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 Active Member Premium Member

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

    Nicholas Pope Active Member

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

    Nicholas Pope Active Member

    Messages:
    292
    Likes Received:
    39
    Best Answers:
    0
    Trophy Points:
    90
    #4
    And this is the link in the toolbar afterward

    Code (Text):
    1. http://www.bawd.co.nz/suggest-listing.php?cid=%3C?php%20echo%20$cid;?%3E
    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:
    HTML:
    1. <a href="/suggest-listing.php?cid={$cid}">Suggest Listing</a>
    Garkoni, Mar 12, 2013 IP
  6. deathshadow

    deathshadow Prominent Member

    Messages:
    5,980
    Likes Received:
    827
    Best Answers:
    144
    Trophy Points:
    395
    #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 Active Member

    Messages:
    292
    Likes Received:
    39
    Best Answers:
    0
    Trophy Points:
    90
    #7
    Nicholas Pope, Mar 12, 2013 IP
  8. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,883
    Likes Received:
    33
    Best Answers:
    51
    Trophy Points:
    100
    #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 Active Member

    Messages:
    292
    Likes Received:
    39
    Best Answers:
    0
    Trophy Points:
    90
    #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,883
    Likes Received:
    33
    Best Answers:
    51
    Trophy Points:
    100
    #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 Active Member

    Messages:
    292
    Likes Received:
    39
    Best Answers:
    0
    Trophy Points:
    90
    #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