本文整理汇总了PHP中security::isValidUrl方法的典型用法代码示例。如果您正苦于以下问题:PHP security::isValidUrl方法的具体用法?PHP security::isValidUrl怎么用?PHP security::isValidUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类security
的用法示例。
在下文中一共展示了security::isValidUrl方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: mssql_fetch_array
echo "<td>{$row['id']}</td><td>{$row['name']}</td><td>{$row['link']}</td><td>{$row['description']}</td><td><a href='?pg=admin&act=dl&subact=edit&id={$row['id']}'>Edit</td><tr/>";
}
} else {
echo "No links added yet.<br/>";
break;
}
echo "</table>";
} else {
$nID = (int) $_GET['id'];
$hLinkData = core::$sql->exec("select * from srcms_downloads where id='{$nID}'");
if (mssql_num_rows($hLinkData) > 0) {
if (!isset($_POST['link'])) {
$hArray = mssql_fetch_array($hLinkData);
echo "<table id='table-3' border='1' cellspacing='0' cellpadding='0'>\r\n\t\t\t\t\t\t\t\t\t\t<form method='post'>\r\n\t\t\t\t\t\t\t\t\t\t<td>Name</td><td>Link</td><td>Description</td><tr/>\r\n\t\t\t\t\t\t\t\t\t\t<td>{$hArray['name']}</td><td>{$hArray['link']}</td><td>{$hArray['description']}</td><tr/>\r\n\t\t\t\t\t\t\t\t\t\t<td><input type='submit' name='submit' value='Save'></td>\r\n\t\t\t\t\t\t\t\t\t\t</form>\r\n\t\t\t\t\t\t\t\t\t\t</table>\r\n\t\t\t\t\t\t\t\t\t\t";
} else {
if (!security::isValidUrl($_POST['link'])) {
echo "Invalid URL<br/>";
misc::back();
} else {
$szName = misc::toHTML($_POST['name']);
$szDesc = misc::toHTML($_POST['description']);
core::$sql->exec("update srcms_downloads set name='{$szName}',description='{$szDesc}',link='{$_POST['link']}' where id='{$nID}'");
echo "Link successfully edited<br/>";
misc::redirect('?pg=admin&act=dl', 1);
}
}
} else {
echo "Record with ID you requested was not found in database.<br/>";
misc::back();
break;
}
示例2:
echo "You don't have any characters on this account.<br/>";
}
break;
case 'myprofile':
//module disabled
if ($core->aConfig['allowMyProfile'] == 0) {
echo "This module is currently disabled.";
return;
}
if (isset($_POST['submit'])) {
$nGender = (int) $_POST['gender'];
$szAvatarUrl = null;
$szSkype = null;
$szMsn = null;
$nPublic = (int) $_POST['ispublic'];
security::isValidUrl($_POST['avatar']) ? $szAvatarUrl = $_POST['avatar'] : ($szAvatarUrl = $core->aConfig[url] . "img/noavatar.png");
security::isCorrectEmail($_POST['msn']) ? $szMsn = $_POST['msn'] : ($szMsn = "None");
$szSkype = security::toHTML($_POST['skype']);
if (strlen($szSkype) > 50) {
$szSkype = "None";
}
if (strlen($szMsn) > 60) {
$szMsn = "None";
}
if (strlen($szAvatarUrl) > 500) {
$szAvatarUrl = $core->aConfig['url'] . "img/noavatar.png";
}
$avatarImageData = @getimagesize($szAvatarUrl);
//no error if shit happens
if (empty($avatarImageData[0]) || empty($avatarImageData[1])) {
$avatarImageData[0] = 0;