Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-18-2010, 12:25 AM   PM User | #1
ashelred
New to the CF scene

 
Join Date: Mar 2010
Posts: 6
Thanks: 2
Thanked 0 Times in 0 Posts
ashelred is an unknown quantity at this point
Question PHP script does not appear to execute

I am trying to make a PHP script to upload two graphics files from each user and to collect information about the users who are uploading these two graphics files. (We have multiple users, but each user will be uploading only two graphics files each time he or she logs on.)

However, the script apparently fails to execute. Although the file ran, I do not get output of error messages and (more importantly) the uploaded data does not get added to the database (which is the main thing that this script is for).

Here is my script. Please tell me where the problem is and suggest how to solve it. I can't find the problem, and neither can my business associates. We need to get this script running ASAP for a work-related data collection project.

PHP Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>phpsubmit</title>
<meta http-equiv="generator" content=
"CoffeeCup HTML Editor (www.coffeecup.com)">
<meta name="created" content="Wed, 17 Feb 2010 15:42:33 GMT">
<meta http-equiv="content-type" content=
"text/html; charset=us-ascii">
<meta name="description" content="">
<meta name="keywords" content="">
<?php function upload($var$file) {if (isset($_FILES[$var])) {
        
        
// Validate the type. Should be jpeg, jpg, or gif.
        
$allowed = array ('image/gif''image/jpeg''image/jpg''image/pjpeg');
        if (
in_array($_FILES[$var]['type'], $allowed)) {
        
            
// Move the file over.
            
if (move_uploaded_file($_FILES[$var]['tmp_name'], $file)) {
            
                echo 
'<p>File uploaded successfully!</p>';
            
            } else { 
// Couldn't move the file over.
            
                
echo '<p><font color="red">The file could not be uploaded because: </b>';
        
                
// Print a message based upon the error.

                
switch ($_FILES[$var]['error']) {
                    case 
1:
                        print 
'The file exceeds 512 kilobytes: the maximum file size for this program.';
                        break;
                    case 
2:
                        print 
'The file exceeds 512 kilobytes: the maximum file size for this form.';
                        break;
                    case 
3:
                        print 
'The file was only partially uploaded.';
                        break;
                    case 
4:
                        print 
'No file was uploaded.';
                        break;
                    case 
6:
                        print 
'No temporary folder was available.';
                        break;
                    default:
                        print 
'A system error occurred.';
                        break;
                } 
// End of switch.
                
                
print '</b></font></p>';

            } 
// End of move... IF.
            
        
} else { // Invalid type.
            
echo '<p><font color="red">Please upload a JPEG or GIF image.</font></p>';
            
unlink ($_FILES[$var]['tmp_name']); // Delete the file.
        
}

    } else { 
// No file uploaded.
        
echo '<p><font color="red">Please upload a JPEG or GIF image smaller than 512KB.</font></p>';}
    }; 
?>
</head>
<body bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink=
"#800080" alink="#FF0000">

