Layout not looking right

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
dinno2
Forum Newbie
Posts: 9
Joined: Sun Aug 11, 2002 10:25 am

Layout not looking right

Post by dinno2 »

Well i have PHP reading the database fine, its just the appearance im not happy with, i would like to be able to <center> the text, and font size arial 1 .. the page in question is at:
http://www.kunzair.com/searchform.php?p ... ael+Driggs

the code is:

<html>
<body>
<?php

mysql_connect (localhost, kunzair_Michael, poster1);

mysql_select_db (kunzair_pirep);
include("header.php");
if ($pilotid == "")
{$pilotid = '%';}

$result = mysql_query ("SELECT * FROM pirep WHERE pilotid LIKE '$pilotid%'");

if ($row = mysql_fetch_array($result)) {
print "<CENTER>";
print "
<table>
<TD>{$row['pilotid']}</TD>\n";
print "<br><br>";
print "<TABLE BORDER=\"0\">\n";
print "<TR>\n<TD><b>PilotID_________________</b></TD>\n";
print "<hr>";
print "<TD><b>Departure___</b></TD>\n";
print "<TD><b>Destination__</b></TD>\n";
print "<TD><b>Hours__</b></TD>\n";
print "<TD><b>Route</b></TD>\n</TR>\n";
do {
print "<TR>\n";
print "<TD>{$row['pilotid']}</TD>\n";
print "<TD>{$row['departure']}</TD>\n";
print "<TD>{$row['destination']}</TD>\n";
print "<TD>{$row['hours']}</TD>\n";
print "<TD>{$row['route']}</TD>\n";
print "</TR>\n";
} while($row = mysql_fetch_array($result));
print "</TABLE>\n</CENTER\n";
print "<center>";
print "<br><br>";
print "<br><br>";
} else {print "<center>You need to enter a PIREP first!</center>";}
print "<BR>\n";
include("footer2.php");
?>
</body>

the page i would like it to look like is:
http://www.kunzair.com/kva101.htm

is that possible??!!??
Michael
User avatar
protokol
Forum Contributor
Posts: 353
Joined: Fri Jun 21, 2002 7:00 pm
Location: Cleveland, OH
Contact:

Post by protokol »

You need to be more specific about what part of the page you need help formatting.
dinno2
Forum Newbie
Posts: 9
Joined: Sun Aug 11, 2002 10:25 am

The sql data

Post by dinno2 »

The Data being pulled off the database, it is writing to the page fine, but i think it looks sloppy, if you take a look at the first link below, it will show you what i am getting, the second link is what i would like to have the page look like. basically, the text size, and font, in a php querry.
the code is in the first post still. hope that clears that up?
Michael
now:
http://www.kunzair.com/searchform.php?p ... ael+Driggs
what i would like aperance wise:
http://www.kunzair.com/kva101.htm

thanks
User avatar
protokol
Forum Contributor
Posts: 353
Joined: Fri Jun 21, 2002 7:00 pm
Location: Cleveland, OH
Contact:

Post by protokol »

Just edit the html attributes in the php code. So where there is a <tr>, make it <tr align=\"center\">

Then everything in the row is centered.
dinno2
Forum Newbie
Posts: 9
Joined: Sun Aug 11, 2002 10:25 am

Post by dinno2 »

Thanks ill try that, what about font size? and style
hehe sorry to be a pest <G>
Michael
User avatar
protokol
Forum Contributor
Posts: 353
Joined: Fri Jun 21, 2002 7:00 pm
Location: Cleveland, OH
Contact:

Post by protokol »

Think of all the data you are displaying as just plain text. Don't worry about the fact that it is dynamically displayed. If you have a pilot who you are displaying info for, then print the formatting (tables in your case) just as you would do in HTML. Create a stylesheet and then include the class's or id's in your HTML.

CSS Tutorial
dinno2
Forum Newbie
Posts: 9
Joined: Sun Aug 11, 2002 10:25 am

Post by dinno2 »

im sorry i just dont get that, ive been reading for two weeks, and cant find anything on text size, in php array
i still am learning <G> duh, and i sure apreciate your help, i did get the text centered, just would like to know anyway to change the text size, per LINE...such as the <TR> or <TD> tags?
User avatar
phice
Moderator
Posts: 1416
Joined: Sat Apr 20, 2002 3:14 pm
Location: Dallas, TX
Contact:

Post by phice »

<font face=Arial size=1>$variableName</font>

Easy. :/
Image Image
dinno2
Forum Newbie
Posts: 9
Joined: Sun Aug 11, 2002 10:25 am

Post by dinno2 »

wow, and ive been looking for weeks for that...shhesh

thank you so much!

Michael
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

<css advocacy>The problem with <font> tags is you end up with hundreds of them bloating your page. If you really want more control over which fonts are used and what they should look like, try CSS like protokol said. It really makes a difference to page size and by using it you can change all your text to Verdana without having to worry about every little font tag.</css advocacy> :)

Mac
MattF
Forum Contributor
Posts: 225
Joined: Sun May 19, 2002 9:58 am
Location: Sussex, UK

Post by MattF »

the <font> tag is HTML not PHP.

If you want to save page loading times and produce a better page add this between the head tags:

<style type="text/css">
.cell {
font-family: Arial;
font-size: 10pt;
text-align: center;
}
</style>

Then when you echo out each line change <td> to <td class="cell">
Post Reply