Jump to content

[SOLVED] Form problem


thefollower

Recommended Posts

I have a form where by you input a number and then it inserts that number to the table but it just wont insert ! I have a seperate process page which recieves the input using _POST

 

Heres the code:

 

<form name="" method="POST" action="choosehousenumberprocess.php" enctype="text/plain" id="Form1">
<input type="submit" id="Button1" name="Button1" value="Submit" style="position:absolute;left:182px;top:187px;width:75px;height:24px;z-index:0">
<input type="text" id="Editbox1" style="position:absolute;left:148px;top:149px;width:144px;font-family:Courier;font-size:19px;z-index:1" size="16" name="HouseNumber" value="">

</form>

 

choosehousenumberprocess.php

 

$HouseNumber = $_POST['HouseNumber'];
Echo $HouseNumber;
$InsertNumber = "UPDATE houses SET HouseNumber = '$HouseNumber' WHERE UserID='{$_SESSION['Current_User']}'";
mysql_query($InsertNumber) or die(mysql_error());  

 

The echo also produces nothing in return =/

Link to comment
https://forums.phpfreaks.com/topic/68628-solved-form-problem/
Share on other sites

 

try this first

<html>
<body>
<?php
$HouseNumber = $_POST['HouseNumber'];
echo $HouseNumber;
$InsertNumber = "UPDATE houses SET HouseNumber = '$HouseNumber' WHERE UserID='{$_SESSION['Current_User']}'";
mysql_query($InsertNumber) or die(mysql_error());  
?>

<form name="" method="POST" action="<? $_SERVER['PHP_SELF']?>"  id="Form1">
<input type="text" id="Editbox1" style="position:absolute;left:148px;top:149px;width:144px;font-family:Courier;font-size:19px;z-index:1" size="16" name="HouseNumber" value="">

<input type="submit" id="Button1" name="Button1" value="Submit" style="position:absolute;left:182px;top:187px;width:75px;height:24px;z-index:0">

</form>
</body>
</html>

Link to comment
https://forums.phpfreaks.com/topic/68628-solved-form-problem/#findComment-344957
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.