shell_exec phpfile
我目前使用此代码:
if(isset($_POST['url']) && isset($_POST['trefwoorden']) )
{
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;
}
在我的 content.php 中,我有以下代码:
#!/usr/bin/php
<?php
echo 'HET WERKT';
?>
现在我想通过填写表单并提交来查看我的 shell_exec 是否实际工作:但它根本不回显任何内容。
我写错代码了吗?
I currently use this code:
if(isset($_POST['url']) && isset($_POST['trefwoorden']) )
{
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
试试这个。这可能对你有帮助。
或
一切顺利。
谢谢,
康吉
Try this. This may help you.
or
All the best.
Thanks,
Kanji
..也许这对你有用:
或者;
.. Maybe this will work for you:
Or;
为什么调用 PHP 文件而不包含它?
此外,我同意Chouchenos的观点,因为这行代码:
如果mysql_insert_id()返回id 132,将像这样执行“php -l content.php132”。
这可能是一个问题,因为
content.php132
可能不存在。Why do you invoke a PHP file and not including it?
Besides, I agree with Chouchenos because this line of code:
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.