我目前有一个项目,是基于批准和拒绝的文件,已被更改或需要上传到我的数据库.我有一个代码设置,每当一个文件被创建或需要修改时,将发送一封邮箱.这封邮箱将有文档的明细以及一个链接,将用户定向到他们需要访问的页面.目前,该链接返回404未找到错误.我的代码设置如下:
$email_subject = "A Previous Document is Pending Removal";
$heading = "<a href='http://rfp.wabtec.com/production/apps/documentControl'>$dept_string-$ctrl_string-$num: $name $dev</a>";
$body_one = "A document is pending removal and will need your approval. Below is a brief description of the document:";
$body_two = "Click on the link below to be redirected to the page. Once you have logged in, check under the tab labeled <b>Pending Action</b>. Click on the name and you will be able to approve or deny the document.";
//Email
$email_to = $email;
//define the headers we want passed. Note that they are separated with \r\n
$email_headers = "MIME-Version: 1.0\r\n" .
"Content-type: text/html; charset=iso-8859-1\r\n" .
"From: RFPC Document System<noreply@wabtec.com>\r\n" .
"Reply-To: RFPC Document System<noreply@wabtec.com>";
//Body
$email_body = "<style type='text/css'>" .
"BODY {FONT-FAMILY: arial,helvetica,sans-serif,verdana; FONT-SIZE: 14px;}" .
".heading {FONT-FAMILY: arial,helvetica,sans-serif,verdana; FONT-SIZE: 16px; FONT-WEIGHT: bold;}" .
"th {text-align: left; padding-right: 10px;padding-bottom:5px}" .
"td {padding-bottom:5px}" .
"</style>" .
"<div>Hello</div><br />" .
"<div>$body_one</div><br />" .
"<table>" .
"<tr><th>File:</th><td><a href='http://rfp.wabtec.com/docs/documentSystem/docs/$file'>$name</a></td></tr>" .
"<tr><th>Type:</th><td>$type</td></tr>" .
"<tr><th>Description:</th><td>$description</td></tr>" .
"</table><br />" .
"<div>$body_two</div><br />" .
"<div class='heading'>$heading</div><br />";
$email_send = @mail( $email_to, $email_subject, $email_body, $email_headers );
无论何时点击链接,这都是我的URL:
http://rfp.wabtec.com/production/apps/documen%20tControl个
我知道‘%20’是表示空格的HTMLURL编码,但正如您在上面看到的.我的URL中没有空格,我想知道为什么我的代码将它放在URL中,而我在那里根本没有空格