I should send data without a form from a page to another! How? I know that curl "asks" data, but I have not to ask them, I have to send!
With poor words, I uses a validator to check data for sign up. If something is not valid, it has to send data back with an error message! How I could send back without encoding them in URL?
Thanks before!
Asked
Active
Viewed 209 times
-3

ProtoTyPus
- 1,272
- 3
- 19
- 40
-
All web communication has two parts, a request and a response. If you are receiving/handling a request, you simply output the answer as the response. – Patrick Q May 31 '16 at 17:57
-
You may use session or query string. – Avijit May 31 '16 at 18:03
-
http://stackoverflow.com/questions/28395/passing-post-values-with-curl ? – HPierce May 31 '16 at 18:07
-
I have the old manner I used: Setting Session. But I would use $_POST. I have not some code to show, cause I have not idea what to do and I haven't found anything. I have not a request. I have to send a message to another page. I would like to do with POST! – ProtoTyPus May 31 '16 at 18:09
1 Answers
0
there are many ways to do it. you can use session. so you can save the data in an array and save the array in session and after you redirect the user to the form with error you have to check if the array is set so you can print errors and data you want then unset the variable you used in session.

HSLM
- 1,692
- 10
- 25
-
-
'value1', 'key2' => 'value2'); // use key 'http' even if you send the request to https://... $options = array( 'http' => array( 'header' => "Content-type: application/x-www-form-urlencoded\r\n", 'method' => 'POST', 'content' => http_build_query($data), ), ); $context = stream_context_create($options); $result = file_get_contents($url, false, $context); var_dump($result); – HSLM Jun 01 '16 at 09:21