<textarea> Tag Is Not Accepting Php Variable - for display, although <Input> tag does accept it

free web hosting
Free Web Hosting, No Ads > CONTRIBUTE > Computers > Programming Languages > PHP Programming

<textarea> Tag Is Not Accepting Php Variable - for display, although <Input> tag does accept it

jlhaslip
I have a single page template which has a Form on it. Logic is to check for a valid Querystring and place the variables accepted from a form back into the form and re-display this form with error or acceptance messages. I'm sure everyone here has done this a million times.

The Form accepts data from a user for First name, Last name, email address, and message-body named 'note_wide' then re-displays the values into the Form, but for some reason, I can't get the value to display into a Textarea.
Sample of the php code is as follows: first the good one:
CODE

<input type="blah" etc... value=" <?php echo &_POST['email'] ?>" />


The one that doesn't work is the same use of the php string being echoed except using the Textarea tag instead: example:
CODE

<textarea type="blah" etc... value=" <?php echo &_POST['note_wide'] ?>" />


The etc includes name, class and other stuff which all appears to work for the 'good' Input tag. Is it only because the php string is being echoed to a <textarea> that this is a problem???

Any ideas about how to fix it?

 

 

 


Reply

slu
The textarea tag does not use a value attribute. Instead you should place you contents between a start and end tag. Like this:

CODE

<textarea type="blah" etc... value="><?php echo &_POST['note_wide'] ?></textarea>



Reply

jlhaslip
Bingo, Thanks for that. Sometimes after staring at the problem for too long, you can't see the simple things. Works excellent now. Thanks again.

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Similar Topics

