Avatar of harryv
harryv

asked on 

button or link that runs exec commands

Hoi,

I have 5 exec comamnds like

<?php
echo exec('/tmp/run/example1.sh');
?>

How can I make a page where you ckick to activate the scripts, I don't have
GD so it can be text based.

Now it runs the scripts when the page is loaded, and that is not what I want.

Jeffeny
Web Languages and StandardsPHP

Avatar of undefined
Last Comment
snoyes_jw
Avatar of snoyes_jw
snoyes_jw
Flag of United States of America image

Separate files:

index.html:
<a href="mypage1.php">click</a>
<a href="mypage2.php">click</a>

mypage1.php:
<?php
echo exec('/tmp/run/example1.sh');
?>

mypage2.php:
<?php
echo exec('/tmp/run/example2.sh');
?>
Avatar of harryv
harryv

ASKER

Hi,

I had that one as last option in mind but what I need is one page whitout opening new pages.
Just klik one a link or (better an image but text is also good) and that the script is running then.

Best regards,

Jeffeny
ASKER CERTIFIED SOLUTION
Avatar of snoyes_jw
snoyes_jw
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
PHP
PHP

PHP is a widely-used server-side scripting language especially suited for web development, powering tens of millions of sites from Facebook to personal WordPress blogs. PHP is often paired with the MySQL relational database, but includes support for most other mainstream databases. By utilizing different Server APIs, PHP can work on many different web servers as a server-side scripting language.

125K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo