Banner

Sponsor

Login


Welcome Back!
Guest
Guest

Register

Lost your password?

52 users online



if elseif else help

if elseif else help

Currently viewing this thread: 1 (0 members and 1 guests)


JustEvolved

JustEvolved

Status: Offline!

if elseif else help

How would I code something like this?

if isset something{

do this

}elseif isset something AND something empty {

do this

}else {

do this

}

I have this but it's not working...any help....

PHP:

<?php
if(isset($_POST["submit"])){

do 
this

}elseif(isset($_POST["submit"])) || (empty($messages))){

do 
this

}else{

do 
this

}
?>

___________________

We are survival machines - robot vehicles blindly programmed to preserve the selfish molecules known as genes.

- Richard Dawkins

Last edited by JustEvolved, January 27th, 2004 08:48 PM (Edited 1 times)

evan

evan

Neverside Newbie
Status: Offline!

Use single quotes for arrays. and || is OR, && is AND
You also have to many parenthesis (sp?)

PHP:

<?php
if( isset( $_POST['submit'] ) ) {
  do 
this
} elseif( isset( $_POST['submit'] ) || empty( $messages ) ) {
  do 
this
} else {
  do 
this
}
?>

Last edited by evan, January 27th, 2004 09:13 PM (Edited 1 times)

Quick Jump:

Main Navigation


Site & Graphic Design by Aeon Tan
Developed by Jeremie Pelletier & Scott Roach


NeverAPI generated this page in 0.0067 seconds.