Jump to content


Photo

will not let me submit if there are too many characters


  • Please log in to reply
5 replies to this topic

#1 allmetallica

allmetallica
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 09 November 2003 - 08:41 AM

Okay. I am really new to My SQL and databases and stuff but here goes my question

My friend designed for me a php script which posts news articles directly on a website and pulls it from an SQL database. Now, it works fine until there are too many characters in the post, and it wont let me submit the article. I just press the submit button and it doesnt work

My friend checked and it isnt a problem in the php but some setting in SQL. I checked the field and it is set on \"text\" which means it should allow unlimited text in that field, right??

I am wondering if its a server limitation or something in PHP My Admin that I overlooked

Please explain this to me like im a 4 yr old cuz im very new,

Thanks!

Alex

#2 Barand

Barand
  • Moderators
  • Sen . ( ile || sei )
  • 18,021 posts

Posted 09 November 2003 - 09:21 AM

Check the method on your submitting form. If it is GET then you are limited to about 2K chars.

If you set a text field in mysql to a value that is too long, it should just truncate the text to fit.
If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received






moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts

#3 allmetallica

allmetallica
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 09 November 2003 - 10:24 AM

so what should I do. Is there a way to change the \"get\" in the form because I believe its in there like you said

I didnt set a value to the text field..actually just left it blank. How should I solve this problem?

Alex

#4 Barand

Barand
  • Moderators
  • Sen . ( ile || sei )
  • 18,021 posts

Posted 09 November 2003 - 10:31 AM

Go to the the <form> tag on your page and change
method=\"GET\"
to
method=\"POST\"

However if, as you say, the textarea is empty when you submit, it sounds as thought the problem could be elsewhere.

Post your code and we may be able to help more.
If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received






moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts

#5 allmetallica

allmetallica
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 09 November 2003 - 10:32 PM

erm..I changed them to post and it only displayed a very limited amount of characters..but it let me post it this time at least..here is the code

else if(!isset($submitNow)) {
echo \"<form name=\"addNews\" action=\"$PHP_SELF\" METHOD=\"GET\">\" .
\"<input type=hidden name=\"submitNow\" value=\"true\">\" .
\"<input type=hidden name=\"action\" value=\"Add\">\" .
\"<input type=hidden name=\"type\" value=\"News\">\" .
\"<b>Headline:</b> <input type=\"text\" name=\"headline\" size=\"30\" maxlength=\"100\" length=\"100\">\" .
\"<br><br><b>Submitted by:</b> <input type=\"text\" name=\"poster\" size=\"30\">\" .
\"<br><br><b>Full story:</b><br><textarea name=\"story\" cols=50 rows=14></textarea>\" .
\"<br><br><input type=\"submit\" value=\"Add news item now\" name=\"submit\">\" .
\"</form>\";

#6 Barand

Barand
  • Moderators
  • Sen . ( ile || sei )
  • 18,021 posts

Posted 10 November 2003 - 08:09 PM

So

[php:1:e4b292efb7]<?php
echo \"<form name=\"addNews\" action=\"$PHP_SELF\" METHOD=\"GET\">\" .
?>[/php:1:e4b292efb7]

is now

[php:1:e4b292efb7]<?php
echo \"<form name=\"addNews\" action=\"$PHP_SELF\" METHOD=\"POST\">\" .
?>[/php:1:e4b292efb7]

, yes?

How are you processing the form?
If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received






moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users