
Untitled
By: a guest on
Apr 24th, 2012 | syntax:
None | size: 2.15 KB | hits: 13 | expires: Never
Populating and creating two dropdown list from array using PHP
if($output_form == 1){
?>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<label>ID</label>
<input type="text" name="ID" /><br /><br/>
<label>Name</label>
<input type="text" name="name" /><br /><br/>
<label>Upload1:</label>
<input type="file" name="upload1" /><br />
<label>Upload2:</label>
<input type="file" name="upload2" /><br />
<label>Catalogue</label>
<select name="cataloguepdfs" />
<?php
foreach ($catalogueArray as $cataloguePDFName) {
echo '<option value="'. $cataloguePDFName . '">' . $cataloguePDFName . '<option />';
}
?>
<label>Template</label>
<select name="templatepdfs" />
<?php
foreach ($templateArray as $templatePDFName) {
echo '<option value="'. $templatePDFName . '">' . $templatePDFName . '<option />';
}
?>
<input type="submit" name="submit" value="Submit">
</body>
</html>
<?php
}
?>
<select name="cataloguepdfs">
<?php
foreach ($catalogueArray as $cataloguePDFName) {
echo '<option value="'. $cataloguePDFName . '">' . $cataloguePDFName . '<option />';
}
?>
</select>
<label>Catalogue</label>
<select name="cataloguepdfs">
<?php
foreach ($catalogueArray as $cataloguePDFName) {
echo '<option value="'. $cataloguePDFName . '">' . $cataloguePDFName . '<option />';
}
?>
</select>
<label>Template</label>
<select name="templatepdfs">
<?php
foreach ($templateArray as $templatePDFName) {
echo '<option value="'. $templatePDFName . '">' . $templatePDFName . '<option />';
}
?>
</select>