Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.