Jump to content

[SOLVED] posting variables with hidden form


kev wood

Recommended Posts

is it possible to send php variables with hidden forms through two pages.

 

i have a php page which processes some user inputs.  i then send these variables to a new page which inserts entries into a mysql db.  i am then trying to send these variables to one last page but every time i try i just get could not connect.  which tells me the variables are not being sent.

 

Well, best idea is to use $_SESSION. It's a variable that exists accross all pages. You just need to add session_start(); at the top of each page and it is set by

 

$_SESSION['Text'] = "Something";

 

And is called like $_SESSION['Text'] like any other variable. Think of it as an array that doesn't expire when you leave a page

when i try to use the session i get errors coming up so that is the reason behind me trying to get it to work with hidden form.  when i am trying to echo out the variable $db i am just getting $db printed on the screen.

i have already passed them on to one page but when i try to pass them on again from this page it fails it is looking like.  it is the db i want to connect to and it is just not working every time i try to echo out the variables i just get the variable name printed on the page.

 

i was under the impression that if the variable held nothing then nothing would be printed out.

i have sorted that part out now it is connecting to the db but it will not insert my image into the db now.  it is storing it on the server but not in the db.

 

it is this section of code that id not working now

 

$run=mysql_query("select max(id) from '$table'");
$lastid = mysql_fetch_row($run);
$lastid=$lastid[0];
$sql="UPDATE '$table' SET image= '$consname2'  WHERE id= '$lastid'";
$query = mysql_query($sql);	

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.