problems with my link-submitting script

kraftwerk
07-30-2002, 03:32 PM
here's the URL: http://links.jamcalc.org/submit.php

here's the code:

<FORM ACTION="<?=$PHP_SELF?>" METHOD="post" NAME="linksubmit">
<table border="1" bordercolor="#828282" bgcolor="c0c0c0" cellspacing="2" cellpadding="3">
<tr bgcolor="#cccccc">
<td align="left"><b><i>::</i><small>Submit Links</small></b></td>
</tr>
<tr><td align="center">
<small>Link Name</small><br>
<INPUT TYPE="text" SIZE="20" NAME="name"><br>
<small>URL</small><br>
<INPUT TYPE="text" SIZE="20" NAME="url" value="http://"><br>
<small>Description</small><br>
<INPUT TYPE="text" SIZE="20" NAME="description"><br>
<INPUT TYPE="submit" NAME="post" VALUE=" Submit ">
</tr>

</table>
</FORM>


<?
if (isset($_POST['post'])) { // if the submit button was pressed...
$fp = fopen('http://links.jamcalc.org/linksubmit.txt','a');
$link = "<tr class='smalltext'><td>" . "[<a href='" . $url . "'>" . $name . "</a>] - " . $description . "</td></tr><tr><td align=center><img src=http://jamcalc.org/newsline.gif></td></tr>";
fwrite($fp, $link);
fclose($fp);
}
?>


after i fill out the form and press the SUBMIT button, it does not add the data to the txt file. whats wrong?

bionicdonkey
08-08-2002, 05:00 AM
have you tried putting the php code before the form??

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum