| | |
Extract addess bar url
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
Hi,
I was making a shopping cart and when a person check the cart.
There is a button Continue Shopping.
What should i do so that he/she should go to the same page from which he/she check cart.
I think that if we can catch/extract the addressbat url then we sha;l; be able to do this.
Please provide solutions for that.
I was making a shopping cart and when a person check the cart.
There is a button Continue Shopping.
What should i do so that he/she should go to the same page from which he/she check cart.
I think that if we can catch/extract the addressbat url then we sha;l; be able to do this.
Please provide solutions for that.
In the text/image link to shopping cart, add extra information about the current page, for example xyz.com?ref=abc. The information in ref can then retrive in the shopping cart so that sending user back to the previous page (eg. abc.php). Do not use $_SERVER['HTTP_REFERER'] as not all browser support it. if you are using form, then use hidden field to pass ref information to the shopping cart (I use this on my clients' store).
Last edited by zippee; Sep 15th, 2006 at 2:56 pm.
Ecommerce-Web-Store.com Building Your e-Business.
Passing the page URL using a hidden field is the safest way to do it.
You could use $_SERVER['HTTP_REFERER'], but as zippee mentioned, not all browsers pass the info. You could just simple test it for a value. If a value exists, display the Continue Shopping button with the link. If it doesn't exist, don't display the button.
My main business is SEO. IMHO, you shouldn't pass values in the URL like that if you are using hyperlinks. It creates multiple URLs that all represent the same page, which is guaranteed to cause problems with duplicate content penalties with the search engines. You could overcome those issues by either adding the proper meta tags to the cart page to prevent the indexing and archiving of the page, or by adding the rel="nofollow" attribute to the hyperlink, or by using a form button to link to the cart.
You could use $_SERVER['HTTP_REFERER'], but as zippee mentioned, not all browsers pass the info. You could just simple test it for a value. If a value exists, display the Continue Shopping button with the link. If it doesn't exist, don't display the button.
My main business is SEO. IMHO, you shouldn't pass values in the URL like that if you are using hyperlinks. It creates multiple URLs that all represent the same page, which is guaranteed to cause problems with duplicate content penalties with the search engines. You could overcome those issues by either adding the proper meta tags to the cart page to prevent the indexing and archiving of the page, or by adding the rel="nofollow" attribute to the hyperlink, or by using a form button to link to the cart.
Last edited by TopDogger; Sep 17th, 2006 at 12:31 pm.
![]() |
Similar Threads
- can not browse using url's only ip's work (Viruses, Spyware and other Nasties)
- IE Address Bar hijacked by http://s5.th.msie.cc/ index.php (CWShredder.exe) (Viruses, Spyware and other Nasties)
- search bar (Viruses, Spyware and other Nasties)
- IE URL Suffix (Web Browsers)
Other Threads in the PHP Forum
- Previous Thread: PHP/Mysql Flash problem !!!!1
- Next Thread: Rich Text Editor
| Thread Tools | Search this Thread |
advanced alerts apache api archive array autosuggest beginner binary broken cakephp checkbox class clients cms code cron curl database date datepart display dynamic echo email emptydisplayvalue eregi error execute explodefunction file files folder form forms function functions google hack head href htaccess html if...loop image include insert ip javasciptvalidation javascript joomla keywords library limit link login mail matching menu mlm multiple mysql object oop password paypal pdf php phpincludeissue query radio random recursion recursive remote script search searchbox server sessions shot smarty source space speed sql syntax system table tutorial update upload url validator variable vbulletin video web website youtube





