posting information from a textarea

posting information from a textarea

am 06.07.2006 18:29:09 von Dave W

------=_Part_78502_28614231.1152203349190
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

I seem to be having a problem posting text from a text area. I have a form
that posts data into a database and there are input fields which seem to
post the data fine. I know this because the entry is changing in the
database, but the text area text doesn't seem to be posting. I double
checked to make sure i got the names right, but it still doesn't seem to be
working. Before I put it into the database I'm using stripslashes. I thought
that might of been the problem and I changed it to trim, but that didn't
work. In the database, the field that I'm putting it into is a longtext type
with fulltext.

--
Dave W

------=_Part_78502_28614231.1152203349190--

Re: posting information from a textarea

am 06.07.2006 18:43:29 von Dave W

------=_Part_78991_32228729.1152204209115
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

I saw this bug: http://bugs.php.net/bug.php?id=22427. Could this be related
to problem I'm having?

On 7/6/06, Dave W wrote:
>
> O, I also tried to change it to a $_FILES array, but that didn't work
> either.
>
> On 7/6/06, Dave W wrote:
> >
> > I seem to be having a problem posting text from a text area. I have a
> > form that posts data into a database and there are input fields which seem
> > to post the data fine. I know this because the entry is changing in the
> > database, but the text area text doesn't seem to be posting. I double
> > checked to make sure i got the names right, but it still doesn't seem to be
> > working. Before I put it into the database I'm using stripslashes. I thought
> > that might of been the problem and I changed it to trim, but that didn't
> > work. In the database, the field that I'm putting it into is a longtext type
> > with fulltext.
> >
> > --
> > Dave W
> >
>


--
Dave W

------=_Part_78991_32228729.1152204209115--

Re: posting information from a textarea

am 06.07.2006 18:59:23 von Brad Bonkoski

stripslashes should not be needed...

if anything addslashes() may be needed if you have single quotes in the
text area.
I would say step 1 is to echo out your insert query to the page before
you even excute the insert, to verify the query, and that you are
getting the proper information from the form.
-B

Dave W wrote:

> I seem to be having a problem posting text from a text area. I have a
> form
> that posts data into a database and there are input fields which seem to
> post the data fine. I know this because the entry is changing in the
> database, but the text area text doesn't seem to be posting. I double
> checked to make sure i got the names right, but it still doesn't seem
> to be
> working. Before I put it into the database I'm using stripslashes. I
> thought
> that might of been the problem and I changed it to trim, but that didn't
> work. In the database, the field that I'm putting it into is a
> longtext type
> with fulltext.
>

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: posting information from a textarea

am 06.07.2006 19:22:27 von Dave W

------=_Part_80091_33212920.1152206547570
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

The inputs are posting, but the textarea still isn't. Argh!

On 7/6/06, Brad Bonkoski wrote:
>
> stripslashes should not be needed...
>
> if anything addslashes() may be needed if you have single quotes in the
> text area.
> I would say step 1 is to echo out your insert query to the page before
> you even excute the insert, to verify the query, and that you are
> getting the proper information from the form.
> -B
>
> Dave W wrote:
>
> > I seem to be having a problem posting text from a text area. I have a
> > form
> > that posts data into a database and there are input fields which seem to
>
> > post the data fine. I know this because the entry is changing in the
> > database, but the text area text doesn't seem to be posting. I double
> > checked to make sure i got the names right, but it still doesn't seem
> > to be
> > working. Before I put it into the database I'm using stripslashes. I
> > thought
> > that might of been the problem and I changed it to trim, but that didn't
> > work. In the database, the field that I'm putting it into is a
> > longtext type
> > with fulltext.
> >
>
>


--
Dave W

------=_Part_80091_33212920.1152206547570--

Re: Re: posting information from a textarea

am 07.07.2006 01:58:59 von Chris

Dave W wrote:
> I saw this bug: http://bugs.php.net/bug.php?id=22427. Could this be related
> to problem I'm having?

Simplify your example and test it, only way to know.

--
Postgresql & php tutorials
http://www.designmagick.com/

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Re: posting information from a textarea

am 07.07.2006 02:02:43 von Chris

Dave W wrote:
> I saw this bug: http://bugs.php.net/bug.php?id=22427. Could this be related
> to problem I'm having?
>

