srinivasa
-
Posts
35 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Downloads
Gallery
Store
Posts posted by srinivasa
-
-
Here i have attached a file name prime.php ,basically am reading input from a form and check whether no is prime or not....there is problem with code, its really working well for small nos upto 10(user input),if user enter above 10 like 11,100...its showing the following error
Fatal error: Maximum execution time of 30 seconds exceeded in C:\wamp\www\prime.php on line 25
Kindly i request you to have a look at code, n suggest me solution.
-
i hope u ll provide solution soon........
-
Here i have attached two files names readnos.php and constuctor-calculator.php , read two nos from form inputs and do sum and diff , display...for setting initial values use constructor.
-
add two nos
in PHP
Am glad to say i got the answer........code is here
class Calculator
{
var $sum;
var $dif;
function add($number1, $number2)
{
$this->sum=$number1 + $number2;
}
function substract($number1, $number2)
{
$this->dif=$number1 - $number2;
}
}
$num1=$_POST['no1'];
$num2=$_POST['no2'];
//Create an object
$calc = new Calculator();
//Call class methods
$calc->add($num1,$num2);
$calc->substract($num1,$num2);
//Display output
echo "Sum = ".$calc->sum." <br>";
echo "Difference = ".$calc->dif." <br>";
?>
now i would like to set initial value using constructor...help me out....
-
add two nos
in PHP
<?php class inputs { var $no1 = $_POST['no1']; var $no2 = $_POST['no2']; function addNos() { echo $this->no1; echo $this->no2; $add = ($this->no1) + ($this->no2); echo $add; } } $obadd = new inputs(); $obadd->addNos(); ?>
-
age display
in PHP
thanks ya..that comment line i deleted,but real problem was i missed </form> tag in (username and password form)sessions.php so i rectified the error, and got the desired result........
-
age display
in PHP
Here i have attached a file named myAge.php ,basically am reading age from a form ,once i submit the form(just age field is there to fill out) its showing blank page!! give me solution please....
in that session.php(last box is the age form)
-
PHP session
in PHP
Thanks a lot...............
-
PHP session
in PHP
I have added the following line in four different pages(for ex: session.php,myproduct.php,myage.php,twologout.php)
$_SESSION['pages'] = $_SERVER["REQUEST_URI"];
i want to display all the four uri in one page say history.php tel me how to display,i tried but dint get the answer..........
so plz giv me ur suggestion...thanks in advance
add two nos using constructors
in PHP
Posted
am very grateful to you, given solution is perfectly alright.