I am writing a forum site and this is an error message I randomly ran into.
I have used this code structure before but never ran into this problem.

"Fatal error: Call to undefined function form() in /home2/fellowes/public_html/comment.php on line 14"


This "$comment=form($_POST);" is line 14 in dreamweaver

	mysql_query("INSERT INTO $tbl_name (userid, posterid, postername, pc_comment) VALUES ('$profileid', '$userid', '$username', '$comment')") or die(mysql_error());

I have used this code before with no problem...

<form method="post" action=<?php echo "comment.php?user_id=$profileid "?> >
                      <div align="center">
                        <table width="100%" height="100%" border="0" cellspacing="0">
                              <td><div align="center">
                                <textarea name="txtComment"  rows="5" ></textarea>
                              <td height="23"><div align="right"><input value="submit" type="submit" name="subSubmit" /></div></td>

This is the form that the $_POST is coming from

9 Years
Discussion Span
Last Post by somedude3488

where the form function? the error is showing because the script cant find the form function.

The form is on another page.

I have used it where I have the form on one page and I set the action to the page with the php code for querying the database. and I use the post method to pull the variables from the form.


Ok so what I have is the one page where you view the posts and the form is located there, when I click submit it then goes to the next page where all the php code is to query the database. I have used this method before and it works thats why I am confused.

So form has an action is set to the page with the php code. I hope I was a little more clear, I have trouble with comunitcation.


I just rewrote all the code, and now its working fine. So whatever the problem was, musta been a spelling error. Thanks for the help anyways.


the reason was that you had the "form()" function on line 14.

since there wasn't a function by that name, the script threw an error.


You know when you Post information from a form on one page and the action is set to another page, its just like it was on the same page...

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.