Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Moderated Pro PHP
|
Moderated Pro PHP This is a moderated forum for discussing advanced, professional level issues with PHP. Your posts will not appear until a moderator approves them. Posts that are not the right level for this forum will be responded to and you'll be asked to post them in the [url="http://p2p.wrox.com/sql-server-2000-20/9"]Beginning PHP[/url] forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Moderated Pro PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 16th, 2007, 09:44 AM
rolanb64
Guest
 
Posts: n/a
Default Vdaemon validation and my save to database code

I have a code that calls the VDend function of vdaemon in order to validate user input, after that i have a code that saves the contents of user input to database, however the code to save to database is executed irregardless of the results of VDend function of vdaemon. code looks similar to the one below, pls help me modify the code below so that code to save to database is only executed after all user inputs are already valid? thanks in advance!

include('vdaemon/vdaemon.php');

$fname = isset($_POST['fname']) ? trim(strip_tags($_POST['fname'])) : '';
$fname = preg_replace("/[\'\:\"]/", '', $fname);
$lname = isset($_POST['lname']) ? trim(strip_tags($_POST['lname'])) : '';
$lname = preg_replace("/[\'\:\"]/", '', $lname);
$school = isset($_POST['school']) ? trim(strip_tags($_POST['school'])) : '';
$school = preg_replace("/[\'\:\"]/", '', $school);
$username = isset($_POST['username']) ? trim(strip_tags($_POST['username'])) : '';
$username = preg_replace("/[\'\:\"]/", '', $username);
$passwd = isset($_POST['passwd']) ? trim(strip_tags($_POST['passwd'])) : '';
$passwd = preg_replace("/[\'\:\"]/", '', $passwd);
$confirm = isset($_POST['confirm']) ? trim(strip_tags($_POST['confirm'])) : '';
$confirm = preg_replace("/[\'\:\"]/", '', $confirm);
$email = isset($_POST['email']) ? trim(strip_tags($_POST['email'])) : '';
$email = preg_replace("/[\'\:\"]/", '', $email);

if (isset($_POST['submit']))
{
   $vars = array('ACTION_PG' => append_sid($_SERVER['PHP_SELF']),
              'MSG' => $msg
             );

   $template->set_file('registration', 'registration.htm');
   $template->set_var('REGISTER', $vars);
   $template->parse('registration');

VDEnd();
}

code to save to database is here-------------------





Similar Threads
Thread Thread Starter Forum Replies Last Post
i cannot save to my database knightneo Beginning PHP 3 January 29th, 2007 08:06 AM
run code on save?? Vince.Bixby Word VBA 3 December 29th, 2006 04:28 AM
save database kim VB How-To 3 April 2nd, 2006 09:26 AM
save database kim Visual Basic 2005 Basics 0 March 20th, 2006 04:34 PM
how to save an array to database say2x VB Databases Basics 0 November 8th, 2005 05:05 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.