Solved

include in die

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

809 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