Ocena wątku:
  • 0 głosów - średnia: 0
  • 1
  • 2
  • 3
  • 4
  • 5
Co robię źle ? Instalowanie skryptu php
#1
Cześć, mam problem z instalacją skryptu kontaktu mailowego w php.
Nie wiem co robię źle że skrypt nie działa - tzn wszystko na stronie jest ok i formularz działa, potem jest komunikat że wiadomość wysłana . Ale nic nie dochodzi Sad

To umieściłem w HEAD działu kontakt.html ( czyli tam gdzie mam ten formularz)

Kod:
<style type="text/css">
body {
    margin:50px 0px; padding:0px;
    text-align:center;
    }
    
#contactarea {
    width:350px;
    margin:0px auto;
    text-align:left;
    padding:15px;
    border:1px solid #333;
    background-color:#b9e58b;
    font-weight: bold;
    font-family: Verdana, Arial;
    font-size: 12px;
}

#inputbox {
    border: 1px solid #000;
    width: 180px;
    padding: 2px;
    font-weight: bold;
    font-family: Verdana, Arial;
    font-size: 12px;
}

#inputlabel {
    font-weight: bold;
    font-family: Verdana, Arial;
    font-size: 12px;

}

#textarea {
    border: 1px solid #000;
    padding: 2px;
    font-weight: bold;
    font-family: Verdana, Arial;
    font-size: 12px;
    width: 300px;
}

</style>

<script language="javascript">

function createRequestObject() {
    var ro;
    var browser = navigator.appName;
    if(browser == "Microsoft Internet Explorer"){
        ro = new ActiveXObject("Microsoft.XMLHTTP");
    }else{
        ro = new XMLHttpRequest();
    }
    return ro;
}

var http = createRequestObject();

function sendemail() {
    var msg = document.contactform.msg.value;
    var name = document.contactform.name.value;
    var email = document.contactform.email.value;
    var subject = document.contactform.subject.value;
    document.contactform.send.disabled=true;
    document.contactform.send.value='Wysyłanie...';

    http.open('get', 'contact.php?msg='+msg+'&name='+name+'&subject='+subject+'&email='+email+'&action=send');
    http.onreadystatechange = handleResponse;
    http.send(null);
}

function handleResponse() {
    if(http.readyState == 4){
        var response = http.responseText;
        var update = new Array();

        if(response.indexOf('|' != -1)) {
            update = response.split('|');
            document.getElementById(update[0]).innerHTML = update[1];
        
        }
    }
}
</script>

Tak jak kazał autor tego skryptu w instrukcjach.
A o to kod skryptu contact.php ( jest w osobnym pliku)
Kod PHP:
<?php
/*

Author: Andrew Walsh
Date: 30/05/2006
Codewalkers_Username: Andrew


*/

$to "TUTAJ JEST MÓJ ADRES E-MAIL"//This is the email address you want to send the email to
$subject_prefix ""//Use this if you want to have a prefix before the subject

if(!isset($_GET['action']))
{
die(
"You must not access this page directly!"); //Just to stop people from visiting contact.php normally
}

/* Now lets trim up the input before sending it */

$name trim($_GET['Imię']); //The senders name
$email trim($_GET['email']); //The senders email address
$subject trim($_GET['temat']); //The senders subject
$message trim($_GET['wiadomosc']); // Te cztery pozycje sobie skonfigurowałem, właśnie nie wiem czy można .

mail($to,$subject,$message,"From: ".$email.""); //a very simple send

echo 'contactarea|Dziękujemy '.$name.', twój e-mail został wysłany'//now lets update the "contactarea" div on the contact.html page. The contactarea| tell's the javascript which div to update.
?>
No i te dwa pliki ( kontakt.html i contact.php ) umieściłem na serwerze. Po czym ze strony próbowałem wysłać maila. Niestety bezskutecznie. Trzy razy próbowałem i nic. nie doszło.

aha jest jeszcze to. nie wiem czy to coś pomoże Tongue
Kod:
<div id="contactarea">
<div align="center"><form name="contactform" id="contactform">
<span id="inputlabel">Imię: </span> &nbsp;&nbsp;<input type="text" name="name" id="inputbox"><br /><br />
<span id="inputlabel">E-mail:</span> &nbsp;&nbsp;&nbsp;<input type="text" name="email" id="inputbox"><br /><br />
<span id="inputlabel">Temat</span> <input type="text" name="subject" id="inputbox"><br /><br />
<span id="inputlabel">Wiadomość:</span><br />
<textarea name="msg" rows="10" id="textarea"></textarea>
<br /><br />
<input type="button" a class="art-button" value="Wyślij!" name="send" onclick="sendemail();" id="submitbutton">
Odpowiedz


Wiadomości w tym wątku
Co robię źle ? Instalowanie skryptu php - przez milanista7 - 18-09-2009, 02:04

Podobne wątki…
Wątek: Autor Odpowiedzi: Wyświetleń: Ostatni post
  Problem zm osadzeniem skryptu lighbox w kodzie html gajowy873 2 3,712 24-09-2016, 02:22
Ostatni post: Anatol64
  Podgląd skryptu loginbla 1 1,993 20-09-2012, 20:38
Ostatni post: Morfeusz_2005
  Nie mogę zainstalować skryptu. Tuhaj 9 6,513 23-05-2011, 14:03
Ostatni post: hieroshima
  Generator sygnaturek- szukam skryptu. SanKylo 2 3,189 09-05-2011, 02:30
Ostatni post: Bartez119
  Księga Gości - problem z zamieszczeniem skryptu neneth 5 4,583 05-05-2011, 17:57
Ostatni post: Pedro84

Skocz do:


Użytkownicy przeglądający ten wątek: 1 gości
Sponsorzy i przyjaciele
SeoHost.pl