<?php 
if ($_POST['submitted']) {
  
$errors[] = array(); //Initialize error array
  
echo 'start';
  
//check for firstname
  
if (empty($_POST['firstname'])) {
    
$errors[] = 'You forgot to enter your first name.';
          } else {
    
$fn trim($_POST['firstname']);
    }
  
//check for lastname
  
if (empty($_POST['lastname'])) {
    
$errors[] = 'You forgot to enter your last name or initial.';
  } else {
    
$ln trim($_POST['lastname']);
    } 
  
//check for age
  
if (empty($_POST['age'])) {
    
$errors[] = 'You forgot to enter your age.';
  } else {
    
$age trim($_POST['age']);
    }
  
//check for which hand
  
if (empty($_POST['hand'])) {
    
$errors[] = 'You forgot to enter which hand you use.';
  } else {
    
$hand trim($_POST['Hand']);
    }
  
//check for how long used Better Letters
  
if (empty($_POST['uselong'])) {
    
$errors[] = 'You forgot to enter how long you have used Better Letters.';
  } else {
    
$ul trim($_POST['uselong']);
    } 
  
//check for how often used Better Letters
  
if (empty($_POST['useoften'])) {
    
$errors[] = 'You forgot to enter how often you use Better Letters.';
  } else {
    
$uo trim($_POST['useoften']);                                    
    } 
  
//check for email
  
if (empty($_POST['email'])) {
    
$errors[] = 'You forgot to enter your e-mail address.';
  } else {
    
$em trim($_POST['email']);
    }
  
//check for web
  
if (empty($_POST['web'])) {
    
$wb NULL;
  } else {
    
$wb trim($_POST['web']);
    }
    
//check for comments
  
if (empty($_POST['comments'])) {
    
$cm NULL;
  } else {
    
$cm trim($_POST['comments']);
    }
  if (
$hand != 'other') {
    
$ot 'NULL';
  } else {
    if (empty(
$_POST['other'])) {
    
$ot 'NULL';
    } else {
    
$ot trim($_POST['other']);
  }}
  if (empty(
$errors)) {// If everything is OK
define('DB_USER''');
define('DB_PASSWORD''');
define('DB_HOST''');
define('DB_NAME''');
//Make the connection
$dbc = @mysql_connect(DB_HOSTDB_USERDB_PASSWORD) OR die('Could not connect to MYSQL: ' mysql_error());
//s Select Database
@mysql_select_db(DB_NAME)OR die('Could not select database' mysql_error());
// Make the query
$query "INSERT INTO defalt (firstname, lastname, age, hand, other, uselong, useoften, comment, email, web, whensubmited) 
VALUES ('$fn', '$ln', '$age', '$hand', '$ot', '$ul', '$uo', '$em', $wb', NOW())"
;
$result = @mysql_query ($query); // Run the query
if ($result) {//it ran OK
//Find Id#
$query 'SELECT * from defalt WHERE whensubmited == max(whensubmited)'
$result = @mysql_query ($query);
$row mysql_fetch_array($result);
$i $row(0);
//before file
$filename 'BetterLetters/before' $i;
//Check for "before" file
upload ('before'$filename);
 
//after file
 
$filename 'BetterLetters/after' $i;
upload ('after'$filename);
  } else {
  echo 
'<p> the following error(s) occurred: <br />';
  foreach (
$errors as $msg) {
    echo 
" - $msg<br />\n";
  }}
  echo 
'</p>' ;}  }; 
 
?>
 <p> Program ran</p>
</body>
</html>

Last edited by ashelred; 03-18-2010 at 12:54 PM..
ashelred is offline   Reply With Quote
Old 03-18-2010, 01:09 AM   PM User | #2
masterofollies
Senior Coder

 
Join Date: May 2005
Posts: 2,137
Thanks: 96
Thanked 72 Times in 72 Posts
masterofollies can only hope to improve
Two things, REMOVE your username,password,database information. People can now login and steal your account.

and second please post your code using the PHP code tags.
__________________
Rowsdower! has accused me of having mental problems, and the administrator allowed it. What a great forum huh?
masterofollies is offline   Reply With Quote
Old 03-18-2010, 02:49 AM   PM User | #3
ashelred
New to the CF scene

 
Join Date: Mar 2010
Posts: 6
Thanks: 2
Thanked 0 Times in 0 Posts
ashelred is an unknown quantity at this point
Question

I'm a real newbie -- I didn;t have to start learning code till two weeks ago, and I only found this forum today.

How do I "post my code using the PHP code tags"? Assume that I know nothing.
ashelred is offline   Reply With Quote
Old 03-18-2010, 03:00 AM   PM User | #4
masterofollies
Senior Coder

 
Join Date: May 2005
Posts: 2,137
Thanks: 96
Thanked 72 Times in 72 Posts
masterofollies can only hope to improve
Your database info is still there, you can edit your post and change it.

To use code tags, you can edit your post and highlight the whole code and above where you type is a little icon looks like a piece of paper and says PHP on it, click that.

Or else click it and then paste your coding.
__________________
Rowsdower! has accused me of having mental problems, and the administrator allowed it. What a great forum huh?
masterofollies is offline   Reply With Quote
Old 03-18-2010, 03:39 AM   PM User | #5
MattF
Senior Coder

 
Join Date: Jul 2009
Location: South Yorkshire, England
Posts: 2,322
Thanks: 6
Thanked 304 Times in 303 Posts
MattF will become famous soon enoughMattF will become famous soon enough
Put, (without the trailing space after the [):

Code:
[ code]
your code goes here
[ /code]
MattF is offline   Reply With Quote
Old 03-19-2010, 02:39 AM   PM User | #6
ashelred
New to the CF scene

 
Join Date: Mar 2010
Posts: 6
Thanks: 2
Thanked 0 Times in 0 Posts
ashelred is an unknown quantity at this point
Okay, I edited it the way you said.
Now, what else needs change to get this code executing?
ashelred is offline   Reply With Quote
Old 03-19-2010, 04:10 AM   PM User | #7
masterofollies
Senior Coder

 
Join Date: May 2005
Posts: 2,137
Thanks: 96
Thanked 72 Times in 72 Posts
masterofollies can only hope to improve
Not sure about this query, something seems wrong.

PHP Code:
$query 'SELECT * from defalt WHERE whensubmited == max(whensubmited)'
__________________
Rowsdower! has accused me of having mental problems, and the administrator allowed it. What a great forum huh?
masterofollies is offline   Reply With Quote
Old 03-19-2010, 01:21 PM   PM User | #8
Rowsdower!
Senior Coder

 
Rowsdower!'s Avatar
 
Join Date: Oct 2008
Location: Some say it's everything.
Posts: 2,007
Thanks: 5
Thanked 395 Times in 388 Posts
Rowsdower! has a spectacular aura aboutRowsdower! has a spectacular aura aboutRowsdower! has a spectacular aura about
Quote:
Originally Posted by masterofollies View Post
Not sure about this query, something seems wrong.

PHP Code:
$query 'SELECT * from defalt WHERE whensubmited == max(whensubmited)'
The spelling is incorrect for "default" and "whensubmitted", but if this matches the actual database then that wouldn't be the problem...

If you aren't sure that the script is running try inserting debugging statements (such as 'print "This is a debugging statement<br />\n";') and see where they stop appearing. Usually you'd want to start these just after entering a loop or inside of an "if" statement.

If you do this and find out that all of your code is all running as you expected then I would guess that you most likely have a problem with matching your database information (for table names/column names/etc.) between your actual database and your PHP code. Start checking row counts for 'select' queries and then check all spelling and SQL names for the 'insert' queries to make sure that they are complete and correct.
__________________
The object of opening the mind, as of opening the mouth, is to shut it again on something solid. –G.K. Chesterton
See Mediocrity in its Infancy
It's usually a good idea to start out with this at the VERY TOP of your CSS: * {border:0;margin:0;padding:0;}
Seek and you shall find... basically:
validate your markup | view your page cross-browser/cross-platform | free web tutorials | free hosting
Rowsdower! is offline   Reply With Quote
Old 03-19-2010, 05:02 PM   PM User | #9
masterofollies
Senior Coder

 
Join Date: May 2005
Posts: 2,137
Thanks: 96
Thanked 72 Times in 72 Posts
masterofollies can only hope to improve
Also you are missing a single quote.

PHP Code:
VALUES ('$fn''$ln''$age''$hand''$ot''$ul''$uo''$em'$wbNOW())"; 
the $wb needs a beginning quote.

PHP Code:
VALUES ('$fn''$ln''$age''$hand''$ot''$ul''$uo''$em''$wb'NOW())"; 
I don't know if NOW() requires quotes or not.
__________________
Rowsdower! has accused me of having mental problems, and the administrator allowed it. What a great forum huh?
masterofollies is offline   Reply With Quote
Old 03-22-2010, 03:48 AM   PM User | #10
ashelred
New to the CF scene

 
Join Date: Mar 2010
Posts: 6
Thanks: 2
Thanked 0 Times in 0 Posts
ashelred is an unknown quantity at this point
Okay, I'm posting the way the program looks now. I put in three debugging statements. When I try to run it, only the first debugging statement prints out. So the problem is that the "if" fails, and then does not go to the "else" where I have an error code for it.
Here is the code:

PHP Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>phpsubmit</title>
<meta http-equiv="generator" content=
"CoffeeCup HTML Editor (www.coffeecup.com)">
<meta name="created" content="Wed, 17 Feb 2010 15:42:33 GMT">
<meta http-equiv="content-type" content=
"text/html; charset=us-ascii">
<meta name="description" content="">
<meta name="keywords" content="">
<?php function upload($var$file) {if (isset($_FILES[$var])) {
        
        
// Validate the type. Should be jpeg, jpg, or gif.
        
$allowed = array ('image/gif''image/jpeg''image/jpg''image/pjpeg');
        if (
in_array($_FILES[$var]['type'], $allowed)) {
        
            
// Move the file over.
            
if (move_uploaded_file($_FILES[$var]['tmp_name'], $file)) {
            
                echo 
'<p>File uploaded successfully!</p>';
            
            } else { 
// Couldn't move the file over.
            
                
echo '<p><font color="red">The file could not be uploaded because: </b>';
        
                
// Print a message based upon the error.

                
switch ($_FILES[$var]['error']) {
                    case 
1:
                        print 
'The file exceeds 512 kilobytes: the maximum file size for this program.';
                        break;
                    case 
2:
                        print 
'The file exceeds 512 kilobytes: the maximum file size for this form.';
                        break;
                    case 
3:
                        print 
'The file was only partially uploaded.';
                        break;
                    case 
4:
                        print 
'No file was uploaded.';
                        break;
                    case 
6:
                        print 
'No temporary folder was available.';
                        break;
                    default:
                        print 
'A system error occurred.';
                        break;
                } 
// End of switch.
                
                
print '</b></font></p>';

            } 
// End of move... IF.
            
        
} else { // Invalid type.
            
echo '<p><font color="red">Please upload a JPEG, PNG or GIF image.</font></p>';
            
unlink ($_FILES[$var]['tmp_name']); // Delete the file.
        
}

    } else { 
// No file uploaded.
        
echo '<p><font color="red">Please upload a JPEG, PNG or GIF image smaller than 512KB.</font></p>';}
    }; 
?>
</head>
<body bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink=
"#800080" alink="#FF0000">

<?php 
print "This is debugging statement 1<br />\n"
if (
$_POST['submitted']) {
    print 
"This is debugging statement 2 <br />\n";
  
$errors[] = array(); //Initialize error array
  //check for firstname
  
if (empty($_POST['firstname'])) {
    
$errors[] = 'You forgot to enter your first name.';
          } else {
    
$fn trim($_POST['firstname']);
    }
  
//check for lastname
  
if (empty($_POST['lastname'])) {
    
$errors[] = 'You forgot to enter your last name or initial.';
  } else {
    
$ln trim($_POST['lastname']);
    } 
  
//check for age
  
if (empty($_POST['age'])) {
    
$errors[] = 'You forgot to enter your age.';
  } else {
    
$age trim($_POST['age']);
    }
  
//check for which hand
  
if (empty($_POST['hand'])) {
    
$errors[] = 'You forgot to enter which hand you use.';
  } else {
    
$hand trim($_POST['Hand']);
    }
  
//check for how long used Better Letters
  
if (empty($_POST['uselong'])) {
    
$errors[] = 'You forgot to enter how long you have used Better Letters.';
  } else {
    
$ul trim($_POST['uselong']);
    } 
  
//check for how often used Better Letters
  
if (empty($_POST['useoften'])) {
    
$errors[] = 'You forgot to enter how often you use Better Letters.';
  } else {
    
$uo trim($_POST['useoften']);                                    
    } 
  
//check for email
  
if (empty($_POST['email'])) {
    
$errors[] = 'You forgot to enter your e-mail address.';
  } else {
    
$em trim($_POST['email']);
    }
  
//check for web
  
if (empty($_POST['web'])) {
    
$wb NULL;
  } else {
    
$wb trim($_POST['web']);
    }
    
//check for comments
  
if (empty($_POST['comments'])) {
    
$cm NULL;
  } else {
    
$cm trim($_POST['comments']);
    }
  if (
$hand != 'other') {
    
$ot 'NULL';
  } else {
    if (empty(
$_POST['other'])) {
    
$ot 'NULL';
    } else {
    
$ot trim($_POST['other']);
  }}
  if (empty(
$errors)) {// If everything is OK
define('DB_USER''');
define('DB_PASSWORD''');
define('DB_HOST''');
define('DB_NAME''');
//Make the connection
$dbc = @mysql_connect(DB_HOSTDB_USERDB_PASSWORD) OR die('Could not connect to MYSQL: ' mysql_error());
//s Select Database
@mysql_select_db(DB_NAME)OR die('Could not select database' mysql_error());
// Make the query
$query "INSERT INTO defalt (firstname, lastname, age, hand, other, uselong, useoften, comment, email, web, whensubmited) 
VALUES ('$fn', '$ln', '$age', '$hand', '$ot', '$ul', '$uo', '$em', '$wb', NOW())"
;
$result = @mysql_query ($query); // Run the query
if ($result) {//it ran OK
//Find Id#
$query 'SELECT * from defalt WHERE whensubmited == max(whensubmited)'
$result = @mysql_query ($query);
$row mysql_fetch_array($result);
$i $row(0);
//before file
$filename 'BetterLetters/before' $i;
//Check for before file
upload ('before'$filename);
 
//after file
 
$filename 'BetterLetters/after' $i;
upload ('after'$filename);
  } else {
      print 
"This is debugging statement 3. <br />\n";
  echo 
'<p> the following error(s) occurred: <br />';
  foreach (
$errors as $msg) {
    echo 
" - $msg<br />\n";
  }}
  echo 
'</p>' ;}  }; 
 
?>
 <p> Program ran</p>
</body>
</html>

Last edited by ashelred; 03-22-2010 at 09:00 PM..
ashelred is offline   Reply With Quote
Old 03-22-2010, 01:17 PM   PM User | #11
Rowsdower!
Senior Coder

 
Rowsdower!'s Avatar
 
Join Date: Oct 2008
Location: Some say it's everything.
Posts: 2,007
Thanks: 5
Thanked 395 Times in 388 Posts
Rowsdower! has a spectacular aura aboutRowsdower! has a spectacular aura aboutRowsdower! has a spectacular aura about
Quote:
Originally Posted by ashelred View Post
Okay, I'm posting the way the program looks now. I put in three debugging statements. When I try to run it, only the first debugging statement prints out. So the problem is that the "if" fails, and then does not go to the "else" where I have an error code for it.
Here is the code:
OK, if debugging statement 3 is not showing then that means that your "if" statement IS returning true and IS being entered. If not you would definitely see the 3rd debugging statement because there is essentially no questionable code inside of the "else" statement before that debugging statement is printed. What is most likely happening is that you have an error whose error reporting is being suppressed. You have four possible locations for this (starting at line 140 of your script):

Code:
//Make the connection
$dbc = @mysql_connect(DB_HOST, DB_USER, DB_PASSWORD) OR die('Could not connect to MYSQL: ' . mysql_error());
//s Select Database
@mysql_select_db(DB_NAME)OR die('Could not select database' . mysql_error());
// Make the query
$query = "INSERT INTO defalt (firstname, lastname, age, hand, other, uselong, useoften, comment, email, web, whensubmited) 
VALUES ('$fn', '$ln', '$age', '$hand', '$ot', '$ul', '$uo', '$em', '$wb', NOW())";
$result = @mysql_query ($query); // Run the query
if ($result) {//it ran OK
//Find Id#
$query = 'SELECT * from defalt WHERE whensubmited == max(whensubmited)'; 
$result = @mysql_query ($query);
My advice would be to remove the "@" character from these locations and then re-run the script. The errors should then be reported and you can fix the problem(s) causing them. After that you can add the "@" characters back in, but until the page works as expected it's best not to suppress that error reporting. Give that a shot and let us know what you find.
__________________
The object of opening the mind, as of opening the mouth, is to shut it again on something solid. –G.K. Chesterton
See Mediocrity in its Infancy
It's usually a good idea to start out with this at the VERY TOP of your CSS: * {border:0;margin:0;padding:0;}
Seek and you shall find... basically:
validate your markup | view your page cross-browser/cross-platform | free web tutorials | free hosting
Rowsdower! is offline   Reply With Quote
Old 03-22-2010, 07:39 PM   PM User | #12
ashelred
New to the CF scene

 
Join Date: Mar 2010
Posts: 6
Thanks: 2
Thanked 0 Times in 0 Posts
ashelred is an unknown quantity at this point
Angry

I removed the "@" symbols. After that, the program still failed to report debugging error 2 as well as debugging error 3. This suggests that the "if" statement did not execute and did not go to "else". Please tell me what could have caused this.
ashelred is offline   Reply With Quote
Old 03-22-2010, 08:27 PM   PM User | #13
Rowsdower!
Senior Coder

 
Rowsdower!'s Avatar
 
Join Date: Oct 2008
Location: Some say it's everything.
Posts: 2,007
Thanks: 5
Thanked 395 Times in 388 Posts
Rowsdower! has a spectacular aura aboutRowsdower! has a spectacular aura aboutRowsdower! has a spectacular aura about
Quote:
Originally Posted by ashelred View Post
I removed the "@" symbols. After that, the program still failed to report debugging error 2 as well as debugging error 3. This suggests that the "if" statement did not execute and did not go to "else". Please tell me what could have caused this.
I haven't checked over your entire code to make sure that you haven't mis-matched the brackets for the if/else, but trust me - if you have those right and the "if" fails you certainly will go to the "else" statement unless there is some "fatal error" - which would be reported to you as long as you haven't disabled error reporting in PHP. So I guess let's back up and try that first.

Try adding this line of code at the VERY TOP of your file:
PHP Code:
<?php phpinfo(); ?>
When you do this it tells the page to print a huge block of information about your PHP. Among the details will be whether error reporting is turned on or not. Look in the "Configuration, PHP Core" section. Check for the "display_errors" directive and make sure that the local value is set to "On" and then check to see if "error_reporting" is set to "6135." Let me know what you find.

Also, you have posted your database connection information in the code again. At this point it may have been cached by google, making it potentially visible for a long time to come. I would advise you to remove that login information (and be sure not to post it again) and update your username/password for your database to avoid a serious security issue.
__________________
The object of opening the mind, as of opening the mouth, is to shut it again on something solid. –G.K. Chesterton
See Mediocrity in its Infancy
It's usually a good idea to start out with this at the VERY TOP of your CSS: * {border:0;margin:0;padding:0;}
Seek and you shall find... basically:
validate your markup | view your page cross-browser/cross-platform | free web tutorials | free hosting
Rowsdower! is offline   Reply With Quote
Users who have thanked Rowsdower! for this post:
ashelred (03-23-2010)
Old 03-23-2010, 12:02 AM   PM User | #14
ashelred
New to the CF scene

 
Join Date: Mar 2010
Posts: 6
Thanks: 2
Thanked 0 Times in 0 Posts
ashelred is an unknown quantity at this point
Quote:
Originally Posted by Rowsdower! View Post
I haven't checked over your entire code to make sure that you haven't mis-matched the brackets for the if/else, but trust me - if you have those right and the "if" fails you certainly will go to the "else" statement unless there is some "fatal error" - which would be reported to you as long as you haven't disabled error reporting in PHP. So I guess let's back up and try that first.

Try adding this line of code at the VERY TOP of your file:
PHP Code:
<?php phpinfo(); ?>
When you do this it tells the page to print a huge block of information about your PHP. Among the details will be whether error reporting is turned on or not. Look in the "Configuration, PHP Core" section. Check for the "display_errors" directive and make sure that the local value is set to "On" and then check to see if "error_reporting" is set to "6135." Let me know what you find.

Also, you have posted your database connection information in the code again. At this point it may have been cached by google, making it potentially visible for a long time to come. I would advise you to remove that login information (and be sure not to post it again) and update your username/password for your database to avoid a serious security issue.
I followed above instructions. The "error_reporting" is set to "6135."
What do I do now.
ashelred is offline   Reply With Quote
Old 03-23-2010, 03:59 PM   PM User | #15
Rowsdower!
Senior Coder

 
Rowsdower!'s Avatar
 
Join Date: Oct 2008
Location: Some say it's everything.
Posts: 2,007
Thanks: 5
Thanked 395 Times in 388 Posts
Rowsdower! has a spectacular aura aboutRowsdower! has a spectacular aura aboutRowsdower! has a spectacular aura about
If it were my script, I would insert some code that I KNOW is wrong and should throw an error (make a call to an undefined function, like <?php this_is_a_garbage_function(); ?>). I'd put this right at the top of the page (in place of the php_info() code that you just did) and see if I get an error message. If not, then the error reporting is still not active so we still can't see where your code is failing. The solution then would be to get error reporting turned on and/or check your error logs.

My thinking is that there would have to be an error that terminates your code in order for your if/else to produce no debugging output at all. As far as I know PHP doesn't just skip if/else statements for the fun of it. So, if you actually do get an error message as expected after doing the above, then I would take care to examine all of the nested statements to make sure that there is no mis-match in opening/closing brackets.
__________________
The object of opening the mind, as of opening the mouth, is to shut it again on something solid. –G.K. Chesterton
See Mediocrity in its Infancy
It's usually a good idea to start out with this at the VERY TOP of your CSS: * {border:0;margin:0;padding:0;}
Seek and you shall find... basically:
validate your markup | view your page cross-browser/cross-platform | free web tutorials | free hosting
Rowsdower! is offline   Reply With Quote
Users who have thanked Rowsdower! for this post:
ashelred (03-23-2010)
Reply

Bookmarks

Tags
data collection, execute, graphics, mysql

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:10 AM.


Advertisement
Log in to turn off these ads.