Ciao ragazzi... sto litigando con una pagina del mio sito!
Ringraziandovi anticipatamente della vostra disponibilità, vi sottopongo il mio problema:
Ho creato una pagina con 2 righe da compilare e un tasto per inviare i dati con il seguente codice:
<div class="column1-unit" align="center">
<div class="contactform" align="center">
<form method="post" action="{$script_url}?act=key">
<fieldset><legend> {$user.name}'s MALL POINTS DELIVERING SISTEM </legend>
<p>Please enter here the key gonna active now:</p>
<p> <input type="text" name="act_key" id="act_key" class="bigfield" value="{$form_key}" tabindex="1" /></p>
<p>Please enter here the point's quantity:</p>
<p> <input type="text" name="points" id="points" class="bigfield" value="{$form_points}" tabindex="2" /></p>
<p><input type="submit" id="submit" class="button" name="a_key" value="Submit"></p>
</fieldset>
</form>
</div>
</div>
Riferito alla seguente pagina key.php che dovrebbe prendere i dati inseriti in precedenza e scriverli in un database sql (database WEBSITE, tabella item_key)
qui vi posto il codice relativo nel key.php:
if (isset($_SESSION['aid']))
{
if (isset($_POST['a_key'])) {
$act_key = trim((isset($_POST['act_key']) ? $_POST['act_key'] : ''));
$points = trim((isset($_POST['points']) ? $_POST['points'] : ''));
$actkey = doQuery("INSERT INTO item_key (act_key,wasted,points) VALUES ('$act_key','0','.$points.')", DATABASE_WEBSITE);
if(!$actkey)
{
$oSmarty->assign('message', array( 'type' => 'error',
'messages' => array( 'Error key' ) ) );
}
else
{
$oSmarty->assign('message', array( 'type' => 'ok',
'messages' => array( 'Your key has been succesful actived!' ) ) );
}
}
}
else
{
$oSmarty->assign('message', array( 'type' => 'error',
'messages' => array( 'Please log-in to acces this feature!.' ) ) );
}
all'interno della pagina visualizzo l'errore "Error key"
e se controllo il database infatti non viene compilata nessuna riga :incazz2:
Matteo.
Ringraziandovi anticipatamente della vostra disponibilità, vi sottopongo il mio problema:
Ho creato una pagina con 2 righe da compilare e un tasto per inviare i dati con il seguente codice:
<div class="column1-unit" align="center">
<div class="contactform" align="center">
<form method="post" action="{$script_url}?act=key">
<fieldset><legend> {$user.name}'s MALL POINTS DELIVERING SISTEM </legend>
<p>Please enter here the key gonna active now:</p>
<p> <input type="text" name="act_key" id="act_key" class="bigfield" value="{$form_key}" tabindex="1" /></p>
<p>Please enter here the point's quantity:</p>
<p> <input type="text" name="points" id="points" class="bigfield" value="{$form_points}" tabindex="2" /></p>
<p><input type="submit" id="submit" class="button" name="a_key" value="Submit"></p>
</fieldset>
</form>
</div>
</div>
Riferito alla seguente pagina key.php che dovrebbe prendere i dati inseriti in precedenza e scriverli in un database sql (database WEBSITE, tabella item_key)
qui vi posto il codice relativo nel key.php:
if (isset($_SESSION['aid']))
{
if (isset($_POST['a_key'])) {
$act_key = trim((isset($_POST['act_key']) ? $_POST['act_key'] : ''));
$points = trim((isset($_POST['points']) ? $_POST['points'] : ''));
$actkey = doQuery("INSERT INTO item_key (act_key,wasted,points) VALUES ('$act_key','0','.$points.')", DATABASE_WEBSITE);
if(!$actkey)
{
$oSmarty->assign('message', array( 'type' => 'error',
'messages' => array( 'Error key' ) ) );
}
else
{
$oSmarty->assign('message', array( 'type' => 'ok',
'messages' => array( 'Your key has been succesful actived!' ) ) );
}
}
}
else
{
$oSmarty->assign('message', array( 'type' => 'error',
'messages' => array( 'Please log-in to acces this feature!.' ) ) );
}
all'interno della pagina visualizzo l'errore "Error key"
e se controllo il database infatti non viene compilata nessuna riga :incazz2:
Matteo.