Need help in this work

Discussion in 'PHP' started by balasun, Aug 3, 2008.

  1. #1
    Hello all,

    I need ur help in below work,

    I used header to redirect browser with two variables like below:

    header('location:addpageconetent.php?mcid='.$mcid.'&scid='.$scid.'&page=success');
    PHP:
    The rediection is works good. But when i refresh page again %20 is added in the url everytime. like below;

    http://localhost/sylvania/admin/addpageconetent.php?mcid=1&scid=%2019&page=success
    PHP:
    It causes some problem.

    Please help me about how to avoid this % symbol when page refresh.
     
    balasun, Aug 3, 2008 IP
  2. xlcho

    xlcho Guest

    Messages:
    532
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #2
    %20 is a space. Check your variable $scid for any spaces, cause if you pasted the code directly, this is your problem - you have a space at the beginning of $scid. If you wanna make sure there are no spaces in the var you can do something like this:
    $scid = str_replace(' ', '', $scid);
    PHP:
     
    xlcho, Aug 3, 2008 IP
  3. balasun

    balasun Peon

    Messages:
    29
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks for your reply..
     
    balasun, Aug 3, 2008 IP
  4. php-lover

    php-lover Active Member

    Messages:
    261
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    58
    #4
    header('location:addpageconetent.php?mcid='.urlencode($mcid).'&scid='.urlencode($scid).'&page=success');
    PHP:
     
    php-lover, Aug 4, 2008 IP