elentz Posted January 30, 2019 Share Posted January 30, 2019 I am trying to get a simple thing working. I have a domain with google that I want to change the point to IP when I access a PHP page. I have a DB table with settings that I am using for the username, password, etc. The issue is that the command to change the IP always sends the same IP. No matter what I try. I have tried assigning a fixed entry for the variable $localip, I have set that variable to 0 ahead of the query to get the info from the table. Nothing I do will change the variable in the command. I can manually put the command in a browser and it will perform the change. Can anyone comment on what I am missing here? <?php ini_set("display_errors", 1); ini_set("track_errors", 1); ini_set("html_errors", 1); error_reporting(E_ALL); require('/var/www/html/cqadmin/utils/connect.php'); $sql = "SELECT * FROM `failover` LIMIT 0, 30"; $result = mysqli_query($link,$sql) or die(mysql_error()); $row = mysqli_fetch_array($result); $localip = ($row['localip']); $dnsusername = ($row['dnsusername']); $dnspassword = ($row['dnspassword']); $domain = ($row['failoverurl']); $location = ($row['location']); $dealer = ($row['dealer']); $output = shell_exec("curl -s https://$dnsusername:$dnspassword@domains.google.com/nic/update?hostname=$domain&myip=$localip"); mysqli_close($link); ?> I get no errors on the page and if I echo $output I get a nochng message back from Google Thanks for looking!! Quote Link to comment Share on other sites More sharing options...
gw1500se Posted January 30, 2019 Share Posted January 30, 2019 You don't do anything with $output. How do you know you are getting nothing back? In any case why are you not using PHP cURL? Quote Link to comment Share on other sites More sharing options...
elentz Posted January 30, 2019 Author Share Posted January 30, 2019 I left out the echo $output in the code. Darn copy and paste. My ignorance of php cURL is why I guess, Quote Link to comment Share on other sites More sharing options...
gw1500se Posted January 30, 2019 Share Posted January 30, 2019 You'll find you have better control with PHP cURL and you will get better feedback in the case of errors. Quote Link to comment Share on other sites More sharing options...
elentz Posted January 30, 2019 Author Share Posted January 30, 2019 You were right using php curl worked out just fine. a couple lines and it allworks Thank you Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.