 |
|
|
| View previous topic :: View next topic |
| Author |
Message |
CaidZamora
Joined: 28 Jul 2005 Posts: 4
|
Posted: Thu Jul 28, 2005 9:19 am keep track of referring pages on an index.html page |
|
|
|
How to keep track of the referring pages.
I use PHP to keep track of the referring pages but I can do it only for the second page which uses PHP and mysql (page2.php). I cannot keep track of the pages referring to my index page which is HTML (index.html).
thank you very much for your help. |
|
degsy

Joined: 23 Feb 2005 Posts: 2440 Location: North East, UK
|
Posted: Thu Jul 28, 2005 12:20 pm |
|
|
|
You would need to use server-side scripting if you want the index to record referrers.
The easiest way would be to change your index.html to index.php and add the appropriate coding.
If you don't want to do this because it means changing the extension then if you have apache you can tell it to process your .html files through the PHP processor. |
|
CaidZamora
Joined: 28 Jul 2005 Posts: 4
|
Posted: Fri Jul 29, 2005 12:55 am index.html imposed by ISP. What about this? |
|
|
|
Thank you for the quick response.
the index.html is imposed on me by the ISP
I wanted to use JavaScript to detect the referring page.
If there is a way I can put the referring URL on a variable, call the second page and pass the variable (such as page2.php?URLVAR). Then process the variable with php and store it in a MySql table.
Does this make sens at all?
Thank you very much. I really appreciate your help.
CaidZamora |
|
degsy

Joined: 23 Feb 2005 Posts: 2440 Location: North East, UK
|
Posted: Fri Jul 29, 2005 4:32 am |
|
|
|
You could do it with javascript
| Code: |
<script type="text/javascript">
if(document.referrer){
window.location.replace("page2.php?refer=" + escape(document.referrer));
}
</script>
|
page2.php
| Code: |
<?php
if(isset($_GET['refer'])){
echo "Referrer: " . $_GET['refer'];
}
?>
|
|
|
CaidZamora
Joined: 28 Jul 2005 Posts: 4
|
Posted: Fri Jul 29, 2005 5:26 am Thanks |
|
|
|
Very nice of you. I will try it tonight and let you know.
Thank you very much. |
|
CaidZamora
Joined: 28 Jul 2005 Posts: 4
|
Posted: Wed Aug 03, 2005 2:59 pm |
|
|
|
Did not work.
I inserted the code on the index page and page2.php with the correct file names of course but my webpage was no longer found (ISP=lycos/tripod/uk)
As soon as I take out the code on the first page, I can access the index.html page again. Weird, hein!
Thanks for helping |
|
degsy

Joined: 23 Feb 2005 Posts: 2440 Location: North East, UK
|
Posted: Thu Aug 04, 2005 10:53 am |
|
|
|
| could be a lycos thing. They have a tendancy to mess up scripts. |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|
|
 |
|
|
|
|
|
|
|