开发者

shell_exec phpfile

开发者 https://www.devze.com 2023-01-18 11:20 出处:网络
I currently use this code: if(isset($_POST[\'url\']) && isset($_POST[\'trefw开发者_开发百科oorden\']) )

I currently use this code:

if(isset($_POST['url']) && isset($_POST['trefw开发者_开发百科oorden']) )
{
  mysql_connect('localhost', 'crawler', 'whathasbeenseencannotbeunseen');
  mysql_select_db("crawler");
  mysql_query("INSERT INTO jobs (jobID, url, trefwoorden) VALUES ('', '".$_POST['url']."', '".$_POST['trefwoorden']."')");
  $output = shell_exec("./content.php " .mysql_insert_id());
  echo $output;

}

In my content.php I have the following code:

#!/usr/bin/php
<?php
echo 'HET WERKT';
?>

Now I want to see if my shell_exec actually works by filling in the form and submitting it: but it doesn't echo anything at all.

Did I write wrong code?


Try this. This may help you.

shell_exec('usr/local/bin/php -l content.php'. mysql_insert_id())

or

shell_exec('usr/local/bin/php -content.php'. mysql_insert_id())

All the best.

Thanks,

Kanji


.. Maybe this will work for you:

shell_exec('php -l content.php'. mysql_insert_id())

Or;

  1. PHP is running in safe_mode
  2. Apache does not have the permissions to execute the script


Why do you invoke a PHP file and not including it?

Besides, I agree with Chouchenos because this line of code:

shell_exec('php -l content.php'. mysql_insert_id())

will execute like this "php -l content.php132" if mysql_insert_id() returns the id 132.

This might be a problem because content.php132 might not be existant.

0

精彩评论

暂无评论...
验证码 换一张
取 消