-
Posts
10 -
Joined
-
Last visited
Posts posted by neilh
-
-
does anybody have any ideas? thanks..
-
Hello, I'm trying to get email piping to a php script working.
What i have so far is piping setup on a cPanel email address pointing to my php script which gets who its from, subject and message from the headers and then emails it to my email address. But the problem is in the email it sends me the message is coming back with all bits of header that havent been removed by the script. Here is the php file that i have currently.
[code]
<?
// read from stdin
$fd = fopen("php://stdin", "r");
$email = "";
while (!feof($fd)) {
$email .= fread($fd, 1024);
}
fclose($fd);
// handle email
$lines = explode("\n", $email);
// empty vars
$from = "";
$subject = "";
$headers = "";
$message = "";
$splittingheaders = true;
for ($i=0; $i<count($lines); $i++) {
if ($splittingheaders) {
// this is a header
$headers .= $lines[$i]."\n";
// look out for special headers
if (preg_match("/^Subject: (.*)/", $lines[$i], $matches)) {
$subject = $matches[1];
}
if (preg_match("/^From: (.*)/", $lines[$i], $matches)) {
$from = $matches[1];
}
} else {
// e-mail body
$message .= $lines[$i]."\n";
}
if (trim($lines[$i])=="") {
// empty line, header section has ended
$splittingheaders = false;
}
}
// mail neil with results...
mail("myname@mydomain.co.uk",$subject,$message,"FROM: $from;");
?>
[/code]
I'm getting these kind of things in my email.
[code]
This is a multi-part message in MIME format.
------=_NextPart_000_0035_01C71C96.88B56590
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit
This is a message test to parser.
------=_NextPart_000_0035_01C71C96.88B56590
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
xmlns:o=3D"urn:schemas-microsoft-com:office:office" = xmlns:w=3D"urn:schemas-microsoft-com:office:word" = xmlns=3D"http://www.w3.org/TR/REC-html40">
[/code]
Does anybody know how to strip out all the headers so I'm just left with a message in this example the message is "This is a message test to parser."
If anybody can help me i would be very grateful as I've been trying to figure this out for awhile.
Thanks,
neil -
Hello again, I've re-designed the site now so it isint that gray website.
www.chromehost.net does this look more better now?
Thanks for your comments
Neil -
Hi, thanks for your feedback i'm going to make the buttons smaller and change a few colours so its not all to gray like you said. And also make the login look more better.
Thanks again
Neil -
I've edited some of the pages now, does it look better?
-
Hi, Thank you i've now fixed the error and the site is Valid XHTML.
I'm going to sort out the spacing you were saying about now :)
Thanks Again for all your help.
Neil -
Ok ive fixed most of them, but i have 3 errors left which i carnt work out how to fix.
please could you give me some help thanks alot!
[url=http://validator.w3.org/check?uri=http%3A%2F%2Fwww.chromehost.net%2F]http://validator.w3.org/check?uri=http%3A%2F%2Fwww.chromehost.net%2F[/url] -
thank you very much :)
you know html css links
[code]<LINK REL="StyleSheet" HREF="/includes/styles.css" TYPE="text/css" MEDIA="ALL">[/code]
thats the one its saying theres something wrong.. can you tell me what the correct way is to include css files.
Thanks
edit: i've found the problem Xhtml is all lower case.. -
[b]Hello, could you please give me some advice on improvements i could do on my website please.[/b]
[url=http://www.chromehost.net]http://www.chromehost.net[/url]
Thank You
Neil
main page moves to the top on ajax reload
in Javascript Help
Posted
Hello, I have a live stats box on my website which reloads every 6 seconds. Here's the code for the bit which does this,
the pageLoad() function is called in the body tag when the main page loads, and then the DIV which the ajax is loaded into shows the content.
However if you have scrolled down the page after 6 seconds the page goes back up to the top. Now i can't work out why this is happening.
If you want to see the Ajax JS file then here it is -> http://phptut.jungledog.co.uk/themes/default/ajax.js
If you can help me sort this out it would be most appreciated!
Thanks,
Neil