IE problems with running script!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
snarkiest
Forum Commoner
Posts: 30
Joined: Mon May 04, 2009 10:06 am
Location: Latvia
Contact:

IE problems with running script!

Post by snarkiest »

Hi, please check this in Firefox and type in twenty daily quests and you should get the image and test it in Internet Explorer and type the same. Why you don't get any result? I don't understand it why it works in Firefox perfectly but isn't working at all in Internet Explorer.

Code: Select all

<?PHP
include("connect.php");
include("vars.php");
 
if(isset($_POST['search'])) {
    if (!$_POST['name']) {
        echo $topregister;
        echo "<table width='330' class='toutborder' cellspacing='2' cellpadding='2'><tr><td class='tinborder' align='center'>If you are searching you have to type what are you searching for. <a href='javascript&#058;self.history.back();'>Return</a>.</td></tr></table>";
        echo $bottom;
        exit();
        }
    $name = mysql_escape_string($_POST['name']);
    $result = mysql_query("
           SELECT *
           FROM achievements
           WHERE name='$name'
    ",$connect);
    while($myrow = mysql_fetch_assoc($result)) {
            echo $topadd_ach;
            echo "<table width='330' class='toutborder' cellspacing='2' cellpadding='2'><tr><td class='tinborder' align='center'>Good that you checked because there is an achievement with that name.</td></tr></table>";
            echo "<table width='330' class='toutborder' cellspacing='2' cellpadding='2'><tr width='100%'>";
            echo "<td class='tinborder' align='center' width='30%'>Image:</td>";
            echo "<td class='tinborder' align='center' width='30%'>Name:</td>";
            echo "<td class='tinborder' align='center' width='40%'>Description:</td>";
            echo "</tr></table>";
            echo "<table width='330' class='toutborder' cellspacing='2' cellpadding='2'><tr width='100%'>";
            echo "<td width='30%' class='trstyle' align='center'><table border='0' cellspacing='1' cellpadding='1'><tr><td style='background: url(http://i.meteorgames.com/ic/bg/000000_both_b48.png) no-repeat;'><table border='0' cellspacing='0' cellpadding='0'><tr><td style='background: url(";
            echo $myrow['image'];
            echo ") no-repeat;'><table border='0' cellspacing='0' cellpadding='0'><tr><td><img src='http://i.meteorgames.com/ic/b/e5e5e5_b48.png'></td></tr></table></td></tr></table></td></tr></table></td>";
            echo "<td width='30%' class='trstyle' align='center'>";
            echo $myrow['name'];
            echo "</td>";
            echo "<td width='40%' class='trstyle' align='center'>";
            echo $myrow['description'];
            echo "</td>";
            echo "</tr></table>";
            echo "<form method='post' action='" . $_POST['$PHP_SELF'] . "' >
         <table width='330' border='0' cellspacing='2' cellpadding='2' class='toutborder'>
          <tr>
            <td width='20%' class='tinborder'>Name: </td>
            <td width='80%' class='trstyle'><input type='text' name='name' /> <input type='submit' name='search' value='Search!' /></td>
          </tr>
          </table>
         </form>";
        echo $bottom;
        exit();
    if($name!='$result') {
                echo $topadd_ach;
            echo "<table width='330' class='toutborder' cellspacing='2' cellpadding='2'><tr><td class='tinborder' align='center' >Achievement with name " . $_POST['name'] . " is not listed in our database records. You may add it. Of course if it is achievement.</td></tr></table>";
            echo "<form method='post' action='" . $_POST['$PHP_SELF'] . "' >
         <table width='330' border='0' cellspacing='2' cellpadding='2' class='toutborder'>
          <tr>
            <td width='20%' class='tinborder'>Name: </td>
            <td width='80%' class='trstyle'><input type='text' name='name' /><input type='submit' name='search' value='Search!' /></td>
          </tr>
          </table>
         </form>";
        echo $bottom;
    }
    }
}//close of if elseif(isset($_POST['search']))
else
  {
echo $topadd_ach;
 echo "<table width='330' class='toutborder' cellspacing='2' cellpadding='2'><tr><td class='tinborder' align='center'>Hello, want to add achievement? First you should check if it is not already there. If it is not, be sure to add it.</td></tr></table>";
 echo "<form method='post' action='" . $_POST['$PHP_SELF'] . "' >
 <table width='330' border='0' cellspacing='2' cellpadding='2' class='toutborder'>
  <tr>
    <td width='20%' class='tinborder'>Name: </td>
    <td width='80%' class='trstyle'><input type='text' name='name' /><input type='submit' name='search' value='Search!' /></td>
  </tr>
  </table>
 </form>";
echo $bottom;
}
?>
Last edited by snarkiest on Tue Jun 02, 2009 3:12 am, edited 1 time in total.
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: IE problems with running script!

Post by requinix »

If something works in one browser but not another then the problem is not PHP related.

Run your HTML through the W3C validator. 95% of problems can be identified by doing that.
snarkiest
Forum Commoner
Posts: 30
Joined: Mon May 04, 2009 10:06 am
Location: Latvia
Contact:

Re: IE problems with running script!

Post by snarkiest »

Validated, it is valid no errors. :/
OH, I just checked:
If in IE i type what i'm searching for and click "search" then it works, if I type what I'm searching for and click "enter" then it don't work.

Why it is so?
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: IE problems with running script!

Post by requinix »

Not sure.

Only potential issue I see is that the form's action is empty. You really should be putting in a URL there, not leaving it blank.
User avatar
mikemike
Forum Contributor
Posts: 355
Joined: Sun May 24, 2009 5:37 pm
Location: Chester, UK

Re: IE problems with running script!

Post by mikemike »

The problem might be related to your form actions. You are using $_POST['$PHP_SELF'], which doesn't exist. I think what you're after is $_SERVER['PHP_SELF'].
snarkiest
Forum Commoner
Posts: 30
Joined: Mon May 04, 2009 10:06 am
Location: Latvia
Contact:

Re: IE problems with running script!

Post by snarkiest »

mikemike wrote:The problem might be related to your form actions. You are using $_POST['$PHP_SELF'], which doesn't exist. I think what you're after is $_SERVER['PHP_SELF'].
Written the script with $_SERVER['PHP_SELF'], but still the same problem.

Code: Select all

<?PHP
include("connect.php");
include("vars.php");
 
if(isset($_POST['search'])) {
    if (!$_POST['name']) {
        echo $topregister;
        echo "<table width='330' class='toutborder' cellspacing='2' cellpadding='2'><tr><td class='tinborder' align='center'>If you are searching you have to type what are you searching for. <a href='javascript&#058;self.history.back();'>Return</a>.</td></tr></table>";
        echo $bottom;
        exit();
        }
    $name = mysql_escape_string($_POST['name']);
    $result = mysql_query("
           SELECT *
           FROM achievements
           WHERE name='$name'
    ",$connect);
    while($myrow = mysql_fetch_assoc($result)) {
            echo $topadd_ach;
            echo "<table width='330' class='toutborder' cellspacing='2' cellpadding='2'><tr><td class='tinborder' align='center'>Good that you checked because there is an achievement with that name.</td></tr></table>";
            echo "<table width='330' class='toutborder' cellspacing='2' cellpadding='2'><tr width='100%'>";
            echo "<td class='tinborder' align='center' width='30%'>Image:</td>";
            echo "<td class='tinborder' align='center' width='30%'>Name:</td>";
            echo "<td class='tinborder' align='center' width='40%'>Description:</td>";
            echo "</tr></table>";
            echo "<table width='330' class='toutborder' cellspacing='2' cellpadding='2'><tr width='100%'>";
            echo "<td width='30%' class='trstyle' align='center'><table border='0' cellspacing='1' cellpadding='1'><tr><td style='background: url(http://i.meteorgames.com/ic/bg/000000_both_b48.png) no-repeat;'><table border='0' cellspacing='0' cellpadding='0'><tr><td style='background: url(";
            echo $myrow['image'];
            echo ") no-repeat;'><table border='0' cellspacing='0' cellpadding='0'><tr><td><img src='http://i.meteorgames.com/ic/b/e5e5e5_b48.png'></td></tr></table></td></tr></table></td></tr></table></td>";
            echo "<td width='30%' class='trstyle' align='center'>";
            echo $myrow['name'];
            echo "</td>";
            echo "<td width='40%' class='trstyle' align='center'>";
            echo $myrow['description'];
            echo "</td>";
            echo "</tr></table>";
            echo "<form method='post' action='" . $_SERVER['PHP_SELF'] . "' >
         <table width='330' border='0' cellspacing='2' cellpadding='2' class='toutborder'>
          <tr>
            <td width='20%' class='tinborder'>Name: </td>
            <td width='80%' class='trstyle'><input type='text' name='name' /> <input type='submit' name='search' value='Search!' /></td>
          </tr>
          </table>
         </form>";
        echo $bottom;
        exit();
    if($name!='$result') {
                echo $topadd_ach;
            echo "<table width='330' class='toutborder' cellspacing='2' cellpadding='2'><tr><td class='tinborder' align='center' >Achievement with name " . $_POST['name'] . " is not listed in our database records. You may add it. Of course if it is achievement.</td></tr></table>";
            echo "<form method='post' action='" . $_SERVER['PHP_SELF'] . "' >
         <table width='330' border='0' cellspacing='2' cellpadding='2' class='toutborder'>
          <tr>
            <td width='20%' class='tinborder'>Name: </td>
            <td width='80%' class='trstyle'><input type='text' name='name' /><input type='submit' name='search' value='Search!' /></td>
          </tr>
          </table>
         </form>";
        echo $bottom;
    }
    }
}//close of if elseif(isset($_POST['search']))
else
  {
echo $topadd_ach;
 echo "<table width='330' class='toutborder' cellspacing='2' cellpadding='2'><tr><td class='tinborder' align='center'>Hello, want to add achievement? First you should check if it is not already there. If it is not, be sure to add it.</td></tr></table>";
 echo "<form method='post' action='" . $_SERVER['PHP_SELF'] . "' >
 <table width='330' border='0' cellspacing='2' cellpadding='2' class='toutborder'>
  <tr>
    <td width='20%' class='tinborder'>Name: </td>
    <td width='80%' class='trstyle'><input type='text' name='name' /><input type='submit' name='search' value='Search!' /></td>
  </tr>
  </table>
 </form>";
echo $bottom;
}
?>
User avatar
mikemike
Forum Contributor
Posts: 355
Joined: Sun May 24, 2009 5:37 pm
Location: Chester, UK

Re: IE problems with running script!

Post by mikemike »

It doesn't work in IE or Firefox here...

Make sure error reporting is on.
snarkiest
Forum Commoner
Posts: 30
Joined: Mon May 04, 2009 10:06 am
Location: Latvia
Contact:

Re: IE problems with running script!

Post by snarkiest »

mikemike wrote:It doesn't work in IE or Firefox here...

Make sure error reporting is on.
Did you try here: http://sc-fans.royalhosting.lv/ach/add_ach.php ?

In FF it should works when you click enter or click search button.
In IE it works only if you click search button, with enter it don't work.

How to turn error reporting on? I already have enabled script debugging in IE browsing settings.
User avatar
mikemike
Forum Contributor
Posts: 355
Joined: Sun May 24, 2009 5:37 pm
Location: Chester, UK

Re: IE problems with running script!

Post by mikemike »

Yes, I tried that URL. I get a blank page once I've searched in all browsers.

In your php.ini file locate display_errors and set it to 'on', and set error_reporting to 'E^ALL' (without the quotes)
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: IE problems with running script!

Post by requinix »

mikemike wrote:and set error_reporting to 'E^ALL' (without the quotes)
Without the caret either ;) "E_ALL"
Last edited by requinix on Tue Jun 02, 2009 4:14 pm, edited 1 time in total.
User avatar
mikemike
Forum Contributor
Posts: 355
Joined: Sun May 24, 2009 5:37 pm
Location: Chester, UK

Re: IE problems with running script!

Post by mikemike »

Oops
snarkiest
Forum Commoner
Posts: 30
Joined: Mon May 04, 2009 10:06 am
Location: Latvia
Contact:

Re: IE problems with running script!

Post by snarkiest »

mikemike wrote:Yes, I tried that URL. I get a blank page once I've searched in all browsers.

In your php.ini file locate display_errors and set it to 'on', and set error_reporting to 'E^ALL' (without the quotes)
I have to add a new line error_reporting=E_ALL in php.ini ?
snarkiest
Forum Commoner
Posts: 30
Joined: Mon May 04, 2009 10:06 am
Location: Latvia
Contact:

Re: IE problems with running script!

Post by snarkiest »

I don't see any changes after i did that. ;)
Post Reply