Page 1 of 1

Multi URL posting for NO AGENT URL feature campaign detail

PostPosted: Wed Jul 27, 2022 6:46 pm
by Noah
<?php
// This script is designed to take a pipe separated group of urls and post them to each url as they exist.
// Here is an example string separated by a pipe
// 'http://127.0.0.1/noah/echo.php|http://127.0.0.1/noah/echo.php';
//URLstring example for no agent URL
//'http://127.0.0.1/mcc/multiurl.php?URLstring=http://127.0.0.1/noah/echo.php|http://127.0.0.1/noah/echo.php';
//This string above is what gets copied to the no agent url feature of the campaign detail view. Replace the http://127.0.0.1/noah/echo.php with your first URL and same for the second
//The file name is multiurl.php
//Have fun!

if (isset($_GET["URLstrings"])) {$URLstring=$_GET["URLstrings"];}
elseif (isset($_POST["URLstrings"])) {$URLstring=$_POST["URLstrings"];}

// Split the urls into each
$parts = explode("|", $URLstring);

// Run the urls through a post
foreach ($parts as $urlmcc) {
// echo $urlmcc ."<br /><br /><br /><br />";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$urlmcc);
curl_setopt($ch, CURLOPT_POST,$urlmcc);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_VERBOSE, TRUE);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,FALSE);
$response = curl_exec ($ch);
// print_r($response);// Print the url
curl_close ($ch);
}
?>

Re: Multi URL posting for NO AGENT URL feature campaign deta

PostPosted: Tue Aug 02, 2022 6:13 pm
by carpenox
Great contribution. You rock!

Chris