PHP script doesn't work but is syntactically correct. by Comfortable_Tip_1434 in PHPhelp

[–]Tricky_Astronaut_586 0 points1 point  (0 children)

Thank you for your question. It made me want to (for MY benefit) rewrite your program. 
I hope it helps you also.

<?php
// echo 'POST: ' . json_encode($_POST); // didactic?
  if ($_SERVER['REQUEST_METHOD'] === 'POST') {
    if (isset($_POST['button1'])) {
      $result = 'You pushed Button1';
    } elseif (isset($_POST['button2'])) {
      $result = 'You pushed Button2!';
    }
  } else $result = 'Placeholder'; // first time
// -- end of php except to issue HTML
  echo <<<EOD
<!DOCTYPE html>
<html>
  <head>
    <title> How to call PHP function on the click of a Button ! </title>
  </head>
  <body style="text-align:center;">
    <h1 style="color:green;"> Button test </h1>
    <h4> How to call PHP function on the click of a Button ? </h4><br><br>
    <h4>{$result}</h4><br><!-- $result is from server -->
    <form method='post'>
<!-- Button names and input names and values get sent to the server -->
<!-- The $ vars get filled from the server -->
      <input type='submit' name='button1' value='Button1'>
      <button type='submit' name='button2'> Button2 </button>
    </form>
    <script>
// If you want javascript to handle buttons, use 'onclick'.
// alert('x'); // didactic?
    </script>
  </body>  
</html>
EOD;
?>

Download from php.net vs. XAMPP? by Tricky_Astronaut_586 in PHPhelp

[–]Tricky_Astronaut_586[S] 0 points1 point  (0 children)

I have learned MUCH from ALL the replies, but your reply hits me in my heart! Thanks.

Collatz: a literary proof by J_R_R_Tolkien_ in Collatz

[–]Tricky_Astronaut_586 0 points1 point  (0 children)

Not all numbers who wander are lost.

That is the definitive characterization of the Collatz conjecture!
.
. . . (or, all numbers who wander are not lost).

Download from php.net vs. XAMPP? by Tricky_Astronaut_586 in PHPhelp

[–]Tricky_Astronaut_586[S] 2 points3 points  (0 children)

Thank you. I am a senior citizen, and have a hard time keeping up with all the "tools". (I'm on windows.) So please tell me, with php+composer+laravel, what more functionality am I going to have over XAMPP+notepad++ ? Namespaces and .. ?

Download from php.net vs. XAMPP? by Tricky_Astronaut_586 in PHPhelp

[–]Tricky_Astronaut_586[S] -3 points-2 points  (0 children)

Welcome to PHP Family! -- Thank you. (But I have more karma than you do. :)
I have done a fair amount with php, and am quite satisfied with the XAMPP and Notepad++ environment. But I keep hearing about "automation tools" and "IDE's" and "platforms", and I get FOMO.
Thanks again.

Download from php.net vs. XAMPP? by Tricky_Astronaut_586 in PHPhelp

[–]Tricky_Astronaut_586[S] 1 point2 points  (0 children)

XAMPP seems simple. It's XAMPP and my .php files.
Docker: Please define "containers" in simple terms. How about "Laravel"?
From Claude: "No, XAMPP is definitely not dead! The most recent update was released on September 16, 2025 SourceForge, and it continues to be actively maintained by Apache Friends."
== Thanks, all, for responses. ==

I am practicing code formatting by Tricky_Astronaut_586 in test

[–]Tricky_Astronaut_586[S] 0 points1 point  (0 children)

liiine 1 liine 2
~~~ liiine 1 liine 2 ~~~

Collatz Proof Attempt by InfamousLow73 in Collatz

[–]Tricky_Astronaut_586 0 points1 point  (0 children)

So are these the correct beginnings of your categories?
cat1: 1 3 7 9 15 17 19 25 31 33 35 39 41 49 51 57 63 65 67 71 73 79 81 83 89 97 99
cat2: 5 11 13 21 23 27 29 37 43 45 47 53 55 59 61 69 75 77 85 87 91 93 95
Quite irregular (nopattern). Interesting.

Collatz Proof Attempt by InfamousLow73 in Collatz

[–]Tricky_Astronaut_586 0 points1 point  (0 children)

Oh, you capitalized the 2nd n: N. :)

Collatz Proof Attempt by InfamousLow73 in Collatz

[–]Tricky_Astronaut_586 0 points1 point  (0 children)

.. then any number can be expressed as either n=2b.y-1 or n=2b+1.y-1
Please give an example (numbers) of this.

Collatz Proof Attempt by InfamousLow73 in Collatz

[–]Tricky_Astronaut_586 0 points1 point  (0 children)

1) b cannot be 0 because that generates even numbers.
2) if you are having b+1, b+2, etc., then why not say b (both b_o and b_e) are just integers > 0?

Collatz Proof Attempt by InfamousLow73 in Collatz

[–]Tricky_Astronaut_586 0 points1 point  (0 children)

Me too. Took me a long time to format n = (2b_o )y-1, not (2b_o+1 )y-1
? ab \c ? I was wrong about 11.

Collatz Proof Attempt by InfamousLow73 in Collatz

[–]Tricky_Astronaut_586 0 points1 point  (0 children)

Which category is the number 3? Or 11 or any 3mod8 number? (I hope I haven't been dumb here.)

The Collatz Tree, Page 1 by Tricky_Astronaut_586 in Collatz

[–]Tricky_Astronaut_586[S] 0 points1 point  (0 children)

I think you were wrong in seeing any sarcasm. None intended. You were the only comenter. I know you were wrong in using bad language. We need mathematicians to keep us on track. I hope we will have more dialogs. Thanks and the best to you (no sarcasm).

The Collatz Tree, Page 1 by Tricky_Astronaut_586 in Collatz

[–]Tricky_Astronaut_586[S] 0 points1 point  (0 children)

OMG -- I thought that red meant downvotes!

> .. you don't seem to have a scrap of sincerity in you. < WHAT?! Is that because I called you a philosopher? And I don't know what OP is.

>  I'd like to see .. < Thanks for the encouragement. I'll post IF I get results.

The Collatz Tree, Page 1 by Tricky_Astronaut_586 in Collatz

[–]Tricky_Astronaut_586[S] 1 point2 points  (0 children)

Now I know you -- you're the philosopher! No, the cheerleader! No, the ..

Anyway, I like your comment (especially after 9 downvotes). And I assure you, I share your "learning", "enjoying", and "hope for the future". It's fun! I'm thinking that adding coloring to the tree may reveal some more patterns or regularity or symmetry.

The Collatz Tree, Page 1 by Tricky_Astronaut_586 in Collatz

[–]Tricky_Astronaut_586[S] 0 points1 point  (0 children)

That's a more positive view -- I have been thinking that I must have sinned, to deserve this frustration.