1. Write A PHP Script To Display Welcome Message.

1y ago
17 Views
2 Downloads
752.42 KB
49 Pages
Last View : 18d ago
Last Download : 3m ago
Upload by : Rafael Ruffin
Transcription

1. Write a PHP script to Display Welcome Message. ?phpecho "Welcome to PHP Programming !!!!"." br ";echo "This", " string", " was", " made", " with multiple parameters.";echo ("Welcome to PHP Programming !!!!"." br ");print("Welcome to PHP"." br ");print "Hello World";? OUTPUT:Welcome to PHP Programming !!!!This string was made with multiple parameters.Welcome to PHP Programming !!!!Welcome to PHPHello WorldEcho (PHP)Print (PHP)echo can take more than one parameterwhen used without parentheses. The syntaxprint only takes oneParameters is echo expression [, expression[,parameter.expression] . ]. Note that echo( arg1, arg2) is invalid.Returnvalueecho does not return any valueprint always returns 1(integer)Syntaxvoid echo ( string arg1 [, string . ] )int print ( string arg )In PHP, echo is not a function but alanguage construct.In PHP, print is not a reallyfunction but a languageconstruct. However, it behaveslike a function in that itreturns a value.What is it?

2. Write a PHP script for Addition of two numbers. ?php a 10; b 20; sum a b;echo "Addition of a and b is sum";? OUTPUT:Addition of 10 and 20 is 303. Write a PHP script for Swapping of Three numbers. ?php a 10; b 20; c 30;echo "a a"." br "."b b"." br "."c c"." br "; temp a; a b; b c; c temp;echo " b After Swapping"." br "." a a"." br "."b b"." br "."c c"." br b ";? OUTPUT:a 10b 20c 30After Swappinga 20b 30c 10

4.1 Write a PHP script to demonstrate the use of Arithmetic Operator. ?php a 10; b 5; c 3; d 8;echo "a a b b c c d d"." br ";//addition example add a b;echo "Addition add"; //prints 15echo " br ";//subtraction example sub a - b;echo "Subtraction sub"; //prints 5echo " br ";//multiplication example mul a * b;echo "multiplication mul"; //prints 50echo " br ";//division example div a / b;echo ' a/ b '. div; // prints 2echo " br ";echo ' a/ c '. a/ c; //prints 3.3333333333333echo " br ";echo ' d/ c '. d/ c; //prints 2.6666666666667echo " br ";//modulus example mod a % b;echo mod;echo " br "; //prints 0//Negation example

neg - a;echo neg; //prints -10;echo " br ";//Concatenation example str1 "Pankaj"; str2 "Kumar";echo str1 . " " . str2; //prints "Pankaj Kumar"echo " br ";echo a . b; //prints 105echo " br ";echo c . d; //prints 38echo " br ";echo " a" " b"; //prints 15? OUTPUT:a 10 b 5 c 3 d 8Addition 15Subtraction 5multiplication 50 a/ b 2 a/ c 3.3333333333333 d/ c 2.66666666666670-10Pankaj Kumar1053815

PHP Comparison OperatorsOperatora bNameEqualDescriptionTrue if a is equal to ba bIdenticalTrue if a is equal to b and of same type,5 ”5” is falsea! ba bNot equalNot equalTrue if a and b are not equalTrue if a and b are not equala! bNot identicalTrue if a and b are not equal and they arenot of same type, for example 5! ”5″returns truea ba bLess thanGreater thanTrue if a is less than bTrue if a is greater than ba bLess than or equalTrue if a is less than or equal to btoa bGreater than orequal toTrue if a is greater than or equal to bOperatorNameDescriptiona and bAndTrue if both a and b are truea or bOrTrue if either a or b is truea xor bXorTrue if either a or b is true, but not both!aNotTrue if a is not truea && bAndSame as and operatora bOrSame as or operatorPHP Logical Operators

4.2 Write a PHP script to demonstrate the use of Comparison & Logical Operator. ?php a 10; b "10"; c 10; d 5;//Equal examplevar dump( a b); //prints bool(true)echo " br ";var dump( a c); //prints bool(true)echo " br ";//Identical examplevar dump( a b); //prints bool(false)echo " br ";var dump( a c); //prints bool(true)echo " br ";//Not equal examplevar dump( a! b); //prints bool(false)echo " br ";var dump( a b); //prints bool(false)echo " br ";//Not identical examplevar dump( a! b); //prints bool(true)echo " br ";var dump( a! c); //prints bool(false)echo " br ";echo " b Logical Operator /b br/ ";if( a b && a d){echo "True";}else{echo "False";}echo " br / ";if( a b a d){echo "True";}else{echo "False";}? OUTPUT:boolean trueboolean trueboolean falseboolean trueboolean falseboolean falseboolean trueboolean falseLogical OperatorFalseTrue

5. Write a PHP script to Check the given number is ODD or EVEN. ?php a 10;if ( a % 2 0){echo "Given number is " . " br " . " b EVEN b " ;}else{echo "Given number is" . " br " . " b ODD b ";}? OUTPUT:Given number isEVEN6. Write a PHP script to find maximum number out of three given numbers. ?php a 10; b 20; c 30;echo "a a b b c c"." br ";if ( a b){if( a c){echo "a is the greatest";}else{echo "c is the greatest";}}else{if ( b c){echo "b is the greatest";}else{echo "c is the greatest";}}? OUTPUT:a 10 b 20 c 30c is the greatest

7. Write a PHP script to Check the given number is Palindrome or Not. ?php number 121 ; temp number; //store it in a temp variable sum 0;//loop till the quotient is 0while( number 0 ){ rem number % 10; //find reminder sum sum*10 rem ;//echo sum ." br "; number floor( number / 10); //find quotient. if 0 then loop again}//if the entered number and the sum value matches then it is an Palindrome numberif( temp sum ){echo "Palindrome Number";}else{echo "Not Palindrome Number";}? OUTPUT:Palindrome Number8. Write a PHP script to Check the given number is Armstrong or Not. ?php number 153 ; temp number; //store it in a temp variable sum 0;//loop till the quotient is 0while( number ! 0 ){ rem number % 10; //find reminder sum sum ( rem * rem * rem ); //cube the reminder and add it to the sum variable till the loop ends//echo sum ." br "; number FLOOR( number / 10); //find quotient. if 0 then loop again}

//if the entered number and the sum value matches then it is an armstrong numberif( temp sum ){echo "Armstrong Number";}else{echo "Not an Armstrong Number";}? OUTPUT:Armstrong Number9. Write a PHP script to print Fibonacci series. ?php count 0 ; f1 0; f2 1;echo f1." ". f2." ";while ( count 10 ){ f3 f2 f1 ;echo f3." "; f1 f2 ; f2 f3 ; count count 1;}? OUTPUT:0 1 1 2 3 5 8 13 21 34 55 89

10. Write a PHP script to check the given number is prime or not. ?php num 29; flag false;for( i 2; i num; i ){if( num % i 0 ){ flag true;break;}}if( flag true){echo "NOT Prime No";}else{echo "Prime No";}? OUTPUT:Prime No

11. Write PHP Script to calculate total marks of student and display grade ?php subject1 75; subject2 50; subject3 50; subject4 50; subject5 93;echo "Subject-1 : subject1 br Subject-2 : subject2 br Subject-3 : subject3 br Subject-4 : subject4 br Subject-5 : subject5 br "; Total subject1 subject2 subject3 subject4 subject5;echo "Total Marks b Total /b br / "; Percentage ( Total * 100) / 500;echo "Percentage b Percentage /b br / ";if( Percentage 75){echo "Grage Distinction";}elseif( Percentage 60){echo "Grage First Class";}elseif( Percentage 50){echo "Grage Second Class";}elseif( Percentage 40){echo "Grage Third Class";}else{echo "Fail";}? OUTPUT:Subject-1 : 75Subject-2 : 50Subject-3 : 50Subject-4 : 50Subject-5 : 93Total Marks 318Percentage 63.6Grage First Class

12.1 Write a PHP script to get type of variable using gettype() ?php No 5; Value 13.5; Name "Bipin Prajapati"; VAR true; MyArray array(110, 45, "HELLO", 1.5, true);echo No . " br/ " . Value . " br/ " . Name . " br/ " . VAR . " br/ ";echo " b gettype(var) /b "." br ";echo gettype( No) . " br/ ";echo gettype( Value). " br/ ";echo gettype( Name). " br/ ";echo gettype( VAR). " br/ ";echo gettype( MyArray). " br/ ";? OUTPUT:513.5Bipin ray12.2 Write a PHP script to get type of variable using gettype() ?php Data array(1,1.5, NULL, "HELLO", new stdclass , true);foreach( Data as value){echo gettype( value)." br/ " ;}? OUTPUT:integerdoubleNULLstringobjectboolean

