Reply to Re: cookies

Your name:

Reply:


Posted by Jerry Stuckle on 05/10/07 13:07

Jon Slaughter wrote:
> "Jerry Stuckle" <jstucklex@attglobal.net> wrote in message
> news:ucGdnTZseYV9nt7bnZ2dnUVZ_t7inZ2d@comcast.com...
>> Jon Slaughter wrote:
>>> "Johnny BeGood" <jbg@jbg.net> wrote in message
>>> news:kAy0i.19511$j7.373298@news.indigo.ie...
>>>> Hi Jon,
>>>>
>>>> I started here - http://www.w3schools.com/php/php_cookies.asp - it gives
>>>> a good idea on how to get started.
>>>>
>>>>
>>> Yeah, I used some of that. But my main issue is that not the basics. Its
>>> that I'm trying to create cookies after page content have been generated.
>>> I have solved the issue but doens't seem that great. Essentially I
>>> redirect to a page that saves the cookies and then that page redirects to
>>> the page I was going to in the first place. I guess I could put the page
>>> in a session variable and use a generalized cookie saver.
>>>
>>> Just seems like its not even close to being the optimal solution.
>>>
>>> Thanks,
>>> Jon
>>>
>>>
>>>
>> Why do you have to do it AFTER page content has been generated?
>>
>> Restructure your page and do it before you generate the content. Or, as
>> Micha indicated, buffer your output and send it later.
>>
>> But I've always been able to send cookies before the page - just sometimes
>> it takes a little work and planning.
>>
>>
>
> I don't understand. Maybe I'm going about it the wrong way.
>
> I am getting user input in a form. The form then calls a php script that
> does all the necessary stuff such as looking up the user in the database or
> whatever.
>
> The problem is, is that every page I use has a template that is a nav bar
> added to it automatically by a central script that is called for every uri
> request.
>
> I cannot control this because of the way it is set up. So what I have to do
> is create a seperate script that is seperate from the centeral script that
> will handle the cookie stuff. Its working fine and I guess thats the way I
> have to do it.
>
> I guess I could modify my code so that I could have certain blocks that are
> executed before the nav bar is added. Wouldn't be to difficult to add but I
> think its ok the way it is. Not the best solution but does the job.
>
> Jon
>
>

If you can't execute code before any output, you'll run into a lot more
problems than just cookies.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация