Results 1 to 6 of 6

Thread: Sucess message page

  1. #1

    Thread Starter
    Member
    Join Date
    May 2001
    Posts
    39

    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 ?

  2. #2
    Frenzied Member sciguyryan's Avatar
    Join Date
    Sep 2003
    Location
    Wales
    Posts
    1,763

    Re: Sucess message page

    Quote 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
    My Blog.

    Ryan Jones.

  3. #3

    Thread Starter
    Member
    Join Date
    May 2001
    Posts
    39

    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

  4. #4
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    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>

  5. #5
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    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?
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  6. #6

    Thread Starter
    Member
    Join Date
    May 2001
    Posts
    39

    Resolved 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
  •  



Click Here to Expand Forum to Full Width