stickygoblin
06-21-2004, 04:36 AM
hi
ok trying to understand where i'm going wrong but its turning into a bit of a nightmare. its a really simple problem. I am trying to send a variable to my database and create a link and possibly a simple page but i haven't managed to get that far yet. The database is recieving a new record from the page but it isn't recieving the value of county.
page1 : insertcounty.php
<html>
<head></head>
<body>
<form name="test" method="post" action="countyinject.php">
<input type="hidden" name="CountyName" value="<? $County ?>">
<table width="500" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="30%">County Name:
<input name="County" type="text" id="County" size="12" maxlength="12">
<input type="submit" name="Submit" value="Create County"></td>
</tr>
</table>
<\form>
</body>
</html>
Page2: countyinject.php
<?php
include("config.php");
//vars section
global $sqlhost;
global $sqluser;
global $sqlpass;
global $sqldb;
$id = $_POST["id"];
$County = $_POST["County"];
$Link = $_POST["Link"];
//END Vars Section
//MYSQL DataBase Connection Section
$cnx = mysql_connect($sqlhost,$sqluser,$sqlpass);
mysql_select_db($sqldb) //This statement is required to select the database from the mysql server
or die("Invalid : " . mysql_error());
//END Database Connection Section
echo "$id<br>$County<br>runner<br>$Link<br>";
if($cnx != null)
{
$SQL_query_String = "INSERT INTO county_tbl (County, Link) VALUES ('$County','$Link')";
$cur= mysql_query($SQL_query_String )
or die("Invalid : " . mysql_error());
}
mysql_close( $cnx);
?>
County Setup Complete Please return to county entry page <a href="insertcounty.php">Clicking
Here</a>
i know its a really simple problem and i feel like a bit of a biff not being able to work it out but i've gone round in circles so many times i'm dizzy!!
table name: county_tbl
tabel contents: id, County, Link
ok trying to understand where i'm going wrong but its turning into a bit of a nightmare. its a really simple problem. I am trying to send a variable to my database and create a link and possibly a simple page but i haven't managed to get that far yet. The database is recieving a new record from the page but it isn't recieving the value of county.
page1 : insertcounty.php
<html>
<head></head>
<body>
<form name="test" method="post" action="countyinject.php">
<input type="hidden" name="CountyName" value="<? $County ?>">
<table width="500" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="30%">County Name:
<input name="County" type="text" id="County" size="12" maxlength="12">
<input type="submit" name="Submit" value="Create County"></td>
</tr>
</table>
<\form>
</body>
</html>
Page2: countyinject.php
<?php
include("config.php");
//vars section
global $sqlhost;
global $sqluser;
global $sqlpass;
global $sqldb;
$id = $_POST["id"];
$County = $_POST["County"];
$Link = $_POST["Link"];
//END Vars Section
//MYSQL DataBase Connection Section
$cnx = mysql_connect($sqlhost,$sqluser,$sqlpass);
mysql_select_db($sqldb) //This statement is required to select the database from the mysql server
or die("Invalid : " . mysql_error());
//END Database Connection Section
echo "$id<br>$County<br>runner<br>$Link<br>";
if($cnx != null)
{
$SQL_query_String = "INSERT INTO county_tbl (County, Link) VALUES ('$County','$Link')";
$cur= mysql_query($SQL_query_String )
or die("Invalid : " . mysql_error());
}
mysql_close( $cnx);
?>
County Setup Complete Please return to county entry page <a href="insertcounty.php">Clicking
Here</a>
i know its a really simple problem and i feel like a bit of a biff not being able to work it out but i've gone round in circles so many times i'm dizzy!!
table name: county_tbl
tabel contents: id, County, Link
