Hi Guys,
I am having issues with this bit of code:
I keep getting this error on the line of code I have made bold. I can't understand why it works with the get_proxy function.
Can anybody help?
Thanks
I am having issues with this bit of code:
I keep getting this error on the line of code I have made bold. I can't understand why it works with the get_proxy function.
Notice: Undefined variable: hostname_Proxys
PHP:
function get_proxy()
{
require_once('../Connections/Proxys.php');
mysql_connect($hostname_Proxys, $username_Proxys, $password_Proxys) or die(mysql_error());
mysql_select_db($database_Proxys) or die(mysql_error());
$sql = "SELECT address
FROM proxy
ORDER BY rand()
LIMIT 1";
$q = mysql_query($sql);
$r = mysql_fetch_array($q);
if (empty($r) || empty($r["address"]))
{
echo 'You have run out of proxys. <a href="addproxys.php">Click Here</a> to add some more.';
die;
}
return $r["address"];
}
function delete_proxy($address)
{
require_once('../Connections/Proxys.php');
mysql_connect($hostname_Proxys, $username_Proxys, $password_Proxys) or die(mysql_error());
mysql_select_db($database_Proxys) or die(mysql_error());
$sql = "DELETE FROM proxy WHERE address = '" . mysql_escape_string($address) . "'";
mysql_query($sql);
}
Thanks