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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.