Actually, show us the form you're trying to submit before doing anything
else. Since we haven't seen any html or php code, guessing it's a bug is
a bit of a stretch.

--
Postgresql & php tutorials
http://www.designmagick.com/

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Re: posting information from a textarea

am 07.07.2006 03:03:46 von Dave W

------=_Part_4998_32404711.1152234226260
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

I'll show you all the steps it passes through.
Here's the form:




value="value("motto") == ""){
echo $session->nationinfo['motto'];
}else{
echo $form->value("motto");
} ?>" />






It's echoing the nationinfo right, but its not posting it. The motto also
works too. When it's submitted, it goes through the function
procEditNation().

$session->editNation($_POST['motto'], $_POST['desc']);

The editNation function:

function editNation($motto, $desc){
global $database, $form;

if($motto){
$field = "motto";
$motto = htmlspecialchars($motto);
$database->updateNationField($this->username,"motto",$motto) ;

}

if($desc){
$field = "desc";
$desc = htmlspecialchars($desc);
$database->updateNationField($this->username,"desc",$desc);


}

return true;
}

Then finally the updateNationField function:

function updateNationField($username, $field, $value){
$q = "UPDATE nations SET ".$field." = '$value' WHERE username =
'$username'";
return mysql_query($q, $this->connection);
}

I just don't know what's wrong since it's posting the motto (which is just a
text-type input) and not the description (which is a textarea). I echo'd out
the mysql queries and excuted them myself from what echo'd out and it's
selecting the desc column just fine.



On 7/6/06, Chris wrote:
>
> Dave W wrote:
> > I saw this bug: http://bugs.php.net/bug.php?id=22427. Could this be
> related
> > to problem I'm having?
> >
>
> Actually, show us the form you're trying to submit before doing anything
> else. Since we haven't seen any html or php code, guessing it's a bug is
> a bit of a stretch.
>
> --
> Postgresql & php tutorials
> http://www.designmagick.com/
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


--
Dave W

------=_Part_4998_32404711.1152234226260--

Re: Re: posting information from a textarea

am 07.07.2006 03:10:49 von Chris

Dave W wrote:
> I'll show you all the steps it passes through.
> Here's the form:
>
>


>

>
> > value="value("motto") == ""){
> echo $session->nationinfo['motto'];
> }else{
> echo $form->value("motto");
> } ?>" />
>
>
>
>

>

>
> It's echoing the nationinfo right, but its not posting it. The motto
> also works too. When it's submitted, it goes through the function
> procEditNation().
>
> $session->editNation($_POST['motto'], $_POST['desc']);
>
> The editNation function:
>
> function editNation($motto, $desc){
> global $database, $form;
>
> if($motto){
> $field = "motto";
> $motto = htmlspecialchars($motto);
> $database->updateNationField($this->username,"motto",$motto) ;
>
> }
>
> if($desc){
> $field = "desc";
> $desc = htmlspecialchars($desc);
> $database->updateNationField($this->username,"desc",$desc);
>
>
> }
>
> return true;
> }
>
> Then finally the updateNationField function:
>
> function updateNationField($username, $field, $value){
> $q = "UPDATE nations SET ".$field." = '$value' WHERE username =
> '$username'";
> return mysql_query($q, $this->connection);
> }
>
> I just don't know what's wrong since it's posting the motto (which is
> just a text-type input) and not the description (which is a textarea). I
> echo'd out the mysql queries and excuted them myself from what echo'd
> out and it's selecting the desc column just fine.

That definitely all looks fine.

If you do:

echo 'post vars: ' . print_r($_POST, true) . '
';

does it show up in post at all?

--
Postgresql & php tutorials
http://www.designmagick.com/

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Re: posting information from a textarea

am 07.07.2006 03:41:52 von Dave W

------=_Part_5343_32091936.1152236512393
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

hmm..interesting. Neither the motto or desc is showing up in the array. I
made a simple form and the
echo 'post vars: ' . print_r($_POST, true) . '
';

works fine. I'm just perplexed on why the motto is still working and not the
desc. Maybe it's because I'm using a fieldset, but then why wouldn't just
one not work?

