therealwesfoster Posted May 1, 2008 Share Posted May 1, 2008 This is kind of urgent, just keep that in mind Whenever I use these 1-line conditional statements, the page doesnt load: $author = (strlen($_POST['r_Author'] > 0) ? addslashes($_POST['r_Author']) : array_push($error,"Please enter an Author"); The page is completely blank. I have no idea what it could be. But If I remove all the lines like that, the page loads fine. Why is that? And how can I fix this? Here's more code: <?php // Set an error holder $error = array(); //---- // Lets load all of the variables from the form // // Required stuff $author = (strlen($_POST['r_Author'] > 0) ? addslashes($_POST['r_Author']) : array_push($error,"Please enter an Author"); $email = (checkEmailAddress($_POST['re_email']) ? $_POST['re_email'] : array_push($error,"Please enter a valid email address"); $type = (preg_match('/^[a-zA-Z]$/',$_POST['r_Type']) ? $_POST['r_Type'] : array_push($error,"Invalid article type"); $title = (strlen($_POST['r_Title']) > 0) ? $_POST['r_Title'] : array_push($error,"Please enter a title for your article"); $photos = (preg_match('/^[a-zA-Z]$/',$_POST['r_Photos'])) ? $_POST['r_Photos'] : array_push($error,"Invalid choice for photos. Choose Yes or No"); $captcha= (strlen($_POST['captcha']) > 0) ? $_POST['captcha'] : array_push($error,"You didn't enter the captcha code"); $captcha= (md5(sha1($captcha)) == $_SESSION['key']) ? $captcha : array_push($error,"The captcha code you entered is invalid."); $terms = (isset($_POST['Terms_Of_Agreement'])) ? true : array_push($error,"Please agree to the terms of service"); // Non-required $summary = addslashes($_POST['Summary']); $article = addslashes($_POST['Article']); ?> And yes, all the $_POST vars are set. I even set error_reporting(E_ALL) ON.. and nothing shows at all... Remember.. urgent. Thanks Quote Link to comment Share on other sites More sharing options...
therealwesfoster Posted May 1, 2008 Author Share Posted May 1, 2008 I just realized that I didn't have enough ) on some of my statements. I've fixed that and it still doesn't work. :-\ Quote Link to comment Share on other sites More sharing options...
therealwesfoster Posted May 1, 2008 Author Share Posted May 1, 2008 Well, I solved it. It was faulty coding by me with all those parenthesis.. But I wonder why it wasn't showing my errors? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.