Current location: Hot Scripts Forums » Programming Languages » PHP » new lines in IE and not Firefox?


new lines in IE and not Firefox?

Reply
  #1 (permalink)  
Old 08-18-05, 02:29 PM
blackcode blackcode is offline
Newbie Coder
 
Join Date: Jul 2005
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
new lines in IE and not Firefox?

hey for some reason in firefox this is formatted properly but when you look at it in internet explorer every word is on a new line (this is the part that is suppose to tell you if the name field is not entered inside a table cell):

PHP Code:

<?php

if ($_SESSION['level'] < 3)
{
   
header("Location: index2.php");
}
echo 
"<body bgcolor='#000000'><form action='includes/prot/addedinventory.php' name='AddContact' method='post'>
   <table class='addinventory'><tr><td class='addinventorycheck' colspan='2' align='center'>"
;
if (
$_SESSION['inventory-add'] == "yes")
{
   echo 
"Successfully Added Product";
}
elseif (
$_SESSION['inventory-add'] == "no")
{
   echo 
"Error Adding Product to Inventory!";
   
$nameblank "Inventory Name must be Entered!";
}
else
{
   echo 
"Add Inventory";
}
echo 
"</td></tr>
   <tr><td>Name</td><td><input class='form' name='name' type='text'></td></tr>"
;
if (
$_SESSION['field-name'] == "blank")
{
   echo 
"<tr><td colspan='2' class='error'>$nameblank</td></tr>";
   unset(
$_SESSION['field-name']);
}
unset(
$_SESSION['inventory-add']);
?>
this is all the css that is in the external file:

Code:
table.addinventory{
	vertical-align:top;
	color:#FFFFFF;
	font-weight:bold;
}
td.addinventorycheck{
	vertical-align:top;
	color:#33CCFF;
}
td.error{
	background-color:#333333;
	border-color:#666666;
	border-style:dashed;
	color:#FF0000;
	width:50px;
}
and this is the part that verify's that the name is entered:

PHP Code:

<?php

session_start
();
include(
"../../includes/sql.php");
if (
$_SESSION['level'] < 3)
{
   
header("Location: index2.php?auth=login");
}
foreach (
$_POST as $field => $value)
{
   if (
$field == "name")
   {
      if (
$value == "")
      {
         
$_SESSION['inventory-add'] = "no";
         
$_SESSION['field-name'] = "blank";
      }
   }
}
if (
$_SESSION['inventory-add'] == "no")
{
   
header("Location: ../../index2.php?main=addinventory");
   exit();
}
$add_name $_POST['name'];
$add_price $_POST['price'];
$add_description $_POST['description'];
$add_image_url $_POST['image_url'];
$add_catagory $_POST['catagory'];
$add_sale_price $_POST['sale_price'];
$add_cost $_POST['cost'];
$add_stalk $_POST['stalk'];
$add_fantasia_price $_POST['fantasia_price'];
$add_attribute $_POST['attribute'];
$query="INSERT INTO Inventory (name,price,description,image_url,catagory,sale_price,cost,stalk,fantasia_price,attribute) VALUES ('$add_name','$add_price','$add_description','$add_image_url','$add_catagory','$add_sale_price','$add_cost','$add_stalk','$add_fantasia_price','$add_attribute')";
$result=mysql_query($query);
$_SESSION['inventory-add'] = "yes";
header("Location: ../../index2.php?main=addinventory");
?>
Reply With Quote
  #2 (permalink)  
Old 08-18-05, 03:07 PM
Keith's Avatar
Keith Keith is offline
Community Liaison
 
Join Date: Feb 2004
Posts: 1,232
Thanks: 1
Thanked 11 Times in 11 Posts
Could you copy and paste the HTML source for each browser?
Reply With Quote
  #3 (permalink)  
Old 08-18-05, 03:17 PM
blackcode blackcode is offline
Newbie Coder
 
Join Date: Jul 2005
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
this is going to be really ****ed up because it is alot of includes and stuff in this page... this is ie:

