Showing posts with label PHP. Show all posts
Showing posts with label PHP. Show all posts

Thursday, November 7, 2019

PHP THREE

php five

<?php

if (isset ($_POST ['b1'])){

function add() {
$a = $_POST ['num1'];
$b = $_POST ['num2'];
echo  $a + $b ;
}
?>
   <h3>  <?php add () ?> </h3>
   <?php
}
?>

<?php

if (isset ($_POST ['b2'])){

function add() {
$a = $_POST ['num1'];
$b = $_POST ['num2'];
echo  $a - $b ;
}
?>
   <h3>  <?php add () ?> </h3>
   <?php
}
?>

<?php

if (isset ($_POST ['b3'])){

function add() {
$a = $_POST ['num1'];
$b = $_POST ['num2'];
echo  $a * $b ;
}
?>
   <h3>  <?php add () ?> </h3>
   <?php
}
?>

<?php

if (isset ($_POST ['b4'])){

function add() {
$a = $_POST ['num1'];
$b = $_POST ['num2'];
echo  $a / $b ;
}
?>
   <h3>  <?php add () ?> </h3>
   <?php
}
?>


<form method="post">
<label> Enter first number </label>
<input type="number" name="num1"/> 

</br>
 </br>
     
     
<label> Enter second number </label>
<input type="number" name="num2"/>     
        </br>
        </br>
        <input type="submit" value="Add" name="b1"/>
     
        <input type="submit" value="Sub" name="b2"/>
     
        <input type="submit" value="Mulip" name="b3"/>
     
        <input type="submit" value="Divid" name="b4"/>
   
</form>

Set password in mysql xampp

You want to edit this file: "\xampp\phpMyAdmin\config.inc.php"

change this line:

$cfg['Servers'][$i]['password'] = 'WhateverPassword';

Wednesday, March 6, 2019

PHP 2nd class Add Code








<?php
if (isset($_POST['Add'])){
$a = $_POST['num1'];
$b = $_POST['num2'];
$c = $a + $b
?>
<h3> Answer is :<?php echo $c ?></h3>
<?php
}
?>
<form method="post">
<label> Enter First Number </label>
<input type="number" name="num1"/>
<br/>
<br/>
<label> Enter Second Number </label>
<input type="number" name="num2"/>
<input type="Submit" value="Add" name="Add"/>
</form>

Php two



















<body>
<form action = "" method = "post">
<label> Enter name </label>
<input type = "text" name = "txtname"/>
<input type = "submit" value = "Save" name = "b1"/>
</form>

<?php

if(isset($_POST['b1'])){
$name = $_POST['txtname'];
?>
<h1> your name is : <?php echo $name ?> </h1>
<?php
}
?>
</body>

Monday, March 4, 2019

Php one

Php One

I












<html>
<body>
<?php
$a = 'Naptechpk';
?>
<center><h1 style="color:green;font-style: oblique;"><?php echo $a; ?></h1></center>
</body>
</html>



PHP THREE