I'm just trying to add two integers using PHP and XAMP.
I've placed my client.html file and service.php (which add numbers) in C:\xampp\htdocs
and I get
"Notice: Undefined variable: _get in C:\xampp\htdocs\service.php on line 7
Notice:
Undefined variable: _get in C:\xampp\htdocs\service.php on line 8" error.
Before posting this error to Stack Overflow. Let me tell you that I double checked my file names, variable names case-sensitive etc everything. but still having the same error. Any help will be really appreciated.
This is my client.html
form action="service.php" method="get">
input type="text" name="txt1"> <br />
input type="text" name="txt2"> <br />
input type="submit" value="add"><br />
and here is service.php
<?PHP
echo "This is my first program in php";
$a= $_get['txt1'];
$b= $_get['txt2'];
echo $a + $b;
?>
$_GET. Also usePOSTmore secure$_POSTinstead because it's more secure since the user can't see it in the url.$_GETwill be transmitted in the url.