我试图将这样存储在mysql中的URL显示为php表中的链接
echo "<td><a href=".$row['resume'].">Resume</a></td>";
Run Code Online (Sandbox Code Playgroud)
其中$ row ['resume']使用mysql_fetch_array检索正确的数据
但是文件链接之间的空格会自动截断
例如我的文件名是"这是一个resume.doc"我只在链接中得到"this"
救命.
如果我使用where子句,没有插入数据的where子句,我有一个不插入的查询.这很奇怪,我在WAMP之前从未见过它
$key=substr(md5(rand(0, 1000000)), 0, 5)
;
$key1="INSERT INTO login(key_id) VALUES('$key')
WHERE (email_id = '" . mysql_real_escape_string($_POST['email_id']) . "')"
if(mysql_query($key1))
{
$message = 'User Added!.';
echo "<SCRIPT>
alert('$message');
location='forgotpassword.php';
</SCRIPT>";
}
Run Code Online (Sandbox Code Playgroud)
如果我回显$_POST['email_id']
它确实返回有效结果
我有以下代码来检查(上传的简历和推荐信是否符合所需类型(pdf或doc或docx)和大小(小于400 kb)
//check file extension and size
$resume= ($_FILES['resume']['name']);
$reference= ($_FILES['reference']['name']);
$ext = strrchr($resume, ".");
$ext1 = strrchr($reference, ".");
if (!(($_FILES["resume"]["type"] == "application/doc")
|| ($_FILES["resume"]["type"] == "application/docx")
|| ($_FILES["resume"]["type"] == "application/pdf" ))
&& (($_FILES["reference"]["type"] == "application/doc")
|| ($_FILES["reference"]["type"] == "application/docx")
|| ($_FILES["reference"]["type"] == "application/pdf"))
&& (($ext == ".pdf") || ($ext == ".doc") || ($ext == ".docx"))
&& (($ext1 == ".pdf") || ($ext1 == ".doc") || ($ext1 == ".docx"))
&& ($_FILES["resume"]["size"] < 400000) //accept upto 500 kb
&& ($_FILES["reference"]["size"] < 400000)) …
Run Code Online (Sandbox Code Playgroud) php ×4
mysql ×3
encryption ×1
file-type ×1
file-upload ×1
hyperlink ×1
insert ×1
passwords ×1
sha1 ×1