SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    SitePoint Enthusiast Prorsum's Avatar
    Join Date
    Dec 2012
    Posts
    54
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy Exercises in PHP & MySql Novice to Ninja

    Hi there,
    I'm working on Chapter 4: Publishing MySql Data on the Web.
    I've downloaded the code and I'm using the folder structure as it is.
    I then click here: http://localhost/php-ninja/chapter6/ and then the directory totaljokes-global1
    But that page http://localhost/php-ninja/chapter6/totaljokes-global1/ doesn't show anything. Is that what is supposed to happen?

    The same happens here in Chapter 7: A content management system, when I look at the folders through this link http://localhost/php-ninja/chapter9/admin/jokes/, that pages doesn't show anything.

    See attached files with screenshots of both cases. The names of the first set of photos refers to chapter 7.

    Thanks!
    Attached Images Attached Images

  2. #2
    SitePoint Evangelist
    Join Date
    Aug 2006
    Location
    Nantwich, Cheshire
    Posts
    452
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    It depends on the configuration of your local server. Normally the server will be configured to look for one or more 'default home' pages which it will show when a directory is opened, often named index, default, home and with a suitable extension .php, .html, .htm, .asp or whatever. So have a look in those directories for something that looks like it ought to be the default page, then check your server config to see if it matches, or add that name onto the end of the url just to get it running.
    http://www.firenza.net - my homage to a car from the 1970s

  3. #3
    SitePoint Enthusiast Prorsum's Avatar
    Join Date
    Dec 2012
    Posts
    54
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What I'm saying is all the other files in the book work as they are when you download them with the file structure as it is -after changing username and password for the connection files. But those two don't.
    The files I was referring to are in chapter 6 and 7. Here's the photo with the file structure as it is: http://localhost/php-ninja/chapter6/totaljokes-global1/ and http://localhost/php-ninja/chapter7/jokes/
    Screen Shot 2013-10-03 at 09.06.31.pngScreen Shot 2013-10-03 at 09.07.08.png

    And here's what you see when you see it on the screen (not) Screen Shot 2013-10-03 at 09.16.48.pngScreen Shot 2013-10-03 at 09.17.01.pngworking:

  4. #4
    SitePoint Enthusiast Prorsum's Avatar
    Join Date
    Dec 2012
    Posts
    54
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The CMS for the joke database here: http://localhost/php-ninja/chapter7/admin/ doesn't show anything when you click on the options. Screen Shot 2013-10-03 at 11.16.38.pngWhy? Screen Shot 2013-10-03 at 11.15.35.png

  5. #5
    SitePoint Addict bronze trophy Hall of Famer's Avatar
    Join Date
    Apr 2013
    Location
    Ithaca
    Posts
    370
    Mentioned
    6 Post(s)
    Tagged
    2 Thread(s)
    I have a server from a webhost, it saves me trouble from setting up a server and maintaining it. Reality is a good programmer may not be a good server admin, its unnecessary anyway.

  6. #6
    SitePoint Evangelist
    Join Date
    Aug 2006
    Location
    Nantwich, Cheshire
    Posts
    452
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    OK, to be fair though you didn't say that some were working and some were not, just that these specific ones were not.

    In each of your folders there's a file called index.php - if your server is configured as mine is, that should execute when you open that folder. First check whether it's executing - stick an echo at the top to just print a string and see if it appears. If that's OK, all you can do is run through the code until you find out what's happening. When you get the blank screen, if you right-click and view page source, what is there?
    http://www.firenza.net - my homage to a car from the 1970s

  7. #7
    SitePoint Enthusiast Prorsum's Avatar
    Join Date
    Dec 2012
    Posts
    54
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    OK, I had to move the includes to the root - confusing as all the other files for all the exercises in the book work where they are.

  8. #8
    From space with love silver trophy
    SpacePhoenix's Avatar
    Join Date
    May 2007
    Location
    Poole, UK
    Posts
    5,072
    Mentioned
    103 Post(s)
    Tagged
    0 Thread(s)
    Did you set up your server with LAMP/WAMP/XAMP or did you do separate installs of Apache, PHP and MySQL?
    Community Team Advisor
    Forum Guidelines: Posting FAQ Signatures FAQ Self Promotion FAQ
    Help the Mods: What's Fluff? Report Fluff/Spam to a Moderator

  9. #9
    SitePoint Enthusiast Prorsum's Avatar
    Join Date
    Dec 2012
    Posts
    54
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have a Mac and configured Apache, PHP, MySql manually and also installed PHP My Admin.

  10. #10
    Hosting Team Leader silver trophybronze trophy
    cpradio's Avatar
    Join Date
    Jun 2002
    Location
    Ohio
    Posts
    5,234
    Mentioned
    154 Post(s)
    Tagged
    0 Thread(s)
    May or may not help but either way, I find it a good way to learn PHP

    Update your php.ini to have the following error_reporting value
    Code:
    error_reporting = E_ALL | E_STRICT
    and have display_errors turned on
    Code:
    display_errors = On
    Restart apache, and reload the pages that appear to be blank to see if any errors/warnings show up.


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
  •