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;
- PHP is running in safe_mode
- 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.
精彩评论