0

Can someone help me explain the coding?

if(isset($_SESSION['patron_ID']))
{ 
set_time_limit(0); 
include 'dbconnect.php'; 
$studylevel1 = $_POST['studylevel']; 
if(isset($_POST['submit'])) 
{ do 
    { 
    $senderid = $_SESSION['patron_ID']; $studylevel1 = $_POST['studylevel'];}}}

Edited by pritaeas: Moved to PHP.

2
Contributors
1
Reply
26
Views
2 Years
Discussion Span
Last Post by broj1
0
// execute the code below only if there is a patron_ID saved in the session variable
// this is probably a check if the user is logged in
if(isset($_SESSION['patron_ID']))
{
    // this function sets max execution time of the script
    // in your case (0) it sets no time limit 
    // see http://php.net/manual/en/function.set-time-limit.php
    set_time_limit(0);
    // here you include the file, probably to connect to the database
    // it is usually separate file so you can use it in many scripts
    include 'dbconnect.php';
    // what follows is an assignment from the session variable
    // this is one way of carying values over from script to script
    $studylevel1 = $_POST['studylevel'];
    // here you check (I presume) whether the form was submitted
    // only if it was, execute the code that folows
    if(isset($_POST['submit']))
    // probably part of a do/while loop
    { do
        {
            $senderid = $_SESSION['patron_ID']; $studylevel1 = $_POST['studylevel'];}}}

Hopefully this was clear enough :-)

Edited by broj1

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.