![]() |
Administrators :Damnation | |
| Forum Coding Asylum |
Not logged | Login
|
|
| Online:There are 6 online. Click here to see more | ||
Register |
Profile |
Private messages |
Search |
Online | Help
| Create a free blog | ||
![]() | ||
|
| ![]() | ![]() |
| Author : | Topic: Project One | Bottom |
| Pokjo Posts : 4 Skiddie |
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 |
|
| ![]() | ![]() |
Get a free forum!
AceBoard Free Forum v 5.3
Download Premium Web Templates!