Page 1 of 1
Help with PHP Registration!
Posted: Thu Feb 24, 2005 7:05 am
by TheCrymsonLegends
Heh I need to know how to change the Registration Form on PHP. I can change things about the Registration Process but I can't change the Form!!
Ex:
User Name: [__________]
Password:[__________}
Retype:
Added Blocks:
Combat Level:
Magic Level:
Prayer Level:
[ For my game of course.. I want to add these things so I can tell if they meet my clan requirements!!
Posted: Thu Feb 24, 2005 7:09 am
by Lixas
This source should be in filename called "reg.php"
Code: Select all
<?
$reg = 0;
if (isset($T1)&&isset($T4)&&isset($T5)&&isset($T6)&&isset($T7)&&$T4==$T5)
if ($T1 != ""&&$T4 != ""&&$T6 != ""&&$T7 != "")
if (yra("table_name", "nick", $T1)==0){
$q = mysql_query("INSERT INTO table_name (nick, name, surname, password, email, ) VALUES ('$T1','$T6','$T7','$T4','$T8')");
if ($q) $reg = 1;
}else $reg = 2;
?>
<?
if (yra("table_name", "nick", $T1)!=0) $klaida = "Login is taken. Please choose other ";
if ($reg == 2)
echo "<p align='center' class='bmeniu'>There is mistakes in registration form. $klaida[url=reg.php]Try again[/url]</p>";
if ($reg == 1)
echo "<p align='center' class='bmeniu'>Cangratulation. Now you are registered member'</p>";
if ($reg == 0){ ?>
<form method="POST" action="">
<div align="center">
[align=center]
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="200" id="AutoNumber1">
<tr>
<td><p align="center" class="meniu">Login:
<p align="center" class="meniu"><input type="text" name="T1" size="20" style="font-size: 8pt; font-family: Verdana"></td>
</tr>
<tr>
<td><p align="center" class="meniu">password (twice)</span>
<p align="center" class="meniu"><input type="password" name="T4" size="20" style="font-size: 8pt; font-family: Verdana"></p>
<p align="center" class="meniu"><input type="password" name="T5" size="20" style="font-size: 8pt; font-family: Verdana"></td>
</tr>
<tr>
<td><p align="center" class="meniu"><span lang="lt">name</span>
<p align="center" class="meniu"><input type="text" name="T6" size="20" style="font-size: 8pt; font-family: Verdana"></td>
</tr>
<tr>
<td><p align="center" class="meniu"><span lang="lt">surname</span>
<p align="center" class="meniu"><input type="text" name="T7" size="20" style="font-size: 8pt; font-family: Verdana"></td>
</tr>
<tr>
<td><p align="center" class="meniu"><p align="center" class="meniu"><span lang="lt">email:</span>
<p align="center" class="meniu"><input type="text" name="T8" size="20" style="font-size: 8pt; font-family: Verdana"></td>
</tr>
<tr>
<td><p align="center" class="meniu"><input type="submit" value="Register" name="B1" style="font-size: 8pt; font-family: Verdana"></td>
</tr>
</table>
[/align]
</div>
<p align="center"></p>
</form>
<?}?>
</div>
</td>
This source should be in function file
Code: Select all
<?
function mysqlc(){
$server = 'localhost';
$user1 = 'user';
$pass1 = 'pass';
$database = db_name';
mysql_connect($server, $user1, $pass1);
mysql_select_db($database);
}
function yra($table, $cell, $value){
$q = mysql_query("select * from $table where `$cell` = '$value'");
$n = mysql_num_rows($q);
return $n; //if $n==0 then this nick is free, else nick is not free
}
Maybe you will find out how it works, and here is chekning function "yra()" that checks is there such registered "nick" or no, If no such nick- then it returns that such nick doesn't exist in database
Do not forget in "reg.php" ta place include to your functions file and connect to your db
Code: Select all
<?include("functions_file_name.php");
mysqlc();?>
I guess that now will be easier to find out, how it works, because i have edited my post and traslated source in english
If you will not understand something, ask me in pm or here!!
Posted: Wed Mar 02, 2005 8:23 pm
by TheCrymsonLegends
He was unable to help me because he didn't understand quite what I was asking. So I brought a picture to demonstrate! I also need help with putting the Google Search into my Forums Header and my Site Footer! I am dualing to my host! I don't need the google search bars but I find them rather useful lol. Can someone give me the exact location in the Header.php and Footer.php to put them? Thank you.
Here is the picture I hope it works.
I hope this helps in understanding what I am needing. I don't want someone to spam saying look at this site and ask them for help, if you can direct me somewhere that is useful and can help me ( a noobie at php ) I would greatly appritiate it. Thank you for wasting your time to help me!

[/img]
Posted: Thu Mar 03, 2005 3:31 pm
by ELRocco
thats gonna be a really hard script because it invoes editing many sql databases and editing major php file im not gonna try rihg now but ill give it a shot later
Posted: Thu Mar 03, 2005 8:16 pm
by TheCrymsonLegends
I know, I have Technocrat from Technocrat.com, he said he might work on it. Then another guy said he might work on it, I know there is alot of things that must be worked on because everyone who I have talked to said they would do it but it would take time, so I am just finding the person who will do the best job and won't let me down

Posted: Fri Mar 04, 2005 2:13 am
by ELRocco
well im not that person i give up its way out of my abilities