Forum Moderators: coopster

Message Too Old, No Replies

PHP MYSQL help!

Script doesnt work , no errors or mgs shown

         

naiquevin

6:47 pm on Apr 2, 2009 (gmt 0)

10+ Year Member



I am using a a PHP script to allow users to add entries - The structure of the script is as follows -

<?php

establish the connection

IF(isset($_POST['submit'])) {

$flag = false;

IF(check for form validation) {
INSERT INTO TABLE
Display a sucess msg.
}
else {
echo 'please enter all fields';
$flag = true;
}
}
else { //ie if form is not yet submittd
$flag = true;
}

if($flag) {

require_once('form.php'); /* Here the form is included to make things simple as it is a part of an HTML tablein this script . The form triggers this php script */
}
?>

The script doesnt work ... no errors , no msg for invalid form submissions ..
What can possibly be the problem here?

dreamcatcher

5:31 am on Apr 3, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi naiquevin,

I`m afraid its impossible to debug here because you have used pseudo code. No-one has anyway of knowing how your syntax is. Try posting a little more code.

dc

naiquevin

10:17 am on Apr 3, 2009 (gmt 0)

10+ Year Member



Hi thanks for replying..
I initially suspected that the problem was due to HTML form being used from a different php file.. (Which as I understand now was wrong) thats why just wanted to confirm if including a file works with such a structure..

I got it now btw.. thanks