Witam ponownie odtatnio, mam problem bo wydaje mi sie ze wszystko jest ok - a nie jest
zmienne wszystkie wysylam tu:
<script>
function myFunction(id)
{
$.ajax({
type: "GET",
url: "./php/modal-dane.php",
dataType: "json",
data: {"id": id}
})
.done(function(json){
var data = json.data;
var tytul = json.tytul;
var miasto = json.miasto;
var adres = json.adres;
var obiekt = json.obiekt;
var miejsc = json.miejsc;
var dostepnych = json.dostepnych;
$("#termin").html("<b>" + data + "</b> / <b>" + miasto + "</b> / <b>" + obiekt + "</b> (<a style='color:#FFFFFF !important;text-decoration:none' href='https://www.google.pl/maps/place/" + adres + "+" + miasto + "' target='_blank' title='Otwórz lokalizację w mapach Google'>" + adres + "</a>)");
$("#liczba-miejsc").html("Liczba wolnych miejsc: <b>" + dostepnych + "</b>");
$("datein").val(data);
$("title").val(tytul);
$("city").val(miasto);
$("address").val(adres);
$("place").val(obiekt);
})
}
</script>
i tu dziala wszystko bezblednie, bo pozniej w tekscie i w konsoli wszystko jest jak na dloni. Problem lezy albo tu, choć widac ze wszystko jest ok:
<form id="modal-form" name="modal-form" action="./php/email.php" method="POST" enctype="multipart/form-data"> <input type="hidden" id="action" name="action" value="signup"> <input type="hidden" id="datein" name="datein" value=""> <input type="hidden" id="title" name="title" value=""> <input type="hidden" id="city" name="city" value=""> <input type="hidden" id="address" name="address" value=""> <input type="hidden" id="place" name="place" value=""> ...
<button type="reset" value="Reset" class="btn btn-d button" style="margin-top:5px;" data-dismiss="modal">Zamknij
</button> <button type="submit" value="Submit" class="btn btn-d button">Zarejestruj się
</button>
...albo tu:
<?php
if ($_SERVER['REQUEST_METHOD'] == 'POST')
{
$action = isset($_POST['action']) ?
$_POST['action'] : ''; $success_page = "./../ok.php";
$error_page = "./../error.php";
if ($action == "signup")
{
$newname = $_POST['name'];
$newemail = $_POST['email'];
$newphone = $_POST['phone'];
$newgender = $_POST['gender'];
if ($newgender == "k") {$nowygender = "Kobieta";} else if ($newgender == "m") {$nowygender = "Mężczyzna";}
if (isset($_POST['planujeciaze'])) {$planujeciaze = $_POST['planujeciaze']; $newplanujeciaze = "Tak";} else {$planujeciaze = "n"; $newplanujeciaze = "Nie";} if (isset($_POST['jestemwciazy'])) {
if ($newgender == "m") {$jestemwciazy = "-"; $newjestemwciazy = "Nie dotyczy";}
else if ($newgender == "k") {$jestemwciazy = $_POST['jestemwciazy']; $newjestemwciazy = "Tak";}
}
else
{
if ($newgender == "m") {$jestemwciazy = "-"; $newjestemwciazy = "Nie dotyczy";}
else if ($newgender == "k") {$jestemwciazy = "n"; $newjestemwciazy = "Nie";}
}
if (isset($_POST['jestemrodzicem'])) {$jestemrodzicem = $_POST['jestemrodzicem']; $newjestemrodzicem = "Tak";} else {$jestemrodzicem = "n"; $newjestemrodzicem = "Nie";} $newdata = $_POST['datein'];
$newtytul = $_POST['title'];
$newmiasto = $_POST['city'];
$newadres = $_POST['address'];
$newmiejsce = $_POST['place'];
...
<tr style=\"margin-top:10px;width:100%;height:100%;background:#00B4FF;margin-left:15px;margin-right:15px;padding:10px;text-align:center\">
<td style=\"width:100%;height:100%;padding:10px\">
<span style=\"font-size:13px;color:#FFFFFF;line-height:20px;\">Jeśli dane z formularza są poprawne, prosimy sprawdzić datę i miejsce wydarzenia:</span>
<br>
<span style=\"font-size:16px;color:#FFFFFF;line-height:20px;\"><b>".$newdata." / ".$newtytul."<br>".$newmiasto.", ".$newadres." - ".$newmiejsce."</b></span>
</td>
</tr>
</table>
</body>
</html>";
$header = "From: Uniwersytet Rodzica <uniwersytetrodzica@apodi.pl>"."\r\n";
$header .= "Reply-To: Uniwersytet Rodzica <uniwersytetrodzica@apodi.pl>"."\r\n";
$header .= "MIME-Version: 1.0"."\r\n";
$header .= "Content-Type: text/html; charset=utf-8"."\r\n";
$header .= "Content-Transfer-Encoding: 8bit"."\r\n";
mail($mailto, $subject, $message, $header); header('Location: '.$success_page); }
}
else
{
header('Location: '.$error_page); }
?>
w czym problem?
wszystkie zmienne $_POST są oprocz tych:
$newdata = $_POST['datein'];
$newtytul = $_POST['title'];
$newmiasto = $_POST['city'];
$newadres = $_POST['address'];
$newmiejsce = $_POST['place'];