Connecting Tech Pros Worldwide Forums | Help | Site Map

Text area value is not passed to php script

Newbie
 
Join Date: May 2006
Posts: 1
#1: May 15 '06
I have the following html code:
<html>
<head>
<title> Node Entry</title>
</head>

<body>
<form action="sqlconnect.php" method="post"><table border="5">
<tr> <td><textarea rows=3 cols=70 name="parent_node"> </textarea></td> </tr>
<tr> <td> <input type="text" name="Node" maxlength="207000" size="20700"> <br> </td> </tr>
<tr> <td colspan="20"><input type="submit" value="Save"</td> </tr>
</tabe>
</form>
</body>
</html>

==The content of sqlconnect.php is as follows:

<?php
//phpinfo();

@ $db = mysql_pconnect('localhost', '','');


if (!$db){echo 'Error Could not connect to database';
exit;
}
else
echo 'connected to database';
mysql_select_db('law');
//echo 'law';
$query = 'show databases';
// echo $query;
$result = mysql_query($query);
echo $result;
// $num_results=mysql_num_rows($result);
// echo $num_result;

mysql_select_db (‘law’);
$NODE=$HTTP_POST_VARS['parent_Node'];
$NODE=AddSlashes($NODE);
$cnode=$HTTP_POST_VARS['Node'];
$cnode=AddSlashes($cnode);
$query = "insert into nodes values ('".$NODE."','".$cnode."')";
echo $query;
$result = mysql_query($query);
echo $result;
//if ($result) echo 'inserted' else echo not inserted;

?>

===
After entering some text in to text area, is get nothing echoed from the parent_node. What is the problem??
Any hellp in this matter is appreciated.

Banfa's Avatar
AdministratorVoR
 
Join Date: Feb 2006
Location: South West UK
Posts: 6,175
#2: May 15 '06

re: Text area value is not passed to php script


Quote:

Originally Posted by harikca

[html]
<textarea rows=3 cols=70 name="parent_node"> </textarea>
[/html]

[php]
$NODE=$HTTP_POST_VARS['parent_Node'];
[/php]

You have a capitalisation mismatch in the identifier parent_node in the two lines above.
Reply