Warning: Division by zero

Hi i have this error with a auto surf script this line gives the surfer 20 seconds to view a persons webpage before showing the next webpage.

$time_autohit=20; //sec this is giving me a Warning: Division by zero error any ideas

I know very little about php
Thanks
Zalka

I doubt you’re getting any kind of error… :wink:

You need to post the rest of your code. Nobody is going to be able to help you with what you have shown.

Thanks

// URLs
$path=/home/whitebea/public_html/autosurffortraffic.com"/
$url_default=“http://Your_site.com”/
// Lenght of session (during session each site will be shown only one time)
$time_autohit= 20; //sec
// mysql database details
$hostnm = “localhost”;
$usernm = “whitebea_ann”;
$pwd = “”;
$dbName = “whitebea_yellow2”;

// Bonus credits at signup
// $bonus_credits=200;

include(‘apanel/vars.conf.php’);

// Do not edit below
$num_en=10;

$t_language= “language”;
$t_user= “user”;
$t_site= “site”;
$t_clear= “clear”;
$t_cat= “cat”;
$t_idu_idc= “idu_idc”;
$t_idm_idc= “idm_idc”;
$t_tmp_mail= “tmp_mail”;

if(!MYSQL_CONNECT($hostnm,$usernm,$pwd)){
die($err[2]);
}
if (!mysql_select_db($dbName)){
die($err[2]);
}

$query = "select * from ".$t_clear;
$result = MYSQL_QUERY($query);
if((mktime(0,0,0,date(“m”),date(“d”),date(“Y”))!=mysql_result($result,0,“date”))and(date(‘w’)==0)){
unset($body,$subject,$row,$result);
require(‘apanel/error_inc.php’);
require(‘apanel/weekstat.php’);
unset($body,$subject,$row,$result);
require(‘error_inc.php’);
}
@mysql_free_result($result);

function auth($log,$pass){
global $t_user;
$query = “select id from “.$t_user.” where email=”".$log."" and pass="".$pass."" ";
$result = MYSQL_QUERY($query);
if(mysql_num_rows($result)>0){
$id=mysql_result($result,0,“id”);
@mysql_free_result($result);
return $id;
}else{
@mysql_free_result($result);
return 0;
}
}

//get the settings
$qset = “select * from re_settings”;
$rset = mysql_query($qset) or die(mysql_error());
$aset = mysql_fetch_array($rset);

$admin_mail = $aset[‘ContactEmail’];
$site1 = $aset[‘SiteTitle’];

?>

url
autosurffortraffic.com

Just used http://phpcodechecker.com/ and I got 2 errors that could make your entire code not work:

Warning: There is 1 line that may be missing a semi-colon: $url_default="http://Your_site.com"/ PHP Syntax Check: Parse error: syntax error, unexpected '/' in your code on line 2 $path=/home/whitebea/public_html/autosurffortraffic.com"/

Thanks alot ill check it out :slight_smile:

These two lines are wrong

$path=/home/whitebea/public_html/autosurffortraffic.com"/
$url_default=“http://Your_site.com”/

Should be

$path="/home/whitebea/public_html/autosurffortraffic.com/";
$url_default=“http://Your_site.com/”;

Thanks alot
Regards Ken

Sponsor our Newsletter | Privacy Policy | Terms of Service