List out different arguments in PHP header function?

Answers were Sorted based on User's Feedback



List out different arguments in PHP header function?..

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

List out different arguments in PHP header function?..

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

List out different arguments in PHP header function?..

Answer / saju

header ('Refresh: 1; URL='.$_SERVER['PHP_SELF']);

Is This Answer Correct ?    0 Yes 1 No

List out different arguments in PHP header function?..

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

Post New Answer

More PHP Interview Questions

What is difference between print_r and echo in php?

0 Answers  


What is the use of die in php?

0 Answers  


How to parse configuration file in php?

0 Answers  


How do you match the character ^ at the beginning of the string? - ^^

1 Answers  


Is php strongly typed?

0 Answers  






how to select single row from table and insert into same table as a new record by using a single sql query.

2 Answers  


Tell me what are magic methods?

0 Answers  


Is php case sensitive?

0 Answers  


What is super () python?

0 Answers  


Is age interval or ordinal data?

0 Answers  


How long is a php session valid?

0 Answers  


What is framework in php for beginners?

0 Answers  


Categories