Starting PHP from Scratch

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
Karan Kundra
Forum Newbie
Posts: 1
Joined: Wed Nov 16, 2005 5:18 pm

Starting PHP from Scratch

Post 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 ??
User avatar
jwalsh
Forum Contributor
Posts: 202
Joined: Sat Jan 03, 2004 4:55 pm
Location: Cleveland, OH

Post 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
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post 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.
User avatar
Trenchant
Forum Contributor
Posts: 291
Joined: Mon Nov 29, 2004 6:04 pm
Location: Web Dummy IS

Post 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
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post 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.
Grim...
DevNet Resident
Posts: 1445
Joined: Tue May 18, 2004 5:32 am
Location: London, UK

Post by Grim... »

I would advise concentrating on your HTML before attempting PHP.
User avatar
Moocat
Forum Contributor
Posts: 143
Joined: Wed Oct 12, 2005 9:28 am
Location: USA

Post 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 :)
Post Reply