On 7/6/06, Chris wrote:
>
> Dave W wrote:
> > I'll show you all the steps it passes through.
> > Here's the form:
> >
> >


> >

> >
> > > > value="value("motto") == ""){
> > echo $session->nationinfo['motto'];
> > }else{
> > echo $form->value("motto");
> > } ?>" />
> >
> >
> >
> >

> >

> >
> > It's echoing the nationinfo right, but its not posting it. The motto
> > also works too. When it's submitted, it goes through the function
> > procEditNation().
> >
> > $session->editNation($_POST['motto'], $_POST['desc']);
> >
> > The editNation function:
> >
> > function editNation($motto, $desc){
> > global $database, $form;
> >
> > if($motto){
> > $field = "motto";
> > $motto = htmlspecialchars($motto);
> > $database->updateNationField($this->username,"motto",$motto) ;
> >
> > }
> >
> > if($desc){
> > $field = "desc";
> > $desc = htmlspecialchars($desc);
> > $database->updateNationField($this->username,"desc",$desc);
> >
> >
> > }
> >
> > return true;
> > }
> >
> > Then finally the updateNationField function:
> >
> > function updateNationField($username, $field, $value){
> > $q = "UPDATE nations SET ".$field." = '$value' WHERE username =
> > '$username'";
> > return mysql_query($q, $this->connection);
> > }
> >
> > I just don't know what's wrong since it's posting the motto (which is
> > just a text-type input) and not the description (which is a textarea). I
> > echo'd out the mysql queries and excuted them myself from what echo'd
> > out and it's selecting the desc column just fine.
>
> That definitely all looks fine.
>
> If you do:
>
> echo 'post vars: ' . print_r($_POST, true) . '
';
>
> does it show up in post at all?
>
> --
> Postgresql & php tutorials
> http://www.designmagick.com/
>



--
Dave W

------=_Part_5343_32091936.1152236512393--

Re: Re: posting information from a textarea

am 07.07.2006 03:56:16 von Dave W

------=_Part_5475_15124167.1152237376485
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

I think I might have found the problem, but I'm not sure how to fix it. I'm
just going to rebuild the form and it make it seperate (with all the
database calls in one page). For some reason, if I add another field before
the motto and i change it, it changes motto too...w/e I'll just make a new
one.

On 7/6/06, Dave W wrote:
>
> hmm..interesting. Neither the motto or desc is showing up in the array. I
> made a simple form and the
>
> echo 'post vars: ' . print_r($_POST, true) . '
';
>
> works fine. I'm just perplexed on why the motto is still working and not
> the desc. Maybe it's because I'm using a fieldset, but then why wouldn't
> just one not work?
>
> On 7/6/06, Chris wrote:
>
> > Dave W wrote:
> > > I'll show you all the steps it passes through.
> > > Here's the form:
> > >
> > >


> > >

> > >
> > > > > > value="value("motto") == ""){
> > > echo $session->nationinfo['motto'];
> > > }else{
> > > echo $form->value("motto");
> > > } ?>" />
> > >
> > >
> > >
> > >

> > >

> > >
> > > It's echoing the nationinfo right, but its not posting it. The motto
> > > also works too. When it's submitted, it goes through the function
> > > procEditNation().
> > >
> > > $session->editNation($_POST['motto'], $_POST['desc']);
> > >
> > > The editNation function:
> > >
> > > function editNation($motto, $desc){
> > > global $database, $form;
> > >
> > > if($motto){
> > > $field = "motto";
> > > $motto = htmlspecialchars($motto);
> > > $database->updateNationField($this->username,"motto",$motto) ;
> >
> > >
> > > }
> > >
> > > if($desc){
> > > $field = "desc";
> > > $desc = htmlspecialchars($desc);
> > > $database->updateNationField($this->username,"desc",$desc);
> > >
> > >
> > > }
> > >
> > > return true;
> > > }
> > >
> > > Then finally the updateNationField function:
> > >
> > > function updateNationField($username, $field, $value){
> > > $q = "UPDATE nations SET ".$field." = '$value' WHERE username =
> > > '$username'";
> > > return mysql_query($q, $this->connection);
> > > }
> > >
> > > I just don't know what's wrong since it's posting the motto (which is
> > > just a text-type input) and not the description (which is a textarea).
> > I
> > > echo'd out the mysql queries and excuted them myself from what echo'd
> > > out and it's selecting the desc column just fine.
> >
> > That definitely all looks fine.
> >
> > If you do:
> >
> > echo 'post vars: ' . print_r($_POST, true) . '
';
> >
> > does it show up in post at all?
> >
> > --
> > Postgresql & php tutorials
> > http://www.designmagick.com/
> >
>
>
>
> --
> Dave W
>



