Skip navigation
Currently Being Moderated

Can I use sessions to solve a problem?

Feb 15, 2012 6:39 PM

Tags: #spry_tabbed_panels #sessions

I have a set of three pages called say "pick", "edit" and "confirm". The edit page is on one of a set of 5 spry tabbed panels.The server is unix and the machine uses windows 64 bit and CS5.5.

Pick uses a drop down list to select an item to edit. It then sends the record index to the edit page where it is edited.

Edit then updates the page and sends the user to the confirm page where he told that the edit was OK and is given a link that takes him back to the edit page.

 

So far everything works fine - the record is edited and the user knows it. But he needs to be able to check it, and that's the problem..

While this link does send the user back to the previous page, it does not send any info as to which record it should pull out.

I have tried to store the value of the record index in a session, but just cannot get it to be available ion the confirm page.

As soon as I enter <?php session_start() ?> on line 1 of any page, I get the message :

Warning: Cannot modify header information - headers already sent on line 1  on the pick page and line  62 on the edit page as soon as a button is pressed, or, in the case of the edit page, as soon as live View is active.

This line is where the page is directed to the next page using a stock Dreamweaver udate record behaviour.:


  $updateGoTo = "editok.php";

  if (isset($_SERVER['QUERY_STRING'])) {

    $updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";

    $updateGoTo .= $_SERVER['QUERY_STRING'];

}header(sprintf("Location: %s", $updateGoTo)); // This is line 62.

 

I have checked all the lines for white space, made sure that the instruction is on line 1 and have no include files other than connection files, all with no white space. Matters not whether I put them before or after the session start instruction.

I even created a new page with just a form and a field to send and this gives the same message - this was not on a spry panel..

PHP ini has the path to sessions set up, and sessions are visible there.

I get the feeling that the tabbed panels could be part of the problem, as when the user lands on the edit page, he has to select the second panel, so some output must have been sent to the browser.and that would kill the session I think?

 

Is there a way of passing the info from page to page without using sessions?

 
Replies
  • Currently Being Moderated
    Feb 16, 2012 11:41 AM   in reply to whatalotofrubbish

    >Is there a way of passing the info from page to page without using sessions?

     

    Sure, you can pass info in the querystring. But, never use the querystring if it will allow a user to access restricted content. For example, you don't want to allow a user to modify the querystring so that they can view content of another user.

     

    >Warning: Cannot modify header information

     

    I'm sure that can be resolved if you post the entire page code.

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 16, 2012 9:44 PM   in reply to whatalotofrubbish

    Are you saving your document as UTF-8 with BOM headers?

    If so, try to save it without BOM...

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points