Hi 
When I upload very long text that dose not have any enter or space 
in it , my page site stretch and become ugly! 
Anybody help me?
I attach my sample php file
please test that bye very long text! 
---------------------------------------------------
sampel_upload code:

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<table width="50%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td>
        <?php 
        //save content in table
        $uploud=$_POST[uploud];
        if (isset($uploud))
        {
        $title=$_POST[title];
        $news=$_POST[news];
        
        $con = mysql_connect("localhost","root","");
        if (!$con)
          {
          die('Could not connect: ');
          }
        mysql_select_db("my_db", $con);
        
        $sql = "CREATE TABLE my_news
          (
          title varchar(25),
          text longtext 
          )";
          mysql_query($sql,$con) ;
         if ($title=="" or $news=="")
         echo "you must enter informatin ";
         else
        {mysql_query("INSERT INTO my_news
                        (title , text)
                        VALUES
                        ('$title', '$news'  )");}
        }                       
?><a href="sampel_view.php">view</a>
        </td>
  </tr>
  <tr>
    <td><form name=form method=post action=sampel_upload.php>
          <table  align=right width=100% border=0 cellspacing=0 
cellpadding=0>
        <tr>
          <td align=right><input size=25  name=title type=text></td>
          <td align=right><label>heder</label></td>
        </tr>
        <tr>
          <td align=right><textarea warp=physical rows=5 name=news 
cols=50 ></textarea></td>
          <td valign=top align=right><label>text</label></td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td> <br><input name=uploud type=submit class=m0l2iover 
value=uploud></td>
        </tr>
      </table>
    </form>
        </td>
  </tr>
</table>
          
        

</body>
</html>
 ----------------------------------
sampel_view code:


<head>

<title>Untitled Document</title>
</head>

<body>
<?php
        //view table content
$con = mysql_connect("localhost","root","");
        if (!$con)
          {
          die('Could not connect: ');
          }
        mysql_select_db("my_db", $con);
        $result = mysql_query("SELECT * FROM my_news");
        print"<table  align=right width=100% border=0 cellspacing=0 
cellpadding=0>";
        while($row = mysql_fetch_array($result))
        {       print"
        <tr>
          <td align=right><label>$row[title]:</label></td>
                  <td  align=right>$row[text]</td>
                </tr>
                <tr ><td colspan=2><br>  
                  <HR ><br></td>
                  </tr>";}
        print"</table>";

?>
</body>
</html>



Reply via email to