473,405 Members | 2,210 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Problems With Refer Script

I've been trying to setup Dean Allen's excellent "Refer" script.
(http://www.textism.com/tools/refer/)

The instructions say to add this code to the bottom of whatever web pages
you want the refer script to track (after the closing </html> tag):

<?php include '<?php echo dirname($_SERVER['SCRIPT_FILENAME']) ?>/refer.php'
?>

Doing so results in the following error on any pages that have the
aforementioned code:

Parse error: parse error in /home/username/public_html/page.php on line 63

The offending line is always the line with the aforementioned PHP code. Does
anyone have any idea what might be causing this not to work? I installed the
refer script into the /refer directory in the web root of my server.

Any help is greatly appreciated.
Jul 16 '05 #1
2 4431
The line is not correct:

<?php include '<?php echo dirname($_SERVER['SCRIPT_FILENAME'])
?>/refer.php'
?>

is not valid. You can not have a <?php and then another <?php. I'm
not sure what you are trying to do, but you probably need something
more like:

<?php
// Untested, use with caution
$location = dirname($_SERVER['SCRIPT_FILENAME'])>;
$location = "$location".'/refer.php' ;
include "$location" ;
?>

You may want to try reading the manual also...

--
Blaine Hilton
http://www.webcalc.net/
On Sun, 03 Aug 2003 06:17:14 GMT, "Mike" <no****@nospam.com> wrote:
I've been trying to setup Dean Allen's excellent "Refer" script.
(http://www.textism.com/tools/refer/)

The instructions say to add this code to the bottom of whatever web pages
you want the refer script to track (after the closing </html> tag):

<?php include '<?php echo dirname($_SERVER['SCRIPT_FILENAME']) ?>/refer.php'
?>

Doing so results in the following error on any pages that have the
aforementioned code:

Parse error: parse error in /home/username/public_html/page.php on line 63

The offending line is always the line with the aforementioned PHP code. Does
anyone have any idea what might be causing this not to work? I installed the
refer script into the /refer directory in the web root of my server.

Any help is greatly appreciated.


Jul 16 '05 #2
> <?php
// Untested, use with caution
$location = dirname($_SERVER['SCRIPT_FILENAME'])>;
$location = "$location".'/refer.php' ;
include "$location" ;
?>


A much shorter version that doesn't depend on temporary variables:
<?php include(dirname($_SERVER['SCRIPT_FILENAME']) . '/refer.php'); ?>
---
Martin Wallgren
Jul 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Kev T | last post by:
Hi, OK Bare with me.New to php and trying to figure this out I trying to do the follwing. I have apage with a checkbox.. It posts to a new page to allow a user to make a paypal order. If...
12
by: Anna | last post by:
Hi all, I posted the same question this afternoon but my message isn't showing up, so I thought I'd give it another try.... in case you should see it later I apologize for posting the same...
11
by: Richard | last post by:
www.geocities.com/r_bullis/test1.html At least this menu works in netscape. Disregarding the colors of the divisions. Those will be removed later. What I'm looking at doing is to have the...
5
by: doc | last post by:
Hi, <SCRIPT LANGUAGE="JavaScript"> function check_selection(selection){ document.pr.n_o.checked=true; } </SCRIPT> <form name=pr action=test.php method=post>
55
by: drhowarddrfine | last post by:
I'm working on a web site that could use some control using js but am concerned about what problems I may have with potential users having their js turned off. Has anyone had any serious problems...
3
by: Indiana | last post by:
Situation: in an ASP page i have created i read a table and i display an ID from the table then i have a button and when i click on a run a new query and then the window has to be closed. (This...
3
by: Namshub | last post by:
I'm having trouble debugging scripts in aspx pages. I have the script explorer working and have 3rd party tools, external scripts and scripts within aspx pages I get the...
3
luke14free
by: luke14free | last post by:
Hi, I have that code and some problems... <script type="text/javascript"> var d = new Date() var ds1 = new Spry.Data.XMLDataSet("data.xml?cacheBuster=" + d.getMilliseconds(),...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.