12.3 Write a PHP script to set type of variable using settype(). ?php Var1 "28Bipin"; // string Var3 "Bipin28"; // string Var4 "Bipin"; // string Var5 25; Var6 254.50;settype( Var1, "integer"); // Var1 is now 28 (integer)settype( Var3, "integer"); // Var1 is now 0 (integer)settype( Var4, "integer"); // Var1 is now 0 (integer)settype( Var5, "float");settype( Var6, "double"); Var2 true; // booleansettype( Var2, "string"); // Var2 is now "1" (string)echo Var1." br/ ";echo Var3." br/ " ;echo Var4." br/ " ;echo Var2." br/ " ;echo gettype( Var1)." br/ ";echo gettype( Var3)." br/ ";echo gettype( Var4)." br/ ";echo gettype( Var5)." br/ ";echo gettype( Var6)." br/ ";echo gettype( Var2);? g

13.1 Write PHP script to demonstrate use of string function- chr() and ord(). html body h2 chr() /h2 ?phpecho chr(77) . " br "; // Mecho chr(102) . " br "; // fecho chr(99) . " br "; // cecho chr(46) . " br "; // .echo chr(52) . " br "; // Decimal value // 4echo chr(052) . " br "; // Octal value // *echo chr(0x52) . " br "; // Hex value // R? h2 ord() /h2 ?phpecho ord("h") . " br "; // 104echo ord("H") . " br "; // 72echo ord("Hello") . " br "; // 72echo ord("99") . " br "; // 57echo ord("Bipin") . " br "; // 66? /body /html OUTPUT:chr()Mfc.4*Rord()10472725766

13.2 Write PHP script to demonstrate use of string functionstrtolower () & strtoupper () & strlen(). h2 string strtolower(string str) /h2 ?phpecho strtolower("hello") . " br ";echo strtolower("HEllo") . " br ";echo strtolower("HeLLO") . " br "; var "nbp piludara";echo strtolower( var) . " br ";? h2 string strtoupper(string str) /h2 ?phpecho strtoupper("h") . " br ";echo strtoupper("H") . " br ";echo strtoupper("Hello") . " br ";echo strtoupper("Mr. Bipin Prajapati") . " br ";echo strtoupper("Bipin") . " br "; //? h2 int strlen(string str) /h2 ?php var "nbp piludara";echo strlen( var) . " br ";echo strlen("Hello") . " br ";echo strlen("Mr. Bipin Prajapati") . " br ";echo strlen("Bipin") . " br "; //? OUTPUT:string strtolower(string str)hellohellohellonbp piludara

string strtoupper(string str)HHHELLOMR. BIPIN PRAJAPATIBIPINint strlen(string str)12519513.3 Write PHP script to demonstrate use of string functionltrim() & rtrim() & trim(). html head title trim() Function! /title /head body pre h2 string trim(string str [,string charlist]) /h2 /pre ?phpecho strlen(" Hello World ")." br "; // 15echo strlen(ltrim(" Hello World "))." br "; //14echo ltrim(" NBP! ")." br ";echo ltrim("Hello World. . . . . ! ","H")." br ";echo " br ";echo strlen(" Hello World ")." br ";echo strlen(rtrim(" Hello World "))." br ";echo " br ";echo strlen(" Hello World ")." br ";echo strlen(trim(" Hello World "))." br ";? /body /html

OUTPUT:string trim(string str [,string charlist])1514NBP!ello World. . . . . !1714171113.4.1 Write PHP script to demonstrate use of string function- substr() html head title String Function - substr() /title /head body pre h1 string substr(string string , int start [,int length]) h1 /pre h1 abcdef /h1 b If Start is Non Negative(POSITIVE), the returned string will start at the strat'thposition in string, start form 0. /b br/ br/ ?phpecho "Substring with Positive Start: " . substr("abcdef",2) . " br/ ";? br/ b If Start is Negative, the returned string will start at the strat'th character from theend of string /b br/ br/ ?phpecho "Substring with negative Start: " . substr("abcdef",-2) . " br/ ";? br/

b If string is less than or equal to start chararcters long, FALSE will returned /b br/ br/ ?phpecho " Start is string : " . substr("abcdef",7) . " br/ ";? br/ /body /html OUTPUT:13.4.2 Write PHP script to demonstrate use of string function- substr(). html head title String Function /title /head body h1 adcdef /h1 h3 if LENGTH is GIVEN /h3 b If LENGTH is Non Negative(POSITIVE), the returned string will start at the strat'thposition in string, and count the length beginning from start /b br/ br/ ?phpecho "Substring :" . substr("abcdef",2,2) . " br/ ";? br/ ?phpecho "Substring :" . substr("NBPATELPILUDARA",2,4) . " br/ ";? br/ ?phpecho "Substring :" . substr("abcdef",-3,2) . " br/ ";? br/ ?phpecho "Substring :" . substr("NBPATELPILUDARA",-5,2) . " br/ ";? br/

b If LENGTH is Negative, the returned string will start at the strat'th position instring, and REmove(ommited) character from end of string /b br/ br/ ?phpecho "Substring :" . substr("abcdef",2,-2) . " br/ ";? br/ ?phpecho "Substring :" . substr("NBPATELPILUDARA",2,-4) . " br/ ";? br/ ?phpecho "Substring :" . substr("abcdef",-2,-2) . " br/ ";? br/ ?phpecho "Substring : " . substr("NBPATELPILUDARA",-2,-4) . " br/ ";? br/ ?phpecho "Substring :" . substr("NBPATELPILUDARA",-4,-2) . " br/ ";? br/ ?phpecho "Substring :" . substr("NBPATELPILUDARA",-5,-4) . " br/ ";? br/ /body /html OUTPUT:13.5.1 Write PHP script to demonstrate use of string function- strcmp (). html head title String Function - strcmp /title /head body h1 int strcmp(string str1 , string str1 ) /h1 h2 1. if str1 str2   return 0 /h2 h2 2. if str1 str2   return 0 /h2 h2 3. if str1 str2   return 0 /h2 br/

?php str1 'a' ; str2 'b'; string1 'b'; string2 'a'; str3 'Bipin' ; str4 'bipin'; str5 'bipin' ; str6 'Bipin'; str7 'Bipin' ; str8 'Bipin';echo strcmp( str1, str2) . " br/ ";echo strcmp( string1, string2) . " br/ ";echo strcmp( str3, str4) . " br/ ";echo strcmp( str5, str6) . " br/ ";echo strcmp( str7, str8) . " br/ ";? /body /html OUTPUT:13.5.2 Write PHP script to demonstrate use of string function- strcasecmp (). html head title String Function - strcasecmp /title Head body h1 int strcasecmp(string str1 , string str1 ) /h1 h2 1. if str1 str2   return 0 /h2 h2 2. if str1 str2   return 0 /h2 h2 3. if str1 str2   return 0 /h2 br/

?php str1 'a' ; str2 'b'; string1 'b'; string2 'a'; str3 'Bipin' ; str4 'bipin'; str5 'bipin' ; str6 'Bipin'; str7 'Bipin' ; str8 'Bipin';echo strcasecmp( str1, str2) . " br/ ";echo strcasecmp( string1, string2) . " br/ ";echo strcasecmp( str3, str4) . " br/ ";echo strcasecmp( str5, str6) . " br/ ";echo strcasecmp( str7, str8) . " br/ ";? /body /html OUTPUT:13.6 Write PHP script to demonstrate use of string function- strpos(). html head title String Function - strpos /title Head body h1 int strpos(string str1 , Mixed Searchstring [,int offset 0] ) /h1

?phpecho strpos("Hello How are u","u") . " br/ ";echo strpos("Hello How are u","y") . " br/ ";echo strpos("Hello How are u a man", "65") . " br/ ";echo strpos("Hello How are u a man", "How ") . " br/ ";echo strpos("Hello How are u","e",2) . " br/ ";echo strpos("Hello How are u","H",2) . " br/ ";? /body /html OUTPUT:13.7 Write PHP script to demonstrate use of string function- - str replace (). html head title String Function - str replace() /title Head body pre h1 str replace(find , replace , string , count) /h1 /pre ?phpecho str replace("Hello","Hi","Hello How are u") . " br/ "; myarray o " pre ";print r(str replace("black","red", myarray, i));echo " pre ";echo " i";?

/body /html OUTPUT:13.8 Write PHP script to demonstrate use of string function- strrev (). html head title String Function - strrev() /title Head body pre h1 string strrev(string string) /h1 /pre ?phpecho strrev("HEllo PHP")." br ";echo strrev("Programming")." br "; var1 "Naman" ; var2 strrev( var1);if(strcasecmp( var1, var2) 0){echo "Its Palindrome string";}else{echo "Its NOT Palindrome string";}? /body /html OUTPUT:

14.1 Write PHP script to demonstrate use of Math functions. abs() & round().OUTPUT:14.2 Write PHP script to demonstrate use of Math functions. ceil() & floor().OUTPUT:14.3 Write PHP script to demonstrate use of Math functions. min() & max().OUTPUT:14.4 Write PHP script to demonstrate use of Math functions. pow() & sqrt().OUTPUT:

15.1 Write PHP script to demonstrate use of date/time functions – date(). html head title String Function - Date() /title /head body H2 string date (string format [, int timestamp]) /h2 br/ ?phpecho date("d/m/y")." br/ " ;echo date("d.m.y")." br/ " ;echo date("Y/m/d")." br/ " ;echo date("D/M/Y")." br/ " ;echo date("l-F-y")." br/ " ;echo date("d/m/y h:i:s a")." br/ " ;echo date("d/m/y h:i:s A")." br/ " ;echo date("d/m/y G :i:s a")." br/ " ;? /body /html OUTPUT:15.2 Write PHP script to demonstrate use of date/time functions – getDate(). html head title String Function - getDate() /title /head body H2 array getdate ([ int timestamp time()s]) /h2 br/ ?phpecho getdate()." br/ " ; // errorecho " pre ";print r(getdate()) . " br/" ;

? /body html OUTPUT:15.3 Write PHP script to demonstrate use of date/time functions – Setdate (). html head title String Function - Setdate() /title /head body H2 public DateTime datetime : : setdate( int year, int month, int day ) /h2 br/ h2 Reset the current date of the datetime object to different date . /h2 br/ ?php Date new DateTime(); Date- setDate(2010, 3, 11);echo Date - format('Y-m-d');? /body /html OUTPUT:15.4 Write PHP script to demonstrate use of date/time functions – mktime().OUTPUT: html head title String Function - mktime() /title /head body H2 mktime(hour,min,sec,month,day,year,dst) (Optional parameter) /h2 br/ h2 Get the UNIX timestamp for a date. /h2 br/

?phpecho mktime(1,1,1,1,1,2001) . " br/ ";echo mktime(0,0,0,0,0,2001). " br/ ";echo mktime(0,0,0,0,0,2012). " br/ ";? body html 15.5 Write PHP script to demonstrate use of date/time functions – time() & checkdate(). html head title String Function - time() and checkdate(month, day, year) /title /head body ?phpecho time()." br/ " ; nextWeek time() (7 * 24 * 60 * 60);// 7 days; 24 hours; 60 mins; 60 secsecho 'Now:'. date('Y-m-d') ."\n";echo 'Next Week: '. date('Y-m-d', nextWeek) ."\n";// or using strtotime():echo 'Next Week: '. date('Y-m-d', strtotime(' 1 week')) ."\n";var dump(checkdate(12, 05, 2012)) ." br/ ";var dump(checkdate(32, 10, 2014)) ." br/ ";var dump(checkdate(12, 32, 2012)) ." br/ ";var dump(checkdate(2, 29, 2001)) ." br/ ";? /body /html OUTPUT:

16.1 Write PHP Script to demonstrate use of Indexed/Numeric arrays and for FOR EACHloop execution. ?php// NUMERIC / INDEXED ARRAY// FIRST METHOD numbers array(1,2,3,4,5);foreach ( numbers as value){echo "Value is value"." br ";} myArray array("NBP", "MPC", "MEC", "SPIT", "SDP");foreach ( myArray as value){echo "College Name is value"." br ";}// SECOND METHOD Friends[0] "Ravi"; Friends[1] "Ketul"; Friends[2] "Sameer"; Friends[3] "Dhaval"; Friends[4] "Amit";foreach ( Friends as value){echo "Friends is value"." br ";}echo " br ";print r( numbers);echo " br ";print r( Friends);? OUTPUT:

16.2 Write PHP Script to demonstrate use of associative arrays and for FOR EACH loopexecution. html head title Array Example : ASSOCIATIVE ARRAY /title /head body ?php myArray array('it' 'Samir','me' 'Bhavik','ee' 'Amit','ec' 'Ritesh','civil' 'Hitendra','gen' 'Prashant');echo " h1 " . "List of Head of N. B. Patel Polytechnic" . " /h1 " . " /br ";echo " h2 ";echo "Head of Computer Engineering / Information Technology : " . myArray['it'] . " /br ";echo "Head of Mechanical Engineering : " . myArray['me'] . " /br ";echo "Head of Electrical Engineering : " . myArray['ee'] . " /br ";echo "Head of Electrical & Communications : " . myArray['ec'] . " /br ";echo "Head of Civil Engineering : " . myArray['civil'] . " /br ";echo "Head of General Department : " . myArray['gen'] . " /br ";echo " /h2 ";foreach ( myArray as key value) {echo "Key is key value is value"." br ";}echo " br ";echo " br "; age array("Peter" "35","Ben" "37","Joe" "43");foreach( age as x x value) {echo "Key " . x . ", Value " . x value;echo " br ";}

