A
Anonymous
Guest
I just uploaded a site, which I just finished and I went through testing to make sure it all worked on the web host. And whenever I added a listing or edited a listing the script would stop. I would get no error, just the script will stop. The whole site works perfectly (to my knowing) on my own test server.
By trial and error, I managed to narrow the problem down to my use of validation class. This is the same class I also use on the signup form, which works fine there. This is the code, I have put comment markings in where I commented the code out for it to work.
I'm am really quite stunned about this, one thing for sure is that I know it is not a problem in the class as I have been using that class for a while, and use it successfully on another page.
By trial and error, I managed to narrow the problem down to my use of validation class. This is the same class I also use on the signup form, which works fine there. This is the code, I have put comment markings in where I commented the code out for it to work.
Code:
dbconnect();
$sql = mysql_query("SELECT userid FROM listings WHERE userid=".$_SESSION['userid']);
if (mysql_num_rows($sql) < 5) {
$fv = new FormValidator;
/*
$fv->isLength("company", "Company name must not contain more than 50 characters", 1, 50);
$fv->isEmpty("type", "Type not specified");
$fv->isLength("web", "Web address must contain less than 100 characters", 0, 100);
$fv->isLength("statement", "Company description must not be more than 1500 characters long", 1, 1500);
$fv->MaxWordLength("statement", "Statement contains a word more than 40 characters long", 40);
$fv->isLength("description", "Service Description must not be more than 1500 characters long", 1, 1500);
$fv->MaxWordLength("description", "Description contains a word more than 40 characters long", 40);
*/
if ($errors = $fv->getErrorList()) {
I'm am really quite stunned about this, one thing for sure is that I know it is not a problem in the class as I have been using that class for a while, and use it successfully on another page.