tom2oo8 Posted June 12, 2009 Share Posted June 12, 2009 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®lock=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®lock=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)"; ?> Link to comment https://forums.phpfreaks.com/topic/161992-just-genrally-dont-work-and-i-dont-know-why-curl-and-other-things/ Share on other sites More sharing options...
tom2oo8 Posted June 12, 2009 Author Share Posted June 12, 2009 Also i think i have it, maby as im doing to many at once Link to comment https://forums.phpfreaks.com/topic/161992-just-genrally-dont-work-and-i-dont-know-why-curl-and-other-things/#findComment-854718 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.