Two methods to run PHP script

Posted by Ashok Kumar on December 8th, 2009
HTML with PHP :-
HTML: add.htm
<html>
<head>
<title>Adding two numbers</title>
</head>
<body>
<form action=”add.php” method=”post”>
Enter the first number: <input type=”text” name=”a” size=10><br>
Enter the second number: <input type=”text” name=”b” size=10><br>
<input type=”submit” name=”submit” value=”ADD”>
</form>
</body>
</html>
PHP: add.php
<html>
<head>
<title>Adding two numbers</title>
</head>
<body>
<?php
$a=$_POST["a"];
$b=$_POST["b"];
$c=$a+$b;
print “Addition of $a and $b is $c.”;
?>
</body>
</html>
Only with PHP :-
<?php
$a = $_POST["a"];
$b = $_POST["b"];
if (!isset($_POST['add']))
{  // If page is not submitted to itself echo the form
?>
<html>
<head><title>Adding Two Numbers</title></head>
<body>
<form method=”post” action=”<?php echo $PHP_SELF; ?>”>
Enter the first number: <input type=”text” size=”12″ maxlength=”12″ name=”a”></br>
Enter the second number: <input type=”text” size=”12″ maxlength=”36″ name=”b”></br>
<input type=”submit” value=”ADD” name=”add”>
</form>
<?
}
else
{
$c=$a+$b;
print “Addition of $a and $b is $c.”;
}
?>
</body>
</html>

HTML with PHP :-

HTML: add.htm

<html>
<head>
<title>Adding two numbers</title>
</head>
<body>
<form action=”add.php” method=”post”>
Read the rest of this entry »

Linux wvdial.conf script for Vodafone IN

Posted by Ashok Kumar on December 8th, 2009
[Modem0]
Modem = /dev/rfcomm0
Baud = 115200
SetVolume = 0
Dial Command = ATDT
Init1 = ATZ
Init3= ATM0
FlowControl = CRTSCTS
[Dialer vodafone]
Username = “vodafone”
Password = “vodafone”
Phone = *99#
Stupid Mode = 1
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Init3 = AT+CGDCONT=1,”10.10.1.100:9401″,”portalnmms”,”",0,0
Inherits = Modem0
[Dialer three]
Username = “none”
Password = “none”
Phone = *99#
Stupid Mode = 1
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Init3 = AT+CGDCONT=1,”10.10.1.100:9401″,”portalnmms”,”",0,0
Inherits = Modem0
[Modem0]
Modem = /dev/rfcomm0

Designed and maintained by Prof. T. Ashok Kumar
Copyright © 2009 BioGem.Org. All rights reserved.