List out different arguments in PHP header function?
Answers were Sorted based on User's Feedback
Answer / sivasankar.p
header —
Send a raw HTTP header
syntax-
void header ( string $string [, bool $replace [,
int $http_response_code ]] )
ex:
<?php
// We'll be outputting a PDF
header('Content-type: application/pdf');
// It will be called downloaded.pdf
header('Content-Disposition: attachment;
filename="downloaded.pdf"');
// The PDF source is in original.pdf
readfile('original.pdf');
?>
| Is This Answer Correct ? | 9 Yes | 3 No |
Answer / rajesh bhujbal
Different arguments that we can pass in header() are:
1.Location:
2.HTTP/
3.Status:
4.WWW-Authenticate:
5.Content-type:
6.Content-Disposition:
7.Cache-Control:
8.Expires:
9.Pragma:
10.Expires:
| Is This Answer Correct ? | 6 Yes | 0 No |
Answer / rakesh kumar nautiyal
<?php
if ((isset($gender)) && ($gender == 'female')) {
header("Location:
http://allinterview.com/form/secret.php");
exit;
}
?>
<html><head><title>the inclusive page</title></head>
<body>
<h3>welcome!</h3>
Even men welcome to this page!
</body></html>
| Is This Answer Correct ? | 5 Yes | 9 No |
Tell me how can we connect to a mysql database from a php script?
What are the different ways we can retrive the mysql results using php ? Explain each
is that "enumerated array" equal to "numeric array"?
How can we increase the execution time of a PHP script?
12 Answers CyberBeoz, Photon, XTX,
What is php explain?
What are php magic methods/functions?
Do you know what does mvc stand for and what does each component do?
Apart from mail() function to send emails,is there any other functions in PHP to send emails?
Which operator is used to concatenate two strings in PHP?
What is the difference between htmlentities and htmlspecialchars in php?
Why are sessions used?
How to store the uploaded file to the final location?