Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP passing variable to next script

Status
Not open for further replies.

scriggs

IS-IT--Management
Jun 1, 2004
286
GB
I have a script which generates a drop down list box from an ODBC datasource. When you select an item from the list it queries the data and displays name, address, etc. It receives the selected item via

Code:
$valid_cust = $_POST['custname'];

I then need to pass this on to another script by pressing another button. How can I pass this item on again. I tried including the data in a hidden field on the form but it doesn't seem to work.

Code:
<?php
echo "<input type=\"hidden\" name=\"custname\" value=\"$valid_cust\">";
?>

<form action="feesmerge.php" method="POST" enctype="multipart/form-data">
template: <input type="file" name="template" /><input type="submit" name="mergeSubmit" value="Submit" />
</form>

When I click the button and run feesmerge.php I recieve the error

"Notice: Undefined index: custname in c:\inetpub\ on line 27"

Any help please...
 
Solved it myself - put the hidden field outside the form, didnt I?!?!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top