IPB

( Zaloguj | Zarejestruj )

2 V   1 2 >  
Reply to this topicStart new topic
> formularz kontaktowy
piotrek122
post 17.8.2010 - 10:12
Post #1





Grupa: Bloger
Postów: 9

Nr: 8 710



Witam kolejne moje pytanie dotyczy Formularz kontaktowych w WP.
Nie korzystam z żadnych wtyczek i po prostu wstawiłem kilka pól i przycisk. W pliku index.php wstawiłem całą funkcję do wysyłania formularza na podany mail w cały problem tkwi w tym iż nie mogę nigdzie ustawić pola w którym by się pojawiał komunikat że mail został wysłany bądź ewentualnie nie został wysłany z powodu wprowadzenia błędnych danych. Jak to można zrobić ręcznie?


--------------------
Go to the top of the page
 
+Quote Post
amistad18
post 17.8.2010 - 11:34
Post #2


aktywność:
*********

Grupa: Redakcja
Postów: 4 252

Nr: 5 919



Pokaż jak wygląda Twój kod do wysyłania maila.
Go to the top of the page
 
+Quote Post
piotrek122
post 17.8.2010 - 12:50
Post #3





Grupa: Bloger
Postów: 9

Nr: 8 710



KOD
<?php
if (empty($_POST['submit'])){
if (!empty($_POST['Imie'])  && !empty($_POST['Telefon']) && !empty($_POST['E_mail']) && !empty($_POST['Wiadomosc']) && !empty($_POST['Pole'])) {
$E_mail=trim($_POST['E_mail']);

$message = "imie: $_POST[Imie]\n telefon: $_POST[Telefon]\n e-mail: $_POST[E_mail]\n wiadomosc: $_POST[Wiadomosc]\n skad:$_POST[Pole]";
$header = "FROM: $_POST[Imie]<$_POST[E_mail]>";
mail("ktos@cos.pl","temat","$message") or die ('nie udało się wysłać');
}

}

?>


--------------------
Go to the top of the page
 
+Quote Post
amistad18
post 17.8.2010 - 13:35
Post #4


aktywność:
*********

Grupa: Redakcja
Postów: 4 252

Nr: 5 919



Ogarnij to:
KOD
<?php
if (empty($_POST['submit'])){
    if ($_POST['Imie'] AND $_POST['Telefon'] AND $_POST['E_mail'] AND $_POST['Wiadomosc'] AND $_POST['Pole']) {
    $E_mail=trim($_POST['E_mail']);

    $message = "imie: $_POST[Imie]\n telefon: $_POST[Telefon]\n e-mail: $_POST[E_mail]\n wiadomosc: $_POST[Wiadomosc]\n skad:$_POST[Pole]";
    $header = "FROM: $_POST[Imie]<$_POST[E_mail]>";
    mail("ktos@cos.pl","temat","$message") or die ('nie udało się wysłać');
    header ("Location: ./index.php?mail=ok");
    } else {
    header ("Location: ./index.php?mail=error");
    }
}

?>

<?php             
    if ($_GET['mail'] == "ok") {
        echo 'E-mail został wysłany';
    } elseif ($_GET['mail'] == "error") {
        echo 'Błąd. Pola oznaczone gwiazdką są wymagane';
    }
?>


Tylko zamiast index.php, daj adres strony na której masz ten formularz.
Go to the top of the page
 
+Quote Post
piotrek122
post 17.8.2010 - 14:11
Post #5





Grupa: Bloger
Postów: 9

Nr: 8 710



Niestety mi to nie działa


--------------------
Go to the top of the page
 
+Quote Post
amistad18
post 17.8.2010 - 16:29
Post #6


aktywność:
*********

Grupa: Redakcja
Postów: 4 252

Nr: 5 919



Niestety, ale wróżką nie jestem.
Go to the top of the page
 
+Quote Post
szymaj
post 22.11.2010 - 22:15
Post #7


aktywność:
*

Grupa: +Bloger
Postów: 46

Nr: 8 220



Podłącze się do pytania o formularz. Pisząc w htmlu kod np:

<p>Godzina rozpoczęcia: <input type="text" name="rozpoczeciegodzina"> Minuta rozpoczęcia: <input type="text" name="rozpoczecieminuta"> </p>

Otrzymuję wszystko w jednej linijce, gdy wpiszę coś takiego do WP, każde pole input zaczyna się od nowej linijki. Testowałem to już na kilku skórkach - wszędzie tak samo, jak zrobić żeby w WP była to 1 linijka?


--------------------
Go to the top of the page
 
+Quote Post
kkarpieszuk
post 22.11.2010 - 23:25
Post #8


aktywność:
****

Grupa: +Bloger
Postów: 376

Nr: 5 123



do style.css skorki dodaj:

input[type='text'] { display: inline; }


