1 / 17

Lesson 18

Lesson 18. CGI Setup. CGI Scripts/ Program. Server. Browser. Request. Http reply. Database. <HTML> <BODY> <A href=http://www.onlineshop.com/cgi-bin/hello1.cgi> Click here to view the record of your previous transactions </A> <p> <A href=http://www.onlineshop.com/cgi-bin/hello2.cgi>

gaura
Download Presentation

Lesson 18

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Lesson 18

  2. CGI Setup CGI Scripts/ Program Server Browser Request Http reply Database

  3. <HTML> <BODY> <A href=http://www.onlineshop.com/cgi-bin/hello1.cgi> Click here to view the record of your previous transactions </A> <p> <A href=http://www.onlineshop.com/cgi-bin/hello2.cgi> List of IT Books for sale </A> </BODY> </HTML>

  4. Perl example – hello2.cgi print "<head>\n"; print "</head>\n"; print "<body>\n"; print "<h1>IT Books</h1>\n"; print "<b>Description of available books</b><br>"; &SetOracle; &RunSQL("Select * from ITBOOKS"); &StopOracle; print "</body></html>\n";

  5. Select Statement Select author,publisher from ITBOOKS where coursename=‘e-commerce’

  6. <HTML> <BODY> <H3>To Register Please Enter The Following Information:</H3> <FORM NAME="regForm" ACTION="http://www.onlineshop.com/hello.asp" METHOD="POST"> Name: <INPUT TYPE="TEXT" NAME="Name" maxlength="25"> <P> Address: <INPUT TYPE="TEXT" NAME="userAdd" maxlength="50"> <P> Password: <INPUT TYPE="Password" NAME="userPassword" maxlength="15"> <P> Email: <INPUT TYPE="TEXT" NAME="email" maxlength="15"> <P> <INPUT TYPE="submit" NAME="Go" VALUE="Register!"> <INPUT TYPE="RESET" VALUE="Reset!"> </FORM> </BODY> </HTML>

  7. Insert Statement INSERT INTO Register(Name,Address,Password,Email) VALUES(Request.form("Name"), Request.form("Address"), Request.form("Password"), Request.form("Email"))

  8. Server Side Scripts • Active Server Pages (.asp) • Java Server pages (.jsp) • Hypertext Preprocessor (.php)

  9. Intrinsic Objects of ASP • Response Object • Request Object • Server Object • Application Object • Session Object • ObjectContext Object • ASPError Object

  10. <%@Language="VBSCRIPT"%> <%option explicit%> <%Dim lastname Dim firstname Dim myage lastname="Ali" firstname="Imran" myage=30 %> <html> <head><title>It is easy</title></head> <body> My name is <%=firstname%> <%=lastname%> and my age is <%Response.Write myage%> </body> </html>

  11. <FORM NAME="regForm" ACTION="regcheck.asp" METHOD="POST" onSubmit="returncheckValues()"> Name: <INPUT TYPE="TEXT" NAME="userName" maxlength="25"> <P> Login: <INPUT TYPE="TEXT" NAME="userlogin" maxlength="15"> <P> <INPUT TYPE="submit" NAME="Go" VALUE="Register!"> <INPUT TYPE="RESET" VALUE="Reset!"> </FORM> …

  12. regcheck.asp <%@Language="VBSCRIPT"%> <%option explicit%> <%Dim loginname Dim name loginname=Request.Form("userlogin") name=Request.Form("username") %> <html> <head><title>It is easy</title></head> <body> My name is <%Response.Write name%> and I am going to use <%Response.Write loginname%> as my login </body> </html>

  13. <%@Language="VBSCRIPT"%> <%option explicit%> <HTML> <Body> Test1 <% Dim myString="ecommerce" %> <%If Time>=#12:00 AM# and Time<=#12:00 PM# then%> <h3>Good Morning Pakistan</h3> <%else%> <h3>Hello Everyone <p> <% Dim j For j=1 to 3 response.write myString response.write "<p>" Next %></h3> <% end if %> </Body> </HTML>

More Related