Serverside PHP:
// form_page.php
<form action=move_page.php>
<?php
$results = mysql_query("SELECT name, id FROM category WHERE parent=12") ;
print "<select name=\"name\">\n" ;
while ( $row = mysql_fetch_row($results) )
print "<option>".htmlspecialchars($row[0])."</option>\n" ;
print "</select>\n" ;
?>
<input type=submit>
</form>
// move_page.php
$url = "http://www.server.com/".$name;
header("location: $url");
Clientsite JavaScript:
<script>
function pageSubmit() {
document.theform.action = document.theform.name.value;
document.theform.submit();
}
</script>
<form name=theform action=http://www.server.com/index.html>
<?php
$results = mysql_query("SELECT name, id FROM category WHERE parent=12") ;
print "<select name=\"name\">\n" ;
while ( $row = mysql_fetch_row($results) )
print "<option>".htmlspecialchars($row[0])."</option>\n" ;
print "</select>\n" ;
?>
<input type=button onClick="pageSubmit()">
</form>