--------------------
pozdrawiam, Konrad Karpieszuk
## WTYCZKA WORDPRESS - SKLEP INTERNETOWY ##
p.s. zleceń odnośnie Wordpressa szukajcie na http://wpzlecenia.pl
Go to the top of the page
 
+Quote Post
szymaj
post 23.11.2010 - 09:35
Post #9


aktywność:
*

Grupa: +Bloger
Postów: 46

Nr: 8 220



Wpisanie: input[type='text'] { display: inline; }

nic nie zmieniło sprawdzałem na kilku skórkach.


--------------------
Go to the top of the page
 
+Quote Post
kkarpieszuk
post 23.11.2010 - 12:06
Post #10


aktywność:
****

Grupa: +Bloger
Postów: 376

Nr: 5 123



zatem leć po szklaną kulę (czytaj: zamiast pisac 'nic nie daje, sprawdzalem' powinienes podac link do strony i pokazac ze faktycznie nie dziala)


--------------------
pozdrawiam, Konrad Karpieszuk
## WTYCZKA WORDPRESS - SKLEP INTERNETOWY ##
p.s. zleceń odnośnie Wordpressa szukajcie na http://wpzlecenia.pl
Go to the top of the page
 
+Quote Post
szymaj
post 23.11.2010 - 13:33
Post #11


aktywność:
*

Grupa: +Bloger
Postów: 46

Nr: 8 220



Kula by się przydała wink.gif

Adres strony ze wstawianym formularzem:

http://www.niemieckidlagimnazjum.pl/?page_id=196

Kod strony:

KOD
<strong>Übung 1</strong>
<strong>Wpisz Er, Sie, Es.</strong>

<form action="http://www.niemieckidlagimnazjum.pl/wyniki.php">
<p align="left"><input name="cw1z1" type="text" /> kommt aus der Schweiz. ( Thomas) </p>

<p align="left"><input name="cw1z2" type="text" /> wohnen in Wien. ( Monika und Susanne)  </p>

<p align="left"><input name="cw1z3" type="text" /> besuchen gerade ihre Familie. ( Herr und Frau Monster)  </p>

<p align="left"><input name="cw1z4" type="text" /> heißt Michaela. (Das Mädchen)  </p>

<p align="left"><input name="cw1z5" type="text" /> fotografiert seine Klassenkameraden. (Der Junge)  </p>




<hr width="200" />
<strong>Übung</strong> <strong>2</strong>

<strong>Wstaw odpowiedni zaimek osobowy!</strong>




1. Was macht Peter gern?                        <input name="cw2z1" type="text" /> spielt Lego.

2.Was macht Tante Rosi gern?                <input name="cw2z2" type="text" /> malt.

3.Was macht Onkel Daniel gern?           <input name="cw2z3" type="text" /> reitet.

4.Was macht Frau Sattel gern?       <input name="cw2z4" type="text" /> tanzt.

5.Was macht Herr Tholen gern?             <input name="cw2z5" type="text" /> schreibt.

6.Was macht mein Kind gern?                <input name="cw2z6" type="text" /> malt.

7.Was macht deine Mutter gern?            <input name="cw2z7" type="text" /> telefoniert.

8.Was macht dein Bruder gern?              <input name="cw2z8" type="text" /> bastelt.

9.Was macht deine Schwester gern?       <input name="cw2z9" type="text" /> singt.


</form>

<strong>Übung</strong> <strong>3</strong>

2.Wohnt <input name="cw3z2" type="text" /> lange in Berlin? (Monika)

<form action="http://www.niemieckidlagimnazjum.pl/wyniki.php">

<strong>Wpisz zaimki!</strong>
1. <input type="text" /> kommt aus Schweden. (Helmut)

2.Wohnt <input name="cw3z2" type="text" /> lange in Berlin? (Monika)

3.<input name="cw3z3" type="text" /> fahre nicht gern mit dem Taxi.

4.Wann besuchst <input name="cw3z4" type="text" /> uns?

5.<input name="cw3z5" type="text" /> lerne seit einem Jahr Deutsch.

6.<input name="cw3z6" type="text" /> bist wirklich sehr nett.


7.Schreibt <input name="cw3z7" type="text" /> heute einen Test? (wy)
<p align="left"><input name="cw" type="submit" value="Gotowe" /> </p>
</form>


Wyświetla się tak samo, na obecnym theme jak i na domyślnym Twenty Ten.


--------------------
Go to the top of the page
 
+Quote Post
kkarpieszuk
post 23.11.2010 - 15:33
Post #12


aktywność:
****

Grupa: +Bloger
Postów: 376

Nr: 5 123



