Results 1 to 6 of 6

Thread: script for a contact form is giving problems

  1. #1
    Join Date
    Apr 2007
    Posts
    149
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default script for a contact form is giving problems

    Hello, i got a script for a contact form and when i put it where i want it, every code that is bellow it, won't be read by the browser... meaning that nothing else will apprear under the contact for (for example: the footer doesn't appear)
    i have checked the tags for the form and they are closed. what else can it be? any help? Appreciate it...

  2. #2
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    We really can't help you out unless you post the code.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  3. #3
    Join Date
    Apr 2007
    Posts
    149
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Sorry About that, here's the code:


    PHP Code:
     <div id="headline">    
              
              
             
               <div id="body-left8"><div align="center">
                <form action="contacto.php" onSubmit="return formCheck(this);" method="post" name="contacto.php" id="contacto.php">
                  <span class="style67 style71 style72">Formulario de Contacto              </span> <br>
                  <br>
                  <table width="623" border="0">
        <tr>
          <td width="211" rowspan="2" class="style47 style47 style70"><div align="center" class="style71"> 
            <div align="center">Las Maravillas De Dios <br>
              P.O. Box 280224 <br>
              Northridge, CA 91325 <br>
              <br>
              Tel. 818.782.4540 / Fax. 818.786.4995        </div>
          </div>
            <p align="center" class="style66 style47 style71">Email: MaravillasdeDios@aol.com       
          <p align="center" class="style55 style71"><span class=" style70 style47">Para Invitaciones Al Ministerio haga click <a href="Invitaciones.php">aqui&nbsp;</td>
          <td width="6" rowspan="3" class="style47 style47 style70"><img src="images/LongDividor.jpg" width="2" height="265" /></td>
          <td class="style47 style47 style70">
          <form action="contacto.php" onSubmit="return formCheck(this);" method="post" name="contacto.php" id="contacto.php"> 

    <?php
    $ipi 
    getenv("REMOTE_ADDR");
    $httprefi getenv ("HTTP_REFERER");
    $httpagenti getenv ("HTTP_USER_AGENT");
    ?>


            Name:<div align="left"><font face="Comic Sans MS">
              <input name="name" type=text class="style46" size=40>
              <span class="style62">      *</span></font></div>
          Phone:  <div align="left"><font size="3" face="Comic Sans MS">
            <input name="phone" type=text class="style46" onblur="MM_validateForm('telefono','','NisNum');return document.MM_returnValue" size=40> 
          </font><font face="Comic Sans MS"><span class="style62">*</span></font></div>
                     Email:<br>
            
              <input name="e-mail" type="text" class="style46" size="40">
          
        <br>Mensaje<div align="left"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">
              <textarea name="coment" cols="37" rows="4" class="style46" scroll="auto"></textarea>
            </font><font face="Verdana, Arial, Helvetica, sans-serif">  <span class="style62">*</span></font></div></td>
          </tr>
        
        <tr>
          <td><div align="left">
            <input type="submit"  value="Enviar" />
          </div></td>
          </tr>
        <tr>
          <td height="25">&nbsp;</td>
          <td><?php

    $ip 
    $_POST['ip'];
    $httpref $_POST['httpref'];
    $httpagent $_POST['httpagent'];
    $visitor $_POST['name'];
    $visitormail $_POST['visitormail'];
    $notes $_POST['notes'];
    $attn $_POST['attn'];


    if (
    eregi('http:'$notes)) {
    die (
    "Do NOT try that! ! ");
    }
    if(!
    $visitormail == "" && (!strstr($visitormail,"@") || !strstr($visitormail,".")))
    {
    echo 
    "<h2>Use Back - Enter valid e-mail</h2>\n";
    $badinput "<h2>Feedback was NOT submitted</h2>\n";
    echo 
    $badinput;
    die (
    "Go back! ! ");
    }

    if(empty(
    $visitor) || empty($visitormail) || empty($notes )) {
    echo 
    "<h2>Use Back - fill in all fields</h2>\n";
    die (
    "Use back! ! ");
    }

    $todayis date("l, F j, Y, g:i a") ;

    $attn $attn ;
    $subject $attn;

    $notes stripcslashes($notes);

    $message $todayis [EST] \n
    Attention: 
    $attn \n
    Message: 
    $notes \n
    From: 
    $visitor ($visitormail)\n
    Additional Info : IP = 
    $ip \n
    Browser Info: 
    $httpagent \n
    Referral : 
    $httpref \n
    "
    ;

    $from "From: $visitormail\r\n";


    mail("myemail"$subject$message$from);

    ?>

    Date: <?php echo $todayis ?>
    <br />
    Thank You : <?php echo $visitor ?> ( <?php echo $visitormail ?> )
    <br />
     </td>
          </tr>
      </table>
      </form>
      
      
      
                <span class="style39"><br>
                </span> </div>
              </div>
                <div id="search-news1">
                  <div align="center"><strong>Los Angeles Convention Center</strong></strong><a href="productos.php"><img src="images/lacc_dvd.gif" alt="LA dvd" width="183" height="165" border="0" /></a><br>
                    <strong>Lo Mejor Del Aņo 2006</strong>
                    <a href="productos.php"><img src="images/dvd 2.gif" alt="LA dvd" width="178" height="165" border="0" />            </div>
                </div>
                <div class="clear"></div>
          </div>
          
          
          
          
          
          
          
          
          
          
          
          
            
            <div class="clear"></div>
          </div>
           
        
        </div>
        <div id="footer">
            
            <p class="style34"><span class="style64">My Footer</span></p>
    </div>    
        
    </body>
    </html>

  4. #4
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    The only thing I have noticed was the lack of semicolons after the variables:

    Code:
    Date: <?php echo $todayis; ?>
    <br />
    Thank You : <?php echo $visitor; ?> ( <?php echo $visitormail; ?> )
    <br />
     </td>
          </tr>
      </table>
      </form>
      
      
      
                <span class="style39"><br>
                </span> </div>
              </div>
                <div id="search-news1">
                  <div align="center"><strong>Los Angeles Convention Center</strong></strong><a href="productos.php"><img src="images/lacc_dvd.gif" alt="LA dvd" width="183" height="165" border="0" /></a><br>
                    <strong>Lo Mejor Del Aņo 2006</strong>
                    <a href="productos.php"><img src="images/dvd 2.gif" alt="LA dvd" width="178" height="165" border="0" />            </div>
                </div>
                <div class="clear"></div>
          </div>
     
            <div class="clear"></div>
          </div>
           
        
        </div>
        <div id="footer">
            
            <p class="style34"><span class="style64">My Footer</span></p>
    </div>    
        
    </body>
    </html>
    Hope this helps.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  5. #5
    Join Date
    Apr 2007
    Posts
    149
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    thanks but that didn't solve the problem... somehow, when i remove this section the problem goes away.

    Code:
    if (eregi('http:', $notes)) {
    die ("Do NOT try that! ! ");
    }
    if(!$visitormail == "" && (!strstr($visitormail,"@") || !strstr($visitormail,".")))
    {
    echo "<h2>Use Back - Enter valid e-mail</h2>\n";
    $badinput = "<h2>Feedback was NOT submitted</h2>\n";
    echo $badinput;
    die ("Go back! ! ");
    }
    
    if(empty($visitor) || empty($visitormail) || empty($notes )) {
    echo "<h2>Use Back - fill in all fields</h2>\n";
    die ("Use back! ! ");
    }

    but i have no idea why... can you help me with that?

  6. #6
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    Try removing the highlighted part below:

    Code:
    if(!$visitormail == "" && (!strstr($visitormail,"@") || !strstr($visitormail,".")))
    Other than that, I can't see anything else that could be causing this problem. If this doesn't fix it, please post the link to the problem page so that we can see exactly where it is failing at.

    Hope this helps.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •