Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: Layout

  1. #1
    New to the CF scene
    Join Date
    Aug 2002
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Layout

    I have the database reading and writing to a php page fine, just having problems with the layout, can any help? or point me somewhere that can help?
    the page in question is
    http://www.kunzair.com/searchform.ph...Michael+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>



    ..........................................................................

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

    possible? using php?

    Thanks
    Michael

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    UK
    Posts
    577
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Your only snags are in the formatting and syntax of the HTML.

    I'd suggest trying to learn the syntaxes yourself --- an easy way would be just to view source on both pages you linked and play a swift game of spot the difference....
    Then just look through the PHP script for the do{} while() section and amend the print statements.

    An example for the departure <td> output

    your php script says -
    print "<TD>{$row['departure']}</TD>\n";
    your other page source reads
    <td width="144" align="center"><font face="Arial" size="1">KBUR</font></td>

    quite simple to just work out what additional bits need to be put in the print statement
    print '<td width="144" align="center"><font face="Arial" size="1">'.$row["departure"].'</font></td>
    ';
    should do for that bit.

    Anyway - have a go yourself and just view-source on the output page to check whether the HTML looks well formed.

    Edit: PS. Welcome to the forum
    Ökii - formerly pootergeist
    teckis - take your time and it'll save you time.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •