Jump to content

pocobueno1388

Members
  • Posts

    3,369
  • Joined

  • Last visited

    Never

Everything posted by pocobueno1388

  1. Does that solve your problem? If so, please mark the thread as solved.
  2. You need to make a datetime field in your users table called something like "last_active". Then on your header page (so the code is called every time they click) you need to put a query that updates that field to the current date/time (you can use the function NOW() to do that). Now to get the current users that have been active in the last 5 minutes, your query would look like this. SELECT username FROM users WHERE last_active > (NOW() - INTERVAL 5 MINUTE)
  3. Your missing a parenthesis in your if statement. Also, you should use isset(). if(!isset($_POST['uploaded'])){ echo "no file being uploaded"; }
  4. rand() is not going to choose anything that isn't in your table, so you will always have a result.
  5. Try this <img src="image.php?photo=1" width=100>
  6. Hmm...I'm not a huge meat eater, but If I had to choose something it would be glazed ham. Love or Money haha
  7. Just because you have a nice car doesn't mean your rich. I use to know a guy that drove a very expensive car, and he lived in a garbage dump because all his money was going towards the car. Febreeze, and I really don't have an explanation to why...they are both pretty much the same thing. So whichever one is cheaper Coffee Or Tea
  8. I love Windows Media Player, and it works fine for everything I need...so I will have to go with that one =] Nice Car or Nice House
  9. Here is a nice class you can download that will allow you to do this http://htmlpurifier.org/
  10. Instead of using just "login.php" as the location, try using the full path. ex header("Location: http://www.yoursite.com/login.php");
  11. Try this code and post what it returns <?php class userquery { //This Fucntion Is Used To Check Weather User as an Admin has Been Logged in or Not function admin_login_check() { $userid = $_COOKIE['userid']; $username = $_COOKIE['username']; $session = $_COOKIE['PHPSESSID']; $query = mysql_query("SELECT * FROM admin WHERE username = '".$username."' AND session = '".$session."'"); if (mysql_num_rows($query) == 1) { $login = true; echo "QUERY 1: The redirect wont' work because your num_rows is equal to 1."; } else { $query = mysql_query("SELECT * FROM users WHERE level='".$admin."' AND username ='".$username."' AND userid = '".$userid."' AND session='".$session."'"); if (mysql_num_rows($query) == 1) { $login = true; echo "QUERY 2: Your redirect won't work becuase your query is returning 1."; } else { echo "...Hopefully you don't get this message"; header('location: login.php'); } } } ?>
  12. What do you mean until it found one that matched? What are you trying to match?
  13. Try this <?php $user = $_SESSION['user']; $SID = $_SESSION['SID']; $query = "SELECT username FROM candidate WHERE user ='$user' AND site ='$SID'"; $result = mysql_query($query)or die(mysql_error()); $num = mysql_num_rows($result); //will be either 0 if its not there or more than zero if it is if($num > 0) { //checks for an entry echo "There are $num results"; } else { echo "Thank You your Application has been submitted you can track your application through your account"; } ?> Tell us what it says.
  14. Connect to the DB http://www.tizag.com/mysqlTutorial/mysqlconnection.php Everything else you need to know is on that site as well. www.w3schools.com is a good site to learn from too.
  15. I do see an error in your query, but also you need to always use mysql_error() $query = "SELECT username, site FROM table WHERE user = '$user' AND site ='$site'"; $result = mysql_query($query)or die(mysql_error());
  16. $sql = "UPDATE ucp_users SET ucp_game_credits=ucp_game_credits+$newamount WHERE ucp_id='". $_SESSION['uid']."'";
  17. Do you have a URL we can go to so we can look at it? Also, post your code.
  18. I honestly don't see a difference 0_o
  19. Try to catch the error by changing the query line to this $result = mysql_query($query)or die(mysql_error());
  20. Yes, that should work. If you would rather keep the formmail script separate, you can just use an include. so right where you have that comment, just put this code include "formmail.php"; //or whatever that file is called
  21. You only need one form action. Here is an example <?php //check if they pressed the submit button if (isset($_POST['submit'])){ //put upload code here //put email code here } ?> If you don't understand that, post your code and we can help you put it together.
  22. I've never even heard of "Hot Toddy", so I will have to go with hot chocolate Treadmill Or Running Outside
  23. You can't store an image in the database, so of course you are going to have to put it in a folder. All you have to do is store the filename of the image in the database, then you will know exactly what image goes with which row. So to display the images from the database, you would just do this. <?php echo "<img src='path_to_images/".$row['filename']."'>"; ?>
  24. Use substr() <?php $number = "5588 3207 2678 6726"; $last_four = substr($number, -4); echo $last_four; //prints "6726" ?>
×
×
  • 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.