我插入了以下链接来传送电子邮件。链接:public_html/emailer.php 我在public_html 文件夹中有脚本文件,我正在使用以下脚本:它应该在目录中创建一个文件,但它不起作用。
#!/public_html/ -q
<?php
/* Read the message from STDIN */
$fd = fopen("php://stdin", "r");
$email = ""; // This will be the variable holding the data.
while (!feof($fd)) {
$email .= fread($fd, 1024);
}
fclose($fd);
/* Saves the data into a file */
$fdw = fopen("pipemail.txt", "w");
fwrite($fdw, $email);
fclose($fdw);
/* Script End */
?>
这将起作用。
#!/usr/local/bin/php -q
<?php
$fd = fopen("php://stdin","r");
$email = "";
while (!feof($fd)) {
$email .= fread($fd,1024);
}
fclose($fd);
/* Saves the data into a file */
$fdw = fopen("pipemail.txt", "w");
fwrite($fdw, $email);
fclose($fdw);
?>
将\n
代码放入服务器时,请确保它以 unix 行 [ ] 结尾。还要确保脚本有执行权限!
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句