Jump to content

blink359

Members
  • Posts

    169
  • Joined

  • Last visited

    Never

Everything posted by blink359

  1. <?php $dbhost = "localhost"; $dbuser = "nathan"; $dbpass = "your_password"; $dbname = "logon"; mysql_connect($dbhost, $dbuser, $dbpass); mysql_select_db($dbname); $user = $_POST['user']; $pass = $_POST['pass']; $character = $_POST['character']; if(!$user || !$pass || !$character) { $problemMessage = "Please fill in all required fields"; $success = false; } if($success) { $result = mysql_query("SELECT acct FROM accounts WHERE login = '".$account."' AND password = '".$password."'") or die(mysql_error()); $numrows = mysql_num_rows($result); } else { die("Account name or password is incorrect"); } $result = mysql_query("update characters SET positionX = 16237, positionY = 16396, positionZ = 60, mapId = 1, zoneId = 0, deathstate = 0 WHERE name = '".$character."'") or die(mysql_error()); $numrows = mysql_num_rows($result); echo "Character '".$character."' has been unstuck!"; mysql_close(); ?> <html> <head> <title>Auto Unstucker</title> </head> <body> <center> <form name=myform method=post action='unstucker.php'> <center><h1>Character Unstucker</h1></center> Account Name:<input type=text name=account value=''><br> Character Name:<input type=text name=character value=''><br> Password:<input type=password name=password value=''><br> <br><input type=submit name=submit value=Unstuck><br> </form> </body> </html> its now just die("Account name or password is incorrect");
  2. } $result = mysql_query("update characters SET positionX = 16237, positionY = 16396, positionZ = 60, mapId = 1, zoneId = 0, deathstate = 0 WHERE name = '".$character."'"); or die(mysql_error()); $numrows = mysql_num_rows($result); } Parse error: syntax error, unexpected T_LOGICAL_OR in /var/www/nathan/unstuck.php on line 24
  3. { $result = mysql_query("SELECT acct FROM accounts WHERE login = '".$account."' AND password = '".$password."'"); or die(mysql_error()); $numrows = mysql_num_rows($result); }
  4. Thanks for that thats fixed that now ive got a Parse error: syntax error, unexpected T_LOGICAL_OR in /var/www/nathan/unstuck.php on line 17
  5. <?php include("config.php"); mysql_connect($dbhost, $dbuser, $dbpass); mysql_select_db($dbname); $user = $_POST['user']; $pass = $_POST['pass']; $character = $_POST['character']; if(!$user || !$pass || !$character) { $problemMessage = "Please fill in all required fields"; $success = false; } if($success) { $result = mysql_query "SELECT acct FROM accounts WHERE login = '".$account."' AND password = '".$password."'" or die(mysql_error()); $numrows = mysql_num_rows($result); } else { die("Account name or password is incorrect"); } $result = mysql_query "update characters SET positionX = 16237, positionY = 16396, positionZ = 60, mapId = 1, zoneId = 0, deathstate = 0 WHERE name = '".$character."'" or die(mysql_error()); echo "Character '".$character."' has been unstuck!"; mysql_close(); ?> <html> <head> <title>Auto Unstucker</title> </head> <body> <center> <form name=myform method=post action='unstucker.php'> <center><h1>Character Unstucker</h1></center> Account Name:<input type=text name=account value=''><br> Character Name:<input type=text name=character value=''><br> Password:<input type=password name=password value=''><br> <br><input type=submit name=submit value=Unstuck><br> </form> </body> </html> still Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /var/www/nathan/unstuck.php on line 16
  6. Nothing happens
  7. The error is: Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /var/www/nathan/unstuck.php on line 16 from my form: <?php include("config.php"); mysql_connect($dbhost, $dbuser, $dbpass); mysql_select_db($dbname); $user = $_POST['user']; $pass = $_POST['pass']; $character = $_POST['character']; { if(!$user || !$pass || !$character) { $problemMessage = "Please fill in all required fields"; $success = false; } if($success); { $result = mysql_query "SELECT acct FROM accounts WHERE login = '".$account."' AND password = '".$password."'"; or die(mysql_error()); $numrows = mysql_num_rows($result); } else { die("Account name or password is incorrect"); } $result = mysql_query "update characters SET positionX = 16237, positionY = 16396, positionZ = 60, mapId = 1, zoneId = 0, deathstate = 0 WHERE name = '".$character."'" or die(mysql_error()); echo "Character '".$character."' has been unstuck!"; mysql_close(); ?> <html> <head> <title>Auto Unstucker</title> </head> <body> <center> <form name=myform method=post action='unstucker.php'> <center><h1>Character Unstucker</h1></center> Account Name:<input type=text name=account value=''><br> Character Name:<input type=text name=character value=''><br> Password:<input type=password name=password value=''><br> <br><input type=submit name=submit value=Unstuck><br> </form> </body> </html>
  8. Ah i sorta edited one of my other scripts
  9. <?php $dbhost = "localhost"; $dbuser = "nathan"; $dbpass = "your_password"; $dbname = "logon"; mysql_connect($dbhost, $dbuser, $dbpass); mysql_select_db($dbname); $user = $_POST['user']; $pass = $_POST['pass']; $flag = $_POST['flag']; $success = true; $problemMessage = ""; if(!$user || !$pass || !$flag) { $problemMessage = "Please fill in all required fields"; $success = false; } else { $query = "SELECT acct FROM accounts WHERE login = '".$user."' AND password = '".$pass."';"; $result = mysql_query($query) or die(mysql_error()); $numrows = mysql_num_rows($result); echo "<tr><td align=center>"; if($newpass != $newpass2) { die("Your new passwords did not match"); } if($numrows == 0) { die("Invalid account name or password!"); } $query = "UPDATE accounts SET flags = '".$flag."' WHERE login = '".$user."';"; $result = mysql_query($query) or die(mysql_error()); echo "Your expansion settings has been changed"; } ?> <html> <head> <title>Expansion Settings</title> </head> <body> <form method="POST" action=""> Expansion Settings<br> Username: <input name="user" type="text"/> <br> Password: <input name="pass" type="text"/> <br> Pre TBC <input type="radio" name="flag" value="0"> <br> TBC Enabled <input type="radio" name="flag" value="8"> <br> Wotlk Enabled <input type="radio" name="flag" value="24"> <br> <input type=submit name=submit value=Submit> </form> </body> </html>
  10. Still doesnt change anything in the DB
  11. my form isnt submitting into the database please help <?php $dbhost = "localhost"; $dbuser = "nathan"; $dbpass = "your_password"; $dbname = "logon"; mysql_connect($dbhost, $dbuser, $dbpass); mysql_select_db($dbname); $user = $_POST['user']; $pass = $_POST['pass']; $flag = $_POST['flag']; $success = true; $problemMessage = ""; if(!$user || !$pass || !$flag) { $problemMessage = "Please fill in all required fields"; $success = false; } else { $query = "SELECT acct FROM accounts WHERE login = '".$user."' AND password = '".$pass."';"; $result = mysql_query($query) or die(mysql_error()); $numrows = mysql_num_rows($result); echo "<tr><td align=center>"; if($newpass != $newpass2) { die("Your new passwords did not match"); } if($numrows == 0) { die("Invalid account name or password!"); } $query = "UPDATE accounts SET flags = '".$flag."' WHERE login = '".$user."';"; $result = mysql_query($query) or die(mysql_error()); echo "Your expansion settings has been changed"; } ?> <html> <head> <title>Expansion Settings</title> </head> <body> Account Creation Page<br> Username: <input name="user" type="text"/> <br> Password: <input name="pass" type="text"/> <br> Pre TBC <input type="radio" name="flag" value="0"> <br> TBC Enabled <input type="radio" name="flag" value="8"> <br> Wotlk Enabled <input type="radio" name="flag" value="24"> <br> <input type=submit name=submit value=Submit> </body> </html>
  12. Problem is Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /var/www/nathan/testreg.php on line 156 This line: $row = mysql_fetch_array( $result );
  13. Its ment to put information into a table called accounts with there username $user password $pass and there account type 0 8 or 24 which is there choice $flag
  14. I dont know whats wrong but somethings wrong with this <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <style type="text/css"> <!-- .style1 {font-size: small} #apDiv1 { position:absolute; left:37px; top:210px; width:169px; height:30px; z-index:1; } body { background-color: #999999; } .cssnav { position: relative; font-family: arial, helvetica, sans-serif; background: url(images/overbtn.jpg) no-repeat; white-space: nowrap; display: block; width: 250px; height: 50px; margin: 0; padding: 0; } .cssnav a { display: block; color: #000000; font-size: 11px; width: 250px; height: 50px; display: block; float: left; color: black; text-decoration: none; } .cssnav img { width: 250px; height: 50px; border: 0 } * html a:hover { visibility:visible } .cssnav a:hover img { visibility:hidden } .cssnav span { position: absolute; left: 53px; top: 15px; margin: 0px; padding: 0px; cursor: pointer; width: 250px; } .style4 {font-size: 16px} --> </style> </head> <body> <center><table width="80%" border="1"> <tr> <th height="186" colspan="5" align="left" valign="top" scope="row"><img src="Images/logo2.jpg" width="944" height="215" /></th> </tr> <tr> <th width="25%" rowspan="2" align="left" valign="top" scope="row"><h2> <div class="cssnav"><a href="index.html" title="Search Engine Optimization"><img src="images/downbtn.jpg" alt="Search Engine Optimization" /><span class="style4">Home</span></a></div> <div class="cssnav"><a href="register.php" title="Search Engine Submission"><img src="images/downbtn.jpg" alt="Search Engine Submission" /><span class="style4">Create Account</span></a></div> <div class="cssnav"><a href="phpbb3/index.php" title="Website Design"><img src="images/downbtn.jpg" alt="Website Design" /><span class="style4">Forums</span></a></div> <div class="cssnav"><a href="vote.php" title="Website Promotion"><img src="images/downbtn.jpg" alt="Website Promotion" /><span class="style4">Vote</span></a></div> <div class="cssnav"><a href="donate.html" title="Google"><img src="images/downbtn.jpg" alt="Google" /><span class="style4">Donate</span></a></div> <br /> </h2> </th> <td colspan="3" rowspan="3" valign="top"> <center><form method="post" action=""> <p> <?php $dbhost = "localhost"; $dbuser = "nathan"; $dbpass = "your_password"; $dbname = "logon"; mysql_connect($dbhost, $dbuser, $dbpass); mysql_select_db($dbname); $user = $_POST['user']; $pass = $_POST['pass']; $pass2 = $_POST['pass2']; $flag = $_POST['flag']; $success = true; $problemMessage = ""; if (isset($_POST['Submit'])) { if(!$user || !$pass || !$pass2) { $problemMessage .= "Please complete all required data <br />"; $success = false; } if(strlen($user) < 5) { $problemMessage .= "User must be more that 5 characters <br />"; $success = false; } if(strlen($user) > 20) { $problemMessage .= "Your username cannot be longer than 20 characters <br />"; $success = false; } if($pass != $pass2) { $problemMessage .= "Your passwords do not match <br />"; $success = false; } if(strlen($pass2) < 5) { $problemMessage .= "Your password must be more than 5 characters<br />"; $success = false; } if(strlen($pass2) > 20) { $problemMessage .= "Your password cannot be longer than 20 characters <br />"; $success = false; } $result = mysql_query("SELECT * FROM `accounts` where username='$user';") or die("Error: (" . mysql_errno() . ") " . mysql_error()); if(isset(!$result)) { $problemMessage .= "The username already exists <br />"; $success = false; } if ($success) { echo "Valid New Account Entry<br />"; $result = mysql_query("INSERT INTO `accounts` VALUES ('', '$user', '$pass2', '', '', '0', '9', '', '', '$flag', 'enUS', '0', '0', null);") or die("Error: (" . mysql_errno() . ") " . mysql_error()); } $row = mysql_fetch_array( $result ); // Print out the contents of the entry ?> <?php if ($success == false) { echo $problemMessage; } ?> Account Creation Page<br> Username: <input name="user" type="text"/> <br> Password: <input name="pass" type="text"/> <br> Repeat Password: <input name="pass2" tpye="text"/> <br /> Pre TBC <input type="radio" name="flag" value="0"> <br> TBC Enabled <input type="radio" name="flag" value="8"> <br> Wotlk Enabled <input type="radio" name="flag" value="24"> <br> <input name="Submit" type="submit" value="submit" /> </p> <imput name="reset" type="reset" value="reset" /> </form></center></td> <td width="22%" height="114">Login to forums</td> </tr> <tr> <td height="129" valign="top"><p class="style1">Donate now to keep our server up</p> <p class="style1"><a href="http://www.paypal.com"><img src="Images/Paypal.png" width="207" height="87" /></a></p></td> </tr> <tr> <th height="224" valign="top" scope="row"><br /></th> <td><p> </p> </td> </tr> <tr> <th height="33" colspan="5" scope="row"> </th> </tr> </table> </center> </body> </html> Pasted from Mibbit ajax IRC client, on 26-Apr-2009 10:53:29 UTC
  15. Nevermind now i have managed to make the script i want work now thanks all for time and work
  16. BTW thanks tooner and everyone else im a bit tierd this morning and didnt notice lol
  17. Still need help heres new PhP code <?php $dbhost = "localhost"; //change this to your DB host $dbuser = "User"; //change this to your DB username $dbpass = "pass"; //change this to your DB password $dbname = "logon"; //change this to your DB name for your account info mysql_connect($dbhost, $dbuser, $dbpass); mysql_select_db($dbname); $user = $_POST['user']; $pass = $_POST['pass']; $newpass = $_POST['newpass']; $newpass2 = $_POST['newpass2']; $success = true; $problemMessage = ""; if (isset($_POST['Submit'])) { if(!$user || !$pass || !$newpass || !$newpass2) { $problemMessage .= "Please fill in all required fields <br />"; $success = false; } if(strlen($newpass < 5) { $problemMessage .= "Your new password must be longer than 5 characters <br />"; $success = false; } if(strlen($newpass > 20) { $problemMessage .= "Your new password must be shorter than 20 characters <br />"; $success = false; } if($newpass != $newpass2) { $problemMessage .= "Your new passwords do not match <br />"; $success = false; } if ($success) { echo "Your passwords have been changed! <br />"; $result = mysql_query("UPDATE accounts SET password = '$newpass' WHERE login = '$user' AND password = '$pass'"); or die("Error: (" . mysql_errno() . ") " . mysql_error()); } } ?> <html> <head> <title>Password Change</title> </head> <body> <form> <input name="user" type="text"/> <br> Password: <input name="pass" type="password"/> <br> New Password: <input name="newpass" type="password"/> <br> Repeat New Password: <input name="newpass2" tpye="password"/> <br /> <input name="Submit" type="submit" value="submit" /> <imput name="reset" type="reset" value="reset" /> </form> </body> </html>
  18. In fact i may have found the script would this work? mysql_query("UPDATE accounts SET password = '$newpass' WHERE login = '$user' AND password = '$pass'");
  19. else { list($dbPass) = mysql_fetch_row($res); if ($pass !== $dbPass) { $errors[] = "Incorrect password"; } why does $pass have to be equal to $dbpass?
  20. $res = mysql_query("UPDATE accounts SET password='{$newpass}' WHERE username='{$user}'"); what if someone knows there user can we do something like $res = mysql_query("UPDATE accounts SET password='{$newpass}' WHERE username='{$user}' AND WHERE password ='{$pass}'");
  21. Hey i was wondering how to make a password changing script ive done most of the PhP and have just got a bit stuck on the query heres what i have so far <?php $dbhost = "localhost"; //change this to your DB host $dbuser = "User"; //change this to your DB username $dbpass = "pass"; //change this to your DB password $dbname = "logon"; //change this to your DB name for your account info mysql_connect($dbhost, $dbuser, $dbpass); mysql_select_db($dbname); $user = $_POST['user']; $pass = $_POST['pass']; $newpass = $_POST['newpass']; $newpass2 = $_POST['newpass2']; $success = true; $problemMessage = ""; if (isset($_POST['Submit'])) { if(!$user || !$pass || !$newpass || !$newpass2) { $problemMessage = "Please fill in all required fields <br />"; $success = false; } if(strlen($newpass < 5) { $problemMessage = "Your new password must be longer than 5 characters <br />"; $success = false; } if(strlen($newpass > 20) { $problemMessage = "Your new password must be shorter than 20 characters <br />"; $success = false; } if($newpass != $newpass2) { $problemMessage = "Your new passwords do not match <br />"; $success = false; } For the query i started guessing that it could be something like if ($success) { echo "Your passwords have been changed! <br />"; $result = mysql_query(UPDATE 'accounts' WHERE 'username' = $user AND 'password' = $pass Can someone please help thanks!
  22. Where abouts should i write that as earlier i tried doing echo "$flag" and it didnt like where i typed it
  23. If this helps ive got my page hosted http://81.100.51.145/nathan/register.php please ignore the picture problem
×
×
  • 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.