473,395 Members | 1,791 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,395 software developers and data experts.

Run applications from links

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_result($rs,"Appname");
$lnk=odbc_result($rs,"lnk");
echo "<li><a href='$lnk'>$app</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\AccessRuntime\Office10\MSACCESS.EXE" /Runtime
"\\PTmacc\wmreports\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('$lnk')'>$app</a></li>";

?>

Does anybody who can help me please?

Thanks.
Regards,
Miguel
Jul 17 '05 #1
1 1569
On 19 May 2004 03:09:43 -0700, Miguel <al**********@iol.pt> wrote:
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_result($rs,"Appname");
$lnk=odbc_result($rs,"lnk");
echo "<li><a href='$lnk'>$app</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\AccessRuntime\Office10\MSACCESS.EXE" /Runtime
"\\PTmacc\wmreports\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('$lnk')'>$app</a></li>";
…
?>

Does anybody who can help me please?

Thanks.
Regards,
Miguel


Exec is what you need to use, if you want someone to click a link to
launch a server-side program, make the link pass a value e.g.
http://www.blah.com/blah.php?launch=1
then just pass it through some if statements to pick the program:

if($_GET["launch"] == 1 echo exec(ping www.google.com);

you can't use php functions from the client side, php is *server side* so
you need to get the logic working over on the server.

HTH.

--
If we can't play God, who will?
Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

52
by: Harlan Messinger | last post by:
Can you help me figure out what to do about popups? Sometimes we develop web applications where popups make very good sense for precisely the same reasons they make sense in traditional...
2
by: Frazer | last post by:
hi I would like to know what n tier applications are (i thought i already knew that). I had developed an applicaton that had a DAL layer, BLL layer, database and user interface layer. what...
385
by: Xah Lee | last post by:
Jargons of Info Tech industry (A Love of Jargons) Xah Lee, 2002 Feb People in the computing field like to spur the use of spurious jargons. The less educated they are, the more they like...
2
by: Mike Ridley | last post by:
I have a database of Access tables on the server and ODBC links to legacy systems. This is not too much of a problem as, at least, I have my tables/files in 2 distinct places. Unfortunately as...
6
by: Terry Bell | last post by:
We've had a very large A97 app running fine for the last seven years. I've just converted to SQL Server backend, which is being tested, but meanwhile the JET based version, running under terminal...
3
by: Shikari Shambu | last post by:
Hi All, I have a situation where multiple applications are sharing some pages/ controls. So, I have a separate common project that has the common pages/ controls. My question is how do I...
10
by: Adrian | last post by:
I have a really newbie question... I developed an asp.net application. By default, it was created here: c:\inetpub\wwwroot\ Now, I wanted to create another application, completely independent....
9
by: odwrotnie | last post by:
I want to know what is the ordinary style in creating PHP applications. Should it be one main index.php which will be processing requests from many htmls like in JSP technology? Or what? Thanks...
2
by: Anil | last post by:
I want to download 3-tier/n-tier sample applications/source code for VB.NET. I searched a lot over google but couldnot find suitable links. So kindly suggest any links for the same.
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.