Jump to content

What am I doing wrong THIS TIME?


Roy766

Recommended Posts

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>

Link to comment
https://forums.phpfreaks.com/topic/106960-what-am-i-doing-wrong-this-time/
Share on other sites

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.