Jump to content

[SOLVED] How to POST data automatically


senyo

Recommended Posts

I found this:

<?php

if(isset($_POST['Name']))    $Name  = $_POST['Name'];

if(isset($_POST['Email']))  $Email  = $_POST['Email'];

if(isset($_POST['Message']))  $Message= htmlentities($_POST['Message']);

 

$Curl_Session = curl_init('http://www.site.com/cgi-bin/waiting.php');

curl_setopt ($Curl_Session, CURLOPT_POST, 1);

curl_setopt ($Curl_Session, CURLOPT_POSTFIELDS, "Name=$Name&Email=$Email&Message=$Message");

curl_setopt ($Curl_Session, CURLOPT_FOLLOWLOCATION, 1);

curl_exec ($Curl_Session);

curl_close ($Curl_Session);

?>

I don't know curl so I assume that

$Name is the subject

$Email the email address

$Message the content.

http://www.site.com/cgi-bin/waiting.php the address where this is sent

 

 

 

The contents is irrelevant. Basically what that is doing is sending data to that url. If you look at the string "Name=$Name&Email=$Email&Message=$Message", that's what's being sent. On the other end it would be captured like a standard post.

 

ex.

echo $_POST['Name'];

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.