Ok, here is the scoop I have this (see below) and on htis page I have a form that calls a function. Well, I have noticed that the OTHER forms on this page ALSO call the function. What is wrong in my code?
The Function name is dumpit() and is the last form on the page. If I use the form above it, the Function dumpit() is still called.
here is the page -
<?php
//calling the header file, which has the dB connection info
//and the header of the page
include("includes/header.inc");
include("includes/Functions.inc");
?>
<form method="post" Action="ComicSearch.php">
<table>
<tr>
<th>Search by Letter:</th><td><input type='Text' name='alphachar' size='1' maxlength='1'></td>
<td><input type="Submit" name="AlphaSearch" value="Search"></td>
</tr>
<tr>
<th>List Comics by Box:</th><td><input type='Text' name='boxlist' size='2' maxlength='2'></td>
<td><input type="Submit" name="ListByBox" value="Search"></td>
</tr>
<tr>
<th>Search by Name:</th><td><Input type='Text' name='criteria' Size='10'></td>
<td><input type="Submit" name="CritSearch" value="Search"></td>
</tr>
</table>
</form><br>
<form method="post" Action="ComicSearch.php">
<input type="Submit" value="List All Comics" name="ListAll">
</form>
<form method="post" Action="PublisherSearch.php">
<input type="Submit" value="List All Publishers" name="ListAll">
</form>
<form method="post" name="InputForm">
<input type="Submit" value="BackUp dB" name="<? dumpIt();?>">
</form>
<?php
//calling the footer file, which has the closing page info
include("includes/footer.inc");
?>
Here is the function -
<?
function dumpIt()
{
//Function dumpIt Variables
$dB = MyComix;
$datestamp = date("m.d.y-hi");
$dump = "c:\phpdev\mysql\bin\mysqldump --opt $dB > DBBackups/$dB.$datestamp.sql";
shell_exec("cmd /c $dump");
}
?>
I know it is something silly ..
Dave