Hi guys I'm using the fotospace.mobi script and get error on registration and I think its not sending the info to the db
My demo: http://fotospace.carlsworld.uni.cc
I can't upload the script I tried not even opera mini or bolt browser allows me to upload it here strange can on other sites...
Anyway here the insertuser.php
Code:
<?php
include("./scripts/header.php");
include('./scripts/outside.inc');
// Strip the requested name from all bad stuff
function is_email($email)
{
return(preg_match("/^[-_.[:alnum:]]+@((([[:alnum:]]|[[:alnum:]][[:alnum:]-]*[[:alnum:]])\.)+(ad|ae|aero|af|ag|ai|al|am|an|ao|aq|ar|arpa|a s|at|au|aw|az|ba|bb|bd|be|bf|bg|bh|bi|biz|bj|bm|bn |bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|c l|cm|cn|co|com|coop|cr|cs|cu|cv|cx|cy|cz|de|dj|dk| dm|do|dz|ec|edu|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|f o|fr|ga|gb|gd|ge|gf|gh|gi|gl|gm|gn|gov|gp|gq|gr|gs |gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|in|info|in t|io|iq|ir|is|it|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr| kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md |mg|mh|mil|mk|ml|mm|mn|mo|mobi|mp|mq|mr|ms|mt|mu|m useum|mv|mw|mx|my|mz|na|name|nc|ne|net|nf|ng|ni|nl |no|np|nr|nt|nu|nz|om|org|pa|pe|pf|pg|ph|pk|pl|pm| pn|pr|pro|ps|pt|pw|py|qa|re|ro|ru|rw|sa|sb|sc|sd|s e|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sy|sz|tc| td|tf|tg|th|tj|tk|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug |uk|um|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|y u|za|zm|zw)|(([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5])\.){3}([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5]))$/i",$email));
}
function strip_name($string)
{
$string = ltrim($string);
$string = ereg_replace(chr(10),"",$string);
$string = ereg_replace("&","",$string);
$string = ereg_replace("<","",$string);
$string = ereg_replace(">","",$string);
$string = ereg_replace("\"","",$string);
$string = ereg_replace("\|","",$string);
$string = ereg_replace("\\\$","",$string);
$curcharlength = strlen($string);
$outstring = $string;
for ($i = 0; $i <= ($curcharlength-1); $i++) {
$curchar = substr ($string,$i,1);
$ochar = ord($curchar);
if ($ochar > 122) {
$new = "" . strtoupper(dechex($ochar)) . "";
$outstring = ereg_replace($curchar,$new,$outstring);
}
if ($ochar < 32)
$outstring = ereg_replace($curchar,"", $outstring);
}
$outstring = ereg_replace("£","", $outstring);
return $outstring;
}
if (empty($HTTP_X_UP_SUBNO))
{
$subno = gethostbyaddr ($REMOTE_ADDR);
}
else {
$subno = $HTTP_X_UP_SUBNO;
}
// Assigns the info to a more memorable (and shorter) name
$pip = $HTTP_X_FORWARDED_FOR;
$agent = $HTTP_USER_AGENT;
// now getting info thats been past on from the last page (im pretty sure that this is not needed
// but lets leave it just in case)
$username = "$username";
$password = "$password";
$email = "$email";
$sex = "$sex";
$username=preg_replace('/[^0-9a-z ]+/i', '', $username);
$username=preg_replace('/[^\w\d\s]+/i', '', $username);
$password=preg_replace('/[^0-9a-z ]+/i', '', $password);
$password=preg_replace('/[^\w\d\s]+/i', '', $password);
// oh look! our first piece of WML!
echo "<p>";
// This checks that the user has entered all reqired info
if (isset($username) && isset($password) && isset($email))
{
// Checks the requested username against those already in the database.//
if ($num_rows_s >0)
{
echo "<b>error</b><br/>$breaker
<br/>sorry, someone else has used that email address!
<br/><a href=\"register.php\">try again?</a><br/>
<a href=\"index.php\">forget it</a><br/>$breaker";
}
// You are a winner! commence with Registermification!!
elseif ($num_rows_s <1)
{
$query_insert = " INSERT INTO forum_users ( username, password, email, subno, origsubno, agent, age, sex, place, joindate, lastactive ) VALUES ( '$username', '$password', '$email', '$subno', '$subno', '$agent', '$age', '$sex', '$place', now(), now())";
$result = mysql_query("$query_insert");
// eeek!! something happend, abort! abort!
if ($result == false)
{
echo "<b>error!</b><br/>$breaker
<br/>sorry, someone else has used that username!
<br/><a href=\"register.php\">try again now?</a><br/>
<a href=\"index.php\">forget it</a><br/>$breaker";
}
// All went well?, GIVE THEM THE GOOD NEWS!!
elseif ($result == true)
{
$query2_insert = " INSERT INTO mail ( userto, author, subject, sentdate, message ) VALUES ( '$username', 'fotospace', 'hello $username!', now(), 'welcome to FotoSpace.mobi, we hope you enjoy your stay. If u need help contact the site owner or any of the admin team.' )";
$result2 = mysql_query("$query2_insert");
echo "You have been registered.<br />Any Illegal Chars have been removed.<br/>Your username is <big><b>$username</b></big> and your password is <big><b>$password</b></big> Please log into your account and have fun. FotoSpace.mobi<br/>$breaker<br/>
<br/><a href=\"index.php\">Go Login Now</a><br/>$breaker";
}
}
}
// Oh, somethings went wrong before it all even started...
else
{
echo "<b>error!</b><br/>
<br/>you can't submit a form if one or more fields is empty, please go <a href=\"./register.php\">back.</a>";
}
echo "</p></body></html>";
?>
Subzero or rider or some1 can u check this coding if its correct...
My demo: http://fotospace.carlsworld.uni.cc
I can't upload the script I tried not even opera mini or bolt browser allows me to upload it here strange can on other sites...
Anyway here the insertuser.php
Code:
<?php
include("./scripts/header.php");
include('./scripts/outside.inc');
// Strip the requested name from all bad stuff
function is_email($email)
{
return(preg_match("/^[-_.[:alnum:]]+@((([[:alnum:]]|[[:alnum:]][[:alnum:]-]*[[:alnum:]])\.)+(ad|ae|aero|af|ag|ai|al|am|an|ao|aq|ar|arpa|a s|at|au|aw|az|ba|bb|bd|be|bf|bg|bh|bi|biz|bj|bm|bn |bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|c l|cm|cn|co|com|coop|cr|cs|cu|cv|cx|cy|cz|de|dj|dk| dm|do|dz|ec|edu|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|f o|fr|ga|gb|gd|ge|gf|gh|gi|gl|gm|gn|gov|gp|gq|gr|gs |gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|in|info|in t|io|iq|ir|is|it|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr| kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md |mg|mh|mil|mk|ml|mm|mn|mo|mobi|mp|mq|mr|ms|mt|mu|m useum|mv|mw|mx|my|mz|na|name|nc|ne|net|nf|ng|ni|nl |no|np|nr|nt|nu|nz|om|org|pa|pe|pf|pg|ph|pk|pl|pm| pn|pr|pro|ps|pt|pw|py|qa|re|ro|ru|rw|sa|sb|sc|sd|s e|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sy|sz|tc| td|tf|tg|th|tj|tk|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug |uk|um|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|y u|za|zm|zw)|(([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5])\.){3}([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5]))$/i",$email));
}
function strip_name($string)
{
$string = ltrim($string);
$string = ereg_replace(chr(10),"",$string);
$string = ereg_replace("&","",$string);
$string = ereg_replace("<","",$string);
$string = ereg_replace(">","",$string);
$string = ereg_replace("\"","",$string);
$string = ereg_replace("\|","",$string);
$string = ereg_replace("\\\$","",$string);
$curcharlength = strlen($string);
$outstring = $string;
for ($i = 0; $i <= ($curcharlength-1); $i++) {
$curchar = substr ($string,$i,1);
$ochar = ord($curchar);
if ($ochar > 122) {
$new = "" . strtoupper(dechex($ochar)) . "";
$outstring = ereg_replace($curchar,$new,$outstring);
}
if ($ochar < 32)
$outstring = ereg_replace($curchar,"", $outstring);
}
$outstring = ereg_replace("£","", $outstring);
return $outstring;
}
if (empty($HTTP_X_UP_SUBNO))
{
$subno = gethostbyaddr ($REMOTE_ADDR);
}
else {
$subno = $HTTP_X_UP_SUBNO;
}
// Assigns the info to a more memorable (and shorter) name
$pip = $HTTP_X_FORWARDED_FOR;
$agent = $HTTP_USER_AGENT;
// now getting info thats been past on from the last page (im pretty sure that this is not needed
// but lets leave it just in case)
$username = "$username";
$password = "$password";
$email = "$email";
$sex = "$sex";
$username=preg_replace('/[^0-9a-z ]+/i', '', $username);
$username=preg_replace('/[^\w\d\s]+/i', '', $username);
$password=preg_replace('/[^0-9a-z ]+/i', '', $password);
$password=preg_replace('/[^\w\d\s]+/i', '', $password);
// oh look! our first piece of WML!
echo "<p>";
// This checks that the user has entered all reqired info
if (isset($username) && isset($password) && isset($email))
{
// Checks the requested username against those already in the database.//
if ($num_rows_s >0)
{
echo "<b>error</b><br/>$breaker
<br/>sorry, someone else has used that email address!
<br/><a href=\"register.php\">try again?</a><br/>
<a href=\"index.php\">forget it</a><br/>$breaker";
}
// You are a winner! commence with Registermification!!
elseif ($num_rows_s <1)
{
$query_insert = " INSERT INTO forum_users ( username, password, email, subno, origsubno, agent, age, sex, place, joindate, lastactive ) VALUES ( '$username', '$password', '$email', '$subno', '$subno', '$agent', '$age', '$sex', '$place', now(), now())";
$result = mysql_query("$query_insert");
// eeek!! something happend, abort! abort!
if ($result == false)
{
echo "<b>error!</b><br/>$breaker
<br/>sorry, someone else has used that username!
<br/><a href=\"register.php\">try again now?</a><br/>
<a href=\"index.php\">forget it</a><br/>$breaker";
}
// All went well?, GIVE THEM THE GOOD NEWS!!
elseif ($result == true)
{
$query2_insert = " INSERT INTO mail ( userto, author, subject, sentdate, message ) VALUES ( '$username', 'fotospace', 'hello $username!', now(), 'welcome to FotoSpace.mobi, we hope you enjoy your stay. If u need help contact the site owner or any of the admin team.' )";
$result2 = mysql_query("$query2_insert");
echo "You have been registered.<br />Any Illegal Chars have been removed.<br/>Your username is <big><b>$username</b></big> and your password is <big><b>$password</b></big> Please log into your account and have fun. FotoSpace.mobi<br/>$breaker<br/>
<br/><a href=\"index.php\">Go Login Now</a><br/>$breaker";
}
}
}
// Oh, somethings went wrong before it all even started...
else
{
echo "<b>error!</b><br/>
<br/>you can't submit a form if one or more fields is empty, please go <a href=\"./register.php\">back.</a>";
}
echo "</p></body></html>";
?>
Subzero or rider or some1 can u check this coding if its correct...
Comment