Jump to content

Session Difficulty


sylesia

Recommended Posts

Ok, so I am working on a site where my goal is to use sessions so that I can keep track of people to make sure they logged in and to also carry over information so that I have it page to page.  My issue comes to this, alot of the pages where done in HTML since my partner only knows that, and it made creating the sites alot easier.  Since sessions are only in php, I try to compensate for it by using the Request() function from a php page.  My code looks like this
<?
session_start();
$_SESSION['option'] = 'car';
require("http://localhost/srh/MS_III_Page.html");
?>

the html allows user to select from a drop down box an option, then press submit, sending them to this new page

<?
session_start();

$user = $_Session['option'];

echo $user;
?>

problem is, nothing shows.  I try to echo anything else and it shows, including when I do
echo $_POST['OptionSelected'];
which is in the html file that was read in before directing to this page.  I am so lost, that any help would be so greatly appreciated.
Link to comment
https://forums.phpfreaks.com/topic/28397-session-difficulty/
Share on other sites

Ok, along those same lines, it works for a while, I can go thru a few pages, but than when I submit a form (from html read thru php again), I get this warning

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\Program Files\xampp\htdocs\srh\yellow1.php:1) in C:\Program Files\xampp\htdocs\srh\yellow1.php on line 2

my start php looks like this
<?
session_start();
    $strongDimension = $_POST['StrongDimensions'];
.
.
.
?>

any ideas why it might be giving me such a warning?

I checked my HTML file I read in, and found nothing there that should be a problem.  I read in an HTML file in a php before this one, and the next php has no issues with session_start(), so I do not think its because my HTML outputs
Link to comment
https://forums.phpfreaks.com/topic/28397-session-difficulty/#findComment-129922
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.