[PHP] Re: Sending a string with $_POST/$_GET

2005-05-18 Thread Luis
Ross wrote:
I want to write a string to a variable and use $_POST or $_GET to retrieve 
it on another page.

I keep gettting an undefined index errror. Can someone show me how this is 
done?

Do I have to use session_start() ?
or just use cookies:
setcookie('myvarname', 'some value');
and in the other page:
echo $_COOKIE['myvarname'];
will output 'some value'
regards
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: Sending a string with $_POST/$_GET

2005-05-18 Thread Brian V Bonini
On Wed, 2005-05-18 at 11:53, Luis wrote:
 Ross wrote:
  I want to write a string to a variable and use $_POST or $_GET to retrieve 
  it on another page.


$string = 'this is a string';
echo 'a href=another_page.php?val=' . $string . 'Next page/a';


another_page.php:

echo $_GET[val];


-- 

s/:-[(/]/:-)/g


BrianGnuPG - KeyID: 0x04A4F0DC | Key Server: pgp.mit.edu
==
gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC
Key Info: http://gfx-design.com/keys
Linux Registered User #339825 at http://counter.li.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php