Jump to content

Caesar

Members
  • Posts

    1,025
  • Joined

  • Last visited

    Never

Everything posted by Caesar

  1. <?php if (preg_match('/MSIE/i',$_SERVER['HTTP_USER_AGENT'])) $h4 = '<h4>You use IE? LOL U SUCK!</h4>'; else $h4 = '<h4>Good for you</h4>'; echo $h4; ?>
  2. Why not keep ANY data from submitting, unless the user inputs a valid date? Maybe I just need to know a little bit more about what you're trying to do....
  3. That isn't the complete line in 111 right?
  4. You really don't want to do it in 100 different PHP pages. Instead, use methods (See OOP) or functions...all within a single PHP page. That being said, it's possible to display anything you want on a conditional basis. What you're asking is basically the basics of if/else 101. Something like.... <?php function loadpage($var) { // Your code here } if($_SESSION['loggedin']) loadpage('members'); else loadpage('login'); ?> There's of course different approaches, techniques...etc. But yes, more than possible.
  5. Can you show us the code where you're setting the session variable in question? Thanks.
  6. The sessions should not be destroyed, unless the browser is being closed, or you probably can't print out the values if you're not initiating the session again in the script/page they are coming back to. If you aren't, then the session variables won't be recognized. session_start()
  7. You can't do it all on the same page. Not using that approach, no. Why not just create a downloadable zip/archive of the files they want and have it as a single download?
  8. Javascript is your friend.
  9. You can always do something like... <?php $img_name = md5(time()).$extension; ?> Not very likely you'll have duplicates unless, the time/date on the server is changed. Edit: I assume you're going to store/log the fact they uploaded an image in your db. So yeah, you store the image name and in the same table, the user id associated with it.
  10. http://subversion.tigris.org/ Word to ya mutha, yo.
  11. So it becomes an issue when your number is negative or less than zero? If I understood you right, try this... <?php //Do this check before your other conditional statements... if($number < 0) $number = 0; if($variable > $number) { //Do the dew man. } ?>
  12. Try using 1-9 (1 through 9) when setting the image quality. It's been a while since I had to use image functions but if I remember, this is different when using ImageCopyResampled() (Which let's you set quality by %).
  13. User accounts with a messages table linked to their id, stored in a MYSQL database would be one approach.
  14. Does your host support dynamic loading? If so, Source Guardian provides the files on their site.
  15. <?php ImageJpeg($ni,$dstFile, $quality); ?> http://us.php.net/manual/en/function.imagejpeg.php
  16. Well, your question wasn't very specific. What exactly are you checking? User input? A record stored in a database? A string? Anyway...assuming it's a string or something manually entered in a form (Bad idea to let people enter dates without forcing the format yourself).... <?php if(!preg_match('/[0-3][0-9]\/[0-1][0-9]\/2[0][0-9][0-9]/', $date) Errors('date'); //Assuming you wrote an Errors() function. else echo 'Email is formatted correctly'; ?>
  17. Where's your login script? In it, do you set a cookie or session variable that contains the user's id or username?
  18. You're not specifying any criteria in your MYSQL query. You're selecting ALL users...since you're not looping through results, it's likely showing the username alphabetically, in descending order.
  19. http://us2.php.net/strip_tags For more info on strip_tags()
  20. <?php $message = htmlspecialchars(strip_tags($_POST['message'])); ?>
  21. Look into Object Oriented Programming (OOP). You may not use it for smaller tasks/scripts but when doing commercial/paid work, it makes more sense. It also encourages clean/organized code and will keep you from using repetitive code.
  22. Even a better idea...CSS: #techcone { font-size: 11px; color: #FF9900; font-family: book antiqua; } <html> <head> <title>More Cowbell</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta name="robot" content="index, follow" /> <link rel="stylesheet" type="text/css" href="style.css" /> </head> <body> <div id="techcone"> The font size, color and font family have been defined in your CSS!! </div> </body> </html> Now....if you are trying to make it dymaic (Your example code isn't clear, as you're using a non HTML tag), you'd use a different method. But you can even use a dynamic style sheet for that as well.
  23. Where's the part where you actually set SESSION variables and assign values to them?
  24. phpBB is using whatever the site/IP is in the settings. To change it to domain, simply login to your phpBB admin and edit the main settings. That's it. Also...not a PHP programming question :-P
×
×
  • 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.