You want to fetch the longurl form value in the link?
http://www.smarturl.uni.cc/index.php?longurl=$longurl
how about this way?
Displays the form, request for value and submit,
if longurl value submited, header to
http://www.smarturl.uni.cc/index.php?longurl=$longurl
PHP Code:
<?php
if (isset($_POST['longurl'])){
$longurl = $_POST['longurl'];
header("location: http://www.smarturl.uni.cc/index.php?longurl=$longurl");
}else{
echo '
<form action="'.$_SERVER['PHP_SELF'].'" method="post" target="_blank">
<table><tr><td>
Enter a long URL to make
<a href="www.smarturl.uni.cc"> Smart URL:<br />
<input type="text" name="longurl" size="30">
<input type="submit" name="submit" value="Make Smart URL!">
</td></tr></table>
</form>';
}
?>