Home
> Uncategorized > Read Web.Config from PHP
Read Web.Config from PHP
Here is some code to read a setting from an ASP.NET web.config file using PHP
<?php
try
{
function GetSetting($key)
{
$sxe = simplexml_load_file("C:Inetpubwwwrootweb.config");
foreach($sxe->xpath(‘/configuration/appSettings/add’) as $item) {
if ($item[‘key’] ==$key) return $item[‘value’];
}
}
echo GetSetting(‘sqlclient’);
}
catch(Exception $e)
{
echo ‘Message: ‘ .$e->getMessage();
}
?>
Categories: Uncategorized
Hi,
i m new in php so i have set up my site in codeignetor based on windows server. and also set .httaccess file for the removing index.php from url but unfortunetally it is not work for this.
I have facing more issues on that problem so let me knowde about that how can i solve this issue. if u find any code please let me knowde.
thanks
LikeLike