Code:
<p class="copyright">Copyright © 2005 - ShyMoments.com,<br> All rights reserved.</p><link rel="stylesheet" type="text/css" href="style/default.css"/>
<link rel="stylesheet" type="text/css" href="style/tables.css"/>
<html>
<head>
<title>ShyMoments - Where it's ok to be Shy!</title>
</head>
<body>
<table class="style">
 <tr>
  <td class="top" colspan="2">
  <table class='top'><tr><td><img src='images/shyblackeye.jpg' height='150'></td><td class='auth'><a href='index2.php?main=addinventory'>Add Inventory</a></td><td class='news'>
<table width=200 height=150 >
<tr><td>
<marquee height=150 width=200 bgcolor=#FFFFFF 
scrollamount=2 scrolldelay=40 direction=up 
onmouseover="this.stop()" onmouseout="this.start()">
<br>
<div align=left style="margin: 10px;"><a href=# style="color: #000000; font-size: 13px; text-decoration: none; 
font-weight: bold;">Welcome to ShyMoments.com</a></div><br><div align=left style="margin: 10px;"><a href=# style="color: #000000; font-size: 13px; text-decoration: none; 
font-weight: bold;">Page is currently Under Construction, Party's are going to be available shortly.</a></div><br><div align=left style="margin: 10px;"><a href=# style="color: #000000; font-size: 13px; text-decoration: none; 
font-weight: bold;">All Sales Reps must make a account for this site and e-mail webmaster@shymoments.com or sue@shymoments.com with the username you registered.</a></div><br><br>
</marquee>
</td></tr>
</table></td>
      </tr>
      </table><h1 class="welcome">
Welcome, blackcode</h1>  </td>
 </tr>
  <td class="menu">
  <body>
<div class="menu" id="menu_place">
</div>
<script language="javascript" src="scripts/menu.js"></script>
<script language="javascript" src="scripts/admin-thing.js"></script>
</body>  </td>
  <td class="main">
  <html>
<body>
<table class='middle'>
    <tr>
     <td class='middlemain'>
     <div class='middlemain'><script type="text/javascript">
function formReset()
{
var x=document.forms.AddContact
x.reset()
}
</script> 
<table>
<tr><td><body bgcolor='#000000'><form action='includes/prot/addedinventory.php' name='AddContact' method='post'>
   <table class='addinventory'><tr><td class='addinventorycheck' colspan='2' align='center'>Add Inventory</td></tr>
   <tr><td>Name</td><td><input class='form' name='name' type='text'></td></tr><tr><td>Price</td><td><input class="form" name="price" type="text"></td></tr>
<tr><td>Description</td><td><input class="form" name="description" type="text"></td></tr>
<tr><td>Image</td><td><input class="form" name="image_url" type="text"></td></tr>
<tr><td>Catagory</td><td><input class="form" name="catagory" type="text"></td></tr>
<tr><td>Sale Price</td><td><input class="form" name="sale_price" type="text"></td></tr>
<tr><td>Cost</td><td><input class="form" name="cost" type="text"></td></tr>
<tr><td>Stalk</td><td><input class="form" name="stalk" type="text"></td></tr>
<tr><td>Fantasia's Price</td><td><input class="form" name="fantasia_price" type="text"></td></tr>
<tr><td>Attribute</td><td><input class="form" name="price" type="text"></td></tr>
<tr><td colspan="2" align="center"><input type="submit" value="Add Item">
<input type="button" onclick="formReset()" value="Reset"></td></tr></table>
</form>
</td></tr>
</table></div>
     </td>
     <td class='promos'>
     <div class='promos'>Our Promotion of today is everything is <b>FREE!!!</b> That is if you can find a product to buy :)</div>
     </td>
    </tr>
    <tr>
     <td colspan='2' class='nav'><center>
<b>|ShyMoments.com|</b></center></td>
    </tr>
   </table></body>
</html>  </td>
 </tr>
</table>
</body>
</html>
and this is firefox:
Code:
<p class="copyright">Copyright © 2005 - ShyMoments.com,<br> All rights reserved.</p><link rel="stylesheet" type="text/css" href="style/default.css"/>
<link rel="stylesheet" type="text/css" href="style/tables.css"/>
<html>
<head>
<title>ShyMoments - Where it's ok to be Shy!</title>
</head>
<body>
<table class="style">
 <tr>
  <td class="top" colspan="2">
  <table class='top'><tr><td><img src='images/shyblackeye.jpg' height='150'></td><td class='auth'><a href='index2.php?main=addinventory'>Add Inventory</a></td><td class='news'>

