SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Jan 2006
    Location
    Croatia
    Posts
    47
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    A simple tell a friend script is not working, please help

    Hi,

    A friend of mine made me a simple PHP tell a friend script. I customized it a bit and uploaded it to my server. Everything was working fine until I modified the form by removing a couple of <br /> tags so it doesn't mess up my layout. After that, it stopped working. I told my friend about it, he checked my modified script and found absolutely nothing wrong. He then uploaded this same script to his own webserver and it worked.

    After that I talked to my webhost and this was what they said:

    Code:
    We apologize for any inconvenience this may have caused you. Please check your script http://zujaona.learn-croatian.com/reciprijatelju.php.You did not mention proper subject line, From, To in the script, also there are some special characters in the script. Please check this. Please refer the link given below to debug your script it please refer the link below to http://in.php.net/manual/en/ref.mail.php.
    Here is the code of my script:

    Code:
    <form name="forma" action="" method="post" target="_self">
    Tvoje ime:<br /> 
    <input type="text" name="ime" /> <br />
    Prijateljev email:<br /> 
    <input type="text" name="email" /> <br />
    <input type="hidden" name="provjera" value="ok">
    <input type="submit" value="Posalji" />
    </form>
    
    <?php
    
    $provjera = $_POST['provjera'];
    $ime = $_POST['ime'];
    $email = $_POST['email'];
    $headers .= 'From: Zujaona <robot@zujaona.com>' . "\r\n";
    
    
    if($provjera=="ok") {
    
    
    mail($email, "$ime vam poručuje da posjetite Zujaonu!", "Pozdrav, $ime vam želite nešto poručiti. \n\n Ova poruka je poslana putem obrasca na Zujaoni (http://zujaona.learn-croatian.com). Vaš prijatelj vam poručuje da posjetite Zujaonu. To je web namijenjen ubijaju dosade i vremena gdje možete igrat igre, gledati filmiće i još toga.! Adresa je http://zujaona.learn-croatian.com . Vidimo se na Zujaoni!", $headers);
    
    
    print "<b>Poruka je poslana, hvala!</b>";
    }
    ?>
    And the link http:zujaona.learn-croatian.com/reciprijatelju.php

    What I'd really like to know is if something's wrong with the script or not? I seriously doubt that it could because the exact same copy is working fine on my friend's server. What's more, I already had problems with a different tell a friend script, of the exact same nature. One moment it was working and the other not. More specificaly, I couldn't change the $message variable because if I did, the script would stop working. If I changed it back, it would work.

    Thanks in advance

  2. #2
    SitePoint Wizard cranial-bore's Avatar
    Join Date
    Jan 2002
    Location
    Australia
    Posts
    2,634
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The reason it works on one host and not another is probably due to PHP or sendmail configuration. The message about specifying from, to and subject implies that this host has configured mail not to send without this things as an anti-spam measure.

    I couldn't read much of your code because it's in another language. I'm not sure what the requirements for special characters are. Just for testing purposes have you tried sending a message using only "normal" english single byte characters (a-z 0-9)?
    mikehealy.com.au
    diigital.com art, design . Latest WorkSaturday Morning

  3. #3
    SitePoint Enthusiast
    Join Date
    Jan 2006
    Location
    Croatia
    Posts
    47
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That's strange. It's working (I've removed the special characters). Heh, thank you. It's funny though, worked for a time a few days ago WITH the special characters.

    Thanks guys :=)

  4. #4
    SitePoint Wizard silver trophy
    Join Date
    Mar 2006
    Posts
    6,132
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    email headers cannot have high ascii characters in them. the subject, is an email header.

    i recomend you take a look at swiftmailer if you want to send emails with special characters and/or support other charsets. if your message body also contains other characters, your emails might not be displayed correctly on the receiving end if you dont prepare the emails properly.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •