Jump to content

Recommended Posts

I am having an issue with my code and IE.

 

What is happening is this is an add new user script for my site.

When their info is added if I am using firefox it works fine but if I am using IE it is not getting the access level like it should and that throws off everything.

 

I think this line is what is causing me the issue.

$access = isset($_POST['access']) &&!empty($_POST['access']) ? $_POST['access'] : '1';

 

I added this in to check to make sure that if the "access" did not transfer over from the form it would default to the lowest level. but for some reason when an admin uses IE it doesn't read this line, so it skips the code and goes on to the next step which throws everything off.

 

Any suggestions on what I can try with IE or any settings i should look at in IE.

 

Thanks

Bill

Link to comment
https://forums.phpfreaks.com/topic/193784-trouble-with-ie/
Share on other sites

here is the form code

<?php
echo "<table border='0'>";
echo "<tr><td align='right'>";
echo "<b>First Name:</b>";
echo "</td><td><p>";
echo "<input type='text' name='firstname' size='20' value='$firstname'>";
echo "<font color=red>*</font></td></tr>";
echo "</td></tr>";

echo "<tr><td align='right'>";
echo "<b>Last Name:</b>";
echo "</td><td><p>";
echo "<input type='text' name='lastname' size='20' value='$lastname'>";
echo "<font color=red>*</font></td></tr>";
echo "</td></tr>";

echo "<tr><td align='right'>";
echo "<b>Street Address:</b>";
echo "</td><td><p>";
echo "<input type='text' name='address1' size='50' value='$address1'>";
echo "</td></tr>";
echo "<tr><td align='right'>";
echo "<b></b>";
echo "</td><td><p>";
echo "<input type='text' name='address2' size='50' value='$address2'>";
echo "</td></tr>";

echo "<tr><td align='right'>";
echo "<b>City:</b>";
echo "</td><td><p>";
echo "<input type='text' name='city' size='30' value='$city'>";
echo "</td></tr>";

echo "<tr><td align='right'>";
echo "<b>State/Province/Territory:</b>";
echo "</td><td><p>";
echo "<input type='text' name='state' size='30' value='$state'>";
echo "</td></tr>";

echo "<tr><td align='right'>";
echo "<b>Zip Code:</b>";
echo "</td><td><p>";
echo "<input type='text' name='zipcode' size='10' value='$zipcode'>";
echo "</td></tr>";

echo "<tr><td align='right'>";
echo "<b>Country:</b>(US or Canada)";
echo "</td><td><p>";
echo "<input type='text' name='country' size='10' value='$country'>";
echo "</td></tr>";

echo "<tr><td align='right'>";
echo "<b>Phone Number:</b>";
echo "</td>";
echo "<td><p>";
echo "<input type='text' name='phone' size='12' value='$phone'>";
echo "</td></tr>";

echo "<tr><td align='right'>";
echo "<b>Email Address:</b>";
echo "</td><td><p>";
echo "<input type='text' name='email' size='30' value='$email'>";
echo "<font color=red>*</font></td></tr>";
echo "</td></tr>";

echo "<tr><td align='right'>";
echo "<b>User Access Level:</b>";
echo "</td><td><p>";
if ($_SESSION['user_rights'] == '2')
{
echo "
<input type='radio' name='access' 'value='1' checked>Player
";
}
if ($_SESSION['user_rights'] == '3')
{
echo "
<input type='radio' name='access' 'value='1' checked>Player
<input type='radio' name='access' 'value='2'>Staff Admin
";
}
if ($_SESSION['user_rights'] == '4')
{
echo "
<input type='radio' name='access' 'value='1' checked> Player
<input type='radio' name='access' 'value='2'> Staff Admin
<input type='radio' name='access' 'value='3'> Chapter Owner
<input type='radio' name='access' 'value='4l'> Global Admin
";
}
echo "</td></tr>";
echo "</td></tr>";
echo "</tr></table>\n";
?>

 

I don't see any problem with the form code but then again this is all a test system so I can work out bugs.  As I said Firefox processes everything fine so what is different with IE that could cause 1 variable to not translate over properly.

 

And if it doesn't transfer over why isn't it reading the line I posted above to default to the lowest value to make sure things are added correctly?

Link to comment
https://forums.phpfreaks.com/topic/193784-trouble-with-ie/#findComment-1019937
Share on other sites

The following contains an extra single-quote before the 'value keyword, making it invalid HTML -

echo "
<input type='radio' name='access' 'value='1' checked>Player
";

 

Some browsers ignore various errors in your markup. You should always validate your resulting pages at the w3.org HTML and CSS validators.

Link to comment
https://forums.phpfreaks.com/topic/193784-trouble-with-ie/#findComment-1019943
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.