echo " pre ";print r( myArray);? /body /html OUTPUT:16.3 Write PHP Script to demonstrate use of mixed array indexed associative arrays andprint using prinr r() function. ?php myArray array('Bipin',28,"Degree" "MTECH",'City' 'Mehsana',"Mehsana");echo " /h2 ";echo " pre ";print r( myArray);? OUTPUT:16.4 Write PHP Script to demonstrate use of multidimensional arrays . html head title Multidimensional Array Example /title /head body ?php marks array(

'Bipin' array ('Maths' 45,'Physics' 40,'Chemistry' 42,),'Ravi' array ('Maths' 40,'Physics' 40,'Chemistry' 40,),'amit' array ('Maths' 50,'Physics' 45,'Chemistry' 48,));echo "Marks for Bipin in Maths : ";echo marks['Bipin']['Maths']." /br ";echo "Marks for Bhavik in Physics : ";echo marks['Ravi']['Physics']." /br ";echo "Marks for Amit in Chemistry : ";echo marks['amit']['Chemistry']." /br ";echo " pre ";print r( marks);? /body /html OUTPUT:

16.4 Write PHP Script to demonstrate sorting arrays . html head title Array Function - SORT() /title /head body h1 bool sort (array array [,int sort flags SORT REGULR]) /h1 br/ h3 Sort the elements from Lowest to Highest Position /h3 ?php foo array("bob","fred","Marry","mark","Alen" ,"arya");sort( foo);print r( foo);echo " br/ " ;echo " br/ "; Batsman Gambhir');sort( Batsman);print r( Batsman);echo " br/ ";? /body /html OUTPUT:

Create a Student Registration form using different HTML form elements and display allstudent information on another page using PHP.Registration.php html head title Student Registration Form /title style type "text/css" h3{font-family: Calibri; font-size: 22pt; font-style: normal; font-weight: bold; color:SlateBlue;text-align: center; text-decoration: underline }table{font-family: Calibri; color:white; font-size: 11pt; font-style: normal;text-align:; background-color: SlateBlue; border-collapse: collapse; border: 2px solid navy}table.inner{border: 0px} /style /head body h3 STUDENT REGISTRATION FORM /h3 form action "RegistrationDispaly.php" method "POST" table align "center" cellpadding "10" !-- First Name -- tr td FIRST NAME /td td input type "text" name "First Name" maxlength "30" required/ (max 30 characters a-z and A-Z) /td /tr !-- Last Name -- tr td LAST NAME /td td input type "text" name "Last Name" maxlength "30" required/ (max 30 characters a-z and A-Z) /td /tr !-- Date Of Birth -- tr td DATE OF BIRTH /td td input type "text" name "Birthday day" maxlength "10" required/ /td /tr !-- Email Id -- tr td EMAIL ID /td td input type "email" name "Email" maxlength "100" style "width:250px" requiredplaceholder "Enter a valid email address" /td /tr

!-- Mobile Number -- tr td MOBILE NUMBER /td td input type "text" name "Mobile Number" maxlength "10" / (10 digit number) /td /tr !-- Gender -- tr td GENDER /td td input type "radio" name "Gender" value "Male" checked/ Male input type "radio" name "Gender" value "Female" / Female /td /tr !-- Address -- tr td ADDRESS br / br / br / /td td textarea name "Address" rows "4" cols "30" /textarea /td /tr !-- City -- tr td CITY /td td select name "City" id "City" option value "0" selected -- Select -- /option option value "Ahmedabad" Ahmedabad /option option value "Mehsana" Mehsana /option option value "Patan" Patan /option option value "Gandhinagar" Gandhinagar /option option value "Visnagar" Visnagar /option /select /td /tr !-- Pin Code -- tr td PIN CODE /td td input type "text" name "Pin Code" maxlength "6" / (6 digit number) /td /tr !-- State -- tr td STATE /td td input type "text" name "State" maxlength "30" / (max 30 characters a-z and A-Z) /td /tr

