SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Oct 2005
    Posts
    26
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    PHP script based on URL

    HI,

    I have some shopping cart software and when you add a product to the basket, the product goes to the basket, and the basket on the right hand side updates, but this is not obvious.

    When the product is added to the basket, the URL changes from the usual SEO friendly URL's to www.domain.com/product.php?xProd=id, so I was thinking of using this to trigger a pop up of some kind when a product is added to the basket.

    I've had a few attempts but haven't been able to get it to work, can someone point me in the right direction?

    I was thinking something along the lines of:

    if (url=xProd) {code for pop up;}

    I can script the code for the pop up myself, but am struggling with the PHP, so if I anyone can help, that would be great.

    Thanks in advance.

  2. #2
    SitePoint Wizard silver trophybronze trophy Cups's Avatar
    Join Date
    Oct 2006
    Location
    France, deep rural.
    Posts
    6,869
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    PHP Code:
    // some rudimentary filtering as well
    // assuming id HAS to be an integer
    // so forcing it to be in order to annihilate
    // any other chars
    if( isset($_GET['id']) && (int)$_GET['id'] > ){

    // echo pop up code onto page




Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •