Re: Sending a string with $_POST/$_GET
| From: | Burhan Khalid | Date: | Tue, 17 May 2005 13:18:01 +0000 |
| Subject: | Re: Sending a string with $_POST/$_GET | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-215390@lists.php.net to get a copy of this message | ||
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']; ?>