Afficher un message
Vieux 10/09/2007, 03h37   #3
Chris
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] Php script for mail in a xhtml page

brian wrote:
> Mauro Sacchetto wrote:
>> I've to implement a php script in a web page to send mail.
>> If I use a .html form and a separate .php script, all works fine.
>> In the contrary, if I try to put the script into the .html file,
>> I've some troubles... Here's the code:
>>
>> ...
>>
>> When I try to open the page, I receive this error:
>>
>> Parse error: syntax error, unexpected T_STRING in
>> /var/www/netsons.org/samiel/form2.php on line 79
>>
>> Do u see my error?

>
> {Copies, pastes into editor that will number the lines ...}
>
> Well, looking in the vicinity of line 79, i'd say the problem lies with
> your reversed PHP tags:
>
> <input name="name" size="50" maxlength="40" value=?> echo $name. <?">
>
> You've got another right below that:
>
> <input name="subject" size="50" maxlength="40" value="?>echo $subject;<?>
>
> And another:
>
> <textarea name="msg" cols="50" rows="8">?> echo $message;<?</textarea>
>
> Some other points:
>
> - You can do without the "echo" by using, eg. <?= $message ?>


Yet later in another thread you complain about short_tags being an
option.. can't have it both ways.

Leave it as <?php echo $message; ?>

it's more portable - it will work on every single php server and you
won't have any issues moving your code around.

--
Postgresql & php tutorials
http://www.designmagick.com/
  Réponse avec citation
 
Page generated in 0,05155 seconds with 9 queries