Ok, I just moved to a new hosting service and everything was working fine before the move. My problem is this ...after a user fills out a form and hits submit, it is supposed to send them to another page, which updates my database and then redirects them back home. Well, my form values are NOT getting passed on to the update PHP page. I've looked everything over on the server and my code (which there is nothing wrong with ..it was working before!) ..but support says nothing is wrong with the server either .../sigh ..this is driving me crazy. Anyways, I don't have a clue what to do now. I've looked over everything that I know of, so if anyone has any other suggestions please let me know.
it's running on windows 2000 server and version 4.3.1
any help would be greatly appreciated.
thanks
Form Values not passing on
Moderator: General Moderators
Here's the form
Here's the update page
I also tried using $newLimit_POST and it still didn't work. We're using something new to me for hosting ..it's a reseller package that allows us to setup hosting packages and the such. I've looked through everything a few times and it seems that everything is set fine, though I really didn't see any PHP options ..i'm assuming everything is setup like the old host ..though i'm not for certain and I really don't know how to go about checking it out.
Thanks
Code: Select all
<?
include "myconn.php";
$query = "SELECT * FROM admin";
$result = mysql_query($query);
$result = mysql_fetch_array($result);
$limit = $resultї'default_limit'];
?>
<title> Change Default Job Limit </title>
<form name = 'limit' action = 'a_adminLimit.php' method = 'post'>
<center>
<table border = '0' width = 100%>
<tr>
<td align = 'center' width = 50%> Enter new Default Job Limit </td>
<td align = 'center'> <input type = 'text' name = 'newLimit' value = '<?echo $limit ?>' size = '5'> </td>
</tr>
<tr>
<td align = 'center'> <input type = 'submit' name = 'submit' value = 'Change'> </td>
<td align = 'center'> <input type = 'reset' name = 'reset' value = 'Reset'> </td>
</tr>
<tr>
<td align = 'center' colspan = '2'> <a href = 'javascript: self.close();'> Close </a> </td>
</tr>
</table>
</form>
<script language = 'javascript'>
<!--
document.limit.newLimit.focus();
-->
</script>Here's the update page
Code: Select all
<?
If (!$submit) {
?>
<center>
Restricted
<br>
<a href = 'javascript: self.close();'> Close </a>
</center>
<?
} else {
include "myconn.php";
$query = "UPDATE admin set
default_limit = $newLimit"
or die("Cannot query");
$result = mysql_query($query)
or die("Cannot result");
?>
<center>
Default job limit has now been updated to <?echo $newLimit ?>
<br>
<a href = 'javascript: self.close();'> Close </a>
</center>
<? } ?>Thanks
- daven
- Forum Contributor
- Posts: 332
- Joined: Tue Dec 17, 2002 1:29 pm
- Location: Gaithersburg, MD
- Contact:
Revised code is below. What you need to do is use $_POST['var'] instead of just $var. ie--to access the posted value of $newLimit, you need to use $_POST['newLimit']. PHP 4x does not like accessing form variables by name alone.
If you use a GET form, you access the variables via $_GET['var']
<?
if (!$submit) { // 'if' should be lowercase
?>
<center>
Restricted
<br>
<a href = 'javascript: self.close();'> Close </a>
</center>
<?
} else {
include "myconn.php";
$query = "UPDATE admin set
default_limit = $$_POST['newLimit']"
or die("Cannot query");
$result = mysql_query($query)
or die("Cannot result");
?>
<center>
Default job limit has now been updated to <?echo $_POST['newLimit'] ?>
<br>
<a href = 'javascript: self.close();'> Close </a>
</center>
<? } ?>
If you use a GET form, you access the variables via $_GET['var']
<?
if (!$submit) { // 'if' should be lowercase
?>
<center>
Restricted
<br>
<a href = 'javascript: self.close();'> Close </a>
</center>
<?
} else {
include "myconn.php";
$query = "UPDATE admin set
default_limit = $$_POST['newLimit']"
or die("Cannot query");
$result = mysql_query($query)
or die("Cannot result");
?>
<center>
Default job limit has now been updated to <?echo $_POST['newLimit'] ?>
<br>
<a href = 'javascript: self.close();'> Close </a>
</center>
<? } ?>
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK