Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Questions and Supports

Notices

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #8  
Old 04-02-2009, 10:39 AM
Tequila's Avatar
Tequila Tequila is offline
The Grim One
 
Join Date: Jan 2009
Location: Souther Tier, New York State
Posts: 1,356
Gender: Female
Credits: 126,048
Tequila is on a distinguished road
Default RE: Integrate script with php safe includes?

New development, working on editing register2.php
Code:
Parse error: syntax error, unexpected T_IF, expecting ',' or ';' in /home/enddayne/public_html/beta/register2.php on line 19
PHP Code:
<?
//Protect the database
$username preg_replace("/[^a-zA-Z0-9\\040.]/"""$username);
$pass1 preg_replace("/[^a-zA-Z0-9s]/"""$pass1);
$pass2 preg_replace("/[^a-zA-Z0-9s]/"""$pass2);
$email preg_replace("/[^a-zA-Z0-9@._-]/"""$email);
$tos preg_replace("/[^a-zA-Z0-9s]/"""$tos);

// Connect to our database

$conn mysql_connect($dbhost$dbuser$dbpass) or die ('Error connecting to mysql database!');
mysql_select_db($dbname);

//Check for errors...
if($username == "" or $pass1 == "" or $pass2 == "" or $email == ""){

echo(
"A required form element was left blank.  Please <a href='register.php'>go back</a> and fill out all the form elements and try again.")

if(
$tos != 'tosyes'){
echo 
"You did not agree to the Terms of Service.  You must agree to the TOS to use this site."

}

if(
$pass1 != $pass2){
echo 
"Your passwords do not match.  Please <a href="register.php">go back</a> and correct this issue."

die();
}

//Check that username does not already exist

$query "SELECT * FROM users WHERE username = '$username'";
$result = @mysql_query($query);
$num = @mysql_numrows($result);

//Loop out code
$i=0;
while (
$i 1) {

$luser=@mysql_result($result,$i,"username");


$i++;
}

$luser strtolower($luser);
$u2 $str strtolower($username);

if(
$luser == $u2){
echo 
"Your username has been taken.  Please <a href="register.php">go back</a> and select a different username."

die();
}

//All checks pass, create the user
$pass1 md5($pass1); //MD5 the password
mysql_query("INSERT INTO users VALUES ('', '$username', '$pass1','$email','free','0')"); 

echo 
"Your account has been created with the username '.$username.'.  <a href="login.php">Click here to log in to your account.</a>"


?>
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Forum Integrate Not Working AlexC Questions and Supports 11 11-26-2013 06:29 AM
How would I integrate Adoptables to a user system? wilfred888 Questions and Supports 5 10-19-2010 04:49 AM
[Lock Please] Account changes Tequila Questions and Supports 6 08-01-2009 02:27 PM


All times are GMT -5. The time now is 10:02 PM.

Currently Active Users: 3350 (0 members and 3350 guests)
Threads: 4,081, Posts: 32,032, Members: 2,016
Welcome to our newest members, jolob.
BETA





What's New?

What's Hot?

What's Popular?


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636