SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Hybrid View

  1. #1
    SitePoint Member
    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;
    ?>

  2. #2
    My precious!!! astericks's Avatar
    Join Date
    Mar 2002
    Location
    Vancouver, BC
    Posts
    1,971
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    try:
    echo $_post['WebSites'];

    asT.

  3. #3
    SitePoint Member
    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?

  4. #4
    Free your mind Toly's Avatar
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •