trouble the syntax of PHP validation in a form - php

my goal: I need to verify that if someone has checked the box that they get financial aid, I need to validated that they check the type they are receiving.
Here is what I have so far in the php validation part.
if (($_SERVER['REQUEST_METHOD'] == 'POST') && (!empty($_POST['action']))):
if (isset($_POST['financial_aid'])) { $financial_aid = $_POST['financial_aid']; }
if ($financial_aid === '') :
$err_financial_aid = '<div class="error">Sorry, this is a required field</div>';
endif; // input field empty
the form code:
<p><strong>Are you receiving Financial Aid? </strong><br />
<select name="Financial_Aid" size="1" tabindex="8">
<option value="blank" selected>Please select one</option>
<option value="Yes">Yes, I Receive Financial Aid</option>
<option value="No">No, I Do Not Receive Financial Aid</option>
</select></p>
<p>Please indicate all forms of Financial Aid that you receive:</p>
<p>
<input type="checkbox" name="financial_type" value="<?php ((isset($financial_type)) && (in_array("hope", $financial_type))) { echo "checked"; } ?> " tabindex="9">HOPE Scholarship/HOPE Grant<br>
<input type="checkbox" name="financial_type" value="<?php ((isset($financial_type)) && (in_array("pell", $financial_type))) { echo "checked"; } ?>" tabindex="10">Pell Grant<br>
<input name="financial_type" type="checkbox" value="Yes" tabindex="11">Student Loan<br>
<input type="checkbox" name="financial_type" value="<?php ((isset($financial_type)) && (in_array("loan", $financial_type))) { echo "checked"; } ?>" tabindex="12">Veterans Benefits<br>
<input type="checkbox" name="financial_type" value="<?php ((isset($financial_type)) && (in_array("tuition_reimbursement", $financial_type))) { echo "checked"; } ?>" tabindex="13">Tuition Reimbursement<br>
<input type="checkbox" name="financial_type" value="<?php ((isset($financial_type)) && (in_array("tuition_waiver", $financial_type))) { echo "checked"; } ?>" tabindex="14">Tuition Waiver<br>
<input type="checkbox" name="financial_type" value="<?php ((isset($financial_type)) && (in_array("other_scholarships", $financial_type))) { echo "checked"; } ?>" tabindex="15"> Other Scholarships </p>
My first thought is that I need another if statement.
if ($financial_aid === 'yes') {
} elseif ($hope) { ((isset($financial_type)) && (in_array("hope", $financial_type)))
return true;
} elseif ($pell) { ((isset($financial_type)) && (in_array("pell", $financial_type)))
return true;
} elseif ($loan) { ((isset($financial_type)) && (in_array("loan", $financial_type)))
return true;
} elseif ($veterns) { ((isset($financial_type)) && (in_array("veterns", $financial_type)))
return true;
}
elseif ($tuition_reimbursement) { ((isset($financial_type)) && (in_array("tuition_reimbursement", $financial_type)))
return true;
}
elseif ($tuition_waiver) { ((isset($financial_type)) && (in_array("tuition_waiver", $financial_type)))
return true;
}
elseif ($other_scholarships) { ((isset($financial_type)) && (in_array("other_scholarships", $financial_type)))
return true;
} else {
!empty $err_finanical_type=please select one
return false;
}
}
I'm missing something. I just don't know what. Can someone help me?

