Register Page[PHP & HTML]

Status
Not open for further replies.

Dayron1234

Rapnameiszero,cuzIhavezero,toleranceforidiots
Jun 30, 2010
772
35
Code:
<form method=post action=register.php?action=register name=s>
<table>
<tr><td>Username:</td><td><input type=text name=user></td></tr>
<tr><td>Password:</td><td><input type=text name=pass></td><tr>
<tr><td>E-mail:</td><td><input type=text name=email></td></tr>
<tr><td>Confirm Pass:</td><td><input type=text name=cpass></td><tr>
<tr><td colspan=2 align=center><input type=submit value=Register></td></tr>
</table>
</form>
<?php

//Login to your database
mysql_connect("localhost", "493955_obrienray1", "pass");
mysql_select_db("shadow-cms_zxq_shadow");

//Check the fields please
if ($action == register) {
  
  if (!$user || !$pass || !$email || !$cpass) {
    print "You must fill out all of the fields nub.";

    exit;
    
$username = mysql_num_rows(mysql_query("SELECT * FROM users where user='$user'"));

   if($username > 0) {
     print "Username is taken.";
     
$email = mysql_num_rows(mysql_query("SELECT * FROM users where user='$user'"));

    if($email > 0) {
      print "Someone has taken that email.";
      
      exit;
    }
    
//Check if the passwords are the same please
   if($pass != $cpass) {
     print "The passwords aren't the same nerd.";

     exit;
   }
   
// Do your job by inserting the data
mysql_query("INSERT into users (user, email, pass) values('$user', '$email', '$pass')");
print "You have successfully register. Please wait while we work on the login.";
   }
?>

I get this error:parse error: syntax error, unexpected $end in /www/zxq.net/s/h/a/shadow-cms/htdocs/register.php on line 48

Line 48 is fucking the end of the code ?> like wtf? #palmface#
 

Sledmore

Chaturbate Livestreamer
Staff member
FindRetros Moderator
Jul 24, 2010
5,195
3,906
I'M THE PHP GOD! loljk, you forgot two of theses "}".

PHP:
<form method=post action=register.php?action=register name=s>
<table>
<tr><td>Username:</td><td><input type=text name=user></td></tr>
<tr><td>Password:</td><td><input type=text name=pass></td><tr>
<tr><td>E-mail:</td><td><input type=text name=email></td></tr>
<tr><td>Confirm Pass:</td><td><input type=text name=cpass></td><tr>
<tr><td colspan=2 align=center><input type=submit value=Register></td></tr>
</table>
</form>
<?php

//Login to your database
mysql_connect("localhost", "493955_obrienray1", "starwars1");
mysql_select_db("shadow-cms_zxq_shadow");

//Check the fields please
if ($action == register) {
  
  if (!$user || !$pass || !$email || !$cpass) {
    print "You must fill out all of the fields nub.";

    exit;
    
$username = mysql_num_rows(mysql_query("SELECT * FROM users where user='$user'"));

   if($username > 0) {
     print "Username is taken.";
     
$email = mysql_num_rows(mysql_query("SELECT * FROM users where user='$user'"));

    if($email > 0) {
      print "Someone has taken that email.";
      
      exit;
    }
    
//Check if the passwords are the same please
   if($pass != $cpass) {
     print "The passwords aren't the same nerd.";

     exit;
   }
   
// Do your job by inserting the data
mysql_query("INSERT into users (user, email, pass) values('$user', '$email', '$pass')");
print "You have successfully register. Please wait while we work on the login.";
   }
   }
   }
   
?>
 
Status
Not open for further replies.

Users who are viewing this thread

Top