Jump to content

Variable not changing for dns update command


elentz

Recommended Posts

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!!

Link to comment
Share on other sites

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.