witam
<meta http-equiv="Content-Type" content="text/html; lang="pl" charset="iso-8859-2"> <script LANGUAGE="JavaScript"> <!--
function cl()
{
window.close();
}
//-->
<?
print('<form name="teknoheat" action="../moje/podlicz_tekh.php" method="POST">');
print ("ZAMAWIASZ TEKNOHEAT");print ('
<br>');
print ("Zamówiłe
¶ towary :");print ('
<br>');
print ('Teknoheat 200 ml. szt : ' . "$t200");print ('
<br>');
print ('Teknoheat 500 ml. szt : ' . "$t500");print ('
<br>');
print ('Teknoheat 1 l. szt : ' . "$t1");print ('
<br>');
print ('Teknoheat biały 200 ml. szt : ' . "$tb200");print ('
<br>');
print ('Teknoheat biały 500 ml. szt : ' . "$tb500");print ('
<br>');
print ('Teknoheat biały 1 l. szt : ' . "$tb1");print ('
<br>');
print ('Teknoheat złoty 300 ml. szt : ' . "$tz300");print ('
<br>');
print ('Teknoheat złoty 750 ml. szt : ' . "$tz750");print ('
<br>');
print ('Teknoheat złoty 1,5 l. szt : ' . "$tz15");print ('
<br>');
print ('Teknoheat miedziany 300 ml. szt : ' . "$tm300");print ('
<br>');
print ('Teknoheat miedziany 750 ml. szt : ' . "$tm750");print ('
<br>');
print ('Teknoheat miedziany 1,5 l. szt : ' . "$tm15");print ('
<br>');
print ('Rozpuszczalnik do Teknoheat 0,5 l. szt : ' . "$tr500");print ('
<br>');
print ('');
$kwota = ($t200 *13.3)+($t500*29)+($t1*56)+($tb200*24)+($tb500*52.2)+($tb1*100.8)+(($tz300+tm300)*24)+(($tz750+$tm750)*52.2)+(($tz15+$tm15)*100.8)+($tr500*8.2);
print ('Na ł
±czn
± kwotę : ' . "$kwota" . ' złotych');print ('
<br>');
<input type="hidden" name="kwota" value='.$kwota.'> <input type="hidden" name="t200" value='.$t200.'> <input type="hidden" name="t500" value='.$t500.'> <input type="hidden" name="t1" value='.$t1.'>
<input type="hidden" name="tb200" value='.$tb200.'> <input type="hidden" name="tb500" value='.$tb500.'> <input type="hidden" name="tb1" value='.$tb1.'>
<input type="hidden" name="tz300" value='.$tz300.'> <input type="hidden" name="tz750" value='.$tz750.'> <input type="hidden" name="tz15" value='.$tz15.'>
<input type="hidden" name="tm300" value='.$tm300.'> <input type="hidden" name="tm750" value='.$tm750.'> <input type="hidden" name="tm15" value='.$tm15.'> <input type="hidden" name="tr500" value='.$tr500.'>
<input type="hidden" name="e_mail" value='.$e_mail.'> <input type="hidden" name="nazwa_fir" value='.$nazwa_fir.'> <input type="hidden" name="nip" value='.$nip.'> <input type="hidden" name="imie_i_nazw" value='.$imie_i_nazw.'> <input type="hidden" name="ulica" value='.$ulica.'> <input type="hidden" name="kodp" value='.$kodp.'> <input type="hidden" name="miasto" value='.$miasto.'> <input type="hidden" name="telefon" value='.$telefon.'> <input type=button class=button value="wróć do zamówienia" onClick="java script:window.close()"> <input type="submit" value="Wy¶lij zamówienie" name="submit"> //}
?>
to kod pliku nr 2 po przesłaniu danych z formularza od pliku nr 1
<META http-equiv="content-type" content="text/html; lang="pl" charset="iso-8859-2"> <script LANGUAGE="JavaScript"> <!--
function cl()
{
window.close();
}
//-->
<?
print ("Zamówienie zostało przyjęte !<br>");
print("Dziękujemy !");
$from = 'e_mail';
$to = '1@eranet.pl';
$szef = '2@eranet.pl';
$subject = 'zamówienie ze strony www';
$body = ("Zamówienie \n\n
Zamówienie \n ================================================================================
== \n\n
Firma : $nazwa_fir \n
NIP : $nip \n
Imie i nazwisko : $imie_i_nazw \n
Ulica : $ulica \n
Kod pocztowy : $kodp \n
Miasto : $miasto \n
Telefon : $telefon \n
e-mail : $e_mail \n \n
Zamówienie Teknoheat 200 ml.: $t200 \n
Zamówienie Teknoheat 500 ml.: $t500 \n
Zamówienie Teknoheat 1 l.: $t1 \n
Zamówienie Teknoheat biały 200 ml.: $tb200 \n
Zamówienie Teknoheat biały 500 ml.: $tb500 \n
Zamówienie Teknoheat biały 1 l.: $tb1 \n
Zamówienie Teknoheat złoty 300 ml.: $tz300 \n
Zamówienie Teknoheat złoty 750 ml.: $tz750 \n
Zamówienie Teknoheat złoty 1,5 l.: $tz15 \n
Zamówienie Teknoheat miedziany 300 ml.: $tm300 \n
Zamówienie Teknoheat miedziany 750 ml.: $tm750 \n
Zamówienie Teknoheat miedziany 1,5 l.: $tm15 \n
Zamówienie rozpuszczalnik do Teknoheat 500 ml.: $tr500 \n
warto¶ć zamówienia : $kwota \n ");
mail ($to,$subject,$body,"From : $from \n ");
mail ($e_mail,$subject,$body,"From : $to \n Return-Path: <1@eranet.pl>");
mail ($szef,$subject,$body,"From : $from \n ");
<input type=button class=button value="zamknij" onClick="java script:window.close()">
?>
to kod pliku wysyłającego nr 3 zamieniłem go na funkcję i wstawiłem do pliku nr 2 pod taką postacią
function wyslij ()
{
global $kwota;
global $t200; global $t500; global $t1;
global $tb200; global $tb500; global $tb1;
global $tz300; global $tz750; global $tz15;
global $tm300; global $tm750; global $tm15;
global $tr500;
$from = 'e_mail';
$to = '1@eranet.pl';
$szef = '2@eranet.pl';
$subject = 'zamówienie ze strony www';
$body = ("Zamówienie \n\n
Zamówienie \n ================================================================================
== \n\n
Firma : $nazwa_fir \n
NIP : $nip \n
Imie i nazwisko : $imie_i_nazw \n
Ulica : $ulica \n
Kod pocztowy : $kodp \n
Miasto : $miasto \n
Telefon : $telefon \n
e-mail : $e_mail \n \n
Zamówienie Teknoheat 200 ml.: $t200 \n
Zamówienie Teknoheat 500 ml.: $t500 \n
Zamówienie Teknoheat 1 l.: $t1 \n
Zamówienie Teknoheat biały 200 ml.: $tb200 \n
Zamówienie Teknoheat biały 500 ml.: $tb500 \n
Zamówienie Teknoheat biały 1 l.: $tb1 \n
Zamówienie Teknoheat złoty 300 ml.: $tz300 \n
Zamówienie Teknoheat złoty 750 ml.: $tz750 \n
Zamówienie Teknoheat złoty 1,5 l.: $tz15 \n
Zamówienie Teknoheat miedziany 300 ml.: $tm300 \n
Zamówienie Teknoheat miedziany 750 ml.: $tm750 \n
Zamówienie Teknoheat miedziany 1,5 l.: $tm15 \n
Zamówienie rozpuszczalnik do Teknoheat 500 ml.: $tr500 \n
warto¶ć zamówienia : $kwota \n ");
mail ($to,$subject,$body,"From : $from \n ");
mail ($e_mail,$subject,$body,"From : $to \n Return-Path: <1@eranet.pl>");
mail ($szef,$subject,$body,"From : $from \n ");
<input type=button class=button value="zamknij" onClick="java script:window.close()"> }
chciałbym wywołać funkcję "wyslij()" w pliku nr 2 po naciśnięciu klawisza
<input type=button class=button value="wyślij" onClick="wyslij()">
tak aby ona zadziałała, może być inny sposów wywołania funkcji po naciśnięciu obrazka i tp. lub jeśli można coś poradzić aby pola hidden nie obcinały stringów.
Przy okazji znalazłem parę braków deklaracji zmiennych global do funkcji.
Pozdrawiam.