|
Posted by The Natural Philosopher on 12/19/07 13:13
Vanscot wrote:
> Ok, first of all, dont reinvent the wheel, there are plenty of
> mail script out there, but if you must/want to do so here
> are some guidelines:
>
> 1 Avoid mixin logic, functions declarations and output: just like
> you take apart html from css, you should take your functions
> declaration
> in one file, your script logic into another file and do the output in
> a template or something like that.
>
> 2 Do you have _only_ apache installed?: if so, you need to instal php
> as well.
>
> 3 Avoid "SuperScripts" that does all-what-you-need, use includes and
> separated scripts.
>
> 4 Define (and on this case explain) your goal: I can say that you want
> to send an email,
> but maybe I'm wrong at that.
>
> 5 Try to ease your life, use (if you can) the pear, pecl or pecl4win.
> (Just add a .php.net and browse).
>
> I'll be waiting your reply so maybe we can crack this down.
>
> On Dec 19, 6:39 am, "Majki Majk" <comit...@europe.com> wrote:
>> "Jeff Gaines" <jgaines_new...@yahoo.co.uk> wrote in message
>>
>> news:xn0ff4k8y2knfuj000@news.individual.net...
>>
>>> On 19/12/2007 in message <Jd1aj.686$Ry2....@newsfe05.lga> Steve wrote:
>>>> dude, DON'T crosspost. multipost if you must, but DON'T crosspost!!!
>>> Is that a Christmas joke or have you confused the two terms?
>>> --
>>> Jeff Gaines Damerham Hampshire UK
>>> The facts, although interesting, are irrelevant
>> Sorry if something went wrong....:)
>> Heh, dude could You help me rather, i'm breaking down here...
>> Majki
>
Try this one
It pretty much works..
Her is the relevant stylesheet.,
/Styles/Style.css
=================
..S1 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10pt;
vertical-align: middle;
text-align: center;
word-spacing: normal;
line-height: 10pt;
font-style: normal;
font-weight: bold;
font-variant: normal;
color: white
}
..S2 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10pt;
vertical-align: middle;
text-align: center;
word-spacing: normal;
line-height: 10pt;
font-style: normal;
font-weight: bold;
font-variant: normal;
color: #000080;
}
..S3 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10pt;
text-align: center;
vertical-align: middle;
word-spacing: normal;
line-height: 10pt;
font-style: normal;
font-weight: bold;
font-variant: normal;
color: #800000;
}
..button1
{
background-image: url("../images/button2.gif");
background-repeat: no-repeat;
background-position: center center;
text-align: center;
vertical-align: middle;
}
..button2
{
background-image: url("../images/button1.gif");
background-repeat: no-repeat;
background-position: center center;
text-align: center;
vertical-align: middle;
}
And the PHP code.
Contact.php
===========
<?php
?>
<HTML>
<TITLE> title</title>
<head>
<link rel=stylesheet href="/Styles/Style.css" type="text/css">
</head>
<script type="text/javascript" language="JavaScript">
function sendmail()
{
document.forms[0].submit();
}
</script>
<body class="content" >
<?
$from=$_POST['from_address'];
$to=$_POST['target_email'];
$body=$_POST['message_body'];
$subject=$_POST['subject'];
/*echo "From: ".$from."<Br>";
echo "To: ".$to."<br>";
echo "Subject: ".$subject."<br>";
echo $body."<br>"; */
if((strlen($from))>0) // have a valid mail
{
mail($to,$subject,$body,"From: ".$from."\r\nReply-To:".$from."\r\n","-f
postmaster@mysite.org");
}
?>
<FORM method="POST" enctype="multipart/form-data" action="Contact.php">
<p>
<table width="100px" border="1" cellpadding="10">
<tr width="100px"><td >
<h2>Send us an email</h2>
<select name="target_email" style="width: 29em;">
<option value="sales@mysite.org"> Any query to do with the shop</option>
<option value="webmaster@mysite.org">Problems or issues with this
site</option>
</select>
</td></tr>
<tr><td>
<h3>Enter your E-Mail address:</h3>
<INPUT TYPE="text" name="from_address" size="45" value="">
</td></tr>
<tr><td>
<h3>Enter The Subject:</h3>
<INPUT TYPE="text" name="subject" size="45" value="">
</td></tr>
<tr><td>
<h3>Enter your message here:</h3>
<TEXTAREA maxlength="1024" rows="10" cols="45"
name="message_body"></textarea>
</td></tr>
<tr><td class="button1" onmouseout="this.className='button1'"
onmouseover="this.className='button2'">
<b class="s1" onmouseout="this.className='s1'"
onmouseover="this.className='s2'"
onclick="this.className='s3';sendmail();">Send Mail</b>
</td></TR>
</table>
</form>
</html>
The only bits missing are the button images. These are done in a
graphics program, and I would post them, but they are binaries.
Navigation:
[Reply to this message]
|