PHP code did not create a cookie and it did not changed the background and text color
Initially, the code load the page, and default the background and text color to white. I then select a different background and text color, and I clicked the submit button. The page refreshes but the background and text color was not changed, and it never created a cookie on my PC.
On IE 6.0, I set the cookies option to prompt I selected Tools --> Internet Options --> Privacy --> Advanced --> set the First-Party Cookies to prompt ================================= Code:
<?PHP |
Use the global arrays to check for values instead.
These are $_POST, $_GET, $_REQUEST, $_SESSION, etc. For example, to get the value from a post form use $_POST['NewBGColor']. ($_GET for get forms or just use $_REQUEST which checks them all). Code:
if(isset($_POST['BeenSubmitted'])) { |
Yep the above code is correct :), well its'
the new feature they have added in php4 and above you better check out the version of php you are using and check out its' documentation. |
Yeah, i should've mentioned that the original code is "correct", but some configurations (and new versions) of php don't automatically set the variables ($NewBGColor from $_POST['NewBGColor']) so it's best to use the new method instead. :)
|
reply
Thank you everyone for your help.
The function setcookie("TextColor", "$NewTextColor"); did not put a cookie into my PC. Is the statement with $_POST is from version 3 or version 4 ? $BGColor = $_POST['NewBGColor']; |
i think its' from version 4
thats' what i know :) |
All times are GMT -5. The time now is 12:35 PM. |