...

View Full Version : Im having problems with writing to files. Could anyone please check my script?



l3vi
04-05-2003, 02:07 AM
Okie dokie, I just made sumthing that does the exact same thing this script does, and it worked, now I tried it but changed the look of the page, and it does not want to work... Could you please tell me where I have messed up in the script?? Thanks a bunch!


<?php

$File = "$_POST['type'].txt";
$Open = fopen($File, "a");
if ($Open){

fwrite($Open, "<a href='boards/boards.php?type=$_POST['type']&board=$_POST['Num']'>$_POST['Nam']</a>\r\n");
fclose ($Open);

} else {
print ("Your file could not be added to the board list due to an error!");
}

?>
<form action="admin.php" method="POST">

<table cellspacing="0" style="border:0px solid black;width:400;">
<tr>
<td style="border:1px solid black;width:100;border-right:medium none"><center>Order #</center></td>
<td style="border:1px solid black;width:633;"><center>Board Name</center></td>
</tr>
<tr>
<td style="border:1px solid black;width:100;border-right:medium none;border-top:medium none;"><center><input type="TEXT" name="Num" size="1"></center></td>
<td style="border:1px solid black;width:633;border-top:medium none;"><center><input type="TEXT" name="Nam" size="40"></center></td>
</tr>
</table>
Public:&nbsp;<input type="radio" name="type" value="Pub"><br>Private:<input type="radio" name="type" value="Priv"><br>
<input type="Submit" value="Create New Public Board">
</form>

BTW, I do have an HTML page, but its the same as everything thats at the bottom half of my page... Please tell me whats wrong w/ my script! Once again, thanks a TON in advance!:thumbsup: :)

Íkii
04-05-2003, 07:33 AM
without a parse error return or some idea of what's not working properly I'd have to guess that that script does actually work.

l3vi
04-05-2003, 05:48 PM
It tells me it cant find the variables. It says


Notice: Undefined index: 'type' in c:\program files\apache group\apache\htdocs\nv\boards\admin.php on line 3

Notice: Undefined index: 'type' in c:\program files\apache group\apache\htdocs\nv\boards\admin.php on line 7

Notice: Undefined index: 'Num' in c:\program files\apache group\apache\htdocs\nv\boards\admin.php on line 7

Notice: Undefined index: 'Nam' in c:\program files\apache group\apache\htdocs\nv\boards\admin.php on line 7

l3vi
04-05-2003, 06:27 PM
AHh! I figured it out! So simple! Thanks 4 all the help!:) :D :D :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum