Hi! Could we please enable some services and cookies to improve your experience and our website?

PHPize Online / SQLize Online  /  SQLtest Online

A A A
Login    Share code      Blog   FAQ

Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code

Copy Format Clear
<h1>Find the Greatest Number</h1> <form action="greatest_number.php" method="POST"> <label for="num1">Enter 1st number:</label> <input type="number" name="num1" id="num1" required> <label for="num2">Enter 2nd number:</label> <input type="number" name="num2" id="num2" required> <input type="submit" value="Find Greatest"> </form>

Stuck with a problem? Got Error? Ask AI support!

Copy Clear
Copy Format Clear
<?php // Use a custom session save path session_save_path("/tmp"); session_start(); // Store session variables in the same script execution $_SESSION["favanimal"] = "Cat"; $_SESSION["favcolor"] = "Yellow"; // Display the session values immediately echo "Session is set.<br>"; echo "<p>Nobita's favourite color is: " . $_SESSION["favcolor"] . "</p>"; echo "<p>Nobita's favourite animal is: " . $_SESSION["favanimal"] . "</p>"; ?>
Copy Clear