1. . id .
2. id
, NULL, 0 - !!!
, echo !!
.
1. id
2. id .
3. id
4. , .
5. .
6. .
7. .
8. .
3
id .
4.
.
Form_book1.html
<html>
<head> <!-- -->
<title> </title>
<body bgcolor = silver text = green>
<h2 align = center> <!-- -->
</h2> <br>
<hr size=2 width=90% color = green> <!-- -->
<form action ="" method=get>
<div align=center>
Id
<input type=text name=nom > <br> <br><br> <!-- - --><br><br>
<table border=0 width=80%>
<!-- -->
<tbody>
<tr>
<td align=center> <input type=reset name=erase value= > </td>
<td align=center> <input type=submit name=send value= > </td>
</tr>
</tbody>
</table>
<br><br><br><br>
<a href="?out=1"> a </a><br><br><br><br>
</div>
</form>
</body>
</html>
Output.php
<?php
echo " $book[desc] <br>";
echo " - $book[price]<br><br><br>";
?>
<a href="?"> </a> <br> <br>
mistake.php
<?php
echo $output;?>
<a href="?"> </a> <br> <br>
Goodbye.php
<?php
echo " !!";
exit();
?>
<?php
$items = array(
array('id' => 11, 'desc' => '- ', 'price' => 24.95),
array('id' => 12, 'desc' => ' ', 'price' => 13.28),
array('id' => 13, 'desc'=> ' PHP', 'price' => 18.80),
|
|
array('id' => 14, 'desc' => ' ', 'price' => 100.20));
if (isset($_GET['out']))
{ include 'goodbye.php';
exit();}
If (!isset($_GET['send']))
{ include 'Form_book1.html';
exit(); }
else // send
if ($_GET['nom'] == NULL)// id
{ $output=" id <br><br>";
include 'forget.php';
exit(); }
else // id , ,
{ $nom = $_GET['nom'];
for ($count = 0; $count <= 3; ++$count)
{
$book = $items[$count]; // -
if ($book['id'] == $nom)
$nom1 = $count;
}
if (isset($nom1)) //
{
$book = $items[$nom1];
include 'output.php';
exit();
}
Else//
{ $output= " id <br> <br> <br>";
include 'forget.php';
exit();}
}
?>