Banner

Sponsor

Login


Welcome Back!
Guest
Guest

Register

Lost your password?

49 users online



sending data in POST method .. ?

sending data in POST method .. ?

Currently viewing this thread: 1 (0 members and 1 guests)


C-CT

C-CT

Status: Offline!

sending data in POST method .. ?

Hi,
I have 2 variables ($name and $email), i want to send these two variables and thier values to an other script as 'POST' with out using any forms or javascript .. just PHP, if it could be done, how to do it?

Thanks! Smile

CDude

CDude

nothing
Status: Offline!

open a connection using fsockopen and fputs http headers.

___________________

http://celerondude.com

C-CT

C-CT

Status: Offline!

Thanks CDude, but i don't know how to use it .. can you tell me?

i want to POST $name and $email to http://www.mywebsite.com/receiver.php

Regards.

CDude

CDude

nothing
Status: Offline!
PHP:


<?php
$url 
'localhost';
$page '/test/show.php';
$postdata 'name=celerondude&message=hello+there';

$fp = @fsockopen $url80 );
if ( !
$fp ) exit ( 'Unable to establish connection' );

$headers [] = 'POST ' $page ' HTTP/1.0';
$headers [] = 'Host: ' $url;
$headers [] = 'Referer: ttp://fake.com';
$headers [] = 'Accept: text/html';
$headers [] = 'Content-Type: application/x-www-form-urlencoded';
$headers [] = 'Content-Length: ' strlen $postdata ) . "\r\n";
$headers [] = $postdata "\r\n";
$headers [] = 'GET ' $page ' HTTP/1.0';

$header implode "\r\n"$headers );
fputs $fp$header );
while ( !
feof $fp ) )
{
       print 
fread $fp1024 );
}
?>

___________________

http://celerondude.com

C-CT

C-CT

Status: Offline!

Thanks alot CDude .. it works!
Grin Grin Grin Smile Smile Smile

gromy

gromy

Status: Offline!

How would you POST that to an https site CDude? Port: 443

Quick Jump:

Main Navigation


Site & Graphic Design by Aeon Tan
Developed by Jeremie Pelletier & Scott Roach


NeverAPI generated this page in 0.008 seconds.