4 Replies - 447 Views - Last Post: 01 October 2012 - 11:14 AM Rate Topic: -----

#1 Tanrou  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 30-September 12

Putting PHP to practical use

Posted 30 September 2012 - 06:46 PM

I understand the concepts, syntax, and many of the functions of php. The problem I have run in to is in actually putting php to work on a project. I have no experience in web development, and a few things would be helpful, if someone would be so kind.

1. If someone could explain how to upload html/php files to a xampp run apache server, which is my localhost.
2. If someone could suggest some very simple/beginner projects for me to practice on. My main issues in understanding php is how to get it to interact with a mySQL database (although I am versed in mySQL).

As far as question one, I have "googled it", and have come up with suggestions to save it to the htdocs folder as the index page/another page. Then you could edit in a link on the index page. This doesn't work for me... When I try to save a new index page, my computer tells me, "that directory does not exist."

As far as the second one goes, it may sound like an odd request. I don't understand how to apply php, however, so it is difficult for me to conceptualize how to get a project done. I can write code, but everything that I have written so far has been purposeless. The most complicated thing I've done was automate dice rolls with modifiers for a game I play.

This inability to put my knowledge (although it is not extensive by any means) to good use has frustrated me to no end. Any help would be appreciated!

Also, any suggested reading is also welcome!

Is This A Good Question/Topic? 0
  • +

Replies To: Putting PHP to practical use

#2 Atli  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 3710
  • View blog
  • Posts: 5,958
  • Joined: 08-June 10

Re: Putting PHP to practical use

Posted 30 September 2012 - 07:02 PM

*
POPULAR

Quote

1. If someone could explain how to upload html/php files to a xampp run apache server, which is my localhost.

If it's a local server, then there is no "upload" required. All you have to do is save the files in the correct location. By default, if I recall, XAMPP servers it's files from the "C:\xampp\htdocs" folder. Any file you put in there will be accessible via Apache.

To access files via Apache on a local server, you type in http://localhost/file.php, which would then show you the PHP file located at: C:\xampp\htdocs\file.php.

Keep in mind that if you go to a directory, like http://localhost/dir/ then Apache will (normally) show the file named "index.html", or "index.php", inside that folder. In this case: C:\xampp\htdocs\dir\index.php (or .html)

Quote

2. If someone could suggest some very simple/beginner projects for me to practice on.

Simple blogs are always a popular project for new PHP coders. They don't have to be horribly difficult to create, so it servers as a nice way to get the experience required to start larger projects.
Was This Post Helpful? 5
  • +
  • -

#3 CTphpnwb  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 2889
  • View blog
  • Posts: 10,010
  • Joined: 08-August 08

Re: Putting PHP to practical use

Posted 30 September 2012 - 08:07 PM

View PostAtli, on 30 September 2012 - 10:02 PM, said:

To access files via Apache on a local server, you type in http://localhost/file.php, which would then show you the PHP file located at: C:\xampp\htdocs\file.php

I would say that it shows you the results of the PHP interpreter's processing of file.php. That's a critical distinction from the contents of that file, and one that beginners really need to pay close attention to if they want to avoid many typical beginner mistakes.
Was This Post Helpful? 4
  • +
  • -

#4 Tanrou  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 30-September 12

Re: Putting PHP to practical use

Posted 01 October 2012 - 09:07 AM

Thank you all for the replies!
@ Atli
That's exactly my issue though. I have tarted to save a file in the htdocs and it will not save. It give me the message "that directory does not exist."
Thanks for the suggestion! I'll see if I can do some research into how to go about getting a blog up and running.
Was This Post Helpful? 0
  • +
  • -

#5 Tenderfoot  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 11
  • View blog
  • Posts: 160
  • Joined: 21-March 12

Re: Putting PHP to practical use

Posted 01 October 2012 - 11:14 AM

View PostTanrou, on 30 September 2012 - 06:46 PM, said:

Also, any suggested reading is also welcome!


Read an ebook. At the very least it should help you get PHP/Apache up and running. I could recommend one that I'm reading right now. It covers a fairly large area of subjects and you can jump from chapter to chapter as you like to explore each subject. You said that one of your problems was interacting with MySQL databases, I believe that's covered in length in one chapter, I believe it was Chapter 19 (Introducing PDO). It also mentions it briefly in chapter 14 (using MySQLi) but that chapter wasn't anything close to helping me out with MySQL, don't know about you.

The book's name is: "Beginning PHP and MySQL - From Novice to Professional" and the author is W. Jason Gilmore. I think there are also a fair bit of comprehensive guides here on D.I.C., but personally I know I prefer to read e-books when I'm just getting familiar with something. Guides are something I'd refer to once I'm into the language a bit more.

This post has been edited by Tenderfoot: 01 October 2012 - 11:16 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1