garry27 Posted October 16, 2008 Share Posted October 16, 2008 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? ??? Quote Link to comment https://forums.phpfreaks.com/topic/128754-solved-bizzarre-issue-with-form-post/ Share on other sites More sharing options...
KevinM1 Posted October 16, 2008 Share Posted October 16, 2008 1. This has nothing to do with OOP. 2. Since this seems to be a general PHP issue, you should show us your PHP code. Two lines of HTML doesn't help anyone in attempting to diagnose the problem. 3. There is no 3. Quote Link to comment https://forums.phpfreaks.com/topic/128754-solved-bizzarre-issue-with-form-post/#findComment-667339 Share on other sites More sharing options...
garry27 Posted October 16, 2008 Author Share Posted October 16, 2008 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(); ?> Quote Link to comment https://forums.phpfreaks.com/topic/128754-solved-bizzarre-issue-with-form-post/#findComment-667371 Share on other sites More sharing options...
garry27 Posted October 16, 2008 Author Share Posted October 16, 2008 I've also commented out the attributes which are called inside the input elements- like I said, it's really stripped down. Quote Link to comment https://forums.phpfreaks.com/topic/128754-solved-bizzarre-issue-with-form-post/#findComment-667374 Share on other sites More sharing options...
KevinM1 Posted October 16, 2008 Share Posted October 16, 2008 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? Quote Link to comment https://forums.phpfreaks.com/topic/128754-solved-bizzarre-issue-with-form-post/#findComment-667470 Share on other sites More sharing options...
garry27 Posted October 16, 2008 Author Share Posted October 16, 2008 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 Quote Link to comment https://forums.phpfreaks.com/topic/128754-solved-bizzarre-issue-with-form-post/#findComment-667540 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.