Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Senior Coder
    Join Date
    May 2006
    Posts
    1,683
    Thanks
    28
    Thanked 4 Times in 4 Posts

    If my $data contains a '&' how do I send it in url ?

    Hi,

    I am sending the category name over with the url
    so it can be collected with the GET. using this:

    Code:
    http://www.example.com/sys/detail.php?pd=$prod&a=$cat_name
    The problem occurs when the $cat_name is
    "Cooking & Wine" or "Cats & Dogs"
    then I just get "Cooking" or "Cats" come over.

    Do I need to change the &'s to plus signs (+)
    or maybe 'and' ? or is there a method to send the &'s ?



    .
    If you want to attract and keep more clients, then offer great customer support.

    Support-Focus.com. automates the process and gives you a trust seal to place on your website.
    I recommend that you at least take the 30 day free trial.

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Use urlencode($cat_name) when you are sending it and urldecode($_GET['a']) when you are reading it out again. $_GET['a'] would be your query string you are trying to get.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    Senior Coder
    Join Date
    May 2006
    Posts
    1,683
    Thanks
    28
    Thanked 4 Times in 4 Posts
    Thanks,
    another little thing learnt
    If you want to attract and keep more clients, then offer great customer support.

    Support-Focus.com. automates the process and gives you a trust seal to place on your website.
    I recommend that you at least take the 30 day free trial.


  •  

    Posting Permissions

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