2

I have built a form submission consisting of about 90 values. The form needs to be submitted to another page that has a curl session which handles the last part. My question is, when I submit that form, how do I access the $_Post[] data as a whole array so I can submit it as the curl post array?

need to get

<form name="send" action="process.php" method="post">
<input 1>
<inpit 2>
...
<input 90>
</form>

to

process.php :

curl_setopt( $ch, CURLOPT_POSTFIELDS, $_Post[] );

Or is it as easy as putting $Post[]?

1
  • 1
    you can get the whole array with just $_post not $_post[] Commented Jul 29, 2012 at 1:15

1 Answer 1

1

From the manual, the CURLOPT_POSTFIELDS value can be in a query-string format, var1=value1&var2=value2... or in an array format with the key being the field name, such as you have with $_POST.

You are currently using $_POST[] in your example; drop the [] and it should work fine:

curl_setopt($ch, CURLOPT_POSTFIELDS, $_POST);
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.