|
|
These forums are to discuss any RSjoomla! related questions. Please note that official support is offered via Customer Support Ticketing System only, responses in the forum are not guaranteed.
checking validation before running php script (1 viewing)
|
|
TOPIC: checking validation before running php script
|
brendon.grice (User)
Fresh Boarder
Posts: 1
|
| checking validation before running php script 2008/09/22 20:04 |
Karma: 0   |
|
The example given in the knowledgebase checks for there to be an email address entered. The trouble I'm having is that if they enter everything in but the validation tells them to fix it, the field does contain something (its just not valid) so it goes ahead and puts it in the database which leads to duplicates. I see formmsg gets populated when there is an error but I can't seem to figure out how to check against it.
if(isset($_POST['form']['email'])) { $database2 = $database; $database2 = new database( 'host', 'user', 'password', 'db', 'prefix(if any)' );//comment this line if you're using the same db where the rsform tables are $database2->setQuery("INSERT INTO `my_external_table` (`firstname`,`lastname`,`email`,`phone`,`city`,`country`) VALUES ('{$processform['firstname']}', '$processform['lastname']', '$processform['email']', '$processform['phone']', '$processform['city']', '$processform['country']')"); $database2->query(); }
|
|
|
|
The administrator has disabled public write access. |
|
|
|
|
|