RSjoomla!

My Account






Lost Password?
No account yet? Register

Newsletter Subscribe

If you would like to be one of the first people to hear about the release of our new components then make sure you have subscribed to our announcements list! We won't bug you with unnecessary stuff.




RSjoomla! Board
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.
Welcome, Guest
Please Login or Register.
Lost Password?
checking validation before running php script (1 viewing)
_GEN_GOTOBOTTOM Post Reply

TOPIC: checking validation before running php script

#4733
brendon.grice (User)
Fresh Boarder
Posts: 1
graphgraph
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.
_GEN_GOTOTOP Post Reply
© Copyright 2007 Best of Joomla, Powered by FireBoardget the latest posts directly to your desktop