SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Jun 2009
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    URL encode issue

    I have a a file search_results.html.In this the user can enter a search keyword like 'engineer ' and find out about engineers in his area who are looking for jobs .

    Now a list of engineers is displayed in a table

    Now when the location tab is clicked on the search results all the people sorted by location are seen ...kinda like monster

    My questions when i click on the location I need to pass the varialbe from the first html file ie keyword and the location from the second file ...
    I know it can be done with url encode but how ....
    how do i write the code and then decode ....


    please provide sample

  2. #2
    SitePoint Guru
    Join Date
    Nov 2004
    Location
    Plano
    Posts
    643
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    urlencode and urldecode

    PHP Code:
    $myString "THIS ENGINEER HAS MANY! <CHAR>ACTER'S THAT ARE NOT SAFE FOR TEH URLZZZ";
    $urlEncodedText urlencode($myString);
    $myLink '<a href="/mypage.php?engineerName=' $urlEncodedText '">' $myString '</a>';
    echo 
    'These should be equal: ';
    echo 
    $myString;
    echo 
    ' = ';
    echo 
    urldecode($urlEncodedText); 

  3. #3
    SitePoint Member
    Join Date
    Jun 2009
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by XtrEM3 View Post
    urlencode and urldecode

    PHP Code:
    $myString "THIS ENGINEER HAS MANY! <CHAR>ACTER'S THAT ARE NOT SAFE FOR TEH URLZZZ";
    $urlEncodedText urlencode($myString);
    $myLink '<a href="/mypage.php?engineerName=' $urlEncodedText '">' $myString '</a>';
    echo 
    'These should be equal: ';
    echo 
    $myString;
    echo 
    ' = ';
    echo 
    urldecode($urlEncodedText); 


    My question is how that you have used engineerName in the link can you use this variable in the mypage.php file ....if yes how to access it


Bookmarks

Posting Permissions

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