probably it's a simple question but here it goes...
I'd like to make on a form a textbox that will serve as a comment of photos that are inserted.
I've got on the form:
<input type=text size=255>
but this gives me a horizonally huge textbox... not what I want. I want something just like this text box that we use to post questions!
can anyone tell me how?
Thanks in advance
Nuno
You could use <textarea>...</textarea> instead and control the dimensions using the rows and cols attributes. Example:
<textarea rows="15" cols="50" name="comments">
</textarea>
yes, I see that. I've tried but that won't do in the form...
i dony't know what you want..I would have given little giants response but here anyway..
| Code: |
<textarea name="textarea"></textarea>
<input type="text" name="textfield"> |
try those I guess.
Theres two different examples there
I tried it... doesn't work on mysql... the textarea is with the name that the input text you wrote, and still not working...
or it isn't working well in the mysql....
What you want is a textarea which is created using the codes already provided. What you mean when you say it doesn't work, I'm not eactly sure though.
If you provide us with some scripts, links and error messages we'll be able to help mutch better 
| Code: |
<form enctype="multipart/form-data" action="filesent.php" method="POST">
<input type="hidden" name="MAX_FILE_SIZE" value="3000000" >
Send this file: <input name="userfile" type="file">
<textarea name="coment" rows="10" cols="40">
</textarea>
<input type="submit" value="Send File" >
</form>
|
| Code: |
$ligacao = mysql_connect("localhost","rantanplan","rantanplan") or die("Problemas de ligacao");
mysql_select_db("homesite",$ligacao);
$sql = "INSERT INTO `photos` (`username` , `link` , `coment`) VALUES
($username,$link,$coment)";
mysql_query($sql);
|
I have this... if I had the input type=text... it would work perfectly... with text area... not working...
anyone that want to help, on the last post, I said I was using textarea... I tried putting id=coment but didn't work as well.... any ideas?
Try adding this before you insert it into the database
| Code: |
| $coment = $_POST['coment']; |
I can do that and it works perfectly if I want to echo it to the page... I have that var in the sql code to insert the text but it doesn't want to... but if i use in the form <input type=text...> instead of the <textarea> it put's with no problem the var contents in the table...
I thing, there could be a problem with sql query. You'd like to add qoutes to update command like
| Code: |
$sql = "INSERT INTO `photos` (`username` , `link` , `coment`) VALUES
($username,$link,\"$coment\")";
|
I thing, it could solve some problems.
I've been picky with you code and changed a few things such as the free spaces at the end of some form fields and some general syntax. Please try these two bits of code and see if they work.
| Code: |
<form enctype="multipart/form-data" action="filesent.php" method="POST">
<input type="hidden" name="MAX_FILE_SIZE" value="3000000">
Send this file: <input name="userfile" type="file">
<textarea name="coment" rows="10" cols="40"></textarea>
<input type="submit" value="Send File">
</form>
|
| Code: |
$ligacao = mysql_connect("localhost","rantanplan","rantanplan") or die("Problemas de ligacao");
mysql_select_db("homesite", $ligacao);
$sql = "INSERT INTO photos(username, link, coment) VALUES
('$username', '$link', '$coment')";
mysql_query($sql);
|
Of course you'll need to change the username, password and databse name! 
mathiaus, that worked... loool
I had a slight problem with my server's security 'cause it didn't allowed me to upload files, but it had nothing to do with that. Apart of that, it's working now, and that's prety fine!
thanks a lot.