Go Hokies"; echo "

Hokies rule!

"; echo "

"; echo "Frank Beamer is the best coach ever!"; echo "
" echo "VT is going to crush $next_opponent!!!" … $hokies<<Go Hokies

Hokies rule!

" VT is going to crush $next_opponent!!! SOMETOKEN; echo $hokies;"> Go Hokies"; echo "

Hokies rule!

"; echo "

"; echo "Frank Beamer is the best coach ever!"; echo "
" echo "VT is going to crush $next_opponent!!!" … $hokies<<Go Hokies

Hokies rule!

" VT is going to crush $next_opponent!!! SOMETOKEN; echo $hokies;">

Presentation is loading. Please wait.

Presentation is loading. Please wait.

Web Programming Week 4 Old Dominion University

Similar presentations


Presentation on theme: "Web Programming Week 4 Old Dominion University"— Presentation transcript:

1 Web Programming Week 4 Old Dominion University
Department of Computer Science CS 418/518 Fall 2007 Michael L. Nelson 9/17/07

2 HERE document … echo "<title>Go Hokies</title>";
echo "<h1>Hokies rule!</h1>"; echo "<p>"; echo "Frank Beamer is the best coach ever!"; echo "<br>" echo "VT is going to crush $next_opponent!!!" $hokies<<<SOMETOKEN <title>Go Hokies</title> <h1>Hokies rule!</h1> <p Frank Beamer is the best coach ever! <br>" VT is going to crush $next_opponent!!! SOMETOKEN; echo $hokies;

3 Neat Usage of HERE <?php … // some code to assemble $header_message
// lots of code to assemble $main_message // some code to assemble $footer_message echo $header_message; echo $main_message; echo $footer_message; ?>

4 Tables Season Record (W-L) <table> <tr>
<th>Season</th> <th>Record (W-L)</th> </tr> <td>1993</td> <td>9-3</td> <td>1994</td> <td>8-4</td> <td>2005</td> <td>11-2</td> </table> Season Record (W-L) 1993 9-3 1994 8-4 1995 10-2 1996 1997 7-5 1998 1999 11-1 2000 2001 2002 10-4 2003 8-5 2004 10-3 2005 11-2

5 Forms <a href="url2?var1=a&var2=b">click me</a> URL1 URL2

6 Single URL, Run-time Inclusion
<?php if ($_REQUEST['action'] == "edit") { require "edit.php"; }elsif ($_REQUEST['action'] == "add") { require "add.php"; }elsif ($_REQUEST['action'] == "delete") { require "delete.php"; } else { require "initialpage.php"; } ?> URL1 <form action="url1" method=post> <input type=radio name=action value=edit> <input type=radio name=action value=add> <input type=radio name=action value=delete> </form> <?php if ($_REQUEST['action'] == "") { require "initialpage.php"; } else { require $_REQUEST['action'] . "php" or die "unknown action!"; } ?>


Download ppt "Web Programming Week 4 Old Dominion University"

Similar presentations


Ads by Google