Page 1 of 1

[SOLVED] Email php hyperlink

Posted: Thu Oct 21, 2004 3:55 pm
by jamrop
Not sure what i am doing wrong here. Automatically sending an email to a user confirming they have posted, and i make a hyperlink, but it does not want to work. Code below

Code: Select all

<?php

//header("Location: approve.php");
$headers = "MIME-Version: 1.0\n"; 

$headers .= "Content-type: text/html; charset=iso-8859-1\n"; 

$headers .= "From: info@De.co.uk <info@De.co.uk>\n";

$subject = "Approved";

$body ="<html><head></head><body>Thank you $approvename for posting at Der.  <br>

Your post title is <b>$title</b><br>

Your post reference is <b>E$advert_id</b>. Please keep a record of this. <br><br>

If you have any questions, please <a href=http://de.co.uk/contact/contact.php>click here</a><br><br>
Please do not reply to this email.
</body></html>";



mail($email, $subject,$body,$headers);


?>
Any ideas

Many thanks

Posted: Thu Oct 21, 2004 4:04 pm
by rehfeld
what "doesnt work" ?

any errors?

Posted: Thu Oct 21, 2004 4:53 pm
by jamrop
sorry

no errors, the user gets the email, but the hyperlink <a href> click here</a> is not clickable, just blue font

Posted: Thu Oct 21, 2004 5:10 pm
by rehfeld
feyd | Help us, help you. Please use

Code: Select all

and

Code: Select all

tags where approriate when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]


use quotes

Code: Select all

&lt;a href="http://de.co.uk/contact/contact.php"&gt;click here&lt;/a&gt;
ALL html attribute values are supposed to use quotes

browsers try thier best to make up for html designers mistakes, but only so much can be done

tons of people thing this kinda stuff is ok:

Code: Select all

&lt;td align=left width=400&gt;
&lt;p class=red&gt;
&lt;select name=foobar&gt;
    &lt;option value=foo selected&gt;
&lt;/select&gt;
etc.... but its all incorrect. yes it may work in some browsers, but its a bad habit


this is how its supposed to be

Code: Select all

&lt;td align="left" width="400"&gt;
&lt;p class="red"&gt;
&lt;select name="foobar"&gt;
    &lt;option value="foo" selected="selected"&gt;Foo&lt;/option&gt;
&lt;/select&gt;

i think alot of people ditch the quotes because if using scripting like php, having to escape all the quotes is a pain.


feyd | Help us, help you. Please use

Code: Select all

and

Code: Select all

tags where approriate when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]

Posted: Thu Oct 21, 2004 5:12 pm
by John Cartwright

Code: Select all

<?php
<?php

//header("Location: approve.php");
$headers = "MIME-Version: 1.0\n"; 

$headers .= "Content-type: text/html; charset=iso-8859-1\n"; 

$headers .= "From: info@De.co.uk <info@De.co.uk>\n";

$subject = "Approved";

$body ="<html><head></head><body>Thank you $approvename for posting at Der.  <br>

Your post title is <b>$title</b><br>

Your post reference is <b>E$advert_id</b>. Please keep a record of this. <br><br>

If you have any questions, please <a href='http://de.co.uk/contact/contact.php'>click here</a><br><br>
Please do not reply to this email.
</body></html>";



mail($email, $subject,$body,$headers);


?>
?>

Posted: Thu Oct 21, 2004 5:15 pm
by jamrop
Many thanks