3v4l.org

run code in 300+ PHP versions simultaneously
<?php include "connect.php"; session_start(); date_default_timezone_set('UTC'); if($_SESSION['user']){ } else{ header("location:index.php"); } if($_SERVER['REQUEST_METHOD'] = "POST") //Added an if to keep the page secured { $details = $con->real_escape_string($_POST['details']); $time = strftime("%X");//time $date = strftime("%B %d, %Y");//date $decision ="no"; $con->select_db("main") or die("Cannot connect to database"); //Connect to database foreach($_POST['public'] as $each_check) //gets the data from the checkbox { if($each_check !=null ){ //checks if the checkbox is checked $decision = "yes"; //sets teh value } } $con->query("INSERT INTO list (details, date_posted, time_posted, public) VALUES ('$details','$date','$time','$decision')"); //SQL query header("location: home.php"); } else { header("location:home.php"); //redirects back to hom } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 10
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 64
Branch analysis from position: 17
2 jumps found. (Code = 47) Position 1 = 37, Position 2 = 39
Branch analysis from position: 37
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 39
2 jumps found. (Code = 77) Position 1 = 42, Position 2 = 47
Branch analysis from position: 42
2 jumps found. (Code = 78) Position 1 = 43, Position 2 = 47
Branch analysis from position: 43
2 jumps found. (Code = 43) Position 1 = 45, Position 2 = 46
Branch analysis from position: 45
1 jumps found. (Code = 42) Position 1 = 42
Branch analysis from position: 42
Branch analysis from position: 46
Branch analysis from position: 47
1 jumps found. (Code = 42) Position 1 = 67
Branch analysis from position: 67
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 47
Branch analysis from position: 64
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 64
Branch analysis from position: 17
Branch analysis from position: 64
filename:       /in/65jIM
function name:  (null)
number of ops:  68
compiled vars:  !0 = $details, !1 = $con, !2 = $time, !3 = $date, !4 = $decision, !5 = $each_check
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INCLUDE_OR_EVAL                                          'connect.php', INCLUDE
    3     1        INIT_FCALL                                               'session_start'
          2        DO_ICALL                                                 
    4     3        INIT_FCALL                                               'date_default_timezone_set'
          4        SEND_VAL                                                 'UTC'
          5        DO_ICALL                                                 
    5     6        FETCH_R                      global              ~9      '_SESSION'
          7        FETCH_DIM_R                                      ~10     ~9, 'user'
          8      > JMPZ                                                     ~10, ->10
          9    > > JMP                                                      ->13
    8    10    >   INIT_FCALL                                               'header'
         11        SEND_VAL                                                 'location%3Aindex.php'
         12        DO_ICALL                                                 
   11    13    >   FETCH_W                      global              $12     '_SERVER'
         14        ASSIGN_DIM                                       ~13     $12, 'REQUEST_METHOD'
         15        OP_DATA                                                  'POST'
         16      > JMPZ                                                     ~13, ->64
   13    17    >   INIT_METHOD_CALL                                         !1, 'real_escape_string'
         18        CHECK_FUNC_ARG                                           
         19        FETCH_FUNC_ARG               global              $14     '_POST'
         20        FETCH_DIM_FUNC_ARG                               $15     $14, 'details'
         21        SEND_FUNC_ARG                                            $15
         22        DO_FCALL                                      0  $16     
         23        ASSIGN                                                   !0, $16
   14    24        INIT_FCALL                                               'strftime'
         25        SEND_VAL                                                 '%25X'
         26        DO_ICALL                                         $18     
         27        ASSIGN                                                   !2, $18
   15    28        INIT_FCALL                                               'strftime'
         29        SEND_VAL                                                 '%25B+%25d%2C+%25Y'
         30        DO_ICALL                                         $20     
         31        ASSIGN                                                   !3, $20
   16    32        ASSIGN                                                   !4, 'no'
   18    33        INIT_METHOD_CALL                                         !1, 'select_db'
         34        SEND_VAL_EX                                              'main'
         35        DO_FCALL                                      0  $23     
         36      > JMPNZ_EX                                         ~24     $23, ->39
         37    > > EXIT                                                     'Cannot+connect+to+database'
         38*       BOOL                                             ~24     <true>
   19    39    >   FETCH_R                      global              ~25     '_POST'
         40        FETCH_DIM_R                                      ~26     ~25, 'public'
         41      > FE_RESET_R                                       $27     ~26, ->47
         42    > > FE_FETCH_R                                               $27, !5, ->47
   21    43    >   IS_NOT_EQUAL                                             !5, null
         44      > JMPZ                                                     ~28, ->46
   22    45    >   ASSIGN                                                   !4, 'yes'
   19    46    > > JMP                                                      ->42
         47    >   FE_FREE                                                  $27
   26    48        INIT_METHOD_CALL                                         !1, 'query'
         49        ROPE_INIT                                     9  ~31     'INSERT+INTO+list+%28details%2C+date_posted%2C+time_posted%2C+public%29+VALUES+%28%27'
         50        ROPE_ADD                                      1  ~31     ~31, !0
         51        ROPE_ADD                                      2  ~31     ~31, '%27%2C%27'
         52        ROPE_ADD                                      3  ~31     ~31, !3
         53        ROPE_ADD                                      4  ~31     ~31, '%27%2C%27'
         54        ROPE_ADD                                      5  ~31     ~31, !2
         55        ROPE_ADD                                      6  ~31     ~31, '%27%2C%27'
         56        ROPE_ADD                                      7  ~31     ~31, !4
         57        ROPE_END                                      8  ~30     ~31, '%27%29'
         58        SEND_VAL_EX                                              ~30
         59        DO_FCALL                                      0          
   27    60        INIT_FCALL                                               'header'
         61        SEND_VAL                                                 'location%3A+home.php'
         62        DO_ICALL                                                 
         63      > JMP                                                      ->67
   31    64    >   INIT_FCALL                                               'header'
         65        SEND_VAL                                                 'location%3Ahome.php'
         66        DO_ICALL                                                 
   33    67    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.13 ms | 1400 KiB | 21 Q