commenting form
Posted: Mon Oct 03, 2016 1:36 pm
Hi,
I'm trying to learn php so I'm developing a simple website, this website shows some posts, it only shows part of a post and when the user hits "read more" button we go to the details.php page, I'm trying to create a commenting form.
For example the user hits post number 3 then url would be:
the code for the form is:
We are now in a page called details
$post_id is the number of the post which I got from the previous page when the user hit "read me"
This variable contains the right number as i printed it out.
whenever i hit submit I get this url and 404 error:
I don't have any page called result.php, could someone please explain to me why I'm being directed into a page that doesn't exist?
Even if i leave the action blank I get the same result.
Thanks
I'm trying to learn php so I'm developing a simple website, this website shows some posts, it only shows part of a post and when the user hits "read more" button we go to the details.php page, I'm trying to create a commenting form.
For example the user hits post number 3 then url would be:
Code: Select all
http://localhost/MYCMS/details.php?post=3the code for the form is:
We are now in a page called details
Code: Select all
<form method="post" action="details.php?post=<?php echo $post_id; ?>">
<tr><td>Name </td><td><input type="text" name="name"></td></tr>
<tr><td>Email </td><td><input type="text" name="email"></td></tr>
<tr><td>Comment</td><td><textarea name="comment" rows="20" cols="35"></textarea></td></tr>
<tr><td align="center" colspan="2"><input type='submit' name='submit' value='post comment' /></td></tr>
</form>
</table>
This variable contains the right number as i printed it out.
whenever i hit submit I get this url and 404 error:
Code: Select all
http://localhost/MYCMS/result.php?searchbox=&name=&email=&comment=&submit=post+commentEven if i leave the action blank I get the same result.
Thanks