Jump to content

lobster

Members
  • Posts

    14
  • Joined

  • Last visited

Everything posted by lobster

  1. thanks ... i wish i could edit the thread title to "what is the difference between php web and php command line " ??
  2. why cant i get a form output in this window ? is this only command line ? or is it incapable of outputting a form ?
  3. can someone suggest a good book with web forms and php ?
  4. thanks ... i also found this website a bit helpful .. http://www.hackingwithphp.com/2/5/0/running-php-scripts
  5. sorry i could not even identify it as a php cli code ... how would i compile this ? do i need only WAMP to compile this code ? if so .. how do i do that ? sorry i am a noob ...
  6. is it possible to make a command line version of this quadratic equation solver ?? <?php $temp = fopen ("php://stdin","r"); $line = fgets($temp); echo $line; ?> <?php fwrite(STDOUT, "Please enter your namen"); // Read the input $name = fgets(STDIN); fwrite(STDOUT, “Hello $name”); // Exit correctly exit(0); ?> <?php echo "Please enter value 1 : "; fscanf(STDIN, "%d\n", $value1); // reads number from STDIN standard input echo "Please enter value 2 : "; fscanf(STDIN, "%d\n", $value2); echo "Answer : " .($value1 + $value2) . "\n"; ?>
  7. thanks i will save that for future reference ... i was wondering if i could do the same with command line version instead of the web form version ... To be able to read input from the script’s user, you can use STDIN combined with fgets(), fread(), fscanf() or fgetc(). For example: you know a command line version of the quadratic equation solver .... ????
  8. is it possible to get a command line version of this quadratic equation solver ??
  9. its working now ...thanks ... its giving me results ....
  10. thanks ... i am running wamp ... and i have saved the file in c:/wamp/www as index.php i get the form display right ... but when i put some value in it ... its giving me errors ...
  11. i cant get any result here ??? i dont know how many things i am doing wrong here ???
  12. i have installed WAMP server .. i hope i can atleast get this working in wamp ... it prompts the user for a value ... like ... enter a value ... i dont know how to do that with a command line version of php right now ... i guess i will stay with the web version of php ... how do i make this work ? it needs some extra syntax to make it work ... but am not sure where to add or what to add to it to make it work ... ??
  13. i dont know much about the difference between the two ? both needs a php interpretor i guess ...? i stumbled upon this online php interpretor .. while trying to solve a maths problem ... which i ended up trying to solve a quadratic equation .... what is this one actually ? can this interpret both command line program and web based php programs ?? the quadratic equation example i tried to solve in this php interpretor looks like this ... this one i cannot get to work with the above php interpretor due to some missing syntax i guess ... the second one looks like a command line version .... this one works with the above php interpretor .. please help to make both of it work ???
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.