Jump to content

Recommended Posts

I have a very basic form that I have completely stripped out any functionality once the form is submitted, in order to identify the error.

 

The problem I have is If I try to send an input with the input name 'userEmail' or 'userPassword' with a non zero value the page outputs up until the containing div is called and then stops. Like this:

...doctype...head..stylesheets etc.
<body class='body' onload='disableAutoComplete()' >
<div id='container'>  ..then nothing

 

I have no idea why this is happenning and why it is singling out these two name values.

 

When I edit the name of the values in the input elements, the page re-executes as normal.

 

I'm using post but when I try get  the page re-executes as usual.

 

I don't know if it could be the file that is corrupt? A couple of days ago I had to reinstall zend studio eclipse as it failed irreversably while I was using it.

 

When I var_dumped the post global vaiables before I commented out all the serverside functionality, it showed that the values passed ok but still the page displayed incorrectly.

 

Any ideas, please?  ???

 

Link to comment
https://forums.phpfreaks.com/topic/128754-solved-bizzarre-issue-with-form-post/
Share on other sites

Here's the class I use to build the form:

 

  function getForm()
  {
    $action = $_SERVER['PHP_SELF'];
  	$textBoxClass = 'w200';
  	$form =
         "<form action='$action' method='post'>
  	        <input name='memberType_2536' type='hidden' value='musicians'/>
  	        
  	        <div class='inputElem'>
              <input name='username' class='$textBoxClass' value='".$this->postValues['username']."' 
                type='text' maxlength='".$this->FD->maxLens['username']."' />
            </div>	
            
            <div class='inputElem'>
              <input name='userEmail' class='$textBoxClass' value='".$this->postValues['userEmail']."' 
                type='text' maxlength='".$this->FD->maxLens['userEmail']."' />			
        </div>

  	        <div class='inputElem'>
              <input name='stageName' class='$textBoxClass' value='".$this->postValues['stageName']."' 
                type='text' maxlength='".$this->FD->maxLens['stageName']."' />			
            </div> 

  	        <div class='inputElem'>
              <input name='forename'/ class='$textBoxClass' value='".$this->postValues['forename']."' 
                type='text' maxlength='".$this->FD->maxLens['forename']."' >			
        </div>

  	        <div class='inputElem'>
              <input name='surname' class='$textBoxClass' value='".$this->postValues['surname']."' 
                type='text' maxlength='".$this->FD->maxLens['surname']."' />			
        </div>
                   
            <div class='inputElem'>
              <input name='userPassword'  value='' 
                type='text' />			
            </div>
                   
            <div class='inputElem'>
              <input name='userPassword2' class='$textBoxClass' value='".$this->postValues['userPassword2']."' 
                type='text' maxlength='".$this->FD->maxLens['userPassword2']."' />			
            </div>
                   
            <div class='inputElem'>
              <input name='asa' value='Sign-up' type='submit'/>
             </div>

          </form>";   	
    return $form;
  } 

 

Everything else, I've disabled such as the validation class I have- all it does is return so the form details never gets to the register stage.

 

<?php
// error_reporting(0);
  session_start();
  require ('classes/classes.php');  
  
  $FORM = new REGISTRATION_FORM; 
  $PAGE = new PAGE();
  $PAGE->css = array('style_sheet.css','navigation.css', 'date_picker.css');
  $PAGE->javascript = array('common.js');
  //$PAGE->ajax = array('jquery-1.2.1.pack.js','intellisense_ini.js');
  $PAGE->bodyAttr = "class='body' onload='disableAutoComplete()'";  
    
  ##attempt add listing
  if($_POST['memberType_2536'])  {
  //validate
  	$failed = $FORM->validatForm();
    if($failed > 99) 
    { 
      while($msg = current($failed)) {
      	$errorMessages .= "<br/>$msg";
        next($failed);
      }
    }
  }
  

  $PAGE->title = 'blah';
  #main content
  $content = 
     "<h1>blahblahblah</h1>
        <div id='statusBox'>            <!-- needs a space to keep the the div width!!! -->
          \n $errorMessages \n
        </div>
      <!--col 1 start-->
  <div class='w200Col'>
     
      </div>
      
      <!--col 2 start-->
      <div class='w200Col'>"
    .$FORM->getfieldTexts()
 ."</div>
  
 <!--col 3 start  -->
      <div class='w400Col'>" 
    .$FORM->getForm()
      ."</div>";

  $PAGE->content = $content; 	
  $PAGE->display();


?>

So it stops right after the container div's opening tag is rendered?

 

Hmm...how soon is the form displayed after the div is rendered?  Is it the first thing, i.e.:

 

<div>
   <form>
   .
   .
   .
   </form>
</div>

 

or is there more code between the two?

 

Actually, it might also be beneficial to see how that container div is rendered, since everything up to that point works.

 

Also, what kinds of input names work?  Is it everything but userEmail and userPassword?

Hi Nightslyr

 

Yes, the outputted code stops right after the container div's openning tag is rendered

 

There's a fair bit of code between the container div and the opening form tag, such as the header with a login box (it only just occured to me that this almost certainly is what is interfering with it but no- I've removed it and still the same problem. lol), menu nav bars, a page heading.

 

Yes everything works except userEmail and userPassword.

 

Here is how the display method for class PAGE starts off:

  function display()
  {   	
     echo "<!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'/>";

  echo $this->getTitle();
  echo $this->getKeywords();
  echo $this->getCss() . $this->getJavascript() . $this->getAjax();
  echo "</head> 
          <body $this->bodyAttr >\n" 	                    
           ."<div id='container'>\n";
		  
  echo $this->getHeader();	
  echo $this->mainMenu;
  echo "<div id='mainContent'>"
             .$this->subMenu

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.