1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163
| <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" >
<head>
<title>Config File</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="./style.css" />
<SCRIPT language="Javascript">
function display_applist(){
appfound.style.visibility="visible";
}
function hide_applist(){
appfound.style.visibility="hidden";
}
</Script>
</head>
<body>
<form name="sendfile" method="POST" ENCTYPE="multipart/form-data" action="index.php">
<!--
add S: shortcut
-->
<fieldset class="cadre">
<!--
dynamic name of the application in PHP
$application_name=$_POST['application_name'];
echo "<legend>Application : ".$application_name."</legend>" ;
-->
<legend>Choose your Application</legend>
<br>
Scroll down the list and check if your application has already been uploaded :
</br>
<?php
// Configuration de la connexion à la base de données
define('MYSQL_HOTE', 'localhost');
define('MYSQL_UTILISATEUR', 'root');
define('MYSQL_MOT_DE_PASSE', 'azerty');
define('MYSQL_BASE_DE_DONNEES', 'mysql');
$application_list = isset($_POST['application_list']) ? $_POST['application_list'] : '';
// DB connection
mysql_connect(MYSQL_HOTE, MYSQL_UTILISATEUR, MYSQL_MOT_DE_PASSE) or die('<h1>Connexion au serveur impossible !</h1>');
mysql_select_db(MYSQL_BASE_DE_DONNEES) or die('<h1>Connexion impossible à la base</h1>');
$query = mysql_query("SELECT * FROM upload;") or die (mysql_error());
if ($query) {
echo '<p>' ;
echo '<form name = "list" method="POST"> ';
echo '<select name="application_list" id=application_list>' ;
echo '</p>' ;
while ($array = mysql_fetch_assoc($query)) {
if ($application_list == $array['name']) {
echo '<option value="' . $array['name'] . '" selected>' . $array['name'] . '</option>';
} else {
echo '<option value="'.$array['name'] . '">' . $array['name'] . '</option>';
}
}
echo '</select>';
}
?>
<p>
Have you found your application ?
<input type="radio" name="applisted" value="yes" onclick = display_applist(); > Yes
<input type="radio" name="applisted" value="no" onclick = hide_applist(); > No<br>
</p>
<div id="appfound" style="visibility:hidden;" >
<p>
Please select the application you want to change :
</p>
<?php
$query = mysql_query("SELECT * FROM upload WHERE name = 'applitest';") or die (mysql_error());
if ($query) {
echo '<select name="application_list" id=application_list>' ;
echo '</p>' ;
while ($array = mysql_fetch_assoc($query)) {
if ($application_list == $array['nametimestamp']) {
echo '<option value="' . $array['nametimestamp'] . '" selected>' . $array['nametimestamp'] . '</option>';
} else {
echo '<option value="'.$array['nametimestamp'] . '">' . $array['nametimestamp'] . '</option>';
}
}
echo '</select>';
}
?>
</div>
<p>
<input type=button value="Go !" onclick=submit(); ;
</p>
</form>
</body>
</html> |
Partager