undefined variable

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • chin Tang
    New Member
    • Apr 2011
    • 4

    undefined variable

    Anyone help me check my coding.The error will be undefined variable of "$ptitle".

    Code:
    <textarea name="ptitle" cols="100" rows="3" class="txt_blacknormal" id="ptitle"><?php echo $ptitle; ?></textarea>
    //undefined variable $msg.
    Code:
    <?php
     if ($msg != '')
       {
        echo "<tr>
         <td class=\"text9\"><div align=\"right\"><span class=\"txt_redrequired\">&nbsp;</span>&nbsp;</div></td>
                          <td height=\"26\" colspan=\"3\" class=\"text8\"><div align=\"left\"><em class=\"txt_redrequired\">$msg</em></div></td>
                          </tr>
    	<tr><td>&nbsp;</td>
            </tr>";	
        }?>
  • agam
    New Member
    • Jan 2011
    • 21

    #2
    Where is $ptitle defined?
    Naming the form atribute via html wont connect it to php because it dosn't work like that(php is erver side and html client side).
    Could you post the full code?
    I cant analyze the problem without it.

    Comment

    • Richard Ryan
      New Member
      • Apr 2011
      • 3

      #3
      If this is an html form that posts to itself, you need to be sure to give the following commands before hand:
      Code:
      if (isset($_POST['ptitle'])){
        $ptitle = $_POST['ptitle'];
      {

      Comment

      • chin Tang
        New Member
        • Apr 2011
        • 4

        #4
        thank you for replied me.I settled the problems already.

        Comment

        • agam
          New Member
          • Jan 2011
          • 21

          #5
          Nice work, never hesitate to ask We are here to help.

          Comment

          Working...