!-- Country -- tr td COUNTRY /td td input type "text" name "Country" value "India" readonly "readonly" / /td /tr !-- Hobbies -- tr td HOBBIES br / br / br / /td td Drawing input type "checkbox" name "Hobby Drawing" value "Drawing" / Singing input type "checkbox" name "Hobby Singing" value "Singing" / Dancing input type "checkbox" name "Hobby Dancing" value "Dancing" / Sketching input type "checkbox" name "Hobby Cooking" value "Cooking" / br / Others input type "checkbox" name "Hobby Other" value "Other" input type "text" name "Other Hobby" maxlength "30" / /td /tr !-- Qualification-- tr td QUALIFICATION br / br / br / br / br / br / br / /td td table tr td align "center" b Sl.No. /b /td td align "center" b Examination /b /td td align "center" b Board /b /td td align "center" b Percentage /b /td td align "center" b Year of Passing /b /td /tr tr td 1 /td td Class X /td td input type "text" name "ClassX Board" maxlength "30" / /td td input type "text" name "ClassX Percentage" maxlength "30" / /td td input type "text" name "ClassX YrOfPassing" maxlength "30" / /td /tr tr td 2 /td td Class XII /td td input type "text" name "ClassXII Board" maxlength "30" / /td td input type "text" name "ClassXII Percentage" maxlength "30" / /td td input type "text" name "ClassXII YrOfPassing" maxlength "30" / /td /tr

tr td 3 /td td Graduation /td td input type "text" name "Graduation Board" maxlength "30" / /td td input type "text" name "Graduation Percentage" maxlength "30" / /td td input type "text" name "Graduation YrOfPassing" maxlength "30" / /td /tr tr td /td td /td td align "center" (10 char max) /td td align "center" (upto 2 decimal) /td /tr /table /td /tr !-- Course -- tr td COURSES br / APPLIED FOR /td td input type "radio" name "Course" value "Diploma" Diploma input type "radio" name "Course" value "Degree" Degree input type "radio" name "Course" value "Master" Master /td /tr tr td Registration Password /td td input type "password" name "Password" id "Password" maxlength "20" / /td /tr !-- Submit and Reset -- tr td colspan "2" align "center" input type "submit" value "Submit" input type "reset" value "Reset" /td /tr /table /form /body /html

RegistrationDispaly.php html head title Student Registration Display Form /title /head body h3 STUDENT INFORMATION /h3 Student Name : ?php echo POST["First Name"] ." ". POST["Last Name"]." br/ ";? D.O.B : ?php echo POST["Birthday day"]." br/ ";? Email ID : ?php echo POST["Email"]." br/ ";? Gender : ?php echo POST["Gender"]." br/ ";? Address : ?php echo POST["Address"]." br/ ". POST["City"]." br/ ". POST["Pin Code"]." br/ ";? ?php echo POST["State"]." br/ ";? ?php echo POST["Country"]." br/ ";? Hobbies : ?php echo POST["Hobby Drawing"]." , ". POST["Hobby Singing"]." ,". POST["Hobby Dancing"]." , ". POST["Hobby Cooking"]." , ". POST["Other Hobby"];? table tr td align "center" b Sl.No. /b /td td align "center" b Examination /b /td td align "center" b Board /b /td td align "center" b Percentage /b /td td align "center" b Year of Passing /b /td /tr tr td 1 /td td Class X /td td ?php echo POST["ClassX Board"];? /td td ?php echo POST["ClassX Percentage"];? /td td ?php echo POST["ClassX YrOfPassing"];? /td /tr tr td 2 /td td Class XII /td td ?php echo POST["ClassXII Board"];? /td td ?php echo POST["ClassXII Percentage"];? /td td ?php echo POST["ClassXII YrOfPassing"];? /td /tr tr td 3 /td td Graduation /td td ?php echo POST["Graduation Board"];? /td td ?php echo POST["Graduation Percentage"];? /td

td ?php echo POST["Graduation YrOfPassing"];? /td /tr tr td /td td /td td align "center" /td td align "center" /td /tr /table COURSES APPLIED FOR : b ?php echo POST["Course"]." br/ ";? /b Registration Password : ?php echo POST["Password"];? /body /html OUTPUT:

