Ok, mam w konsoli firebuga odpowiedź:
Kod
http://localhost/f/index.php?app=gp&module=createchar&id=20
Ale.. Nie mogę tego odczytać w PHP po wysłaniu formularza ( action=[...]createchar ), poneiważ wtedy get['id'] sie zeruje.
Ktoś moze podpowiedzieć? Nie mam kompletnie pojęcia jak to zrobić. Ładuje mi się wszystko OK w konsoli, ale po wysłaniu formularza jest form action="plik.php" i tam wysyła, więc zeruje ten get..
Próbuję na czystym kodzie:
Kod
<HEAD>
<TITLE> TEST </TITLE>
<script type='text/javascript' src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
</HEAD>
<form action="index.php" method="post">
<table class="ipb_table">
<tbody>
<tr class="header">
</tr>
<tr>
<td width="42%" align="right"><strong>Imię</strong></td>
<td align="left"><input type="text" class="input_text" name="imie" size="25" maxlength="24" placeholder="Martin"></td>
</tr>
<tr>
<td width="42%" align="right"><strong>Nazwisko</strong></td>
<td align="left"><input type="text" class="input_text" name="nazwisko" size="25" maxlength="24" placeholder="Diesel"></td>
</tr>
<tr>
<td align="right"><strong>Wiek</strong></td>
<td align="left"><input type="text" class="input_text" name="charage" size="25" maxlength="4" placeholder="21 lat"></td>
</tr>
<tr>
<td align="right"><strong>Płeć</strong></td>
<td align="left">
<select id="charsex" name="charsex" class="input_text" style="min-width: 158px;">
<option value="-1" selected="selected"> </option>
<option value="1">Mężczyzna</option>
<option value="0">Kobieta</option>
</select>
</td>
</tr>
</tbody>
</table>
<div id="sMale" style="display:none;">
<img src="http://localhost/f/public/gp/skins/2.png" class="skins" id="2" style="margin-top: 3px;" />
<img src="http://localhost/f/public/gp/skins/7.png" class="skins" id="7" style="margin-top: 3px;" />
</div>
<div id="sFemale" style="display:none;">
<img src="http://localhost/f/public/gp/skins/9.png" class="skins" id="9" style="margin-top: 3px;" />
<img src="http://localhost/f/public/gp/skins/12.png" class="skins" id="12" style="margin-top: 3px;" />
</div>
<input type="hidden" name="skin" id="sid" value=""><br />
<div align="center"><input type='submit' class='input_submit' value='Submit' /></div>
</form>
<script type="text/javascript">
jQuery(".skins").click( function () { if( jQuery("#sid").val() != jQuery(this).attr("id")){ jQuery(".skins").fadeTo("fast", 0.33); jQuery(this).fadeTo("fast", 1); jQuery("#sid").val( jQuery(this).attr("id") ); } else { jQuery(".skins").fadeTo("slow", 1); jQuery("#sid").val(""); } });
jQuery("#charsex").change( function () { if(jQuery(this).val() == '1') { jQuery("#sMale").show("slow"); jQuery("#sFemale").hide("slow"); } else if (jQuery(this).val() == '0') { jQuery("#sFemale").show("slow"); jQuery("#sMale").hide("slow"); } else { jQuery("#sMale").hide("slow"); jQuery("#sFemale").hide("slow"); } });
$('.skins').click(function(event) {
$.post('index.php', {'id' : $(this).attr('id')}, function(data) {
})
});
</script>
<?php
echo $_POST['id'];
echo "<br/>";
echo $_POST['imie'];
echo "<br/>";
echo $_POST['nazwisko'];
echo "<br/>";
echo $_POST['charage'];
echo "<br/>";
exit();
?>
Próbowałem i getem i postem to wysyłać.. Nie wysyła nic..