[b]amount of data passed thro forms..[/b]
Moderator: General Moderators
- harsha
- Forum Contributor
- Posts: 103
- Joined: Thu Jul 11, 2002 1:35 am
- Location: Bengaluru (Bangalore) > Karnataka > India
[b]amount of data passed thro forms..[/b]
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
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
- harsha
- Forum Contributor
- Posts: 103
- Joined: Thu Jul 11, 2002 1:35 am
- Location: Bengaluru (Bangalore) > Karnataka > India
passing thro forms
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
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
- harsha
- Forum Contributor
- Posts: 103
- Joined: Thu Jul 11, 2002 1:35 am
- Location: Bengaluru (Bangalore) > Karnataka > India
its a long text field
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.
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
- harsha
- Forum Contributor
- Posts: 103
- Joined: Thu Jul 11, 2002 1:35 am
- Location: Bengaluru (Bangalore) > Karnataka > India
heres the complete code...though not very neat ;)
<?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>
<?
}
?>
//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>
<?
}
?>
- harsha
- Forum Contributor
- Posts: 103
- Joined: Thu Jul 11, 2002 1:35 am
- Location: Bengaluru (Bangalore) > Karnataka > India
web POST max is 8 MB
yah i checked apache's httpd conf( i guess thats right ) it says the max size for post is 8 mb
now what?
now what?
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.
