3v4l.org

run code in 300+ PHP versions simultaneously
<?php if ($stmt = $mysqli->prepare("INSERT INTO `regisrations`(`country`,`state`,`IP`,`email`,`firstname`,`lastname`,`othernames`,`pin`,`dayphone`,`postal`,`affiliation`) VALUES (?,?,?,?,?,?,?,?,?,?,?)")){ $stmt->bind_param('ssssssissss',$_SESSION[country],$_SESSION[state],$_SESSION[IP],$_SESSION[email],$_SESSION[firstname],$_SESSION[lastname],$_SESSION[othernames],$_SESSION[pin],$_SESSION[dayphone],$_SESSION[postal],$_SESSION[affiliation]); $_SESSION[country] = $_POST['country']; $_SESSION[state] = $_POST['state']; $_SESSION[IP] = $_POST['IP']; $_SESSION[email] = $_POST['email']; $_SESSION[firstname] = $_POST['firstname']; $_SESSION[lastname] = $_POST['lastname']; $_SESSION[othernames] = $_POST['othernames']; $_SESSION[pin] = $_POST['pin']; $_SESSION[dayphone] = $_POST['dayphone']; $_SESSION[postal] = $_POST['postal']; $_SESSION[affiliation] = $_POST['affiliation'];var_dump($result); $stmt->execute(); $stmt->close(); }else { printf("Prepared Statement Error: %s\n", $mysqli->error); } echo "<h1>Registration Complete!</h1>"; echo "<br />Thank you! You should receive an email shortly confirming your registration as shown below:"; $msg = "Thank you for registering. we are verifying your details and then create your account<br /><br />"; $msg .= "===================================================================<br />"; $msg .= "Contact Information:<br />"; $msg .= "===================================================================<br />"; $msg .= "Type: $_SESSION[country] <br />"; $msg .= "Organisation Name: $_SESSION[state] <br />"; $msg .= "Organisation Pin: $_SESSION[IP] <br />"; $msg .= "Email: $_SESSION[email] <br />"; $msg .= "Participant Name: $_SESSION[firstname] <br />"; $msg .= "Surname: $_SESSION[lastname] <br />"; $msg .= "Other Names: $_SESSION[othernames] <br />"; $msg .= "Participant PIN : $_SESSION[pin] <br />"; $msg .= "Phone: $_SESSION[dayphone] <br />"; $msg .= "Postal Address: $_SESSION[postal] <br />"; $msg .= "Designation: $_SESSION[affiliation] <br />"; $msg .= "Designation: $_SESSION[affiliation] <br />"; $msg .= "===================================================================<br />"; $msg .= "If you have any questions, contact us on Tel: 020 4965508 or Email: contactcentre@kentrade.go.ke<br />"; echo $msg; //Send confirmation message to user. $sender = "noreply@kentrade.go.ke"; $subject = "Registration Confirmed"; $mailheaders = "MIME-Version: 1.0\r\n"; $mailheaders .= "Content-type: text/html; charset=ISO-8859-1\r\n"; $mailheaders .= "From: $sender"; mail($_SESSION[email], $subject, $msg, $mailheaders); ?>
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.32, 8.2.0 - 8.2.28, 8.3.0 - 8.3.20, 8.4.1 - 8.4.6
Warning: Undefined variable $mysqli in /in/9parp on line 2 Fatal error: Uncaught Error: Call to a member function prepare() on null in /in/9parp:2 Stack trace: #0 {main} thrown in /in/9parp on line 2
Process exited with code 255.
Output for 7.0.5 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.33
Notice: Undefined variable: mysqli in /in/9parp on line 2 Fatal error: Uncaught Error: Call to a member function prepare() on null in /in/9parp:2 Stack trace: #0 {main} thrown in /in/9parp on line 2
Process exited with code 255.
Output for 7.3.32 - 7.3.33
Fatal error: Uncaught Error: Call to a member function prepare() on null in /in/9parp:2 Stack trace: #0 {main} thrown in /in/9parp on line 2
Process exited with code 255.
Output for 7.0.0 - 7.0.4
Notice: Undefined variable: mysqli in /in/9parp on line 2 Fatal error: Uncaught Error: Call to a member function prepare() on unknown in /in/9parp:2 Stack trace: #0 {main} thrown in /in/9parp on line 2
Process exited with code 255.
Output for 5.6.0 - 5.6.40
Notice: Undefined variable: mysqli in /in/9parp on line 2 Fatal error: Call to a member function prepare() on null in /in/9parp on line 2
Process exited with code 255.
Output for 5.0.4 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38
Notice: Undefined variable: mysqli in /in/9parp on line 2 Fatal error: Call to a member function prepare() on a non-object in /in/9parp on line 2
Process exited with code 255.
Output for 5.0.0 - 5.0.3
Notice: Undefined variable: mysqli in /in/9parp on line 2 Fatal error: Call to a member function prepare() on a non-object in /in/9parp on line 2
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.9
Fatal error: Call to a member function on a non-object in /in/9parp on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to a member function on a non-object in /in/9parp on line 2

preferences:
175.35 ms | 416 KiB | 5 Q