abs0lut Posted May 6, 2008 Share Posted May 6, 2008 i don't want to display the input form if he already posted once.. how to check if he already posted? Link to comment https://forums.phpfreaks.com/topic/104309-solved-check-if-already-posted/ Share on other sites More sharing options...
dezkit Posted May 6, 2008 Share Posted May 6, 2008 if($user = uses_details_in_thread){ echo "there might be a chance of getting a correct answer"; } Link to comment https://forums.phpfreaks.com/topic/104309-solved-check-if-already-posted/#findComment-534095 Share on other sites More sharing options...
DarkWater Posted May 6, 2008 Share Posted May 6, 2008 I lol'd. D: Link to comment https://forums.phpfreaks.com/topic/104309-solved-check-if-already-posted/#findComment-534096 Share on other sites More sharing options...
Fadion Posted May 6, 2008 Share Posted May 6, 2008 loool. Set a session/cookie when the user posts the form and use it to check if he already posted. It could be bypassed but theres no other good way. Link to comment https://forums.phpfreaks.com/topic/104309-solved-check-if-already-posted/#findComment-534102 Share on other sites More sharing options...
abs0lut Posted May 6, 2008 Author Share Posted May 6, 2008 loool. Set a session/cookie when the user posts the form and use it to check if he already posted. It could be bypassed but theres no other good way. do I need to store the session in database?? when I logout, and I login again, the form appeared ... Link to comment https://forums.phpfreaks.com/topic/104309-solved-check-if-already-posted/#findComment-534151 Share on other sites More sharing options...
Fadion Posted May 6, 2008 Share Posted May 6, 2008 If u have a user based site, u can save the "already_posted" as a database field. If not u can only count on pure sessions and cookies which can be deleted. You are most surely destroying all your session variables when logging out, thats why the form appears again. A cookie would be more appropriate in this case, but they can be always deleted. Link to comment https://forums.phpfreaks.com/topic/104309-solved-check-if-already-posted/#findComment-534338 Share on other sites More sharing options...
abs0lut Posted May 6, 2008 Author Share Posted May 6, 2008 echo "<input type=\"text\" name=\"cost[]\" /><br>"; for ($i=0; $i<count($niqid); $i++) { $query = "INSERT INTO ctable (userid, name, cost, total, date, postid) VALUES ('$userid', '".$niqid[$i]."', '".$cost[$i]."', '$total', '$date', '$post')"; $sql = mysql_query($query) or die (mysql_error()); } I want the input form cost to disappear if he posted already. please help me.. Link to comment https://forums.phpfreaks.com/topic/104309-solved-check-if-already-posted/#findComment-534785 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.