Jump to content

dheon09

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

dheon09's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. [!--quoteo(post=352776:date=Mar 8 2006, 02:26 PM:name=txmedic03)--][div class=\'quotetop\']QUOTE(txmedic03 @ Mar 8 2006, 02:26 PM) [snapback]352776[/snapback][/div][div class=\'quotemain\'][!--quotec--] Well for the original topic of this page. IE is not 100% xhtml/css compliant. Microsoft likes to make up their own rules and substitute them for the true standards pretty much any time they feel like it. No I am not bitter, but as a web developer I hold a high level of distain for Microsoft. I use linux on my computer. My suggestion would be to use a simple piece of code and write two CSS files. Call one of them ie.css and one ff.css for simplicity sake and if you will bare with me a moment I will give a small piece of PHP which may help you out. This is assuming that your server allows PHP. If your server does not allow PHP, I do appologise and would be happy to provide alternative solutions to your problem. So here's the PHP: [code] <?php if ( eregi("mozilla", $_SERVER['HTTP_USER_AGENT']) ) {   $css = "ff.css"; } else {   $css = "ie.css"; } ?> [/code] Place that at the top of the page and then you link statement should look something like this: [code]<link rel="stylesheet" type="text/css" href="<?php echo $stylesheet; ?>" />[/code] If you use an embeded stylesheet or inline styles (I highly advise against this) then you would need to read the file with fread() instead of the file name as the $css you would make $css equal to the contents of the stylesheet and place the echo between <style type="text/css"></style> tags or just use an include("cssfile"); between the style tags. That would cover your embeded stylesheet, but the inlines would be more complex so we won't even go there. This will allow you to develop a CSS file that is 100% CSS2 compliant (ff.css) and then some crazy mixed up CSS2 wanna be file (ie.css) so the page will be easy to maintain for multiple browsers. I only cover two browsers here because they are the two most popular, but if you wanted to you could use more than two files with if () {} elseif () {} else {} statements. You could even isolate the IE browser and then if they are using the crazy mixed up browser they get (ie.css) otherwise get a properly written CSS2 file (ff.css). I hope my ramblings are of some use to you. If not, I would be happy to review your CSS file and offer suggestions to a solution to your problem that deal strictly with CSS. Now for the "hack". It's not a hack it is CSS2 at work and you don't need that extra container. Simply use: [code] body {   width: 800px;   margin: 20px auto; } [/code] Now I used 800 pixels simply because that's the width you specified and 20 pixel top margin so you don't lose the top margin, but 0 would suffice if you want to remove the top margin. Syntax is margin: top right bottom left;. If you do not enter all of them then anything beyond the last one you enter is assumed to be the same. If you set auto left and right margins and do not set margin for the elements on the page then this method will work fine for centering the page contents. If your page layout is very complex and you need lots of margins set for left and right margin, then you can use a container, but this ultimately makes simple xhtml more complex than it has to be. Try to follow the KISS (keep it simple stupid) system. Javizy, please, look back at the post and notice that 100% only works in IE for height. That's what the whole problem was to begin with. In FF there are a couple of ways to fix this, but IE doesn't know what to do with them. I hope this has, in some way, helped someone. Happy coding! [/quote] Hi, can anyone help me figure out how to change css dynamically depending on the browser? Thanks...
  2. [!--quoteo(post=353036:date=Mar 9 2006, 06:12 AM:name=AV1611)--][div class=\'quotetop\']QUOTE(AV1611 @ Mar 9 2006, 06:12 AM) [snapback]353036[/snapback][/div][div class=\'quotemain\'][!--quotec--] Grey, All I stand corrected... I wrote that when I rolled out of bed this morning... Now that I look at it, I was SOOOOO wrong about the $result_ar thing... Ack! Looking at what the code actually does, there are far easier ways to accomplish what you are trying to do with that script... I don't know if a rewrite is an option... [/quote] Thanks anyway, i did make the code with only 1 <?php .....code......?> and it did work...Thanks for the reminder...
  3. [!--quoteo(post=352753:date=Mar 8 2006, 12:27 PM:name=greycap)--][div class=\'quotetop\']QUOTE(greycap @ Mar 8 2006, 12:27 PM) [snapback]352753[/snapback][/div][div class=\'quotemain\'][!--quotec--] Ok, when I remove the clutter of the <? ?> tags, you get this: [code] $user = "user"; $pass = "pass"; $dbase = "localhost"; $uname = $_POST['user']; $upass = $_POST['pass']; $connection = mysql_connect("localhost",$user,$pass) or die ("Error Connecting to DBase"); mysql_select_db($dbase,$connection) or die ("Error Connecting to table"); $result = mysql_query("SELECT * FROM usertb",$connection) or die ("Error querying DBase"); $i = 0; while($result_ar = mysql_fetch_assoc($result)) {    mysql_close();    ob_start();    if ($upass == $result_ar['upass'] && $uname == $result_ar['uname'])    {       header("Location: clients/myoxy/index.html");    }    else       header("Location: index.html");    $i+=1; } [/code] I don't really know why youre using an ob_start() (especially without a ob_flush()) and you are also closing your connection multiple times. I'm not sure of the effect on the ob_start() and multiple header() calls, but there is no way that the results you will get from that are what you are actually looking for. Try something like this: [code]$found = false; while ($result_ar = mysql_fetch_assoc($result)) {    if (($upass == $result_ar['upass']) && ($uname == $result_ar['uname']))    {       $found = true;       break;    } } if ($found) { //valid login    header("Location: clients/myoxy/index.html"); } else { //invalid login    header("Location: index.html"); } [/code] [/quote] i tried your code and tested it locally but it keeps me directed to "[b]index.html[/b]" even if i used the correct username/password....
  4. [!--quoteo(post=352738:date=Mar 8 2006, 12:00 PM:name=greycap)--][div class=\'quotetop\']QUOTE(greycap @ Mar 8 2006, 12:00 PM) [snapback]352738[/snapback][/div][div class=\'quotemain\'][!--quotec--] That $result_ar is fine. It is being initialized and set to the results of the query. If the query was bad, the die() would have been executed and your script would have halted. Can you show the entire code? And what is being output? There should be output after that warning. [/quote] If you can see the entire code is posted above, also the Warning...after the warning there was no output...i tried setting a worng pass and user for the connection and it did show the die message so I think the query is good...do you need something else?
  5. [!--quoteo(post=352722:date=Mar 8 2006, 11:20 AM:name=AV1611)--][div class=\'quotetop\']QUOTE(AV1611 @ Mar 8 2006, 11:20 AM) [snapback]352722[/snapback][/div][div class=\'quotemain\'][!--quotec--] Here is my best guess: I don't know where line 17 is, but I assume it is the line that reads: [code] while($result_ar = mysql_fetch_assoc($result)){ [/code] the problem is you use this a few lines before it: [code] $result = mysql_query("SELECT * FROM usertb",$connection) or die ("Error querying DBase"); [/code] That causes an error because it doesn't know what $result_ar is, so it can't send headers after that point... [/quote] can you tell me what should i do...i really need to work this out asap....as i've said before the script works on our local netwok Thanks
  6. HI, I'm also having problems with "headers" and did all the possible solution to fix it but to no avail...here's the Warning: "Warning: Cannot add header information - headers already sent by (output started at /home/virtual/site90/fst/var/www/html/connect.php:17) in /home/virtual/site90/fst/var/www/html/connect.php on line 23" here's my code: <?php $user = "user"; $pass = "pass"; $dbase = "localhost"; $uname = $_POST['user']; $upass = $_POST['pass']; $connection = mysql_connect("localhost",$user,$pass) or die ("Error Connecting to DBase"); mysql_select_db($dbase,$connection) or die ("Error Connecting to table"); $result = mysql_query("SELECT * FROM usertb",$connection) or die ("Error querying DBase"); $i = 0; while($result_ar = mysql_fetch_assoc($result)){ mysql_close(); ?> <?php ob_start(); if ($upass == $result_ar['upass'] && $uname == $result_ar['uname']) { header("Location: clients/myoxy/index.html"); } else header("Location: index.html"); ?> <?php $i+=1; } ?> can anyone help me fix this...actually this is working on our network.. Thanks!!!
×
×
  • 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.