本文整理汇总了PHP中isNotNull函数的典型用法代码示例。如果您正苦于以下问题:PHP isNotNull函数的具体用法?PHP isNotNull怎么用?PHP isNotNull使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了isNotNull函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testBoolean
public function testBoolean()
{
isTrue(true);
isFalse(false);
isNull(null);
isNotNull(false);
isNotNull('');
isNotNull(0);
isNotNull(0.0);
}
示例2: addslashes
if (!isNotNull($txtEmail)) {
$message .= "* Email cannot be empty! <br>";
} else {
if (!isValidEmail($txtEmail)) {
$message .= "* Invalid email! <br>";
}
}
/*---------Selecting the custom fields data if exists---------------*/
$select_custom_update = "SELECT cv.nvalue_id,cf.vrequired_custom_field,vcustom_field_name\n\t\t\t\t\t\t\t FROM " . $tableprefix . "custom_fields cf," . $tableprefix . "custom_fields_value cv\n\t\t\t\t\t\t\t WHERE cf.ncustom_id = cv.ncustom_field_id\n\t\t\t\t\t\t\t\t AND cf.vcustom_field_form_id = 1\n\t\t\t\t\t\t\t\t AND cv.ncustom_table_id = " . addslashes($userid) . "\n\t\t\t\t\t\t\t\t ORDER BY cf.vcustom_sort_order";
//echo $select_custom_data;
$result_custom_update = mysql_query($select_custom_update) or die(mysql_error());
if (mysql_num_rows($result_custom_update) > 0) {
while ($custom_update_row = mysql_fetch_array($result_custom_update)) {
$custom_name = "txtCustom_" . $custom_update_row['nvalue_id'];
if ($custom_update_row['vrequired_custom_field'] == 'Y') {
if (!isNotNull($_POST[$custom_name])) {
$message .= "* " . ucfirst($custom_update_row['vcustom_field_name']) . " cannot be empty ! <br>";
}
}
}
}
$qry2 = "select email from " . $tableprefix . "users where email='" . addslashes($txtEmail) . "' AND user_id <> '" . addslashes($userid) . "' ";
if (mysql_num_rows(mysql_query($qry2)) > 0) {
$message .= "* The email address '" . htmlentities($txtEmail) . "' is already in use!. <br>";
}
if ($message != "") {
// error
$message = "<br>Please correct the following errors to continue!<br>" . $message;
} else {
// no error so insert user details
$sql = "UPDATE " . $tableprefix . "users SET\n\t\t\tfirst_name = '" . addslashes($txtFirstName) . "',\n\t\t\tlast_name = '" . addslashes($txtLastName) . "',\n\t\t\taddress1 = '" . addslashes($txtAddress1) . "',\n\t\t\taddress2 = '" . addslashes($txtAddress2) . "',\n\t\t\tcity = '" . addslashes($txtCity) . "',\n\t\t\tstate = '" . addslashes($txtState) . "',\n\t\t\tcountry = '" . addslashes($ddlCountry) . "',\n\t\t\tphone = '" . addslashes($txtPhone) . "',\n\t\t\tfax = '" . addslashes($txtFAX) . "',\n\t\t\tzip = '" . addslashes($txtZIP) . "',\n\t\t\tnewsLetter = '" . addslashes($check_news) . "',\n\t\t\temail = '" . addslashes($txtEmail) . "'\n\t\t\tWHERE user_id = '" . addslashes($userid) . "'\n\t\t\t";
示例3: executeQuery
<?php
if ($_POST["postback"] == "Save Changes") {
$error = false;
$errormessage = "";
if (isNotNull($_POST["ddlCSS"])) {
$newid = $_POST["ddlCSS"];
$ddlCSS = $_POST["ddlCSS"];
$selectedid = $ddlCSS;
} else {
//user name null
$error = true;
$errormessage .= MESSAGE_STYLE_REQUIRED . "<br>";
}
if ($error) {
$errormessage = MESSAGE_ERRORS_FOUND . "<br>" . $errormessage;
} else {
//no error so validate
$sql1 = " UPDATE sptbl_users ";
$sql1 .= " SET nCSSId = '" . mysql_real_escape_string($newid) . "' WHERE nUserId = '" . $_SESSION["sess_userid"] . "' ";
$result1 = executeQuery($sql1, $conn);
$message = true;
//update css
$sql = "Select vCSSURL from sptbl_css where nCSSId='" . mysql_real_escape_string($newid) . "'";
$result = executeSelect($sql, $conn);
if (mysql_num_rows($result) > 0) {
$row = mysql_fetch_array($result);
$_SESSION["sess_cssurl"] = $row["vCSSURL"];
//$_SESSION["sess_cssurl"] = "./styles/AquaBlue/style.css";
}
//update css
示例4: htmlentities
<td valign=top align="left">
<textarea name="txtArtistDescription" class="textbox" rows="8" cols="80" ><?php
echo htmlentities(stripslashes($txtArtistDescription));
?>
</textarea>
</td>
</tr>
<tr><td colspan="3"> </td></tr>
<!--<tr><td align="left" valign=top ><?php
echo TEXT_VENDOR;
?>
Photo <span class="required">*</span></td><td > </td>
<td valign=top align="left" class="blackbartextCopy"><input type="file" name="artistphoto" id="artistphoto" size="40" class="textbox" > Best Size 100X100
<div align="left">
<?php
if (isNotNull($txtArtistPhoto)) {
?>
Existing: <img src="<?php
echo SITE_URL;
?>
/portfolios/<?php
echo $txtArtistPhoto;
?>
" height="100" width="100">
<br>
<input type="checkbox" class="checkbox" name="chkDeleteArtistPhoto"> Delete Existing
<br>
<?php
}
?>
示例5: settype
$styleplus = $_POST["styleplus"];
}
$userId = $_SESSION['sess_userid'] ? $_SESSION['sess_userid'] : 0;
if ($_POST["ddlCategory"] != "") {
$ddlCategory = $_POST["ddlCategory"];
} else {
$ddlCategory = $_GET["ddlCategory"];
}
if ($_POST["ddlDepartment"] != "") {
$ddlDepartment = $_POST["ddlDepartment"];
} else {
$ddlDepartment = $_GET["ddlDepartment"];
}
$error = false;
$errormessage = "";
if (isNotNull($_GET["id"])) {
$kbid = $_GET["id"];
settype($kbid, integer);
$sql = " SELECT nKBID, vKBTitle, tKBDesc ";
$sql .= " FROM sptbl_kb ";
$sql .= " WHERE nKBID = '{$kbid}' ";
$rs = executeSelect($sql, $conn);
if (mysql_num_rows($rs) > 0) {
$row = mysql_fetch_array($rs);
$title = $row["vKBTitle"];
$description = $row["tKBDesc"];
} else {
$error = true;
$errormessage = "";
}
} else {
示例6: header
} else {
header("Location:login.php");
exit;
}
if (isset($_REQUEST['stat']) && $_REQUEST['stat'] == 'Y') {
$message = "Your products and images saved successfully!.";
}
$maximagesizestringinPHP = ini_get("upload_max_filesize");
$maximagesizeinPHP = $maximagesizestringinPHP * (1024 * 1024);
$sql_artists = "select artist_id,artist_name from " . $tableprefix . "artists where vapproved='Y' ";
$rs_id = mysql_query($sql_artists) or die(mysql_error());
$numrows = mysql_num_rows($rs_id);
if (isset($_POST['btnSave']) && $_POST['btnSave'] != '') {
// check button for save
$message = "";
if (!isNotNull($_FILES['txtUploadZip']['name'])) {
$message .= "* Upload a CSV file ! <br>";
}
$sellerid = $_POST['seller'];
$uploadfile = ReplaceArrayImage($_FILES['txtUploadZip']['name']);
$types = array('csv');
preg_match('/\\.([a-zA-Z]+?)$/', $uploadfile, $matches);
if (!in_array(strtolower($matches[1]), $types)) {
// check file format is valid or not
$message .= "* Invalid file format for CSV file ! <br>";
}
// end format check
if (!empty($_FILES['txtUploadZip']['name'])) {
// moving files to folder
$filename = time() . strrchr(strtolower($_FILES['txtUploadZip']['name']), '.');
$tempFile = $_FILES['txtUploadZip']['tmp_name'];
示例7: executeQuery
$error = true;
$errormessage .= MESSAGE_COMPANY_REQUIRED . "<br>";
}
if (!isNotNull($var_departmentid)) {
$error = true;
$errormessage .= MESSAGE_DEPARTMENT_REQUIRED . "<br>";
}
if (!isNotNull($var_catid)) {
$error = true;
$errormessage .= MESSAGE_CATEGORY_REQUIRED . "<br>";
}
if (!isNotNull($var_kbtitle)) {
$error = true;
$errormessage .= MESSAGE_TITLE_REQUIRED . "<br>";
}
if (!isNotNull($var_kbdesc)) {
$error = true;
$errormessage .= MESSAGE_DESCRIPTION_REQUIRED . "<br>";
}
if (!$error) {
$sql = "UPDATE sptbl_kb SET nCatId= '" . mysql_real_escape_string($var_catid) . "', nStaffId = '" . mysql_real_escape_string($_SESSION["sess_staffid"]) . "', vKBTitle='" . mysql_real_escape_string($var_kbtitle) . "', ";
$sql .= " tKBDesc = '" . mysql_real_escape_string($var_kbdesc) . "', vStatus = '{$var_status}', vMetaTage_keyword = '" . mysql_real_escape_string($var_kbmetatagkeyword) . "' , vMetaTage_desc = '" . mysql_real_escape_string($var_kbmetatagdescription) . "'";
$sql .= "WHERE nKBID = '" . mysql_real_escape_string($var_id) . "'";
executeQuery($sql, $conn);
//updateRoute($var_catid);
//Insert the actionlog
if (logActivity()) {
$sql = "Insert into sptbl_actionlog(nALId,nStaffId,vAction,vArea,nRespId,dDate) Values('','{$var_staffid}','" . TEXT_UPDATION . "','Knowledgebase','" . mysql_real_escape_string($var_id) . "',now())";
executeQuery($sql, $conn);
}
$message = true;
示例8: loadCSS
function loadCSS($userid)
{
global $conn;
if (isNotNull($userid)) {
$sql = " SELECT c.vCSSURL FROM sptbl_css c INNER JOIN sptbl_users u ON u.nCSSId = c.nCSSId ";
$sql .= " WHERE u.nUserId='" . mysql_real_escape_string($userid) . "'";
$result = executeSelect($sql, $conn);
if (mysql_num_rows($result) > 0) {
$row = mysql_fetch_array($result);
$cssurl = $row["vCSSURL"];
} else {
$cssurl = "styles/helpdesk.css";
}
} else {
$cssurl = "styles/helpdesk.css";
}
return "<link href=\"{$cssurl}\" rel=\"stylesheet\" type=\"text/css\">";
}
示例9: addslashes
} else {
if (!isValidEmail($txtEmail)) {
$message .= "* Invalid email! <br>";
}
}
$qry2 = "select email from " . $tableprefix . "users where email='" . addslashes($txtEmail) . "'";
if (mysql_num_rows(mysql_query($qry2)) > 0) {
$message .= "* The email address '{$txtEmail}' is already in use!. <br>";
}
/*custom fields null checking starts*/
$select_custom_qry = "SELECT * FROM " . $tableprefix . "custom_fields WHERE vcustom_display_field = 'Y'\n\t\t\t\t\t\t \t AND vcustom_delete_status !='Y' ORDER BY vcustom_sort_order";
$result_custom_qry = mysql_query($select_custom_qry) or die(mysql_error());
while ($custom_qry_row = mysql_fetch_array($result_custom_qry)) {
$field_name = 'custom_field_' . $custom_qry_row['ncustom_id'];
if ($custom_qry_row['vrequired_custom_field'] == 'Y') {
if (!isNotNull($_POST[$field_name])) {
$message .= "* " . ucfirst($custom_qry_row['vcustom_field_name']) . " cannot be empty ! <br>";
}
}
/*$insert_custom_fields = "INSERT INTO ".$tableprefix."custom_fields_value(ncustom_field_id,ncustom_table_id,vfield_name_value)
VALUES(".$custom_qry_row['ncustom_id'].","
.$userid.","
.GetSQLValueString($_POST[$field_name],"text").")";
mysql_query($insert_custom_fields) or die(mysql_error());*/
}
/*custom fields null checking ends*/
if ($message != "") {
// error
$message = "<br>Please correct the following errors to continue!<br>" . $message;
} else {
示例10: stripslashes
} else {
$content = "Message :" . stripslashes($txtMessage) . "<br><br>";
}
$content_db = stripslashes($txtMessage);
if (!isNotNull($contact_name)) {
$message .= "* Contact name cannot be empty! <br>";
}
if (!isNotNull($email_address)) {
$message .= "* Email address cannot be empty! <br>";
} elseif (!isValidEmail($email_address)) {
$message .= "* Email address cannot be invalid! <br>";
}
if (!isNotNull($subject)) {
$message .= "* Subject cannot be empty! <br>";
}
if (!isNotNull($txtMessage)) {
$message .= "* Message cannot be empty! <br>";
}
if ($message != "") {
// error
$message = "<br>Please correct the following errors to continue!<br>" . $message;
} else {
// no error so insert user details
//echo "SELECT * FROM artists WHERE artist_id = '".$artistid."'";
////// sent message to seller....
$sql = "SELECT * FROM " . $tableprefix . "artists WHERE artist_id = '" . $sellerid . "'";
$rs = mysql_query($sql) or die(mysql_error());
if (mysql_num_rows($rs) > 0) {
$sell = mysql_fetch_array($rs);
$sell_email = $sell['email'];
$sellerName = stripslashes($sell['first_name']) . ' ' . stripslashes($sell['last_name']);
示例11: makeChildList
function makeChildList($currid, $count)
{
static $childlist = "";
if (!isNotNull($deptid)) {
$deptid = 0;
}
if (!isset($current_parentcat_id)) {
$current_parentcat_id = 0;
}
$count = $count + 1;
$sql = "select nDeptId as id,vDeptDesc as name from sptbl_depts where nDeptParent={$currid} ";
$get_options = mysql_query($sql);
$num_options = mysql_num_rows($get_options);
if ($num_options > 0) {
while (list($child_id, $child_name) = mysql_fetch_row($get_options)) {
$childlist .= "" . $child_id . ",";
makeChildList($child_id, $count);
}
}
return $childlist;
}
示例12: header
}
}
if (isset($_SESSION["sess_userid"]) && $_SESSION["sess_userid"] != "") {
$userid = $_SESSION["sess_userid"];
} else {
header("Location:login.php?action=postartistfeedback&artistid={$artistid}&productid={$productid}");
exit;
}
if ($artistid == '') {
header("Location:categorydetail.php");
exit;
}
if ($_POST["btnPostFeedback"] == "Post Feedback") {
$txtFeedback = $_POST["txtFeedback"];
$ddlRating = $_POST["ddlRating"];
if (!isNotNull($txtFeedback)) {
$message .= "* Feedback cannot be empty! <br>";
}
if ($message != "") {
// error
$message = "<br>Please correct the following errors to continue!<br>" . $message;
} else {
// no error so insert user details
$sql = "INSERT INTO " . $tableprefix . "artist_feedbacks (\n\t\t\t\tfeedback_content,\n\t\t\t\trating,\n\t\t\t\tuser_id,\n\t\t\t\tartist_id,\n\t\t\t\tdate_added,\n\t\t\t\tpublished\n\n\t\t\t\t) VALUES (\n\t\t\t\t'" . addslashes($txtFeedback) . "',\n\t\t\t\t'" . addslashes($ddlRating) . "',\n\t\t\t\t'" . addslashes($userid) . "',\n\t\t\t\t'" . addslashes($artistid) . "',\n\t\t\t\tnow(),\n\t\t\t\t'N')\n\t\t\t\t";
//echo $sql;
$message = "Thank you for posting your valuable feedback about <b>" . getArtistName($artistid) . "</b>";
$message .= "<br>Your feedback is pending for review and approval by the administrator";
mysql_query($sql);
$txtFeedback = "";
$ddlRating = "";
}
示例13: image
if (isset($_GET["smid"]) and $_GET["smid"] != "") {
$smid = $_GET["smid"];
} else {
if (isset($_POST["smid"]) and $_POST["smid"] != "") {
$smid = $_POST["smid"];
}
}
$txtSMName = $_POST["txtSMName"];
$chkPublished = $_POST["chkPublished"];
if ($chkPublished == "on") {
$chkPublished = "Y";
} else {
$chkPublished = "N";
}
if ($_POST["btnSaveChanges"] == "Save Changes") {
if (!isNotNull($txtSMName)) {
$message = "* Shipping Method Name cannot be empty!<br>";
} else {
$logofilename = $_FILES['txtSMLogo']['name'];
$logofiletype = $_FILES['txtSMLogo']['type'];
$logotempname = $_FILES['txtSMLogo']['tmp_name'];
if ($_FILES['txtSMLogo']['name'] != "") {
if (!isValidWebImageType($logofiletype, $logofilename, $logotempname)) {
$message .= " * Invalid Shipping Logo file ! Upload an image (jpg/gif/bmp/png)" . "<br>";
$error = true;
} else {
$logoimagedest = "../products/" . "sm_" . time() . $logofilename;
if (move_uploaded_file($_FILES['txtSMLogo']['tmp_name'], $logoimagedest)) {
chmod($logoimagedest, 0777);
} else {
$logoimagedest = "";
示例14: getStaffCompanies
?>
</div></td>
</tr>
<tr><td colspan="3"> </td></tr>
<tr>
<td width="13%" align="left"> </td>
<td width="26%" align="left" class="toplinks" valign="top"><?php
echo TEXT_TO;
?>
<font style="color:#FF0000; font-size:9px">*</font> </td>
<td width="61%" align="left">
<?php
$staffcompanies = getStaffCompanies($_SESSION["sess_staffid"]);
$ddl = "";
if (isNotNull($staffcompanies)) {
echo "<select name=\"ddlEmails[]\" id=\"ddlEmail\" class=\"comm_input input_width1a\" style=\"width:300px; height:60px!important;\" MULTIPLE size=\"10\">";
$var_listnew = makeEmailList($staffcompanies);
if (count($var_listnew) > 0) {
foreach ($var_listnew as $key => $value) {
$ddl .= "<option value=\"{$key}\"";
if ($ddlEmails == "{$key}") {
$ddl .= " selected=\"selected\"";
}
$ddl .= ">" . $value . "</option>\n";
}
echo $ddl;
}
echo "</select>";
//echo makeDropDownList("ddlEmails[]",makeEmailList($staffcompanies),$ddlEmails,false, "textbox", "\" MULTIPLE size=10 style=\"width:300px;\" id=\"ddlEmail","" );
} else {
示例15: picture
}
}
}
if ($picbigtype != "") {
if (!isValidWebImageType($picbigtype, $picbigfilename, $picbigtempname)) {
$message .= " * Invalid product picture (big)! Upload an image (jpg/gif/png)" . "<br>";
$error = true;
} else {
if (file_exists($picbigdest)) {
$message .= " * Product picture (big) with the same name exists! Please rename the product picture (big) and upload! " . "<br>";
$error = true;
}
}
}
/*----Digital Product Block Starts-------*/
if (isNotNull($_FILES['txtProductZip']['name'])) {
$uploadfile = ReplaceArrayImage($_FILES['txtProductZip']['name']);
$types = array('zip', 'pdf', 'rar', 'psd', 'opf', 'azw', 'lit', 'pdb', 'pkg', 'mp3', 'mpeg', 'mp4', 'avi');
preg_match('/\\.([a-zA-Z]+?)$/', $uploadfile, $matches);
if (!in_array(strtolower($matches[1]), $types)) {
// check file format is valid or not
$message .= "* Invalid file format for Digital Product! <br>";
}
// end format check
}
/*----Digital Product Block Ends-------*/
if ($message != "") {
// error
$message = "<br>Please correct the following errors to continue!<br>" . $message;
} else {
// no error so insert user details