<? DEW-CODE.COM  

Downloads

Assorted scripts  (1)
DewNewPHPLinks  (9)





Lost Password?
No account yet? Register

Dew-Code Newsfeed

Resources


 USdigitalcable.com

Dew-Code
Welcome, Guest
Please Login or Register.    Lost Password?
PHP Links Reports 1.0 (1 viewing) (1) Guest
Go to bottom Post Reply Favoured: 0
TOPIC: PHP Links Reports 1.0
#789
adktech (User)
Junior Boarder
Posts: 21
graphgraph
User Offline Click here to see the profile of this user
PHP Links Reports 1.0 3 Years ago Karma: 0  
QUOTE:

From; http://www.dew-code.com/component/option,com_jooget/Itemid,27/task,detail/id,3/

Please note, this does not work correctly if you have outbound clicks set to be dilspayed with a frame.

Are there any plans to add Reports support to outbound clicks set to be displayed with a frame?
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#790
Dewed (Admin)
Admin
Posts: 603
graph
User Online Now Click here to see the profile of this user
Dew-Code.com
Re:PHP Links Reports 1.0 3 Years ago Karma: 9  
Edit out_frame.php and locate these lines...
Code:

where ID = '$ID' "); }
Just above the closing curly bracket "}" , add these lines
Code:

$page_desc = "<a href=./edit_site.php?ID=".$ID.">EDIT</a>"; $user_agent = getenv("HTTP_USER_AGENT"); $ip = getenv("REMOTE_ADDR"); $date_added = date("Y-m-d"); $table_name = "page_track"; $sql = "insert into $tb_track values ('', '$ID', '$page_desc', '$user_agent', '$ip', '$date_added')"; $result = mysql_query($sql) or die (mysql_error());
 
Report to moderator   Logged Logged  
 
Nothing to it but to Dew it !
Dew-Code.com
  The administrator has disabled public write access.
#792
adktech (User)
Junior Boarder
Posts: 21
graphgraph
User Offline Click here to see the profile of this user
Re:PHP Links Reports 1.0 3 Years ago Karma: 0  
An error has popped up but doesn't always show itself when clicking on a sites link.
QUOTE:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'values ('', '25', 'EDIT', 'Mozilla/4.0 (compat' at line 1

QUOTE:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'values ('', '84', 'EDIT', 'Mozilla/4.0 (compat' at line 1


('', '25', 'EDIT'
('', '84', 'EDIT'
etc.
Are the link id's
I comment the new line out and it doesn't error at all.
Its fine after a hitting f5 it just starts working.
Can't nail down a common cause.
And, its not generating new reports when using frames.

this is the current out_frame.php code I have.
QUOTE:
<?

// *******************************************************************

// out_frame.php

// *******************************************************************


include("include/config.php");

include("include/functions.php");

include("include/common.php");

$language = $gl["Language"];

include("include/lang/$language.php");

include("include/session.php");

session_start();

$ID=$_GET['ID'];

$REMOTE_ADDR = $_SERVER['REMOTE_ADDR'];

if(isset($ID)){

$get_site = sql_query("

select

SiteURL,

OutIP

from

$tb_links

where

ID = '$ID'

");

$get_row = sql_fetch_array($get_site);

$url = $get_row["SiteURL"];

$SID = mysql_affected_rows();

}

if($REMOTE_ADDR != $get_row["OutIP"]){

$result = sql_query("

update

$tb_links

set

HitsOut = HitsOut + 1,

OutIP = '$REMOTE_ADDR',

LastUpdate = LastUpdate

where

ID = '$ID'

");
$page_desc = "<a href=./edit_site.php?ID=".$ID.">EDIT</a>"; $user_agent = getenv("HTTP_USER_AGENT"); $ip = getenv("REMOTE_ADDR"); $date_added = date("Y-m-d"); $table_name = "page_track"; $sql = "insert into $tb_track values ('', '$ID', '$page_desc', '$user_agent', '$ip', '$date_added')"; $result = mysql_query($sql) or die (mysql_error());
}

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"

"DTD/xhtml1-frameset.dtd">

<html>

<head>

<title>PHP-TV</title>

</head>

<frameset border="0" frameborder="0" rows="100,*">

<frame name="top" src="top_frame.php?<?=session_name()?>=<?=session_id()?>" scrolling="no" marginwidth="10" marginheight="5" topmargin="5" leftmargin="10" />

<frame name="main" src="<?=$url?>" scrolling="auto" marginwidth="0" marginheight="0" topmargin="0" leftmargin="0" />

</frameset><noframes></noframes>

</html>



 
Report to moderator   Logged Logged  
 
Last Edit: 2009/01/25 12:53 By adktech. Reason: Clarification of fact
  The administrator has disabled public write access.
#794
Dewed (Admin)
Admin
Posts: 603
graph
User Online Now Click here to see the profile of this user
Dew-Code.com
Re:PHP Links Reports 1.0 3 Years ago Karma: 9  
Possibly $table_name = "page_track"; is causing the issue because the mysql table name differs, .


In the 2.1 version, this variable is set in the config.php file,so if you have defined it in that file, remove "$table_name = "page_track";" otherwise, make sure the mysql table exists.


Another possibility is your version of MySQL simply doesn't like '' to indicate a NULL value which I've ran into, on version 4.x I believe. If thats the case, replacing both apostphes with NULL should work.
 
Report to moderator   Logged Logged  
 
Nothing to it but to Dew it !
Dew-Code.com
  The administrator has disabled public write access.
#795
Dewed (Admin)
Admin
Posts: 603
graph
User Online Now Click here to see the profile of this user
Dew-Code.com
Re:PHP Links Reports 1.0 3 Years ago Karma: 9  
And of course 3 seconds after posting, another possibility comes to mind.
There may be characters in the browser's agent that cause issues when inserting them

As of PHP 4, you can use the mysql_real_escape_string function to prepare the string for use in a query ..

So change this ..
Code:

$user_agent = getenv("HTTP_USER_AGENT");
to this
Code:

$user_agent = mysql_real_escape_string(getenv("HTTP_USER_AGENT"));
 
Report to moderator   Logged Logged  
 
Nothing to it but to Dew it !
Dew-Code.com
  The administrator has disabled public write access.
#796
adktech (User)
Junior Boarder
Posts: 21
graphgraph
User Offline Click here to see the profile of this user
Re:PHP Links Reports 1.0 3 Years ago Karma: 0  
page_track is in the database.

applied
QUOTE:
$user_agent = mysql_real_escape_string(getenv("HTTP_USER_AGENT"));

Error
QUOTE:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'values ('', '8', 'EDIT', 'Mozilla/4.0 (compatib' at line 1


It only seems to error once and after the site is visited it doesnt error.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
Go to top Post Reply
get the latest posts directly to your desktop
Outsource your projects to thousands of programmers at
ScriptLance.com
Newsflash
Interested in
advertising?

This space for rent!

Sign up for PayPal and start accepting credit card payments instantly.
Copyright Dew-Code 2008