Jump to content

textarea not working


sarab99

Recommended Posts

I lost one day trying to fix this code. I would like to view the reading file as wraped.

 

any help please

 

 <textarea method='POST'  rows=20 cols=100 wrap=on>

<?
if(!empty($_POST['dbname']) && !empty($_POST['dbuser']) && !empty($_POST['dbpass']) && !empty($_POST['path1'])) 
{
$dbname = $_POST['dbname'];
$dbuser = $_POST['dbuser'];
$dbpass = $_POST['dbpass'];
$path1 = $_POST['path1'];
if(mysql_connect( "localhost", $dbuser, $dbpass ))
{
$drop= "DROP TABLE $dbname.`GetIt`" ;
$query = "CREATE TABLE $dbname.`GetIt` (`fileview` VARCHAR( 2048 ) NOT NULL);";
mysql_query($drop);
mysql_query($query);
mysql_query("LOAD DATA LOCAL INFILE " . "'$path1'"  . " INTO TABLE " . $dbname . ".GetIt");
$result =mysql_db_query($dbname,"SELECT * FROM GetIt ");
$numrows = mysql_num_rows($result);    
while($row = mysql_fetch_array($result))   { 
echo $row[fileview] ; 
}
}
}
?>
</textarea>

Link to comment
https://forums.phpfreaks.com/topic/111734-textarea-not-working/
Share on other sites

Not sure if this is your entire problem, but this line:

<textarea method='POST'  rows=20 cols=100 wrap=on>

 

Is incorrect.  It needs to be in form tags and have no method="" declaration on the textarea.

 

Hi

 

I have a form but did not include it  because the problem with the php code. any way below is complete code:

 

<html><head>
<body>

<tr>
                    <td width="100%" dir="ltr">
                      <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber22" height="124" dir="ltr">
                        
            <tr>
            <td width="50%" dir="ltr">            
		<div dir="ltr">
		<form method="post" dir="ltr">
		<table border="0" cellspacing="1" width="109" dir="ltr">
	   	<tr>
		<td width="312" dir="ltr"><font face="Tahoma"><span style="font-size: 9pt">
		DataBase Name :<br> <input type="text" name="dbname" size="20">  
		</span></font></td>
		<td width="245" dir="ltr"><font face="Tahoma"><span style="font-size: 9pt">
		Username :<br>
            <input type="text" name="dbuser" size="20"></span></font></td>
		<td width="117" dir="ltr"><font face="Tahoma"><span style="font-size: 9pt">
		Password :<input type="text" name="dbpass" size="20"></span></font></td>
	    </tr>
	    <tr>
		<td width="558" valign="middle" colspan="2" dir="ltr">
		<p align="left" dir="ltr"><font face="Tahoma"><span style="font-size: 9pt">
		File Path :
		<input type="text" name="path1" size="90" value="file to read"></span></font></td>
		<td width="117" valign="middle" dir="ltr">
		<font face="Tahoma"><span style="font-size: 9pt">
		<input type="submit" value="GetIt" name="exec"></span></font></td>
	    </tr>



 <textarea method='POST'  rows=20 cols=100 wrap=on>

<?
if(!empty($_POST['dbname']) && !empty($_POST['dbuser']) && !empty($_POST['dbpass']) && !empty($_POST['path1'])) 
{
$dbname = $_POST['dbname'];
$dbuser = $_POST['dbuser'];
$dbpass = $_POST['dbpass'];
$path1 = $_POST['path1'];
if(mysql_connect( "localhost", $dbuser, $dbpass ))
{
$drop= "DROP TABLE $dbname.`GetIt`" ;
$query = "CREATE TABLE $dbname.`GetIt` (`fileview` VARCHAR( 2048 ) NOT NULL);";
mysql_query($drop);
mysql_query($query);
mysql_query("LOAD DATA LOCAL INFILE " . "'$path1'"  . " INTO TABLE " . $dbname . ".GetIt");
$result =mysql_db_query($dbname,"SELECT * FROM GetIt ");
$numrows = mysql_num_rows($result);    
while($row = mysql_fetch_array($result))   { 
echo $row[fileview] ; 


    
}
}

}

?>
</textarea>

Link to comment
https://forums.phpfreaks.com/topic/111734-textarea-not-working/#findComment-573595
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.