Fedora Linux Support Community & Resources Center
  #1  
Old 5th December 2004, 04:59 AM
leaded Offline
Registered User
 
Join Date: May 2004
Posts: 373
PHP question, can't interpret manuals

I'm programming some forms on a RH 7 server (not mine) with PHP 4.3.8.

I have some easy questions about session variables and post variables, and the documentation I found doesn't really help answer them.

I was hoping someone friendly couple help me out here. I don't really want to register at another forum if I don't have to!

Ok, so the call for session_start();... when does this need to be done? Every page that uses a session variable?

Also, if I'm using the $_POST array, it doesn't look like I need to use session_start();... is this true?

If I have two pages of forms, it seems like I lose the $_POST info after I submit the second form... if both forms have the same name="form1" will my $_POST entries from the first form carry through past the second, and include the second?

Maybe I should buy a book... lol...
Reply With Quote
  #2  
Old 5th December 2004, 08:20 AM
Id4qiBd2 Offline
Registered User
 
Join Date: Nov 2004
Posts: 19
If you're coding multiple forms on multiple pages, and want to maintain what the responses were from page 1 after page 2 is submitted, you're going to have to write the responses from page 1 to some type of datastore, be it a session variable of some type, a database, flat files, what have you.

session_start() would need to be called at the beginning of each page that utilizes session variable information, yes.

If you're using the $_POST array when a page is submitted, no you don't necessarily need to involve session information, unless you're hoping for the information coming in via that $_POST array to be maintained between multiple page requests.... you're going to need to copy that information into some data store.... most likely the session in this case.

As for the last question.... your $_POST information won't carry over from page 1 to page 3, even if your forms have different names. It's not like form submissions of the same name over write each other in the $_POST array. The $_POST array starts empty with each request (that's what HTTP being "stateless" is all about, nothing persists) and is then only populated if something is being POST'ed as part of that request. To maintain that information, you need to take action to store it somewhere.

Hope that makes sense and helps.....
Reply With Quote
  #3  
Old 6th December 2004, 08:06 AM
Jman Offline
Registered User
 
Join Date: Mar 2004
Location: Minnesota, USA
Age: 27
Posts: 7,909
Moved to Programming.
Reply With Quote
Reply

Tags
interpret, manuals, php, question

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do you interpret this message? jim1944 Using Fedora 6 19th December 2007 03:41 AM
FC4 Manuals Renich Using Fedora 5 26th October 2005 06:00 PM


Current GMT-time: 15:43 (Wednesday, 19-06-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat