0

I am trying to create a movie review website, the majority of my site is coming together. I do not know how to create a script that will display user reviews on the website. Here is what I have so far for the form, how do I display user reviews after they hit the submit button?

<label>Enter your name here:
<form action="http://www.daaq.net/utils/echopost.php " method= "post" <br/>
First name: <input type="text" name="firstname" /><br/>
Last name: <input type="text" name="lastname" /><br/>
</label>


<label>Write Review:
<br/>

<textarea name= "textareasample" rows="5" cols="30" wrap="physical"> </textarea>
</label>
<br/>


<label>Rate Movie(Double-Click):
<br/>

<input type="radio" name="rating" value="one"/> One Star <br/>
<input type="radio" name="rating" value="two"/> Two Stars <br/>
<input type="radio" name="rating" value="three"/> Three Stars <br/>
<input type="radio" name="rating" value="four"/> Four Stars <br/>
<input type="radio" name="rating" value="five"/> Five Stars <br/>

</label>

<label>Click "Submit" to enter your review and to read other reviews by users.
  <input type="submit" value="Submit" />
</form>
</label>
3
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by johnjacob
0

First of all, where is your data stored? You need to store the data somewhere before you can hope to output anything.

0

if you use php then this is the best code ever
first get your movie id and store in a var
like this:

$movie_id = $_GET['movie_id'];

and then update your movies table only one field when user view you movie post liky this query:

mysql_query("UPDATE your table name SET `views` = (views+1) WHERE movies_id = '$movie_id' LIMIT 1" );

and print query is ;

$query = "SELECT * FROM movies WHERE movies_id='".$movie_id."' LIMIT 1";
$exe = mysql_query($query, $con);
$row = mysql_fetch_assoc($exe);

and then echo your views for the users
like

<?php echo "Views" ." " .$row['views']; ?>

Edited by Ezzaral: Added code tags. Please use them to format any code that you post.

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.