Forum Moderators: phranque

Message Too Old, No Replies

Do you know this trick?

Make a link appear on certain visit

         

GuruSan

8:01 am on Nov 18, 2008 (gmt 0)

10+ Year Member



Hi

I want a particular link to display on my webpage (homepage) only on 2nd or subsequent visit by the visitor. (Presume that the visitor does not clear the cookies during these visits.)
This link should not be visible on first visit to the webpage (homepage).

Can anyone help?

Thanks!

bill

8:17 am on Nov 18, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Welcome to WebmasterWorld GuruSan.

It would really depend on how your site operates, but essentially yes, you could set a cookie and then retrieve that value and show a visitor specific content based on that value.

GuruSan

10:21 am on Nov 18, 2008 (gmt 0)

10+ Year Member



Thanks Bill.

I have embedded a flash element on my homepage in html. The visitor proceeds by clicking on the flash element.

Although I know what you are saying w.r.t. to setting a cookie etc.; but I do not know how to do this in practice. Would you mind sharing something definite like say a code snippet to do this?

Or where else (or how) can I get to know this better?

-Ashish

Habtom

10:37 am on Nov 18, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You could do something like the following in PHP.

<?php

if (!isset($_COOKIE['Visited'])) {
setcookie('Visited', $value);
} else {
echo "<a href=\"\">your link here</a>";
}

?>

Habtom

10:38 am on Nov 18, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Details of how you set your cookie is here. [php.net]

GuruSan

8:31 am on Nov 19, 2008 (gmt 0)

10+ Year Member



Wow Habtom! Thank you very much for this great help! will try this and get back here with my progress/result.