First let me say that your checking input enhances the user experience that many miss.
Your question about PHP validation looks to have 3 areas of response:
1) You show the form code using:
Financial Aid and Yes
BUT your if statement shows
$financial_aid === 'yes'
Camel text needs to be the same in your if code to identify the SAME variable and the === identical as Yes is not identical to yes - things to watch and keep in harmony.
2) The id component of each input form field is missing. You are only using 'name="financial_type"'. Name is for sending the data item via a form submission but also using id="financial_type" more easily works to different ids for each radio button/checkbox with javascript or css. If in doubt just do both name="item1" and id="item2" then the same for the next but changed to item2, etc. Best of both worlds until you have situation selecting between a few checkboxs (ex. box 1 is for red box, 2 for blue and 3 for green for example) that is not part of this questtion.
3) You do not show if you are using a form Submit or if you are using
"button type="button" onclick="dosomething()"
where dosomething() is triggered as a submit.
Validating data at the other end can reveal the word "on" instead of checked or unchecked being passed. I have found this with AJAX XMLHttpRequest transfers more than with POST from form submits. If your question was caused by an "on" confirm/validate instead of the check or uncheck status showing... try the dosomething() script below.
The script also shows the standard type of field... lname existing with and input id as well as localStorage array to be transfered. Sending a localStorage and the form Submit won't both work on their own, leaving the localStorage un sent. XMLHttpRequest needs to be used instead to allow both the form fields and the localStorage to be sent to in this case processing on the server by the code in catchby.php
This example has the client sending with a button...
<button type="button" onclick="dosomething();" class="btn btn-primary btn-lg">Complete </button>
that triggers dosomething() ,in the same page, to use Yes or No based on checked or unchecked status to send from javascript to PHP
<script>
function dosomething() {
// Start XMLHttpRequest
var DaData = new XMLHttpRequest();
// where to pass data to
var url = "catchby.php";
// Data items to pass.. lname is a field in the form
var nm = document.getElementById("lname").value;
/* financial_type is the id of checkbox input converted to Yes or No avoiding the constant "on" being sent */
if($('#financial_type').attr('checked')) {
var cb = "Yes";
} else {
var cb = "No";
}
/* svdStorage is the name of localStorage that is not part of the form that is other saved input user has entered saved on their client side computer that stays for next web visits... in this case an array that includes any outside the form data to send. */
var ct = localStorage.getItem('svdStorage');
// variables to be available in catchby.php via $_REQUEST in code
var vars = "nname="+nm+"&ftype="+cb+"&scdStuff="+ct;
DaData.open("POST", url, true);
DaData.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
// Check onreadystatechange for XMLHttpRequest
DaData.onreadystatechange = function() {
if(DaData.readyState == 4 && DaData.status == 200) {
var return_data = DaData.responseText;
document.getElementById("status").innerHTML = return_data;
}
}
// OK Send data items and process data transfer
DaData.send(vars);
document.getElementById("status").innerHTML = "Processing...";
}
</script>
Then to receive data being sent here is catchby.php coding...
<?php
$customerInformation = "";
if(!empty( $_REQUEST["name"]))
{
$customerInformation .= "Name: ";
$customerInformation .= $_REQUEST["name"];
}
// this net line will show the Yes or No reflecting the checked status instead of just the work "on"
$customerInformation .= "<br/>The financial requested was: ".$_REQUEST["ftype"];
// convert localStorage array to data items
$zscdStuff = json_decode($_REQUEST["scdStuff"]);
// determine # of array items
$length = count($zscdStiff);
for ($i = 0; $i < $length; $i++) {
// define items in each line of array
// then
// do what is needed with each line item
}
?>
Note... XMLHttpRequest will work with form items and all other variables you want to transfer, async at the same time, while submit only transfers form items.
Using 1)exactly the same names, 2)use parameter id as well as name parameter in each item of submit line and 3)convert the check / uncheck status to an explicit text item like "Yes" and "No" and your results will be what you expect.

Related

Error "Undefined index" if check box is not checked

