Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Warning: setcookie() expects parameter 3 to be long, string given in

Status
Not open for further replies.

brogan

Technical User
Oct 7, 2003
44
0
0
GB
Hi,

I'm receiving the following error message:

Warning: setcookie() expects parameter 3 to be long, string given in...........

My code is as follows:

<?php
$getFirstname = $_GET['firstname'];
$getSurname = $_GET['surname'];
$getEmail = $_GET['email'];
$getOffers = $_GET['offers'];
setcookie('entry', $getFirstname, $getSurname, $getPassword, $getOffers);
?>

Many Thanks

Mark
 
If you read the PHP online manual entry for set_cookie(), you will find that, just as the error message says, the third parameter passed to that function must be an integer. I don't know that value you're passing, but guession from the name of the variable, $getSurname, I'd bet it's a string.

Read the online manual entry in the link above. There are four or five example code snippets on that page.

Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top