--
Dave W

------=_Part_5475_15124167.1152237376485--

Re: Re: posting information from a textarea

am 07.07.2006 17:18:17 von Dave W

------=_Part_16679_27101501.1152285497013
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Ha! I figured the damn thing out! Using the full text type created a bunch
of overhead and it wasn't storing it into the table. I realized that I was
unsetting the post array before I was doing the print_r so that is why the
variables weren't showing up. Then, I finally realized that for some reason,
I had to convert the textarea to a utf encoding before I entered it into the
database! That was annoying.

On 7/6/06, Dave W wrote:
>
> I think I might have found the problem, but I'm not sure how to fix it.
> I'm just going to rebuild the form and it make it seperate (with all the
> database calls in one page). For some reason, if I add another field before
> the motto and i change it, it changes motto too...w/e I'll just make a new
> one.
>
> On 7/6/06, Dave W wrote:
>
> > hmm..interesting. Neither the motto or desc is showing up in the array.
> > I made a simple form and the
> >
> > echo 'post vars: ' . print_r($_POST, true) . '
';
> >
> > works fine. I'm just perplexed on why the motto is still working and not
> > the desc. Maybe it's because I'm using a fieldset, but then why wouldn't
> > just one not work?
> >
> > On 7/6/06, Chris < dmagick@gmail.com> wrote:
> >
> > > Dave W wrote:
> > > > I'll show you all the steps it passes through.
> > > > Here's the form:
> > > >
> > > >


> > > >

> > > >
> > > > > > > name="motto"
> > > > value="value("motto") == ""){
> > > > echo $session->nationinfo['motto'];
> > > > }else{
> > > > echo $form->value("motto");
> > > > } ?>" />
> > > >
> > > >
> > > >
> > > >

> > > >

> > > >
> > > > It's echoing the nationinfo right, but its not posting it. The motto
> > > > also works too. When it's submitted, it goes through the function
> > > > procEditNation().
> > > >
> > > > $session->editNation($_POST['motto'], $_POST['desc']);
> > > >
> > > > The editNation function:
> > > >
> > > > function editNation($motto, $desc){
> > > > global $database, $form;
> > > >
> > > > if($motto){
> > > > $field = "motto";
> > > > $motto = htmlspecialchars($motto);
> > > > $database->updateNationField($this->username,"motto",$motto) ;
> > >
> > > >
> > > > }
> > > >
> > > > if($desc){
> > > > $field = "desc";
> > > > $desc = htmlspecialchars($desc);
> > > > $database->updateNationField($this->username,"desc",$desc);
> > >
> > > >
> > > >
> > > > }
> > > >
> > > > return true;
> > > > }
> > > >
> > > > Then finally the updateNationField function:
> > > >
> > > > function updateNationField($username, $field, $value){
> > > > $q = "UPDATE nations SET ".$field." = '$value' WHERE username
> > > =
> > > > '$username'";
> > > > return mysql_query($q, $this->connection);
> > > > }
> > > >
> > > > I just don't know what's wrong since it's posting the motto (which
> > > is
> > > > just a text-type input) and not the description (which is a
> > > textarea). I
> > > > echo'd out the mysql queries and excuted them myself from what
> > > echo'd
> > > > out and it's selecting the desc column just fine.
> > >
> > > That definitely all looks fine.
> > >
> > > If you do:
> > >
> > > echo 'post vars: ' . print_r($_POST, true) . '
';
> > >
> > > does it show up in post at all?
> > >
> > > --
> > > Postgresql & php tutorials
> > > http://www.designmagick.com/
> > >
> >
> >
> >
> > --
> > Dave W
> >
>
>
>
> --
> Dave W
>



--
Dave W

------=_Part_16679_27101501.1152285497013--