Professional Web Applications Themes

Problems With Refer Script - PHP Development

I've been trying to setup Dean Allen's excellent "Refer" script. ([url]http://www.textism.com/tools/refer/[/url]) 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: P error: p 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 ...

  1. #1

    Default Problems With Refer Script

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

    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:

    P error: p 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.


    Mike Guest

  2. #2

    Default Re: Problems With Refer Script

    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
    [url]http://www.webcalc.net/[/url]


    On Sun, 03 Aug 2003 06:17:14 GMT, "Mike" <nospamnospam.com> wrote:
    >I've been trying to setup Dean Allen's excellent "Refer" script.
    >([url]http://www.textism.com/tools/refer/[/url])
    >
    >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:
    >
    > P error: p 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.
    >
    Blaine HIlton Guest

  3. #3

    Default Re: Problems With Refer Script

    > <?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
    Martin Wallgren Guest

Similar Threads

  1. Problems with login script-PHP/Mysql
    By redman181 in forum Macromedia Dynamic HTML
    Replies: 0
    Last Post: April 29th, 01:53 PM
  2. Problems with script
    By Kev T in forum PHP Development
    Replies: 0
    Last Post: August 3rd, 11:06 AM
  3. REFER VINTAGE, LEGACY, OBSOLETE APPLE MACINTOSH PROBLEMS TO:
    By BandR Svcs in forum Mac Networking
    Replies: 0
    Last Post: August 20th, 06:38 PM
  4. java script problems
    By Phil in forum Windows XP/2000/ME
    Replies: 2
    Last Post: July 19th, 04:05 PM
  5. Perl Script Problems
    By Robert in forum PERL Miscellaneous
    Replies: 12
    Last Post: July 9th, 10:27 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139