Hello
I'm using PHP to build a menu of links based on information stored on
database.
There is a table with two fields. One regards the name of the
application (Appname) and the other one the corresponding link (lnk).
My PHP code looks like:
<?php
…
while (odbc_fetch_row ($rs))
{
$app=odbc_resul t($rs,"Appname" );
$lnk=odbc_resul t($rs,"lnk");
echo "<li><a href='$lnk'>$ap p</a></li>";
}
…
?>
The problem is that $lnk can simply be either a web link or a
reference to an application (.exe), which is server side. In that
case, $lnk is something like:
"C:\Program Files\Common Files\Microsoft
shared\AccessRu ntime\Office10\ MSACCESS.EXE" /Runtime
"\\PTmacc\wmrep orts\Macc\Macc. mde" /cmd server=PTmacc, database=macc4
When $lnk is a web link, the application works as I want, but if not,
the application isn't executed. The ‘path' is assumed as a web link
and the browser tries to open it.
Does any PHP function that allows opening applications from a normal
link. I know exec() function but I really don't know if it works as I
wish. Besides I think it's not possible to make something like:
<?php
…
echo "<li><a href='exec('$ln k')'>$app</a></li>";
…
?>
Does anybody who can help me please?
Thanks.
Regards,
Miguel
I'm using PHP to build a menu of links based on information stored on
database.
There is a table with two fields. One regards the name of the
application (Appname) and the other one the corresponding link (lnk).
My PHP code looks like:
<?php
…
while (odbc_fetch_row ($rs))
{
$app=odbc_resul t($rs,"Appname" );
$lnk=odbc_resul t($rs,"lnk");
echo "<li><a href='$lnk'>$ap p</a></li>";
}
…
?>
The problem is that $lnk can simply be either a web link or a
reference to an application (.exe), which is server side. In that
case, $lnk is something like:
"C:\Program Files\Common Files\Microsoft
shared\AccessRu ntime\Office10\ MSACCESS.EXE" /Runtime
"\\PTmacc\wmrep orts\Macc\Macc. mde" /cmd server=PTmacc, database=macc4
When $lnk is a web link, the application works as I want, but if not,
the application isn't executed. The ‘path' is assumed as a web link
and the browser tries to open it.
Does any PHP function that allows opening applications from a normal
link. I know exec() function but I really don't know if it works as I
wish. Besides I think it's not possible to make something like:
<?php
…
echo "<li><a href='exec('$ln k')'>$app</a></li>";
…
?>
Does anybody who can help me please?
Thanks.
Regards,
Miguel
Comment