Jump to content


Photo

**SOLVED** Can't figure out why my output is comming out wrong


  • Please log in to reply
7 replies to this topic

#1 OriginalSunny

OriginalSunny
  • Members
  • PipPipPip
  • Advanced Member
  • 95 posts

Posted 24 March 2006 - 11:06 PM

Hi,
I am working on a webpage and can't seem to figure out why my output is comming out half way down the page. My .php file reads in the .inc file which contains the following coding:

<form action="order_form.php?do=new" method="POST">
<?php
if (isset($message_new))
echo "<tr><td colspan='2'><b>$message_new</b>
</td></tr>";
?>

<table border="0" cellpadding="5" cellspacing="0">

<tr><td align="right"><b>Title</b></td>
<td><input type="text" name="title"
value="<?php echo @$title ?>"
size="10" maxlength="10"></td></tr><br><br>

<tr><td align="right"><b>Surname</b></td>
<td><input type="text" name="surname"
value="<?php echo @$surname ?>"
size="30" maxlength="30"></td></tr><br><br>

..........

<tr><td align="center" colspan="2">
<input type="submit"
value="Submit"></td></tr>

</table>

I am fairly confident that the php file is not causing this problem. Can anyone see why it is doing this??

#2 Barand

Barand
  • Moderators
  • Sen . ( ile || sei )
  • 18,017 posts

Posted 25 March 2006 - 12:00 AM

Could it be that $message_new contains several empty lines?
If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received






moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts

#3 OriginalSunny

OriginalSunny
  • Members
  • PipPipPip
  • Advanced Member
  • 95 posts

Posted 25 March 2006 - 12:45 AM

Its not that because when i get rid of echo"..$messagenew.." it doesnt make any difference. The only time it makes a difference is when i get rid of


<table border="0" cellpadding="5" cellspacing="0">

But i need the table to display the info in the correct places. I dont see anything wrong with my table command.

#4 kenrbnsn

kenrbnsn
  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 25 March 2006 - 05:13 AM

Do you have a URL where we could look at the results?

Ken

#5 Hooker

Hooker
  • Members
  • PipPipPip
  • Advanced Member
  • 193 posts
  • LocationWales, UK

Posted 25 March 2006 - 06:13 AM

try changing:
<tr><td colspan='2'><b>$message_new</b>
</td></tr>

to just this:
<b>$message_new</b>

unless "<b>$message_new</b>" is suposed to be set within the table, in which case its in the wrong place, seems to be that its creating 2 colums of an unset size so its just making them huge :/


#6 OriginalSunny

OriginalSunny
  • Members
  • PipPipPip
  • Advanced Member
  • 95 posts

Posted 25 March 2006 - 11:51 AM

I have tried that and it still makes no difference. The only time it makes a difference is when i get rid of:

<table border="0" cellpadding="5" cellspacing="0">

For some reason the table is created half way down the page.

#7 Barand

Barand
  • Moderators
  • Sen . ( ile || sei )
  • 18,017 posts

Posted 25 March 2006 - 11:56 AM

Anything within <table>...</table> that isn't inside a cell will be output above the table.

In your case you have several <br> placed outside table cells. Remove them.

EG

<tr><td align="right"><b>Title</b></td>
<td><input type="text" name="title"
value="<?php echo @$title ?>"
size="10" maxlength="10"></td></tr>[!--coloro:#FF6666--][span style=\"color:#FF6666\"][!--/coloro--]<br><br>[!--colorc--][/span][!--/colorc--]
If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received






moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts

#8 OriginalSunny

OriginalSunny
  • Members
  • PipPipPip
  • Advanced Member
  • 95 posts

Posted 25 March 2006 - 12:02 PM

Its ok now. I have just recoded the page. I think the main problem was those <br> statements.
Thanks.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users