ty tam kazdą linijke wstawiles jako oddzielny akapit (<p> jak paragraph). usun te <p> na poczatku i koncu kazdej linijki (</p>>


--------------------
pozdrawiam, Konrad Karpieszuk
## WTYCZKA WORDPRESS - SKLEP INTERNETOWY ##
p.s. zleceń odnośnie Wordpressa szukajcie na http://wpzlecenia.pl
Go to the top of the page
 
+Quote Post
szymaj
post 23.11.2010 - 20:33
Post #13


aktywność:
*

Grupa: +Bloger
Postów: 46

Nr: 8 220



Coś drgnęło... ale nie do końca. Usunąłem znaczniki. Kod strony wygląda teraz tak

KOD
Übung 1
Wpisz Er, Sie, Es
<form action="http://www.niemieckidlagimnazjum.pl/wyniki.php">
<input name="cw1z1" type="text" /> kommt aus der Schweiz. ( Thomas)  
<input name="cw1z2" type="text" /> wohnen in Wien. ( Monika und Susanne)
<input name="cw1z3" type="text" /> besuchen gerade ihre Familie. ( Herr und Frau Monster)  
<input name="cw1z4" type="text" /> heißt Michaela. (Das Mädchen)  
<input name="cw1z5" type="text" /> fotografiert seine Klassenkameraden. (Der Junge)  

Übung 2

Wstaw odpowiedni zaimek osobowy!


1. Was macht Peter gern? <input name="cw2z1" type="text" /> spielt Lego.
2. Was macht Tante Rosi gern? <input name="cw2z2" type="text" /> malt.
3. Was macht Onkel Daniel gern? <input name="cw2z3" type="text" /> reitet.
4. Was macht Frau Sattel gern? <input name="cw2z4" type="text" /> tanzt.
5. Was macht Herr Tholen gern? <input name="cw2z5" type="text" /> schreibt.
6. Was macht mein Kind gern? <input name="cw2z6" type="text" /> malt.
7. Was macht deine Mutter gern? <input name="cw2z7" type="text" /> telefoniert.
8. Was macht dein Bruder gern? <input name="cw2z8" type="text" /> bastelt.
9. Was macht deine Schwester gern? <input name="cw2z9" type="text" /> singt.


Übung 3

Wpisz zaimki!
1. <input type="text" /> kommt aus Schweden. (Helmut)
2. Wohnt <input name="cw3z2" type="text" /> lange in Berlin? (Monika)
3. <input name="cw3z3" type="text" /> fahre nicht gern mit dem Taxi.
4. Wann besuchst <input name="cw3z4" type="text" /> uns?
5. <input name="cw3z5" type="text" /> lerne seit einem Jahr Deutsch.
6. <input name="cw3z6" type="text" /> bist wirklich sehr nett.
7. Schreibt <input name="cw3z7" type="text" /> heute einen Test? (wy)
<input name="cw" type="submit" value="Gotowe" />
</form>


adres strony: http://www.niemieckidlagimnazjum.pl/?page_id=196
Zależnie od położenia pola <input>, za każdym razem rozbija wiersz inaczej.


--------------------
Go to the top of the page
 
+Quote Post
amistad18
post 23.11.2010 - 21:11
Post #14


aktywność:
*********

Grupa: Redakcja
Postów: 4 252

Nr: 5 919



A ja widzę taki kod:

KOD
<p>1. Was macht Peter gern?<br>
<input type="text" name="cw2z1"> spielt Lego.<br>
2. Was macht Tante Rosi gern?<br>
<input type="text" name="cw2z2"> malt.<br>
3. Was macht Onkel Daniel gern?<br>
<input type="text" name="cw2z3"> reitet.<br>
4. Was macht Frau Sattel gern?<br>
<input type="text" name="cw2z4"> tanzt.<br>
5. Was macht Herr Tholen gern?<br>
<input type="text" name="cw2z5"> schreibt.<br>
6. Was macht mein Kind gern?<br>
<input type="text" name="cw2z6"> malt.<br>
7. Was macht deine Mutter gern?<br>
<input type="text" name="cw2z7"> telefoniert.<br>
8. Was macht dein Bruder gern?<br>
<input type="text" name="cw2z8"> bastelt.<br>
9. Was macht deine Schwester gern?<br>
<input type="text" name="cw2z9"> singt.</p>
Go to the top of the page
 
+Quote Post
kkarpieszuk
post 23.11.2010 - 21:48
Post #15


aktywność:
****

Grupa: +Bloger
Postów: 376

Nr: 5 123



tak jak zauwazyl amistad: po kazdej linijce wcisnales enter i wp zmienil go automatycznie na <br/>. jak wciskasz enter by zrobic nowa linie, nie dziw sie ze ta sie pojawia


--------------------
pozdrawiam, Konrad Karpieszuk
## WTYCZKA WORDPRESS - SKLEP INTERNETOWY ##
p.s. zleceń odnośnie Wordpressa szukajcie na http://wpzlecenia.pl
Go to the top of the page
 
+Quote Post

2 V   1 2 >
Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



: 9 02 12 - 05:07
WebFan | Wszystko co chcesz wiedzieć o e-commerce