Reply
passing value from the form in previous page
Old 05-22-2007, 06:38 AM passing value from the form in previous page
Average Talker

Posts: 22
hi,

i have a problem in passing the values between pages,
i'm not using session, i just tried to pass them using by embed them in a url.

so, the case is i would like to add a new patient.
in the first.php, i search patient MRid and after get the value, i pass it to the second.php which is used to retreive patient personal data. i pass all the values from first.php and second.php to third.php, and in third.php, i also have a form to search the insurance company. after that, all the data could be inserted to database.
Code:
<form name= "searchPatient" method= "GET" action= "addNewPatient1.php?MR=".<?php echo $ckbxPatient; ?>>

<form action="addNewPatient2.php?MR=".<?php echo $_GET['ckbxPatient']; ?>."&pname=".<?php echo $pname; ?>." method="GET" name= "searchPatient">

<form action="../action/addNewPatientAct.php?a=a" method="GET" name= "profile">
the first and second page works well, but after i click submit button in the third page, the values from the previous page can't be passed, and it's not embedded in the url.

can anyone help me with this problem? thx for your attention
moccacinoe is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 05-22-2007, 06:50 AM Re: passing value from the form in previous page
Skilled Talker

Posts: 70
Use session for your this problem.

Thanks
gary is offline
Reply With Quote
View Public Profile
 
Old 05-22-2007, 06:56 AM Re: passing value from the form in previous page
jito's Avatar
MY LIFE IS 'i' LIFE

Posts: 551
Name: surajit ray
Location: inside the heart of my friends
Not very sure about your proble. It seems you are sending huge amount of data using query string. That's not good.
Let me understand the case.
from 1st page you got some value and send it through query string to 2nd page.
from 2nd page you have more values, append this values with the value from the 1st page and post it to 3rd page.
There you inserting everything.
Is it the case?
Then what's your problem, are not the values getting in to the database?
__________________
Think+, work +, but not HIV + :)
jito is offline
Reply With Quote
View Public Profile
 
Old 05-22-2007, 10:00 AM Re: passing value from the form in previous page
Average Talker

Posts: 22
Hi thanks for the replies..
Quote:
from 1st page you got some value and send it through query string to 2nd page.
from 2nd page you have more values, append this values with the value from the 1st page and post it to 3rd page.
There you inserting everything.
yes, this is exactly the case.. =)
the problem is, after i click the submit button in the 3rd page, the values that supposed to be passed from page 1 and 2, doesn't appear.. i mean it should be
Code:
http://localhost/clinic/resepsionis/action/addNewPatientAct.php?MR=1&pname=lena& statPem=pribadi&asuransi=&profileSave=Save
but in fact it shows
Code:
http://localhost/clinic/resepsionis/action/addNewPatientAct.php?statPem=pribadi&asuransi=&profileSave=Save
, means that it only grabs the value from page 3 only..
i really confuse about it..

thanks
moccacinoe is offline
Reply With Quote
View Public Profile
 
Old 05-22-2007, 10:42 AM Re: passing value from the form in previous page
jito's Avatar
MY LIFE IS 'i' LIFE

Posts: 551
Name: surajit ray
Location: inside the heart of my friends
try echoing the values you got from page 1 and 2 in page 3, and lets see what happence. like:
echo $_GET['MR'] and echo $_GET['pname'].

If you get these values right, post your code where you are constructing the query string.
__________________
Think+, work +, but not HIV + :)
jito is offline
Reply With Quote
View Public Profile
 
Old 05-22-2007, 12:17 PM Re: passing value from the form in previous page
solomongaby's Avatar
Webmaster Talker

Latest Blog Post:
How Do You Find Music Online ?
Posts: 522
Name: Gabe Solomon
Location: Romania
you cant use method GET and put get variables in the form action.
Use method POST
__________________
If you like my posts ... TK is appreciated:)
Web Directory | Blog
solomongaby is offline
Reply With Quote
View Public Profile Visit solomongaby's homepage!
 
Old 05-23-2007, 04:51 AM Re: passing value from the form in previous page
digitalfusion's Avatar
Skilled Talker

Posts: 70
Name: Martin
Location: Fife, Scotland
Quote:
Originally Posted by solomongaby View Post
you cant use method GET and put get variables in the form action.
Use method POST
I agree you need to use post to send the variables.
Because what happens when you send form data is it packages up all the form variables and POSTS them onto the handler in this case pages 2 and then 3.

Other than that use sessions.

But what i generally would do is comment out your query on the 3rd page and try echoing the form variables on page 2 and 3 to see if they are getting sent first, because if they aren;t thats why the query won;t be functioning properly.

Regards,
Martin
__________________
---------------------------------------------------
www.tornadodesigns.co.uk www.teenium.com www.kirkgandss.com www.worldofmuscle.co.uk
digitalfusion is offline
Reply With Quote
View Public Profile Visit digitalfusion's homepage!
 
Old 05-23-2007, 09:40 AM Re: passing value from the form in previous page
Average Talker

Posts: 21
Name: hamim
Location: Dhaka
use the straight way.. when u are passing the values through the query string then no need to use form any more. Again if u are using form then no need to pass query string. use hidden fiedls or other input fields to stor your values and just call the 3rd page with form action. U will get all the values...

then try to echoing values to ensure that u r getting all u need.
then try to echo your sql query.
if everything is ok then execute the query and laugh
__________________
offshore outsourcing , bangladesh web design => softnmore

Last edited by softnmore : 05-23-2007 at 09:44 AM.
softnmore is offline
Reply With Quote
View Public Profile Visit softnmore's homepage!
 
Old 05-24-2007, 07:06 AM Re: passing value from the form in previous page
Average Talker

Posts: 22
Hi..
thanks a lot for your replies...

i use hidden values and it works!!
thank's a lot for the replies.. =P

regards,

Lena
moccacinoe is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to passing value from the form in previous page
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.36905 seconds with 12 queries