PHP drop down and Session question -


What really needs to happen here .. One session takes my data from the drop down below. And then take it back on this page, with a header on the process page. Then when it comes back to the first page, the dropdown will be populated with the session or the same client when I left that page and the change in the drop down will work. Can anyone help me with this. Thanks, now it gives the customer drop down, but changing to drop down does not work which I really need to work on.

  session_start (); $ Current = release ($ _ session ['client namefor'])? $ _SESSION ['client namefor']: 0; While ($ line = mysql_fetch_array ($ result)) {$ id = $ row ["Client_Code"]; $ Cheese = $ line ["Client_Full_Name"]; $ Value = "$ id, $ thing"; ? $ Sel = ($ id == $ current) selected ':' '; $ Options4 = "& Lt; OPTION $ sel VALUE = \" $ value \ "& gt; $ Item; }? & Gt; & Lt; Form name = "form" action = "& lt ;? php echo $ _SERVER ['PHP_SELF'] ;? & gt;" Method = "post" & gt; & Lt; Select Name = "ClientNameFor" onchange = "this.form.submit ()" & gt; & Lt; Option value = 0> Client & lt ;? Php $ options4? & Gt; & Lt; / Select & gt; & Lt; / Form & gt;  

Process page header

  session_start (); $ _SESSION ['client namefor'] = $ _POST ['txtclientcode']; // Do not redirect // redirect headers ("location: test.php"); Go out(); I do not know your question or problem but I think it should be  

  $ _ session ['client namefair'] = $ _POST ['client namefor']; Instead of  

  $ _ session ['ClientNamefour'] = $ _POST ['txtclientcode'];  

In addition to your code & lt; / Option & gt; Do not forget to close the tag.

Of course, you can get form data on the form page, but

  & lt; Form name = "form" action = "& lt ;? php echo $ _SERVER ['PHP_SELF'] ;? & gt;" Method = "post" & gt;  

It looks like the data is sent back to the same page.

and never trust the data is submitted by the user.

Edit:

Try:

  onChange = "javascript: document.forms [0]. Submit () " 

or

  onChange =" javascript: document.forms ['form']. Submit () " 

But what did I get by using Google only?


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -