Re: Php script for mail in a xhtml page

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux