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
  1. #1
    New to the CF scene
    Join Date
    Jun 2003
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Problem with Table, Java script and Text Document in PHP

    Please take a datail look of my code. When I am displaying the text document get messed up with table area. Any suggestion??? Please...
    If anyone interested to see the out put please provide the e-mail address I will send a snap shot oy the messy out put.

    <html>
    <HEAD>

    <style>

    .itemBorder { border: 1px solid black }
    .itemText { text-decoration: none; color: #FFFFFF; font: 12px Arial, Helvetica }
    .crazyBorder { border: 2px outset #663399 }
    .crazyText { text-decoration: none; color: #FFCC99; font: Bold 12px Arial, Helvetica }

    </style>

    </HEAD>

    <BODY marginwidth="0" marginheight="0" style="margin: 0" onLoad="writeMenus()" onResize="if (isNS4) nsResizeHandler()">


    <table width = 100% height = 100%>
    <tr>
    <td ALIGN = left width = 20% height = 100%>

    <SCRIPT LANGUAGE="JavaScript" src = "TableOfContent.js">
    </script>

    </td>

    <td align = left valign = top width = 50% height = 100%>

    <form action = "ShowDomainName.php" Method = "GET">

    <?php

    require("............");
    $link = mysql_connect($host,$user,$pass);
    if (!$link)
    die("Couldn't connect to MySQL");

    mysql_select_db($db)
    or die("Couldn't open $db: ".mysql_error());

    $table = "Domain";
    $result = mysql_query("SELECT Name FROM $table");

    if (!$result)
    {
    print "Query Failed: " .mysql_error();
    }
    else
    {
    $num_rows = mysql_num_rows($result);
    if(!$submit)
    {
    if ($num_rows > 0)
    {
    print "<br>Available number of Domain/Domains : $num_rows <p>";
    print "<table border = 1>\n";

    while($a_row = mysql_fetch_row($result))
    {
    print "<tr>\n";
    foreach ($a_row as $field)
    print "\t<td>$field</td>\n";
    $Domain_Name[] = $field;
    print "</tr>\n";
    }
    print "</table>\n";
    ?>
    </td>
    <td align = left valign = top width = 30% height = 100%>
    <br>Select any of the domain for more information<br><br>
    <select name = "DomainMenu">
    <option value></option>
    <?php
    foreach ($Domain_Name as $Existing_Domain)
    print " <option value=\"$Existing_Domain \">$Existing_Domain</option>";

    ?>
    </select>
    <input type="submit" value="Show More Info" name="submit">
    </form>
    <?php
    }
    else
    print "There is no Domain in the Database";
    }
    else
    {
    if (isset($_GET['DomainMenu']))
    {
    $val = $_GET['DomainMenu'];
    if ($val != '')
    {
    $result = mysql_query("SELECT Description FROM $table where Name = '". $_GET['DomainMenu'] ."'");
    if (!$result)
    {
    print "Query Failed: " .mysql_error();
    }
    else
    {
    $Domain_Description = mysql_result($result, 0, 'Description');

    $string = trim($Domain_Description);
    if ($string != '')
    {


    print "<h1>Description for ".$_GET['DomainMenu']." </h1>\n";
    $Domain_Description = nl2br($Domain_Description);
    print "<pre>$Domain_Description</pre>";
    }
    else
    {
    print "There is no description for $val";
    }

    }
    }
    else
    print "Plese Select a Domain and try again";
    }
    }
    }
    mysql_close($link);
    ?>

    </td>
    </tr>
    </table>

    </body>

    </html>

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    frankfurt, german banana republic
    Posts
    1,848
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Ehm, where is your JavaScript question?

    To encourage more reponses to your problem, I would suggest you put the messy code online so we can have a look at it. Seeing only PHP code does not help very much.
    De gustibus non est disputandum.


  •  

    Posting Permissions

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