simple php script question

 
Post new topic   Reply to topic    Aprelium Forum Index -> PHP
View previous topic :: View next topic  
Author Message
noamkrief
-


Joined: 12 Nov 2003
Posts: 40

PostPosted: Mon Dec 29, 2003 4:36 am    Post subject: simple php script question Reply with quote

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
Back to top View user's profile Send private message Send e-mail
whackaxe
-


Joined: 28 Jun 2003
Posts: 90

PostPosted: Mon Dec 29, 2003 9:49 pm    Post subject: Reply with quote

wll if it shouldnt be there, then why is it? :?

anways, try

Code:

if (!isset($_SESSION['F_NAME']))
{
session_start()
}
Back to top View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> PHP All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group