Learning Mysql



Download 4.24 Mb.
View original pdf
Page366/366
Date04.08.2023
Size4.24 Mb.
#61806
1   ...   358   359   360   361   362   363   364   365   366
Learning MySQL

Pet roll call

".
"".
"".
"";
foreach my Name (keys %$results)
{
$result.=
"".
"".
"".
"";
}
$result.=
"
NameCount
$Name".$results->{$Name}->{Count}."
".
" The string you entered was 'type your query here'
Dumping all the submitted data...
query: type your query here
submit_button: Submit query
// Show a logout link and a link to the main page echo "Logout | Gift list";
578 | Appendix:
The Wedding Registry Code

echo "\n

Gift editing page

";
// Show the existing gifts for editing showgiftsforedit($connection);
?>

Jack and Jill's Wedding Gift Registry


// If an error message is stored, show it...
if (isset($message))
echo "

{$message}

";
Overview | 579


?>
(if you've not logged in before, makeup a username and password)
" method="POST">
Please enter a username:
value="echo $_POST['username'];?>" />
Please enter a password:




// Show a logout link echo "Logout";
// Check whether the user is Jack or Jill (username is 'jack' or
// 'jill'); if so, show a link to the gift editing page.
if($_SESSION['username']=="jack" || $_SESSION['username']=="jill")
echo " | Edit gifts";
// Connect to the MySQL DBMS and use the wedding database -
// credentials are in the file db.php if(!($connection= @ mysqli_connect(
$DB_hostname, $DB_username, $DB_password, $DB_databasename)))
showerror($connection);
// Pre-process the message data for security if(count($_GET))
$message = clean($_GET["message"], 128);
// If there's a message to show, output it if (!empty($message))
echo "\n

".
urldecode($message)."

";
echo "\n

Here are some gift suggestions

";
// Show the gifts that are still unreserved showgifts($connection, SHOW_UNRESERVED_GIFTS);
echo "\n

Your Shopping List

";
// Show the gifts that have been reserved by this user showgifts($connection, SHOW_GIFTS_RESERVED_BY_THIS_USER);
?>
Download 4.24 Mb.

Share with your friends:
1   ...   358   359   360   361   362   363   364   365   366




The database is protected by copyright ©ininet.org 2024
send message

    Main page