How can I do this?

Discussion in 'PHP' started by Z33M@N, Feb 11, 2009.

  1. #1
    I'm busy working on a classifieds ads script that I'm building from scratch, I'm still relatively new to php.

    when I call data from the ads table in mysql it shows all the results in that category in a page. Now what I need to do is to be able to click on one of the results and it will open a page called showad.php and it should show that particular ad on that page with a form to be able to email the person.

    So how do I call the data to point a link to the page showad.php and show the ad details on that page? :)

    This should work similar to the gumtree.com ads.

    Any help would be appreciated, thanks in advance! :)
     
    Z33M@N, Feb 11, 2009 IP
  2. crivion

    crivion Notable Member

    Messages:
    1,669
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    210
    Digital Goods:
    3
    #2
    When you extract all ads just do an url like
    <a href=showads.php?adid=$row[id]>show ad</a>
    Basically that means you need to pass the add of entry into db to showads.php page
    then in showads.php you just add condition where id = $_GET[adid] into your query
     
    crivion, Feb 11, 2009 IP
  3. Z33M@N

    Z33M@N Peon

    Messages:
    116
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Hi thanks for this, I'm going to try this out. :D
     
    Z33M@N, Feb 11, 2009 IP