kununited2007 Posted November 2, 2011 Share Posted November 2, 2011 <?php $con = mysql_connect("localhost","root","password"); if (!$con) { die('Could not connect:' . mysql_error()); } mysql_select_db("Products", $con); $result = mysql_query("SELECT * FROM btp_reviews" ); echo "<table border='1' cellspacing='0' cellpadding='0'>"; echo '<tr> <td>Id</td> <td>Review</td> <td>Name</td> <td>Update</td> <td>Status</td> </tr>'; while($row = mysql_fetch_assoc($result)) { echo '<tr>'; echo '<td>' . $row['id'] . '</td>'; echo "<td>" . $row['review'] . "</td>"; echo "<td>" . $row['r_name'] . "</td>"; echo "<td>" ."<form action='radio.php' method='post' ><a href=http://localhost/editt.php?id=".$row['id'].">Edit</a>.</td> <td>" ."<input type='radio' name='r1' value='2' />Approve<br/><input type=hidden name=id value='".$row['id']."' /> <input type='radio' name='r1' value='3' /> Reject<br/> <input type=submit value=Submit /></form>"."</td>"; } echo "</table>"; mysql_close($con); ?> Link to comment https://forums.phpfreaks.com/topic/250270-how-to-add-striplashes-for-reviews-in-this-code/ Share on other sites More sharing options...
trq Posted November 2, 2011 Share Posted November 2, 2011 Your kidding right? Link to comment https://forums.phpfreaks.com/topic/250270-how-to-add-striplashes-for-reviews-in-this-code/#findComment-1284176 Share on other sites More sharing options...
ZulfadlyAshBurn Posted November 2, 2011 Share Posted November 2, 2011 use stripslashes stripslashes($row['review']) hopes this works. Link to comment https://forums.phpfreaks.com/topic/250270-how-to-add-striplashes-for-reviews-in-this-code/#findComment-1284182 Share on other sites More sharing options...
trq Posted November 2, 2011 Share Posted November 2, 2011 You shouldn't need to use stripslashes on data coming out of your database. If you do, there is something wrong with the way you are putting the data in. Link to comment https://forums.phpfreaks.com/topic/250270-how-to-add-striplashes-for-reviews-in-this-code/#findComment-1284192 Share on other sites More sharing options...
ZulfadlyAshBurn Posted November 2, 2011 Share Posted November 2, 2011 he should use stripslashes upon inserting into database but since he is asking how, im just showing him Link to comment https://forums.phpfreaks.com/topic/250270-how-to-add-striplashes-for-reviews-in-this-code/#findComment-1284198 Share on other sites More sharing options...
trq Posted November 2, 2011 Share Posted November 2, 2011 Quote he should use stripslashes upon inserting into database but since he is asking how, im just showing him You should only need to use stripslishes when inserting if your server is poorly configured. Link to comment https://forums.phpfreaks.com/topic/250270-how-to-add-striplashes-for-reviews-in-this-code/#findComment-1284200 Share on other sites More sharing options...
ZulfadlyAshBurn Posted November 2, 2011 Share Posted November 2, 2011 disabling magic_quotes_gpc sloves the prob for me Link to comment https://forums.phpfreaks.com/topic/250270-how-to-add-striplashes-for-reviews-in-this-code/#findComment-1284203 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.