글 수 32
<?
echo("
<form action='$PHP_SELF' method='post'>
<input type='hidden' name='aaa' value='ttt'>
<input type='text' name='a'>
<input type='text' name='b'>
<input type='text' name='c'>
<input type='text' name='d'>
<input type='text' name='e'>
<input type='text' name='f'>
<input type='submit'>
</form>
");
if($aaa == "ttt")
{
$sql = "insert into tttt values('";
$max_count = count($_POST);
$i=1;
foreach($_POST as $key => $value)
{
if($key != "aaa")
{
if($i == $max_count)
$sql .= $value."'";
else
$sql .= $value."','";
}
$i++;
}
echo("$sql");
}
?>
echo("
<form action='$PHP_SELF' method='post'>
<input type='hidden' name='aaa' value='ttt'>
<input type='text' name='a'>
<input type='text' name='b'>
<input type='text' name='c'>
<input type='text' name='d'>
<input type='text' name='e'>
<input type='text' name='f'>
<input type='submit'>
</form>
");
if($aaa == "ttt")
{
$sql = "insert into tttt values('";
$max_count = count($_POST);
$i=1;
foreach($_POST as $key => $value)
{
if($key != "aaa")
{
if($i == $max_count)
$sql .= $value."'";
else
$sql .= $value."','";
}
$i++;
}
echo("$sql");
}
?>










프로그래밍언어

php 


