Allora sono tre ora che sto impazzendo con questo codice:
Codice PHP:
<?php
if (isset($_GET['action']) != "") {
switch ($_GET['action']) {
case 'avanti': //maschera d'inserimento
echo "
<span class=\"rosa\">Compila con i tuoi dati</span>
<form name=\"reg\" id=\"reg\" method=\"get\" />
<input name=\"nick\" type=\"text\" id=\"nick\" /><span class=\"bianco\">".NICK."[b]*[/b]</span>
<input name=\"mail\" type=\"text\" id=\"mail\" /><span class=\"bianco\">".MAIL."[b]*[/b]</span>
<input name=\"pwd\" type=\"password\" id=\"pwd\" /><span class=\"bianco\">".PWD."[b]*[/b]</span>
<input name=\"pwd2\" type=\"password\" id=\"pwd2\" /><span class=\"bianco\">".RETYPE_PWD."[b]*[/b]</span>
<input name=\"Submit\" type=\"submit\" class=\"login\" onClick=\"javascript:caricaBox('boxes/register_user.php?action=avanti2&action2=registrami', 'site');return false;\" value=\"".REGISTER_ME."\" />
</form></p>";
break;
case 'avanti2':
if (($_GET['action2']) == "registrami") {
$nick = $_GET['nick'];
$email = $_GET['mail'];
$pwd = $_GET['pwd'];
$pwd2 = $_GET['pwd2'];
echo $nick; //NON MI STAMPA NIENTE!!!!
}
break;
default: // homepage con regolamento
echo "
<span class=\"rosa\">".REGISTER_RULE."</span></p>";
echo "<form name=\"reg\" id=\"reg\" method=\"get\" />
".READ_RULE."</p>
<input name=\"Submit\" type=\"submit\" class=\"login\" onClick=\"javascript:caricaBox('boxes/register_user.php?action=avanti', 'site');return false;\" value=\"".CONFERMO."\" />
</form>";
}
}
?>
Perchè quando eseguo il controllo if (($_GET['action2']) == "registrami")
(che viene eseguito)
non ottengo i valori dei campi?
Se faccio l'echo dei valori recuperati con $_GET[] non ottengo niente.
Con get non passa i valori dei campi??
Per capire vi posto il codice Ajax
Codice PHP:
<script type="text/javascript"><!--//
function caricaBox(string, IdBox) {
var url_action = string;
new Ajax.Request(url_action, {onComplete:showResponse} );
function showResponse(originalRequest)
{
$(IdBox).innerHTML = originalRequest.responseText;
}
return false;
}
//--></script>