Jump to content

PHP Form


Lectrician

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.