SitePoint Sponsor

User Tag List

Page 1 of 4 1234 LastLast
Results 1 to 25 of 91
  1. #1
    SitePoint Wizard
    Join Date
    Dec 2005
    Posts
    1,711
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How would I direct my form to the same page

    Hi all

    Just showing a bit of my code here, the problem is - in my contact form if a user leaves a blank field i prompt them with an error.

    PHP Code:
    //validate the name and combat magic quotes, if necessary
    $do_name true;
    if (!empty(
    $_REQUEST['name'])) {
        
    $name stripslashes($_POST['name']);
    } else {
        
    $do_name false;
        echo 
    '<p>You forgot to enter your name!</p>';

    the [ echo '<p>You forgot to enter your name!</p>'; ] part displays on a blank page with no styles from my site, how would i get it to display on the same page with a back link?

    thanks

  2. #2
    SitePoint Zealot webreadyaudio's Avatar
    Join Date
    Sep 2003
    Location
    Wylie, TX
    Posts
    129
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I always post the form again, if the user doesn't fill in a field. So the basic skeleton I use is
    PHP Code:
    <?php
    if(isset($_POST['submit'])){

    //error checking
    //convert posted fields
    $fieldone $_POST['fieldone'];

    //etc.
       
    if(!$fieldone){
        echo 
    "<p>You must fill out field one!</p>";
    //show form again
    ?>
       <form action="<?php $_POST['PHP-SELF'];?>">
    <input type="text" name="fieldone" value="">
    <input type="submit" name="submit" value="Submit">
    </form>
     <?php  }else{
        echo 
    "Thank you for visiting";
    }else{
    ?>

    <form action="<?php $_POST['PHP-SELF'];?>">
    <input type="text" name="fieldone" value="">
    <input type="submit" name="submit" value="Submit">
    </form>
    <?php ?>
    I hope that helps, it may not be the safest or best way to do this but, it has gotten me by!

  3. #3
    SitePoint Addict miggl's Avatar
    Join Date
    Feb 2007
    Location
    Los Angeles, CA
    Posts
    286
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Optimally you would alert the client to this without having to repost to a page using javascript.
    In this case is I would post the form to itself, then check for errors. If any errors occur, show the error messages. Also repopulate the form with the submitted $_POST values.
    Celebrate Liberty, Freedom, and Rights at The Constitutionalist.

  4. #4
    SitePoint Addict miggl's Avatar
    Join Date
    Feb 2007
    Location
    Los Angeles, CA
    Posts
    286
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    webreadyaudio is on the money with this. However, I would optimize the skeletion a bit:
    PHP Code:
    <?php
        session
    -start();

        
    $s_field_1 '';
        
    $s_field_2 '';
        
    $s_field_3 '';
        
    $s_error_message '';

        if(isset(
    $_POST['action']))
        {
            if (isset(
    $_POST['field1'])) {$s_field_1 $_POST['field1']};
            if (isset(
    $_POST['field2'])) {$s_field_2 $_POST['field2']};
            if (isset(
    $_POST['field3'])) {$s_field_3 $_POST['field3']};
            if (
    $s_field_1 != 'valid text') {$s_error_message .= 'Field 1 is invalid.<br />';}
            if (
    $s_field_2 != 50) {$s_error_message .= 'Field 2 is not equal to 50.<br />';}
            if (
    $s_field_3 != 'other text') {$s_error_message .= 'Field 3 is plain wrong.<br />';}
        }
        if (
    strlen($s_error_message) == 0)
        {
            
    header('Location: index.php');
            exit();
        }
        
    ?>
    <html>
        <head>
        </head>
        <body>
            <form action="" method="post">
                <input type="hidden" name="action" id="action" value="" />
                <table>
    <?php    
            
    if (strlen($s_error_message) > 0)
            {
    ?>
                    <tr>
                        <td colspan="2">The following errors occured:<br /><?php print($s_error_message); ?></td>
                    </tr>
    <?php
            
    }
        }
    ?>
                    <tr>
                        <td>Field 1:</td>
                        <td><input type="text" name="field1" value="<?php print($s_field_1); ?>" /></td>
                    </tr>
                    <tr>
                        <td>Field 2:</td>
                        <td><input type="text" name="field2" value="<?php print($s_field_2); ?>" /></td>
                    </tr>
                    <tr>
                        <td>Field 3:</td>
                        <td><input type="text" name="field3" value="<?php print($s_field_3); ?>" /></td>
                    </tr>
                    <tr>
                        <td colspan="2"><input type="submit" name="submit" value="Submit" onclick="document.getElementById('action').value = 'save';" /></td>
                    </tr>
                </table>
            </form>
        </body>
    </html>
    Celebrate Liberty, Freedom, and Rights at The Constitutionalist.

  5. #5
    SitePoint Wizard
    Join Date
    Dec 2005
    Posts
    1,711
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just seen your post as i was writting this so il post anyway, what i can see seems alot easyier, have alook at my code and see what you think.

    Just trying to understand all this - thanks guys. So what your saying is have all the code on the same page? I currently have my code in a diffrent file like below

    HTML Code:
    <form name="contact" method="post" action="process.php" target="_self">
    process.php:

    PHP Code:
    ?
    //validate the name and combat magic quotes, if necessary
    $do_name true;
    if (!empty(
    $_REQUEST['name'])) {
        
    $name stripslashes($_POST['name']);
    } else {
        
    $do_name false;
        echo 
    '<p>You forgot to enter your name!</p>';
    }
    //validate the email and check if necessary chars are present and email is not blank
    $do_email true;
    if(
    eregi("^[[:alnum:]][a-z0-9_.-]*@[a-z0-9.-]+\.[a-z]{2,4}$"$_POST['email'])) { 
        
    $email $_POST['email']; 
    } else { 
         
    $do_email false// NOTE THIS LINE 
         
    echo "<p>Not a valid email address</p>\n"
    }
    //validate the category and combat magic quotes, if necessary 
    $do_category true
    if (!empty(
    $_REQUEST['category'])) { 
        
    $category $_POST['category']; 
    } else { 
        
    $do_category false
        echo 
    '<p>Please select a category!</p>';
    }
    //validate the comment and combat magic quotes, if necessary
    $do_comment true;
    if (!empty(
    $_REQUEST['comment'])) {
        
    $comments stripslashes($_POST['comment']);
    } else {
        
    $do_comment false;
        echo 
    '<p>You forgot your comments!</p>';

    // arrange category options
    $to="email@site.com";
       
    $message "$name just filled in your contact form. They said:\n$comments\n\nTheir e-mail address was: $email";
    switch(
    $category) { 
        case 
    'enquires' 
        
    $subject 'Enquires'
    break; 
        case 
    'clubs' 
        
    $subject 'Clubs'
    break; 
        case 
    'pictures' 
        
    $subject 'Pictures'
    break; 
        case 
    'advertise' 
        
    $subject 'Advertise'
    break;
    }  
    //  check and send to my email account
    if ($do_name && $do_email && $do_category && $do_comment) { 
        if(
    mail($to,$subject,$message,"From: $email\n")) { 
    // succesful? redirect 
        
    header("Location: index1.php"); 
        exit(); 
    } else { 
        echo 
    "There was a problem sending the mail. Please check that you filled in the form correctly."
        } 


    ?> 
    sorry if its abit full on just trying to learn stuff still at the novice stage.

    thanks in advance

  6. #6
    SitePoint Addict miggl's Avatar
    Join Date
    Feb 2007
    Location
    Los Angeles, CA
    Posts
    286
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    To avoid having it on different pages the user browses to, simply include your validation PHP in your main page, like so:
    PHP Code:
    include('process.php'); 
    It actually is good practice to separate your code out like that. However, keep in mind that you want to make the user go to different pages as few times as at all possible.
    Celebrate Liberty, Freedom, and Rights at The Constitutionalist.

  7. #7
    SitePoint Wizard
    Join Date
    Dec 2005
    Posts
    1,711
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I see so i do the include('process.php'); and have

    <form action="<?php $_POST['PHP-SELF'];?> will that return any errors to the same page?

    thanks

  8. #8
    SitePoint Wizard
    Join Date
    Dec 2005
    Posts
    1,711
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ive just done the above and all my error messages are showing before ive even touched the form?

    still learning here examples and input much appreciated. Thanks!

  9. #9
    SitePoint Addict miggl's Avatar
    Join Date
    Feb 2007
    Location
    Los Angeles, CA
    Posts
    286
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Update your process.php to the following:
    PHP Code:
    <?php
    if (isset($_POST['submit'])) //check for name of your submit button
    {
    //validate the name and combat magic quotes, if necessary 
    $do_name true
    if (!empty(
    $_REQUEST['name'])) { 
        
    $name stripslashes($_POST['name']); 
    } else { 
        
    $do_name false
        echo 
    '<p>You forgot to enter your name!</p>'

    //validate the email and check if necessary chars are present and email is not blank 
    $do_email true
    if(
    eregi("^[[:alnum:]][a-z0-9_.-]*@[a-z0-9.-]+\.[a-z]{2,4}$"$_POST['email'])) {  
        
    $email $_POST['email'];  
    } else {  
         
    $do_email false// NOTE THIS LINE  
         
    echo "<p>Not a valid email address</p>\n";  

    //validate the category and combat magic quotes, if necessary  
    $do_category true;  
    if (!empty(
    $_REQUEST['category'])) {  
        
    $category $_POST['category'];  
    } else {  
        
    $do_category false;  
        echo 
    '<p>Please select a category!</p>'

    //validate the comment and combat magic quotes, if necessary 
    $do_comment true
    if (!empty(
    $_REQUEST['comment'])) { 
        
    $comments stripslashes($_POST['comment']); 
    } else { 
        
    $do_comment false
        echo 
    '<p>You forgot your comments!</p>'
    }  
    // arrange category options 
    $to="email@site.com"
       
    $message "$name just filled in your contact form. They said:\n$comments\n\nTheir e-mail address was: $email"
    switch(
    $category) {  
        case 
    'enquires' :  
        
    $subject 'Enquires';  
    break;  
        case 
    'clubs' :  
        
    $subject 'Clubs';  
    break;  
        case 
    'pictures' :  
        
    $subject 'Pictures';  
    break;  
        case 
    'advertise' :  
        
    $subject 'Advertise';  
    break; 
    }   
    //  check and send to my email account 
    if ($do_name && $do_email && $do_category && $do_comment) {  
        if(
    mail($to,$subject,$message,"From: $email\n")) {  
    // succesful? redirect  
        
    header("Location: index1.php");  
        exit();  
    } else {  
        echo 
    "There was a problem sending the mail. Please check that you filled in the form correctly.";  
        }  
    }  
    }
    ?>
    Celebrate Liberty, Freedom, and Rights at The Constitutionalist.

  10. #10
    SitePoint Wizard
    Join Date
    Dec 2005
    Posts
    1,711
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok so heres my page so far:

    HTML:
    HTML Code:
    <?php include ('process.php'); ?>
    	
    	<form name="contact" method="post" action="<?php $_POST['PHP-SELF'];?>">
    	  <h1><input name="name" type="text" id="name"> Name</h1>
    	  <p>&nbsp; </p>
    	  <h1><input name="email" type="text" id="email">Email</h1>
    	  <p>&nbsp;</p>
    	  <p>
    	    <select name="category" id="category">
    	      <option>Please Select</option>
    	      <option value="enquires">Enquries</option>
    	      <option value="clubs">Clubs</option>
    	      <option value="pictures">Pictures</option>
    	      <option value="advertise">Advertise</option>
    	      <option value="other">Other</option>
    	      </select>
    	</p>
    	  <p>&nbsp;</p>
    	  <p><textarea name="comment" id="comment"></textarea></p>
    	  <p>&nbsp;</p>
    	  <p><input type="submit" name="submit" value="submit"></p>
    
    	</form>
    How will i set this up now with the code above in my process.php?

    I no it's a big job but thanks in advance.

  11. #11
    SitePoint Wizard
    Join Date
    Dec 2005
    Posts
    1,711
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    sorry i posted as you submitted, so you've added :

    PHP Code:
    if (isset($_POST['submit'])) //check for name of your submit button 

    thanks my html is above aswell

  12. #12
    SitePoint Wizard
    Join Date
    Dec 2005
    Posts
    1,711
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok were getting some were, its in the right place but the error messages are still there when i load the page and I dont think it reconzies the category aswell

    thanks

  13. #13
    SitePoint Addict miggl's Avatar
    Join Date
    Feb 2007
    Location
    Los Angeles, CA
    Posts
    286
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try this:
    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 == '') {$s_selected " selected='selected'";}
    else 
    $s_selected 'enquires';}
    ?>
              <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>
    Celebrate Liberty, Freedom, and Rights at The Constitutionalist.

  14. #14
    SitePoint Wizard
    Join Date
    Dec 2005
    Posts
    1,711
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Parse error: syntax error, unexpected '}' in /home/public_html/contact.php on line 63

    PHP Code:
    <?php 
    if ($category == '') {$s_selected " selected='selected'";} 
    else 
    $s_selected 'enquires';} //line 58
    ?>
    Getting hard core now - thanks very much!

  15. #15
    SitePoint Addict miggl's Avatar
    Join Date
    Feb 2007
    Location
    Los Angeles, CA
    Posts
    286
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry about that, should be:
    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 == '') {$s_selected " selected='selected'";} 
    else {
    $s_selected 'enquires';} 
    ?> 
              <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>
    Celebrate Liberty, Freedom, and Rights at The Constitutionalist.

  16. #16
    SitePoint Wizard
    Join Date
    Dec 2005
    Posts
    1,711
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks no errors now but still the same the error messages are there when i load the page??

    This is a html aswell not xhtml

    thanks again

  17. #17
    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 the code of the page after you load it (view source)? Thanks!
    Celebrate Liberty, Freedom, and Rights at The Constitutionalist.

  18. #18
    SitePoint Wizard
    Join Date
    Dec 2005
    Posts
    1,711
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    HTML Code:
    <div id="rightlist">
    
    	<p>You forgot to enter your name!</p><p>Not a valid email address</p>
    <p>Please select a category!</p><p>You forgot your comments!</p> 
          
    	<form name="contact" method="post" action=""> 
    	<h1><input name="name" type="text" id="name" value=""> Name</1> 
    	<p>&nbsp; </p> 
    	<h1><input name="email" type="text" id="email" value="">Email</h1> 
    	<p>&nbsp;</p> 
    	<p><select name="category" id="category"> 
    		<option>Please Select</option>
    
    		
    	 
    		<option value="enquires" selected='selected'>Enquries</option> 
    	 
    		<option value="clubs">Clubs</option> 
    	 
    		<option value="pictures">Pictures</option> 
    	 
    		<option value="advertise">Advertise</option> 
    	 
    		<option value="other">Other</option> 
    	</select> 
        </p> 
          <p>&nbsp;</p> 
          <p><textarea name="comment" id="comment"></textarea></p> 
          <p>&nbsp;</p> 
          <p><input type="submit" name="submit" value="Submit"></p> 
    
        </form> 
    	
    	<h1><br>
    
    	</h1>
    	</div>

  19. #19
    SitePoint Addict miggl's Avatar
    Join Date
    Feb 2007
    Location
    Los Angeles, CA
    Posts
    286
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you close your browser and then open a new one and go to the page, does it still show the message? I'm thinking that you might be refreshing (and this possibly reposting) the page, which would be the same as clicking the submit button again and again.
    Celebrate Liberty, Freedom, and Rights at The Constitutionalist.

  20. #20
    SitePoint Wizard
    Join Date
    Dec 2005
    Posts
    1,711
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    iam viewing it in 2 diffrent browsers still the same miggl??

    thanks for your time again

    any solutions?

  21. #21
    SitePoint Wizard
    Join Date
    Dec 2005
    Posts
    1,711
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if it helps when i submit the form the category error disapears but still leaves the other three

  22. #22
    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 following for process.php, I reworked it a bit. Check if that works for you:
    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 stripslashes($_POST['name']);}
            else {
    $s_error_message .= '<p>You forgot to enter your name!</p>';}
            if (isset(
    $_POST['email']))
            {
                if(
    eregi("^[[:alnum:]][a-z0-9_.-]*@[a-z0-9.-]+\.[a-z]{2,4}$"$_POST['email'])) {$email $_POST['email'];}
                else {
    $s_error_message .= "<p>Not a valid email address</p>";}
            }
            else {
    $s_error_message .= "<p>You forgot your email address!</p>";}
            if (isset(
    $_POST['category'])) {$category $_POST['category'];}
            else {
    $s_error_message .= '<p>Please select a category!</p>';}
            if (isset(
    $_POST['comment'])) {$comments stripslashes($_POST['comment']);}
            else {
    $s_error_message .= '<p>You forgot your comments!</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.

  23. #23
    SitePoint Wizard
    Join Date
    Dec 2005
    Posts
    1,711
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Parse error: syntax error, unexpected ';' in /home/public_html/process.php on line 37

    PHP Code:
    header('Location: index1.php');
                    exit();
                }
                else {print(
    'There was a problem sending the mail. Please check that you filled in the form correctly.';} // line 37
        
    }  
    }
    ?> 
    cheers

  24. #24
    SitePoint Addict miggl's Avatar
    Join Date
    Feb 2007
    Location
    Los Angeles, CA
    Posts
    286
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Bah! Another one of those pesky typos!
    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 stripslashes($_POST['name']);}
            else {
    $s_error_message .= '<p>You forgot to enter your name!</p>';}
            if (isset(
    $_POST['email']))
            {
                if(
    eregi("^[[:alnum:]][a-z0-9_.-]*@[a-z0-9.-]+\.[a-z]{2,4}$"$_POST['email'])) {$email $_POST['email'];}
                else {
    $s_error_message .= "<p>Not a valid email address</p>";}
            }
            else {
    $s_error_message .= "<p>You forgot your email address!</p>";}
            if (isset(
    $_POST['category'])) {$category $_POST['category'];}
            else {
    $s_error_message .= '<p>Please select a category!</p>';}
            if (isset(
    $_POST['comment'])) {$comments stripslashes($_POST['comment']);}
            else {
    $s_error_message .= '<p>You forgot your comments!</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.

  25. #25
    SitePoint Wizard
    Join Date
    Dec 2005
    Posts
    1,711
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Parse error: syntax error, unexpected $end in /home/public_html/process.php on line 42

    line 42 is the end of the code - ?>

    weve got to get this - ?? thanks


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
  •