Jump to content

help urgently needed resolving php cron file errors


JewelsPiper

Recommended Posts

I have purchased a ad manager type script and have put so much work in to the site but i cannot get the cron file to execute properly due to errors.  The makers of the script arent answering my emails so I am left to find the answer myself im hoping some experts can shine a light on this for me :)

 

I have the cron running once daily as required

 

the error messages are as follows:

 

/home2/net2you/public_html/2xx.co.uk/include/CronStats.php: line 1: ?php: No such file or directory

/home2/net2you/public_html/2xx.co.uk/include/CronStats.php: line 2: syntax error near unexpected token `;'

/home2/net2you/public_html/2xx.co.uk/include/CronStats.php: line 2: `ob_start();'

 

I have installed the script on two different hosts and get the exact same errors.

 

any help would be much appriciated

 

 

the contents of the cron file are below

______________________________________________

 

<?php
ob_start();
ini_set("max_execution_time", 0);
error_reporting(0);
require_once("db_connection.php");
// hits table fix
$ws = mysql_query("select pid from publishersinfo");
while($row = mysql_fetch_assoc($ws)){
$max = mysql_fetch_assoc(mysql_query("SELECT count(distinct ip) as distinct_hits, count(ip) as hits, date from hits where pub_id='$row[pid]' group  by date order by hits desc, distinct_hits desc limit 1"));
mysql_query("update publishersinfo set hits = '$max[hits]', distinct_hits = '$max[distinct_hits]' where pid = '$row[pid]' ");
 
$country_clicks = mysql_query("select count(country) as clicks, country from hits where is_click = 1 and pub_id = '$row[pid]' GROUP BY country order by clicks desc");
mysql_query("delete from country_clicks where pid  = '$row[pid]' ");
while($rc = mysql_fetch_assoc($country_clicks)){
mysql_query("insert into country_clicks set clicks = '$rc[clicks]' , country = '$rc[country]', pid = '$row[pid]', updated = CURDATE() ");
}
}
mysql_free_result($ws);
 
// adv info
$advertisement_ids = mysql_query("select adv_id from advertisersinfo");
while($ro = mysql_fetch_assoc($advertisement_ids)){
$clicksToday = mysql_result(mysql_query("select count(hit_id) from hits where adv_id = '$ro[adv_id]' and is_click='1' and is_sale='0' and `date` = CURDATE()"),0,0);
$impressionsToday = mysql_result(mysql_query("select count(hit_id) from hits where adv_id = '$ro[adv_id]' and is_click='0' and is_sale='0' and `date` = CURDATE()"),0,0);
$conversionsToday = mysql_result(mysql_query("select count(hit_id) from hits where adv_id = '$ro[adv_id]' and is_sale='1' and `date` = CURDATE()"),0,0);
 
mysql_query("update advertisersinfo set clicksToday = $clicksToday, clicksTotal = (clicksTotal + $clicksToday), impressionsToday = $impressionsToday, impressionsTotal = (impressionsTotal + $impressionsToday), conversionsTotal = (conversionsTotal + $conversionsToday) where adv_id = '$ro[adv_id]' ");
}
mysql_free_result($advertisement_ids);
 
// targeted_ads
$cmp_ids = mysql_query("select cmp_id from adv_campaign");
while($ro = mysql_fetch_assoc($cmp_ids)){
$clicksToday = mysql_result(mysql_query("select count(hit_id) from hits where cmp_id = '$ro[cmp_id]' and is_click='1' and `date` = CURDATE()"),0,0);
 
mysql_query("update adv_campaign set clicksToday = $clicksToday, clicksTotal = (clicksTotal + $clicksToday), remaining_budget = (remaining_budget - expense_today) where cmp_id = '$ro[cmp_id]' ");
 
//camp_appeared
$camp_appeared = mysql_query("select distinct publishersinfo.url, publishersinfo.pid from publishersinfo, hits where hits.cmp_id= '$ro[cmp_id]' and hits.pub_id=publishersinfo.pid order by hits.hit_id, hits.pub_id");
mysql_query("delete from camp_appeared where cmp_id= '$ro[cmp_id]' ");
 
while($cmp = mysql_fetch_assoc($camp_appeared)){
mysql_query(" insert into camp_appeared set url = '$cmp', pid = '$cmp[pid]', cmp_id = '$ro[cmp_id]', updated = curdate() ");

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.