RE: [PHP-DB] Input Type Text Area-problem
| From: | Richard Allsebrook | Date: | Thu, 20 Jul 2000 16:40:10 +0000 |
| Subject: | RE: [PHP-DB] Input Type Text Area-problem | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-1345@lists.php.net to get a copy of this message | ||
But leave out the spaces round $php_variable
<TEXTAREA ROWS=? COLS=? NAME=?>$php_variable</TEXTAREA>
_____
~ Richard Allsebrook ~
Applications Developer and Webmaster
Easysoft Limited, No3 The Embankment, Leeds, LS1 4BJ
http://www.easysoft.com <http://www.easysoft.com>
The Home of Data Access Middleware
"A computer lets you make more mistakes faster than any invention in human
history-with the possible exceptions of handguns and tequila."
_____
-----Original Message-----
From: codyc@cisco.com [mailto:codyc@cisco.com]
Sent: Thursday, July 20, 2000 4:45 PM
To: Hanson, Donna
Cc: php-db@lists.php.net
Subject: Re: [PHP-DB] Input Type Text Area-problem
Dealing with text areas is a little different than other input boxes.
You basically do it like this:
<TEXTAREA ROWS=? COLS=? NAME=?> $php_variable </TEXTAREA>
The major difference is that you do not have a VALUE tag INSIDE the
TEXTAREA tag, you enclose your variable in between the tags.
/Cody
"Hanson, Donna" wrote:
> OK, I'm sending more of the code. The 'More Info' field is the
> problem.
> Thanks again, Donna
>
> >Input form:
> **********
> printf("
> <HTML><HEAD><TITLE>Landmark Jobs</TITLE></HEAD>
> <BODY BGCOLOR=\"#ffffff\" BACKGROUND=\"content_bkgrd.gif\"
> LEFTMARGIN=0
> TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0>\n") ;
>
> printf("
> <FORM METHOD=post ACTION=\"addresults.php\">\n");
>
> printf("<TD><INPUT TYPE=submit VALUE=\"ADD\"></TD>\n") ;
>
> printf("
> <TR>
> <TD>Company:</TD>
> <TD><SELECT NAME=\"company[0]\">
> <OPTION VALUE=\"American Outdoor Advertising\">American Outdoor
> Advertising</OPTION>
> <OPTION VALUE=\"Falcon Publishing, Inc.\">Falcon Publishing,
> Inc.</OPTION></SELECT>\n");
>
> printf("
> <TR>
> <TD>Job Title:</TD>
> <TD><INPUT TYPE=text NAME=title SIZE=70
> VALUE=\"\"><BR></TD></TR>\n") ;
>
> printf(" <TR>
> <TD>More Info:</TD>
> <TD><TEXTAREA NAME=info ROWS=3 COLS=70
> VALUE=\"\"></TEXTAREA><BR>
> </TD></TR></TABLE></FORM></BODY></HTML>\n") ;
> **********
>
> >Addresults form:
>
> **********
> require ("globals.php") ;
> require ("common.php") ;
>
> $addStmt = "Insert into $tableName
> (company, title, a_contact, a_position, a_phone, a_email,
> b_contact, b_position, b_phone, b_email, info)
> values('$company[0]', '$title', '$a_contact',
> '$a_position',
> '$a_phone',
> '$a_email',
> '$b_contact', '$b_position', '$b_phone', '$b_email',
> '$info')" ;
> **********
>
> >Modify form:
>
> **********
> require ("common.php") ;
>
> $selectStmt = "SELECT * FROM jobs WHERE oid = $oid" ;
>
> if (!($row = pg_Fetch_Object($result, $i))) {
> DisplayErrMsg ("Internal error: the entry does not exist") ;
> exit () ;
> }
>
> // Populate the associative array with the current attributes of the
> entry
>
> $resultEntry["company"] = $row->company ;
> $resultEntry["title"] = $row->title ;
> $resultEntry["a_contact"] = $row->a_contact ;
> $resultEntry["a_position"] = $row->a_position ;
> $resultEntry["a_phone"] = $row->a_phone ;
> $resultEntry["a_email"] = $row->a_email ;
> $resultEntry["b_contact"] = $row->b_contact ;
> $resultEntry["b_position"] = $row->b_position ;
> $resultEntry["b_phone"] = $row->b_phone ;
> $resultEntry["b_email"] = $row->b_email ;
> $resultEntry["info"] = $row->info ;
>
> GenerateHTMLForm($resultEntry, "update.php?oid=$oid", " MODIFY ") ;
>
> pg_FreeResult ($result) ;
> **********
>
> --
> Donna Hanson
> Xperts, Inc.
>
> ----------
> >From: "Sam Masiello" <smasiello@chekinc.com>
> >To: "Hanson, Donna" <dhanson@xperts.com>, "php dbs"
> <php-db@lists.php.net>
> >Subject: RE: [PHP-DB] Input Type Text Area-problem
> >Date: Thu, Jul 20, 2000, 9:56 AM
> >
>
> >
> > Could you show us the code where you are echoing the existing
> database data
> > into the textarea? My bet is that is where the problem lies.
> >
> > Sam Masiello
> > System Analyst
> > Chek.Com
> > (716) 853-1362 x289
> > smasiello@chekinc.com
> >
> > -----Original Message-----
> > From: Hanson, Donna [mailto:dhanson@xperts.com]
> > Sent: Thursday, July 20, 2000 11:45 AM
> > To: php dbs
> > Subject: [PHP-DB] Input Type Text Area-problem
> >
> > Hi,
> > Submitting an Add form with php4 embedded in html to Postgres using
> a <TEXT
> > AREA> tag works fine, the data DOES get entered.
> >
> > When I run a MODIFY script to populate the array, an empty text box
> is
> > returned for the field that was entered in the TEXT AREA input field
> (the
> > others are ok). If I update the record, it changes the value to
> nothing.
> > This is part of my modify script, can you see anything wrong here?
> >
> > **********
> > require ("common.php") ;
> > $selectStmt = "SELECT * FROM jobs WHERE oid = $oid" ;
> >
> > $resultEntry["b_contact"] = $row->b_contact ;
> > $resultEntry["info"] = $row->info ;
> >
> > GenerateHTMLForm($resultEntry, "update.php?oid=$oid", " MODIFY ")
> ;
> >
> > pg_FreeResult ($result) ;
> >
> > **********
> > Thanks for taking the time to look at this, any help is greatly
> appreciated,
> > Donna
> > --
> > Donna Hanson
> > Xperts, Inc.
> >
> > --
> > PHP Database Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
> > For additional commands, e-mail: php-db-help@lists.php.net
> > To contact the list administrators, e-mail:
> php-list-admin@lists.php.net
> >
> >
> > --
> > PHP Database Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
> > For additional commands, e-mail: php-db-help@lists.php.net
> > To contact the list administrators, e-mail:
> php-list-admin@lists.php.net
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
> For additional commands, e-mail: php-db-help@lists.php.net
> To contact the list administrators, e-mail:
> php-list-admin@lists.php.net
>
>
>
--
Cody Caughlan -codyc@cisco.com- Cisco Systems
Web/Database Engineer phone: (408) 525-6029
Enterprise Line of Business pager: (408) 951-9949