Jump to content

srinivasa

Member
  • Posts

    35
  • Joined

  • Last visited

Everything posted by srinivasa

  1. am very grateful to you, given solution is perfectly alright.
  2. srinivasa

    PRIME OR NOT

    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. prime.php
  3. i hope u ll provide solution soon........
  4. 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. readnos.php constuctor-calculator.php
  5. srinivasa

    add two nos

    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....
  6. srinivasa

    add two nos

    <?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(); ?>
  7. srinivasa

    age display

    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........
  8. srinivasa

    age display

    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) myAge.php sessions.php
  9. srinivasa

    PHP session

    Thanks a lot...............
  10. srinivasa

    PHP session

    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
×
×
  • Create New...