Keywords : tag, accepting, php, variable, display, tag, accept

  1. Unexpected T_variable...
    Help! (3)
  2. How To Display Images Of A Directory
    (4)
    I am trying to do a simple thing. I want to display all the images of a directory on a single page
    with the checkbox next to each image, so that i can select multi images and i can delete selected
    images. Following few lines of code display the images of a directory.. i need help to put the
    check boxes with each image. and I dont understand how can i select multi images with check box and
    then delete them. I hope someone can help. thanks. CODE <?php $path = "./";
    $dir_handle = @opendir($path) or die("Unable to open folde....
  3. Script Help Required: Undefined Variable
    A fault I cannot spot in PHP (3)
    Hi, when running a PHP script I keep getting the error: QUOTE Notice: Undefined variable: bret
    in c:\program files\easyphp1-8\home\poll.php on line 294 Notice: Undefined
    variable: bret in c:\program files\easyphp1-8\home\poll.php on line 294 (And,
    yes, I get it twice). The code related to the variable is as follows: CODE function
    LogString($string,$type)     {         $t_log = "\n";
            $t_log .=
    $this->globaldata->server_vars['REMOTE_ADDR']."....
  4. Getting An Array Value Of A Dynamic Variable
    (9)
    Ok i can't believe I need help in php but I can't figure this out... If i have an array,
    lets say called test, how do i get a certain value from that array when referencing it dynamically
    by either a string or another variable? Example: CODE $test=array(1,2,5);
    $name="test"; //Doesn't work: echo $$name[0]; /Doesn't
    work: echo ${$name}[0]; ....
  5. How To Display The Latest Forum Post On Main Page
    (4)
    Hey does anyone know how to display the latest forum post on the main page of a website? I'm new
    to PHP and have no idea what to do. Thanks in advance!....
  6. Display The Current Date/time
    With a simple PHP code (3)
    Use this code to display the current date and time. CODE <?php   $date =
    date('l dS \of F Y h:i:s A');   echo "$date"; ?>
    "l" would display the current day of the week such as Sunday. d displays the day of the month...
    such as 1 and S adds the appropriate suffix(st). /of simply displays the word "of". F displays the
    current month with no abbreviations while Y displays the four digit year(2007). "h" displays the
    current hour with leading zeros if necessary(Ex. 06 for 6 o'clock). "i" displays the m....
  7. Display Random File In A Directory
    how to display a random file from a set directory. (9)
    hi, could someone please help me with this? I have some files in a directory and i want to know how
    i can randomly display link/s to one or more of the files in my directory for download. But it must
    not at any time display index.php which is also in the directory with the downloads. Thanks in
    advance for any help given /unsure.gif" style="vertical-align:middle" emoid=":unsure:" border="0"
    alt="unsure.gif" />....
  8. Display MySQL results in a Table
    question (8)
    hi all i know php and my sql i want to know how can show mysql result in this tabel for example :
    CODE <table cellpadding="0" cellspacing="0" width="200"
    height="151">     <!-- MSTableType="layout" -->     <tr>
            <td height="21" width="100" valign="top">1</td>
            <td height="21" width="100" valign="top">8</td>
        </tr>     <tr>         <td height="21" width="100" valign=&....
  9. Php Form Help!
    Parse error T_LNUMBER - expecting T_VARIABLE (3)
    Hello, I am trying to make an employee application. I was just wondering if anyone knows how to spot
    a php code error, when the code directly around the line with the error looks the same. below is
    some of my process.php code. I beleive the error is on line 41. QUOTE PHP parse error: PHP
    Parse error: parse error, unexpected T_LNUMBER, expecting T_VARIABLE or '$' in
    /home/wwwange/public_html/FORMS/forms/process.php on line 41 Process.php code: CODE
    <?php include("global.inc.php"); $errors=0; $error="The foll....
  10. Converting Characters In A Variable To Individual Values In An Array
    turning variables into arrays (2)
    Say I have a variable such as $nav_item and it had to contents Home . IE: CODE
    $nav_item = 'Home'; How would I make so that $nav_item was an array and
    had the following contents? CODE $nav_item = array ('h', 'o',
    'm', 'e'); With the case changing (ie H would become h and U
    would become u ) EDIT: Okay found out that I could change the case with
    array_change_key_case ($nav_item, CASE_LOWER); ....
  11. How I Can Display Forum Topic On Main Website ?
    (4)
    Suppose i have a website.. domain.com , and have phpbb forums on domain.com/forums.. And i want to
    display the new topics written in the forum on the main page of website...how i can do that.. ? for
    example ,I want to display this topic `? "domain.com/forums/viewtopic.php?t=16" how can i do
    that ?....
  12. Determining Whether A Phrase Is In A Variable
    deciding whether a string is a url (2)
    I have a input box in a form called "button" and when the user clicks Submit! I want php to
    determine whether or not this is a url or just text. All urls have "http://" in them so I have
    decided I need a script which can determine whether or not "http://" is in a variable or a string.
    The problem with using strings is that I've never needed to use them before (and thus have no
    knowledge about them). When I was using asp, I knew there was a function called instr() but I
    can't find php's equivalent. Does anybody know? Thanks in advance!....
  13. Calling A False Variable...
    like $count . $val (6)
    Okay I'm very new to PHP still, although you may recognize me from the threa before, just go
    finished finals so now back to PHP! On one page I accept an input which will tell the next page
    how many form lines to generate, that part I have worked out, or so I think. Because the number of
    forum fields could vary I need to have a number of forum variables, so I used this code: CODE
    echo   "<td><input name=\"wname" . $appendval . "\"
    type=\"text\" id=\"wname" . $appendval . "....
  14. Php Parse Error
    Including Variable in post (2)
    ok this is my config script that runs my site: CODE <? # Set up info for left column on the
    top page: # It should begin with html tag <td> and finish with tag </td>
    $top_leftcol=" <td width='195' bgcolor='#eeeeee'
     valign='top'> <table width='100%'  bgcolor='#777799' border=0
    cellspacing='0' cellpadding='0'> <tr><td> <font
    FACE='ARIAL, HELVETICA' color='#ffffff' size='-1'>  
    <b>MMORPG Trade Center<....
  15. Stored Or Global Variable?
    (1)
    I've created a form, nothing special, that uses a php script as a form action to input data into
    mysql. Nothing special at all about this scenario. One thing I'd like to do is have the php
    script redirect the user back to the html page that has the form the user just completed. I
    don't want to have to hard code the url into the header function because I use this php script
    with a bunch of other pages. Does PHP store the value of this page into some variable that the php
    script can use? Thanks. kvarnerexpress....
  16. Script: Phpbb Mod, Total Users Registered
    Display the total users anywhere on your site. (1)
    This is for phpBB V2+ It displays the total number of registered users anywhere you want. This file
    is called: phpbb-totalusers.php CODE <?php /** * ©2005 Craig lloyd. All rights reserved. * *
    Mod Title:   Total Registered Users * Author:      Craig Lloyd * Description: Shows
    total number of registered users * Release:     v1.2, 10th May 2005 *** * Demo:            
       http://www.toxicsims.co.uk/ (stats box) * Installation Level:  Easy *
    Installation Time:   1 minute * Files To Edit:       This one * Included Files....
  17. Calling A Variable From A Dynamic List In A Sql Statement
    (2)
    I would be greatful if anyone could help me out, I have been stuck on this for a while. The problem
    is that I have a drop down menu which I get the contents of from a database. Then when I press the
    get details button I want to use the value selected in my drop down menu and pass it into an SQL
    statement to recieve all te relevent info. Everything works if I specify a known variable, but the
    problem seems to be passing a variable in which is part of the array. Below is the code for the drop
    down menu and the Sql statement i'm trying to execute. drop down menu: �....
  18. Possible To Put An If Statement Inside A Variable?
    (2)
    Ok, so I'm using the include() function on my website. Problem is I'm trying to include a
    search engine form into the layout which is stored in a variable, except the form has an if
    statement in it and I can't seem to get it working. Here's the code I'm trying to
    include... CODE Search: > Just wondering if it is possible for me to put this
    form with the if statement into a variable, or if there's another way that I could go about
    doing this. Thanks.....
  19. I Want A Php Code To Display The Most Popular...
    (6)
    I want a PHP code to display the most popular clicks/links on certain pages. Can anyone help?....

    1. Looking for tag, accepting, php, variable, display, tag, accept

*RANDOM STUFF*





*SIMILAR VIDEOS*
Searching Video's for tag, accepting, php, variable, display, tag, accept

*MORE FROM TRAP17.COM*
advertisement



<textarea> Tag Is Not Accepting Php Variable - for display, although <Input> tag does accept it



 

 

 

 

ADD REPLY / Got an Opinion! a humble request :-) RAPID SEARCH! Free Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE