Jump to content

This topic is 7241 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Hello PHP Ninjas,

I have a multipart form that needs to post to multiple FM7 tables via FX.php. Is it possible to force the POST method in PHP across all the pages? Here's the dealio:

Step 1: foo.php - Form action goes to foo-add.php

Step 2: foo-add.php - retrieves data via POST, submits to foo table in FM7, then redirects to bar.php?foo=123 via an html meta tag.

Step 3: bar.php - retrieves foo via GET, builds new form where foo is a hidden field. Form action goes to bar-add.php.

Step 4: bar-add.php - retrieves data via POST, submits to bar table in FM7, then redirects to success page.

For the sake of security, cleaner error trapping and stronger data entry integrity, I don't want to rely on data getting passed by GET from step 2 to 3. A user could simply change the data in the URL or a hacker might try to write their own script to access data via GET. I have to write considerably more PHP logic to prevent these scenarios.

How can I pass all variables via POST method in PHP/HTML without inserting a success step between Step 2 and 3? Your thoughts are greatly appreciated!

Shannon

-=-=-

Posted

I've used "curl" in php to POST a Form. For example:

<?php

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "http://localhost:1154/FMPro");

curl_setopt($ch, CURLOPT_POST, 1);

curl_setopt($ch, CURLOPT_POSTFIELDS, "-db=combotest.fp5&-format=-fmp_xml&-findall");

curl_exec($ch);

curl_close($ch);

?>

Good Luck.

Garry

This topic is 7241 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.