Page 1 of 1

IE problems with running script!

Posted: Mon Jun 01, 2009 3:54 pm
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;
}
?>

Re: IE problems with running script!

Posted: Mon Jun 01, 2009 9:14 pm
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.

Re: IE problems with running script!

Posted: Tue Jun 02, 2009 3:09 am
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?

Re: IE problems with running script!

Posted: Tue Jun 02, 2009 12:44 pm
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.

Re: IE problems with running script!

Posted: Tue Jun 02, 2009 2:06 pm
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'].

Re: IE problems with running script!

Posted: Tue Jun 02, 2009 2:30 pm
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;
}
?>

Re: IE problems with running script!

Posted: Tue Jun 02, 2009 2:51 pm
by mikemike
It doesn't work in IE or Firefox here...

Make sure error reporting is on.

Re: IE problems with running script!

Posted: Tue Jun 02, 2009 3:06 pm
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.

Re: IE problems with running script!

Posted: Tue Jun 02, 2009 3:12 pm
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)

Re: IE problems with running script!

Posted: Tue Jun 02, 2009 3:25 pm
by requinix
mikemike wrote:and set error_reporting to 'E^ALL' (without the quotes)
Without the caret either ;) "E_ALL"

Re: IE problems with running script!

Posted: Tue Jun 02, 2009 3:25 pm
by mikemike
Oops

Re: IE problems with running script!

Posted: Tue Jun 02, 2009 3:30 pm
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 ?

Re: IE problems with running script!

Posted: Thu Jun 04, 2009 10:44 am
by snarkiest
I don't see any changes after i did that. ;)