Monkuar Posted May 10, 2009 Share Posted May 10, 2009 <?php require_once "ipbsdk_class.inc.php"; $SDK =& new IPBSDK(); $message = $_POST['message']; $title = $_POST['title']; $username = $_POST['username']; $SDK->write_pm ("$username", "$title", "$message"); echo "$username $title $message"; ?> Ok Now since I got that to work.. I want to beable to make validation functions only a user can send a message once every 5minutes? Something like that please, thanks php! I know need to add a if function.. but can i add it and store it in a user cookie so they can only use this once every 1-5minutes or whatever i can edit xx minutes. thanks! Quote Link to comment https://forums.phpfreaks.com/topic/157603-yay-i-got-my-form-to-work-but/ Share on other sites More sharing options...
jackpf Posted May 10, 2009 Share Posted May 10, 2009 If you save it in a cookie, the user can just delete it. Quote Link to comment https://forums.phpfreaks.com/topic/157603-yay-i-got-my-form-to-work-but/#findComment-831061 Share on other sites More sharing options...
Ken2k7 Posted May 10, 2009 Share Posted May 10, 2009 Don't use cookies. The user can just clear cookies, though I guess it's irrelevant. DB would be the way to go though. Quote Link to comment https://forums.phpfreaks.com/topic/157603-yay-i-got-my-form-to-work-but/#findComment-831100 Share on other sites More sharing options...
Monkuar Posted May 10, 2009 Author Share Posted May 10, 2009 Ok well I can do it by database too any way how? your post's kinda didn't help em Quote Link to comment https://forums.phpfreaks.com/topic/157603-yay-i-got-my-form-to-work-but/#findComment-831189 Share on other sites More sharing options...
shadiadiph Posted May 10, 2009 Share Posted May 10, 2009 make a field in your database as a time and date timestampfield then you would have to update that field when the user submits the message and add time as now() i guess then before submittng the message have to write an sql statement to get the time field the use strtotime() to get the value in seconds then an if statement to check the time and if the time is 300> more than 300 seconds then it is ok to send the message if not produce an error you would also need to define a variable for the time now at the top of the page also you would have to make a clause if the field was empty and the user has never sent a message before Quote Link to comment https://forums.phpfreaks.com/topic/157603-yay-i-got-my-form-to-work-but/#findComment-831209 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.