Solved

include in die

Posted on 2004-10-01
4
408 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
ok if the msg should not be displayed remove that echo from the function
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
These days socially coordinated efforts have turned into a critical requirement for enterprises.
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…

763 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

12 Experts available now in Live!

Get 1:1 Help Now