When I check the checkbox there is no errors, but when I didn't check the checkbox it gives me errors.
<?php
if(isset($_REQUEST['btn']))
{
$remmber = $_REQUEST['active'];
if($remmber == "on")
{
echo "Checked";
}
else {$remmber = "";}
}
?>
<html>
<form name= "frm" action = "test.php" method = "post" >
<p>Username
<input type = "text" name = "name" value = "" />
</p>
<p>Password
<input type = "text" name = "password" value = "" />
</p>
<p>
<td colspan = "2"><input type = "checkbox" name = "active" value = "active" />Keep Me Loged In
</p>
<p><input type = "submit" name = "btn" value = "Login" />
</p>
</form>
</html>
For checkboxes if they are not checked then they are not posted. So check if it is present in the posted data then set on, else set blank to the variable. Try with -
if(isset($_REQUEST['btn']))
{
$remmber = !empty($_REQUEST['active']) ? 'on' : '';
if($remmber == "on")
{
echo "Checked";
}
else
$remmber = "";
}
if($remmber == "on") yet you're using and specifying a value value = "active"
"on" is the default value for a checkbox if a value is not specified.
Therefore, you need to adjust it to read as
if($remmber == "active")
Edit: (an explanation)
The reason why you're getting an undefined index, is that once you hit the submit submit and do not tick the checkbox, it will produce that notice.
Modify your code to read as and check if the checkbox value is set.
if(isset($_REQUEST['btn']))
{
if(isset($_REQUEST['active'])){
$remmber = $_REQUEST['active'];
if($remmber == "active")
{
echo "Checked";
}
else {$remmber = "";}
} // closing brace for if(isset($_REQUEST['active']))
}
Additional edit, to show the user that the checkbox isn't set:
if(isset($_REQUEST['btn']))
{
if(isset($_REQUEST['active'])){
$remmber = $_REQUEST['active'];
if($remmber == "active")
{
echo "Checked";
}
else {$remmber = "";}
} // closing brace for if(isset($_REQUEST['active']))
else{ echo "The checkbox was not ticked.";
}
}
Footnotes:
You should also use a conditional !empty() for your inputs.
You're only checking if the submit and checkbox are set.
After noticing a comment you left in another answer:
#Barmar i am just using this for login page , where i am using a checkbox to remember username and password. – Akshat Dhiman
Please read the following Q&A on Stack:
Remember me Cookie best practice?
It also contains valuable information regarding passwords.
I hope you are using modern-day hashing methods also, such as password_hash() as well as prepared statements.
you can use simply isset
if(isset($_REQUEST['btn']))
{
$remmber = isset($_REQUEST['active']) ? $_REQUEST['active'] : '';
if($remmber == "on")
{
echo "Checked";
}
else {$remmber = "";}
}

Issue w/PHP syntax

I need a simple php function to mimic an Ajax form submission - basically in the form there is a radio button "ajax" and it is either set to yes or no. I just need to mimic successful/failing ajax calls...
HTML
<label for="">Ajax Success*<input type="radio" name="ajax" id="yes" value="yes" checked>Yes<input type="radio" name="ajax" id="no" value="no">No</label>
PHP
<?php
$ajax = $_POST["ajax"];
if(isset($_POST['ajax'] == "yes")) {
echo "success";
} else {
echo "failure";
}
?>
if I remove the isset, I get an 'undefined index' error, if I put it in I get a syntax error but it looks correct to me...
I just need to send back an echo depending on what option is selected for the input 'ajax'
thx
isset($_POST['ajax'] == "yes") doesn't make sense. You want to check if it's set, and then check if its value is equal to "yes":
if(isset($_POST['ajax']) && $_POST['ajax'] == "yes") {
echo "success";
} else {
echo "failure";
}
As your code does, I'll say you use your defined variable like in this example:
<?php
$ajax = $_POST["ajax"];
if($ajax == "yes") {
echo "success";
} else {
echo "failure";
}
?>
Because if the variable has the value "yes" it'll be ok and undefined or other value will end in "failure".

select all checkboxes if none are select in php query

I have a script wher users can find exercise from a database, I have checkboxes for the user to find specific exercises the script works fine when a least 1 checkbox is selected from each checkbox group however I would like it that if no checkboxes was selected then it would the results of all checkboxes.
my checkbox form looks like this
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" name="criteria">
<p><strong>MUSCLE GROUP</strong></p>
<input type="checkbox" name="muscle[]" id="abdominals" value="abdominals"/>Abdominals<br />
<input type="checkbox" name="muscle[]" id="biceps" value="biceps" />Biceps<br />
<input type="checkbox" name="muscle[]" id="calves" value="calves" />Calves<br />
ect...
<br /><p><strong>EQUIPMENT (please select a least one)</strong></p>
<input type="checkbox" name="equipment[]" id="equipment" value="bands"/>Bands<br />
<input type="checkbox" name="equipment[]" id="equipment" value="barbell" />Barbell<br />
<input type="checkbox" name="equipment[]" id="equipment" value="dumbbell" />Dumbbell<br />
ect....
<input type="submit" name="sub" value="Generate Query" />
</form>
and here is my script
<?php
if(isset($_POST['muscle']) && !empty($_POST['muscle'])){
if(isset($_POST['equipment']) && !empty($_POST['equipment'])){
//get the function
include ($_SERVER['DOCUMENT_ROOT'] .'/scripts/functions.php');
$page = (int) (!isset($_GET["page"]) ? 1 : $_GET["page"]);
$limit = 14;
$startpoint = ($page * $limit) - $limit;
// Runs mysql_real_escape_string() on every value encountered.
$clean_muscle = array_map('mysql_real_escape_string', $_REQUEST['muscle']);
$clean_equipment = array_map('mysql_real_escape_string', $_REQUEST['equipment']);
// Convert the array into a string.
$muscle = implode("','", $clean_muscle);
$equipment = implode("','", $clean_equipment);
$options = array();
if(array($muscle))
{
$options[] = "muscle IN ('$muscle')";
}
if(array($equipment))
{
$options[] = "equipment IN ('$equipment')";
}
$fullsearch = implode(' AND ', $options);
$statement = "mytable";
if ($fullsearch <> '') {
$statement .= " WHERE " . $fullsearch;
}
if(!$query=mysql_query("SELECT * FROM {$statement} LIMIT {$startpoint} , {$limit}"))
{
echo "Cannot parse query";
}
elseif(mysql_num_rows($query) == 0) {
echo "No records found";
}
else {
echo "";
while($row = mysql_fetch_assoc($query)) {
echo "".$row['name'] ."</br>
".$row['description'] ."";
}
}
echo "<div class=\"new-pagination\">";
echo pagination($statement,$limit,$page);
echo "</div>";
}
}
Im new with php so my code may not be the best. If anyone can help me or point me in the right direction I would be very greatful.
OK - I think I have figured it all out. You were right - the main problem was in your isset and isempty calls. I created some variations on your file, and this shows what is going on. Note - since I don't have some of your "other" functions, I am only showing what is going wrong in the outer parts of your function.
Part 1: validating function
In the following code, I have added two JavaScript functions to the input form; these were loosely based on scripts you can find when you google "JavaScript validation checkbox". The oneBoxSet(groupName) function will look through all document elements; find the ones of type checkBox, see if one of them is checked, and if so, confirms that it belongs to groupName. For now, it returns "true" or "false". The calling function, validateMe(formName), runs your validation. It is called by adding
onclick="validateMe('criteria'); return false;"
to the code of the submit button. This basically says "call this function with this parameter to validate the form". In this case the function "fixes" the data and submits; but you could imagine that it returns "false", in which case the submit action will be canceled.
In the validateMe function we check whether at least one box is checked in each group; if it is not, then a hidden box in the "all[]" group is set accordingly.
I changed the code a little bit - it calls a different script (muscle.php) instead of the <?php echo $_SERVER['PHP_SELF']; ?> you had... obviously the principle is the same.
After this initial code we will look at some stuff I added in muscle.php to confirm what your original problem was.
<html>
<head>
<script type="text/javascript">
// go through all checkboxes; see if at least one with name 'groupName' is set
// if so, return true; otherwise return false
function oneBoxSet(groupName)
{
var c=document.getElementsByTagName('input');
for (var i = 0; i<c.length; i++){
if (c[i].type=='checkbox')
{
if (c[i].checked) {
if (c[i].name == groupName) {
return true; // at least one box in this group is checked
}
}
}
}
return false; // never found a good checkbox
}
function setAllBoxes(groupName, TF)
{
// set the 'checked' property of all inputs in this group to 'TF' (true or false)
var c=document.getElementsByTagName('input');
// alert("setting all boxes for " + groupName + " to " + TF);
for (var i = 0; i<c.length; i++){
if (c[i].type=='checkbox')
{
if (c[i].name == groupName) {
c[i].checked = TF;
}
}
}
return 0;
}
// this function is run when submit is pressed:
function validateMe(formName) {
if (oneBoxSet('muscle[]')) {
document.getElementById("allMuscles").value = "selectedMuscles";
//alert("muscle OK!");
}
else {
document.getElementById("allMuscles").value = "allMuscles";
// and/or insert code that sets all boxes in this group:
setAllBoxes('muscle[]', true);
alert("No muscle group was selected - has been set to ALL");
}
if (oneBoxSet('equipment[]')) {
document.getElementById("allEquipment").value = "selectedEquipment";
//alert("equipment OK!");
}
else {
document.getElementById("allEquipment").value = "allEquipment";
// instead, you could insert code here that sets all boxes in this category to true
setAllBoxes('equipment[]', true);
alert("No equipment was selected - has been set to ALL");
}
// submit the form - function never returns
document.forms[formName].submit();
}
</script>
</head>
<body>
<form action="muscle.php" method="post" name="criteria">
<p><strong>MUSCLE GROUP</strong></p>
<input type="checkbox" name="muscle[]" id="abdominals" value="abdominals"/>Abdominals<br />
<input type="checkbox" name="muscle[]" id="biceps" value="biceps" />Biceps<br />
<input type="checkbox" name="muscle[]" id="calves" value="calves" />Calves<br />
<input type="hidden" name="all[]" id="allMuscles" value="selectedMuscles" />
etc...<br>
<br /><p><strong>EQUIPMENT (please select a least one)</strong></p>
<input type="checkbox" name="equipment[]" id="equipment" value="bands"/>Bands<br />
<input type="checkbox" name="equipment[]" id="equipment" value="barbell" />Barbell<br />
<input type="checkbox" name="equipment[]" id="equipment" value="dumbbell" />Dumbbell<br />
<input type="hidden" name="all[]" id="allEquipment" value="selectedEquipment" />
<br>
<input type="submit" name="sub" value="Generate Query" onclick="validateMe('criteria'); return false;" />
</form>
</body>
</html>
Part 2: what's wrong with the PHP?
Now here is a new start to the php script. It checks the conditions that you were testing at the start of your original script, and demonstrates that you never get past the initial if statements if a check box wasn't set in one of the groups. I suggest that you leave these tests out altogether, and instead get inspiration from the code I wrote to fix any issues. For example, you can test whether equipmentAll or muscleAll were set, and create the appropriate query string accordingly.
<?php
echo 'file was called successfully<br><br>';
if(isset($_POST['muscle'])) {
echo "_POST[muscle] is set<br>";
print_r($_POST[muscle]);
echo "<br>";
if (!empty($_POST['muscle'])) {
echo "_POST[muscle] is not empty!<br>";
}
else {
echo "_POST[muscle] is empty!<br>";
}
}
else {
echo "_POST[muscle] is not set: it is empty!<br>";
}
if(isset($_POST['equipment'])) {
echo "_POST[equipment] is set<br>";
print_r($_POST['equipment']);
echo "<br>";
if (!empty($_POST['equipment'])) {
echo "_POST[equipment] is not empty!<br>";
}
else {
echo "_POST[equipment] is empty!<br>";
}
}
else {
echo "_POST[equipment] is not set: it is empty!<br>";
}
if(isset($_POST['all'])) {
echo "this is what you have to do:<br>";
print_r($_POST['all']);
echo "<br>";
}
// if(isset($_POST['muscle']) && !empty($_POST['muscle'])){
// if(isset($_POST['equipment']) && !empty($_POST['equipment'])){
If you call this with no check boxes selected, you get two dialogs ('not OK!'), then the following output:
file was called successfully
_POST[muscle] is not set: it is empty!
_POST[equipment] is not set: it is empty!
this is what you have to do:
Array ( [0] => allMuscles [1] => allEquipment )
If you select a couple of boxes in the first group, and none in the second:
file was called successfully
_POST[muscle] is set
Array ( [0] => abdominals [1] => calves )
_POST[muscle] is not empty!
_POST[equipment] is not set: it is empty!
this is what you have to do:
Array ( [0] => selectedMuscles [1] => allEquipment )
I do not claim to write beautiful code; but I hope this is functional, and gets you out of the fix you were in. Good luck!

