Roy766 Posted May 23, 2008 Share Posted May 23, 2008 Ahem. <html> <head> <title>Diagonal Line Length Calculator</title> </head> <body> <form> X1:<input type="text" name="x1"><br> X2:<input type="text" name="x2"><br> Y1:<input type="text" name="y1"><br> Y2:<input type="text" name="y2"><br> <input type="submit" value="Go!"><br> </form> <br> <?php $length = pow(sqrt($_REQUEST['x2'] - $_REQUEST['x1']), 2) + pow(sqrt($_REQUEST['72'] - $_REQUEST['y1']), 2) echo 'The length of that line is ' . $length ?> </form> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/106960-what-am-i-doing-wrong-this-time/ Share on other sites More sharing options...
GingerRobot Posted May 23, 2008 Share Posted May 23, 2008 Forgetting your semi-colons from the end of your lines? <html> <head> <title>Diagonal Line Length Calculator</title> </head> <body> <form> X1:<input type="text" name="x1"><br> X2:<input type="text" name="x2"><br> Y1:<input type="text" name="y1"><br> Y2:<input type="text" name="y2"><br> <input type="submit" value="Go!"><br> </form> <br> <?php $length = pow(sqrt($_REQUEST['x2'] - $_REQUEST['x1']), 2) + pow(sqrt($_REQUEST['72'] - $_REQUEST['y1']), 2); echo 'The length of that line is ' . $length; ?> </form> </body> </html> Next time try telling us what the problem is too Quote Link to comment https://forums.phpfreaks.com/topic/106960-what-am-i-doing-wrong-this-time/#findComment-548265 Share on other sites More sharing options...
Barand Posted May 23, 2008 Share Posted May 23, 2008 .. and not even proof-reading your own code for obvious typos Quote Link to comment https://forums.phpfreaks.com/topic/106960-what-am-i-doing-wrong-this-time/#findComment-548303 Share on other sites More sharing options...
Roy766 Posted May 23, 2008 Author Share Posted May 23, 2008 Sorry. God. Quote Link to comment https://forums.phpfreaks.com/topic/106960-what-am-i-doing-wrong-this-time/#findComment-548383 Share on other sites More sharing options...
sasa Posted May 24, 2008 Share Posted May 24, 2008 $length = sqrt(pow(($_REQUEST['x2'] - $_REQUEST['x1']), 2) + pow(($_REQUEST['y2'] - $_REQUEST['y1']), 2)); Quote Link to comment https://forums.phpfreaks.com/topic/106960-what-am-i-doing-wrong-this-time/#findComment-548720 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.