Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 14th, 2004, 03:25 PM
Registered User
 
Join Date: Jun 2003
Location: , , .
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default form variable passing with popups and other...

hi, i am having a problem that i just cant seem to figure out. i have searched all over the internet for the past 2 days and cant find anything that helps.

just to clarify things:

page 1 = page with questions
page 2 = page with echoes of answers
popup = popup from page 2

page 1 has several radio buttons and a few checkboxes. i then use php to transfer the information from page 1 to page 2 where the answers are echoed.

well that all works great, but on page 2 i have a link that produces a popup, where the user should be able to change one of the answers they selected without it affecting the others.

upon submitting the popup, page 2 should be updated with the new answer from the popup, but the other answers should not be effected.

i have tried several things, but all left me with the new answer being updated, but all of the others not being found.

i hope this makes sense if it doesnt, let me know and i will clarify, any help or information would be greatly appreciated.
Reply With Quote
  #2 (permalink)  
Old February 16th, 2004, 11:13 AM
Registered User
 
Join Date: Dec 2003
Location: , , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

if you are posting to the original page again, then you would have to re-post all the variables as html is stateless. you might want to try javascript to adjust the answer on the main page... call the function from the pop-up form

Reply With Quote
  #3 (permalink)  
Old February 16th, 2004, 11:49 AM
Registered User
 
Join Date: Jun 2003
Location: , , .
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

yea, i was afraid i would have to repass the variables.

i will try javascript and see how that works out.

thanks for the information.
Reply With Quote
  #4 (permalink)  
Old February 16th, 2004, 03:23 PM
Friend of Wrox
Points: 2,570, Level: 21
Points: 2,570, Level: 21 Points: 2,570, Level: 21 Points: 2,570, Level: 21
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: San Diego, CA, USA
Posts: 836
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You might want to use an intermediary page to process incoming variables. The page you display always pulls the data from somewhere (database, session, file, whatever). This is how you can maintain state.

When you submit the form data, have a script accept and store the posted data somewhere (again: db, session, file, whatever) and redirect to your existing page 2 for displaying.

To redirect, use the header() function *** BEFORE *** any HTML output is sent to the user (including whitespace outside of your <?php ?> tags!!!)

header("Location: page2.php");



Take care,

Nik
http://www.bigaction.org/
Reply With Quote
  #5 (permalink)  
Old February 18th, 2004, 10:31 PM
Registered User
 
Join Date: Jun 2003
Location: , , .
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hey Nik, thanks for the information, but im a little confused.

can you give me and example, using session, as to how this would work. maybe post some code to get me started.

thanks again for the excellent help.
Reply With Quote
Reply


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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
passing variable tbekarov ASP.NET 2.0 Professional 7 February 1st, 2006 04:16 PM
Passing variable to a public variable Hudson40 Access VBA 2 February 25th, 2005 06:23 AM
passing a variable from one form to another madhukp VB How-To 4 January 19th, 2005 12:45 AM
Passing a variable mrideout BOOK: Beginning ASP.NET 1.0 3 August 6th, 2004 02:57 PM



All times are GMT -4. The time now is 03:25 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.