Jump to content

[SOLVED] check if already posted..


abs0lut

Recommended Posts

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
Share on other sites

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
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.