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

html table in php code

P: 18
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
Expand|Select|Wrap|Line Numbers
  1. $messageproper ="\n\n" .
  2.         "Name: " .
  3.         ucwords($_POST['name']) .
  4.         "\n" .
  5.         "Email: " .
  6.         ucwords($email) .
  7.         "\n" .
  8.         "Message: " .
  9.         $_POST['message'] .
  10.         "\n" .
  11.         "\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..
Expand|Select|Wrap|Line Numbers
  1.  $messageproper = "<table bgcolor= "."gray ".">
  2.                    <tr>
  3.                       <td>Name : </td>
  4.                       <td>Email :</td>
  5.                       <td>Message :</td>
  6.                    </tr>
  7.                    <tr>
  8.                       <td>".ucwords($_POST['name'])."</td>
  9.                       <td>".ucwords($email)."</td>
  10.                       <td>".$_POST['message']."</td>
  11.                    </tr>
  12.                  </table>";
Dec 3 '10 #1
Share this Question
Share on Google+
2 Replies


P: 67
Hello,

See below example, it might be helpful.

Expand|Select|Wrap|Line Numbers
  1. $message ='<table width="100%" border="0" cellspacing="0" cellpadding="0">
  2.   <tr>
  3.     <td>Name:</td>
  4.     <td>'.$name.'</td>
  5.   </tr>
  6.   <tr>
  7.     <td>Email:</td>
  8.     <td>'.$email.'</td>
  9.   </tr>
  10.   <tr>
  11.     <td>Address:</td>
  12.     <td>'.$address.'</td>
  13.   </tr>
  14.   <tr>
  15.     <td>Comment:</td>
  16.     <td>'.$comment.'</td>
  17.   </tr>
  18. </table>';
  19.  
  20. echo $message;
  21.  
Regards,
Mayur Bhayani
Dec 3 '10 #2

P: 4
you must create array ;)
Dec 3 '10 #3

Post your reply

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