...

View Full Version : Variable working in Firefox but not IE



dmilani
12-20-2007, 02:11 AM
I have the following code which works in Firefox but not in Explorer.
For some reason the $tabsel variable is not being passed correctly.
If I echo $tabsel it displays in Firefox but not Explorer.
The reason I am confused is that the rest of the variables are being passed correctly.

Thanks for your help.




<?php
include 'config.php';
include 'opendb.php';

$ud_id=$HTTP_POST_VARS['ud_id'];
$ud_tname=$HTTP_POST_VARS['ud_tname'];
$ud_contact1=$HTTP_POST_VARS['ud_contact1'];
$ud_phone1A=$HTTP_POST_VARS['ud_phone1A'];
$ud_phone1B=$HTTP_POST_VARS['ud_phone1B'];
$ud_email1=$HTTP_POST_VARS['ud_email1'];
$ud_contact2=$HTTP_POST_VARS['ud_contact2'];
$ud_phone2A=$HTTP_POST_VARS['ud_phone2A'];
$ud_phone2B=$HTTP_POST_VARS['ud_phone2B'];
$ud_email2=$HTTP_POST_VARS['ud_email2'];
$ud_date=$HTTP_POST_VARS['ud_date'];
$ud_misc=$HTTP_POST_VARS['ud_misc'];

// **** Here's the problem *****
$tabsel=$HTTP_POST_VARS['sorttab'];


$query="UPDATE $tabsel SET tname='$ud_tname', contact1='$ud_contact1', phone1A='$ud_phone1A', phone1B='$ud_phone1B', email1='$ud_email1', contact2='$ud_contact2', phone2A='$ud_phone2A', phone2B='$ud_phone2B', email2='$ud_email2', misc='$ud_misc' ,date='$ud_date' WHERE reg_id='$ud_id'";
mysql_query($query);
echo "Record Updated";

echo phpinfo();
echo "<br> {$query}" ;
echo "<br> {$tabsel}" ;
mysql_close();

include 'closedb.php';

?>

CFMaBiSmAd
12-20-2007, 02:18 AM
Your form probably contains invalid markup and is interpreted differently between the two browsers.

Post your form code to get specific help with what it might be doing.

dmilani
12-20-2007, 03:12 AM
Thanks for the response. I suspected the form, particularly the hidden input fields, but the $id field works so I moved on.

Here's the form:



<!-- Code Update Formatting --->
<link rel="stylesheet" type="text/css" href="register.css" />
<form action="ADLTupdated.php" method="post">
<input type="hidden" name="ud_id" value="<? echo $id; ?>">
<table>
<tr>
<td class="odd">Team Name: </td>
<td colspan="2" class="odd">
<input type="text" name="ud_tname" size="30" value="<? echo $tname; ?>"></td>
</tr>

<tr>
<td class="even">Session:</td>
<td colspan="2" class="even">I:&nbsp;
<input type="text" name="ud_sess_one" size="5" value="<? echo $sess_one; ?>">&nbsp;II:&nbsp;<input type="text" name="ud_sess_two" size="5" value="<? echo $sess_two; ?>"></td>
</tr>

<tr>
<td class="odd">First Contact:</td>
<td colspan="2" class="odd">
<input type="text" name="ud_contact1" size="40" value="<? echo $contact1; ?>"></td>
</tr>

<tr>
<td class="even"></td>
<td class="even">Phone:&nbsp;
<input type="text" name="ud_phone1A" size="17" value="<? echo $phone1A; ?>">
</td>
<td class="even">
<input type="text" name="ud_phone1B" size="17" value="<? echo $phone1B; ?>">
</td>
</tr>

<tr>
<td class="odd"></td>
<td colspan="2" class="odd">Email:&nbsp;
<input type="text" name="ud_email1" size="40" value="<? echo $email1; ?>">
</td>
</tr>

<tr>
<td class="even">Second Contact:</td>
<td colspan="2" class="even">
<input type="text" name="ud_contact2" size="40" value="<? echo $contact2; ?>">
</td>
</tr>

<tr>
<td class="odd"></td>
<td class="odd">Phone:&nbsp;
<input type="text" name="ud_phone2A" size="17" value="<? echo $phone2A; ?>">
</td>
<td class="odd">
<input type="text" name="ud_phone2B" size="17" value="<? echo $phone2B; ?>">
</td>
</tr>

<tr>
<td class="even"></td>
<td colspan="2" class="even">Email:&nbsp;
<input type="text" name="ud_email2" size="40" value="<? echo $email2; ?>">
</td>
</tr>

<tr>
<td class="odd">Registration Date:</td>
<td colspan="2" class="odd">
<input type="text" name="ud_date" size="40" value="<? echo $date; ?>">
</td>
</tr>

<tr>
<td class="even">Notes:</td>
<td colspan="2" class="even">
<textarea name="ud_misc" rows="5" cols="40"> <? echo $misc; ?></textarea>
</td>
</tr>
</table
<input type="hidden" name="sorttab" value="<? echo $tabsel; ?>">
<input type="Submit" value="Update">
</form>

CFMaBiSmAd
12-20-2007, 03:22 AM
The </table> tag is missing the > and is preventing the browser from seeing the sorttab input field.

dmilani
12-20-2007, 03:36 AM
:eek:

Thanks

aedrin
12-20-2007, 04:37 PM
Also, you should be using $_GET and $_POST, $HTTP_POST_VARS is outdated and will soon stop working (PHP6 I believe).



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum