6 Replies - 1715 Views - Last Post: 21 November 2008 - 04:47 AM Rate Topic: -----

#1 shygirl15  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 40
  • Joined: 21-November 08

Imputing data into MySQL database using a form

Posted 21 November 2008 - 03:26 AM

First... Please know this isn't homework. I'm making this website to learn basicly. Also, please know that I have tried for HOURS searching google. I have did Trail and Error like crazy, and asked all those computer techy people i know.



<?php
$username="151296";
$password="puppypuppy";
$database="151296";

mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");

$last = $_COOKIE['ID_my_site']; 

$query = "SELECT*FROM wings, users where wings.Numero = users.Wing AND users.username = '" . $last ."';";

$query2 = "SELECT Wing From users where users.Wing = 0;";

$result = mysql_query($query);
$result2 = mysql_query($query2);

$num=mysql_numrows($result);
if($num == 1) {
   $row = mysql_fetch_assoc($result);
   $CC1 = $row["CC1"];
   $GB1 = $row["GB1"];
   $Radar1 = $row["Radar1"];
   $Runway1 = $row["Runway1"];
   $Factory1 = $row["Factory1"];
   $NP1 = $row["NP1"];
   $Residence1 = $row["Residence1"];   
   $PP1 = $row["PP1"];
   $Oil1 = $row["Oil1"];
$Total1 = $CC1 + $GB1 + $Radar1 + $Runway1 + $Factory1 + $NP1 + $Residence1 + $PP1 + $Oil1;

   
$CC2 = $row["CC2"];
   $GB2 = $row["GB2"];
   $Radar2 = $row["Radar2"];
   $Runway2 = $row["Runway2"];
   $Factory2 = $row["Factory2"];
   $NP2 = $row["NP2"];
   $Residence2 = $row["Residence2"];   
   $PP2 = $row["PP2"];
   $Oil2 = $row["Oil2"];
$Total2 = $CC2 + $GB2 + $Radar2 + $Runway2 + $Factory2 + $NP2 + $Residence2 + $PP2 + $Oil2;

$CC3 = $row["CC3"];
   $GB3 = $row["GB3"];
   $Radar3 = $row["Radar3"];
   $Runway3 = $row["Runway3"];
   $Factory3 = $row["Factory3"];
   $NP3 = $row["NP3"];
   $Residence3 = $row["Residence3"];   
   $PP3 = $row["PP3"];
   $Oil3 = $row["Oil3"];
$Total3 = $CC3 + $GB3 + $Radar3 + $Runway3 + $Factory3 + $NP3 + $Residence3 + $PP3 + $Oil3;

$CC4 = $row["CC4"];
   $GB4 = $row["GB4"];
   $Radar4 = $row["Radar4"];
   $Runway4 = $row["Runway4"];
   $Factory4 = $row["Factory4"];
   $NP4 = $row["NP4"];
   $Residence4 = $row["Residence4"];   
   $PP4 = $row["PP4"];
   $Oil4 = $row["Oil4"];
$Total4 = $CC4 + $GB4 + $Radar4 + $Runway4 + $Factory4 + $NP4 + $Residence4 + $PP4 + $Oil4;

$CC5 = $row["CC5"];
   $GB5 = $row["GB5"];
   $Radar5 = $row["Radar5"];
   $Runway5 = $row["Runway5"];
   $Factory5 = $row["Factory5"];
   $NP5 = $row["NP5"];
   $Residence5 = $row["Residence5"];   
   $PP5 = $row["PP5"];
   $Oil5 = $row["Oil5"];
$Total5 = $CC5 + $GB5 + $Radar5 + $Runway5 + $Factory5 + $NP5 + $Residence5 + $PP5 + $Oil5;

$CC6 = $row["CC6"];
   $GB6 = $row["GB6"];
   $Radar6 = $row["Radar6"];
   $Runway6 = $row["Runway6"];
   $Factory6 = $row["Factory6"];
   $NP6 = $row["NP6"];
   $Residence6 = $row["Residence6"];   
   $PP6 = $row["PP6"];
   $Oil6 = $row["Oil6"];
$Total6 = $CC6 + $GB6 + $Radar6 + $Runway6 + $Factory6 + $NP6 + $Residence6 + $PP6 + $Oil6;

$CC7 = $row["CC7"];
   $GB7 = $row["GB7"];
   $Radar7 = $row["Radar7"];
   $Runway7 = $row["Runway7"];
   $Factory7 = $row["Factory7"];
   $NP7 = $row["NP7"];
   $Residence7 = $row["Residence7"];   
   $PP7 = $row["PP7"];
   $Oil7 = $row["Oil7"];
$Total7 = $CC7 + $GB7 + $Radar7 + $Runway7 + $Factory7 + $NP7 + $Residence7 + $PP7 + $Oil7;

$CC8 = $row["CC8"];
   $GB8 = $row["GB8"];
   $Radar8 = $row["Radar8"];
   $Runway8 = $row["Runway8"];
   $Factory8 = $row["Factory8"];
   $NP8 = $row["NP8"];
   $Residence8 = $row["Residence8"];   
   $PP8 = $row["PP8"];
   $Oil8 = $row["Oil8"];
$Total8 = $CC8 + $GB8 + $Radar8 + $Runway8 + $Factory8 + $NP8 + $Residence8 + $PP8 + $Oil8;

$CC9 = $row["CC9"];
   $GB9 = $row["GB9"];
   $Radar9 = $row["Radar9"];
   $Runway9 = $row["Runway9"];
   $Factory9 = $row["Factory9"];
   $NP9 = $row["NP9"];
   $Residence9 = $row["Residence9"];   
   $PP9 = $row["PP9"];
   $Oil9 = $row["Oil9"];
$Total9 = $CC9 + $GB9 + $Radar9 + $Runway9 + $Factory9 + $NP9 + $Residence9 + $PP9 + $Oil9;

   $Wingmoney = $row["Wingmoney"];

}
mysql_close();

?>





<html>
<head>
<title>
Planez
</title>
<META http-equiv="PRAGMA" content="no-cache">
<style>

BODY{font-size:8pt;font-family:Verdana,Arial,Helvetica;color:#ffffff;}
TD{font-size:8pt;}
H1{font-size:8pt;}
H2{font-size:8pt;}
INPUT{font-size:8pt;}
SELECT{font-size:8pt;}
A{color:#FFFFFF;}
A:link{text-decoration:none;}
A:visited{text-decoration:none;}
A:hover{text-decoration:underline;color:red;}
A:active{text-decoration:underline;color:red;}
IMG{border:0;}
.box{BACKGROUND-COLOR: #ffffff; BORDER-BOTTOM: black 1px solid; BORDER-LEFT:black 1px solid;  BORDER-RIGHT:black 1px solid;  BORDER-TOP:black 1px solid;   FONT-SIZE: 9pt; FONT-STYLE: normal; COLOR: #000099; HEIGHT: 20px; LINE-HEIGHT: normal; } 
</style>

</head>
<body bgcolor=#000000 topmargin=0 leftmargin=0 marginheight=0 marginwidth=0>


<font color=#FFFFFF face=Verdana,Arial size=1>
<font size=4>
<b>


<?if ($result2 == 0)
echo $result2; ?>

Infrastructure
</b>
</font>
<br>
Show buildings in your wing sectors
<br>
Maximum number of buildings per sector: 
<font color=#00ff33>
300
</font>
( max = 250 + #members x 5 )
<br>
Minimum number of buildings per sector: 
<font color=yellow>
150
</font>
<br>
Wing cannot have more than 
<font color=yellow>
50
</font>
 buildings of the same type in each sector.
<br>
Buildings in 
<font color="gray">
gray
</font> color needs other building for functioning.
<p>
<table border=1 cellspacing=0 cellspacing=0 bordercolor=#00ff33 cellspacing=0>


<tr>
<td align=center valign=top width=150 height=60>

( total : 



<?php

if( $Total1 < 51 ){
echo("<font color=red> $Total1 </font> )");

}else if( $Total1 < 300 ){
echo("<font color=#33CCFF> $Total1 </font> )");

}else if( $Total1 = 300 ){
echo("<font color=green> $Total1) </font> )");


}


?>



<br>
<font color="FFFFFF">



















































<? if ($CC1 == 0)
echo "";
else
echo "Command Center (x " . $CC1 . ")<br>"; ?>

<? if ($GB1 == 0)
echo "";
else
echo "Government Bldg. (x" . $GB1 . ")<br>"; ?>

<? if ($Radar1 == 0)
echo "";
else
echo "Radar Station (x" . $Radar1 . ")<br>"; ?>

<? if ($Runway1 == 0)
echo "";
else
echo "Runway (x" . $Runway1 . ")<br>"; ?>

<? if ($Factory1 == 0)
echo "";
else
echo "Factory (x" . $Factory1 . ")<br>"; ?>

<? if ($NP1 == 0)
echo "";
else
echo "Nuclear Plant (x" . $NP1 . ")<br>"; ?>

<? if ($Residence1 == 0)
echo "";
else
echo "Residence (x" . $Residence1 . ")<br>"; ?>

<? if ($PP1 == 0)
echo "";
else
echo "Power Plant (x" . $PP1 . ")<br>"; ?>

<? if ($Oil1 == 0)
echo "";
else
echo "Oil Refinery (x" . $Oil1 . ")<br>"; ?>













</font>
<br>

</td>
<td align=center valign=top width=150 height=60>



( total : 

<?php

if( $Total2 < 51 ){
echo("<font color=red> $Total2 </font> )");

}else if( $Total2 < 300 ){
echo("<font color=#33CCFF> $Total2 </font> )");

}else if( $Total2 = 300 ){
echo("<font color=green> $Total2 </font> )");


}


?>

<br>
<font color="FFFFFF">

















<? if ($CC2 == 0)
echo "";
else
echo "Command Center (x " . $CC2 . ")<br>"; ?>

<? if ($GB2 == 0)
echo "";
else
echo "Government Bldg. (x" . $GB2 . ")<br>"; ?>

<? if ($Radar2 == 0)
echo "";
else
echo "Radar Station (x" . $Radar2 . ")<br>"; ?>

<? if ($Runway2 == 0)
echo "";
else
echo "Runway (x" . $Runway2 . ")<br>"; ?>

<? if ($Factory2 == 0)
echo "";
else
echo "Factory (x" . $Factory2 . ")<br>"; ?>

<? if ($NP2 == 0)
echo "";
else
echo "Nuclear Plant (x" . $NP2 . ")<br>"; ?>

<? if ($Residence2 == 0)
echo "";
else
echo "Residence (x" . $Residence2 . ")<br>"; ?>

<? if ($PP2 == 0)
echo "";
else
echo "Power Plant (x" . $PP2 . ")<br>"; ?>

<? if ($Oil2 == 0)
echo "";
else
echo "Oil Refinery (x" . $Oil2 . ")<br>"; ?>



















</font>
<br>

</td>
<td align=center valign=top width=150 height=60>
( total : 

<?php

if( $Total3 < 51 ){
echo("<font color=red> $Total3 </font> )");

}else if( $Total3 < 300 ){
echo("<font color=#33CCFF> $Total3 </font> )");

}else if( $Total3 = 300 ){
echo("<font color=green> $Total3 </font> )");


}


?>


<br>
<font color="FFFFFF">











<? if ($CC3 == 0)
echo "";
else
echo "Command Center (x " . $CC3 . ")<br>"; ?>

<? if ($GB3 == 0)
echo "";
else
echo "Government Bldg. (x" . $GB3 . ")<br>"; ?>

<? if ($Radar3 == 0)
echo "";
else
echo "Radar Station (x" . $Radar3 . ")<br>"; ?>

<? if ($Runway3 == 0)
echo "";
else
echo "Runway (x" . $Runway3 . ")<br>"; ?>

<? if ($Factory3 == 0)
echo "";
else
echo "Factory (x" . $Factory3 . ")<br>"; ?>

<? if ($NP3 == 0)
echo "";
else
echo "Nuclear Plant (x" . $NP3 . ")<br>"; ?>

<? if ($Residence3 == 0)
echo "";
else
echo "Residence (x" . $Residence3 . ")<br>"; ?>

<? if ($PP3 == 0)
echo "";
else
echo "Power Plant (x" . $PP3 . ")<br>"; ?>

<? if ($Oil3 == 0)
echo "";
else
echo "Oil Refinery (x" . $Oil3 . ")<br>"; ?>


















</font>
<br>
 
</td>
</tr>
<tr>
<td align=center valign=top width=150 height=60>
( total : 

<?php

if( $Total4 < 51 ){
echo("<font color=red> $Total4 </font> )");

}else if( $Total4 < 300 ){
echo("<font color=#33CCFF> $Total4 </font> )");

}else if( $Total4 = 300 ){
echo("<font color=green> $Total4 </font> )");


}


?>

<br>
<font color="FFFFFF">











<? if ($CC4 == 0)
echo "";
else
echo "Command Center (x " . $CC4 . ")<br>"; ?>

<? if ($GB4 == 0)
echo "";
else
echo "Government Bldg. (x" . $GB4 . ")<br>"; ?>

<? if ($Radar4 == 0)
echo "";
else
echo "Radar Station (x" . $Radar4 . ")<br>"; ?>

<? if ($Runway4 == 0)
echo "";
else
echo "Runway (x" . $Runway4 . ")<br>"; ?>

<? if ($Factory4 == 0)
echo "";
else
echo "Factory (x" . $Factory4 . ")<br>"; ?>

<? if ($NP4 == 0)
echo "";
else
echo "Nuclear Plant (x" . $NP4 . ")<br>"; ?>

<? if ($Residence4 == 0)
echo "";
else
echo "Residence (x" . $Residence4 . ")<br>"; ?>

<? if ($PP4 == 0)
echo "";
else
echo "Power Plant (x" . $PP4 . ")<br>"; ?>

<? if ($Oil4 == 0)
echo "";
else
echo "Oil Refinery (x" . $Oil4 . ")<br>"; ?>

















</font>
<br>
 
</td>
<td align=center valign=top width=150 height=60>
( total : 

<?php

if( $Total5 < 51 ){
echo("<font color=red> $Total5 </font> )");

}else if( $Total5 < 300 ){
echo("<font color=#33CCFF> $Total5 </font> )");

}else if( $Total5 = 300 ){
echo("<font color=green> $Total5 </font> )");


}


?>

<br>
<font color="FFFFFF">










<? if ($CC5 == 0)
echo "";
else
echo "Command Center (x " . $CC5 . ")<br>"; ?>

<? if ($GB5 == 0)
echo "";
else
echo "Government Bldg. (x" . $GB5 . ")<br>"; ?>

<? if ($Radar5 == 0)
echo "";
else
echo "Radar Station (x" . $Radar5 . ")<br>"; ?>

<? if ($Runway5 == 0)
echo "";
else
echo "Runway (x" . $Runway5 . ")<br>"; ?>

<? if ($Factory5 == 0)
echo "";
else
echo "Factory (x" . $Factory5 . ")<br>"; ?>

<? if ($NP5 == 0)
echo "";
else
echo "Nuclear Plant (x" . $NP5 . ")<br>"; ?>

<? if ($Residence5 == 0)
echo "";
else
echo "Residence (x" . $Residence5 . ")<br>"; ?>

<? if ($PP5 == 0)
echo "";
else
echo "Power Plant (x" . $PP5 . ")<br>"; ?>

<? if ($Oil5 == 0)
echo "";
else
echo "Oil Refinery (x" . $Oil5 . ")<br>"; ?>











</font>
<br>
 
</td>
<td align=center valign=top width=150 height=60>
( total : 

<?php

if( $Total6 < 51 ){
echo("<font color=red> $Total6 </font> )");

}else if( $Total6 < 300 ){
echo("<font color=#33CCFF> $Total6 </font> )");

}else if( $Total6 = 300 ){
echo("<font color=green> $Total6 </font> )");


}


?>

<br>
<font color="FFFFFF">













<? if ($CC6 == 0)
echo "";
else
echo "Command Center (x " . $CC6 . ")<br>"; ?>

<? if ($GB6 == 0)
echo "";
else
echo "Government Bldg. (x" . $GB6 . ")<br>"; ?>

<? if ($Radar6 == 0)
echo "";
else
echo "Radar Station (x" . $Radar6 . ")<br>"; ?>

<? if ($Runway6 == 0)
echo "";
else
echo "Runway (x" . $Runway6 . ")<br>"; ?>

<? if ($Factory6 == 0)
echo "";
else
echo "Factory (x" . $Factory6 . ")<br>"; ?>

<? if ($NP6 == 0)
echo "";
else
echo "Nuclear Plant (x" . $NP6 . ")<br>"; ?>

<? if ($Residence6 == 0)
echo "";
else
echo "Residence (x" . $Residence6 . ")<br>"; ?>

<? if ($PP6 == 0)
echo "";
else
echo "Power Plant (x" . $PP6 . ")<br>"; ?>

<? if ($Oil6 == 0)
echo "";
else
echo "Oil Refinery (x" . $Oil6 . ")<br>"; ?>












</font>
<br>
 
</td>
</tr>
<tr>
<td align=center valign=top width=150 height=60>
( total : 

<?php

if( $Total7 < 51 ){
echo("<font color=red> $Total7 </font> )");

}else if( $Total7 < 300 ){
echo("<font color=#33CCFF> $Total7 </font> )");

}else if( $Total7 = 300 ){
echo("<font color=green> $Total7 </font> )");


}


?>

<br>
<font color="FFFFFF">





















<? if ($CC7 == 0)
echo "";
else
echo "Command Center (x " . $CC7 . ")<br>"; ?>

<? if ($GB7 == 0)
echo "";
else
echo "Government Bldg. (x" . $GB7 . ")<br>"; ?>

<? if ($Radar7 == 0)
echo "";
else
echo "Radar Station (x" . $Radar7 . ")<br>"; ?>

<? if ($Runway7 == 0)
echo "";
else
echo "Runway (x" . $Runway7 . ")<br>"; ?>

<? if ($Factory7 == 0)
echo "";
else
echo "Factory (x" . $Factory7 . ")<br>"; ?>

<? if ($NP7 == 0)
echo "";
else
echo "Nuclear Plant (x" . $NP7 . ")<br>"; ?>

<? if ($Residence7 == 0)
echo "";
else
echo "Residence (x" . $Residence7 . ")<br>"; ?>

<? if ($PP7 == 0)
echo "";
else
echo "Power Plant (x" . $PP7 . ")<br>"; ?>

<? if ($Oil7 == 0)
echo "";
else
echo "Oil Refinery (x" . $Oil7 . ")<br>"; ?>





















</font>
<br> 
</td>
<td align=center valign=top width=150 height=60>
( total : 

<?php

if( $Total8 < 51 ){
echo("<font color=red> $Total8 </font> )");

}else if( $Total8 < 300 ){
echo("<font color=#33CCFF> $Total8 </font> )");

}else if( $Total8 = 300 ){
echo("<font color=green> $Total8 </font> )");


}


?>

<br>
<font color="FFFFFF">













<? if ($CC8 == 0)
echo "";
else
echo "Command Center (x " . $CC8 . ")<br>"; ?>

<? if ($GB8 == 0)
echo "";
else
echo "Government Bldg. (x" . $GB8 . ")<br>"; ?>

<? if ($Radar8 == 0)
echo "";
else
echo "Radar Station (x" . $Radar8 . ")<br>"; ?>

<? if ($Runway8 == 0)
echo "";
else
echo "Runway (x" . $Runway8 . ")<br>"; ?>

<? if ($Factory8 == 0)
echo "";
else
echo "Factory (x" . $Factory8 . ")<br>"; ?>

<? if ($NP8 == 0)
echo "";
else
echo "Nuclear Plant (x" . $NP8 . ")<br>"; ?>

<? if ($Residence8 == 0)
echo "";
else
echo "Residence (x" . $Residence8 . ")<br>"; ?>

<? if ($PP8 == 0)
echo "";
else
echo "Power Plant (x" . $PP8 . ")<br>"; ?>

<? if ($Oil8 == 0)
echo "";
else
echo "Oil Refinery (x" . $Oil8 . ")<br>"; ?>














</font>
<br>

</td>
<td align=center valign=top width=150 height=60>
( total : 

<?php

if( $Total9 < 51 ){
echo("<font color=red> $Total9 </font> )");

}else if( $Total9 < 300 ){
echo("<font color=#33CCFF> $Total9 </font> )");

}else if( $Total9 = 300 ){
echo("<font color=green> $Total9 </font> )");


}


?>

<br>
<font color="FFFFFF">










<? if ($CC9 == 0)
echo "";
else
echo "Command Center (x " . $CC9 . ")<br>"; ?>

<? if ($GB9 == 0)
echo "";
else
echo "Government Bldg. (x" . $GB9 . ")<br>"; ?>

<? if ($Radar9 == 0)
echo "";
else
echo "Radar Station (x" . $Radar9 . ")<br>"; ?>

<? if ($Runway9 == 0)
echo "";
else
echo "Runway (x" . $Runway9 . ")<br>"; ?>

<? if ($Factory9 == 0)
echo "";
else
echo "Factory (x" . $Factory9 . ")<br>"; ?>

<? if ($NP9 == 0)
echo "";
else
echo "Nuclear Plant (x" . $NP9 . ")<br>"; ?>

<? if ($Residence9 == 0)
echo "";
else
echo "Residence (x" . $Residence9 . ")<br>"; ?>

<? if ($PP9 == 0)
echo "";
else
echo "Power Plant (x" . $PP9 . ")<br>"; ?>

<? if ($Oil9 == 0)
echo "";
else
echo "Oil Refinery (x" . $Oil9 . ")<br>"; ?>











</font>
<br> 
</td>
</tr>
</table>
<table border=0 width=95% cellpadding=5>
<tr>

<form action="114.nus" method="post" name="buy">
<input type="hidden" name="cmd" value="113">
<input type="hidden" name="x" value="1">
<input type="hidden" name="y" value="1">
<td>
<font color=#FFFFFF face=Verdana,Arial size=2>
<strong>
Build structures
</strong>
<br>
<font size=1>
Commander can build everywhere. Other pilots can only build buildings in the sector of their defensive disposition.
</td>
<td bgcolor=#292929 align=center>
<font color=#FFFFFF face=Verdana,Arial size=1>
<strong>
Wing Money:
</strong>
<br>
<?=$Wingmoney?>
</td>
<td>
<font color=#FFFFFF face=Verdana,Arial size=1>
			Click Area to build
<br>
			<img border=0 src="eww5.gif" usemap="#MAP" name=sector alt=BOO>
			<map name="MAP">
			<area shape="rect" coords="1,1,23,21" href="infra1.php" >
			<area shape="rect" coords="24,1,44,21" href="infra2.php" >
			<area shape="rect" coords="45,1,66,20" href="infra3.php" >
			<area shape="rect" coords="1,22,23,43" href="infra4.php" >
			<area shape="rect" coords="24,22,44,43" href="infra5.php" >
			<area shape="rect" coords="45,22,65,43" href="infra6.php" >
			<area shape="rect" coords="1,44,23,64" href="infra7.php" >
			<area shape="rect" coords="24,44,44,64" href="infra8.php" >
			<area shape="rect" coords="45,44,65,64" href="infra9.php" >
			</map>
		</td>
	</tr>
</table>

<font color=#FFFFFF face=Verdana,Arial size=2>



















<?----soooooo lost----------->
$cons = "INSERT INTO wings (CC1, GB1, Radar1, Runway1, Factory1, NP1, Residence1, PP1, Oil1)
VALUES ('".$_POST['1']."', '".$_POST['2']."',".$_POST['3']."', ".$_POST['4']."', ".$_POST['5']."', ".$_POST['6']."', ".$_POST['7']."', ".$_POST['8']."',)";

$result = mysql_query($query);



<?--------pray for a miracle--->

<input style="font-size:8pt;" type=button name=cons value=Construct onclick="Go(1,this.form);"> 
 / 
 <input style="font-size:8pt;" type=button name=dest value=Destroy onclick="Go(0,this.form);"> buildings to highlighted sector




<table border=1 bordercolor=#003399 cellspacing=0 width=95%>
	<tr align=center bgcolor=#003399>
		<td><font size=1>Name</td>
		<td><font size=1>Hit<br>Point</td>
		<td><font size=1>Armor</td>
		<td><font size=1>Price<td wrap=><font size=1>Amount</td>
		<td><font size=1>Description</td>
		<td><font size=1>Dependency</td>
	</tr>
			
<input type=hidden name="cc[1]" value=1>
<tr align=center>
	<td><font size=1>Command Center</td>
	<td><font size=1>2200</td>
	<td><font size=1>25</td>
	<td><font size=1>10000</td>
	<td nowrap>
		<img border=0 src=up.gif onclick="UpDown(2,1);">




		<input name="[1]" type=text size=3 maxlength=3 value=0>






		<img border=0 src=down.gif onclick="UpDown(2,0);">
	</td>
	<td><font size=1>Defensive structures and aircraft controlled by computer can attack enemy</td>
	<td><font size=1> </td>
</tr>









					
<input type=hidden name="gb[2]" value=2>
<tr align=center>
	<td><font size=1>Government Bldg.</td>
	<td><font size=1>1500</td>
	<td><font size=1>20</td>
	<td><font size=1>9000</td>
	<td nowrap>
		<img border=0 src=up.gif onclick="UpDown(3,1);">


<input name="[2]" type=text size=3 maxlength=3 value=0>




		<img border=0 src=down.gif onclick="UpDown(3,0);">
	</td>
	<td><font size=1>Collect tax from residence, 100 credits per residence</td>
	<td><font size=1> </td>
</tr>







					
<input type=hidden name="radar[3]" value=3>
<tr align=center>
	<td><font size=1>Radar Station</td>
	<td><font size=1>500</td>
	<td><font size=1>25</td>
	<td><font size=1>3000</td>
	<td nowrap>
		<img border=0 src=up.gif onclick="UpDown(4,1);">
		<input name="[3]" type=text size=3 maxlength=3 value=0>
		<img border=0 src=down.gif onclick="UpDown(4,0);">
	</td>
	<td><font size=1>Your wing radar while in base</td>
	<td><font size=1>Power Plant/Nuclear Power Plant</td>
</tr>
					
<input type=hidden name="Runway[4]" value=4>
<tr align=center>
	<td><font size=1>Runway</td>
	<td><font size=1>350</td>
	<td><font size=1>5</td>
	<td><font size=1>1000</td>
	<td nowrap>
		<img border=0 src=up.gif onclick="UpDown(5,1);">
		<input name="[4]" type=text size=3 maxlength=3 value=0>
		<img border=0 src=down.gif onclick="UpDown(5,0);">
	</td>
	<td><font size=1>Needed for your aircraft to take off</td>
	<td><font size=1></td>
</tr>
					
<input type=hidden name="Factory[5]" value=5>
<tr align=center>
	<td><font size=1>Factory</td>
	<td><font size=1>800</td>
	<td><font size=1>10</td>
	<td><font size=1>1000</td>
	<td nowrap>
		<img border=0 src=up.gif onclick="UpDown(6,1);">
		<input name="[5]" type=text size=3 maxlength=3 value=0>
		<img border=0 src=down.gif onclick="UpDown(6,0);">
	</td>
	<td><font size=1>Needed to buy defensive structures;<br>Produce aircraft controlled by computer automatically</td>
	<td><font size=1>Residence, Highway, Power Plant/Nuclear Power Plant</td>
</tr>
					
<input type=hidden name="np[6]" value=6>
<tr align=center>
	<td><font size=1>Nuclear Plant</td>
	<td><font size=1>500</td>
	<td><font size=1>15</td>
	<td><font size=1>5000</td>
	<td nowrap>
		<img border=0 src=up.gif onclick="UpDown(7,1);">
		<input name="[6]" type=text size=3 maxlength=3 value=0>
		<img border=0 src=down.gif onclick="UpDown(7,0);">
	</td>
	<td><font size=1>Supplies power for factory and radar station</td>
	<td><font size=1>Residence, Highway</td>
</tr>
					
<input type=hidden name="Residence[7]" value=7>
<tr align=center>
	<td><font size=1>Residence</td>
	<td><font size=1>500</td>
	<td><font size=1>4</td>
	<td><font size=1>1500</td>
	<td nowrap>
		<img border=0 src=up.gif onclick="UpDown(8,1);">
		<input name="[7]" type=text size=3 maxlength=3 value=0>
		<img border=0 src=down.gif onclick="UpDown(8,0);">
	</td>
	<td><font size=1>Supplies workers for factory, oil refinery and (nuclear) power plant</td>
	<td><font size=1></td>
</tr>
					
<input type=hidden name="pp[8]" value=8>
<tr align=center>
	<td><font size=1>Power Plant</td>
	<td><font size=1>700</td>
	<td><font size=1>12</td>
	<td><font size=1>1000</td>
	<td nowrap>
		<img border=0 src=up.gif onclick="UpDown(9,1);">
		<input name="[8]" type=text size=3 maxlength=3 value=0>
		<img border=0 src=down.gif onclick="UpDown(9,0);">
	</td>
	<td><font size=1>Supplies power for factory and radar station</td>
	<td><font size=1>Residence, Oil Refinery, Highway</td>
</tr>
					
<input type=hidden name="[9]" value=9>
<tr align=center>
	<td><font size=1>Oil Refinery</td>
	<td><font size=1>700</td>
	<td><font size=1>8</td>
	<td><font size=1>1000</td>
	<td nowrap>
		<img border=0 src=up.gif onclick="UpDown(10,1);">
		<input name="amount[]" type=text size=3 maxlength=3 value=0>
		<img border=0 src=down.gif onclick="UpDown(10,0);">
	</td>
	<td><font size=1>Produces fuel for power plant, enables cheaper fuel</td>
	<td><font size=1>Residence, Highway</td>
</tr>




























Basicly, that place where I wrote "i'm so lost." That is causing the entire screen to turn grey. Obviously becasue it is totally random. This is because i'm not a good programmer at all.


My intent is to use a form to to modify the database. I have named each text fiend "[1], [2], all the way up to 8. With VALUES the same "1, 2, 3 and so on too 8.





I haven't any idea how I can connect the form to the PHP... so that it will imput what I want into the database when i press the "Cons" button.





If you would like to see what i'm talking about, the website is http://planez.orgfree.com

Username: energy
Password: puppy

Click infrastructure.

The form at the bottom is what i'm trying to make work.



I'd REALLY appreciate some help with this... i'm dead in my tracks right now.

This post has been edited by shygirl15: 21 November 2008 - 03:34 AM


Is This A Good Question/Topic? 0
  • +

Replies To: Imputing data into MySQL database using a form

#2 no2pencil  Icon User is offline

  • Admiral Fancy Pants
  • member icon

Reputation: 5388
  • View blog
  • Posts: 27,384
  • Joined: 10-May 07

Re: Imputing data into MySQL database using a form

Posted 21 November 2008 - 03:37 AM

View Postshygirl15, on 21 Nov, 2008 - 04:26 AM, said:

I'd REALLY appreciate some help with this... i'm dead in my tracks right now.


Always verify the Post values before using them.

<?php

if(!isset($_POST['1'])) die("Post one was not set");
if(!isset($_POST['2'])) die("Post two was not set");
if(!isset($_POST['3'])) die("Post three was not set");
if(!isset($_POST['4'])) die("Post four was not set");
if(!isset($_POST['5'])) die("Post five was not set");
if(!isset($_POST['6'])) die("Post six was not set");
if(!isset($_POST['7'])) die("Post seven was not set");
if(!isset($_POST['8'])) die("Post eight was not set");
// If we got this far, they all have some sort of data... lets take a look 1st
echo "Going to fill the database with the following information ";
echo "<p>".$_POST['1']."</p>";
echo "<p>".$_POST['2']."</p>";
echo "<p>".$_POST['3']."</p>";
echo "<p>".$_POST['4']."</p>";
echo "<p>".$_POST['5']."</p>";
echo "<p>".$_POST['6']."</p>";
echo "<p>".$_POST['7']."</p>";
echo "<p>".$_POST['8']."</p>";

$cons = "INSERT INTO wings (CC1, GB1, Radar1, Runway1, Factory1, NP1, Residence1, PP1, Oil1)
VALUES ('".$_POST[1]."', '".$_POST[2]."',".$_POST[3]."', ".$_POST[4]."', ".$_POST[5]."', ".$_POST[6]."', ".$_POST[7]."', ".$_POST[8]."',)";

$result = mysql_query($query);
?>



Now then, your real error is in the insert command. You can't use the single quotes inside the post array, since mysql will be looking for the 2nd single quote to end the value segment.

It will see this :

VALUES(' <-- start single quote
" <-- start double quote
.$_POST[' <-- end single quote
1]." <-- end double quote, why is it outside of the single quotes, expecting comma
Was This Post Helpful? 0
  • +
  • -

#3 shygirl15  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 40
  • Joined: 21-November 08

Re: Imputing data into MySQL database using a form

Posted 21 November 2008 - 03:43 AM

View Postno2pencil, on 21 Nov, 2008 - 02:37 AM, said:

View Postshygirl15, on 21 Nov, 2008 - 04:26 AM, said:

I'd REALLY appreciate some help with this... i'm dead in my tracks right now.


Always verify the Post values before using them.

<?php

if(!isset($_POST['1'])) die("Post one was not set");
if(!isset($_POST['2'])) die("Post two was not set");
if(!isset($_POST['3'])) die("Post three was not set");
if(!isset($_POST['4'])) die("Post four was not set");
if(!isset($_POST['5'])) die("Post five was not set");
if(!isset($_POST['6'])) die("Post six was not set");
if(!isset($_POST['7'])) die("Post seven was not set");
if(!isset($_POST['8'])) die("Post eight was not set");
// If we got this far, they all have some sort of data... lets take a look 1st
echo "Going to fill the database with the following information ";
echo "<p>".$_POST['1']."</p>";
echo "<p>".$_POST['2']."</p>";
echo "<p>".$_POST['3']."</p>";
echo "<p>".$_POST['4']."</p>";
echo "<p>".$_POST['5']."</p>";
echo "<p>".$_POST['6']."</p>";
echo "<p>".$_POST['7']."</p>";
echo "<p>".$_POST['8']."</p>";

$cons = "INSERT INTO wings (CC1, GB1, Radar1, Runway1, Factory1, NP1, Residence1, PP1, Oil1)
VALUES ('".$_POST[1]."', '".$_POST[2]."',".$_POST[3]."', ".$_POST[4]."', ".$_POST[5]."', ".$_POST[6]."', ".$_POST[7]."', ".$_POST[8]."',)";

$result = mysql_query($query);
?>



Now then, your real error is in the insert command. You can't use the single quotes inside the post array, since mysql will be looking for the 2nd single quote to end the value segment.

It will see this :

VALUES(' <-- start single quote
" <-- start double quote
.$_POST[' <-- end single quote
1]." <-- end double quote, why is it outside of the single quotes, expecting comma












I'm sorry. I didn't mean to post the entire page of code. I tried to delete it, and when highlight it, and press backspace... it goes back.. like the WEBpage.. goes back.. so w.e


My problem isnt with the Echos.. i know they are flawed... but my problem is the bottom.. where the form is.. where you see the <?------- hope this works---->

thanks for your quick response though. I am so so so excited to get this fixed.. but 5:30am.. and i havent had ANY progress all night lol


LOL!

OMG, im so sorry! Wow, I am so embarassed. That code you posted was some kind of error finding program that found out what was wrong with my code.

Again, i'm sorry. I really am clueless lol.
Was This Post Helpful? 0
  • +
  • -

#4 no2pencil  Icon User is offline

  • Admiral Fancy Pants
  • member icon

Reputation: 5388
  • View blog
  • Posts: 27,384
  • Joined: 10-May 07

Re: Imputing data into MySQL database using a form

Posted 21 November 2008 - 03:47 AM

View Postshygirl15, on 21 Nov, 2008 - 04:43 AM, said:

My problem isnt with the Echos.. i know they are flawed... but my problem is the bottom.. where the form is.. where you see the <?------- hope this works---->

I don't see any "hope this works". I do see "pray for a miracle".

In your code, you start a form:

<form action="114.nus" method="post" name="buy">

& this is what the input buttons are for. However, I don't see a submit button, nor do I see the end form. As well, what is 114.nus? Is that the name of the file you posted the code from? I have never seen a file type of nus before. I would be expecting it to be php.
Was This Post Helpful? 1

#5 shygirl15  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 40
  • Joined: 21-November 08

Re: Imputing data into MySQL database using a form

Posted 21 November 2008 - 03:57 AM

Ok. I did notice that I didn't close the form.


What I did to correct this, is that I closed the prior form.

Then I started a new form.

<form action="imput" method="post" name="cons">


<?----soooooo lost----------->

$cons = "INSERT INTO wings (CC1, GB1, Radar1, Runway1, Factory1, NP1, Residence1, PP1, Oil1)
VALUES ('".$_POST['1']."', '".$_POST['2']."',".$_POST['3']."', ".$_POST['4']."', ".$_POST['5']."', ".$_POST['6']."', ".$_POST['7']."', ".$_POST['8']."',)";

$result = mysql_query($query);



<?--------pray for a miracle--->

<input style="font-size:8pt;" type=button name=cons value=Construct onclick="Go(1,this.form);"> 
 / 
 <input style="font-size:8pt;" type=button name=dest value=Destroy onclick="Go(0,this.form);"> buildings to highlighted sector




<table border=1 bordercolor=#003399 cellspacing=0 width=95%>
	<tr align=center bgcolor=#003399>
		<td><font size=1>Name</td>
		<td><font size=1>Hit<br>Point</td>
		<td><font size=1>Armor</td>
		<td><font size=1>Price<td wrap=><font size=1>Amount</td>
		<td><font size=1>Description</td>
		<td><font size=1>Dependency</td>
	</tr>
			
<input type=hidden name="cc[1]" value=1>
<tr align=center>
	<td><font size=1>Command Center</td>
	<td><font size=1>2200</td>
	<td><font size=1>25</td>
	<td><font size=1>10000</td>
	<td nowrap>
		<img border=0 src=up.gif onclick="UpDown(2,1);">




		<input name="[1]" type=text size=3 maxlength=3 value=0>






		<img border=0 src=down.gif onclick="UpDown(2,0);">
	</td>
	<td><font size=1>Defensive structures and aircraft controlled by computer can attack enemy</td>
	<td><font size=1> </td>
</tr>









					
<input type=hidden name="gb[2]" value=2>
<tr align=center>
	<td><font size=1>Government Bldg.</td>
	<td><font size=1>1500</td>
	<td><font size=1>20</td>
	<td><font size=1>9000</td>
	<td nowrap>
		<img border=0 src=up.gif onclick="UpDown(3,1);">


<input name="[2]" type=text size=3 maxlength=3 value=0>




		<img border=0 src=down.gif onclick="UpDown(3,0);">
	</td>
	<td><font size=1>Collect tax from residence, 100 credits per residence</td>
	<td><font size=1> </td>
</tr>







					
<input type=hidden name="radar[3]" value=3>
<tr align=center>
	<td><font size=1>Radar Station</td>
	<td><font size=1>500</td>
	<td><font size=1>25</td>
	<td><font size=1>3000</td>
	<td nowrap>
		<img border=0 src=up.gif onclick="UpDown(4,1);">
		<input name="[3]" type=text size=3 maxlength=3 value=0>
		<img border=0 src=down.gif onclick="UpDown(4,0);">
	</td>
	<td><font size=1>Your wing radar while in base</td>
	<td><font size=1>Power Plant/Nuclear Power Plant</td>
</tr>
					
<input type=hidden name="Runway[4]" value=4>
<tr align=center>
	<td><font size=1>Runway</td>
	<td><font size=1>350</td>
	<td><font size=1>5</td>
	<td><font size=1>1000</td>
	<td nowrap>
		<img border=0 src=up.gif onclick="UpDown(5,1);">
		<input name="[4]" type=text size=3 maxlength=3 value=0>
		<img border=0 src=down.gif onclick="UpDown(5,0);">
	</td>
	<td><font size=1>Needed for your aircraft to take off</td>
	<td><font size=1></td>
</tr>
					
<input type=hidden name="Factory[5]" value=5>
<tr align=center>
	<td><font size=1>Factory</td>
	<td><font size=1>800</td>
	<td><font size=1>10</td>
	<td><font size=1>1000</td>
	<td nowrap>
		<img border=0 src=up.gif onclick="UpDown(6,1);">
		<input name="[5]" type=text size=3 maxlength=3 value=0>
		<img border=0 src=down.gif onclick="UpDown(6,0);">
	</td>
	<td><font size=1>Needed to buy defensive structures;<br>Produce aircraft controlled by computer automatically</td>
	<td><font size=1>Residence, Highway, Power Plant/Nuclear Power Plant</td>
</tr>
					
<input type=hidden name="np[6]" value=6>
<tr align=center>
	<td><font size=1>Nuclear Plant</td>
	<td><font size=1>500</td>
	<td><font size=1>15</td>
	<td><font size=1>5000</td>
	<td nowrap>
		<img border=0 src=up.gif onclick="UpDown(7,1);">
		<input name="[6]" type=text size=3 maxlength=3 value=0>
		<img border=0 src=down.gif onclick="UpDown(7,0);">
	</td>
	<td><font size=1>Supplies power for factory and radar station</td>
	<td><font size=1>Residence, Highway</td>
</tr>
					
<input type=hidden name="Residence[7]" value=7>
<tr align=center>
	<td><font size=1>Residence</td>
	<td><font size=1>500</td>
	<td><font size=1>4</td>
	<td><font size=1>1500</td>
	<td nowrap>
		<img border=0 src=up.gif onclick="UpDown(8,1);">
		<input name="[7]" type=text size=3 maxlength=3 value=0>
		<img border=0 src=down.gif onclick="UpDown(8,0);">
	</td>
	<td><font size=1>Supplies workers for factory, oil refinery and (nuclear) power plant</td>
	<td><font size=1></td>
</tr>
					
<input type=hidden name="pp[8]" value=8>
<tr align=center>
	<td><font size=1>Power Plant</td>
	<td><font size=1>700</td>
	<td><font size=1>12</td>
	<td><font size=1>1000</td>
	<td nowrap>
		<img border=0 src=up.gif onclick="UpDown(9,1);">
		<input name="[8]" type=text size=3 maxlength=3 value=0>
		<img border=0 src=down.gif onclick="UpDown(9,0);">
	</td>
	<td><font size=1>Supplies power for factory and radar station</td>
	<td><font size=1>Residence, Oil Refinery, Highway</td>
</tr>
					
<input type=hidden name="Oil[9]" value=9>
<tr align=center>
	<td><font size=1>Oil Refinery</td>
	<td><font size=1>700</td>
	<td><font size=1>8</td>
	<td><font size=1>1000</td>
	<td nowrap>
		<img border=0 src=up.gif onclick="UpDown(10,1);">
		<input name="[9]" type=text size=3 maxlength=3 value=0>
		<img border=0 src=down.gif onclick="UpDown(10,0);">
	</td>
	<td><font size=1>Produces fuel for power plant, enables cheaper fuel</td>
	<td><font size=1>Residence, Highway</td>
</tr>




</form>






Now. When ever you see the 1,2,3,4 all those. Those are the text fields that i'm attempting to imput into the database when I press "Construct" AKA cons.
Was This Post Helpful? 0
  • +
  • -

#6 no2pencil  Icon User is offline

  • Admiral Fancy Pants
  • member icon

Reputation: 5388
  • View blog
  • Posts: 27,384
  • Joined: 10-May 07

Re: Imputing data into MySQL database using a form

Posted 21 November 2008 - 04:28 AM

You are still a bit off as to how the process works. Use the following example with the rest of your code.

<?php

/*
 *
 * Import 8 post variables
 *
 */

$err=0;
if(!isset($_POST['1'])) $err=1;
if(!isset($_POST['2'])) $err=2;
if(!isset($_POST['3'])) $err=3;
if(!isset($_POST['4'])) $err=4;
if(!isset($_POST['5'])) $err=5;
if(!isset($_POST['6'])) $err=6;
if(!isset($_POST['7'])) $err=7;
if(!isset($_POST['8'])) $err=8;
if($err!=0) {
  die("Text box ".$err." was not filled in.");
}
// If we got this far, they all have some sort of data...

$sql = "INSERT INTO wings (CC1, GB1, Radar1, Runway1, Factory1, NP1, Residence1, PP1, Oil1)
VALUES ('".$_POST[1]."', '".$_POST[2]."',".$_POST[3]."', ".$_POST[4]."', ".$_POST[5]."', ".$_POST[6]."', ".$_POST[7]."', ".$_POST[8]."',)";

$result = mysql_query($sql) or die("There was an error executing the query. ");
?>
<html><head><title>Fill 8 input boxes</title></head>
<body>
<form action="<?php echo $PHP_SELF; ?>" method="post">
<p>
<input type=text name=1></input><br>
<input type=text name=2></input><br>
<input type=text name=3></input><br>
<input type=text name=4></input><br>
<input type=text name=5></input><br>
<input type=text name=6></input><br>
<input type=text name=7></input><br>
<input type=text name=8></input><br>
</p>
<input type=submit value="Go for it!">
</form>
</body></html>


Was This Post Helpful? 1

#7 shygirl15  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 40
  • Joined: 21-November 08

Re: Imputing data into MySQL database using a form

Posted 21 November 2008 - 04:47 AM

View Postno2pencil, on 21 Nov, 2008 - 03:28 AM, said:

You are still a bit off as to how the process works. Use the following example with the rest of your code.

<?php

/*
 *
 * Import 8 post variables
 *
 */

$err=0;
if(!isset($_POST['1'])) $err=1;
if(!isset($_POST['2'])) $err=2;
if(!isset($_POST['3'])) $err=3;
if(!isset($_POST['4'])) $err=4;
if(!isset($_POST['5'])) $err=5;
if(!isset($_POST['6'])) $err=6;
if(!isset($_POST['7'])) $err=7;
if(!isset($_POST['8'])) $err=8;
if($err!=0) {
  die("Text box ".$err." was not filled in.");
}
// If we got this far, they all have some sort of data...

$sql = "INSERT INTO wings (CC1, GB1, Radar1, Runway1, Factory1, NP1, Residence1, PP1, Oil1)
VALUES ('".$_POST[1]."', '".$_POST[2]."',".$_POST[3]."', ".$_POST[4]."', ".$_POST[5]."', ".$_POST[6]."', ".$_POST[7]."', ".$_POST[8]."',)";

$result = mysql_query($sql) or die("There was an error executing the query. ");
?>
<html><head><title>Fill 8 input boxes</title></head>
<body>
<form action="<?php echo $PHP_SELF; ?>" method="post">
<p>
<input type=text name=1></input><br>
<input type=text name=2></input><br>
<input type=text name=3></input><br>
<input type=text name=4></input><br>
<input type=text name=5></input><br>
<input type=text name=6></input><br>
<input type=text name=7></input><br>
<input type=text name=8></input><br>
</p>
<input type=submit value="Go for it!">
</form>
</body></html>






Ok. Wow thank you. That pointed out SO many errors. Thank you so much. I changed everything pretty much exactly like you said. I still get a grey screen, but it's most likely my fault.

<?----soooooo lost----------->

$sql = "INSERT INTO wings (CC1, GB1, Radar1, Runway1, Factory1, NP1, Residence1, PP1, Oil1)
VALUES ('".$_POST[1]."', '".$_POST[2]."',".$_POST[3]."', ".$_POST[4]."', ".$_POST[5]."', ".$_POST[6]."', ".$_POST[7]."', ".$_POST[8]."',)";

$result = mysql_query($sql)or die








<?---form starts here--->

<form action="<?php echo $PHP_SELF; ?>" method="post">



<?--------pray for a miracle--->

<input style="font-size:8pt;" type=button name=cons value=Construct onclick="Go(1,this.form);"> 
 / 
 <input style="font-size:8pt;" type=button name=dest value=Destroy onclick="Go(0,this.form);"> buildings to highlighted sector




<table border=1 bordercolor=#003399 cellspacing=0 width=95%>
	<tr align=center bgcolor=#003399>
		<td><font size=1>Name</td>
		<td><font size=1>Hit<br>Point</td>
		<td><font size=1>Armor</td>
		<td><font size=1>Price<td wrap=><font size=1>Amount</td>
		<td><font size=1>Description</td>
		<td><font size=1>Dependency</td>
	</tr>
			
<input type=text name=1 ></imput>
<tr align=center>
	<td><font size=1>Command Center</td>
	<td><font size=1>2200</td>
	<td><font size=1>25</td>
	<td><font size=1>10000</td>
	<td nowrap>
		<img border=0 src=up.gif onclick="UpDown(2,1);">




		<input name="[1]" type=text size=3 maxlength=3 value=0>






		<img border=0 src=down.gif onclick="UpDown(2,0);">
	</td>
	<td><font size=1>Defensive structures and aircraft controlled by computer can attack enemy</td>
	<td><font size=1> </td>
</tr>









					
<input type=text name=2 ></imput>
<tr align=center>
	<td><font size=1>Government Bldg.</td>
	<td><font size=1>1500</td>
	<td><font size=1>20</td>
	<td><font size=1>9000</td>
	<td nowrap>
		<img border=0 src=up.gif onclick="UpDown(3,1);">


<input name="[2]" type=text size=3 maxlength=3 value=0>




		<img border=0 src=down.gif onclick="UpDown(3,0);">
	</td>
	<td><font size=1>Collect tax from residence, 100 credits per residence</td>
	<td><font size=1> </td>
</tr>







					
<input type=text name=3 ></imput>
<tr align=center>
	<td><font size=1>Radar Station</td>
	<td><font size=1>500</td>
	<td><font size=1>25</td>
	<td><font size=1>3000</td>
	<td nowrap>
		<img border=0 src=up.gif onclick="UpDown(4,1);">
		<input name="[3]" type=text size=3 maxlength=3 value=0>
		<img border=0 src=down.gif onclick="UpDown(4,0);">
	</td>
	<td><font size=1>Your wing radar while in base</td>
	<td><font size=1>Power Plant/Nuclear Power Plant</td>
</tr>
					
<input type=text name=4 ></imput>
<tr align=center>
	<td><font size=1>Runway</td>
	<td><font size=1>350</td>
	<td><font size=1>5</td>
	<td><font size=1>1000</td>
	<td nowrap>
		<img border=0 src=up.gif onclick="UpDown(5,1);">
		<input name="[4]" type=text size=3 maxlength=3 value=0>
		<img border=0 src=down.gif onclick="UpDown(5,0);">
	</td>
	<td><font size=1>Needed for your aircraft to take off</td>
	<td><font size=1></td>
</tr>
					
<input type=text name=5 ></imput>
<tr align=center>
	<td><font size=1>Factory</td>
	<td><font size=1>800</td>
	<td><font size=1>10</td>
	<td><font size=1>1000</td>
	<td nowrap>
		<img border=0 src=up.gif onclick="UpDown(6,1);">
		<input name="[5]" type=text size=3 maxlength=3 value=0>
		<img border=0 src=down.gif onclick="UpDown(6,0);">
	</td>
	<td><font size=1>Needed to buy defensive structures;<br>Produce aircraft controlled by computer automatically</td>
	<td><font size=1>Residence, Highway, Power Plant/Nuclear Power Plant</td>
</tr>
					
<input type=text name=6 ></imput>
<tr align=center>
	<td><font size=1>Nuclear Plant</td>
	<td><font size=1>500</td>
	<td><font size=1>15</td>
	<td><font size=1>5000</td>
	<td nowrap>
		<img border=0 src=up.gif onclick="UpDown(7,1);">
		<input name="[6]" type=text size=3 maxlength=3 value=0>
		<img border=0 src=down.gif onclick="UpDown(7,0);">
	</td>
	<td><font size=1>Supplies power for factory and radar station</td>
	<td><font size=1>Residence, Highway</td>
</tr>
					
<input type=text name=7 ></imput>
<tr align=center>
	<td><font size=1>Residence</td>
	<td><font size=1>500</td>
	<td><font size=1>4</td>
	<td><font size=1>1500</td>
	<td nowrap>
		<img border=0 src=up.gif onclick="UpDown(8,1);">
		<input name="[7]" type=text size=3 maxlength=3 value=0>
		<img border=0 src=down.gif onclick="UpDown(8,0);">
	</td>
	<td><font size=1>Supplies workers for factory, oil refinery and (nuclear) power plant</td>
	<td><font size=1></td>
</tr>
					
<input type=text name=8 ></imput>
<tr align=center>
	<td><font size=1>Power Plant</td>
	<td><font size=1>700</td>
	<td><font size=1>12</td>
	<td><font size=1>1000</td>
	<td nowrap>
		<img border=0 src=up.gif onclick="UpDown(9,1);">
		<input name="[8]" type=text size=3 maxlength=3 value=0>
		<img border=0 src=down.gif onclick="UpDown(9,0);">
	</td>
	<td><font size=1>Supplies power for factory and radar station</td>
	<td><font size=1>Residence, Oil Refinery, Highway</td>
</tr>
					
<input type=text name=9 ></imput>
<tr align=center>
	<td><font size=1>Oil Refinery</td>
	<td><font size=1>700</td>
	<td><font size=1>8</td>
	<td><font size=1>1000</td>
	<td nowrap>
		<img border=0 src=up.gif onclick="UpDown(10,1);">
		<input name="[9]" type=text size=3 maxlength=3 value=0>
		<img border=0 src=down.gif onclick="UpDown(10,0);">
	</td>
	<td><font size=1>Produces fuel for power plant, enables cheaper fuel</td>
	<td><font size=1>Residence, Highway</td>
</tr>

</p>
<input type=submit value="Go for it!">
</body></html>







<input type=submit value="Go for it!">


That party right there. Is this saposed to be the button? Can you please direct me as to how I make...


<input style="font-size:8pt;" type=button name=cons value=Construct onclick="Go(1,this.form);">




That as my button.






EDIT-----------

Ok. After looking at my code a little more... I made a couple changes... Hopefully for the better..... if not.. just tell me, and i have the prior code backed up.

<?----soooooo lost----------->

$sql = "INSERT INTO wings (CC1, GB1, Radar1, Runway1, Factory1, NP1, Residence1, PP1, Oil1)
VALUES ('".$_POST[1]."', '".$_POST[2]."',".$_POST[3]."', ".$_POST[4]."', ".$_POST[5]."', ".$_POST[6]."', ".$_POST[7]."', ".$_POST[8]."',)";

$result = mysql_query($sql)or die








<?---form starts here--->

<form action="<?php echo $PHP_SELF; ?>" method="post">



<?--------pray for a miracle--->

<input style="font-size:8pt;" type=button name=cons value=Construct onclick="Go(1,this.form);"> 
 / 
 <input style="font-size:8pt;" type=button name=dest value=Destroy onclick="Go(0,this.form);"> buildings to highlighted sector




<table border=1 bordercolor=#003399 cellspacing=0 width=95%>
	<tr align=center bgcolor=#003399>
		<td><font size=1>Name</td>
		<td><font size=1>Hit<br>Point</td>
		<td><font size=1>Armor</td>
		<td><font size=1>Price<td wrap=><font size=1>Amount</td>
		<td><font size=1>Description</td>
		<td><font size=1>Dependency</td>
	</tr>
			

<tr align=center>
	<td><font size=1>Command Center</td>
	<td><font size=1>2200</td>
	<td><font size=1>25</td>
	<td><font size=1>10000</td>
	<td nowrap>
	<img border=0 src=up.gif onclick="UpDown(2,1);">

<input type=text name=1 size=3 maxlength=3 value=0></imput>

	<img border=0 src=down.gif onclick="UpDown(2,0);">
	</td>
	<td><font size=1>Defensive structures and aircraft controlled by computer can attack enemy</td>
	<td><font size=1> </td>
</tr>









					

<tr align=center>
	<td><font size=1>Government Bldg.</td>
	<td><font size=1>1500</td>
	<td><font size=1>20</td>
	<td><font size=1>9000</td>
	<td nowrap>
	   <img border=0 src=up.gif onclick="UpDown(3,1);">


<input type=text name=2 size=3 maxlength=3 value=0></imput>




		<img border=0 src=down.gif onclick="UpDown(3,0);">
	</td>
	<td><font size=1>Collect tax from residence, 100 credits per residence</td>
	<td><font size=1> </td>
</tr>







					

<tr align=center>
	<td><font size=1>Radar Station</td>
	<td><font size=1>500</td>
	<td><font size=1>25</td>
	<td><font size=1>3000</td>
	<td nowrap>
		<img border=0 src=up.gif onclick="UpDown(4,1);">
		<input type=text name=3 size=3 maxlength=3 value=0></imput>
		<img border=0 src=down.gif onclick="UpDown(4,0);">
	</td>
	<td><font size=1>Your wing radar while in base</td>
	<td><font size=1>Power Plant/Nuclear Power Plant</td>
</tr>
					

<tr align=center>
	<td><font size=1>Runway</td>
	<td><font size=1>350</td>
	<td><font size=1>5</td>
	<td><font size=1>1000</td>
	<td nowrap>
		<img border=0 src=up.gif onclick="UpDown(5,1);">
		<input type=text name=4 size=3 maxlength=3 value=0></imput>
		<img border=0 src=down.gif onclick="UpDown(5,0);">
	</td>
	<td><font size=1>Needed for your aircraft to take off</td>
	<td><font size=1></td>
</tr>
					

<tr align=center>
	<td><font size=1>Factory</td>
	<td><font size=1>800</td>
	<td><font size=1>10</td>
	<td><font size=1>1000</td>
	<td nowrap>
		<img border=0 src=up.gif onclick="UpDown(6,1);">
		<input type=text name=5 size=3 maxlength=3 value=0></imput>
		<img border=0 src=down.gif onclick="UpDown(6,0);">
	</td>
	<td><font size=1>Needed to buy defensive structures;<br>Produce aircraft controlled by computer automatically</td>
	<td><font size=1>Residence, Highway, Power Plant/Nuclear Power Plant</td>
</tr>
					

<tr align=center>
	<td><font size=1>Nuclear Plant</td>
	<td><font size=1>500</td>
	<td><font size=1>15</td>
	<td><font size=1>5000</td>
	<td nowrap>
		<img border=0 src=up.gif onclick="UpDown(7,1);">
		<input type=text name=6 size=3 maxlength=3 value=0></imput>
		<img border=0 src=down.gif onclick="UpDown(7,0);">
	</td>
	<td><font size=1>Supplies power for factory and radar station</td>
	<td><font size=1>Residence, Highway</td>
</tr>
					

<tr align=center>
	<td><font size=1>Residence</td>
	<td><font size=1>500</td>
	<td><font size=1>4</td>
	<td><font size=1>1500</td>
	<td nowrap>
		<img border=0 src=up.gif onclick="UpDown(8,1);">
		<input type=text name=7 size=3 maxlength=3 value=0></imput>
		<img border=0 src=down.gif onclick="UpDown(8,0);">
	</td>
	<td><font size=1>Supplies workers for factory, oil refinery and (nuclear) power plant</td>
	<td><font size=1></td>
</tr>
					

<tr align=center>
	<td><font size=1>Power Plant</td>
	<td><font size=1>700</td>
	<td><font size=1>12</td>
	<td><font size=1>1000</td>
	<td nowrap>
		<img border=0 src=up.gif onclick="UpDown(9,1);">
		<input type=text name=8 size=3 maxlength=3 value=0></imput>
		<img border=0 src=down.gif onclick="UpDown(9,0);">
	</td>
	<td><font size=1>Supplies power for factory and radar station</td>
	<td><font size=1>Residence, Oil Refinery, Highway</td>
</tr>
					

<tr align=center>
	<td><font size=1>Oil Refinery</td>
	<td><font size=1>700</td>
	<td><font size=1>8</td>
	<td><font size=1>1000</td>
	<td nowrap>
		<img border=0 src=up.gif onclick="UpDown(10,1);">
		<input type=text name=9 size=3 maxlength=3 value=0></imput>
		<img border=0 src=down.gif onclick="UpDown(10,0);">
	</td>
	<td><font size=1>Produces fuel for power plant, enables cheaper fuel</td>
	<td><font size=1>Residence, Highway</td>
</tr>

</p>
<input type=submit value="Go for it!">
</body></html>






EDIT AGAIN SORRY

I turned thissssssss.....
<input type=submit value="Go for it!">







into this.....

<input style="font-size:8pt;" type=submit name=cons value=Construct onclick="Go(1,this.form);"> 


This post has been edited by shygirl15: 21 November 2008 - 05:07 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1