AIM: - Write a PHP program to create a database using MySQL. html head title Create Database. /title /head body ?php con mysql connect("localhost","root","");if(! con){ die("not opened"); }echo "Connection open"." /br "; query "create database std"; crdb mysql query( query, con);if(! crdb){ die("not created. .!".mysql error()); }echo "database created. !";? /body /html O/P:Connection opendatabase created. ! AIM: - Write a PHP program to drop a database using MySQL. html head title Drop Database. /title /head body ?php con mysql connect("localhost","root","");if(! con){ die("not opened");}echo "Connection open"." /br "; query "drop database std"; crdb mysql query( query, con);if(! crdb){die("not droped. .!" .mysql error());}echo "database droped. !";? /body /html

O/P:Connection opendatabase droped. ! AIM: - Write a PHP program to create a table in MySQL. html head title Create Table. /title /head body ?php con mysql connect("localhost","root","");if(! con){die("not opened");}echo "Connection open"." /br "; db mysql select db("std", con);if(! db){die("Database not found".mysql error());}echo "Database is selected"." /br "; query "create table computer(id INT not null,name varchar(50),branchvarchar(50))"; crtb mysql query( query, con);if(! crtb){die(" table not created. .!".mysql error());}echo "table created. !"." /br ";? /body /html O/P:Connection openDatabase is selectedtable created. !

AIM: - Write a PHP program to insert record into a table using MySQL. html head title Insert Record. /title /head body ?php con mysql connect("localhost","root","");if(! con){die("not opened");}echo "Connection open"." /br "; db mysql select db("std", con);if(! db){die("Database not found".mysql error());}echo "Database is selected"." /br "; query1 "insert into computer values(001,'Bipin','CE')"; insrtb1 mysql query( query1, con); query2 "insert into computer values(002,'Utsav','IT')"; insrtb2 mysql query( query2, con);if(! insrtb

print "Hello World"; ? OUTPUT: Welcome to PHP Programming !!!! This string was made with multiple parameters.Welcome to PHP Programming !!!! Welcome to PHP Hello World Echo (PHP) Print (PHP) Parameters echo can take more than one parameter when used without parentheses. The syntax

Related Documents:

PHP is FREE to download from the official PHP resource: www.php.net PHP is easy to learn and runs efficiently on the server side Where to Start? To get access to a web server with PHP support, you can: Install Apache (or IIS) on your own server, install PHP, and MySQL Or find a web hosting plan with PHP and

PHP is an acronym for "PHP: Hypertext Preprocessor" PHP is a widely-used, open source scripting language PHP scripts are executed on the server PHP is free to download and use What is a PHP File? PHP files can contain text, HTML, CSS, JavaScript, and PHP code PHP code are executed on the server, and the result is returned to the browser .

php architect's Guide to PHP Design Patterns A Practical Approach to Design Patterns for the PHP 4 and PHP 5 Developer Jason E. Sweat USA 21.99 Canada 29.99 U.K. 16.99 Net php architect's Guide to PHP Design Patterns Design patterns are comprehensive, well-tested solutions to common problems that developers everywhere encounter each day.

you can't view your .php page on your local hard drive; you'll either see nothing or see the PHP source code if you upload the file to a PHP-enabled web server, requesting the .php file will run the program and send you back its output 5.2: PHP Basic Syntax 5.1: Server-Side Basics 5.2: PHP Basic Syntax 5.3: Embedded PHP 5.4: Advanced PHP Syntax

My Pals are Here! 3 Edition Books A, B /Workbooks . Php 1,804.68 . The Filipino Odyssey 4 . Php 826.20 . Science for Active Learning 4 . Php 772.20 . Walking in The Spirit . Php 811.40 . HELE for Life 4 . Php 688.90 . E-Book . Php 1,404.00 . None None . Php 8,404.32 GRADE 5 . English This Way 5 (3. rd. Edition) Php 658.80 . Read rd to Lead 5 .

PHP is FREE to download from the official PHP resource: www.php.net PHP is easy to learn and runs efficiently on the server side Where to Start? To get access to a web server with PHP support, you can: Install Apache (or IIS) on your own server, install PHP, and MySQL Or find a web hosting plan with PHP an

PHP runs on various platforms (Windows, Linux, Unix, Mac OS X, etc.) PHP is compatible with almost all servers used today (Apache, IIS, etc.) PHP supports a wide range of databases PHP is free. Download it from the official PHP resource: www.php.net PHP is easy to learn

DRCP Availability in PHP DRCP is available in the new OCI8 1.3.1 beta Must be linked with Oracle database 11g client libraries against an Oracle database 11g Default in PHP 5.3 and PHP 6 PHP 5.2.4 Build PHP with DRCP-enabled OCI8 1.3.1 Beta from PECL under PHP 5.2.4 ext/oci8; configure, build, and install PHP as normal