clonetrooper9494 Posted November 21, 2007 Share Posted November 21, 2007 I am trying to make a basic PHP script that will take the data from a form and post it on a page, like a commenting thing. but for some reason, the script is not writing in the page! here are the srcipts:form page: <body><form action="post.php" method="post"><input type="text" name="name"><br><textarea name="comment"></textarea><br><input type="submit" value="post comment"><br></form></body> PHP page: <?php$myFile = "htmllab2-0_blog.php";$fh = fopen($myFile, 'a') or die("Failed");$name = $_POST["name"];$comment = $_POST["comment"];$main = "\n<tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr>\n<td align='left'> By \n" . $_POST["name"] . "\n<br><br>\n" . $_POST["comment"] . "\n</td></tr>\n<!-- --!>\n<!-- --!>\n<!-- --!>";fwrite($fh, $main);fclose($fh);echo "...";?> the page that gets writen on (named 'htmllab2-0_blog.php', and yes the pages are all in the same folder...) : <body><table boder="1"><tr></tr><td>See what other people think about the HTML Lab below.</td></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr> all of the pages work, but when the computer views the posting page, it doesn't write on the htmlab_blog page!do you see what's wrong? Link to comment Share on other sites More sharing options...
clonetrooper9494 Posted November 21, 2007 Author Share Posted November 21, 2007 oops... I found the problem... the <!-- ending was covering up every thing... I just looked at its html and its all good!is there any way to close this topic??? Link to comment Share on other sites More sharing options...
Synook Posted November 22, 2007 Share Posted November 22, 2007 Wait for a mod to do so - anyway, others can still learn from your code, comment, and discuss. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.