john010117
Members-
Posts
492 -
Joined
-
Last visited
Never
Everything posted by john010117
-
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)
-
Can you please post the updated code? From what I can tell about the code you've posted, you don't have $limit defined.
-
Are you echoing the variable?
-
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.
-
Put: if(isset($_POST['send'])) in place of if($_GET['send'])
-
Try using htmlentities() also.
-
"Edit" -> "Go to". I think. Or, use another notepad. Google Programmer's Notepad 2 or Notepad++
-
<?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>
-
Only stylesheets that are embedded in .php files. NOT external stylesheets.
-
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>
-
Of course. Make sure you have different stylesheets for PHP to pick. After all, you can't put variables into stylesheets.
-
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.
-
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.
-
php Squares (aka superbowl squares)
john010117 replied to chiefrokka's topic in Beta Test Your Stuff!
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() -
Good mailserver client to use with Windows and WAMP
john010117 replied to john010117's topic in Miscellaneous
Yes. Thanks. -
Good mailserver client to use with Windows and WAMP
john010117 replied to john010117's topic in Miscellaneous
Oh, I should've added that it's for localhost. Sorry about that. -
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.
-
[SOLVED] Calculate DATE OF BIRTH by given AGE
john010117 replied to john010117's topic in PHP Coding Help
Yes, I'm aware of that fact. Just knowing how old someone is doesn't give you the exact birthdate. -
[SOLVED] Parse error: parse error, unexpected T_ELSE
john010117 replied to refiking's topic in PHP Coding Help
In your original code, I don't see an else statement anywhere. I see an elseif statement, though. -
<?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]) ; ?>
-
[SOLVED] Calculate DATE OF BIRTH by given AGE
john010117 replied to john010117's topic in PHP Coding Help
Ok, thank you both of you. I believe I got it. -
[SOLVED] Calculate DATE OF BIRTH by given AGE
john010117 replied to john010117's topic in PHP Coding Help
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. -
[SOLVED] Calculate DATE OF BIRTH by given AGE
john010117 replied to john010117's topic in PHP Coding Help
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; ?> -
[SOLVED] Calculate DATE OF BIRTH by given AGE
john010117 replied to john010117's topic in PHP Coding Help
So that means I'll have to first SELECT every record from the database and check each record using your method? -
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?