Folge dem Video um zu sehen, wie unsere Website als Web-App auf dem Startbildschirm installiert werden kann.
Anmerkung: Diese Funktion ist in einigen Browsern möglicherweise nicht verfügbar.
<?php
if ($_COOKIE[success]=="1")
{
} else {
//go back to login if not successful
header("Location: login.php");
exit;
}
$connection=mysql_connect("localhost","someone","project") or die(mysql_error());
mysql_select_db("cdcat", $connection) or die(mysql_error());
$display = "<h2>Select a version to delete</h2>";
if (isset($_POST['submit']))
{
$deleteVer = "delete from versions where versionname = '$_POST[ver_id]'";
$verRes = mysql_query ($deleteVer, $connection) or die('<IMG ALIGN=left SRC="logo.gif"><br><br><br><br><br>'.'<font face ="Tahoma" size=2> You cannot delete this version because you still have CDs referencing it in your cds table. <br>Please <a href="deletecd.php"><b>remove</b></a> those records first</font>');
}
$getVer = "select versionname from versions order by versionname";
$getVerRes = mysql_query($getVer, $connection) or die(mysql_error());
if (mysql_num_rows($getVerRes) <1)
{
$display .= "<p>Sorry, there are no versions in the database yet </p>";
} else {
$display .= "
<form method=\"POST\" action=\"$_SERVER[PHP_SELF]\"><br>
<select name=\"ver_id\">
<option value=\"\"> -- Select one --</option>";
while ($record = mysql_fetch_array($getVerRes))
{
$id = $record['versionname'];
$verName = stripslashes ($record['versionname']);
$display .="<option value=\"$id\"> $verName </option>";
}
$display .= "
</select>
<input type=\"submit\" name=\"submit\" value=\"Delete version\"></p>
</form>";
}
?>
<html><head><title>Delete a version</title>
<link rel=stylesheet type="text/css" href="project.css"></head>
<body>
<img align=left src="logo.gif">
<br><br><br><br><br><br><br>
<center>
<?php echo $display; ?></center>
</body>
</html>
<?php
if ($_COOKIE[success]=="1"){
$connection = mysql_connect("localhost","someone","project") or die(mysql_error());
mysql_select_db("cdcat", $connection) or die(mysql_error());
$display = "<h2>Select a version to delete</h2>";
if (isset($_POST['submit'])){
$deleteVer = "DELETE FROM versions WHERE versionname = '$_POST[ver_id]'";
$verRes = mysql_query ($deleteVer, $connection) or die('<IMG ALIGN=left SRC="logo.gif"><br><br><br><br><br>'.'<font face ="Tahoma" size=2> You cannot delete this version because you still have CDs referencing it in your cds table. <br>Please <a href="deletecd.php"><b>remove</b></a> those records first</font>');
}
$getVer = "SELECT versionname FROM versions ORDER BY versionname";
$getVerRes = mysql_query($getVer, $connection) or die(mysql_error());
if (mysql_num_rows($getVerRes) < 1){
$display .= "<p>Sorry, there are no versions in the database yet </p>";
} else {
$display .= "
<form method=\"POST\" action=\"$_SERVER[PHP_SELF]\"><br>
<select name=\"ver_id\">
<option value=\"\"> -- Select one --</option>";
while ($record = mysql_fetch_array($getVerRes)){
$id = $record['versionname'];
$verName = stripslashes ($record['versionname']);
$display .="<option value=\"$id\"> $verName </option>";
}
$display .= "
</select>
<input type=\"submit\" name=\"submit\" value=\"Delete version\"></p>
</form>";
}
?>
<html><head><title>Delete a version</title>
<link rel=stylesheet type="text/css" href="project.css"></head>
<body>
<img align=left src="logo.gif">
<br><br><br><br><br><br><br>
<center>
<?php echo $display; ?></center>
</body>
</html>
<?php
} else {
//-- go back to login if not successful
header("Location: login.php");
exit;
}
?>