Hello all,
I am having some trouble with my auto responder code. Not that knowledgable with php, but do have lots of coding background. Basically, I have an auto responder set up after someone submits their details. My problem is i cannot put any links into the message part of the auto responder.
The code is setup to use variables as the email address, subject and main body. It all works fine with normal text. However, as soon as i put <a href="...">Click here</a> i get a parse error. What am i doing wrong?
$to = "$email";
$subject = "Title";
$body = "message text...";
This is how i have setup my code. I have tried many combinations and everytime it runs, until i enter the html.
All help is appreciated
Help with auto responder
Moderator: General Moderators
- AbraCadaver
- DevNet Master
- Posts: 2572
- Joined: Mon Feb 24, 2003 10:12 am
- Location: The Republic of Texas
- Contact:
Re: Help with auto responder
If you have a PHP file then the PHP must be within <?php tags ?>. If you want to add HTML (not PHP) then you have to close the tags:
Code: Select all
<?php
$to = "$email";
$subject = "Title";
$body = "message text...";
?>
<a href="...">Click here</a>
<?php
//more php code
?>mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
-
blackthumb
- Forum Newbie
- Posts: 3
- Joined: Tue Jan 26, 2010 4:02 pm
Re: Help with auto responder
Thanks for the quick reply.
Are you saying there is no way for me to put the link in the email text the way I have coded it?
If so, might there be an alternative?
Are you saying there is no way for me to put the link in the email text the way I have coded it?
If so, might there be an alternative?
- AbraCadaver
- DevNet Master
- Posts: 2572
- Joined: Mon Feb 24, 2003 10:12 am
- Location: The Republic of Texas
- Contact:
Re: Help with auto responder
I wasn't paing attention. I thought you were trying to display it in the page. You need to learn how quotes are used in PHP: http://us.php.net/manual/en/language.types.string.phpblackthumb wrote:Thanks for the quick reply.
Are you saying there is no way for me to put the link in the email text the way I have coded it?
If so, might there be an alternative?
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
-
blackthumb
- Forum Newbie
- Posts: 3
- Joined: Tue Jan 26, 2010 4:02 pm
Re: Help with auto responder
Thanks for the link pal. I now understand the mail function and all is working fine.
Thanks again!!
Thanks again!!