Log in

View Full Version : Want to edit a php file from my php site



borris83
04-15-2009, 03:15 PM
I am maintaining a workstation inventory in my office and I store the name of the products in some variables and in an array.. I include the file in lot of pages to display the table header etc...


$office_2003 = "Microsoft Office 2003" ;
$office2007 = "Microsoft Office 2007" ;
$project = "Microsoft Project 2003" ;
$project2007 = "Microsoft Project 2007" ;
$sql2000 = "Microsoft SQL server 2000" ;
$sql2005 = " Microsoft SQL server 2005" ;
$sql2008 = "Microsoft SQL server 2008" ;
$visio = "Visio" ;
$vb6 = "Visual Studio 6.0 Enterprise Ed" ;
$dotnet2003 = "Visual Studio .NET 2003 Ent" ;
$dotnet2005 = "Visual Studio .NET 2005 " ;
$dotnet2008 = "Visual Studio .NET 2008 " ;
$vss = " VSS" ;
$emb_vc = "Embedded VC++ " ;
$adobeflex = "Adobe Flex " ;
$delphi = "Delphi " ;






$products = array("office_2003","office2007","project", "project2007", "sql2000" ,"sql2005", "sql2008", "visio","vb6","dotnet2003", "dotnet2005",
"dotnet2008", "vss", "emb_vc", "adobeflex", "delphi");

If I want to add a new product, I obviously need to edit this page to add one more value in the array as well as one more variable and create one more field in the database..

I want to create a friendly page so that anybody could add a product from the website itself instead of messing with the code..

How can I do that?

forum_amnesiac
04-15-2009, 04:17 PM
Unless I'm misunderstanding what you want couldn't you just have a products table in your database and read this to create your header array.

sysout
04-16-2009, 09:54 AM
yeap, use table on your database to fetch this dynamic data.
fetch it and put it on your array()

borris83
04-16-2009, 11:06 AM
I never thought about doing it this way... I will try that