Jump to content

Recommended Posts

Thanks.

 

I have been googling, and it seems you can send some form POST data via headers?

 

I have tried this code, but it returns a server error, with the log showing that the headers where malformed?

 

Any ideas?

 

<?php
$host = "www.example.com";
$path = "/path/to/script.php";
$data = "data1=value1&data2=value2";
$data = urlencode($data);

header("POST $path HTTP/1.1\r\n" );
header("Host: $host\r\n" );
header("Content-type: application/x-www-form-urlencoded\r\n" );
header("Content-length: " . strlen($data) . "\r\n" );
header("Connection: close\r\n\r\n" );
header($data);
?> 

Link to comment
https://forums.phpfreaks.com/topic/150447-php-form/#findComment-795388
Share on other sites

Thanks.

 

When the form is submitted a new page opens through my perl script.

 

When you hit the back button to go back to this blank php page and then press refresh (because the page has expired), the session will have been cleared wont it?  So when ever the php is executed the session will be renewed?

Link to comment
https://forums.phpfreaks.com/topic/150447-php-form/#findComment-795746
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.