By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,987 Members | 967 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,987 IT Pros & Developers. It's quick & easy.

Undefined variable: name

P: 7
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\views\s cripts\student\StudentFormVS.phtml on line 59
error here is tag i cannot retrieve name value from database

pls help me form name is StudentFormVS.phtml how to incluse one field value to this form
Expand|Select|Wrap|Line Numbers
  1. <body onload=" document.getElementById('firstname').focus();">
  2. <form name='studentform' method="post" action="<?php echo $this->element->getAction(); ?>">
  3.     <div class="adb-1-2std">
  4.     <!--Content Starts-->
  5.         <!--Course details-->
  6.         <div class="ads-5N">
  7.             <div align="right" class="td ads-5-1">&nbsp;</div>
  8.                 <div align="right" class="td ads-5-2">First Name<span class="Req gen-87">*</span></div>
  9.                 <div align="left" class="ads-5-3"><?php echo $this->element->firstname; ?></div>
  10.                 <div align="right" class="ads-5-4">Surname<span class="Req gen-87">*</span></div>
  11.                 <div align="left" class="ads-5-3"><?php echo $this->element->surname; ?></div>
  12.                 <!-- Start First Name error !-->
  13.                           <?php $errorfn = $this->element->firstname->getMessages();
  14.                                 $errorsn = $this->element->surname->getMessages();
  15.                               if(!($errorfn == null && $errorsn == null)){ ?>    
  16.                               <div align="left" class="ts-5-7">
  17.                         <?php foreach ($errorfn as $value ) {
  18.                                     echo $value;
  19.                             }
  20.                         ?>
  21.                     </div>
  22.                 <!-- Ends First Name error !-->
  23.                 <!-- Start Surname error !-->
  24.                     <div align="left" class="ts-5-71" >
  25.                           <?php $errorsn = $this->element->surname->getMessages();
  26.                             foreach ( $errorsn as $value ) {
  27.                                 echo $value;
  28.                             }
  29.                             echo "</div>";
  30.                          }
  31.                         ?>
  32.                 <!-- Ends Surname error !-->
  33.                 <div align="right" class="td ads-5-6">Supervisor Name</div>
  34.                 <div align="left" class="ads-5-7"><?php echo $this->element->supervisorname; ?></div>
  35.                 <div align="right" class="ads-5-8">Employee No</div>
  36.                 <div align="left" class="ads-5-7"><?php echo $this->element->employeeno; ?></div>
  37.                   <!-- Start Enter Employee No error !-->
  38.                       <div align="left" class="ts-5-71">
  39.                           <?php $errors = $this->element->employeeno->getMessages();
  40.                             foreach ( $errors as $value ) {
  41.                                 echo $value . '<br/>';
  42.                             }
  43.                         ?>
  44.                       </div>
  45.                 <!-- Ends Enter Employee No error !-->
  46.  
  47.                 <div class="gen-88"></div>
  48.             </div>
  49.  
  50.             <div class="ads-6Std">
  51.                 <div class="td band">
  52.                 <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>
  53.                 <div class="Add_crs2" align="left"><strong >&nbsp;Pharmacy&nbsp;</strong>
  54.  
  55.                 </div>
  56.              </div>
  57.                     <div class="Add_Crs1">
  58.                         <?php echo $this->element->branches; ?>
  59.                         <?php $this->element->$name ;
  60.                         ?>
  61.  
  62.                     </div>
  63.                 <div class="gen-88">&nbsp;</div>
  64.             </div>
  65.  
  66.             <div class="ads-7">
  67.                 <div class="td band">
  68.                  <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>
  69.                  <div class="Add_crs2" align="left"><strong >&nbsp;Course</strong></div>
  70.                 </div>
  71.  
  72.                 <div class="Add_Crs">
  73.                    <div class="Add_Crs1">
  74.                     <?php echo $this->element->courses; ?>
  75.                     </div>                    
  76.              </div>
  77.              </div>
  78.              <div ></div>
  79.             <div class="ads-7">&nbsp;
  80.             <div class="td band"></div>
  81.             </div>
  82.             <div class="ads-8">
  83.                 <div align="center" class="adc-6-1">
  84.                     <input type="submit" value="Save" class="button"/>&nbsp;&nbsp;
  85.                     <input type="reset" value="Reset" class="button"/>&nbsp;&nbsp;
  86.                     <input type="button" name="cancel" value="Cancel" onclick="javascript:window.location='/student/list'" class="button"/>
  87.                 </div>
  88.                 <div class="gen-88"></div>
  89.             </div>
  90.  
  91.         <!--Course details ends-->
  92.          <?php echo $this->element->id; ?>
  93.          <?php echo $this->element->addedBranch; ?>
  94.          <?php echo $this->element->addedCourse; ?>
  95.  
Nov 10 '11 #1
Share this Question
Share on Google+
1 Reply


zorgi
Expert 100+
P: 431
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.phtml is not name of the form but view script name.
Nov 10 '11 #2

Post your reply

Sign in to post your reply or Sign up for a free account.