473,397 Members | 1,985 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

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 1566
arggg
91
Anyone??? I updated my original post with code.
Mar 25 '08 #2

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

Similar topics

14
by: Recoura Tim | last post by:
Hello, I'm writing a shoppingcart program in PHP. The website of our suplliers webpage i written in ASP. He has very detailed info about his products, that I want to include in my PHP page, I...
1
by: james | last post by:
I can't seem to access sessions variables from include files. If I use the include file like this it I cant get the session variables: <?php session_start(); require("url/to/inc/file.php");...
4
by: Will | last post by:
I know I am searching using the wrong words because I can't seem to find a simple answer on this. Here's what I want to do. helper.inc <!php var $fileName2; class helper { function...
22
by: Martin MOKREJ© | last post by:
Hi, I'm looking for some easy way to do something like include in c or PHP. Imagine I would like to have: cat somefile.py a = 222 b = 111 c = 9
4
by: julian maisano | last post by:
What i want to do is the following: include (pagecalled.php?argument1=x&argument2=x ..... ); (I need to place the page somewhere inside another one, as if it had been called from another link)...
4
by: Mark | last post by:
I am setting up an asp.net site using the Ektron CMS. Every page in the site uses the same basic template, with the look of the page changing via CSS and an id on the body. The id is shared by all...
3
by: Todd | last post by:
Hello...I'm trying to include querystring variables in a #include but it's not working this works: <!--#include file="calendar/calendar.asp--> this does not: <!--#include
3
by: Dave Kelly | last post by:
From a html page menu I need to pass 2 variables. <a href="signup.php?var1=list-PINSS.php&var2=blurb-PINSS.php"><h3>Padre Island National Sea Shore</h3></a><br> These go to a php web page...
6
by: j.woodcock | last post by:
is there a way of having a file that's name is a variable (eg dependant on the user name) act like a include. i know that you cant define the file for an include asp tag using a variable and that...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.