html table in php code

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • niths
    New Member
    • Mar 2010
    • 18

    html table in php code

    hello,
    i need html table to be inserted in php code..i tried this but i am getting some problem with it so can anyone help me..
    Thank u..

    My actual code is this
    Code:
    $messageproper ="\n\n" .
    		"Name: " .
    		ucwords($_POST['name']) .
    		"\n" .
    		"Email: " .
    		ucwords($email) .
    		"\n" .
    		"Message: " .
    		$_POST['message'] .
    		"\n" .
    		"\n\n" ;
    i tried and i need some thing like this..but i am not getting... is there any error in this.. please suggest me..
    Code:
     $messageproper = "<table bgcolor= "."gray ".">
                       <tr>
                          <td>Name : </td>
                          <td>Email :</td>
                          <td>Message :</td>
                       </tr>
                       <tr>
                          <td>".ucwords($_POST['name'])."</td>
                          <td>".ucwords($email)."</td>
                          <td>".$_POST['message']."</td>
                       </tr>
                     </table>";
  • Mayur2007
    New Member
    • Aug 2007
    • 67

    #2
    Hello,

    See below example, it might be helpful.

    Code:
    $message ='<table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td>Name:</td>
    	<td>'.$name.'</td>
      </tr>
      <tr>
        <td>Email:</td>
    	<td>'.$email.'</td>
      </tr>
      <tr>
        <td>Address:</td>
    	<td>'.$address.'</td>
      </tr>
      <tr>
        <td>Comment:</td>
    	<td>'.$comment.'</td>
      </tr>
    </table>';
    
    echo $message;
    Regards,
    Mayur Bhayani

    Comment

    • yusuf ali bozki
      New Member
      • Dec 2010
      • 4

      #3
      you must create array ;)

      Comment

      Working...