Page 1 of 1
Starting PHP from Scratch
Posted: Wed Nov 16, 2005 8:11 pm
by Karan Kundra
hey i am a beginer at programming I wanted to know if it was possible to start from php .. all i know is a bit of html and some sql.
Please help me in this ... and how important is it to know cgi scripting to work on php ??
Posted: Wed Nov 16, 2005 8:19 pm
by jwalsh
If you're going to focus on web programming, and know HTML and SQL, then php and javascript would be the first on my list. It may be a bit of a challange at first, but we're here to help.
Good Luck
Posted: Wed Nov 16, 2005 9:53 pm
by Ambush Commander
Personally, I think JavaScript is secondary. Definitely start learning about programming languages in general and bang out a script or too. Remember, questions go in the code forum.
Posted: Wed Nov 16, 2005 10:22 pm
by Trenchant
When I was first starting out I found it easyer to learn if I had a reason or something specific to do. You may be interested in making a big site or something with PHP and if so you gotta remember to start small. Building large projects with bad technique is never a good idea.
If you want here's my suggestion and a bit of a challenge. Search around on the internet to try and make a simple login page. Here is basically what it should be like:
1. login form(standard HTML)
2. PHP processing(check if the set username/password matches the one the user entered.)
3. Redirrect the user to the appropriate page(members area or show a message if they entered the wrong information)
A simple script like this can be made with the following PHP functions:
if () { }
strip_tags();
$_POST[];
echo "";
Thats my suggestion to you if you wan't to get started with something reasonably small. If you have any problems making a script like this don't be afraid to ask questions. If your a little confused about where to get started I'll find you some tutorials, just ask. As far as an online resource goes you can research the functions I listed by going to PHP's website: php.net
If you have any questions whatsoever we're all here for you. Remember to use lots of comments ( // YOUR COMMENT HERE ). Comments are one of the best ways to keep your scripts organized.
Good Luck
Posted: Thu Nov 17, 2005 1:07 am
by RobertGonzalez
Another really good thing to do is go to
Sitepoint.com and download the sample chapters of Kevin Yank's "How to build a database driven website using PHP and MySQL". The first four chapters are free and they will actually show how to develop a mini app in those first chapters.
When I was starting out a few years ago that is where I started. Then after I built a few small (and absolutely terribly coded) apps, I downloaded phpBB and tried to sift through the entire application to see if could figure out how it worked. Soon after I was developing my own full fledged web applications.
Hang in there. PHP is probably the easiest server side scripting language to learn and it is amazingly powerful. This community is a God-send and you will find yourself coming here more and more, at first for help, then to offer it.
Posted: Thu Nov 17, 2005 7:35 am
by Grim...
I would advise concentrating on your HTML before attempting PHP.
Posted: Thu Nov 17, 2005 8:45 am
by Moocat
Each one of these below is a seperate project:
- Learn to make a "Hello World" program.
- Make a program that adds two numbers together and outputs them.
- Output two input fields from one page onto another page after submitting.
- Add those two values and output the result on the next page.
- If the result on the next page is less than 5 color the result "red", if not color the result "green"
- Make a page that lets a (hard coded) admin "login" and set your first session variable
- Use an INSERT statement with an input field
- Learn more php at http://www.php.net
Good luck, hope to see you soon
