PHP JSP ASP
Dynamic bloc <?php ?> <% %> <% %>
HTML insertion into the dynamic code <? for ($i=1; $i<10; $i++) { ?> HELLO<br/> <? } ?> <% for (int i=1; i<10; i++) { %> HELLO<br/> <% } %> For i = 1 to 6 response.write(tab(i) & "<br />") Next
bgcolor="#ffffff" height="10"> Comments server-side <?/*Comment*/?> <%--Comment--%>
bgcolor="#ffffff" height="10"> Page Inclusion include "file.php"; <?@ include file="file.txt" ?> <jsp :include page="file.jsp" flush="true" \> <!--#include virtual="file.asp"-->
bgcolor="#ffffff" height="10"> Declaration, init. <? $var = "value"; ?> <% String var = new String("value"); %> dim var var="value"
Referencing a variable $var var var
Display a variable <? echo $var; ?> ----------- <% response.write(var) %>
Display a variable <?=$var; ?> <%=var %> -------------
Concatenate strings $var . " string" Var + " string" var & " string"
Display the time <?=date("h:i A");?> <%=java.util.Calendar.getInstance().getTime() %> <% response.write (hour(now())%>
Session variable $_SESSION[‘var’] $_SESSION[‘var’] = $val; session.getAttribute("var"); session.setAttribute("var", val); Session("var") Session.Contents("var")
Request variable $_REQUEST[‘var’] $_GET[‘var’] $_POST[‘var’] request.getParameter("var"); -------- ------- --------- Request.QueryString("var") Request.Form("var")
Cookies $_COOKIES[‘var’]   Request.Cookies("var")
Arrays $tab = array(); $tab[] = "value";   Dim tab(6),i tab(1) = "value"
Foreach loop into an array foreach($_SESSION as $var) { echo $var . ‘<br/>’; }   dim i For Each i in Session.Contents Response.Write(i & "<br />") Next
Conditional if(h == 12) { echo "Good breakfast"; } else { echo "Hello"; } <%if(h == 12) {%> Good breakfast <%} else {%> Hello <%}%> If h=12 then response.write("Good breakfast") else response.write("Hello") end if
Functions function mul($n1, $n2) { return $n1*$n2; }   sub mul(n1,n2) response.write(n1*n2) end sub
Session Functions session_start( ) session_destroy( )   -------- Session.Abandon Session.Contents.RemoveAll() Session.Contents.Remove("var") Session.Timeout=5
Double interpretation PHP ${ $expression } JSP ${ expression } <!-- This page was loaded on <%= (new java.util.Date()).toLocaleString() %> --> Quick reference for installations of servers for dynamic web sites development
PHP – EasyPHP = Apache + PHP with MySQL
VENDOR : http://www.easyphp.org/ PATH : C:\Program Files\EasyPHP1-8\EasyPHP.exe WEB ROOT : C : \ Program Files \ easyPHP \ www \ START : Graphical interface : icon at bottom right corner URL : http://127.0.0.1/my_directory/ ADMIN MySQL : C:\Program Files\EasyPHP\mysql\bin\mysql –u root –p ADMIN MySQL : (phpMyAdmin) http://127.0.0.1/mysql/ Password MySQL : C:\Program Files\EasyPHP1-8\phpmyadmin\config.inc.php $cfg['Servers'][$i]['password'] = 'pass-word';
ASP – Apache avec ChiliASP (A SUN product)
VENDOR : http://httpd.apache.org/ http://www.sun.com/software/chilisoft/ PATH : C:\ Program Files \ Apache Group \ Apache \ WEB ROOT : C : \ Program Files \ Apache Group \ Apache \ htdocs \ START : http://127.0.0.1 : 5100 / URL : http://127.0.0.1/
ASP – IIS = Internet Information Services (A Microsoft product)
VENDOR : http://www.microsoft.com/windows2000/community/centers/iis/ INSTALL : Control Pannel – Add or Remove programs – Add/Remove Windows components - IIS PATH : %SystemRoot% \ system32 \ inetsrv \ iis.msc WEB ROOT : C : \ Inetpub \ wwwroot \ START : %SystemRoot%\system32\inetsrv\iis.msc URL : http://127.0.0.1/ ADMIN ODBC : %SystemRoot%\system32\odbcad32.exe
JSP – Tomcat with JBoss
VENDOR : http://www.jboss.com/products/jbossas/downloads/ PATH : C: \ jboss \ WEB ROOT : C: \ jboss \ deploy \ default \ ENVIRONMENT : JAVA_HOME and JBOSS_HOME START : . C: \ jboss \ bin \ run –c default URL : http://127.0.0.1 : 8080 / ADMIN JMX : http:// localhost : 8080 / jmx-console / ADMIN consol : C : \ jboss \ bin \ twiddle -s nom_hote:1099 serverinfo –d jboss
JSP – Tomcat (avec Apache)
VENDOR : http://tomcat.apache.org/ PATH : $CATALINA_HOME = C:\Program Files\Tomcat\ $APACHE = C:\Program Files\Apache INSTALL : $APACHE_HOME\modules\mod_jk.so WEB ROOT : $CATALINA_HOME \ webapps \ ENVIRONMENT : JAVA_HOME START : apache2ctl start URL : http://127.0.0.1/
© Copyright Nadine St-Amand IDE : C:\Program Files\Macromedia\Dreamweaver MX 2004\Dreamweaver.exe