Jump to content

ChidoriSoul

Members
  • Content Count

    151
  • Joined

  • Last visited

Everything posted by ChidoriSoul

  1. I'm not like super bad as having no experience at all, I do have some experience using Javascript for Proxy Blocking, javascript stopping, etc. I just didn't know how to "move" an image/slide an image across a div/background image.
  2. Thats the thing, I'm pretty basic with Javascript, I was just hoping someone will give me something to start with, as I have previously stated, I am bad at Javascript.
  3. So, as of now, I'm trying to make a Javascript map so that a character image can be placed on it, and the person who is controlling the character can use their arrow keys to navigate through the map. I've heard this can be done, but if at any possibilty, is it possible to make it so that some parts of the "map" image can not be put on, like a house or something.
  4. EDIT: Nevermind, I fixed it.
  5. Well, accoreding to JSG's advice, it was true, in the net tab, the page was loading twice. Now, I have no idea how to fix this, anyone have any ideas?
  6. Its nothing to do with the database, as I empty the users table before each test, but the error I previously stated was that:It inserts the user, but then says that the name is already in use. What my main concern is how to got through the scan, inserted, but then went through again, giving the error.
  7. I did what you said, boen_robot, but it still says that the name is in use. $q1 = mysql_query("SELECT * FROM `users` WHERE `name`='$User'");$c1 = mysql_num_rows($q1);$query3 = mysql_query ("SELECT * FROM `users` WHERE `email`='$Email'");$result3 = mysql_num_rows($query3);if($c1 >= 1) {echo "This name is already in use.";}elseif($result3 >= 1) {echo "This email is already in use.";} I think it may be something with my AJAX :/
  8. No, either of your methods did not work, and I do the ".$var." because I was taught to "escape" the variable to make it function easier in queries and echos.
  9. Alright, so I'm doing a pure dynamic AJAX site, and i've been on a register script for 2 days now, and for some reason, something about it makes it weird.The Script: <?phpsession_start();require('require/connect.php');require('require/clean_code.php');$name = safe($_GET['user']);if(isset($_GET['user'])) {$pass = safe($_GET['pass']);$email = safe($_GET['email']);$gender = safe($_GET['gender']);$class = safe($_GET['type']);if($name=='') {echo "Please enter a name.";}elseif($pass=='') {echo "Please enter a password.";}elseif($email=='') {echo "Please enter an email.";}elseif($gender != "Male" && $gender != "Female") {echo "Please choose a legit gender.";}elseif($class != "Warrior" && $class != "Mage") {echo "Please choose a legit class.";}else {$q = mysql_query("SELECT * FROM `users` WHERE `name`='".$name."'");$c = mysql_num_rows($q);$q1 = mysql_query("SELECT * FROM `users` WHERE `email`='".$email."'");$c2 = mysql_num_rows($q1);if($c > '0') {echo "This name is already in use.";}elseif($c1 > '0') {echo "This email is already in use.";}else {$pass2 = sha1($pass);mysql_query("INSERT INTO `users` (`name`, `pass`, `email`, `type`, `gender`) VALUES ('".$name."', '".$pass2."', '".$email."', '".$class."', '".$gender."')") or die(mysql_error());echo "You have successfuly registered, ".$name.".";}}}else {?><head><script type='text/javascript' src='require/jquery.js'></script><script type='text/javascript' src='require/main.js'></script><script type='text/javascript'>function function1() {var user = window.document.reg.user.value;var pass = window.document.reg.password.value;var email = window.document.reg.email.value;var gender = window.document.reg.gender.value;var class = window.document.reg.class.value;var url = "reg.php?user=" + user + "&pass=" + pass + "&email=" + email + "&gender=" + gender + "&type=" + class + "";loadlink(url);}</script></head>TestRegister<form name='reg' onsubmit='return function1();'><table width='98%' style='border: 1px solid black;' valign='top' align='center'><tr><td width='30%' style='border: 1px solid black;'>Username</td><td width='70%' style='border: 1px solid black;'><input type="text" name="user"></td></tr><tr><td width='30%' style='border: 1px solid black;'>Password</td><td width='70%' style='border: 1px solid black;'><input type="password" name="password"></td></tr><tr><td width='30%' style='border: 1px solid black;'>Email</td><td width='70%' style='border: 1px solid black;'><input type="text" name="email"></td></tr><tr><td width='30%' style='border: 1px solid black;'>Gender</td><td width='70%' style='border: 1px solid black;'><select name="gender"><option value="Male">Male</option><option value="Female">Female</option></select></td></tr><tr><td width='30%' style='border: 1px solid black;'>Class</td><td width='70%' style='border: 1px solid black;'><select name="class"><option value="Warrior">Path Of Swordsmen</option><option value="Mage">Guidance Of Magician</option></select></td></tr><tr><td width='30%' colspan='2' style='border: 1px solid black;'><input type='submit' name='submit' value='Register!' onclick='function1();'></td></tr></table></form><?php}?> If you tried this, it would be successful, but it would say that the username is already registered, so it really lies. Can someone point out the error on this AJAX/PHP?
  10. Never mind, it was one of my codes that was redirecting.
  11. There is no way, you have to hold the user information somewhere to tell your site which user is which, but don't use cookies, they are very easily hackable and can lead to scammers getting account information without passwords, which is why I say use sessions.:]
  12. So, I have my site.It recently got hacked so it redirects to the index page no matter which page you go toI finally sorted all of that out, and it took me like 2.5 hours.I then realized that I had not put session_start() on my starting template page.I put it there and update, and it comes back, so I remove it, and the site is perfectly fine, so has anyone else had a problem like this, and does anyone know how to fix it?My site is here.
  13. So the better way would to be to use both?
  14. Just making some security for my site, and wondering which way is better, htmlspecialchars or mysql_real_escape_string, or both?
  15. Ok, thank you, the error is now gone, but what I am really looking for is how to get the ending there so it gives each user a specific profile.
  16. IT does, but I get this error: Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/www/pokemonplanet.awardspace.info/view_profile.php on line 12 Line 12 is : Print "$array['name']";
  17. Hey! I am trying to create a view_profile system, and I am having a bit of trouble making where it says:view_profile.php?id=1I need to figure out how to make the ending where it shows the information based on the user information on the link.Can anyone help me?
  18. ChidoriSoul

    Update + Add

    Hello. I am currently trying to run a site where you can randomly find some "credits" on the ground.I am currently trying to make a system where a user finds them, then it adds a set amount (5) to a field in my database. So if a user has 100 credits, then goes on the page, he/she would now have 105. Anyone to help me with this?
  19. Ok, so I changed that to one, but now, it is not changing depeding on how many times I visit the page, it always adds the Darkrai.Oh, and it also messes up the footer, not sure why :/
  20. Thank you very much JSG. Now, even though my row shows that it is at 2 in the field (2 = get, else = not), it still takes me to the I already have it page. <?phpsession_start();?><html><!--[if IE]> <link rel="stylesheet" type="text/css" href="allie.css" /><![endif]--><center><head><?php include('head.php'); ?></head><body><?phprequire_once('db.php');$promosession = $_SESSION["user_id"];$querypromo = mysql_query("SELECT * FROM `users` WHERE `id` = '".$promosession."'");$promo = mysql_fetch_array($querypromo);$query = mysql_query("SELECT `got_promo` FROM `users` WHERE `id`='".$promosession."'");if (mysql_num_rows($query) == 2) {$name = Darkrai;$owner = $_SESSION['user_name'];$position = 1;$query = mysql_query("INSERT INTO pokemon (pokemon_id, name, owner, picture, icon, position) VALUES ('', '$name','$owner','<img src=\'images/sprites/darkrai.png\' alt=\'darkrai\' />','<img src=\'http://www.pokemonelite2000.com/sprites/dpiconani/dpiconani491.gif\' alt=\'darkraicon\' />','$position')");echo "<div id='container'> <div id='banner'></div> <div id='frame'> <div id='leftmenu'><div style='padding: 3px;'> <?php include('menuin.php'); ?> </div></div> <div id='content'><div style='padding: 3px;'> <center><u>Promo!</u><br/><table border='1' width='100%'><tr><th>Current Promo</th></tr><tr><td width='100%' style='text-align: center'>The current Promotional Pokemon is <b>Darkrai</b>!</td></tr><tr><td width='100%' style='text-align: center'><img src='images/sprites/darkrai.png' alt='darkrai' /></td></tr><tr><td width='100%' style='text-align: center'><font color='red'>You have just obtained the Current Promotional Pokemon: <b>Darkrai</b>!</td></tr></table> <br/><br/><script type='text/javascript'><!--google_ad_client = 'pub-4468899317544238';/* Pokemon Planet Ads */google_ad_slot = '7415068260';google_ad_width = 468;google_ad_height = 60;//--></script><script type='text/javascript' src='http://pagead2.googlesyndication.com/pagead/show_ads.js'></script></div></div> <?php include('rightmenuin.php'); ?> </div></div></div> <div id='footer'><font color='#000000'>Pokemon Planet is © 2009 by Shadow. This site is created and coded by Shadow. Pokemon Planet is in no way affiliated with Nintendo, Pokémon Company, Game Freak, Creatures, or any related organizations. Most Pokémon images (sprites, icons, map tiles, etc.) are © Nintendo and their publishers. Images are slightly modified in order to meet certain needs upon this website.</font></div></div>";$query = mysql_query("UPDATE `users` SET got_promo='2' WHERE `id` = '".$_SESSION['user_id']."'");}else {echo "<div id='container'> <div id='banner'></div> <div id='frame'> <div id='leftmenu'><div style='padding: 3px;'> <?php include('menuin.php'); ?> </div></div> <div id='content'><div style='padding: 3px;'> <center><u>Promo!</u><br/><table border='1' width='100%'><tr><th>Current Promo</th></tr><tr><td width='100%' style='text-align: center'>The current Promotional Pokemon is <b>Darkrai</b>!</td></tr><tr><td width='100%' style='text-align: center'><img src='images/sprites/darkrai.png' alt='darkrai' /></td></tr><tr><td width='100%' style='text-align: center'><font color='red'>You have already obtained a <b>Darkrai!</b></td></tr></table> <br/><br/><script type='text/javascript'><!--google_ad_client = 'pub-4468899317544238';/* Pokemon Planet Ads */google_ad_slot = '7415068260';google_ad_width = 468;google_ad_height = 60;//--></script><script type='text/javascript' src='http://pagead2.googlesyndication.com/pagead/show_ads.js'></script></div></div> <div id='rightmenu'><div style='padding: 3px;'> <?php include('rightmenuin.php'); ?> </div></div></div> <div id='footer'><center><font color='#000000'>Pokemon Planet is © 2009 by Shadow. This site is created and coded by Shadow. Pokemon Planet is in no way affiliated with Nintendo, Pokémon Company, Game Freak, Creatures, or any related organizations. Most Pokémon images (sprites, icons, map tiles, etc.) are © Nintendo and their publishers. Images are slightly modified in order to meet certain needs upon this website.</font></center></div></div>";$query = mysql_query("UPDATE `users` SET got_promo='2' WHERE `id` = '".$_SESSION['user_id']."'");}?></body></html>
  21. Ok, I removed my code, edited your in to match mine, but it still Updates my profile but does not give me a Darkrai, whats up?My Code: <?phpsession_start();?><html><!--[if IE]> <link rel="stylesheet" type="text/css" href="allie.css" /><![endif]--><center><head><?php include('head.php'); ?></head><body><?phprequire_once('db.php');$promosession = $_SESSION["user_id"];$querypromo = mysql_query("SELECT * FROM `users` WHERE `id` = '".$promosession."'");$promo = mysql_fetch_array($querypromo);$query = "SELECT `id` FROM `users` WHERE `id`='".$promosession."'";$result = mysql_query($query);if (mysql_num_rows($result) == 0) {$name = Darkrai;$owner = $_SESSION['user_name'];$position = 1;$query = mysql_query("INSERT INTO pokemon (pokemon_id, name, owner, picture, icon, position) VALUES ('', '$name','$owner','<img src=\'images/sprites/darkrai.png\' alt=\'darkrai\' />','<img src=\'http://www.pokemonelite2000.com/sprites/dpiconani/dpiconani491.gif\' alt=\'darkraicon\' />','$position')");echo "<div id='container'> <div id='banner'></div> <div id='frame'> <div id='leftmenu'><div style='padding: 3px;'> <?php include('menuin.php'); ?> </div></div> <div id='content'><div style='padding: 3px;'> <center><u>Promo!</u><br/><table border='1' width='100%'><tr><th>Current Promo</th></tr><tr><td width='100%' style='text-align: center'>The current Promotional Pokemon is <b>Darkrai</b>!</td></tr><tr><td width='100%' style='text-align: center'><img src='images/sprites/darkrai.png' alt='darkrai' /></td></tr><tr><td width='100%' style='text-align: center'><font color='red'>You have just obtained the Current Promotional Pokemon: <b>Darkrai</b>!</td></tr></table> <br/><br/><script type='text/javascript'><!--google_ad_client = 'pub-4468899317544238';/* Pokemon Planet Ads */google_ad_slot = '7415068260';google_ad_width = 468;google_ad_height = 60;//--></script><script type='text/javascript' src='http://pagead2.googlesyndication.com/pagead/show_ads.js'></script></div></div> <?php include('rightmenuin.php'); ?> </div></div></div> <div id='footer'><center><font color='#000000'>Pokemon Planet is © 2009 by Shadow. This site is created and coded by Shadow. Pokemon Planet is in no way affiliated with Nintendo, Pokémon Company, Game Freak, Creatures, or any related organizations. Most Pokémon images (sprites, icons, map tiles, etc.) are © Nintendo and their publishers. Images are slightly modified in order to meet certain needs upon this website.</font></center></div></div>";}else {echo "<div id='container'> <div id='banner'></div> <div id='frame'> <div id='leftmenu'><div style='padding: 3px;'> <?php include('menuin.php'); ?> </div></div> <div id='content'><div style='padding: 3px;'> <center><u>Promo!</u><br/><table border='1' width='100%'><tr><th>Current Promo</th></tr><tr><td width='100%' style='text-align: center'>The current Promotional Pokemon is <b>Darkrai</b>!</td></tr><tr><td width='100%' style='text-align: center'><img src='images/sprites/darkrai.png' alt='darkrai' /></td></tr><tr><td width='100%' style='text-align: center'><font color='red'>You have already obtained a <b>Darkrai!</b></td></tr></table> <br/><br/><script type='text/javascript'><!--google_ad_client = 'pub-4468899317544238';/* Pokemon Planet Ads */google_ad_slot = '7415068260';google_ad_width = 468;google_ad_height = 60;//--></script><script type='text/javascript' src='http://pagead2.googlesyndication.com/pagead/show_ads.js'></script></div></div> <div id='rightmenu'><div style='padding: 3px;'> <?php include('rightmenuin.php'); ?> </div></div></div> <div id='footer'><center><font color='#000000'>Pokemon Planet is © 2009 by Shadow. This site is created and coded by Shadow. Pokemon Planet is in no way affiliated with Nintendo, Pokémon Company, Game Freak, Creatures, or any related organizations. Most Pokémon images (sprites, icons, map tiles, etc.) are © Nintendo and their publishers. Images are slightly modified in order to meet certain needs upon this website.</font></center></div></div>";$query = mysql_query("UPDATE `users` SET got_promo='1' WHERE `id` = '".$_SESSION['user_id']."'");}?></body></html>
  22. I am having a problem with my Promo page, where I want it to show if the user has already received the promo, and do not run the script, and if they have not, run the script. The page is located here. My code is this: <?phpsession_start();?><html><!--[if IE]> <link rel="stylesheet" type="text/css" href="allie.css" /><![endif]--><center><head><?php include('head.php'); ?></head><body><?phprequire_once('db.php');$promosession = $_SESSION["user_id"];$querypromo = mysql_query("SELECT * FROM `users` WHERE `id` = '".$promosession."'");$promo = mysql_fetch_array($querypromo);$query = mysql_query("SELECT `got_promo` FROM `users` WHERE `id` = '".$promosession."'");if($query == 0) {$name = Darkrai;$owner = $_SESSION['user_name'];$position = 1;$query = mysql_query("INSERT INTO pokemon (pokemon_id, name, owner, picture, icon, position) VALUES ('', '$name','$owner','<img src=\'images/sprites/darkrai.png\' alt=\'darkrai\' />','<img src=\'http://www.pokemonelite2000.com/sprites/dpiconani/dpiconani491.gif\' alt=\'darkraicon\' />','$position')");echo "<div id='container'> <div id='banner'></div> <div id='frame'> <div id='leftmenu'><div style='padding: 3px;'> <?php include('menuin.php'); ?> </div></div> <div id='content'><div style='padding: 3px;'> <center><u>Promo!</u><br/><table border='1' width='100%'><tr><th>Current Promo</th></tr><tr><td width='100%' style='text-align: center'>The current Promotional Pokemon is <b>Darkrai</b>!</td></tr><tr><td width='100%' style='text-align: center'><img src='images/sprites/darkrai.png' alt='darkrai' /></td></tr><tr><td width='100%' style='text-align: center'><font color='red'>You have just obtained the Current Promotional Pokemon: <b>Darkrai</b>!</td></tr></table> <br/><br/><script type='text/javascript'><!--google_ad_client = 'pub-4468899317544238';/* Pokemon Planet Ads */google_ad_slot = '7415068260';google_ad_width = 468;google_ad_height = 60;//--></script><script type='text/javascript' src='http://pagead2.googlesyndication.com/pagead/show_ads.js'></script></div></div> <?php include('rightmenuin.php'); ?> </div></div></div> <div id='footer'><center><font color='#000000'>Pokemon Planet is © 2009 by Shadow. This site is created and coded by Shadow. Pokemon Planet is in no way affiliated with Nintendo, Pokémon Company, Game Freak, Creatures, or any related organizations. Most Pokémon images (sprites, icons, map tiles, etc.) are © Nintendo and their publishers. Images are slightly modified in order to meet certain needs upon this website.</font></center></div></div>";}else {echo "<div id='container'> <div id='banner'></div> <div id='frame'> <div id='leftmenu'><div style='padding: 3px;'> <?php include('menuin.php'); ?> </div></div> <div id='content'><div style='padding: 3px;'> <center><u>Promo!</u><br/><table border='1' width='100%'><tr><th>Current Promo</th></tr><tr><td width='100%' style='text-align: center'>The current Promotional Pokemon is <b>Darkrai</b>!</td></tr><tr><td width='100%' style='text-align: center'><img src='images/sprites/darkrai.png' alt='darkrai' /></td></tr><tr><td width='100%' style='text-align: center'><font color='red'>You have already obtained a <b>Darkrai!</b></td></tr></table> <br/><br/><script type='text/javascript'><!--google_ad_client = 'pub-4468899317544238';/* Pokemon Planet Ads */google_ad_slot = '7415068260';google_ad_width = 468;google_ad_height = 60;//--></script><script type='text/javascript' src='http://pagead2.googlesyndication.com/pagead/show_ads.js'></script></div></div> <div id='rightmenu'><div style='padding: 3px;'> <?php include('rightmenuin.php'); ?> </div></div></div> <div id='footer'><center><font color='#000000'>Pokemon Planet is © 2009 by Shadow. This site is created and coded by Shadow. Pokemon Planet is in no way affiliated with Nintendo, Pokémon Company, Game Freak, Creatures, or any related organizations. Most Pokémon images (sprites, icons, map tiles, etc.) are © Nintendo and their publishers. Images are slightly modified in order to meet certain needs upon this website.</font></center></div></div>";$query = mysql_query("UPDATE `users` SET got_promo='1' WHERE `id` = '".$_SESSION['user_id']."'");}?></body></html>
  23. ChidoriSoul

    Money

    Yes, that is what I I am asking for, I know I need the Update Code, but on the code from w3schools.com, it only shows that you can add it once, but I need to it everytime you see it, it will add the select amount of coins, updating your currency each time.
×
×
  • Create New...