Recently viewed products

Guido
Sorry for this i will get myself more up to date.
I have moved session_start() to above include still same error
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/stilbaai/public_html/testrecent.php:8)
Thank you

Check for any output before the session_start. It might be an empty line, of even a space before the <?php tag.
Another cause might be the BOM

Hi
I had the PHPH script between the BODY section of HTML ,i removed all of that and left only PHP the error is gone but DATABASE not adding user id /
Thanks

You don’t get any errors at all now?

Then try adding some echo statements to follow the flow of the script. Echo variables you’re interested in, do a print_r of $_SESSION to see what it contains.

I use Dreamweaver where do you set it ?

I don’t use dreamweaver. Can’t you write echo statements like in any editor?

Hi
This is what i got: Array ( [user_id] => 949568 ) it was added to the database field.
If i refresh the page should it then add a new user _id number to the database field ?
I treid but it does not add new user-id.

I don’t know if it should, as in: do you want it to do so?

It doesn’t right now, because you store the id in a session variable, and until you close the browser that session will stay alive, and the ‘user_id’ within it too. And you only assign a new user_id and store it in the database if none exists in the session.

Guido
Thanks i have just got to grips with what happens ,i closed the browser and it works.
You guys are great .i will certainly make use of this forum again.
What i meant by where do i set it ,another person send a reply i must set the BOM
Regards

Thanks.

i will certainly make use of this forum again.

You’re welcome :slight_smile: