Page 1 of 1

Sign up page does not work correctly.

Posted: Mon Jan 02, 2012 12:24 pm
by austinthompson
Hope I am posting this in the right place. If not. Sorry.

The code I have displays what you see here: http://www.alliwantfor.me/registerUser.php

That is the first problem. There is no way to register because it tells you "Too many requests have been made within the last hour. This feature has been temporarily disabled."

If I delete the part of the code that displays that statement then it appears to work correctly and gives you a form. That form does nothing once submitted. That version is located at: http://www.alliwantfor.me/fix.php

Here is the original code found at: http://www.alliwantfor.me/registerUser.php

Code: [Select]
<?php

$ignoreSession = true;

include "funcLib.php";

$stop = true;
?>

<HTML>

<head>

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

<title>Sign Up </title>

</head>

<BODY>

<table cellspacing="0" cellpadding="5" width="100%" height="100%" bgcolor="#FFFFFF" nosave border="0" style="border: 1px solid rgb(128,255,128)">
<tr>

<td valign="top">
<center>
<?php

if($_REQUEST["fname"] != ""){
if($stop){
return;
}
$fname = convertString($_REQUEST["fname"]);
$lname = convertString($_REQUEST["lname"]);
$suffix = convertString($_REQUEST["suffix"]);
$userid = convertString($_REQUEST["userid"]);
$email = convertString($_REQUEST["email"]);
$comment = convertString($_REQUEST["comment"]);

// send an email out to all the admins
$query = "select * from people where admin=1";
$result = mysql_query($query) or die("Could not query: " . mysql_error());

$to = "";

while($row = mysql_fetch_assoc($result)){
$to .= $row["email"] . ",";
}

$subject = "Request for new WishList account";
$message = "The following person is requesting a new account<p><b>First Name:</b> " . $fname . "<br><b>Last Name:</b> " . $lname ."<br><b>Suffix:</b> " . $suffix . "<br><b>Desired Userid:</b> " . $userid . "<br><b>Email:</b> " . $email . "<br><b>Comment</b><br>" .$comment;

$result = sendEmail($to, "", $subject, $message, 0);

if($result == 1)
print "<h2>Thank you. You should receive an email shortly with your account details</h2>";
else
print "<h1>An unexpected error has occured</h1>";

}
else{
?>
<h2>Welcome to the WishList Site</h2>

<table width=80%><tr><td align=left>

<?php
if($stop){
print "Too many requests have been made within the last hour. This feature has been temporarily disabled.";
return;
}
?>
The following information will be submitted to the administrator of
the WishList Site who will create an account for you. You will
receive an email with your WishList password when the account is
created.

</td></tr></table>
<p>&nbsp;
<form method=post action="registerUser.php">
<table style="border-collapse: collapse;" id="AutoNumber1" border="0" bordercolor="#111111" cellpadding="2" cellspacing="0" bgcolor=lightYellow>

<tr><td colspan="2" align="center" bgcolor="#6702cc">
<font size=3 color=white><b>Please Fill In</b></font>
</td></tr>
<tr>
<td align=right><b>First Name</b></td>
<td><input type=text name=fname size=20></td>
</tr>
<tr>
<td align=right><b>Last Name</b></td>
<td><input type=text name=lname size=20></td>
</tr>
<tr>
<td align=right><b>Suffix</b></td>
<td><input type=text name=suffix size=20></td>
</tr>
<tr>
<td align=right><b>Desired Userid</b></td>
<td><input type=text name=userid size=20></td>
</tr>

<tr>
<td align=right><b>Email</b></td>
<td><input type=text name=email size=40></td>
</tr>

<tr>
<td align=right><b>Comment</b></td>
<td><textarea name=comment rows=3 cols=60 onfocus="this.value=''"></textarea></td>
</tr>

<tr><td align="center" colspan="2" bgcolor="#c0c0c0">
<input type="submit" value="Submit" style="font-weight:bold">

</td></tr>
</table>

</form>

</center>
</td>
</tr>
</table>
</body>
</html>
<?php
}
?>


