Re: [PHP] after submitting, working with data on same page

2004-07-09 Thread Matt M.
>:if ($calcentry) {...}part of my code and do some calculations with
php and mysql >and put my output into textarea2.

if ($_POST['calcentry'] == 'Calc Your Entry') {
}

is one way to do it

>So my first question is how do I keep the data in textarea1 so when I
perform my >submit I can do some calculations on it etc?  Then how can
I place my results >into textarea2.





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



Re: [PHP] after submitting, working with data on same page

2004-07-09 Thread Daniel Guerrier
You have the data in the $_POST global.
So submit it to _self as you already have and
if $_POST['calcentry'] is present and not null then do
your calculation 
then set the value of the sencond textarea to the
result.

--- "Hull, Douglas D" <[EMAIL PROTECTED]> wrote:
> I have my two html textarea fields followed by these
> two buttons.

 action="" method="post">
> 
 value="Calc Your Entry" /> name="clearentry" value="Clear Your Entry" />
> 
> I have textarea1 to type words into.  I have
> textarea2 for my results.  I have people type words
> in textarea1 and after hitting the "calcentry"
> button I want to reload the same page, go into
> my:

if ($calcentry) {...}

part of my code and do
> some calculations with php and mysql and put my
> output into textarea2.  But after submitting and
> re-loading the page my textarea1 field is empty.  So
> my first question is how do I keep the data in
> textarea1 so when I perform my submit I can do some
> calculations on it etc?  Then how can I place my
> results into textarea2.

So all I want is to type
> words into a textarea field, reload the same page,
> do some calcs on these words, and place the results
> into textarea.  So it amounts to having the exact
> same page but now I have my calculated results in
> the second textarea.  I have all my code for calcs
> etc. and it works fine.

Thanks for any help,
Doug
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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