Jump to content
Old threads will finally start getting archived ×

php arithmic trouble


Recommended Posts

<?php

$ans = $_POST[first] $_POST[calc] $_POST[second];

$message = "";

if (!isset($_POST[first]) == here) {

$message = "Welcome to the math machine";

} elseif (($_POST[first]) == ($_POST[first])) {

$message = "$_POST[first] $_POST[calc] $_POST[second] = $ans";

}

?>

this a peice of code from a test page i am trying out. $_POST[first] $_POST[calc] $_POST[second]; these are user inputs, they would make, E.G. 4 + 4, i want this to complete so that when i put $ans in my code it will give me 8, not 4 + 4.

 

any help on this matter will help me very much, and is much apreciated.

thanks loads

lee

Link to comment
https://forums.phpfreaks.com/topic/1848-php-arithmic-trouble/
Share on other sites

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.