Jump to content

Could someone mentor me with PHP?


Dubbeldam

Recommended Posts

Just don't use the forum as the textbook, but an aid. Instead of trying to learn only by asking the questions on the forum, it would be better to read the W3Schools tutorial, and just post questions about what you don't understand. Don't forget about the best resource of 'em all: The PHP Manualwww.php.net has an excellent system where you can just enter "www.php.net" + function name, and it will redirect you to the proper page. So if you wanted to know what the print_r() function does, you'd just enter "www.php.net/print-r". It greatly simplifies referencing.

Link to comment
Share on other sites

Thanks for the repliesIt's not necessarily the coding. More the set up. I've got no idea where to start? I downloaded XAMPP so I have it all already.

In this tutorial we assume that your server has activated support for PHP and....
Ehm... What server?
you will want to install a web server, such as ยป Apache, and
Wait... Didn't the quote above assume I already had a server?? :) I feel a bit ashamed because the questions are probably 100% stupid noob questions which I know are annoying haha!
Link to comment
Share on other sites

In the first sentence, they're talking about "server" as in "a computer that will (eventually) execute PHP code in some way", whereas in the second sentence, they're talking about "web server", as in "a program running on a computer that receives HTTP requests, and gives HTTP responses", so they aren't conflicting with themselves, but your confusion is understandable.XAMPP contains Apache and PHP, along with other stuff. Just install it, and see Question 2 from their documentation.

Link to comment
Share on other sites

In the first sentence, they're talking about "server" as in "a computer that will (eventually) execute PHP code in some way", whereas in the second sentence, they're talking about "web server", as in "a program running on a computer that receives HTTP requests, and gives HTTP responses", so they aren't conflicting with themselves, but your confusion is understandable.XAMPP contains Apache and PHP, along with other stuff. Just install it, and see Question 2 from their documentation.
Ok so number 1: My computer?and the number 2: The program as in XAMPP?Thanks for understanding my confusion haha.I'll go futher through the PHP documentation. I'll probably have more questions, I'll write them down =]
Link to comment
Share on other sites

Ok so number 1: My computer?and the number 2: The program as in XAMPP?
1. In your case, yes. They use the term "server", because you may instead use a hosting service - the computer(s) of someone else who has Apache and everything installed and ready for you to just place your files there and run them.2. Pretty much. XAMPP is actually a package that includes a web server, not a web server itself. The web server itself is "Apache".
Link to comment
Share on other sites

Thanksss!! I got it working! Well, I think =] I put the php file into the htdocs and I can see it on 127.0.0.1/filename.php =].I have another question. Right now I use notepad ++, which is good. But does it also have a visual mode? Like frontpage? Because I find that very easy to do a quickcheck on my coding actions.

Link to comment
Share on other sites

I have another question. Right now I use notepad ++, which is good. But does it also have a visual mode? Like frontpage? Because I find that very easy to do a quickcheck on my coding actions.
The preview windows on WYSIWYG editors are not recommended for checking your work. They use different rendering engines than browsers do, and thus the pages can be inaccurate. It's just best to check your work in a browser.
Link to comment
Share on other sites

The preview windows on WYSIWYG editors are not recommended for checking your work. They use different rendering engines than browsers do, and thus the pages can be inaccurate. It's just best to check your work in a browser.
can't stress this enough. If you're developing a webpage, there's no reason to not have a web browser open anyway. Just hit F5. And, if you have FF and the Web Developers toolbar add-on installed, you can see validation errors as you browser, so can fix those errors as you make them.
Link to comment
Share on other sites

They use different rendering engines than browsers do, and thus the pages can be inaccurate.
To be specific, I think Dreamweaver uses Opera's Presto engine and Frontpage probably uses IE's Trident engine. Others may also use webkit or Gecko. Regardless of how you design your page, eventually you'll want to test it with each engine. IE, Firefox, Opera, and either Chrome or Safari cover those.
Link to comment
Share on other sites

Just hit F5.
This is easy, but the developer tools kit for Opera (dragonfly) makes it even easier by allowing you to set an automatic page refresh interval, such as every 5 seconds. This can also be done by putting this in the webpage head:
<meta http-equiv="refresh" content="5" />

"Content" represents the number of seconds between each page refresh.

Link to comment
Share on other sites

To be specific, I think Dreamweaver uses Opera's Presto engine and Frontpage probably uses IE's Trident engine. Others may also use webkit or Gecko. Regardless of how you design your page, eventually you'll want to test it with each engine. IE, Firefox, Opera, and either Chrome or Safari cover those.
Actually, Dreamwaver's "Live Preview" uses WebKit. I don't know about the WYSIWYG (non live pre)view. I think it's a custom engine.
Link to comment
Share on other sites

Thanks for all the replies. After all it really isn't much of a bummer to just press F5 =P It's ok I guess. I'm glad I'm studying PHP. Right now I'm trying to figure the MySQL thing out to create a database where people can login and stuff. I've downloaded a few examples but I haven't really gotten the time to check them out yet. Will do tomorrow.

Link to comment
Share on other sites

When I'm in serious development mode, I have at least 2 computers running windows and mac, and multiple browsers open on each. I don't use the refresh trick because most of my pages have a lot of dynamic javascript stuff, so I am content to reload the page manually. No big deal. But I can see the value to that if the page is not dynamic. It's actually a clever idea.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...