<table width=200 height=150 >
<tr><td>
<marquee height=150 width=200 bgcolor=#FFFFFF 
scrollamount=2 scrolldelay=40 direction=up 
onmouseover="this.stop()" onmouseout="this.start()">
<br>
<div align=left style="margin: 10px;"><a href=# style="color: #000000; font-size: 13px; text-decoration: none; 
font-weight: bold;">Welcome to ShyMoments.com</a></div><br><div align=left style="margin: 10px;"><a href=# style="color: #000000; font-size: 13px; text-decoration: none; 
font-weight: bold;">Page is currently Under Construction, Party's are going to be available shortly.</a></div><br><div align=left style="margin: 10px;"><a href=# style="color: #000000; font-size: 13px; text-decoration: none; 
font-weight: bold;">All Sales Reps must make a account for this site and e-mail webmaster@shymoments.com or sue@shymoments.com with the username you registered.</a></div><br><br>
</marquee>
</td></tr>
</table></td>
      </tr>
      </table><h1 class="welcome">
Welcome, blackcode</h1>  </td>

 </tr>
  <td class="menu">
  <body>
<div class="menu" id="menu_place">
</div>
<script language="javascript" src="scripts/menu.js"></script>
<script language="javascript" src="scripts/admin-thing.js"></script>
</body>  </td>
  <td class="main">
  <html>

<body>
<table class='middle'>
    <tr>
     <td class='middlemain'>
     <div class='middlemain'><script type="text/javascript">
function formReset()
{
var x=document.forms.AddContact
x.reset()
}
</script> 
<table>
<tr><td><body bgcolor='#000000'><form action='includes/prot/addedinventory.php' name='AddContact' method='post'>
   <table class='addinventory'><tr><td class='addinventorycheck' colspan='2' align='center'>Add Inventory</td></tr>
   <tr><td>Name</td><td><input class='form' name='name' type='text'></td></tr><tr><td>Price</td><td><input class="form" name="price" type="text"></td></tr>

<tr><td>Description</td><td><input class="form" name="description" type="text"></td></tr>
<tr><td>Image</td><td><input class="form" name="image_url" type="text"></td></tr>
<tr><td>Catagory</td><td><input class="form" name="catagory" type="text"></td></tr>
<tr><td>Sale Price</td><td><input class="form" name="sale_price" type="text"></td></tr>
<tr><td>Cost</td><td><input class="form" name="cost" type="text"></td></tr>
<tr><td>Stalk</td><td><input class="form" name="stalk" type="text"></td></tr>
<tr><td>Fantasia's Price</td><td><input class="form" name="fantasia_price" type="text"></td></tr>
<tr><td>Attribute</td><td><input class="form" name="price" type="text"></td></tr>
<tr><td colspan="2" align="center"><input type="submit" value="Add Item">

<input type="button" onclick="formReset()" value="Reset"></td></tr></table>
</form>
</td></tr>
</table></div>
     </td>
     <td class='promos'>
     <div class='promos'>Our Promotion of today is everything is <b>FREE!!!</b> That is if you can find a product to buy :)</div>
     </td>
    </tr>

    <tr>
     <td colspan='2' class='nav'><center>
<b>|ShyMoments.com|</b></center></td>
    </tr>
   </table></body>
</html>  </td>
 </tr>
</table>
</body>
</html>
Reply With Quote
  #4 (permalink)  
Old 08-18-05, 03:20 PM
blackcode blackcode is offline
Newbie Coder
 
Join Date: Jul 2005
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
if you need a username and password to test it just ask ill private message you with a username and password... and what to do to see what im talking about...
Reply With Quote
  #5 (permalink)  
Old 08-18-05, 07:49 PM
Keith's Avatar
Keith Keith is offline
Community Liaison
 
Join Date: Feb 2004
Posts: 1,232
Thanks: 1
Thanked 11 Times in 11 Posts
Yeah, the code in both is identical, just as it should be. The browser really makes no difference, the output will always be the same.
Reply With Quote
  #6 (permalink)  
Old 08-21-05, 10:17 AM
blackcode blackcode is offline
Newbie Coder
 
Join Date: Jul 2005
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
yea... and this is why i hate microsoft...
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump


All times are GMT -5. The time now is 07:02 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.