Jump to content

john010117

Members
  • Posts

    492
  • Joined

  • Last visited

    Never

Everything posted by john010117

  1. Uh oh. Try looking at the file list now in the account that you gave us. Better fix somethings. (I just typed in "><script>" (without quotes)
  2. Can you please post the updated code? From what I can tell about the code you've posted, you don't have $limit defined.
  3. Are you echoing the variable?
  4. You'll need to have a table that has each individual sessions in it, and the script will need to update the database every time a user goes to another page with the page name and the time.
  5. Put: if(isset($_POST['send'])) in place of if($_GET['send'])
  6. Try using htmlentities() also.
  7. "Edit" -> "Go to". I think. Or, use another notepad. Google Programmer's Notepad 2 or Notepad++
  8. <?php header("Content-type: text/css"); ?> /* Rest of your CSS stuff goes here*/ body { background-color: <?php echo $bgcolor; ?> } Save it as something.php and you can call it from another file. That way, you can put variables into external stylesheets. <html> <head> <link href="something.php" rel="stylesheet" type="text/css" /> </head> </html>
  9. Only stylesheets that are embedded in .php files. NOT external stylesheets.
  10. Or you could just embed stylesheets into PHP documents Ex: <html> <head> <title>Style</title> <style type="text/css"> body { background-color: <?php echo $bgcolor; ?> } </style> </head> <body> Hi </body> </html>
  11. Of course. Make sure you have different stylesheets for PHP to pick. After all, you can't put variables into stylesheets.
  12. No problem. If you get stuck on any part of your code, post the relevant part of the code, and we'll be glad to help.
  13. I believed you answered your own question. Let a user submit the color of the page into a database (a simple script should work that part out). Then, whenever that page loads, do a query on the database, and do a simple if/else statement to select the right stylesheet.
  14. Use these two functions on all of your variables ($_POST and $_GET): addslashes() and htmlentities() If you expect a variable to be a number, use the function is_numeric() If the script throws an error when a variable is empty, use the function empty()
  15. Oh, I should've added that it's for localhost. Sorry about that.
  16. Does anyone know of a good, reliable mail client that works with WAMP? I only need a client that can send e-mails (don't need to receive them - need it for websites that I design to send out activation e-mails). Thanks.
  17. Yes, I'm aware of that fact. Just knowing how old someone is doesn't give you the exact birthdate.
  18. In your original code, I don't see an else statement anywhere. I see an elseif statement, though.
  19. <?php $webarray = array("http://www.site1.com", "http://www.site2.com", "http://www.site3.com", "http://www.site4.com" ); $rand = rand(0,sizeof($webarray)); header( 'Location: '.$webarray[$rand]) ; ?>
  20. Ok, thank you both of you. I believe I got it.
  21. Thanks for the link. Hm, then what would be a better way to store date of births? That wouldn't be it because I have date of births stored in the database, not ages.
  22. Hm... I'm not very familiar with doing math inside queries... will it be something like this? (Assuming that "dob" is the field name and $age1 and $age2 are the submitted ages) <?php $query = 'SELECT * FROM users WHERE ' . time() . ' - dob > ' . $age1 . ' AND ' . time() . ' - dob < ' . $age2; ?>
  23. So that means I'll have to first SELECT every record from the database and check each record using your method?
  24. First of all, I've scoured Google, but they only gave me how to calculate age by given birth. I need the opposite. So, here's the thing. I have a pretty simple site that has the basic user database, and a search engine. When a user registers, their date of birth (that they have provided) is converted into a UNIX timestamp and is stored in the database. Now, the search engine is designed so that a user can give a range of ages to search for (ex: can find all users between the ages of 18 to 30). Since I have users' date of birth stored in the database, not their ages, how will I design the script to work? Will converting the given ages to UNIX timestamps first, then using MySQL's "<" and ">" operators to search the database work? Or is there a different way?
×
×
  • 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.