Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 420
  • Last Modified:

include in die

hello there,
is there anyway i can have in

die ("you need to have 5 points");

and include something like

include ("help.html"); ???

thanks for any help!
0
Xtry
Asked:
Xtry
  • 2
1 Solution
 
XtryAuthor Commented:
i want instead of showing me the message "you need to have 5 points" i want to show  the help.html
0
 
ldbkuttyCommented:
if you are excecting an SQL query with die, you can use something like this:

$result = mysql_query("your_sql_query_here");

if(!$result) {
   include "help.html";
}
0
 
hernst42Commented:
Don't know what you are meaning.

The die command directly exists the php-interpreter after printing the message. No further php-command is executed.

So what you want migth be this:

function fatalError($msg) {
    echo $msg:
    include("help.html");
    die(0);
}

And then calling
fatalError("you need to have 5 points");
0
 
hernst42Commented:
ok if the msg should not be displayed remove that echo from the function
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now