Citat:
Originalno napisao Blood
uh..nista te nisam razumeo...
|
Ako je forma na strani koja na submit inicira Iframe:
PHP kôd:
//deo forme
<div> <?php
$x=1;
echo "<a href=\"category.php?x=\"$x\"\" target=\"_self\" ><font color=\"#999999\" size=\"3\">admin 1</font> </a>";
?> </div>
<div> <?php
$y=1;
echo "<a href=\"category.php?y=\"$y\"\" target=\"_self\" ><font color=\"#999999\" size=\"3\">admin 2</font> </a>";
?> </div>
</div></td>
</tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr valign="top">
<td><div>
<?php // delete !!!
if (isset($_GET['x'])) {
?>
<?php
echo "<iframe name=\"Frame2\" id=\"Frame2\" src=\"http://localhost/pro_storage/body/iframecategory2.php\"
height=\"400\" width=\"49%\" frameborder=\"2\" scrolling=\"auto\">
</iframe>";
?>
<?php // restore delite !!!
?>
<?php
echo "<iframe name=\"Frame4\" id=\"Frame4\" src=\"http://localhost/pro_storage/body/iframecategory4.php\"
height=\"400\" width=\"49%\" frameborder=\"2\" scrolling=\"auto\">
</iframe>";
?>
<?php } ?>
<?php //rename !!!
if (isset($_GET['y'])) {
?>
<?php
echo "<iframe name=\"Frame3\" id=\"Frame3\" src=\"http://localhost/pro_storage/body/iframecategory3.php\"
height=\"90\" width=\"100%\" frameborder=\"2\" scrolling=\"no\">
</iframe>";
?>
<?php // move !!!
?>
<?php
echo "<iframe name=\"Frame5\" id=\"Frame5\" src=\"http://localhost/pro_storage/body/iframecategory5.php\"
height=\"90\" width=\"100%\" frameborder=\"2\" scrolling=\"no\">
</iframe>";
?>
<?php } ?>
<?php
echo "<form name=\"form1\" action='../iframecategory4.php' method='post' target='Frame4'>";
?>
<table width="75%" border="0" cellpadding="5" cellspacing="5">
<tr align="right">
<td>
<div>
<?php
echo "<input type='submit' name=\"Submit\" value=\"Restore\" />";
?>
<?php
echo "<label>
<input type=\"checkbox\" id=\"enabler\" value=\"1\" onClick=\"enable_it()\">
</label>";
?>
<?php
echo "<input type='submit' name=\"Total\" value=\"Archive!\" disabled=\"disabled\"/>";
?>
<?php
echo "</form>";
?>
</div>
// KOD IFRAME-a SA KOGA JE NA POCETNU STRANU PREMESTENA FORMA:
PHP kôd:
<table width="75%" border="0" cellpadding="0" cellspacing="0">
<?php
$quenty=mysql_query("SELECT
category.idcat,
category.catname,
category.idsec,
category.delopt,
category.arhiva,
section.secname
FROM category, section WHERE category.delopt='1' AND category.arhiva='0' AND category.idsec=section.idsec
ORDER BY section.secname
");
while ($row=mysql_fetch_array($quenty)){
$file = strval($row['idcat']);
?>
<tr style="initial;" onMouseOver="this.className='highlight'" onMouseOut="this.className='normal'">
<td valign="top" width="20%" align="right">
<div>
<?php
echo("<font color=#999999 size=3px >" . $row[5] . " </font>");
?>
</div> </td>
<td valign="top">
<div>
<?php
echo "<input type=\"checkbox\" name=\"". $file."[]\" >";
?>
<?php
echo("<font color=#666666 size=3px >" . $row[1] . " </font>");
?>
<?php
}
?>
</div>
</td>
</tr>
</table>
<table width="75%" border="0" cellpadding="0" cellspacing="0">
<tr align="center">
<td>
<div>
<?php
include( '../includes/connect.php' );
if (isset($_POST['Submit'])) {
$t="SELECT
category.idcat,
category.catname,
category.delopt,
category.arhiva
FROM category WHERE category.delopt='1' AND category.arhiva='0' ";
$t1=mysql_query($t);
while($t2=mysql_fetch_array($t1)) {
$f = strval($t2['idcat']);
@$c=$_POST[$f];
if (!$c==""){
$f1 = intval($f);
$del="UPDATE category SET category.delopt='0' WHERE category.idcat='$f1' ";
$b=mysql_query($del);
if($b){
$o=@$b;
if ($o==true)
{$sql=mysql_query("OPTIMIZE TABLE `category`");}
{
echo "<font color=\"#666666\"font size=\"3\"><b>PONOVO STE OMOGUCILI KATEGORIJU
<META HTTP-EQUIV=\"refresh\" CONTENT=\"1; URL=iframecategory4.php\"></b></font>";
exit();
}
}
if(!$b){
{
echo "<font color=\"#666666\"font size=\"3\"><b>NISTE OMOGUCILI NAZNACENU KATEGORIJU
<META HTTP-EQUIV=\"refresh\" CONTENT=\"2; URL=iframecategory4.php\"></b></font>";
exit();
}
}
}
}
}
?>
KAKO POKUPITI OZNACEN CEHECKBOX NA iframe DA BI NA if (isset($_POST['Submit'])) {…. SA GLAVNE STRANE, OZNACEN PODATAK IZ BAZE BIO OBRISAN ILI SLICNO ?
Dok je cela forma bila na Iframe kod je naravno radio, sada nema sta da mi inicalizuje $file.