|
|
|||||||||
|
|||||||||
|
|||||||||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
hi
im trying to use the setcookie function to set a cookie, but its not setting the cookie, i suspect that it is because i have a header(location: blah blah) function called after that? if this is the problem is there a way around it? thanks... you dudes are cool and thanks for helping me out ![]() |
|
#2
|
|||
|
|||
|
if the setcookie function is used after the header function, that should be fine,
make sure theirs no white space any where, make sure that in your code that the <? or <?php tag, is the first chars, and their isnt any spaces hope that helps |
|
#3
|
|||
|
|||
|
if you have a location header, then that means that the browser isnt displaying a page, and to set cookies, the page must display. even if you set the right cookie headers with setcookie, if you call location, then it's going to change the page location before the cookies are dumped to the browser.
your best bet would be to use setcookie then meta tags to do the redirect to a new page <meta http-equiv="refresh" content="0; url=http://www.devarticles.com"> will refresh the page to devarticles.com after 0 seconds... |
|
#4
|
|||
|
|||
|
or do as mytch says hehe
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > cookies and headers |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|