SitePoint Sponsor

User Tag List

Results 1 to 7 of 7

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Aug 2000
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    My system is Windows 2000 with:
    PHP4 PL2
    Apache 1.3.21

    I have been starting my PHP learning from resource on the web.
    When I read the following site http://www.webmasterbase.com/article...id=228&pid=301
    I follow their instruction for the URL query string example and $name, something wrong.
    It only show "Welcome to our Web site, ! " in the welcome.php

    Same problem occured before for form submitting.

    It seems that my server do not response to any variable function. I just don't want to continue if the problem is not solved

    Anybody who can kindy suggest solution for my case?

    Thanks a lot


  2. #2
    SitePoint Wizard jonese's Avatar
    Join Date
    Jul 1999
    Location
    Powder Springs GA (Atlanta)
    Posts
    1,238
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    can you post the URL that you are having problems with and the PHP code that you are using?

    this might help us to help you better.

    One thing you can check right away is the spelling of your variable $name. make sure that you have it spelled the same and that it's also done the same. IE $name and not $NaMe.

    ------------------
    Eric Jones - SitePoint Administrator
    http://www.sitepoint.com
    eric@sitepoint.com

  3. #3
    SitePoint Author Kevin Yank's Avatar
    Join Date
    Apr 2000
    Location
    Melbourne, Australia
    Posts
    2,571
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Also make sure register_globals is set to On in your php.ini file.


    ------------------
    -Kevin Yank.
    http://www.SitePoint.com/
    Helping Small Business Grow Online!

  4. #4
    SitePoint Enthusiast alf's Avatar
    Join Date
    Aug 2000
    Posts
    39
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, I am facing the same problem too. I had check that both track_var and register_global is on.
    This is the code for posting data to another php file

    file 1.php3
    <html>
    <head>
    <title></title>
    </head>

    <body>

    <a href="2.php3"firstname=Kevin&lastname=Yank">Hi, I'm Kevin Yank!</A>

    </body>
    </html>

    file 2.php3
    <html>
    <head>
    <title></title>
    </head>

    <body>

    <?php
    echo("Welcome to our Web site, $firstname $lastname!");
    ?>

    </body>
    </html>


  5. #5
    SitePoint Zealot oodie's Avatar
    Join Date
    Jul 2000
    Location
    Misty Mountain
    Posts
    125
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    <a href="2.php3"firstname=Kevin&lastname=Yank">Hi, I'm Kevin Yank!</A>
    It should be
    Code:
    <a href="2.php3?firstname=Kevin&lastname=Yank">Hi, I'm Kevin Yank!</A>
    You have to separate the filename and variables with '?'

  6. #6
    SitePoint Enthusiast alf's Avatar
    Join Date
    Aug 2000
    Posts
    39
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi, thanks for pointing me the error, I tried <a href="2.php3"firstname=Kevin&lastname=Yank">Hi, I'm Kevin Yank!</A> but still can't work. If I use $HTTP_POST_VARS[firstname] I can able to get Kevin as firstname. I don't think this is the correct way to get the post data, am I right? Or can I get it in other way? Hope anyone can answer my question. Thanks!

  7. #7
    SitePoint Zealot oodie's Avatar
    Join Date
    Jul 2000
    Location
    Misty Mountain
    Posts
    125
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't think this is the correct way to get the post data, am I right?
    Actually, this is the recommended way to use GET/POST variables since it's more optimized (by set register_globals to Off and track_vars to On)

    Try to check with phpinfo() and see if it correctly loads the configuration from php.ini


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
  •