Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Pro PHP
|
Pro PHP Advanced PHP coding discussions. Beginning-level questions will be redirected to the Beginning PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 21st, 2006, 07:29 PM
Authorized User
 
Join Date: Dec 2005
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default Saving form variables after a reload,

I would like to know if it is possible to save form variables after a page is reloaded without submiting.

I am using a reload(form) to reload the page. When I attempt to pass the variables within the reload function, the function will nolonger refresh the page. I have also attempted to use $_Session[''] for the variables, but I am not sure of how to get the value in a text box to $_Session['value1'] when the user enters information into the text box.

I need the $_session['value'] to be updated as soon as anychanges are made to the textbox.


 
Old January 24th, 2006, 08:41 AM
Friend of Wrox
 
Join Date: Dec 2004
Posts: 154
Thanks: 0
Thanked 0 Times in 0 Posts
Default

"I would like to know if it is possible to save form variables after a page is reloaded without submiting."

If you aren't submitting the data to the server how can it save the data?

I dont understand what you are trying to do to be honnest.

PHP works on the server side so you need to send the data to the server for any chnages.. It seams that you are trying to make changes happen when the user change data on the form itself before sending it out: That would be the job of Javascript.
 
Old January 24th, 2006, 09:11 PM
Authorized User
 
Join Date: Dec 2005
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I am using a java function to reload the page. I need to carry the values from the php form across the reload.

What I am trying to do is:

When a user enters information into a text box or a list(drop down) the values need to be saved when the page reloads. (page reload will occur when a user makes a list selection, loading different information into a second list based on the option selected from the first.) I need to save any of the information that the user has entered prior to making a selection from the list, so that it can be displayed after the page reloads.

I have the lists working without a problem. I am looking for a way to save the values from a form into java or php, that will allow me to use the values saved after a page reloads.

 
Old January 24th, 2006, 11:44 PM
Authorized User
 
Join Date: Dec 2005
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I thought that I would try to explain things a bit better.

I would like to know if it is possible to save a value from a php form in a session using a java function.


What I am doing:

I have a php form. The form contains a textbox and 2 list menus (drop down box) The second drop down box relies on the selection made in the first.

within the reload() java function I save the value entered in the first list menu (using the onChange="reload(this.form)" ) I pass the variables in the url. The users selection loads values into the second list menu. Where the user can make a second selection. This value is passed using the same method.

What I would like to do is save the textbox (or all the entered values) values in a session using a java function. When the user changes the a value or enters one.

Thanks

I have posted this in the java section also, as it may be more of a java question.
 
Old January 26th, 2006, 10:43 AM
Friend of Wrox
 
Join Date: Dec 2004
Posts: 154
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I haven't looked at passing variables between java -> php but it seamed to be a pain when by mistake I got those search result >.<

I use(d) a Javascript double drop down menu on a website I made some times ago.

However I didnt use reload() because there was no point of reloading the same page. The double drop down allow me to make a double selection. I then POST that selection to the next page which then perform a database search and display.

I think what you are trying to do is a bit similar? you want to have multiple drop down which basically when you change drop down 1, the text in drop down 2 change ?

If thats correct, you dont need php @ that stage, you need to look for javascript multiple drop down.

Let me know :)

Edit:
Example of what I think you are trying to do:
http://www.trans4mind.com/personal_d...tripleMenu.htm
 
Old February 2nd, 2006, 03:45 PM
Authorized User
 
Join Date: Dec 2005
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I'm doing something similar. Although the list would be far too long to have the data already avalible in the second drop down. The first drop down will have about 300 different values. The second drop down will have up to 60 different values for each value selected in the first drop down.

I have used a mysql query to load the values in the second drop down where they relate to the selection made in the first drop down.

(I reload the page because I need the page to go through the second query (for the second drop down), I'm using an if statment -- if there is a selection made in the first drop down, do this query to load the data in the second drop down list.)

I can't list the total number of values in the second drop down, as there would be about 18000 values in total for the user to search through.

I need to filter them base on the selection from the first drop down, not really a choice for what I need to do(this part is working fine between page loads (using javascript)).

So I need to find some way to save the data in all the text boxes and the list values (preferably without passing them all through the url) There is going to be about 25 text boxes in the form.

There will be two more drop downs lower on the page, using the same info as the drop down boxes above

so you can see why I am avoiding passing everything through the url.

I am just trying to get the 2 drop downs and one text box to work for now. Also -- if the second drop down list is empty, there is no values in the database for that selection in the first drop down, there will be a text box instead of the list.(everything works when I pass the variable through the url)


Thanks again for your input

 
Old May 19th, 2006, 10:21 PM
Registered User
 
Join Date: May 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Can i get help from you guys???

I am facing the problem that Rinventive mention earlier on. That i want to link the 2 list/menu. Can i know how to reload the page by using php? and how do i get the variable from list/menu selected index? I m really at my lost now. Please help..

 
Old June 8th, 2006, 12:59 AM
Registered User
 
Join Date: Jun 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I m facing the same problem. i select item from first dropdown list and items in second dropdown list get selected. but all form texboxs get empty. need urgent help.

 
Old June 23rd, 2006, 04:49 AM
Registered User
 
Join Date: Jun 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Use PHP to generate the first drop-dowm and in the onchange call a javascript function that submits the form via the get method and not post, then when the page reloads all the previous variables will be available in $_SERVER['QUERY_STRING']

Ctrl-Alt-Del





Similar Threads
Thread Thread Starter Forum Replies Last Post
Reload page Tooltip not work - Reload xslt file? ismailc XSLT 10 January 22nd, 2008 10:03 AM
Saving Form Contents Borhani Excel VBA 2 January 20th, 2008 12:55 PM
Reload Parent form from Child form maulik33 ASP.NET 2.0 Basics 2 February 6th, 2007 12:53 PM
Saving data using form misskaos Classic ASP Basics 3 October 27th, 2006 03:16 PM
Close form without saving cqprod27 Access VBA 8 June 4th, 2004 08:14 AM





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