Popular in Web Development II
Popular in ComputerScienence
This 4 page Study Guide was uploaded by Sydney Jones on Tuesday February 24, 2015. The Study Guide belongs to CS295 at a university taught by Dr. Kanwal Gagneja in Fall. Since its upload, it has received 92 views.
Reviews for test1notes
Report this Material
What is Karma?
Karma is the currency of StudySoup.
You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!
Date Created: 02/24/15
CHAPTER ONE 61 Cwampwwwphpvqs4scriptsphp or whatever folder eg Cwampwwwlab1 must have php extension won39t open via folder go localhost in browser enter script gtwampsevrgtphpgtphpipi has logs n shit wamp stay of ine on personal laptop httplocalhostltusergtphpinfophp quotquot to open in browser 81 Php tags are php ltphpgt Php code cannot be seen by computer unlike html Html doesn39t need a server Blank pages sometimes caused by not php extension spelling mistakes url wrong Sometimes php not enabled File not found error url incorrect script not in right directory Print command to throw data to browser eg print quotHelo also echo Java case sensitive php NOT when dealing with functions Print is same as print as same as PRINT Print quotHello how are you good to see youquot Is all on one line PHP manual available at httpphpnet any function name Sending html to browser NAME OF FILE IS PHP Html can be embedded like ltphp print quotltspan stylequotfontweight boldquotgtHello Worldltspangtquot White spaces ignored by compiler similar to java Generally ignored by browser ex not in pre tag ltpregt tag keeps all spaces intact useful with SERVER Comments quotltquot in html quotIIquot or quotquot for single line quot djaskldf quot for multiple in php c java CHAPTER TWO Variables Prede ned Variables SERVER cannot use print Must use printr SERVER Naming Variables Always preface with Can use only letters or underscores No spaces Each variable name in one script should be unique Variable names are case sensitive name Name In java and C variables must be initialized but no need in PHP Types of Variables Numbers integers 1 1 oatingpoint 10 10 String anything in quot or print name print quotMy name is namequot prints with value print 39My name is name prints quotMy name is namequot variable loses value For double quotes use escape sequence quotI said quotHow are youquot quot or single quotes or 39I said quotHow are youquot quotnquot for new line quotrquot for character return quottquot for tab is assignment operator Eg var 10 var1 105 Ring quotCall mequot To print print var print var1 Ring or print quotThe number is varquot print quotThe year yearquot print quotInquot print quotThe june tempt juneavgquot print quotInquot print quotThe paper title pagetitlequot 151 POST in php script to display data GET shows data in web url GET variabIe gets data for those variables niset to see any debug errors Errorreporting to see all errors name GET39name Print quotnamequot those two lines in php Having more than one variable show up scriptphp fnameJudyampnamesily ltigtlta hrefquotscript0309phpfnameMichaelamplnameJollyquotgtMichael Jollyltagtltligt In php for above fname GET39fname lname GET39lname END OF CHAPTER THREE For assignment two strlenname nds length of string Name age city state see above X Drive price POST price total price quantity total numberformat In php Print quotltpgtdfhsaltbr gt ltspan classquotnumberquotgt Function round rounds to one decimal place automatically eg round350 3 round28952 2 289 numberformat works same way as round but brings commas in numberformat1000 prints 10000 numberformat4325313 2 43253 num 10 42 equals 8 Bc pemdas num 1042 equals 3 Ect all work with java number rand brings in any random number rand0 10 between 0 and 100 and 10 are included getrandmax gets highest number available by operating system mtrand same as rand but more intelligentsensitive
Are you sure you want to buy this material for
You're already Subscribed!
Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'