Re: Sending a string with $_POST/$_GET

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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() ?

This would be ideal.


Have checked the documentation, can't find a really basic example.

Well you didn't post any code, so I can't give you specifics, but a crude example is :


<?php
  session_start();
  $_SESSION['some-string'] = "hello I am a string";
  echo '<a href="page2.php">Read the string</a>';
?>

<?php
  session_start();
  echo 'String is : '.$_SESSION['some-string'];
?>

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux