Re: PHP URL issues

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I wouldn't do the htmlentities() on the whole argument list.  Depending on the Doctype version you have declared and depending how well implemented it is in each browser, it may render the argument list useless.  Unless you declared the strictest and latest version of HTML, all browsers will take a plain & in between arguments instead of an &. 

Haven't you seen the page source as received by the browser?  All browsers give you that option somewhere in their menues.   What does the URL look like in the Location box in the browser?  Just to know whether the problem is in the assembly of the URL or in reading it back.  If the URL shows correctly, try a var_dump($_GET).  Show it within a <pre> section so even whitespace is clearly visible.

Satyam

  ----- Original Message ----- 
  From: Don Don 
  To: Satyam ; PHP List 
  Sent: Tuesday, March 13, 2007 4:01 PM
  Subject: Re:  PHP URL issues


  $query_string = 'testId='. urlencode(trim($tmpTestId)) . '&userId=' . urlencode(trim($tmpUserId));
  print '<p><a href="viewpage.php?'. htmlentities($query_string) .'"> View Values </a></p>';

  on view page i am trying to display the values using $_GET[value] and it sill returns ""

  Satyam <Satyam@xxxxxxxxxxxxx> wrote:
    You should use urlencode() on variables that will go into URL arguments. 
    You might have a whitespace in any of those variables and the URL stops at 
    the first whitespace. If those spaces are at the ends and are not 
    significant, you might want to use trim().




    ----- Original Message ----- 
    From: "Don Don" 
    To: "PHP List" 
    Sent: Tuesday, March 13, 2007 11:37 AM
    Subject: Re:  PHP URL issues


    >
    > I've just noticed that if am passing only one value it works fine, but 
    > when am passing in more than one none works.
    >
    > Why is that or what could be wrong ?
    >
    > e.g. this works
    > echo "$letter_value 
    >  "; on test.php i can display the value of term but with this
    >
    > echo "> href='test.php?term=$letter_value&type=$type_value'>$letter_value 
    >  "; on test.php the values are empty.
    >
    > Nikola Stjelja wrote:
    > If you are going to insert variables like $var_name in a string you need 
    > to enclose that string with double qoutations marks, not single. PHP will 
    > replace var names with values only inside double qoutations.
    >
    > Hope that helps
    >
    > On 3/12/07, Don Don wrote: I've got the following 
    > url rewriting problem.
    >
    > on page 1 i've got this
    >
    > 
    See 

    >
    > and on page 2 i've got this
    >
    > $messageID = $_REQUEST["messageId"];
    > $userID = $_REQUEST["userId"];
    >
    >
    > when i check to see the values of these variables its says its empty, but 
    > when i place my cursor on the link in
    > page 1 i can see both variables being show with their values in the 
    > browser. But on page 2 i cant get the values
    > Something seems wrong perharps ?
    >
    > Cheers
    >
    >
    > ---------------------------------
    > Now that's room service! Choose from over 150,000 hotels
    > in 45,000 destinations on Yahoo! Travel to find your fit.
    >
    >
    >
    > -- 
    > Please visit this site and play my RPG!
    >
    > http://www.1km1kt.net/rpg/Marinci.php
    >
    >
    >
    >
    > ---------------------------------
    > Don't get soaked. Take a quick peek at the forecast
    > with theYahoo! Search weather shortcut.


    --------------------------------------------------------------------------------


    No virus found in this incoming message.
    Checked by AVG Free Edition.
    Version: 7.5.446 / Virus Database: 268.18.10/720 - Release Date: 12/03/2007 
    19:19

    -- 
    PHP General Mailing List (http://www.php.net/)
    To unsubscribe, visit: http://www.php.net/unsub.php






------------------------------------------------------------------------------
  We won't tell. Get more on shows you hate to love
  (and love to hate): Yahoo! TV's Guilty Pleasures list.


------------------------------------------------------------------------------


  No virus found in this incoming message.
  Checked by AVG Free Edition.
  Version: 7.5.446 / Virus Database: 268.18.10/720 - Release Date: 12/03/2007 19:19

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux