[php]<form name="form1" action="<? $_SERVER['PHP_SELF'];?>" method="post">
<input type="submit" value="add" name="ram" onClick='window .open("data_add ed.php", "", "width=350, height=100, scrollbars=1"); cal("ram")'>
<input type="hidden" name="popup" value="popup_" />
function cal(i)
{
document.form1. popup.value = i;
}
</form>
/*************** ******data_adde d.php********** *************** ***/
<?
$popup = trim($_REQUEST['popup']);
//echo "popup = ".$popup;
switch($popup)
{
case "ram": $tbl = "tbl_ram"; break;
default: break;
}
if ($popup == "ram")
{$title = "Ram";}
if (trim($_REQUEST['btnEnter']) == "Add")
{
if (trim($_REQUEST['txtadd']) <> "")
{
$txtadd = trim($_REQUEST['txtadd']);
$result = "SELECT * FROM ".$tbl;
$query = "INSERT INTO ".$tbl." VALUES ('0','$txtadd') ";
if (!$query)
{echo die(mysql_error ());}
}
}
?>[/php]
my coding can't show out in "data_added.php ". may i know what happened?
thank you.
<input type="submit" value="add" name="ram" onClick='window .open("data_add ed.php", "", "width=350, height=100, scrollbars=1"); cal("ram")'>
<input type="hidden" name="popup" value="popup_" />
function cal(i)
{
document.form1. popup.value = i;
}
</form>
/*************** ******data_adde d.php********** *************** ***/
<?
$popup = trim($_REQUEST['popup']);
//echo "popup = ".$popup;
switch($popup)
{
case "ram": $tbl = "tbl_ram"; break;
default: break;
}
if ($popup == "ram")
{$title = "Ram";}
if (trim($_REQUEST['btnEnter']) == "Add")
{
if (trim($_REQUEST['txtadd']) <> "")
{
$txtadd = trim($_REQUEST['txtadd']);
$result = "SELECT * FROM ".$tbl;
$query = "INSERT INTO ".$tbl." VALUES ('0','$txtadd') ";
if (!$query)
{echo die(mysql_error ());}
}
}
?>[/php]
my coding can't show out in "data_added.php ". may i know what happened?
thank you.
Comment