Page 1 of 1

check if link is clicked in php

Posted: Mon Mar 27, 2006 5:52 am
by seaten
Im a newbie.

Is it possible in PHP to check if a link was clicked?

I know with for example checkboxes this is possible . e.g.


Code: Select all

if (!$_POST['sel_product_category'] ) {
 $arrErrors['sel_product_category'] = 'Please provide a category name for your Product.';
}

<label for="sel_product_category">Product Category:</label>
 <input name="sel_product_category" type="Text" id="sel_product_category" value="">

Posted: Mon Mar 27, 2006 6:40 am
by Chris Corbyn
Not sure what you mean. If the link points to another part of your website then it's pretty easy by just setting s session variable on the new page.

If the link points to an external website then you just need to go via an intermediate page on your own site first (you'll have seen this done on other sites):

So you'd point your link to something like:

http://www.yoursite.com/redirect.php?si ... google.com

On redirect.php you just check the value of $_GET['site'] and ;)