Re: newbie: goto url from var calc.

From: Grebo (me_at_me.com)
Date: 04/01/04


Date: Thu, 1 Apr 2004 19:09:57 +0100

Thanks Andrew Going to have a go with that.

"Andrew @ Rockface" <andrew@rockface-records.co.uk> wrote in message
news:c4gip1$o9j$1@sparta.btinternet.com...
> Oops, had a bit of a finger fart. Here's where I left of:
>
> If you want to use POST as your method in page1.html, change page2.php to
> the following:
> <?php
> $sum = $_POST[num1] + $_POST[$num2];
> echo $sum;
> ?>
>
> --
> Andrew @ Rockface
> np: [winamp not running]
> andrew@rockface-records.co.uk
> www.rockface-records.co.uk
>
>
> "Andrew @ Rockface" <andrew@rockface-records.co.uk> wrote in message
> news:c4gijq$o2e$1@sparta.btinternet.com...
> > "Grebo" <me@me.com> wrote in message
> > news:c4fvcr$4nm$1@titan.btinternet.com...
> > > New to PHP and just done the "Hello Wolrd" now on a quest.
> > > I want to have say 2 fields in a form that calculate a value and then
> > based
> > > on that value
> > > goto a URL containing that value and also have the value carried over
to
> > be
> > > used in next page.
> > > I've managed to get a page to echo the values in the next page using
> post
> > > and submit.
> > > I even managed to make a link (Not Submit) that went to a page.php
based
> > on
> > > radio button value.
> > > But can't get the 2 to come together and not even looked at
calculating
> > say
> > > field1*field2.
> >
> > Do the calculation in the page that you post the two values to, not the
> form
> > page.
> > In other words:
> > page1 = form that accepts two fields as input and then posts the fields
to
> > page2.
> > page2 = calculate the sum of the two passed fields/variables and display
> > sum.
> >
> > page1.html
> > <form action="page2.php" method="GET">
> > <input type="text" name="num1">
> > <input type="text" name="num2">
> > <input type="submit" value="Submit">
> > </form>
> >
> > page2.php
> > <?php
> > $sum = $num1 + $num2;
> > echo $sum;
> > ?>
> >
> > if you want to use POST as your method change page2.php to:
> >
> >
>
>



Relevant Pages

  • Need help on Roundup
    ... be calculating to the 3rd decimal which is making my totals unacceptable. ... formatting in the cells are for 2 decimal places. ... Hi,You can use the following array formula. ... The sum is still rounding up from the 3rd decimal. ...
    (microsoft.public.excel.worksheet.functions)
  • Re: Need help on Roundup
    ... be calculating to the 3rd decimal which is making my totals unacceptable. ... formatting in the cells are for 2 decimal places. ... Hi,You can use the following array formula. ... The sum is still rounding up from the 3rd decimal. ...
    (microsoft.public.excel.worksheet.functions)
  • Re: Another vectorization problem..
    ... compare the results of your nested for-loop method with the most recent ... to handling the first row in a special way. ... calculating a, b, and c.) ... The sum that you asked about is done inherently in the matrix ...
    (comp.soft-sys.matlab)
  • RE: precision of calculations in MDX, implications on sorting
    ... "Tom VdP" wrote: ... > Calculating the sum with a calculated member yields a rounding error. ...
    (microsoft.public.sqlserver.olap)
  • Re: operator overloading
    ... "Consider calculating the sum of the first n terms of an arithmetic ... series, given its first term, a1, and common difference, d. ... The series sum is a pure math operation, and would not need operator overloading. ...
    (comp.lang.java.programmer)