Undefined variable: name

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • fareednn
    New Member
    • Oct 2011
    • 7

    #1

    Undefined variable: name

    path is in which error is shown xampp is installed in d drive in my system
    Undefined variable: name in D:\xampp\htdocs \phonereporting \application\vi ews\scripts\stu dent\StudentFor mVS.phtml on line 59
    error here is tag i cannot retrieve name value from database

    pls help me form name is StudentFormVS.p html how to incluse one field value to this form
    Code:
    <body onload=" document.getElementById('firstname').focus();">
    <form name='studentform' method="post" action="<?php echo $this->element->getAction(); ?>">
    	<div class="adb-1-2std">
    	<!--Content Starts-->
    		<!--Course details-->
    		<div class="ads-5N">
    			<div align="right" class="td ads-5-1">&nbsp;</div>
    				<div align="right" class="td ads-5-2">First Name<span class="Req gen-87">*</span></div>
    				<div align="left" class="ads-5-3"><?php echo $this->element->firstname; ?></div>
    				<div align="right" class="ads-5-4">Surname<span class="Req gen-87">*</span></div>
    				<div align="left" class="ads-5-3"><?php echo $this->element->surname; ?></div>
    				<!-- Start First Name error !-->
                          	<?php $errorfn = $this->element->firstname->getMessages();
                          	      $errorsn = $this->element->surname->getMessages();
    						      if(!($errorfn == null && $errorsn == null)){ ?>	
                          		<div align="left" class="ts-5-7">
    						<?php foreach ($errorfn as $value ) {
                          	      	echo $value;
    							}
    						?>
    			    	</div>
                    <!-- Ends First Name error !-->
    				<!-- Start Surname error !-->
    				    <div align="left" class="ts-5-71" >
                          	<?php $errorsn = $this->element->surname->getMessages();
    							foreach ( $errorsn as $value ) {
    								echo $value;
    							}
    							echo "</div>";
    						 }
    						?>
                    <!-- Ends Surname error !-->
    				<div align="right" class="td ads-5-6">Supervisor Name</div>
    				<div align="left" class="ads-5-7"><?php echo $this->element->supervisorname; ?></div>
    				<div align="right" class="ads-5-8">Employee No</div>
    				<div align="left" class="ads-5-7"><?php echo $this->element->employeeno; ?></div>
      			    <!-- Start Enter Employee No error !-->
    					  <div align="left" class="ts-5-71">
                          	<?php $errors = $this->element->employeeno->getMessages();
    							foreach ( $errors as $value ) {
    								echo $value . '<br/>';
    							}
    						?>
    					  </div>
                    <!-- Ends Enter Employee No error !-->
                    
    				<div class="gen-88"></div>
    			</div>
    					
    			<div class="ads-6Std">
    				<div class="td band">
    				<div class="Add_btn"><input type="button" value="Add" class="button"/ onclick="window.open('/student/pharmacy','','width=790,height=500,left=180,top=140,scrollbars=yes');"></div>
    				<div class="Add_crs2" align="left"><strong >&nbsp;Pharmacy&nbsp;</strong>
    				
    				</div>
     			</div>
    					<div class="Add_Crs1">
    						<?php echo $this->element->branches; ?>
    						<?php [I]$this->element->$name ;[/I]
    						?>
    												 
    					</div>
    				<div class="gen-88">&nbsp;</div>
    			</div>
    			
    			<div class="ads-7">
    				<div class="td band">
    				 <div class="Add_btn"><input type="button" value="Add" class="button"/ onclick="window.open('/student/course','','width=790,height=500,left=180,top=140,scrollbars=yes');"></div>
    				 <div class="Add_crs2" align="left"><strong >&nbsp;Course</strong></div>
    				</div>
    					
    				<div class="Add_Crs">
    				   <div class="Add_Crs1">
    					<?php echo $this->element->courses; ?>
    					</div>					
    			 </div>
    			 </div>
    			 <div ></div>
    			<div class="ads-7">&nbsp;
    			<div class="td band"></div>
    			</div>
    			<div class="ads-8">
    				<div align="center" class="adc-6-1">
    					<input type="submit" value="Save" class="button"/>&nbsp;&nbsp;
    					<input type="reset" value="Reset" class="button"/>&nbsp;&nbsp;
    					<input type="button" name="cancel" value="Cancel" onclick="javascript:window.location='/student/list'" class="button"/>
    				</div>
    				<div class="gen-88"></div>
    			</div>
    			
    		<!--Course details ends-->
    		 <?php echo $this->element->id; ?>
    		 <?php echo $this->element->addedBranch; ?>
    		 <?php echo $this->element->addedCourse; ?>
  • zorgi
    Recognized Expert Contributor
    • Mar 2008
    • 431

    #2
    To me that looks like ZF view script. View scripts are often used if form is to complex for decorators. To add anything to the form you should first locate and edit class that uses this view script and than style it within view script.

    StudentFormVS.p html is not name of the form but view script name.

    Comment

    Working...