Page 1 of 1

[b]amount of data passed thro forms..[/b]

Posted: Fri Sep 20, 2002 3:21 am
by harsha
i need help with the amount of data passed to a MySQL DB using forms...right now the size of data chunk i pass is too less and i want to be able to pass articles together....plz help

Posted: Fri Sep 20, 2002 3:44 am
by twigletmac
Sorry I'm a bit confused by your question, could you please explain what exactly you are trying to do and how would like to be able to do it.

Mac

passing thro forms

Posted: Fri Sep 20, 2002 3:58 am
by harsha
i scripted a php script to accept the article(which is quite big) and then i connect to the mysql db and enter another row....what happens now is that the data entered is clipped (i.e; part of the data is inserted)....i hope that helps

Posted: Fri Sep 20, 2002 4:01 am
by twigletmac
What type of field are you inserting the data into? If it's a varchar field then that will only accept 255 characters, if you need space for more you should change it to a text field.

Mac

its a long text field

Posted: Fri Sep 20, 2002 4:05 am
by harsha
am inserting into a long text field and face no problem when i use PHP MYadmin to do that its only when i send on the localnetwork.

Posted: Fri Sep 20, 2002 4:06 am
by twigletmac
That's really strange. Why don't you post some of the code here - maybe something in there is going wrong.

Mac

heres the complete code...though not very neat ;)

Posted: Fri Sep 20, 2002 4:08 am
by harsha
<?php

//form variables declared as global variables
$author=$HTTP_POST_VARS['author'];
$title=$HTTP_POST_VARS['title'];
$info=$HTTP_POST_VARS['info'];
$body=$HTTP_POST_VARS['body'];
$submit=$HTTP_POST_VARS['submit'];
if($HTTP_POST_VARS['submit'])
{
$db = mysql_connect("localhost", "shadows","qwerty");
mysql_select_db("articles",$db);
$sql = "INSERT INTO artikle (author,title,info,body) VALUES ('$author','$title', '$info', '$body')";
$result = mysql_query($sql);
echo "<b>Thank you! Information entered.<b><br>";
}
else
{
?><title>^*Articles--AutoShadows v1.0*^</title>
<body bgcolor="#CCCCCC">
<form method="POST" action="auto_article.php">
Author's name:<br><input type="Text" name="author" size="30"><br>
Article's title:<br><input type="Text" name="title" size="67"><br>
Description of the Article:<br>
<textarea name="info" cols="50" rows="5">
Enter the description of the article
</textarea>
<br><br>
Article in detail:<br>
<textarea name="body" cols="50" rows="10">
Enter the description of the article
</textarea>
<br>
<input type="submit" name="submit" value="Publish Article">
<input type="reset"name="reset" value="clear all"></form>
<?
}
?>

Posted: Fri Sep 20, 2002 5:49 am
by Wayne
have you checked the HTTP POST max size restrictions on your webserver?

web POST max is 8 MB

Posted: Fri Sep 20, 2002 6:05 am
by harsha
yah i checked apache's httpd conf( i guess thats right ) it says the max size for post is 8 mb
now what?

Posted: Fri Sep 20, 2002 8:46 am
by phice
Nice work on the bold tags in the title ;)

Posted: Fri Sep 20, 2002 9:11 am
by Wayne
try printing the article body to the screen at the same time as when you do the database insert, as if it were the confirmation page. At least then you will know whether it is the database chopping the data or if the full article isnt getting posted to the database. Let us know which of those options it is.