Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [PHP]Prośba o sprawdzenie kodu php
Forum PHP.pl > Forum > Przedszkole
s4v4g3
Witam,
bardzo proszę o sprawdzenie kodu - zrobiłem formularz php, ale coś chyba albo przeoczyłem, albo sam już nie wiem.. główkuje już za długo;/
Bardzo proszę o pomoc.

Kod php:
CODE

<?PHP

if(isset($_POST['submit'])) {

$mailnadawcy = $_POST['mailnadawcy'];
$mail = "kowalski@gmail.com";
$theme = "Catering";
$body = $_POST['body'];

$name = $_POST['name'];

itd...


$notice = $_POST['notice'];

$header = "Od: ". $mailnadawcy . "";

if ($_SERVER['REQUEST_METHOD'] == 'POST') {


$body = "From: $mailnadawcy\n
Name: $name\n
E-mail: $email\n
Phone: $phone\n
Best time to call: $time_call\n


itd....

Notice: $notice\n
";

mail($mail, $theme, $body, $header);

header('location: catering.html');

}}
?>


A to kod z HTMLa
CODE

<form action="send.php" method="post" >
<fieldset>
<legend>Contact Details</legend><br />
<div id="pola_01">
<label>Name: </label><span class="reds"></span><input type="text" name="name" size="25"/>
</div>
itd...


<br />

<legend>Order</legend>
<table class="basic_lines">
<tr>
<th scope="col">Details</th>
<th scope="col">Appetizers</th>
<th scope="col">Entrees</th>

</tr>
<tr>
<th scope="row"># Vegetarian</th>


<td><input type="text" name="veg_app" size="2" /></td>
<td><input type="text" name="veg_entre" size="2" /></td>
</tr>
itd.


</table><br/>
<br />

<legend>Optional</legend><br />
<div id="pola_01">
<label>% Vegetarian: </label><span class="reds"></span><input type="text" name="vegan_percent" size="25"/>
</div>


<legend>Notice</legend>
<div id="pola_01">
<textarea name="notice" cols="45" rows="3"></textarea>
</div>

<div id="pola_04">
<input type="reset" name="clear" class="reset" value="Clear " />
</div>

<div id="pola_04">
<input type="submit" name="submit" class="submit" value="Send " />
</div>

<br /> <br /><br /> <br />
</fieldset>

</form>


</div>



Dzięki serdecznie i pozdrawiam
Spawnm
Popraw bbcode, napisz co jest nie tak w tym kodzie.
Jakiś komunikat dostajesz?
s4v4g3
No właśnie żaden komunikat nie wyskakuje...
Formularz jest już na serwerze - newsletter tam działa, więc php mail jest dobry tam.
Co jest w kodzie źle to nie mam pojęcia;/
wookieb
Temat: Jak poprawnie zadac pytanie
s4v4g3
Poprawiłem kod.
Wstawiłem
1.
error_reporting(E_ALL);
2.
ini_set('display_errors','1');
na początek.. wysłałem na server, ale nic dalej nie pokazało;/
Jakaś mała pomoc?;/
wookieb
Wywal te 1. oraz 2. bo to są pozostałości po kopiowaniu z geshi.
s4v4g3
1.2 oraz 2. oczywiście nie mam w kodzie.
Jak wykonać ten skrypt, aby pokazały się błędy?
wookieb
Normalnie po prostu odpalasz z przeglądarki adres skryptu.
Wstaw sobie jakieś śmieszne echo przed oraz po wywołaniu "mail" to będziesz wiedział, czy po dochodzi do tego miejsca, którego potrzebujesz.
s4v4g3
Z przeglądarki jest pusta strona;/
Edit :
Jednak mam błędy...biggrin.gif

CODE

Notice: Undefined index: mailnadawcy in D:\Hosting\5243506\html\send.php on line 10

Notice: Undefined index: body in D:\Hosting\5243506\html\send.php on line 13

Notice: Undefined index: name in D:\Hosting\5243506\html\send.php on line 15

Notice: Undefined index: email in D:\Hosting\5243506\html\send.php on line 16

Notice: Undefined index: phone in D:\Hosting\5243506\html\send.php on line 17

Notice: Undefined index: time_call in D:\Hosting\5243506\html\send.php on line 18

Notice: Undefined index: date_event in D:\Hosting\5243506\html\send.php on line 20

Notice: Undefined index: occasion in D:\Hosting\5243506\html\send.php on line 21

Notice: Undefined index: guests in D:\Hosting\5243506\html\send.php on line 22

Notice: Undefined index: event_type in D:\Hosting\5243506\html\send.php on line 23

Notice: Undefined index: veg_app in D:\Hosting\5243506\html\send.php on line 25

Notice: Undefined index: veg_entre in D:\Hosting\5243506\html\send.php on line 26

Notice: Undefined index: chicken_app in D:\Hosting\5243506\html\send.php on line 28

Notice: Undefined index: chicken_entre in D:\Hosting\5243506\html\send.php on line 29

Notice: Undefined index: lamb_app in D:\Hosting\5243506\html\send.php on line 31

Notice: Undefined index: lamb_entre in D:\Hosting\5243506\html\send.php on line 32

Notice: Undefined index: sea_app in D:\Hosting\5243506\html\send.php on line 34

Notice: Undefined index: sea_entre in D:\Hosting\5243506\html\send.php on line 35

Notice: Undefined index: otherp_app in D:\Hosting\5243506\html\send.php on line 37

Notice: Undefined index: otherp_entre in D:\Hosting\5243506\html\send.php on line 38

Notice: Undefined index: salad_app in D:\Hosting\5243506\html\send.php on line 40

Notice: Undefined index: salad_entre in D:\Hosting\5243506\html\send.php on line 41

Notice: Undefined index: deserts_app in D:\Hosting\5243506\html\send.php on line 43

Notice: Undefined index: deserts_entre in D:\Hosting\5243506\html\send.php on line 44

Notice: Undefined index: bevarages_app in D:\Hosting\5243506\html\send.php on line 46

Notice: Undefined index: bevarages_entre in D:\Hosting\5243506\html\send.php on line 47

Notice: Undefined index: vegan_percent in D:\Hosting\5243506\html\send.php on line 50

Notice: Undefined index: kids_percent in D:\Hosting\5243506\html\send.php on line 51

Notice: Undefined index: inexeperienced_percent in D:\Hosting\5243506\html\send.php on line 52

Notice: Undefined index: app_glove_or_buffet in D:\Hosting\5243506\html\send.php on line 53

Notice: Undefined index: main_service_or_buffet in D:\Hosting\5243506\html\send.php on line 54

Notice: Undefined index: notice in D:\Hosting\5243506\html\send.php on line 56

wookieb
Przejrzyj $_POST
  1. print_r($_POST);

Błędy mówią Ci jakich kluczy w niej brakuje.
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.