SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Zealot
    Join Date
    Sep 2007
    Posts
    128
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    I need some help...

    I am working through yanks book on PHP/mySQL, and i have run into a bit of a snag. This code does not seem to be working, with either his example or what I type up. What is the problem with it?

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>Query String Link Example</title>
    <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
    </head>
    <body>
    <p><?php
    $name = $_GET['name'];
    echo "Welcome to our Web site, $name!";
    ?></p>
    </body>
    </html>
    Check out my blog at http://maxnorman.net
    Need advice? Go to http://askthekid.org

  2. #2
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    Are you accessing the page with a query string

    ie. having this at the end of the filename.
    ?name=somename
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  3. #3
    SitePoint Zealot
    Join Date
    Sep 2007
    Posts
    128
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yes. here is the page that links to it:

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>Query String Link Example</title>
    <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
    </head>
    <body>
    <p><a href="welcome1.php?name=Kevin">Hi, I'm Kevin!</a></p>
    </body>
    </html>
    Check out my blog at http://maxnorman.net
    Need advice? Go to http://askthekid.org

  4. #4
    SitePoint Member
    Join Date
    Oct 2007
    Location
    thailand
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you mean that it didn't show "Welcome to our Web site, Kevin !" when you click on
    <a href="welcome1.php?name=Kevin">Hi, I'm Kevin!</a>
    . isn't it ?

  5. #5
    SitePoint Zealot
    Join Date
    Sep 2007
    Posts
    128
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yes. It is not showing up...
    Check out my blog at http://maxnorman.net
    Need advice? Go to http://askthekid.org

  6. #6
    SitePoint Addict CVPer's Avatar
    Join Date
    Sep 2007
    Location
    Vancouver, BC, Canada
    Posts
    233
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i copied your code and it's running perfectly on my machine.
    so you may check whether the file welcome1.php could be found by the caller page or whether your web server can recognize php code if the result page is pure blank.
    * @location Vancouver, BC, Canada
    * @name Steve
    * @job PHP/MySQL, Drupal, WordPress Developer

  7. #7
    SitePoint Zealot
    Join Date
    Sep 2007
    Posts
    128
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    oh, wow. I didn't upload it to my local web server. That is why it is not working.
    lol!
    Check out my blog at http://maxnorman.net
    Need advice? Go to http://askthekid.org


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
  •