This is located in a page of its and its job is to store a few values as sessions and go back to where it came from, then these values can be recalled elsewhere on the site. Their purpose is to be used as filtering criteria in an SQL code.
The problem is that the values aren't saved, nomatter what I try I can't save the values. How do I properly store values and recall them elsewhere?
Those who beat their swords into plowshares will plow for those who did not.
You where right that session_start(); wasn't there in the other file, stupid misstake but anyway it broke the code. I am modifying an existing opensource code. Anyway I switched to cookies:
<?php
setcookie("specificYear", $_POST['specificYear'], time()+604800); /* Expires in a week */
setcookie("specificMake", $_POST['specificMake'], time()+604800); /* Expires in a week */
setcookie("specificModel", $_POST['specificModel'], time()+604800); /* Expires in a week */
//print $_COOKIE['specificYear'];
header("Location: /shop/catalog/index.php?cPath=1");
?>
Now the print cookie code works when viewing it in the page that sets it, but after the redirect I cannot call it up with the same code in the other page.
Those who beat their swords into plowshares will plow for those who did not.
Destructionator XIII wrote:(Also a potential pitfall: make sure there are no new lines before or after the <?php ?> in both files - it messes up session handling too, as I recently learned the hard way.)
I just didn't get sessions to work quite simply. And putting session_start(); at the beginning of the page the code was supposed to return to after entering the session values simply made the page blank, I am not sure if OSCommerce (I am modifying this software to filter products based on vehicle properties) has sessions on or if it breaks because of it, at any rate it seems like a giant task to check out all the code and files considering I started coding in php this monday.
Those who beat their swords into plowshares will plow for those who did not.