Web Hosting Talk







View Full Version : PHP Variable Troubles


jmaskell
07-22-2005, 05:27 AM
I'm having a slight problem with PHP in that I want to pass a set of variables through one script, and then onto another 3rd script, however I can't seem to be able to do this.

The script works with a form being submitted and processed to check that all of the data is correct. If the data submitted is not correct and valid then the form is displayed again and the errors are shown.

What we want/need to do is pass these variables onto another script that performs some more complicated functions with them. We do need to pass the variables to a third script as this script handles various other forms from the site, although directly. Ideally we do not want to post the form directly to this script as this we do not want to complicate the functions in it even further.

So how do we pass these variables, ($firstName, $surName and $telNumber are a few) to this script? We also want to avoid using another page for the user to confirm the details (and we could put hidden fields in here) as the customer does not want this.

All help on this is appreciated, and apologies if this is a simply issue with an obvious solution.

qledge
07-22-2005, 05:56 AM
Write a class to perform this function. Then include this class into the script that you want the variables to be process.

PHP is object oriented!

Cheers,
QLedge.

<Signature to be setup in your profile>

fozzy
07-22-2005, 08:43 AM
If I have this right there are three pages:
The form
A processing script
A third page (which is a script).

Simply include the third page in the processing script then call the required functions.

ie The call in the processing script to the third script.

advancedErrorChecking ($_POST['fname'], $_POST['lname'], ... )