1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Button Link that links to external php file

Discussion in 'PHP' started by Nicholas Pope, Mar 11, 2013.

  1. #1
    I hope this makes sense, I'm new to this, Here is my code:

    <p class="buttons-block">
    <a href="???????" class="btn btn-large btn-block btn-primary">Suggest Listing</a>
    </p>

    This is the button code, I need to link to a Suggest listing page and get the category they are on when they click it.

    The link that normally deals with this takes current category when someone clicks submit listing.

    The page that this deals with in the admin panel has an option to use external file and it uses /suggest-listing.php?cid={$cid} how can I use the button above and still get current category. cheers for your help
     
    Nicholas Pope, Mar 11, 2013 IP
  2. VideoWhisper.com

    VideoWhisper.com Well-Known Member

    Messages:
    330
    Likes Received:
    6
    Best Answers:
    2
    Trophy Points:
    113
    Digital Goods:
    2
    #2
    <a href="/suggest-listing.php?cid=<?php echo $cid;?>">Suggest Listing</a>
     
    VideoWhisper.com, Mar 11, 2013 IP
  3. Nicholas Pope

    Nicholas Pope Well-Known Member

    Messages:
    357
    Likes Received:
    56
    Best Answers:
    0
    Trophy Points:
    165
    #3
    That gives me 403.htm error
     
    Nicholas Pope, Mar 11, 2013 IP
  4. Nicholas Pope

    Nicholas Pope Well-Known Member

    Messages:
    357
    Likes Received:
    56
    Best Answers:
    0
    Trophy Points:
    165
    #4
    And this is the link in the toolbar afterward

    http://www.bawd.co.nz/suggest-listing.php?cid=%3C?php%20echo%20$cid;?%3E
    Code (markup):
     
    Nicholas Pope, Mar 11, 2013 IP
  5. Garkoni

    Garkoni Active Member

    Messages:
    213
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    60
    #5
    Try this:
    <a href="/suggest-listing.php?cid={$cid}">Suggest Listing</a>
    HTML:
     
    Garkoni, Mar 12, 2013 IP
  6. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,998
    Best Answers:
    253
    Trophy Points:
    515
    #6
    1) What makes the text "Suggest Listing" a paragraph? Answer, it isn't -- there is no grammatical or structural reason for that to be inside a P.

    2) It probably also doesn't need FOUR classes that appear to be completely presentational -- that might as well be HTML 3.2 / presentational markup (no matter what the re-re's writing skins for turdpress or doomla might tell you)

    though really I can't even make sense out of what you are asking -- put the link you want in the anchor... I'm not certain how/why you'd be having trouble doing that... though I suspect this tiny snippet isn't telling us the whole story since we don't know if you're inside echo like a good little dooby, how/if you need to handle quotes, or if you need to open and close PHP every five characters like the garbage code VideoWhisperer posted.

    You've basically given us a half inch corner ripped off a notebook page to diagnose a problem with the entire notebook -- and the answers so far reflect this.
     
    deathshadow, Mar 12, 2013 IP
  7. Nicholas Pope

    Nicholas Pope Well-Known Member

    Messages:
    357
    Likes Received:
    56
    Best Answers:
    0
    Trophy Points:
    165
    #7
    Nicholas Pope, Mar 12, 2013 IP
  8. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #8
    Then it would have been nice if you had at least told us that you were using some kind of templating engine.
     
    Rukbat, Mar 15, 2013 IP
  9. Nicholas Pope

    Nicholas Pope Well-Known Member

    Messages:
    357
    Likes Received:
    56
    Best Answers:
    0
    Trophy Points:
    165
    #9
    No need to be like that, I did say in the very first sentence I'm new to this, so i had no idea about that information.
     
    Nicholas Pope, Mar 15, 2013 IP
  10. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #10
    You were asking us to translate something into another language - without telling us what language. Not an exact analogy, but close. You're asking for a PHP solution to a templating engine (which isn't PHP, it' a different language) question. How were we supposed to know that you wanted the answer as template code, not PHP code?
     
    Rukbat, Mar 15, 2013 IP
  11. Nicholas Pope

    Nicholas Pope Well-Known Member

    Messages:
    357
    Likes Received:
    56
    Best Answers:
    0
    Trophy Points:
    165
    #11
    Are you blind or just thick, I am completely new to this, i dont know about template code or php code I was asking what I thought was a simple question, obviously it wasnt simple because I missed information that I didnt know about, my apologies that my noobyness got you irate
     
    Nicholas Pope, Mar 15, 2013 IP