Jump to content

Yay I got my form to work.. but....


Monkuar

Recommended Posts

<?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!

Link to comment
https://forums.phpfreaks.com/topic/157603-yay-i-got-my-form-to-work-but/
Share on other sites

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.