SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Jun 2007
    Location
    Guelph Canada
    Posts
    42
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    samplepage.php won't fully execute

    Hello

    I'm working in the Sitepoint book build your own website using php and mysql and specifically samplepage.php on page 64

    It seems to pick up the name alright and place it in the url however it doesn't post my name and the paragraph that is indicated on page 66.

    Here is the code
    Code:
    <body>
    <?php if (!isset($GET['name']) or $_GET['name'] == ''): ?>
    
    <form action= "<?php echo $_SERVER['PHP_SELF']; ?>" method="get">
    <label>Please enter your Name: <input type="text" name="name" /></label>
    
    
    <input type="submit" value="Enter your name here" />
    </form>
    
    <?php else: ?>
    
    <p> Your name: <?php echo $_GET['name']; ?></p>
    
    <p>This paragraph contains a <a href="newpage.php?name=<?php echo urlencode($_GET['name']);?>">link</a> that passes the name variable on to the next document.</p>
    
    <?php endif; ?>
    
    </body>

  2. #2
    SitePoint Enthusiast SilkySmooth's Avatar
    Join Date
    May 2003
    Location
    In the PHP Engine :-)
    Posts
    58
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The first $_GET has a missing underscore.
    ---------------------
    -- SilkySmooth --
    ---------------------
    Directory Share | Free phpLD Mods

  3. #3
    play of mind Ernie1's Avatar
    Join Date
    Sep 2005
    Posts
    1,252
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    $GET['name']
    //to
    $_GET['name'
    my mobile portal
    ghiris.ro

  4. #4
    SitePoint Enthusiast
    Join Date
    Jun 2007
    Location
    Guelph Canada
    Posts
    42
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you

    Silkysmooth and ernie1

    Scott


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
  •