SitePoint Sponsor |
|
User Tag List
Results 1 to 4 of 4
Thread: Variable passing
-
May 30, 2003, 10:18 #1
- Join Date
- May 2003
- Location
- Indiana
- Posts
- 3
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Variable passing
This simple code does not work on my server. I pulled it directly from "Beginning PHP 4". The server is set up with php 4.2.2. Can anyone tell me why it does echo anything typed into the textarea?
Thank you
textarea.htm
----
<FORM METHOD=POST ACTION="textarea.php">
What is your favorite website?
<TEXTAREA NAME="WebSites" COLS="50" ROWS="5">
http://
</TEXTAREA>
<INPUT TYPE=SUBMIT>
</FORM>
textarea.php
-----
Your favorite web sites are:
<?php
echo $WebSites;
?>
-
May 30, 2003, 10:40 #2
- Join Date
- Mar 2002
- Location
- Vancouver, BC
- Posts
- 1,971
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
try:
echo $_post['WebSites'];
asT.
-
May 30, 2003, 10:56 #3
- Join Date
- May 2003
- Location
- Indiana
- Posts
- 3
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Thanks.... Do I have to use $_POST or $_GET any time I want to pass a variable from page to page or script to script?
-
May 30, 2003, 11:44 #4
- Join Date
- Sep 2001
- Location
- Panama
- Posts
- 2,181
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
If you are going to pass the variable through the url then you should use $_GET
Community Guidelines | Community FAQ
"He that is kind is free, though he is a slave;
he that is evil is a slave, though he be a king." - St. Augustine
Bookmarks