How do i echo this?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
djcritch
Forum Newbie
Posts: 11
Joined: Thu Mar 20, 2008 5:55 am

How do i echo this?

Post by djcritch »

Hi i have set up a php session using GET but having a bit of trouble calling the information, can anyone see what im doing wrong?

heres what ive got:

Code: Select all

 
session_start();
foreach ($_GET as $key => $value)
 {
  $_SESSION[$key] = $value;
 }
 
and to call it i have:

Code: Select all

<?php $_SESSION['url'] echo $_value; ?>

but im guessing this is incorrect ?
User avatar
Mini
Forum Newbie
Posts: 23
Joined: Mon Dec 04, 2006 4:39 am
Location: Netherlands

Re: How do i echo this?

Post by Mini »

Code: Select all

 
session_start();
foreach ($_GET as $key => $value)
{
$_SESSION[$key] = $value;
}
 
echo $_SESSION['url'];
 
hope that helps you. 8)
djcritch
Forum Newbie
Posts: 11
Joined: Thu Mar 20, 2008 5:55 am

Re: How do i echo this?

Post by djcritch »

ok i have it working now but im getting this warning ? ? ?

any idea how i can get rid of it ? ? ?

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent
User avatar
Mini
Forum Newbie
Posts: 23
Joined: Mon Dec 04, 2006 4:39 am
Location: Netherlands

Re: How do i echo this?

Post by Mini »

The session_start(); should go on top of the page, before you have any output (echo/html).

:D
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: How do i echo this?

Post by John Cartwright »

djcritch wrote:ok i have it working now but im getting this warning ? ? ?

any idea how i can get rid of it ? ? ?

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent
If Mini's suggestion doesn't work, try searching the error. We have discussed this error message hundreds of times.
Post Reply