Jump to content

[SOLVED] Blank page when using array_push HELP


Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.