pocobueno1388
Members-
Posts
3,369 -
Joined
-
Last visited
Never
Everything posted by pocobueno1388
-
Write to a file http://www.tizag.com/phpT/filewrite.php Working with forms http://www.tizag.com/phpT/forms.php
-
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.
-
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.
-
Just simply give the session a new value. $_SESSION['var'] = 'new val';
-
Where is it doubling the results? If your trying to display who is logged in, show us some code.
-
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/
-
[SOLVED] mysql_real_escape_string help
pocobueno1388 replied to thewooleymammoth's topic in PHP Coding Help
Post your full code, for some reason your POST values must not be going through. -
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.
-
Yeah, thats why you have to order the item_id field DESC, so it will show up in reverse.
-
SELECT * FROM table ORDER BY item_id DESC LIMIT 0,30 I'm pretty sure that will do it
-
Forgot the dollar sign again
-
You forgot the '$' on this line files = glob("../images/*.$extension"); Change to $files = glob("../images/*.$extension");
-
Game manager with little to no experiance needs help!!!
pocobueno1388 replied to hawk258's topic in PHP Coding Help
It would help if you posted the code and the exact error. We can't really do much without it. -
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
-
Does the file have a .php extension?
-
It would be easier if you told us what you were doing, and what the problem was.
-
It would be if ($var == 8 || $var == 10 || $var == 12)
-
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.
-
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"; ?>
-
[SOLVED] Displaying Text from MySQL
pocobueno1388 replied to Helminthophobe's topic in PHP Coding Help
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. -
[SOLVED] Displaying Text from MySQL
pocobueno1388 replied to Helminthophobe's topic in PHP Coding Help
Before you insert the news content into the database, use nl2br() on it. www.php.net/nl2br