Help with PHP Registration!

Any problem with PHP can be disscused here
Post Reply
TheCrymsonLegends
Posts: 1246
Joined: Wed Feb 16, 2005 6:59 am

Help with PHP Registration!

Post 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!!


Reached 5000 Credits! The highest of any member on Smokyhosts! New milestone for Me!
Lixas
Posts: 750
Joined: Wed Feb 16, 2005 4:21 pm

Post 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!!
Image
TheCrymsonLegends
Posts: 1246
Joined: Wed Feb 16, 2005 6:59 am

Post 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.

Image

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]
Reached 5000 Credits! The highest of any member on Smokyhosts! New milestone for Me!
ELRocco
Posts: 46
Joined: Sun Feb 20, 2005 3:19 am
Contact:

Post 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
TheCrymsonLegends
Posts: 1246
Joined: Wed Feb 16, 2005 6:59 am

Post 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 :)
Reached 5000 Credits! The highest of any member on Smokyhosts! New milestone for Me!
ELRocco
Posts: 46
Joined: Sun Feb 20, 2005 3:19 am
Contact:

Post by ELRocco »

well im not that person i give up its way out of my abilities
Post Reply