Jump to content

blink359

Members
  • Posts

    169
  • Joined

  • Last visited

    Never

Everything posted by blink359

  1. it stands for account type of the private emulators of world of warcraft so 0 = no expansion 8 = the burning crusade expansion 24 = wrath of the lich king expansion
  2. i mucked pretty much everything up on the register page now :'( gonna have to start it again now
  3. But my mysql query is correct the only thing i changed from when it was working was $result = mysql_query("INSERT INTO `accounts` VALUES ('', '$user', '$pass2', '', '', '0', '9', '', '', '$flag', 'enUS', '0', '0', null)") where it says $flag it used to be 24 which is one of the possible values from my radio buttons which is: Pre TBC<input type="radio" name="flag" value="0" /> TBC Enabled<input type="radio" name="flag" value="8" /> WOTLK Enabled<input type="radio" name="flag" value="24" />
  4. Right ive solved my last problem but when i got to make an account it now says Error: (1136) Column count doesn't match value count at row Here is my code: <!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"> <!-- #apDiv1 { position:absolute; left:9px; top:336px; width:1144px; height:40px; z-index:1; } body,td,th { color: #FFFFFF; } body { background-color: #000000; } #apDiv2 { position:absolute; left:13px; top:417px; width:934px; height:1657px; z-index:1; } #apDiv3 { position:absolute; left:32px; top:32px; width:593px; height:101px; z-index:2; } .style1 { font-size: xx-large } --> </style> </head> <body> <div id="apDiv2"> <?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; } 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()); } } ?> <?php if ($success == false) { echo $problemMessage; } ?> <center><form method="post" action=""> 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" /> TBC Enabled<input type="radio" name="flag" value="8" /> WOTLK Enabled<input type="radio" name="flag" value="24" /> <input name="Submit" type="submit" value="submit" /> <imput name="reset" type="reset" value="reset" /> </form></center> </h1></div> <div id="apDiv3"> <h1 class="style1">Server Name Goes here</h1> </div> <p><img src="Images/Image2.jpg" width="1143" height="321" /></p> <p><a href="index.html"><img src="Images/Home.jpg" width="150" height="50" /></a><a href="phpbb3/index.php"><img src="Images/Forums.jpg" width="150" height="50" /></a><a href="Register.php"><img src="Images/Create.jpg" width="250" height="50" /></a><a href="vote.php"><img src="Images/Vote.jpg" width="150" height="50" /></a><a href="donate.html"><img src="Images/Donate.jpg" width="150" height="50" /></a></p> <p> </p> </body> </html>
  5. Oh i see i think: HTML = Pre TBC<input type="radio" name="flag" value="0" /> TBC Enabled<input type="radio" name="flag" value="8" /> WOTLK Enabled<input type="radio" name="flag" value="24" /> PHP = $flag = $_POST['flag']; Then for mysql Query $result = mysql_query("INSERT INTO `accounts` VALUES ('', '$user', '$pass2', '', '', '0', '9', '', '', '$flag', 'enUS', '0', '0', null)")
  6. Still confused about what i need to do to get the 0 or 8 or 24 included in the mysql query depending on what radio button they used
  7. So whats the php code to make the radio boxes put the values into the mysql query?
  8. can i do it so they tick the boxes for there account type if so whats the php so that i give the radio boxes or dropdown values so pre tbc is worth 0 if its put into mysql query tbc is worth 8 if its put into mysql query wotlk is worth 24 if ts put into mysql query and then i put in the mysql query where it goes '$none OR $tbc OR $wotlk",
  9. So jons that would work right?
  10. Im trying to make the values get put into the mysql statement here $result = mysql_query("INSERT INTO `accounts` VALUES ('6', '$user', '$pass2', '', '', '0', '9', '', '', 'VALUES GO HERE', 'enUS', '0', '0', null)") so i could use Pre TBC<input type="radio" name="pretbc" value="0"> 0<br> TBC Enabled<input type="radio" name="tbc" value="8"> 8<br> Wotlk Enabled<input type="radio" name="wotlk" value="24"> 24<br> and before the ifs with $user = $_POST['user']; $pass = $_POST['pass']; $pass2 = $_POST['pass2'] do $none = $_POST['none'']; $tbc = $_POST['tbc']; $wotlk = $_POST['wotlk'];; so $result = mysql_query("INSERT INTO `accounts` VALUES (; '6', '$user', '$pass2', '', '', '0', '9', '', '', '$none OR $tbc OR $wotlk', 'enUS', '0', '0', null)") ;
  11. Could i do something like $_POST['user']; $result = mysql_query("INSERT INTO `accounts` VALUES ('6', '$user', '$pass2', '', '', '0', '9', '', '', '$_POST['none'] OR $_POST['tbc'] OR $_POST['wotlk']', 'enUS', '0', '0', null)") and before the ifs do $_POST['none'] = "0"; $_POST['tbc'] = "8"; $_POST['wotlk'] = "24";
  12. Ok thanks for that but any chance for the code to make tbc work 8 wotlk worth 24 and none checked worth 0?
  13. I have 2 checkboxes in my form i want it so only one can be ticked at a time i need it when tbc box is checked its worth the value 8 if wotlk is checked its worth the value 24 and if none are check its worth the value 0 can anyone help me on 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"> <!-- #apDiv1 { position:absolute; left:9px; top:336px; width:1144px; height:40px; z-index:1; } body,td,th { color: #FFFFFF; } body { background-color: #000000; } #apDiv2 { position:absolute; left:13px; top:417px; width:934px; height:1657px; z-index:1; } #apDiv3 { position:absolute; left:32px; top:32px; width:593px; height:101px; z-index:2; } .style1 { font-size: xx-large } --> </style> </head> <body> <div id="apDiv2"> <?php $dbhost = "DBHOST"; $dbuser = "DBUSER"; $dbpass = "DBPASS"; $dbname = "DBNAME"; mysql_connect($dbhost, $dbuser, $dbpass); mysql_select_db($dbname); $user = $_POST['user']; $pass = $_POST['pass']; $pass2 = $_POST['pass2']; $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; } if ($success) { echo "Valid New Account Entry<br />"; $result = mysql_query("INSERT INTO `accounts` VALUES ('6', '$user', '$pass2', '', '', '0', '9', '', '', '24', 'enUS', '0', '0', null)") or die("Error: (" . mysql_errno() . ") " . mysql_error()); } } ?> <?php if ($success == false) { echo $problemMessage; } ?> <center><form method="post" action=""> 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> The burning Crusade: <inputname="tbc" type="checkbox"/><br> Wrath of the lich king: <inputname="wotlk" type="checkbox"/><br> <input name="Submit" type="submit" value="submit" /> <imput name="reset" type="reset" value="reset" /> </form></center> </h1></div> <div id="apDiv3"> <h1 class="style1">Server Name Goes here</h1> </div> <p><img src="Images/Image2.jpg" width="1143" height="321" /></p> <p><a href="index.html"><img src="Images/Home.jpg" width="150" height="50" /></a><a href="phpbb3/index.php"><img src="Images/Forums.jpg" width="150" height="50" /></a><a href="Register.php"><img src="Images/Create.jpg" width="250" height="50" /></a><a href="vote.php"><img src="Images/Vote.jpg" width="150" height="50" /></a><a href="donate.html"><img src="Images/Donate.jpg" width="150" height="50" /></a></p> <p> </p> </body> </html>
  14. Where exactly sorry im new to PhP
  15. Hey all i have script and when they submit through the vote button i want it to take them to a site can some one show me the code to do it here is my php script <?php $unixts = date("U"); $unix_12hours = date("U") - (12*60*60); $dbhost = "127.0.0.1"; //database host goes here $dbuser = "your_user"; //database user goes here $dbpass = "your_password"; //database password goes here $dbname = "world"; //database name goes here mysql_connect($dbhost, $dbuser, dbpass); mysql_select_db($dbname); $user = mysql_real_escape_string($_POST['user']); $success = true; $problemMessage = "Cannot connect to mysql server"; if (isset($_POST['Submit'])) { if(!$user); { $problemMessage .= "Please enter your account name <br />"; $success = false; } if ($success) { $sql = "SELECT COUNT(*) as `total_users` FROM `accounts` WHERE `lastvote` <= $unix_12hours AND `username` = $user LIMIT 1;"; $result = mysql_query($sql); $row = mysql_fetch_assoc($result); if ($row['total_users'] == 1){ echo ("Thanks for voting!"); mysql_query("INSERT INTO mailbox_insert_queue VALUES('$user','$user','Thanks for voting','Thanks for voting for our server please take this token as a thank you from our staff Thanks from the Sinister WoW team','61','0','1234500','1')"); //1234500 is the id for our token mysql_query("UPDATE `users` SET `last_voted` = $unixts WHERE `username` = '$user' LIMIT 1;"); } else{ $problemMessage = "You have voted in the past 12 hours"; } } } ?> <html> <head> <title>Voting Page</title> </head> <body> <form> Username: <input name="user" type="text"/><br> <input name="Submit" type="submit" value="Vote" /> </form> </body> </html> if you can add it into this code where it should go that would be great just make it go to google.com for now thanks
  16. Just to check what parts i need to edit as im pretty new and i dont wanna muck it up
  17. Hey thanks jonsjava so i just need to use that script and it will work then ?
  18. a timer that doesnt let them have the mysql query done more than once every 12 hours so the mysql queery only sends them one thing untill 12 hours has passed and they vote again
  19. Hey i was wondering how to put a timer on my php script i also need it to make a popup when they click "vote" here is my PhP script so far i am relitavely new to PhP aswell <?php $dbhost = "127.0.0.1"; //database host goes here $dbuser = "your_user"; //database user goes here $dbpass = "your_password"; //database password goes here $dbname = "world"; //database name goes here mysql_connect($dbhost, $dbuser, dbpass); mysql_select_db($dbname); $user = $_POST['user']; $success = true; $problemMessage = "Cannot connect to mysql server"; if (isset($_POST['Submit']) { if(!$user); { $problemMessage .= "Please enter your account name <br />"; $success = false; } if ($success) { echo ("Thanks for voting!") { mysql_query("INSERT INTO mailbox_insert_queue VALUES('$user','$user','".Thanks for voting."','".Thanks for voting for our server please take this token as a thank you from our staff Thanks from the Sinister WoW team."','61','0','1234500','1')"); //1234500 is the id for our token ?> <html> <head> <title>Voting Page</title> </head> <body> <form> Username: <input name="user" type="text"/><br> <input name="Submit" type="submit" value="Vote" /> </form> </body> </html>
×
×
  • 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.