www.webdeveloper.com
Page 2 of 2 FirstFirst 12
Results 16 to 29 of 29

Thread: [RESOLVED] Form Values Not submitting between pages...

  1. #16
    Join Date
    Jan 2009
    Posts
    3,346
    I'd check the settings mentioned here to make sure POST is being included in the Globals. http://stackoverflow.com/questions/6...ving-post-data

    Also check that the post max setting is included in the config with a setting (default is still 8m I think).

    Failing that, can you post the results from the below?
    PHP Code:
     echo php_info(); 

  2. #17
    Join Date
    Jun 2003
    Posts
    72
    Ok ... this is weird ...

    So, the form works if I comment out one of the unrelated include files....
    Code:
    <?php include '../head.php'; ?>
    But the form does NOT work if the head.php file is included.

    Below is what is in the file head.php (which is pretty basic) ...

    Code:
    <base href="http://www.rapaportlaw.com/newsite/" />
    
    <style type="text/css">
    @font-face {
        font-family: 'TrajanProRegular';
        src: url('trajanpro-regular-webfont.eot');
        src: url('trajanpro-regular-webfont.eot?#iefix') format('embedded-opentype'),
             url('trajanpro-regular-webfont.woff') format('woff'),
             url('trajanpro-regular-webfont.ttf') format('truetype'),
             url('trajanpro-regular-webfont.svg#TrajanProRegular') format('svg');
        font-weight: normal;
        font-style: normal;
    
    }
    </style>
    
    <link rel=StyleSheet href="style.css" type="text/css" />
    
    <style type="text/css">
    <?php
    // Set section menu
    
    if($areasec==1) {
    	echo ".sub2 li, .sub3 li, .sub4 li { display:none; } .sub2, .sub3, .sub4 { padding-top:15px !important; }";
    } elseif ($areasec==2) {
    	echo ".sub1 li, .sub3 li, .sub4 li { display:none; } .sub1, .sub3, .sub4 { padding-top:15px !important; }";
    } elseif ($areasec==3) {
    	echo ".sub1 li, .sub2 li, .sub4 li { display:none; } .sub1, .sub2, .sub4 { padding-top:15px !important; }";
    } elseif ($areasec==4) {
    	echo ".sub1 li, .sub2 li, .sub3 li { display:none; } .sub1, .sub2, .sub3 { padding-top:15px !important; }";
    } 
    ?>
    </style>

  3. #18
    Join Date
    Jan 2009
    Posts
    3,346
    Can you turn on error reporting? It sounds like you might be getting some path issues.
    Put the following at the top of the problematic script:
    PHP Code:
    ini_set('display_errors',1); 
    error_reporting(E_ALL); 

  4. #19
    Join Date
    Jun 2003
    Posts
    72
    When the form is submitted, the output shows...

    Notice: Undefined index: message in /home/content/59/1249312/html/_domains/rapaportlaw.com/newsite/contactform.php on line 50
    messagePOST:

    You must write a message.
    Please go to Contact Page
    Notice: Undefined variable: message in /home/content/59/1249312/html/_domains/rapaportlaw.com/newsite/contactform.php on line 200
    Line 50 is...
    PHP Code:
    echo "messagePOST: ".$_POST['message']."<br /><br />"
    line 200 is ...
    PHP Code:
    echo $message
    The complete code for contactform.php is...

    Code:
    <?php session_start(); ?>
    <?php
    ini_set('display_errors',1); 
    error_reporting(E_ALL); 
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    
    <head>
    
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>Rapaport Law Firm</title>
    
    <?php include 'head.php'; ?>
    
    </head>
    
    <body>
    
    <?php include 'header.php'; ?>
    <div id="title-bar">
    	<div id="title-wrap">
        	<div id="title">
        	  <h1>Contact Us</h1></div>
        </div>
    </div>
    
    <div id="page-wrap">
    
        <div class="content">
        <!-- <h2>Contact Form</h2> -->
        
        <p>
            
    <?php
    echo "messagePOST: ".$_POST['message']."<br /><br />";
    if(isset($_POST['Submitted'])) {   
    	if( $_SESSION['chapcha_code'] == $_POST['chapcha_code'] && !empty($_SESSION['chapcha_code'] ) ) {
    		
    		$youremail = 'test@rapaportlaw.com';
    		$fromsubject = 'Rapaport Law Contact Page';
    		$fname = $_POST['fname'];
    		$mail = $_POST['mail'];
    		$phone = $_POST['phone']; 
    		$message = $_POST['message']; 
    			$to = $youremail; 
    			$mailsubject = 'Rapaport Law Contact Page';
    			$body = $fromsubject.'
    			
    			 Name:  '.$fname.'
    			 Phone Number: '.$phone.'
    			 E-mail: '.$mail.'
    			
    			 Message: 
    			 '.$message.'
    			
    			|---------END MESSAGE----------|'; 
    	
    		echo "Thank you fo your message. Someone will contact you shortly.<br/>Return to our <a href='http://www.rapaportlaw.com/'>Home Page</a>"; 
    		mail($to, $subject, $body);
    		unset($_SESSION['chapcha_code']);
       } else {
    		echo 'Sorry, you have provided an invalid security code<br /><br />';
    		?>
    
         				 <form name="contact_form" method="post" action="contactform.php" onSubmit="return evalid()">
                        
                            <div class="formlabel">Name *</div>
    						<div class="formfield"><input name="fname" type="text" /></div>
                        
                            <div class="formlabel">E-mail *</div>
                            <div class="formfield"><input type="text" name="mail" size="30" /></div>
                        
                            <div class="formlabel">Phone</div>
                            <div class="formfield"><input name="phone" type="text" size="30" onkeypress="return numere(event)" 
                            		onkeyup="return limitarelungime(this, 10)"  /></div>
                        
                            <div class="formlabel">Message *</div>
                            <div class="formfield"><textarea name="message" onkeyup="return limitarelungime(this, 255)"  cols="35" rows="5"></textarea></div>
                        
                            <div class="formlabel">Security Code*</div>
                            <div class="formcode"><input id="chapcha_code" name="chapcha_code" type="text" /></div>
                            <div class="formcodeimg"><img src="security_image.php" border="0" /></div>
                        	<div class="clear"></div>
                            
                            <div class="formlabel">
                            <!-- <input type="reset" name="reset" value="Reset"/> -->
                                <input type="submit" name="Submitted" value="Submit" id="Submitted">
                            </div>
                        
         				 </form>
    
            <?php
       }
    } else { 
    	echo "You must write a message. </br> Please go to <a href='contact/'>Contact Page</a>"; 
    	echo $message;
    }
    ?> 
        </p>
    
    	</div>
    
        
            <div class="side-right">    
            	<?php include 'side-right.php'; ?>
           </div> 
      
        
    </div>
    
    <?php include 'footer.php'; ?>
    
    
    </body>
    
    </html>
    And I get the same error message if I comment out the the head.php page.

  5. #20
    Join Date
    Jan 2009
    Posts
    3,346
    I thought you just said it worked if you commented out the include?

  6. #21
    Join Date
    Jun 2003
    Posts
    72
    Sorry, commented it out on the wrong page this time. Here is what is outputed when I comment out the include for head.php on the contactform.php page..

    messagePOST: 123123 1

    Thank you fo your message. Someone will contact you shortly.
    Return to our Home Page
    Notice: Undefined variable: subject in /home/content/59/6849359/html/_domains/rapaportlaw.com/newsite/contactform.php on line 74
    Line 74 is...
    PHP Code:
        mail($to$subject$body); 
    It works... Odd. But I need this head because it has all the style info and other important stuff.

  7. #22
    Join Date
    Jan 2009
    Posts
    3,346
    I'm trying to see if you get any errors from the included file...

  8. #23
    Join Date
    Jun 2003
    Posts
    72
    The stylesheet is coming up when head.php is included (and the link to the style sheet is inside head.php). So, the file is linked alright.

    No other errors...

  9. #24
    Join Date
    Jan 2009
    Posts
    3,346
    I'm surprised you aren't getting any other errors. There is a variable that would not be initialized before using it in head.php.
    Code:
    $areasec
    The above is not set in your form processor before the include nor is it set in the code you posted before checking to see if it is equal to 1. So either we are not seeing all of the code that is in use or you didn't display all the errors and set error reporting to an appropriate level.

  10. #25
    Join Date
    Jun 2003
    Posts
    72
    I removed the areasec variable from the head, and still not working...

    HTML Code:
    <base href="http://www.rapaportlaw.com/newsite/" />
    
    <style type="text/css">
    @font-face {
        font-family: 'TrajanProRegular';
        src: url('trajanpro-regular-webfont.eot');
        src: url('trajanpro-regular-webfont.eot?#iefix') format('embedded-opentype'),
             url('trajanpro-regular-webfont.woff') format('woff'),
             url('trajanpro-regular-webfont.ttf') format('truetype'),
             url('trajanpro-regular-webfont.svg#TrajanProRegular') format('svg');
        font-weight: normal;
        font-style: normal;
    
    }
    </style>
    
    <link rel=StyleSheet href="style.css" type="text/css" />
    Gets the same error messages and the values are still not being transferred...

    Notice: Undefined index: message in /home/content/59/6849359/html/_domains/rapaportlaw.com/newsite/contactform.php on line 50
    messagePOST:

    You must write a message.
    Please go to Contact Page
    Notice: Undefined variable: message in /home/content/59/6849359/html/_domains/rapaportlaw.com/newsite/contactform.php on line 200

  11. #26
    Join Date
    Jan 2009
    Posts
    3,346
    And you are sure you are only accessing the contactform.php page from submitting the form and not directly?

  12. #27
    Join Date
    Jun 2003
    Posts
    72
    regularpage.php
    ---- include: side_right.php (contains the form)


    ... submission goes right to ....


    contactform.php

  13. #28
    Join Date
    Jun 2003
    Posts
    72
    Was definitely a server issue. Finally got my webhost to check into it (they were reluctant because they kept saying that it was a "programming issue" and they do not support that).

    They upgraded my version of PHP from 5.2 to 5.3.14 ... that seemed to do the trick. It is working now. Thanks for all your help.

  14. #29
    Join Date
    Aug 2012
    Location
    Programming
    Posts
    21
    Your welcome

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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



Recent Articles