Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2003

    Unanswered: 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?

  2. #2
    Join Date
    Aug 2003

    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 .

  3. #3
    Join Date
    Oct 2003
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts