Jump to content

Sign up script stop working?


newt

Recommended Posts

Ok, Basically a few years ago I coded a login system..I've kept it on a external drive for like 2 years, then I finally got it off it to revise the script to use it in a website im developing.. But now when i went to test the script...it just refreshes the page, but when i tested it when i made it, it use to work and I haven't touched the code what so ever..Since i fail to see the problem with it can any1 else try to fix it?

 

<?php

session_start();

include "dbconnect.php";

?>

<html>

<head>

<link rel="stylesheet" type="text/css" href="nelsonstyle.css">

<title>newt</title>

</head>

<body bgcolor="#000000">

<?php

$query18 = "SELECT * FROM `proinfo` LIMIT 1";

$result11 = mysql_query($query18, $dbconnect);

if(mysql_num_rows($result11) > 0)

{

while($row3 = mysql_fetch_array($result11))

{

if($row3[closed] == '2')

{

echo '<font color="#FFCC00">Updates are currently being made, please come back later.</font>';

session_unregister("valid_user");

}

else

{

if (!$entry == 'save')

{echo '

<font size=+6 face="Verdana, Arial, Helvetica, sans-serif" color=#FFCC00><u>Sign Up</u></font>

<form action=?entry=save method=post>

<font color=#FFCC00>Username<br>

<input type=text name=username2><br>

Password<br>

<input type=password name=password2><br>

 

<input type=submit value="Sign up!">

</font>

</form>

';

$empty = '';

}

else

{

if($username2 == $empty || $password2 == $empty)

{

echo '<font color=#FFCC00>Please enter something! <a href=signup.php>Try again</a>';

$entry = 'no';

}

else

{

$query19 = "SELECT * FROM `promembers` WHERE `username` = '$username2' LIMIT 1";

$result12 = mysql_query($query19, $dbconnect);

if(!mysql_num_rows($result12) > 0)

{

echo '<font color=#FFCC00>Thank you for joining! <a href=login.php>Login</a>';

$username2 = eregi_replace(" ", "_", $username2);

$query5 = "INSERT INTO `promembers` ( `id` , `username` , `password` , `admin` , `lvl` , `race` , `weapon` , `armor` , `money` , `bank` , `location1` , `location2` , `lastloc1` , `lastloc2` , `exp` , `nextlvl` , `Health` , `MaxHealth` , `monhealth` )

VALUES ('0', '$username2', '$password2', '1', '1', '$race', 'Fists', 'Rags', '0', '0', '1', '1', '1', '1', '0', '200', '100', '100', '0'

)";

mysql_query($query5, $dbconnect);

$date = date("l dS of F Y h:i:s A");

$query5 = "INSERT INTO `promail` VALUES ('0', '$date', 'Thank you for joining , If you need some help email me at [email protected] - Newt.<br>', 'Newt', '$username2', '2')";

mysql_query($query5, $dbconnect);

}

else

{echo '<font color=#FFCC00>Username has been taken. <a href=signup.php>Try Again</a>';}

}}}}}

?>

</body>

</html>

Link to comment
https://forums.phpfreaks.com/topic/152875-sign-up-script-stop-working/
Share on other sites

The code is dependent on register_globals, so all the variables from the form are no longer magically being set. The session variables are also no longer magically being set. Register_globals were turned off by default 7 year ago and have been completely removed in php6.

 

It you set error_reporting to E_ALL and set display_errors to ON, you will get errors that will help point out what variables are no longer magically getting set.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.