Jump to content

Just genrally dont work and i dont know why? [curl and other things]


tom2oo8

Recommended Posts

Most of my scripts work even if i do it the "long" way but this one just isnt.

 

I have made this script to change the nameservers and all park the domains as i cant be bothered to do 231 sites manually.

 

Heres the code so if any one can help, also i have taken out the user and pass for obviuos reasons:

 


<?php
$username = "naaa";
$password = "loliaccidentlyleftitin";
$hostname = "localhost"; 

//connection to the database
$dbhandle = mysql_connect($hostname, $username, $password) 
  or die("Unable to connect to MySQL");

$selected = mysql_select_db("nothinghere",$dbhandle);


$ch = curl_init() or die("dont work");
echo "Work goddamnit";
curl_setopt($ch, CURLOPT_URL, 'https://billing.tsohost.co.uk/dologin.php') or die("dont work");
curl_setopt ($ch, CURLOPT_POST, 1) or die("dont work");
curl_setopt ($ch, CURLOPT_POSTFIELDS, 'username=NOOOO&password=NOOOO');
curl_setopt ($ch, CURLOPT_COOKIEJAR, 'cookie.txt') or die("dont work") or die("dont work");
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); 


curl_setopt($ch, CURLOPT_URL, 'https://billing.tsohost.co.uk/clientarea.php?action=domaindetails')or die("dont work") ;
curl_setopt ($ch, CURLOPT_POST, 1) or die("dont work");

$sql = mysql_query("Select * FROM site") or die("dont work");
while($rows == mysql_fetch_array($sql))
{
$get = "sub=savereglock&reglock=off&id=" . $rows['id'];
curl_setopt ($ch, CURLOPT_POSTFIELDS, $get) or die("dont work");
}
curl_setopt($ch, CURLOPT_URL, 'https://billing.tsohost.co.uk/dologin.php') or die("dont work");
curl_setopt ($ch, CURLOPT_POST, 1);
$sql = mysql_query("Select * FROM site");
while($rows == mysql_fetch_array($sql))
{
$get = "sub=savens&id=" . $rows['id'] . "&ns1=ns1.hosting24.com&ns2=ns2.hosting24.com";
curl_setopt ($ch, CURLOPT_POSTFIELDS, $get);
}
$sql = mysql_query("Select * FROM site");
while($rows == mysql_fetch_array($sql))
{
$get = "sub=savereglock&reglock=on&id=" . $rows['id'];
curl_setopt ($ch, CURLOPT_POSTFIELDS, $get);
}
curl_setopt($ch, CURLOPT_URL, 'http://64.235.57.236:2082/login/?user=LOLNO&pass=LOLNO');
$sql = mysql_query("Select * FROM site");
while($rows == mysql_fetch_array($sql))
{
$exp = explode(".",$rows['site']);
$site = $exp['1'] . ".com";
$get = "http://64.235.57.236:2082/frontend/x3/park/doaddparked.html?domain=" . $site . "&go=Add+Domain";
curl_setopt ($ch, CURLOPT_URL, $get);
}


curl_close ($ch); 

      $logFile = fopen(".htaccess","w");
   
$sql = mysql_query("Select * FROM site");
while($rows == mysql_fetch_array($sql))
{
$exp = explode(".",$rows['site']);
$site = $exp['1'];
$writestuff = "\n RewriteCond %{HTTP_HOST} ^www." . $site .".com$ [OR] \n RewriteCond %{HTTP_HOST} ^www." . $site .".com$ \n RewriteRule ^.?$ \"http\:\/\/www\." . $site ."\.com\/". $site  ."\/\" [R=301,L] \n";
     fwrite($logFile, $writestuff);
}



fclose($logFile);

print "Fished Wow it works?! (doubt it)";

?>

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.