Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 24

Thread: $_GET variable not working in this case

  1. #11
    Join Date
    Dec 2009
    Posts
    29
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    both of them not working ..
    can u tell me how new orkut works ..
    everything is dynamic over there .. !

    my case is similar to orkut scrapbook ... now . .!

  2. #12
    Join Date
    Dec 2009
    Posts
    29
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    check gmail standard version address bar

    http://mail.google.com/mail/?shva=1#inbox

    similar to what i get
    something/?username=abcd#members
    if i use the GET variable ....

    they too have a ajax page loaded dynamically in the right ... !

  3. #13
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    Yea google and orkut work together. They use and ajax. Trying to explaing everything they have going on would take a while if you just want the address bar to look like that make the form action to "?userid=<?php echo $userid; ?>#home" you'd have to use a sql statment to get the id though and validate the login.

  4. #14
    Join Date
    Apr 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by bluewalrus View Post
    Yea google and orkut work together. They use and ajax. Trying to explaing everything they have going on would take a while if you just want the address bar to look like that make the form action to "?userid=<?php echo $userid; ?>#home" you'd have to use a sql statment to get the id though and validate the login.
    doing this.. it would be better to use $_REQUEST['userid'];

  5. #15
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    The variables in $_REQUEST are provided to the script via the GET, POST, and COOKIE input mechanisms and therefore could be modified by the remote user and cannot be trusted.
    How is REQUEST better?

  6. #16
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    $_REQUEST holds the values of GET, POST and COOKIE, so it is more general and will work regardless of how a variable is sent: for example, if you don't know whether a value will be send in the url or by a form with method="post", or maybe even in a cookie, then that will hold all of them and you don't need to worry about it.

    However, using $_REQUEST is lazy and bad practice if you know the variable will only becoming from one source. It's like a lesser version of register_globals, though at least it doesn't end up conflicting with anything else in the script.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  7. #17
    Join Date
    Dec 2009
    Posts
    29
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    whatever variable passing it is , in the child page it is not working
    i tried this
    Code:
    action="?user=<?php echo $userid; ?>#members"
    when i use the $_get/post/request var in members.php it is not working
    BUT when i use it in the main index.php it is working ......
    .........

  8. #18
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Is that the action of a form? You can use get variables as the action only if the form itself is set to method="post", so that the values do not conflict.
    action="?ex=ample" would remove that when submitted if the method="get".
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  9. #19
    Join Date
    Dec 2009
    Posts
    29
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    yeah .. i dint use like that ...

    even when directly using address bar , navigating to
    Code:
    something/?user=abcd#members
    doesnt work

    ....

    is it a problem that the entire page "members.php" is included as innerHTML ...

  10. #20
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Then that is not part of the request, so it won't be available in the php. Sorry if I'm not helping-- I jumped in this halfway.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

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
  •