|
-
Jan 19th, 2006, 07:57 AM
#1
Thread Starter
Member
Sucess message page
Hi
I have some experience with programming, but i'am very new in PHP and i want to know hat is the best way to show a page with a sucess message after a script execution.
Any suggestions ?
-
Jan 23rd, 2006, 09:33 PM
#2
Re: Sucess message page
 Originally Posted by Desbaratizador
Hi
I have some experience with programming, but i'am very new in PHP and i want to know hat is the best way to show a page with a sucess message after a script execution.
Any suggestions ?
There are many, many ways.
You could create a dynamically generated one, you could use a template fom a database, you cold use the include() function to include a premade file or any combination of those, can you be a bit more specific about your needs?
Cheers,
Ryan Jones
-
Jan 24th, 2006, 06:45 AM
#3
Thread Starter
Member
Re: Sucess message page
I want to show a "Operation completed with sucess" message after a user fire a submit button. What i need is a example of a dynamically generated one (or other).
Thanks on advance
-
Jan 24th, 2006, 07:36 AM
#4
Re: Sucess message page
I assume submit is on a form and the form action points to your PHP script, so don't output anything during the script execution and after it's finished you could check whether it was succesful and condiitonally display an HTML message.
Example: Lets say $success is true or false depending on whether the script worked.
PHP Code:
<?php
// script goes here...
?>
<html>
<head>
<title>Success</title>
</head>
<body>
<?php
if ($success)
{
?>
<p>It worked, yay</p>
<?php
}
else
{
?>
<p>Oh crap, something went wrong! :-(</p>
<?php
}
?>
</body>
</html>
-
Jan 25th, 2006, 02:57 AM
#5
Re: Sucess message page
It also dependso n what you consider to be success, what does the script do with the submitted data and what would you need to test in order to assertain whethher the script failed?
-
Jan 30th, 2006, 06:50 AM
#6
Thread Starter
Member
Re: Sucess message page
OK. Thanks.
With the examples submited as help i made the target.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|