launching php file from button not link
Posted: Sun Feb 01, 2004 5:31 pm
Hi... any help much appreciated!
I have created a file called addvenue.php with the following if condition at the start of it:
in the default page display is a link that will reload the page making the if condition true, showing the submission form.
I can make the link work with a word:
But i really want it to be a button. I can make other button links such as:
That basically refreshes the page. Can i make a button link for the if condition too? I tried this:
but it only reloads the same page...
anyone know why this is happening or how else i could do it? Am i going about this the wrong way?
thanks
I have created a file called addvenue.php with the following if condition at the start of it:
Code: Select all
<?php
if (isset($_GET['addvenue'])): // If the user wants to add a venue
?>
<form action="<?=$_SERVER['PHP_SELF']?>" method="post">
<p>Venue Name<br />
<input type="text" name="vname" SIZE="40"><br /><BR>
<input type="submit" name="submitvenue" value="SUBMIT" />
</p>
</form>
<?php
else: // Default page displayI can make the link work with a word:
Code: Select all
echo('<BR><a href="' . $_SERVER['PHP_SELF'] .
'?addvenue=1">Add a venue!</a><BR>');Code: Select all
echo('<FORM METHOD="LINK" ACTION="addvenue.php">
<INPUT TYPE="submit" VALUE="Refresh Page"></FORM>');Code: Select all
echo('<BR>
<FORM METHOD="LINK" ACTION="' . $_SERVER['PHP_SELF'] .'?addvenue=1"><INPUT TYPE="submit" VALUE="Add Venue">');anyone know why this is happening or how else i could do it? Am i going about this the wrong way?
thanks