Solved

include in die

Posted on 2004-10-01
4
412 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

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

Question has a verified solution.

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

Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
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…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
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 …

808 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