Web page load is corrupted

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
RIGOLETO
Forum Commoner
Posts: 37
Joined: Fri Nov 20, 2009 10:13 am

Web page load is corrupted

Post by RIGOLETO »

Hi there,

I am open a PDF file, just using the code below, but it is corrupted, anyone has a solution?



<?php

function pdf($name3){

$mi_pdf = $name3;
header('Content-type: application/pdf');
header('Content-Disposition: attachment; filename="'.$mi_pdf.'"');
readfile($mi_pdf);


}

?>
User avatar
Jonah Bron
DevNet Master
Posts: 2764
Joined: Thu Mar 15, 2007 6:28 pm
Location: Redding, California

Post by Jonah Bron »

Check to make sure the PDF isn't corrupt. And, it doesn't look like you call the function in your code.

Remember to use the tags :wink:
RIGOLETO
Forum Commoner
Posts: 37
Joined: Fri Nov 20, 2009 10:13 am

Re: Web page load is corrupted

Post by RIGOLETO »

I am callin this from other HTML, I mean that there is a HTML that call my Function

Code: Select all

 
 
<?php
 
function pdf($name3){
 
$mi_pdf = $name3;
header('Content-type: application/pdf');
header('Content-Disposition: attachment; filename="'.$mi_pdf.'"');
readfile($mi_pdf);
 
 
}
 
?>
Hi there,
 
I am open a PDF file, just using the code below, but it is corrupted, anyone has a solution? 
 
 
[color=#804080]
<?php
 
function pdf($name3){
 
$mi_pdf = $name3;
header('Content-type: application/pdf');
header('Content-Disposition: attachment; filename="'.$mi_pdf.'"');
readfile($mi_pdf);
 
 
}
 
?>[/color]
 
Post Reply