TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Shiva Tiwari
NA
73
5.3k
alert message is not displaying after downlading the file
May 30 2020 2:47 AM
$select =
"SELECT * FROM `success-stories` where id='$id'"
;
$result = $conn->query($select);
$row = $result->fetch_assoc();
$file=$row[
"download_pdf"
];
$file_arr=explode(
"/"
,$file);
$path=$file_arr[0].
"/"
.$file_arr[1].
"/"
.$file_arr[2];
if
(file_exists($path))
{
header(
'Content-Description: File Transfer'
);
header(
'Content-Type: application/pdf'
);
header(
'Content-Disposition: attachment; filename="'
.$path.
'"'
);
header(
'Expires: 0'
);
header(
'Cache-Control: must-revalidate'
);
header(
'Pragma: public'
);
header(
'Content-Length: '
. filesize($path));
ob_clean();
ob_flush();
readfile($path);
exit;
}
echo
"<script>alert('Thank you for downloading story..');</script>"
;
Reply
Answers (
3
)
Storing database of an HTML form
web developer specializing in small to medium business ?