Jump to content

neilh

Members
  • Posts

    10
  • Joined

  • Last visited

Posts posted by neilh

  1. 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,

    // Page Load Events
    function livestats() {
    MyAjaxRequest('onlinestats_ajax','/onlinestats.php');
    setTimeout(livestats,6000);
    }
    function pageLoad() {
    livestats();	
    }

    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

     

  2. 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
  3. 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]
  4. 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..
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.