Jump to content

pocobueno1388

Members
  • Posts

    3,369
  • Joined

  • Last visited

    Never

Everything posted by pocobueno1388

  1. Write to a file http://www.tizag.com/phpT/filewrite.php Working with forms http://www.tizag.com/phpT/forms.php
  2. You could do this with a text document, but depending on the situation you may want to use a database. Is this site going to be ONLY for you, or are multiple people going to be using this? If it's only for a small amount of people, then it would be fine to use a text document if you choose to.
  3. Well, we all know how well IP tracking works...basically it doesn't. It will stop some, but with anyone who knows anything about computers, they will easily bypass this IP check. There really isn't much you can do...just give them a warning that hopefully will scare them, then do random checks on accounts checking for obvious clues for two people being the same person.
  4. Just simply give the session a new value. $_SESSION['var'] = 'new val';
  5. Where is it doubling the results? If your trying to display who is logged in, show us some code.
  6. Google has loads of stuff on this Upload Image http://www.phpfreaks.com/tutorials/36/0.php http://www.tutorialized.com/view/tutorial/Form-Based-Image-Upload/668 Thumbnail http://www.reconn.us/image_thumbnail.html http://www.anyexample.com/programming/php/php_multiple_photo_thumbnail_generator.xml http://www.thecredence.com/how-to-create-image-thumbnails-with-php-using-gd-library/
  7. Post your full code, for some reason your POST values must not be going through.
  8. If he rips you off, SUE HIM! You can sue people for ANYTHING nowadays. Yeah, but you will probably end up paying more in legal fees to sue the person than your actually suing for. Plus, your not even guaranteed to win the case.
  9. Yeah, thats why you have to order the item_id field DESC, so it will show up in reverse.
  10. SELECT * FROM table ORDER BY item_id DESC LIMIT 0,30 I'm pretty sure that will do it
  11. You forgot the '$' on this line files = glob("../images/*.$extension"); Change to $files = glob("../images/*.$extension");
  12. It would help if you posted the code and the exact error. We can't really do much without it.
  13. I'm not sure what you mean by "const", but when you use the function define() you are creating a constant. Only use that if you don't want that value to be changed. www.php.net/define
  14. It would be easier if you told us what you were doing, and what the problem was.
  15. It would be if ($var == 8 || $var == 10 || $var == 12)
  16. I wonder why the echo $query.'<p>'; didn't show up 0_o I'm sure it has something to do with all those LIKE statements in there. I would post your query and error in the MySQL forum. Fenway, Barand or some other super guru will come by and probably correct it in no time.
  17. It should have printed out the darn query... Try putting this: echo $query.'<p>'; $result = mysql_query($query)or die(mysql_error().' ERROR: '.$query);
  18. Okay, change this line $result = mysql_query($query)or die(mysql_error()); To $result = mysql_query($query)or die(mysql_error().$query); Then copy and paste what it prints. In all your queries you had LIKE '$var%' I looked up the syntax for LIKE and they had a percent sign on both sides of the variable...so I changed that. You might be able to do it with the one as well...you might want to change it to one just to make sure, and see if it works.
  19. Okay, try this: EDIT Don't try it yet...hold on. EDIT AGAIN Okay, try it now. <?php include "header.php"; print "Searching usernames is searching all player's BASIC names, not their display names.<p>"; if ($_GET['action'] == "search") { $name=$_POST['username']; $idnumber=$_POST['idnumber']; $acctkind=$_POST['acctkind']; $onstatus=$_POST['onstatus']; if ($acctkind == "Premium") $acctkind=1; if ($acctkind == "normal") $acctkind=0; if ($acctkind == "Doesn\'t Matter") $acctkind=""; if ($onstatus == "Doesn\'t Matter") $query= "select displayname,id from users where basicname LIKE '%$name%' AND id LIKE '%$idnumber%' AND acctkind LIKE '%$acctkind%' ORDER BY id ASC"; else if ($onstatus == "Online") $query= "select displayname,id from users where basicname LIKE '%$name%' AND id LIKE '%$idnumber%' AND acctkind LIKE '%$acctkind%' AND lli > (NOW() - INTERVAL 2 MINUTE)"; else if ($onstatus == "Offline") $query= "select displayname,id from users where basicname LIKE '%$name%' AND id LIKE '%$idnumber%' AND acctkind LIKE '%$acctkind%' AND lli < (NOW() - INTERVAL 2 MINUTE)"; $result = mysql_query($query)or die(mysql_error()); $num = mysql_num_rows($result); if ($num == "0") { print "No matches to your search query."; include "footer.php"; exit; } while ($thing = mysql_fetch_assoc($result)) { print "<a href='userprofiles.php?id={$thing['id']}'>{$thing['displayname']}</a><br>"; } include "footer.php"; exit; } ?> <form method="post" action="searchusers.php?action=search"> Username: <input type="text" name="username"><br> Player ID#: <input type="text" name="idnumber"><br> Account Type: <select name="acctkind"> <option>Doesn't Matter</option> <option>Premium</option> <option>normal</option></select><br> Online/Offline: <select name="onstatus"> <option>Doesn't Matter</option> <option>Online</option> <option>Offline</option> </select><br> <input type="submit" name="submit" value="Search Users"> </form> <?php include "footer.php"; ?>
  20. Have you tried to echo some text between the if ($_GET['action'] == "search") brackets? Maybe your script isn't even reaching that part of the code when you press search.
  21. If you use nl2br() before adding the content to the database, the form can look like your second way. This is paragraph one. This is paragraph two. I'm not sure if there is a better method, but this is how I always do it and it works fine for me.
  22. Before you insert the news content into the database, use nl2br() on it. www.php.net/nl2br
×
×
  • 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.