FORUM, Forum Discussion, Forum Gratuit, Nom de domaine, Nom de domaine gratuit, Redirection gratuite,

Forum Coding Asylum Administrators :Damnation
Forum Coding Asylum
Not logged | Login
Online:There are 6 online. Click here to see more
Register Register | Profile Profile | Private messages Private messages | Search Search | Online Online | Help Help | Create a free blog

forum Forum index forumPHP Projects forumProject One

Author : Topic: Project One  Bottom
 Damnation
 admin
 Posts : 21
 Damnation
  Posted 27/07/2007 05:25:01 PM
Send a private message to Damnation
I'm not experienced in PHP so I can just hand out projects like that because I don't know exactly how or what I want to learn first. So I'm simply just going to tell you what I've been learning about and see what you guy's think we should do.

I've learned and you should learn:
PHP opening tag <? and closing ?> or <?php Another opening and closing ?>
I know how to comment code
Every php command must end with ; just like any other real language.
Variables and operators
I know there are 2 different variables-Local and Global
Don't know much about them, but i do know global variables are able to be accessed by other scrïpts and functions.
I've read a little about the $_GET, $_POST,$_COOKIE,$_FILES,$_ENV, AND $_SESSION. I have yet to play with them.
I've made a few arithmetic scrïpts taht involve what else other than math.
I've also learned about a little about arrays.
I haven't written nearly enough scrïpts to fully understand why all this stuff is important and what it is fully capable of doing but I'm sure in time I'll know.

I am also learning out of a book called "PHP Essentials, 2nd addition" by: Julie C. Meloni
It had a 5 star rating on Amazon. It explains very well so far but I'm a hands on type of learner so it takes me longer. I've also been googling a few tutorials.

I am currently not using an IDE program for PHP yet, but I am planning to look for a good one here soon. Because I hate looking for a missing ; or (). So if anyone has an IDE for PHP that is good please post here if not, I will just play around with a bunch of them.

Have you guys downloaded php, apache, or have your own site to play with php yet? If you don't have any idea what to download to start playing with php, either reply here or msg me on MSN.  

--Last edited by Damnation on 2007-07-27 17:28:13 --

 Pokjo
 Posts : 4
 Skiddie
  Posted 11/08/2007 03:16:31 PM
Send a private message to Pokjo
A) http://www.blumentals.net/download/rapidphp7_full.exe I think is the best web scrïpting IDE on the market. though it is like +40$.. not too much but well worth it.

B)There are 3 variable types:

1: Super Globals called by what you have written.. $_POST['variable']
$_COOKIE['']
$_SERVER[''] and so on..

2: Globals which are basic vars but the point of them is that in PHP you cannot call a variable that is defined outside of the function.. as such

//defining the var

$user = joe;

//calling the function

getUser();

//defining the function

function getUser(){

 //this will cause an undefined variable error to be displayed.
 echo'<p>The users name is '.$user.'.</p>;
 }
************************************************************
so you select the var using the $GLOBALS[''] array. as such:
************************************************************

$user = joe;

getUser();

function getUser(){
 //you can define a var as a global in two ways:

 echo'<p>The users name is '.$GLOBALS['user'].'.</p>';

 //note that you omit the dollar sign when calling a variable    with in brackets.

 or

echo'<p>The users name is '.global $user.'.</p>';
}

3: Local variables... variables that are defined and used inside the function.

getUser();

function getUser(){
//this is a local variable.
 $user = joe;
 echo'<p>The users name is '.$user.'.</p>';
}

but the local $user var could not be called outside of the getUser() function.

I think that the best first project would be to create an online html form and create a scrïpt that will process the information and echo/(display) the information back to the user.

a couple of useful things to process would be like a registration for an email listing with membership fees including taxes

so the html would look like:

form.html

<form action="processInfo.php" method="POST">

First Name :<input type="text" name="firstName" size="20"/>
Last Name :<input type="text" name="lastName" size="20"/>
Email :<input type="text" name="email" size="30"/>


</form>
with a checkbox or two for the membership rates

add the rate to a .57% tax rate in javascrïpt and display it back to the user as Total: <input type="text" name="total" />

<scrïpt type="text/javascrïpt">
 var monthlyCost = 19.95;/*or what ever the value of the text boxes are*/
 var taxRate = .57;
//total after taxes:
 var total = monthlyCost * taxRate + monthlyCost;
//then display to the user:
 document.getElementByName("total").value = total;
</scrïpt>

then you would have this info posted to the processInfo.php

and use your research on how to handle the information..

Clues :

look for info regarding the following:

isset($_someVar)
$_POST['someFormElement']
echo''

so it might look something like this:
(i dont want to do it all for those who might follow me on this)

if(isset(someVar)){
callSomeFunction();
}

function someFunction(){
   display the info in an orderly fashion;
}

with this down you could add some things to further your self and  your comfort level with functions and variable types and handling and the next step would be to validate this information /*next lesson*/ then do something with the information /*3rd lesson*/ ie.. save it to a file email it to some one and eventually enter it into a MySQL database.

if there are any errors in the above code i would not be suprised so dont email me and say you c-p'ed it and it didnt work..lol well at any rate i dont know if you Damnation will find this of help and/or any one else for that matter but if you or anyone else does and would like me to continue or has any questions just let me know..

email me at pokjomama(at)gmail dot com i am very busy but love to help so i may not check back here for a bit unless i get an email.

good luck and happy coding..

P.S. PHP is a very easy language to learn if you have any coding experience.

Pokjo  


forum Forum index forumPHP Projects forumProject One
top
Go to :
  Add a quick reply

Add a quick reply