Jump to content

cURL - Trigger URL & post variables remotely


sawade

Recommended Posts

Hi PHP experts,

 

I need to run a URL from a .php file. I dont need to grab its output or do anything.

 

All I want to do is just call a URL [that was created from the .php file] so that the server receives a request for the URL and executes the request.

 

Any help would be great.

Thanks

 

Additional Info:

 

- Standalone App

- Must be submitted via post and not SQL

- Must hide user URL and make sure server submitted for security

Seems like you're doing something, how do I put this, unorthodox. What's the nature behind your business? Why does the URL need to be hidden? Do you plan on spamming this or something?

 

 

<?php

$c = curl_init();
curl_setopt($c,CURLOPT_URL,"http://site.com/script.php");
curl_setopt($c,CURLOPT_POST,true);
curl_setopt($c,CURLOPT_RETURNTRANSFER,true);
curl_setopt($c,CURLOPT_POSTFIELDS,"var1=this&var2=that&var3=those");
curl_setopt($c,CURLOPT_REFERER,"http://blah.com");
curl_exec($c);
curl_close($c);

?>

Seems like you're doing something, how do I put this, unorthodox. What's the nature behind your business? Why does the URL need to be hidden? Do you plan on spamming this or something?

 

No, no spamming involved.  The URL needs to be hidden for security reasons.

 

Will give this a shot.  Thanks.

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.