homepage Welcome to WebmasterWorld Guest from 54.205.189.156
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / WebmasterWorld / New To Web Development
Forum Library, Charter, Moderators: brotherhood of lan & mack

New To Web Development Forum

    
cross-browser issues
problems related to login script and PNG images
naiquevin




msg:3895442
 5:18 am on Apr 19, 2009 (gmt 0)

I have been developing a website using PHP & MySQL and testing it on local server using XAMPP..

All this while I was using Mozilla Firefox to test the code but lately I checked it on Internet Explorer, and it doesnt work the same way in IE6 as it does in Firefox..

for one, the login script doesnt take me to the members area in IE6. Clicking on the submit button only clears the username and password field and no script is executed .

secondly, I am using certain images created in photoshop stored as PNG. In IE6 the transparent background of the image is replaced by a white background.
Also blocks with rounded corners made using HTML table doesnt appear continuous in IE

In Firefox these things work perfectly fine ..

How to make sure that the website works the same way in all browsers?

 

rocknbil




msg:3895564
 2:29 pm on Apr 19, 2009 (gmt 0)

There are many ways these can go wrong but I'll toss a few ideas out there . . .

How to make sure that the website works the same way in all browsers?

Valid doctype declaration [webmasterworld.com]?
Does the page validate [validator.w3.org]?

These two are possibly the most important building blocks for cross browser compatibility; after the above two are verified you should be able to right-click the background in FF, select Page Info, and see "Standards Compliance Mode" for Page Rendering as opposed to Quirks Mode.

Of course, all bets are off with IE 6, but this will get you closer. But invalid code can cause forms and Javascript to not work at all, so this is job one.

Clicking on the submit button only clears the username and password field and no script is executed.

I am guessing you mean no server-side script is executed? Does the form rely on Javascript to work, or is Javascript part of the way it works and does it contain Javascript errors in IE6?

What I mean is, if the page contains invalid code, tihs may "break" any valid Javascript you have associated with the form. Also if you have an input type="button" and allow Javascript to process the form submit, if the JS gets "broken" in IE6, "button" inherently has no action so it will do nothing at all. If this is the case, the best solution here is to always use input type="submit", then do

<form action="yourscript.php" onSubmit="return validate(this);">

...
function validate (form) {
// your stuff
if (no_errors) { form.submit(); }
return false;
}

What happens here is if the Javascript is not broken, it returns false to the browser, telling it NOT to do it's natural action, submit the form - so Javascript does the submit, preventing a double-submit. But if the Javascript is broken, it will still submit.

This may be speculation but it's a pretty common problem.

naiquevin




msg:3895925
 6:15 am on Apr 20, 2009 (gmt 0)

thanks a lot...

btw there is no javascript ..
everything is just PHP Mysql ..
it is a simple login system, queries the database table and compares username and password combination... and then sets the session variables

rocknbil




msg:3896233
 4:21 pm on Apr 20, 2009 (gmt 0)

Okay, so does the output (form) page validate? Since it's an IE only issue, I can't help thinking this is the root of the problem.

If it does, temporarily add this to the top of your script (REMOVE AFTER DEBUGGING, this may reveal TMI about your program!)

error_reporting(E_ALL);
ini_set('display_errors', '1');

Run it in IE, see if it gives you any clues.

If no love there, in your PHP script, drop in some debug variables:

$debug = "opening script, put expected input variables here " . $_POST['username'] . ", for example \n";

$debug .= "entering validation section \n";

$debug .= "exiting validation \n";

$debug .= "Beginning page response \n";

Then in your page output:

<!-- $debug -->

View source to see what's up.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / WebmasterWorld / New To Web Development
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved