SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Jul 2007
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Problem in Kevin's book

    Working on page 51-53. Did the examples. Did not work. When I click the link I get the source code for the second page. I changed the link from relative to
    http://localhost/mysites/welcome1.ph...&lastname=Yank and this worked. this is on a mac. Why didn't the relative link work?

  2. #2
    In memoriam gold trophysilver trophybronze trophy Dan Schulz's Avatar
    Join Date
    May 2006
    Location
    Aurora, Illinois
    Posts
    15,476
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Which book are you referring to?

  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)
    This is from Build Your Own Database Driven Website Using PHP & MySQL, 3rd Edition.

    Any chance you opened the first page (containing the link) directly from your hard drive (e.g. with File->Open, or by double-clicking the file on your hard drive)? This would cause the browser to load the relative link from your hard drive as well, instead of requesting it from your web server.

    By changing the link to an absolute URL, you have made sure that the linked page is being loaded from the web server, but the page containing the link is probably still being loaded directly from your hard drive.

    PHP code is only processed when a file is requested through your web server, so you need to make sure you always load pages in your browser with a proper http:// URL, not a file:// URL (which loads the file directly from your hard drive).
    Kevin Yank
    CTO, sitepoint.com
    I wrote: Simply JavaScript | BYO PHP/MySQL | Tech Times | Editize
    Baby’s got back—a hard back, that is: The Ultimate CSS Reference

  4. #4
    SitePoint Member
    Join Date
    Jul 2007
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    That was it

    Thanks Kevin. That did it.


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
  •