Path: csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Matthew Carter Newsgroups: comp.lang.php Subject: Re: test prog inpu tpost Date: Thu, 31 Dec 2015 21:40:17 -0500 Organization: Ahungry (http://ahungry.com) Lines: 80 Message-ID: <87oad6c99q.fsf@ahungry.com> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="7c986cd4736462de309a749b207746fe"; logging-data="16493"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18r/zaitsql6MOK2aqyiWps" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) Cancel-Lock: sha1:mPKIo7VA4yYN50w26FCFNxtwIbs= sha1:+pLrgRY96AzuCT4INswU6OVdtY4= Xref: csiph.com comp.lang.php:16048 Lew Pitcher writes: > On Thursday December 31 2015 20:57, in > comp.lang.php, "vjp2.at@at.BioStrategist.dot.dot.com" > wrote: > >> >> Should this work? > >> I'm stuck with lynx browser for a few days and can't tell > > That shouldn't stop you, assuming that you have a PHP-enabled webserver to > host the page on. > > Lynx, like all browsers, just renders the html sent to it by the server. > > PHP code executes on the server. > > If the html with PHP is served from a PHP-enabled web server, lynx will render > the results correctly. > >> >> >> Quadratic >> >> >> > $t; > > What is $t ? > Why are you trying to execute it as a php statement? > >> $b=$_POST['b'];$a=$_POST['a'];$c=$_POST['c']; > > Here, you should test whether the page is invoked from a GET or a POST. None > of the $_POST variables will be set on the initial GET, and your later > computation will be invalid. > >> $x;$y; > > Same question as above with $t. What is $x? What is $y? Why are you trying to > execute two variables as php statements? > >> $t=(pow($b,2))-(4*$a*$c); > > Meaningless (and possibly errant) results on GET > >> if($t<=0) >> $t=(-1)*$t; >> $x=(-2*$c)/($b+(sqrt($t))); >> $y=(-2*$c)/($b-(sqrt($t))); >> echo sprintf("Solution in Addition = %f in Subtraction = %f" ,$x,$y); > > This last stmt is overly complicated. Why wouldn't you just > printf("Solution in Addition = %f in Subtraction = %f" ,$x,$y); > ? > >> ?> >>
>>
>>
>>
> > I'm not entirely certain that this is the proper use for the