Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2004

    Unanswered: echo problem

    I am a beginner in PhP
    I am running php an apache server

    Is this code correct? Is there a config problem I dont know about?

    echo "$username";
    when I go to http://myip/test?username=me
    I should recive a page with "me" on it. but I get a blank page instead. why?
    Last edited by Lord_Saroman; 12-01-04 at 04:14.

  2. #2
    Join Date
    Mar 2003
    The Bottom of The Barrel
    Provided Answers: 1
    I'm a n00b, so this is a shot in the dark...


    echo $_REQUEST['username'];
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  3. #3
    Join Date
    Jul 2003
    Teddy's right. It has to do with global variables. Originally your method would have worked - because PHP automatically made all of your $_REQUEST, $_GET, $_POST etc items into normal variables.

    Now you actually have to point to the array. (instead of just $PHP_SELF to get the name of your script - you need $_SERVER['PHP_SELF']).

    As you've passed the username as a GET variable (in the URL - as opposed to a POST form) - you can refer to it as $_GET['username']. The $_GET is more specific (as you know the variable is being taken from the URL).
    Joel Dixon
    Analyst Programmer
    Melbourne, Australia

  4. #4
    Join Date
    Aug 2004
    thanks, this worked fine.
    I set the "global variables = on" to make MY code work..

Posting Permissions

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