Go Back   Pictual Design Forums > Graphics > Tutorials
Top Posters Referers Register Members List Calendar Search Today's Posts Mark Forums Read

Tutorials Staged guides related to design, graphics and skinning.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 10-01-2005, 01:24 PM
dbfootballa3 dbfootballa3 is offline
Returning Member
 
Rep Power: 0
dbfootballa3 is off the scale
Default

Welcome to PHP. To start learning php, you need access to a FTP server. After that a php editor would be nice, but notepad is ok, or any other text editor.

First lets understand what php is. See now, HTML is just showing information, it doesn't acullay contact the server. Then JavaScript( I'll make JavaScript tutorials later) Is client based which means it just takes information from the users computer. But it only takes time and stuff. Then PHP acually contacts the server. It uses HTML to get information from the user then takes that information and uses it. Since HTML your going to need to know some html, but I will still give the html code to help you. Now lets get started.

To start a php file, you must name it having the .php file extension. The starting tags for php are.
Code:
<?php ?>
See how simple it is so far. Now let me introduce you to the next command. The "print" command. This is what you are going to use a lot. It basically prints what ever you want. Let me give you the code then I will break it down for you guys.

Code:
<?php print "Hey there people"; ?>
Now we put the command there, which is "print "Hello there people";". The print command puts what ever you put inside of the quotation marks. Also after every line of code, put a simi-colon ( at the end. If you don't then you'll get confused when your code doesn't work.

Since we have a small feel for php, time to talk to you about editors. PHP Editors help you by color coding your code. Some of them will allow you to download php to them so that they can debug your code! The ones that I suggest are PHP Designer, Dreamweaver, and anyhting else you can find. PHP Designer is freeware, and it is the best one I have found.

Back to programming.....

Now with the print command in your mind, now lets use it with making a simple code..First you must understand variables.

Variables are very easy to understand, they are mainly used to store information for later use. For all you HTML people that's why when you make a from you have to give it a name. Anyways, when making a variable, you can't make it with a number first. A alphabitic letter has to be first. Examples...

Correct:
$hello123423423
$h2
Incorrect:
$1Hello
$123423423hello

Now that you know the correct and incorrect way to write variables, time to have fun.

Get on your ftp, or whatever you have access to that has PHP installed. Make a new HTML file.

Open up that html file and start to make a very simple form.. In this form we are going to add numbers that people can put in.

Code:
<body> <form action="handle_simple.php" method="post"> <input type="text" name="number1">+ <input type="text" name="number2"> <input type="submit" name="submit"> </form> </body>
I am not going to explain the HTML part as you should know this if you want to be a php expert

Now time for me to give you the PHP part of this code. Make a new file and name it handle_simple.php.

Here is the coding for it and read the comments.
Code:
<?php //Here is the starting tags $number1 = $_POST['number1']; // This take the information from the html part and turns it into a variable. $number2 = $_POST['number2']; // *Same thin $total = $number1 + $number2; // This is the actual formula print "Hello, your total is $total"; //This prints the result from the formula ?>
Also if you want to see a working example of this... Visit Here

If that doesn't work then please contact me for further questions. Thanks!

Made by: Devon Studios

Thanks for reading this tutorial. I did copy and paste this, but from my site
If anything is wrong please tell me. Thanks again.
Reply With Quote
  #2  
Old 10-01-2005, 01:58 PM
Insaze Insaze is offline
Returning Member
Advanced Member (50+ posts)
 
Rep Power: 0
Insaze is off the scale
Default

dont forget to tell the readerss that there is also the echo() function

btw u got PHP for Dummies - this appears to be similar to the basic description of php in php for dummies
Reply With Quote
  #3  
Old 10-01-2005, 02:15 PM
dbfootballa3 dbfootballa3 is offline
Returning Member
 
Rep Power: 0
dbfootballa3 is off the scale
Default

Well, i did not rip it....So don't think that, and I am new to PHP as well, so I really don't understand a lot..But I DID WRITE THIS TUT!!!

Edit: also i did get some of this from a book. But it is not word for word, and the example used is nothing like it.

Thanks,
Devon
Reply With Quote
  #4  
Old 10-01-2005, 02:33 PM
Insaze Insaze is offline
Returning Member
Advanced Member (50+ posts)
 
Rep Power: 0
Insaze is off the scale
Default

i know u did get your info from a book, everyone does i guess, no offense and hey - i didnt accuse u of anything, so dont accuse urself :P
Reply With Quote
  #5  
Old 10-01-2005, 02:49 PM
dbfootballa3 dbfootballa3 is offline
Returning Member
 
Rep Power: 0
dbfootballa3 is off the scale
Default

Thanks, now do you think it would help someone that JUST started php??
Reply With Quote
  #6  
Old 10-01-2005, 03:24 PM
ownsyou ownsyou is offline
Returning Member
Advanced Member (50+ posts)
 
Location: England
Rep Power: 0
ownsyou is an unknown quantity at this point
Send a message via MSN to ownsyou
Default

it would help someone very new, but i really dont need any tips, ive been in the php buisness over 1.6 years ;P
Reply With Quote
  #7  
Old 10-01-2005, 03:26 PM
dbfootballa3 dbfootballa3 is offline
Returning Member
 
Rep Power: 0
dbfootballa3 is off the scale
Default

I know that most of you are experts, but usually when a site has introductions to languages they get more hits. If I am corrent, which half the time I am not. Heh
Reply With Quote
  #8  
Old 10-31-2005, 07:26 AM
alpro alpro is offline
Returning Member
 
Location: Belgium / Limburg / Lanaken
Rep Power: 0
alpro is off the scale
Send a message via MSN to alpro
Default

hmm, what can i say

readed a thousand of these introduction tuts, but still didn't learned a thing out of it

guess php is my only problem if it comes to coding
Reply With Quote
  #9  
Old 10-31-2005, 09:42 AM
iEcstacy iEcstacy is offline
Returning Member
 
Rep Power: 0
iEcstacy is off the scale
Default

<div class='quotetop'>QUOTE(alpro @ Oct 31 2005, 04:26 AM)</div><div class='quotemain'>hmm, what can i say

readed a thousand of these introduction tuts, but still didn't learned a thing out of it

guess php is my only problem if it comes to coding
[snapback]3435[/snapback]
[/quote:fa21a87328]
Well then, try this order of learning to code: HTML > JavaScript > PHP. I know the forthmost basics of JavaScript + some more, so I can understand just about everything in this tutorial. JavaScript would be more of a "Introductory Introduction Unit" to PHP.
Reply With Quote
  #10  
Old 11-02-2005, 01:36 PM
Insaze Insaze is offline
Returning Member
Advanced Member (50+ posts)
 
Rep Power: 0
Insaze is off the scale
Default

yeh thats the way i learned it
and somewhere in the middle learn css
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
php links xplicit Programming 4 08-30-2006 04:09 PM
Php Logging FireNova Tutorials 2 03-05-2006 11:00 AM
Php Linking FireNova Tutorials 4 12-17-2005 05:38 AM
Php Simple Email Script FireNova Tutorials 4 07-01-2005 07:56 PM
Php Randomizing images FireNova Tutorials 3 06-19-2005 04:00 PM


All times are GMT -4. The time now is 01:45 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
vRewrite 1.5 beta SEOed URLs completed by Tech Help Forum and Chalo Na.