Jump to content

[SOLVED] PHP else two codes executed


Eminem

Recommended Posts

How can I go about making it so that two codes will be executed in an "else"?

 

<?php

if ($user = " ")
  echo "Please specify a username!";
elseif ($pass = " ")
  echo "Please enter your password!";
else
  mail($to,$subject,$message);

echo "Hello World!"

?>

 

I want else to run not only mail, but Hello World! too. I want it so that Hello World! doesn't show up in the if and elseif situations... only in an else situation.

Link to comment
https://forums.phpfreaks.com/topic/66585-solved-php-else-two-codes-executed/
Share on other sites

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.