superninja Posted August 2, 2006 Share Posted August 2, 2006 Hello allI want to make a simple reviews system,it contain writer folder and mine folder.The writer folder contain index.php where the writer write the review and show.php where the review is inserted to mysql.Here is index.php in writer folder: <h1>Make a Review</h1><br> <form name="input" action="show.php" method="post">Title: <input type="text" name="title" size="20"><br>Review:<textarea rows="10" cols="45" name="review"></textarea><br><br><input type="submit" value="Submit"></form> and here is the show.php <b>Title:</b><br> <?php echo $_POST["title"]; ?><br><br><b>Review:</b><br> <?php echo $_POST["review"]; ?><?$con = mysql_connect(localhost,***,***);mysql_select_db("db", $con);mysql_query("INSERT INTO reviews (title, review) VALUES ('$_POST[title]', '$_POST[review]')");?> now i'll show you the mine folder.It contains index.php where is the list with the reviews.index.php <h1>REVIEWS</h1><br><?php$con = mysql_connect(localhost,**,***);if (!$con) { die('Could not connect: ' . mysql_error()); }mysql_select_db("sqltrain", $con);$result = mysql_query("SELECT title FROM reviews");while($row = mysql_fetch_array($result)) { echo $row['title']; echo "<br />"; }mysql_close($con);?> Now i don't know what to do further..I want to make when someone click on the titles in index.php to go in a page where's the review.I also can't insert <a href=""></a> in echo $row['title']; i tried with echo $row['<a href=\"page\">title</a>']; but there is error i can't do it so can you help me? Link to comment Share on other sites More sharing options...
tjodalv Posted August 2, 2006 Share Posted August 2, 2006 I am ASP programmer but try this:echo "<a href=\"viewreview.php?id=$row['id']\">$row['title']</a>";That should work. I assume that you have id field in database. Link to comment Share on other sites More sharing options...
superninja Posted August 2, 2006 Author Share Posted August 2, 2006 Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in C:\xampp\htdocs\simplereview\index.php.php on line 19 please help Link to comment Share on other sites More sharing options...
tjodalv Posted August 2, 2006 Share Posted August 2, 2006 Don't know then, try thisecho "<a href=\"viewreview.php?id=".$row['id']."\">$row['title']</a>"; Link to comment Share on other sites More sharing options...
superninja Posted August 2, 2006 Author Share Posted August 2, 2006 Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in C:\xampp\xampp\xampp\htdocs\=sqltrain\index.php on line 19 I think it's the same? Link to comment Share on other sites More sharing options...
superninja Posted August 11, 2006 Author Share Posted August 11, 2006 ideas? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now