Parašė Gytisz· 2014 Kov. 16 22:03:58
#4
Editavau:
Kodas kuri naudoju:
<?php
require_once "../maincore.php";
include "edit.php";
if (!iADMIN) { header("Location:../index.php"); exit; }
$result = dbquery("SELECT * FROM ".DB_PREFIX."on WHERE on='".$editon."' LIMIT 0,1");
echo "<form action='index.php' method='post' enctype='multipart/form-data'><table width='10%' class='tbl'>
<tr>
<td>SWITCH ON/OFF?</td>
<td><input type='checkbox' name='on' size='70' ";
if ($data['on'] == 1) { echo "CHECKED"; }
echo "></td>
</tr>
<tr>
<td colspan='2' align='center'><input type='submit' value='".$locale['ctbs011']."' class='button'>
</td>
</td>
</table></form>";
?>
edit.php yra:
<?php
if (!iADMIN) { header("Location:../../../index.php"); exit; }
$editon = $_POST['on'];
if($on == 'on') { $naujas = 1; } else { $naujas = 0; }
$result = dbquery("UPDATE ".$db_prefix."pageidavimai SET `on` = '".$naujas."' LIMIT 1 ;"); }
else {
$result = dbquery("UPDATE ".$db_prefix."pageidavimai SET `on` = '".$naujas."' LIMIT 1 ;"); }
}
?>
Gali buti kad pievas pjaunu, nes tikrai nenuotuokiu :|
Redagavo Gytisz· 2014 Kov. 16 22:03:58