checkbox onclick in php function

Can i write some code to execute while my check box is checked in my php code..
my declaration of check box is...
<input id="checkbox" name="click" type="checkbox" onclick="check(this)"/>
i thought to perform a function called check() while clicking the check box..
<script type="text/javascript">
function check(cb)
{
if($("input[type=checkbox]:checked"")
{
//my functionality and operations
}
}
But its not working, how can i perform the onclick event in the Checkbox's action..
First of all, there's a mistake. It should be .is(":checked").
function check(cb)
{
if($(cb).is(":checked"))
{
//my functionality and operations
}
}
And the HTML should be:
<input type="checkbox" onclick="check(this);" />
Or, if you wanna invoke a PHP Function after clicking on Checkbox, you need to write an AJAX code. If this is the case, in your if condition, and checked condition, you can call a PHP file, that calls only this function.
function check(cb)
{
if($(cb).is(":checked"))
{
$.getScript("clickCheckbox.php");
}
}
And you can write JavaScript plus PHP in the clickCheckbox.php file, say something like this:
clickCheckbox.php
<?php
header("Content-type: text/javascript");
unlink("delete.png");
echo 'alert("Deleted!");';
?>
Once you click on the checkbox, and if the state is checked, it gives out an AJAX call to this PHP file, where you are deleting a file delete.png and in the echo statement, you are outputting a JavaScript alert, so that you will get an alert message saying Deleted!.
$('#myform :checkbox').click(function() {
var $this = $(this);
// $this will contain a reference to the checkbox
if ($this.is(':checked')) {
// the checkbox was checked
} else {
// the checkbox was unchecked
}
});
Where your form has id myform
use
if ($('#checkbox').is(':checked'))
or inside an event
$('#checkbox').click(function(){
if ($(this).is(':checked')){
//your routine here if checked
}else{
//routine here if not checked
}
});
You can put like this:
Include the column checked in your table with default value NO.
Then after your SELECT statement show the array.
page1.php
<input type=checkbox value="<?php $row['checked']?>" onclick="location.href = 'update.php?id=<?php echo $row['id']; ?>&checked=<?php if ($row['checked'] == 'YES') { ?>NO<?php } else {?>YES<?php } ?>';" <?php if ($row['checked'] == 'YES') { ?> checked <?php } ?>>
update.php
<?php include('server.php'); ?>
<?php
$id = $_GET['id'];
$checked = $_GET['checked'];
if(isset($_GET['id']))
{
$sql = "UPDATE table SET
checked = '$checked'
WHERE `id` = '$id' ";
if ($conn->query($sql) === TRUE)
{
}
else
{
echo "Error updating record: " . $conn->error;
}
header('location: page1.php');
}
?>
Try this one
<input id="checkbox" name="click" type="checkbox" onclick="check()"/>
//in js
if( $('input[name=checkbox]').is(':checked') ){
// your code
}

Server Side Form Validation PHP with multi-file Upload

HTML:
Owner: input type="text" name="owner[]" />
Category:
<select name="cat[]">
<option value="clothes">Clothes</option>
<option value="shoes">Shoes</option>
<option value="accessories">Accessories</option>
</select>
Upload: <input type="file" name="image[]" />
whith function that clone the same fields when click on "+ button"
I count the POST field with:
$num = count($_FILES['image']['name']);
because i want to know how many times the end user clone the fields.
what i want is Make sure that the user has to fill all fields which he opend with "+ button" i cant check all the hidden fields i want to check just the field he opend.
so what can i do ?
i cant do like this:
$owner = $_POST['owner'][$i];
$cat = $_POST['cat'][$i];
$file = $_FILES['image'][$i];
if ($owner && $cat && $file)
echo "bla bla bla";
else
echo "fill all the fields!";
can anyone help me ?
thank you
There are some points which you need to make sure beforehand. Whenever you are using any input field's name attribute as "owner[]" or "cat[]" or "image[]", you will get an array then. But since, input file's property accessing capability is already 2D array by default, so now you will be able to access those properties as a 3D array.
When you have added a "[]" for the input file field's name attribute, you will now get the name of the 1st file as "$_FILES['image'][0]['name']", because array indices start with 0. As per your question, you can validate using the following way:-
<?php
$numOwners = count($_POST['owner']);
$numCats = count($_POST['cat']);
$numFiles = count($_FILES['image']);
// Check to see if the number of Fields for each (Owners, Categories & Files) are the same
if ($numFiles === $numCats && $numFiles === $numOwners) {
$boolInconsistencyOwners = FALSE;
$boolInconsistencyCats = FALSE;
$boolInconsistencyFiles = FALSE;
for ($i = 0; $i < $numFiles; $i++) {
if (empty($_POST['owner'][$i])) {
$boolInconsistencyOwners = TRUE;
break;
}
if (empty($_POST['cat'][$i])) {
$boolInconsistencyCats = TRUE;
break;
}
if (!is_uploaded_file($_FILES['image'][$i]['tmp_name'])) {
$boolInconsistencyFiles = TRUE;
break;
}
}
if ($boolInconsistencyOwners || $boolInconsistencyCats || $boolInconsistencyFiles) {
echo "I knew that there will be some problems with users' mentality!";
// Redirect with proper Error Messages
}
else {
echo "Wow, Users have improved & have become quite obedient!";
// Proceed with normal requirements
}
}
else {
echo "Something fishy is going on!";
}
?>
Hope it helps.

Categories