php as default "value" in html

From: Date: Sun, 04 Apr 2004 15:39:27 +0000
Subject: php as default "value" in html
Groups: php.general 
Request: Send a blank email to php-general+get-182282@lists.php.net to get a copy of this message
tnx that works now ----- Original Message ----- From: "Mark" <mark_weinstock@yahoo.com> To: "Andy B" <aborka1@wmis.net>; <php-general@lists.php.net> Sent: Sunday, April 04, 2004 11:32 AM Subject: Re: [PHP] php as default "value" in html > > --- Andy B <aborka1@wmis.net> wrote: > > hi... > > > > i have the following html line: > > <input type="text" name="referred" value=<?echo > > $old['Referred'];?> > > accesskey="d" id="id-referred"> > > the php variable $old['Referred'] was pulled from a mysql table. > > the full string that this variable holds is "I work for you..." but > > when used as a default value in an input text field for html the > > only part that shows up in the form itself is "I". is there > > anything going on that im missing somewhere?? > > > > > > Yes. Perform the subsitution manually. You'll get > <input type="text" name="referred" value=I work for you... > accesskey="d" id="id-referred"> > > You need quotes around the PHP code. > <input type="text" name="referred" value="<?echo > $old['Referred'];?>" > accesskey="d" id="id-referred"> > > > > ===== > Mark Weinstock > mark_weinstock@yahoo.com > *************************************** > You can't demand something as a "right" unless you are willing to fight to death to defend everyone else's right to the same thing. > *************************************** > > __________________________________ > Do you Yahoo!? > Yahoo! Small Business $15K Web Design Giveaway > http://promotions.yahoo.com/design_giveaway/

« previous php.general (#182282) next »