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

exec() command not functioning in php

jzz
I have the following HTML code, which executes a PHP script.
================================================== ===========================
<!--HTML CODE-->
<html><head><title>Vulneraility Scan</title></head>

<body><form method="POST" action="n2.php">
Host<input name="address" type="text" value="IP Address">
<input type="submit" name="Submit" value="SCAN">
</form></body>
</html>
<!--END OF HTML CODE-->
================================================== ============================
The PHP script is
================================================== ==============================
<?php
$ip = $_POST['address'];
$com2="echo $ip > targets.txt";
exec($com2);

$com3="rm -rf
results.html";
exec($com3);
echo "<br>This May Take Time";
$com4="nessus -q -T html localhost 1241 j1 abcd targets.txt
results.html";
exec($com4);
echo "<br>Finished";

?>
================================================== =========================

I only see "This May Take Time " and "Finished" words on the screen,
the exec() commands do not execute.

Please Help
jZZ

Jul 26 '05 #1
2 1760
jzz wrote:
$com4="nessus -q -T html localhost 1241 j1 abcd targets.txt
results.html";
exec($com4);
echo "<br>Finished";

?>
================================================== =========================

I only see "This May Take Time " and "Finished" words on the screen,
the exec() commands do not execute.


That makes sense, because it's the only stuff you output.
Do you expect to see the output of the exec calls?
Then you should use something like:

exec($com4, $output);
echo $output;

--
http://www.phpforums.nl
Jul 26 '05 #2
jzz
Then what command do i use to see the output???

Aug 10 '05 #3

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

Similar topics

3
by: Paolo Scolamacchia | last post by:
Hi everybody, this is my environment : Apache is installed on a Linux server (RedHat9A) and I launch the browser on a PC running WindowsXP to execute php scripts on the Linux server. I would run...
4
by: Andrew Crowe | last post by:
Hi guys, I'm having trouble executing commands using exec() or system() that need to write files. I've set the permissions on CMD.EXE but I can't use exec() to write any files, even if the...
6
by: Hal Vaughan | last post by:
I have a script used to find and run Java on a Windows system.  It worked fine on original tests (on a Windows XP system).  It's now running on a Windows 2000 (sp3) system, and it won't work -- the...
0
by: Jan | last post by:
I store sql-commands in a database table. In the first step I get the sql command out of the database table with embedded sql. In the second step I try to execute the command, which i got from the...
17
by: comp.lang.tcl | last post by:
The TCL command I am using will do a command-line action on a PHP script: set cannotRunPHP I have to do it this way as both the TCL script and the PHP script run as CLI. However, "info.php"...
8
by: R. Bernstein | last post by:
In doing the extension to the python debugger which I have here: http://sourceforge.net/project/showfiles.php?group_id=61395&package_id=175827 I came across one little thing that it would be nice...
4
by: Shailesh Humbad | last post by:
I was trying to exec a background process on XP using PHP CLI, but could not get it to work. Suppose the command I want to spawn off is "cmd". On *nix, it is as easy as putting ampersand "&" at...
21
by: comp.lang.tcl | last post by:
set php {<? print_r("Hello World"); ?>} puts $php; # PRINTS OUT <? print_r("Hello World"); ?> puts When I try this within TCL I get the following error:
7
by: JahMic | last post by:
I'm having a problem with exec on my hosting server. Unfortunately, the hosting support seems to be anything but helpful. The following works fine on my localhost: <?php $MaskData =...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.