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? Quote Link to comment 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"; } Quote Link to comment Share on other sites More sharing options...
DarkWater Posted May 6, 2008 Share Posted May 6, 2008 I lol'd. D: Quote Link to comment 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. Quote Link to comment 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 ... Quote Link to comment 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. Quote Link to comment 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.. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.