Re: embedding php inside of php

From: Date: Mon, 02 Jul 2012 15:01:09 +0000
Subject: Re: embedding php inside of php
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-318364@lists.php.net to get a copy of this message
On Sat, Jun 30, 2012 at 8:00 PM, Tim Dunphy <bluethundr@gmail.com> wrote: > Hello, > > I am trying to get the hang of php using some examples that I found > in a book. I've been making progress lately, but one thing has me a > bit stumped. > > > In an HTML form that I am echoing through PHP I would like to embed > smaller chunks of php in the code like so: > > > echo '<br /><br /> > <form method="post" action="sendemail.php"> > <label for="subject">Subject of email:</label><br /> > <input id="subject" name="subject" type="text" > value="<?php > echo $subject;?>"><br /> You're trying to open PHP tags within a PHP code block. Drop the nested <?php echo $subject; ?> and replace it with: '.$subject.' Thus: echo '<br/><br/> <form method="post" action="sendmail.php"> <label for="subject">Subject of email </label><br/> <input id="subject" name="subject" type="text" value="'.$subject.'"><br/> -- </Daniel P. Brown> Network Infrastructure Manager http://www.php.net/

« previous php.general (#318364) next »