SitePoint Sponsor

User Tag List

Page 2 of 4 FirstFirst 1234 LastLast
Results 26 to 50 of 91
  1. #26
    SitePoint Addict miggl's Avatar
    Join Date
    Feb 2007
    Location
    Los Angeles, CA
    Posts
    286
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Again, another dastardly typo. I edited the above code in my previous post. Sorry about that.
    Celebrate Liberty, Freedom, and Rights at The Constitutionalist.

  2. #27
    SitePoint Wizard
    Join Date
    Dec 2005
    Posts
    1,723
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    lol getting there now. no errors showing but when i submit a blank form only the email error comes up and the category is already selecting enquries when i load the page

    thanks

  3. #28
    SitePoint Addict miggl's Avatar
    Join Date
    Feb 2007
    Location
    Los Angeles, CA
    Posts
    286
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    LOL, darnit, waiting for when you say that everything works like a charm! OK, let's see what the issue is. Here's the main page code:
    PHP Code:
    <?php include ('process.php'); ?>  
          
        <form name="contact" method="post" action="<?php $_POST['PHP-SELF'];?>">  
          <h1><input name="name" type="text" id="name" value="<?php print($name); ?>" /> Name</h1>  
          <p>&nbsp; </p>  
          <h1><input name="email" type="text" id="email" value="<?php print($email); ?>" />Email</h1>  
          <p>&nbsp;</p>  
          <p>  
            <select name="category" id="category">  
              <option>Please Select</option>  
    <?php  
    if ($category == 'enquires') {$s_selected " selected='selected'";}  
    else {
    $s_selected '';}  
    ?>  
              <option value="enquires"<?php print($s_selected); ?>>Enquries</option>  
    <?php  
    if ($category == 'clubs') {$s_selected " selected='selected'";}  
    else {
    $s_selected '';}  
    ?>  
              <option value="clubs"<?php print($s_selected); ?>>Clubs</option>  
    <?php  
    if ($category == 'pictures') {$s_selected " selected='selected'";}  
    else {
    $s_selected '';}  
    ?>  
              <option value="pictures"<?php print($s_selected); ?>>Pictures</option>  
    <?php  
    if ($category == 'advertise') {$s_selected " selected='selected'";}  
    else {
    $s_selected '';}  
    ?>  
              <option value="advertise"<?php print($s_selected); ?>>Advertise</option>  
    <?php  
    if ($category == 'other') {$s_selected " selected='selected'";}  
    else {
    $s_selected '';}  
    ?>  
              <option value="other"<?php print($s_selected); ?>>Other</option>  
              </select>  
        </p>  
          <p>&nbsp;</p>  
          <p><textarea name="comment" id="comment"><?php print($comments); ?></textarea></p>  
          <p>&nbsp;</p>  
          <p><input type="submit" name="submit" value="Submit" /></p>  

        </form>
    Here's the process.php page:
    PHP Code:
    <?php
    $name                
    '';
    $email                '';
    $category            '';
    $comments            '';
    $s_error_message    '';

    if (isset(
    $_POST['submit'])) //check for name of your submit button
    {
        if (
    $_POST['submit'] == 'Submit')
        {
            if (isset(
    $_POST['name'])) {$name trim(stripslashes($_POST['name']));}
            if (isset(
    $_POST['email'])) {$email trim(stripslashes($_POST['email']));}
            if (isset(
    $_POST['category'])) {$category trim(stripslashes($_POST['category']));}
            if (isset(
    $_POST['comment'])) {$comments trim(stripslashes($_POST['comment']));}
            if (
    strlen($name) == 0) {$s_error_message .= '<p>You forgot to enter your name!</p>';}
            if (
    strlen($category) == 0) {$s_error_message .= '<p>Please select a category!</p>';}
            if (
    strlen($comments) == 0) {$s_error_message .= '<p>You forgot your comments!</p>';}
            if (
    strlen($email) == 0) {$s_error_message .= "<p>You forgot your email address!</p>";}
            elseif(!
    eregi("^[[:alnum:]][a-z0-9_.-]*@[a-z0-9.-]+\.[a-z]{2,4}$"$email)) {$s_error_message .= "<p>Not a valid email address</p>";}

            if (
    strlen($s_error_message) > 0) {print($s_error_message);}
            else
            {
                
    $to="email@site.com";
                
    $message $name ' just filled in your contact form. They said:\n' $comments '\n\nTheir e-mail address was: ' $email;
                
    $subject ucfirst($category);
                
                if(
    mail($to$subject$message'From: ' $email))
                {  
                    
    header('Location: index1.php');
                    exit();
                }
                else {print(
    'There was a problem sending the mail. Please check that you filled in the form correctly.');}
            }
        }  
    }
    ?>
    Celebrate Liberty, Freedom, and Rights at The Constitutionalist.

  4. #29
    SitePoint Wizard
    Join Date
    Dec 2005
    Posts
    1,723
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok now were getting some where

    1. page loads with no errors showing
    2. they all work besides the category(it dosent show any error if you dont select a category and still lets you post)
    3. when i submit, error:

    Warning: Cannot modify header information - headers already sent by (output started at /home/public_html/contact.php:7) in /home/public_html/process.php on line 31


    PHP Code:
    if(mail($to$subject$message'From: ' $email))
                {  
                    
    header('Location: index1.php'); // line 31
                    
    exit();
                } 
    cheers
    Last edited by computerbarry; Mar 6, 2007 at 06:42.

  5. #30
    SitePoint Addict miggl's Avatar
    Join Date
    Feb 2007
    Location
    Los Angeles, CA
    Posts
    286
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    To address the category problem:
    PHP Code:
    <?php
    session_start
    ();

    include (
    'process.php');
    ?>  
          
        <form name="contact" method="post" action="<?php $_POST['PHP-SELF'];?>">  
          <h1><input name="name" type="text" id="name" value="<?php print($name); ?>" /> Name</h1>  
          <p>&nbsp; </p>  
          <h1><input name="email" type="text" id="email" value="<?php print($email); ?>" />Email</h1>  
          <p>&nbsp;</p>  
          <p>  
            <select name="category" id="category">  
              <option value="">Please Select</option>  
    <?php
    if ($category == 'enquires') {$s_selected " selected='selected'";}  
    else {
    $s_selected '';}  
    ?>  
              <option value="enquires"<?php print($s_selected); ?>>Enquries</option>  
    <?php
    if ($category == 'clubs') {$s_selected " selected='selected'";}  
    else {
    $s_selected '';}  
    ?>  
              <option value="clubs"<?php print($s_selected); ?>>Clubs</option>  
    <?php
    if ($category == 'pictures') {$s_selected " selected='selected'";}  
    else {
    $s_selected '';}  
    ?>  
              <option value="pictures"<?php print($s_selected); ?>>Pictures</option>  
    <?php
    if ($category == 'advertise') {$s_selected " selected='selected'";}  
    else {
    $s_selected '';}  
    ?>  
              <option value="advertise"<?php print($s_selected); ?>>Advertise</option>  
    <?php
    if ($category == 'other') {$s_selected " selected='selected'";}  
    else {
    $s_selected '';}  
    ?>  
              <option value="other"<?php print($s_selected); ?>>Other</option>  
              </select>  
        </p>  
          <p>&nbsp;</p>  
          <p><textarea name="comment" id="comment"><?php print($comments); ?></textarea></p>  
          <p>&nbsp;</p>  
          <p><input type="submit" name="submit" value="Submit" /></p>  

        </form>
    Regarding the issue with the headers already being sent: make sure there are no leading spaces or any HTML prior to including the process.php file. process.php must also have no leading text prior to the first PHP escape tag (<?php).
    Celebrate Liberty, Freedom, and Rights at The Constitutionalist.

  6. #31
    SitePoint Wizard
    Join Date
    Dec 2005
    Posts
    1,723
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Cheers getting even closer

    Ok:

    1. ive moved the include ('process.php'); to the top outside of my <html> and no header error (but the errors are showing at the top of the page now how will i get the errors to fit inside <html> for poistioning without moving it down the page and getting the header error again)
    2. sucess! the errors are all functional - just edited this message included <option value="">Please Select</option> sorted the category problem
    3. when i submit ok the errors are outside of my page but also make my page jump across the screen to the left?


    Cheers - anyone thanks
    Last edited by computerbarry; Mar 6, 2007 at 07:46.

  7. #32
    SitePoint Addict miggl's Avatar
    Join Date
    Feb 2007
    Location
    Los Angeles, CA
    Posts
    286
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Change process.php to the following:
    PHP Code:
    <?php
    function verify()
    {
        
    $name                '';
        
    $email                '';
        
    $category            '';
        
    $comments            '';
        
    $s_error_message    '';

        if (isset(
    $_POST['submit'])) //check for name of your submit button
        
    {
            if (
    $_POST['submit'] == 'Submit')
            {
                if (isset(
    $_POST['name'])) {$name trim(stripslashes($_POST['name']));}
                if (isset(
    $_POST['email'])) {$email trim(stripslashes($_POST['email']));}
                if (isset(
    $_POST['category'])) {$category trim(stripslashes($_POST['category']));}
                if (isset(
    $_POST['comment'])) {$comments trim(stripslashes($_POST['comment']));}
                if (
    strlen($name) == 0) {$s_error_message .= '<p>You forgot to enter your name!</p>';}
                if (
    strlen($category) == 0) {$s_error_message .= '<p>Please select a category!</p>';}
                if (
    strlen($comments) == 0) {$s_error_message .= '<p>You forgot your comments!</p>';}
                if (
    strlen($email) == 0) {$s_error_message .= "<p>You forgot your email address!</p>";}
                elseif(!
    eregi("^[[:alnum:]][a-z0-9_.-]*@[a-z0-9.-]+\.[a-z]{2,4}$"$email)) {$s_error_message .= "<p>Not a valid email address</p>";}
            }
        }

        return 
    $s_error_message;
    }
    ?>
    And your main page to:
    PHP Code:
    <?php
    //this at the very top of the page
    session_start();

    include (
    'process.php');

    $s_error_message verify();
    if (
    strlen($s_error_message) > 0) {print($s_error_message);}
    else
    {
        
    $to="email@site.com";
        
    $message $name ' just filled in your contact form. They said:\n' $comments '\n\nTheir e-mail address was: ' $email;
        
    $subject ucfirst($category);
                
        if(
    mail($to$subject$message'From: ' $email))
        {  
            
    header('Location: index1.php');
            exit();
        }
        else {print(
    'There was a problem sending the mail. Please check that you filled in the form correctly.');}
    }
    //this further down where you want the error to be displayed:
    print($s_error_message);
    ?>  
        <form name="contact" method="post" action="<?php $_POST['PHP-SELF'];?>">  
          <h1><input name="name" type="text" id="name" value="<?php print($name); ?>" /> Name</h1>  
          <p>&nbsp; </p>  
          <h1><input name="email" type="text" id="email" value="<?php print($email); ?>" />Email</h1>  
          <p>&nbsp;</p>  
          <p>  
            <select name="category" id="category">  
              <option value="">Please Select</option>  
    <?php
    if ($category == 'enquires') {$s_selected " selected='selected'";}  
    else {
    $s_selected '';}  
    ?>  
              <option value="enquires"<?php print($s_selected); ?>>Enquries</option>  
    <?php
    if ($category == 'clubs') {$s_selected " selected='selected'";}  
    else {
    $s_selected '';}  
    ?>  
              <option value="clubs"<?php print($s_selected); ?>>Clubs</option>  
    <?php
    if ($category == 'pictures') {$s_selected " selected='selected'";}  
    else {
    $s_selected '';}  
    ?>  
              <option value="pictures"<?php print($s_selected); ?>>Pictures</option>  
    <?php
    if ($category == 'advertise') {$s_selected " selected='selected'";}  
    else {
    $s_selected '';}  
    ?>  
              <option value="advertise"<?php print($s_selected); ?>>Advertise</option>  
    <?php
    if ($category == 'other') {$s_selected " selected='selected'";}  
    else {
    $s_selected '';}  
    ?>  
              <option value="other"<?php print($s_selected); ?>>Other</option>  
              </select>  
        </p>  
          <p>&nbsp;</p>  
          <p><textarea name="comment" id="comment"><?php print($comments); ?></textarea></p>  
          <p>&nbsp;</p>  
          <p><input type="submit" name="submit" value="Submit" /></p>  

        </form>
    Last edited by miggl; Mar 6, 2007 at 09:29.
    Celebrate Liberty, Freedom, and Rights at The Constitutionalist.

  8. #33
    SitePoint Wizard
    Join Date
    Dec 2005
    Posts
    1,723
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    lol thanks miggl hoping you'd come back just putting it together now - 5 min.

    THANKS!

  9. #34
    SitePoint Wizard
    Join Date
    Dec 2005
    Posts
    1,723
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Parse error: syntax error, unexpected $end in /home/public_html/contact.php on line 124

    that the very end of the file </html> line 124
    reagrding the //this further down where you want the error to be displayed:
    print($s_error_message); will i just inclose this in <?php ?> and place it were i please?

    thanks

  10. #35
    SitePoint Addict miggl's Avatar
    Join Date
    Feb 2007
    Location
    Los Angeles, CA
    Posts
    286
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by computerbarry View Post
    Parse error: syntax error, unexpected $end in /home/public_html/contact.php on line 124
    This is now fixed in the code above.
    Quote Originally Posted by computerbarry View Post
    reagrding the //this further down where you want the error to be displayed:
    print($s_error_message); will i just inclose this in <?php ?> and place it were i please?
    Precisely
    Celebrate Liberty, Freedom, and Rights at The Constitutionalist.

  11. #36
    SitePoint Wizard
    Join Date
    Dec 2005
    Posts
    1,723
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks again in advance miggl.

    Warning: Cannot modify header information - headers already sent by (output started at /home/public_html/process.php:28) in /home/public_html/contact.php on line 17

    line 28 ?> end of the process.php
    line 17 header('Location: index1.php'); contact.php

    thanks again

  12. #37
    SitePoint Wizard
    Join Date
    Dec 2005
    Posts
    1,723
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    any 1? thanks.

  13. #38
    SitePoint Addict miggl's Avatar
    Join Date
    Feb 2007
    Location
    Los Angeles, CA
    Posts
    286
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Please post the entire code of your main page.
    Celebrate Liberty, Freedom, and Rights at The Constitutionalist.

  14. #39
    SitePoint Wizard
    Join Date
    Dec 2005
    Posts
    1,723
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    just changed the viewing hope that helps:

    Thanks

    CONTACT.PHP:

    PHP Code:
    <?php
    //this at the very top of the page
    session_start();

    include (
    'process.php');

    $s_error_message verify();
    if (
    strlen($s_error_message) > 0) {print($s_error_message);}
    else
    {
        
    $to="email@site.com";
        
    $message $name ' just filled in your contact form. They said:\n' $comments '\n\nTheir e-mail address was: ' $email;
        
    $subject ucfirst($category);
                
        if(
    mail($to$subject$message'From: ' $email))
        {  
            
    header('Location: index1.php');
            exit();
        }
        else {print(
    'There was a problem sending the mail. Please check that you filled in the form correctly.');}
    }

    ?>
    HTML Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
    <title>mysite.com</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    
    <link href="structure1.css" rel="stylesheet" type="text/css">
    <link href="appearance1.css" rel="stylesheet" type="text/css">
    
    </head>
    <body>
    <br><br>
    
    <div id="wrapper">
    <img src="images/logo.gif">
    <div id="banner">
      <h1>&nbsp;</h1>
    </div>
    
    <div id="l">
    PHP Code:
    <?php include ('includes/navigation.inc.html'); ?>
    HTML Code:
    </div>
    
    <div id="m">
    	<p>&nbsp;</p>
    	<h1>site<br>
    	<span class="grey">contact</span></h1>
    	<h1>&nbsp;</h1>
    	<div id="leftlist">
    	<h2>Please fill in all the text fields, if you don'tleave your name or a valid email no information can reach us.</h2>
    	<p>&nbsp;</p>
    	<p>kind regards</p>
    	</div>
    	<div id="rightlist">
    PHP Code:
    <?php print($s_error_message);?>
    HTML Code:
    <form name="contact" method="post" action="<?php $_POST['PHP-SELF'];?>">  
    	<h1><input name="name" type="text" id="name" value="<?php print($name); ?>"> Name</h1>  
    	<p>&nbsp; </p>  
    	<h1><input name="email" type="text" id="email" value="<?php print($email); ?>">Email</h1>  
    	<p>&nbsp;</p>  
    	<p><select name="category" id="category">  
    		<option value="">Please Select</option>
    PHP Code:
    <?php
        
    if ($category == 'enquires') {$s_selected " selected='selected'";}  
        else {
    $s_selected '';}  
        
    ?>  
              <option value="enquires"<?php print($s_selected); ?>>Enquries</option>  
        <?php
        
    if ($category == 'clubs') {$s_selected " selected='selected'";}  
        else {
    $s_selected '';}  
        
    ?>  
              <option value="clubs"<?php print($s_selected); ?>>Clubs</option>  
        <?php
        
    if ($category == 'pictures') {$s_selected " selected='selected'";}  
        else {
    $s_selected '';}  
        
    ?>  
            <option value="pictures"<?php print($s_selected); ?>>Pictures</option>  
        <?php
        
    if ($category == 'advertise') {$s_selected " selected='selected'";}  
        else {
    $s_selected '';}  
        
    ?>  
            <option value="advertise"<?php print($s_selected); ?>>Advertise</option>  
        <?php
        
    if ($category == 'other') {$s_selected " selected='selected'";}  
        else {
    $s_selected '';}  
        
    ?>
    HTML Code:
    <option value="other"<?php print($s_selected); ?>>Other</option>  
    	</select></p>  
    	<p>&nbsp;</p>  
    	<p><textarea name="comment" id="comment"><?php print($comments); ?></textarea></p>  
    	<p>&nbsp;</p>  
    	<p><input type="submit" name="submit" value="Submit"></p>  
    
        </form>
    	
    	</div><!-- End #rightlist -->
    	
    </div><!-- End #m -->
    
    <div id="r">
    PHP Code:
    <?php include ('includes/sub_navigation.inc.html'); ?>
    HTML Code:
    </div><!-- End #r -->
    PHP Code:
    <?php include ('includes/footer.inc.html'); ?>
    HTML Code:
    </div><!-- End #wrapper -->
    
    </body>
    </html>

  15. #40
    SitePoint Addict miggl's Avatar
    Join Date
    Feb 2007
    Location
    Los Angeles, CA
    Posts
    286
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Do you have any header() calls in navigation.inc.html, sub_navigation.inc.html, or footer.inc.html? There must be some output to the page prior to the header() call, which causes this error. Double-check for any spaces, html, or characters that come before that.
    Celebrate Liberty, Freedom, and Rights at The Constitutionalist.

  16. #41
    SitePoint Wizard
    Join Date
    Dec 2005
    Posts
    1,723
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    no header() calls in navigation.inc.html, sub_navigation.inc.html, or footer.inc.html? just basic html

    ??

  17. #42
    SitePoint Addict miggl's Avatar
    Join Date
    Feb 2007
    Location
    Los Angeles, CA
    Posts
    286
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Please post your code again from the absolute first position, to the last (in one single code block this time).
    Can you also post the exact error message as well?

    Thanks.
    Celebrate Liberty, Freedom, and Rights at The Constitutionalist.

  18. #43
    SitePoint Wizard
    Join Date
    Dec 2005
    Posts
    1,723
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks.

    Warning: Cannot modify header information - headers already sent by (output started at /home/public_html/process.php:28) in /home/public_html/contact.php on line 17


    FULL CODE OF CONTACT.PHP:

    Code:
    <?php
    //this at the very top of the page
    session_start();
    
    include ('process.php');
    
    $s_error_message = verify();
    if (strlen($s_error_message) > 0) {print($s_error_message);}
    else
    {
        $to="email@site.com";
        $message = $name . ' just filled in your contact form. They said:\n' . $comments . '\n\nTheir e-mail address was: ' . $email;
        $subject = ucfirst($category);
                
        if(mail($to, $subject, $message, 'From: ' . $email))
        {  
            header('Location: index1.php');
            exit();
        }
        else {print('There was a problem sending the mail. Please check that you filled in the form correctly.');}
    }
    
    ?> 
    
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
    <title>mysite.com</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    
    <link href="structure1.css" rel="stylesheet" type="text/css">
    <link href="appearance1.css" rel="stylesheet" type="text/css">
    
    </head>
    <body>
    <br><br>
    
    <div id="wrapper">
    <img src="images/logo.gif">
    <div id="banner">
      <h1>&nbsp;</h1>
    </div>
    
    <div id="l">
    	<?php include ('includes/navigation.inc.html'); ?>
    </div>
    
    <div id="m">
    	<p>&nbsp;</p>
    	<h1>site<br>
    	<span class="grey">contact</span></h1>
    	<h1>&nbsp;</h1>
    	<div id="leftlist">
    	<h2>Please fill in all the text fields, if you don'tleave your name or a valid email no information can reach us.</h2>
    	<p>&nbsp;</p>
    	<p>kind regards</p>
    	</div>
    	<div id="rightlist">
    	<?php print($s_error_message);?> 
    	<form name="contact" method="post" action="<?php $_POST['PHP-SELF'];?>">  
    	<h1><input name="name" type="text" id="name" value="<?php print($name); ?>"> Name</h1>  
    	<p>&nbsp; </p>  
    	<h1><input name="email" type="text" id="email" value="<?php print($email); ?>">Email</h1>  
    	<p>&nbsp;</p>  
    	<p><select name="category" id="category">  
    		<option value="">Please Select</option>  
    	<?php
    	if ($category == 'enquires') {$s_selected = " selected='selected'";}  
    	else {$s_selected = '';}  
    	?>  
              <option value="enquires"<?php print($s_selected); ?>>Enquries</option>  
    	<?php
    	if ($category == 'clubs') {$s_selected = " selected='selected'";}  
    	else {$s_selected = '';}  
    	?>  
              <option value="clubs"<?php print($s_selected); ?>>Clubs</option>  
    	<?php
    	if ($category == 'pictures') {$s_selected = " selected='selected'";}  
    	else {$s_selected = '';}  
    	?>  
    		<option value="pictures"<?php print($s_selected); ?>>Pictures</option>  
    	<?php
    	if ($category == 'advertise') {$s_selected = " selected='selected'";}  
    	else {$s_selected = '';}  
    	?>  
    		<option value="advertise"<?php print($s_selected); ?>>Advertise</option>  
    	<?php
    	if ($category == 'other') {$s_selected = " selected='selected'";}  
    	else {$s_selected = '';}  
    	?>  
    		<option value="other"<?php print($s_selected); ?>>Other</option>  
    	</select></p>  
    	<p>&nbsp;</p>  
    	<p><textarea name="comment" id="comment"><?php print($comments); ?></textarea></p>  
    	<p>&nbsp;</p>  
    	<p><input type="submit" name="submit" value="Submit"></p>  
    
        </form>
    	
    	</div><!-- End #rightlist -->
    	
    </div><!-- End #m -->
    
    <div id="r">
      
    <?php include ('includes/sub_navigation.inc.html'); ?>
    
    </div><!-- End #r -->
    <?php include ('includes/footer.inc.html'); ?>
    </div><!-- End #wrapper -->
    
    </body>
    </html>
    just incase heres

    PROCESS.PHP:

    PHP Code:
    <?php
    function verify()
    {
        
    $name                '';
        
    $email                '';
        
    $category            '';
        
    $comments            '';
        
    $s_error_message    '';

        if (isset(
    $_POST['submit'])) //check for name of your submit button
        
    {
            if (
    $_POST['submit'] == 'Submit')
            {
                if (isset(
    $_POST['name'])) {$name trim(stripslashes($_POST['name']));}
                if (isset(
    $_POST['email'])) {$email trim(stripslashes($_POST['email']));}
                if (isset(
    $_POST['category'])) {$category trim(stripslashes($_POST['category']));}
                if (isset(
    $_POST['comment'])) {$comments trim(stripslashes($_POST['comment']));}
                if (
    strlen($name) == 0) {$s_error_message .= '<p>You forgot to enter your name!</p>';}
                if (
    strlen($category) == 0) {$s_error_message .= '<p>Please select a category!</p>';}
                if (
    strlen($comments) == 0) {$s_error_message .= '<p>You forgot your comments!</p>';}
                if (
    strlen($email) == 0) {$s_error_message .= "<p>You forgot your email address!</p>";}
                elseif(!
    eregi("^[[:alnum:]][a-z0-9_.-]*@[a-z0-9.-]+\.[a-z]{2,4}$"$email)) {$s_error_message .= "<p>Not a valid email address</p>";}
            }
        }

        return 
    $s_error_message;
    }
    ?>
    CHEERS!

  19. #44
    SitePoint Addict miggl's Avatar
    Join Date
    Feb 2007
    Location
    Los Angeles, CA
    Posts
    286
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Could you also please paste the entire source from your browser (View Source) in a code block for me, after doing this:
    Above line 17 put this code:
    PHP Code:
    print("|");
    die(); 
    Thanks!
    Celebrate Liberty, Freedom, and Rights at The Constitutionalist.

  20. #45
    SitePoint Wizard
    Join Date
    Dec 2005
    Posts
    1,723
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Cheers miggl

    This source:

    |

    thats it blank page with the above

  21. #46
    SitePoint Addict miggl's Avatar
    Join Date
    Feb 2007
    Location
    Los Angeles, CA
    Posts
    286
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Can you post that in a code block for me?
    Celebrate Liberty, Freedom, and Rights at The Constitutionalist.

  22. #47
    SitePoint Wizard
    Join Date
    Dec 2005
    Posts
    1,723
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    what do mean? there is no code to show from the browser??

    All my code is in the above files above.

    Thanks

  23. #48
    SitePoint Addict miggl's Avatar
    Join Date
    Feb 2007
    Location
    Los Angeles, CA
    Posts
    286
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    use the [ code ] [ /code ] tags in the form so that it doesn't trim spaces, etc.
    1. View source.
    2. Hit CTRL-A to select everything.
    3. CTRL-C to copy selection.
    4. Create new reply. Type "&#91;code]" then paste the copied code, and finish by typing "&#91;/code]".

    Thanks.
    Celebrate Liberty, Freedom, and Rights at The Constitutionalist.

  24. #49
    SitePoint Wizard
    Join Date
    Dec 2005
    Posts
    1,723
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks - It shows the error from early:

    Code:
    <br />
    <b>Warning</b>:  Cannot modify header information - headers already sent by (output started at /home/public_html/process.php:28) in <b>/home/public_html/contact.php</b> on line <b>17</b><br />
    this is whats showing in the browser my page wont load just the error

    is that what you mean?

    this is with out
    print("|");
    die();

    Thanks again miggl

  25. #50
    SitePoint Addict miggl's Avatar
    Join Date
    Feb 2007
    Location
    Los Angeles, CA
    Posts
    286
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks, ya, that helps much better .
    Now, could you post the same with the print("|"); die(); directly above line 17? I'm trying to see what is output directly before that line that is causing the error.
    Celebrate Liberty, Freedom, and Rights at The Constitutionalist.


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
  •