Submit Review Form help
Moderator: General Moderators
Submit Review Form help
Hello, I am creating a PHP "Submit a Review" form for a website. I have searched across google and cant find any helpful links. How would i go about creating code for this? Thank you in advance
-
timclaason
- Forum Commoner
- Posts: 77
- Joined: Tue Dec 16, 2003 9:06 am
- Location: WI
Form
feyd | Please use
And then on whateverPageYouArePostingTo.php:[/syntax]
There's a lot of components to this question. I would do a search for some of the above things I mentioned.
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
This is kind of a loaded question. You can really spend all day talking about stuff like this to a person who is starting from scratch (ie has no experience in web development). You need to understand querystrings, post and get form methods, How to retreive form values with $_POST and $_GET, how to put that data somewhere (whether it sends out an email or puts it into a database), and if you put it into a database, you need to understand connection strings, database schemas, how to retreive data from a database, etc.
All that aside, here's how I'd do a simple "Submit a review".
Assuming that the review is for the entire website or that there is only one thing to review, you can make the page like this:
[syntax="html"]
<HTML>
<HEAD>
...
<FORM METHOD='POST' ACTION='whateverPageYouArePostingTo.php'>
<TABLE>
<TR>
<TD>Your Review</TD>
<TD><TEXTAREA COLS='8' ROWS='50' NAME='review'></TEXTAREA></TD>
</TR>
<TR>
<TD COLSPAN='2' ALIGN='RIGHT'><INPUT TYPE='SUBMIT' VALUE='Submit Review'></TD>
</TR>
</TABLE>
</FORM>
Code: Select all
$posterReview = $_POST['review'];
//Assuming you have a database with all reviews:
//Do connection string and database selection
//Then do input checking on variable $posterReview
//Then do the query:
$query = "INSERT INTO reviews (fld_review) VALUES ($posterReview)";
$SQL = mysql_query($query, $databaseLink);feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]