#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    9
    Rep Power
    0

    Special charachter value not shows


    I am getting the value of some string value including special character from table. Its shows in the address bar but when I echo in php it shows only first word. Could you
    please help me. Thanks

    My actual Value is Diary & Eggs

    In address bar it shows in this format

    (some address here)/freshNfruity1/freshNfruity/subProducts.php?selCatagory=6%20+%20&mainCatName=Diary%20&%20Eggs


    and in the form I recieved this value using this
    $mainCatName = isset($_REQUEST['mainCatName'])?$_REQUEST['mainCatName']:"";


    AND when I use the echo like

    echo $mainCatName;

    The result is shows only
    Diary

    Hope you understand my point.
  2. #2
  3. --
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2012
    Posts
    3,959
    Rep Power
    1014
    Hi,

    the URL is broken. A "&" separates the URL parameters, so it must not appear within parameter values. You need to encode it with %26 or using urlencode().
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    9
    Rep Power
    0
    Originally Posted by Jacques1
    Hi,

    the URL is broken. A "&" separates the URL parameters, so it must not appear within parameter values. You need to encode it with %26 or using urlencode().
    Thanks for your reply. Could you please tell me some detail that how I can use urlencode().

    Like echo urlencode($mainCatName);

    Thanks
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    9
    Rep Power
    0
    Originally Posted by Jacques1
    Hi,

    the URL is broken. A "&" separates the URL parameters, so it must not appear within parameter values. You need to encode it with %26 or using urlencode().
    Thank you very much for your help I sort out now.

    Thanks once again

IMN logo majestic logo threadwatch logo seochat tools logo