Re: [houston-php] session_start() issues

From: Jonny N.
Sent on: Wednesday, August 25, 2010 4:48 PM
I am pretty new to php and have limited knowledge of what best practise. Feel free to make suggestion my ears are all yours.

I am putting together a small ticket request application for learning purpose. I will be doing client side validation using JavaScript before I actually post it but I also want to do server side scripting in case Javascript is disabled or get hack. At this stage I want finish up the server side coding before moving on to client side.

The strange part is when I include session_start() the IE and Firefox lose all the form values. The back button works normal if i don't include the session_start();

I only include the session_start(); I never assigned any values to it or anything.

is there anything i need to setup in php or apache to use session?

My site is currently setup to use the session. Feel free to check it out and provide feedback when you can.

http://tomball.mine.nu/ticket/request

On Wed, Aug 25, 2010 at 4:19 PM, Brandon Bissoon <[address removed]> wrote:
That's not a server-side feature, that's a browser. Unless you're using a session to store the values, check if the session is valid and repopulate the field - you are limited to the browser's default behavior.

Try this..
First - Not sure why you aren't doing validation on the page before it's posted. What you're doing is a horrible practice.

Second - IF You must do it that way. Store the user's input in the session. In the "Value" parameter of your input fields, echo the values if the session exist.

That would solve your problem.

"A simple man believes anything, but a prudent man gives thought to his steps." Proverbs 14:15

--- On Wed, 8/25/10, Jonny Nguyen <[address removed]> wrote:

From: Jonny Nguyen <[address removed]>
Subject: [houston-php] session_start() issues
To: [address removed]
Date: Wednesday, August 25, 2010, 3:29 PM


I experience a strange behavior with session_start().

My browser back button is not working correctly when i use the session_start(); It loads the previous page but non of the form values gets loaded. it comes up as a new request.
I have a form validation that will use the parent.history.back() if it fails. this validation works fine when i don't use the session_start().? when I do use the session_start() it will just reset all the values in the form. I have tested this in IE and in Firefox and get the same behaviors.

I have look far and near and have not been able to find anything useful.

please let me know you have encounter this issue in the past.

thanks in advance

Jonny




--
Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
This message was sent by Jonny Nguyen ([address removed]) from Houston PHP Users Group.
To learn more about Jonny Nguyen, visit his/her member profile
To unsubscribe or to update your mailing list settings, click here

Meetup, PO Box 4668 #37895 New York, New York[masked] | [address removed]




--
Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
This message was sent by Brandon Bissoon ([address removed]) from Houston PHP Users Group.
To learn more about Brandon Bissoon, visit his/her member profile

To unsubscribe or to update your mailing list settings, click here

Meetup, PO Box 4668 #37895 New York, New York[masked] | [address removed]

People in this
Meetup are also in:

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy