Solved

include in die

Posted on 2004-10-01
4
409 Views
Last Modified: 2013-11-18
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
Comment
Question by:Xtry
  • 2
4 Comments
 

Author Comment

by:Xtry
ID: 12203921
i want instead of showing me the message "you need to have 5 points" i want to show  the help.html
0
 
LVL 32

Expert Comment

by:ldbkutty
ID: 12203942
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
 
LVL 48

Accepted Solution

by:
hernst42 earned 500 total points
ID: 12203953
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
 
LVL 48

Expert Comment

by:hernst42
ID: 12203960
ok if the msg should not be displayed remove that echo from the function
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Shoutout to Emily Plummer (http://www.experts-exchange.com/members/eplummer26.html) for giving me this article! She did most of it, I just finished it up and posted it for her :)    Introduction In a previous article (http://www.experts-exchang…
Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now