If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > simple session question

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-28-03, 22:37
noamkrief noamkrief is offline
Registered User
 
Join Date: Dec 2003
Posts: 61
simple session question

I have a simple form page called session.php.

It starts with
<?php session_start();


This form then calles onto another file called addentry.php. This file connects and inserts the data from the form into the mysql database.

In the end of my addendtry.php i have:

echo "Thank you ". $_SESSION['F_NAME'] .", your entry was successfully added to the database.";
include 'session.php';

?>

This tells the user that the data was entered and it takes the user back to the original form to log more data...

The only problem is that session.php's first line: session_start(); shouldn't be there since it already exists in addentry.php and this is why i'm getting this error at the top of the page:
Notice: A session had already been started - ignoring session_start()


Any ideas on an a way to fix this?
thanks
Noam
Reply With Quote
  #2 (permalink)  
Old 12-30-03, 07:42
rexselin rexselin is offline
Registered User
 
Join Date: Aug 2003
Location: India
Posts: 109
regarding session_start

What happens if you remove it ?

I assume that this is just a warning notice as I have seen in other sites.
Try suppressing the error .like

<?php @session_start();

or If you wanna remove the code go ahead .
Cheers,
Selin
Reply With Quote
  #3 (permalink)  
Old 12-30-03, 11:16
sundialsvcs sundialsvcs is offline
Registered User
 
Join Date: Oct 2003
Posts: 706
Based on what I see, the include of session.php should occur first, not last. And it should be the only place where sessioning code occurs. (Includes can really bite you... plan them carefully.)
__________________
ChimneySweep(R): fast, automatic
table repair at a click of the
mouse! http://www.sundialservices.com
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On