Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

quotes into web address

  • 12-09-2007 02:54PM
    #1
    Registered Users, Registered Users 2 Posts: 91 ✭✭


    i have a php string that holds the value of a name. so it could possibly be something like o'connor etc. i know of the stripslashes($str) function which is fine and it gets rid of the value on the current page so that when you're doing searches in SQL databases it checks them correctly. however i need to put this same value into a link for previous and next pages. currently i have

    echo "<a href='employee.php?kw=".($name)."&dpt_id=".($dpt)."&sortby=".($sortby)."&page=".(page +1)."'class='text>Next>></a>";

    for the link to each next page


    but if you put in o'c as the value for the $name value then o\'c is now the value. Now the backslash is part of the $name and stops everything to the right of o\



    can #%39; help with this and how is it implemented?


Comments

  • Registered Users, Registered Users 2 Posts: 706 ✭✭✭DJB


    replace ' with %27

    You need to do a URL Encode. Not sure of the exact command in PHP is but it's definately there.

    When you use urlencode, it replaces the ' with %27. There's loads of them for spaces, underscores, etc.

    See: http://php.net/urlencode

    Rgds,

    Dave


Advertisement