469,645 Members | 1,143 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,645 developers. It's quick & easy.

Include HTML with variables

91
I have an external html that is a form. the Values of the form elements have <?= $results['Name'] ?> type information however with file_get_contents in the main php file that then stores the contents to a variable so it can return ALL the data is not completeing the variable processing of the HTML FILE.

For example the values that have $results in them are just displaying $results instead of the actual database information.
Does anyone know of another way to import a false parse the php variables in the external file then set it as a variable ($content) then return $content?
the function is.
Expand|Select|Wrap|Line Numbers
  1.     function editUser()
  2.     {
  3.         global $db, $error,$func,$login;
  4.  
  5.         $sql = "SELECT * FROM users INNER JOIN tsms WHERE id='".$_REQUEST[2]."' AND tsms.uid=tid";
  6.         $sql = $db->query($sql);
  7.         if ($results = $db->fetchArray($sql))
  8.         {
  9.             $content = file_get_contents('./includes/editform.html');
  10.         }
  11.         else 
  12.         {
  13.             $error->addError("INVALID USER","CANNOT FIND USERID ".$_REQUEST[2]);
  14.         }
  15.         return $content;
  16.     }
and html
Expand|Select|Wrap|Line Numbers
  1. <form>
  2. <table class=\"EditForm\"><thead>User Details:</thead>
  3. <tbody>
  4. <tr><td>Name:</td>
  5. <td><input type=\"text\" name=\"name\" maxlength=\"155\" value=\"<?=$results['Full_Name']?>\"></td></tr>
  6. <tr><td>Email:</td>
  7. <td><input type=\"text\" name=\"email\" maxlength=\"155\" value=\"<?=$results['Email'] ?>\"></td></tr>
  8. <tr><td>AD Account:</td>
  9. <td><input type=\"text\" maxlength=\"25\" name=\"ad\"></td></tr>
  10. <tr><td>Receive Alerts:</td>
  11. <td><input type=\"checkbox\" name=\"alerts\" value=\"true\"></td>
  12. </tr>
  13. </tbody>
  14. </table><br>
  15. <table class=\"EditForm\">
  16. <thead>Access Details:</thead>
  17. <tbody>
  18. <tr>
  19. <td><input type=\"checkbox\" name=\"access\" value=\"1\">Login</td>
  20. <td><input type=\"checkbox\" value=\"2\" name=\"access\">View Graphs</td>
  21. <td><input type=\"checkbox\" value=\"4\" name=\"access\">View Other TSMs<br>
  22.     </td></tr><tr><td><input type=\"checkbox\" name=\"access\" value=\"256\">Add User<br>
  23.     </td><td><input type=\"checkbox\" value=\"512\" name=\"access\">Edit User<br>
  24.     </td><td><input type=\"checkbox\" value=\"1024\" name=\"access\">Remove User<br>
  25.     </td></tr><tr><td><input type=\"checkbox\" value=\"2048\" name=\"access\">Edit Config<br>
  26.     </td><td><input type=\"checkbox\" name=\"access\" value=\"4096\">Change Template<br>
  27.     </td><td>
  28.     </td></tr><tr><td colspan=\"3\">Access Level (higher can edit lowers access)<br>
  29.     <input type=\"radio\" class=\"a_level\" name=\"a_level\" value=\"0\">None <input type=\"radio\" class=\"a_level\" name=\"a_level\" value=\"16384\">1 <input type=\"radio\" class=\"a_level\" name=\"a_level\" value=\"32768\">2 <input type=\"radio\" class=\"a_level\" name=\"a_level\" value=\"65536\">3 <input type=\"radio\" class=\"a_level\" name=\"a_level\" value=\"131072\">4 <input type=\"radio\" class=\"a_level\" name=\"a_level\" value=\"262144\">5 <input type=\"radio\" class=\"a_level\" name=\"a_level\" value=\"524288\">System Admin</td></tr>
  30.     </tbody>
  31.     </table>
  32. <br>
  33. <table>
  34.     <thead>TSM Report Properties:</thead>
  35.     <tbody>
  36.         <tr>
  37.             <td>Name:</td>
  38.             <td><input type=\"text\" name=\"tsm_name\"></td>
  39.         </tr>
  40.         <tr>
  41.             <td>Group:</td>
  42.             <td><select name=\"tsm_Group\">
  43.                 <option></option>
  44.             </select></td>
  45.         </tr>
  46.         <tr>
  47.             <td>Include in reports:</td>
  48.             <td><input type=\"checkbox\" name=\"tsm_include\"></td>
  49.         </tr>
  50.     </tbody>
  51. </table>
  52. <br>
  53. <table><tr><td><input type=\"submit\" value=\"Save\" name=\"User_Save\"></td><td><a
  54.     href=\"javascript:LoadData('/user');\">Cancel</a></td></tr></table></form>
  55.  
Mar 25 '08 #1
1 1375
arggg
91
Anyone??? I updated my original post with code.
Mar 25 '08 #2

Post your reply

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

Similar topics

14 posts views Thread by Recoura Tim | last post: by
1 post views Thread by james | last post: by
4 posts views Thread by Will | last post: by
4 posts views Thread by julian maisano | last post: by
4 posts views Thread by Mark | last post: by
3 posts views Thread by Dave Kelly | last post: by
6 posts views Thread by j.woodcock | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.