Here is the code posted at: http://www.alliwantfor.me/fix.php

Code: [Select]
<?php

$ignoreSession = true;

include "funcLib.php";

$stop = true;
?>

<HTML>

<head>

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

<title>Sign Up </title>

</head>

<BODY>

<table cellspacing="0" cellpadding="5" width="100%" height="100%" bgcolor="#FFFFFF" nosave border="0" style="border: 1px solid rgb(128,255,128)">
<tr>

<td valign="top">
<center>
<?php

if($_REQUEST["fname"] != ""){
if($stop){
return;
}
$fname = convertString($_REQUEST["fname"]);
$lname = convertString($_REQUEST["lname"]);
$suffix = convertString($_REQUEST["suffix"]);
$userid = convertString($_REQUEST["userid"]);
$email = convertString($_REQUEST["email"]);
$comment = convertString($_REQUEST["comment"]);

// send an email out to all the admins
$query = "select * from people where admin=1";
$result = mysql_query($query) or die("Could not query: " . mysql_error());

$to = "";

while($row = mysql_fetch_assoc($result)){
$to .= $row["email"] . ",";
}

$subject = "Request for new WishList account";
$message = "The following person is requesting a new account<p><b>First Name:</b> " . $fname . "<br><b>Last Name:</b> " . $lname ."<br><b>Suffix:</b> " . $suffix . "<br><b>Desired Userid:</b> " . $userid . "<br><b>Email:</b> " . $email . "<br><b>Comment</b><br>" .$comment;

$result = sendEmail($to, "", $subject, $message, 0);

if($result == 1)
print "<h2>Thank you. You should receive an email shortly with your account details</h2>";
else
print "<h1>An unexpected error has occured</h1>";

}
else{
?>
<h2>Welcome to the WishList Site</h2>

<table width=80%><tr><td align=left>

The following information will be submitted to the administrator of
the WishList Site who will create an account for you. You will
receive an email with your WishList password when the account is
created.

</td></tr></table>
<p>&nbsp;
<form method=post action="registerUser.php">
<table style="border-collapse: collapse;" id="AutoNumber1" border="0" bordercolor="#111111" cellpadding="2" cellspacing="0" bgcolor=lightYellow>

<tr><td colspan="2" align="center" bgcolor="#6702cc">
<font size=3 color=white><b>Please Fill In</b></font>
</td></tr>
<tr>
<td align=right><b>First Name</b></td>
<td><input type=text name=fname size=20></td>
</tr>
<tr>
<td align=right><b>Last Name</b></td>
<td><input type=text name=lname size=20></td>
</tr>
<tr>
<td align=right><b>Suffix</b></td>
<td><input type=text name=suffix size=20></td>
</tr>
<tr>
<td align=right><b>Desired Userid</b></td>
<td><input type=text name=userid size=20></td>
</tr>

<tr>
<td align=right><b>Email</b></td>
<td><input type=text name=email size=40></td>
</tr>

<tr>
<td align=right><b>Comment</b></td>
<td><textarea name=comment rows=3 cols=60 onfocus="this.value=''"></textarea></td>
</tr>

<tr><td align="center" colspan="2" bgcolor="#c0c0c0">
<input type="submit" value="Submit" style="font-weight:bold">

</td></tr>
</table>

</form>

</center>
</td>
</tr>
</table>
</body>
</html>
<?php
}
?>

Hope this makes sense.

Re: Sign up page does not work correctly.

Posted: Mon Jan 02, 2012 10:28 pm
by austinthompson
Either this is harder than I thought or I asked a really dumb question... lol

Re: Sign up page does not work correctly.

Posted: Tue Jan 03, 2012 1:55 am
by phpHappy
The constant fname isn't defined so this will be true and stop- if($_REQUEST["fname"] != ""){

You didn't post code for funcLib.php - so is sendEmail a function from there? As for the submitted form not doing anything - you didn't post registerUser.php so there is no way to know what is supposed to happen. Edit your post and put code inside of php code tags.