I am trying to create a script that takes form input (textbox) and then sends the form input to itself (<?=$SERVER['PHP_SELF']?>) and then (it checks everytime) if($POST['submit']==true) it prints <a href="<?=$_POST['location']?>">Right click...</a> and then the form again...
This is the full code:
<html>
<head>
<title>Nick Flashes version 2 - ThePeccavi.co.uk</title>
</head>
<?php
if($_POST['submit']==false){
?>
<body>
<h1>Welcome to ThePeccavi's Nick Flashes version 2</h1>
<p>
This uses PHP to put your input into a link :-)
</p>
Put in the location (eg http://asite.com/flashdirectory/directory/flash.swf), this can be an html, php, javascript, pdf, any document on the web:<form action="<?=$SERVER['PHP_SELF']?>" method="post">
<input type="text" name="location">
<input type="submit" value="Nick Flash!">
</form>
</body>
<?php
}
elseif($POST['submit']==true){
?>
<body>
<h1>Welcome to ThePeccavi's Nick Flashes version 2</h1>
<p>
This uses PHP to put your input into a link :-)
</p>
Your Link:
<a href="<?=$_POST['location']?>">Right click and then click Save Link (or Target) as... then you can save the file on your computer and there you go!</a>
<br />
Go again?
<form action="<?=$_SERVER['PHP_SELF']?>" method="post">
<input type="text" name="location">
<input type="submit" value="Nick Flash!">
</form>
</body>
<?php }?>
</html>
to see it in action go to http://thepeccavi.co.uk/nickflashes2.php