sessions problem

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

You might want to check to see if it is exactly named 'userName' in the form -- you have that capital N in there. Try this to see what the form is actually sending:

Code: Select all

function dump($var) {
        echo '<pre>' . print_r($var, 1) . '</pre>';
}
dump($_POST);
(#10850)
User avatar
nhan
Forum Commoner
Posts: 95
Joined: Sun Feb 27, 2005 8:26 pm
Contact:

Post by nhan »

it only displays :


Array
(
)


:(
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Post by Benjamin »

Nothing is being posted to that page then.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

nhan wrote:it only displays :
Array
(
)
So on your original post, what HTML form sends data to page 1?
(#10850)
User avatar
nhan
Forum Commoner
Posts: 95
Joined: Sun Feb 27, 2005 8:26 pm
Contact:

Post by nhan »

yes, but when i click the back button.... and re enter the data.... those in the print command are being displayed... :( are there any scripts that would do the same function... im not really good at php.. :)
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

Maybe if you posted both/all your pages we could help you better.
(#10850)
User avatar
nhan
Forum Commoner
Posts: 95
Joined: Sun Feb 27, 2005 8:26 pm
Contact:

Post by nhan »

to aborint:

Code: Select all

form action: <form action='$_SERVER[PHP_SELF]' method='post'>

for username : <input type='text' name='userName' value='$_POST[userName]'>
for group: 
                <select name='group'>
               	<option value = MRQ >MRQ</option>
	<option value = PBO >PBO</option>
	<option value = PHA >PHA</option>
	<option value = LGV >LGV</option>
              </select>

for process:
                 <select name='process'>
               	<option value = process1 >process1</option>
	<option value = process2>process2</option>
	<option value = process3>process3</option>
	<option value = process4 >process4</option>
              </select>
thanks for the help guys... :)
User avatar
nhan
Forum Commoner
Posts: 95
Joined: Sun Feb 27, 2005 8:26 pm
Contact:

Post by nhan »

to aborint:

i have already posted the code on the previous threads.... i have just removed the unnecessary ones... :)
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

That looks like it should work if there is a value in that text field. It probably is not a session problem unless session are not working at all. I would separately test the form and the session to make sure each is working and then combine.
(#10850)
Post Reply