Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how I can capture a string which is more then 262 characters from an h

Status
Not open for further replies.

Queryman

Programmer
Nov 4, 2002
243
US
how I can capture a string which is more then 262 characters from an html form. I have tried both get and post method on the html form.



Michael

 
Hmm, I don't seem to have that problem:
sample.asp
Code:
<%
Option Explicit

Dim myLongString, i
For i = 1 to 500
	myLongString = myLongString & i mod 10
Next

%>
<html>
<head>
</head>
<body>
<form method=&quot;POST&quot; action=&quot;sample.asp&quot;>
<input type=&quot;text&quot; name=&quot;aLongInput&quot; value=&quot;<%=myLongString%>&quot;>
<input type=&quot;submit&quot;>
</form>
<%
If Request.Form(&quot;aLongInput&quot;) <> &quot;&quot; Then Response.Write &quot;You posted &quot; & len(Request.Form(&quot;aLongInput&quot;)) & &quot; characters: <br>&quot; & Request.Form(&quot;aLongInput&quot;)
%>
</body>
</html>

sample.php
Code:
<?
for($i = 1;$i<=500;$i++)
	$myLongString = $myLongString . $i % 10;
?>
<html>
<head>
</head>
<body>
<form method=&quot;POST&quot; action=&quot;sample.asp&quot;>
<input type=&quot;text&quot; name=&quot;aLongInput&quot; value=&quot;<?echo $myLongString?>&quot;>
<input type=&quot;submit&quot;>
</form>
<?
if(!empty($_POST))
	echo &quot;You posted &quot; . length($_POST[&quot;aLongInput&quot;]) . &quot; characters: <br>&quot; . $_POST[&quot;aLongInput&quot;];
?>
</body>
</html>

What language are you using?

-Tarwn

[sub]01010100 01101001 01100101 01110010 01101110 01101111 01101011 00101110 01100011 01101111 01101101 [/sub]
[sup]29 3K 10 3D 3L 3J 3K 10 32 35 10 3E 39 33 35 10 3K 3F 10 38 31 3M 35 10 36 3I 35 35 10 3K 39 3D 35 10 1Q 19[/sup]
Get better results for your questions: faq333-2924
Frequently Asked ASP Questions: faq333-3048
 
Wow, my PHP is rusty, lets fix that :p
sample.php
Code:
<?
$myLongString = &quot;&quot;;
for($i = 1;$i<=500;$i++)
	$myLongString = $myLongString . $i % 10;
?>
<html>
<head>
</head>
<body>
<form method=&quot;POST&quot; action=&quot;sample.php&quot;>
<input type=&quot;text&quot; name=&quot;aLongInput&quot; value=&quot;<?echo $myLongString?>&quot;>
<input type=&quot;submit&quot;>
</form>
<?
if(!empty($_POST))
	echo &quot;You posted &quot; . strlen($_POST[&quot;aLongInput&quot;]) . &quot; characters: <br>&quot; . $_POST[&quot;aLongInput&quot;];
?>
</body>
</html>

Sorry about that :)
-Tarwn

[sub]01010100 01101001 01100101 01110010 01101110 01101111 01101011 00101110 01100011 01101111 01101101 [/sub]
[sup]29 3K 10 3D 3L 3J 3K 10 32 35 10 3E 39 33 35 10 3K 3F 10 38 31 3M 35 10 36 3I 35 35 10 3K 39 3D 35 10 1Q 19[/sup]
Get better results for your questions: faq333-2924
Frequently Asked ASP Questions: faq333-3048
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top