Menu

The look and feel of the error page

Help
2007-04-07
2013-06-03
  • Hard As Rock

    Hard As Rock - 2007-04-07

    If I forget to fill out a field, I get a crude page with a short message. How can i make it open an error.html page

    Thanks!

     
    • TNTEverett

      TNTEverett - 2007-04-07

      The bottom of your process.php file has the "crude" html page code.  Either modify this code to your satisfaction or take it out and use the php refresh function to display any page you want. 

       
      • Hard As Rock

        Hard As Rock - 2007-04-07

        Could you please send me the right script to achieve this. I don't know anything about php scripting. I'd appreciate it!

        <?php
        include("global.inc.php");
        $errors=0;
        $error="The following errors occured while processing your form input.<ul>";
        pt_register('POST','Nombres');
        pt_register('POST','Apellidos');
        pt_register('POST','Email');
        pt_register('POST','Consulta');
        $Consulta=preg_replace("/(\015\012)|(\015)|(\012)/","&nbsp;<br />", $Consulta);if($Nombres=="" || $Email=="" || $Consulta=="" ){
        $errors=1;
        $error.="<li>You did not enter one or more of the required fields. Please go back and try again.";
        }
        if(!eregi("^[a-z0-9]+([_\\.-][a-z0-9]+)*" ."@"."([a-z0-9]+([\.-][a-z0-9]+)*)+"."\\.[a-z]{2,}"."$",$Email)){
        $error.="<li>Invalid email address entered";
        $errors=1;
        }
        if($errors==1) echo $error;
        else{
        $where_form_is="http".($HTTP_SERVER_VARS["HTTPS"]=="on"?"s":"")."://".$SERVER_NAME.strrev(strstr(strrev($PHP_SELF),"/"));
        $message="Nombres: ".$Nombres."
        Apellidos: ".$Apellidos."
        Email: ".$Email."
        Consulta: ".$Consulta."
        ";
        $message = stripslashes($message);
        mail("dark_go@hotmail.com","www.lapiramidemoche.com",$message,"From: visitante");

        header("Refresh: 0;url=http://www.azulejosweb.com/templo/sent.html");
        ?><?php
        }
        ?>

         
        • TNTEverett

          TNTEverett - 2007-04-08

          if($errors==1)
          header("Refresh: 0;url=http://www.azulejosweb.com/templo/errorpage.html");
          else{
          $where_form_is="http".($HTTP_SERVER_VARS["HTTPS"]=="on"?"s":"")."://".$SERVER_NAME.strrev(strstr(strrev($PHP_SELF),"/"));
          $message="Nombres: ".$Nombres."
          Apellidos: ".$Apellidos."
          Email: ".$Email."
          Consulta: ".$Consulta."
          ";
          $message = stripslashes($message);
          mail("dark_go@hotmail.com","www.lapiramidemoche.com",$message,"From: visitante");

          header("Refresh: 0;url=http://www.azulejosweb.com/templo/sent.html");
          ?><?php 
          }
          ?>

           
    • Hard As Rock

      Hard As Rock - 2007-04-08

      Thank you so much. I works fine now

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.