You are here: Problem with HTTP_REFERER when clicking on refresh button « PHP Programming Language « IT news, forums, messages
Problem with HTTP_REFERER when clicking on refresh button

Posted by Martien van Wanrooij on 05/13/07 14:37

In a simple webshop application I am trying to check that the "shopping
cart" only should be "filled" when you choose an article in "meerinfo.php"
and click on a link to "winkelwagen.php". It works fine in that sense that
when I would enter in the browser "www.mysite.php/winkelwagen?id=5"it will
be ignored.
However when I go from meerinfo.php to winkelwagen.php , the article is
added again and again to the shopping cart when I click on the refresh
button in Internet Explorer. Is there a way to avoid that?

This is the code in winkelwagen.php

if(!isset($_SESSION['artikelen'])) //initiate the array when the first
article is added to the shopping cart
{
$_SESSION['artikelen'] = array();
}
$waarvandaan = $_SERVER['HTTP_REFERER'];
if (strstr($waarvandaan, "meerinfo.php"))
{
$id = $_GET['id'];
$_SESSION['artikelen'][] = $id;
}

Thanks for any help (or suggestions for articles that discuss this topic)

Martien

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация