本文整理汇总了PHP中yasDB_insert函数的典型用法代码示例。如果您正苦于以下问题:PHP yasDB_insert函数的具体用法?PHP yasDB_insert怎么用?PHP yasDB_insert使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了yasDB_insert函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: die
die("The reCAPTCHA wasn't entered correctly. Go back and try it again." . "(reCAPTCHA said: " . $resp->error . ")");
}
} elseif ($settings['userecaptcha'] == "no" && $_POST['security'] != 'ten') {
die('You did not pass the security check. Go back and try again.');
}
$comment_timestamp = trim($_POST['timestamp']);
$submitted_timestamp = time();
if (isset($_POST['addcomment'])) {
if (empty($_POST['userid'])) {
echo 'Sorry, the blog you were commenting seems to be invalid.';
} elseif (empty($_POST['comment']) || empty($_POST['name'])) {
echo 'Please go back and try again, it seems the comment or name was left empty.';
} else {
$comment = yasDB_clean($_POST['comment']);
$name = yasDB_clean($_POST['name']);
$ipaddress = yasDB_clean($_SERVER['REMOTE_ADDR']);
yasDB_insert("INSERT INTO `newsblog` (id, comment, ipaddress, username) values ('', '{$comment}', '{$ipaddress}', '{$name}')", false);
echo '<script>alert("Comment added!");</script>';
}
} else {
echo 'Unexpected error!';
}
if (empty($_POST['userid'])) {
echo '<META http-equiv="refresh" content="2; URL=' . $setting['siteurl'] . '">';
} else {
if ($setting['seo'] == 'yes') {
echo '<META http-equiv="refresh" content="2; URL=' . $setting['siteurl'] . 'shownews/' . intval($_POST['userid']) . '/.html">';
} elseif ($setting['seo'] == 'no') {
echo '<META http-equiv="refresh" content="2; URL=' . $setting['siteurl'] . 'index.php?act=shownews&id=' . intval($_POST['userid']) . '">';
}
}
示例2: install_playtomic
function install_playtomic($gameid)
{
$table = '';
$pre = 'ptomic';
global $mysqli;
$categories = array('Action' => 2, 'Adventure' => 3, 'Strategy' => 10, 'Multiplayer' => 2, 'Puzzle' => 1, 'Rhythm' => 7, 'Shooter' => 5, 'Sports' => 4, 'Other' => 7, 'RPG' => 3, 'Arcade' => 9, 'Driving' => 4, 'Defense' => 10, 'Rhythm' => 7, 'Education' => 7, 'Gadgets' => 1, 'Fighting' => 2, 'Dress Up' => 8, 'Board Game' => 7, 'Pimp & Customize' => 8, 'Pimp & Customize' => 8);
$query = yasDB_select("SELECT * FROM `playtomicfeed` WHERE `id` = '{$gameid}'", false);
$result = $query->fetch_array(MYSQLI_ASSOC);
$gamename = $result['name'];
$thumburl = $result['thumburl'];
$thumburl_200 = $result['thumbnail_200x200'];
$screen1_thumb = '';
$screen2_thumb = '';
$screen3_thumb = '';
$screen4_thumb = '';
$gameurl = $result['gameurl'];
$c = explode(",", $result['categories']);
// Remove comma delimiter and seperate categories into array in order to insert single category.
$category = $categories[$c[0]];
$slug = str_replace(array('-', '_'), '', $result['slug']);
// Download and save game file
$game_file = $pre . "_" . $slug . "." . GetFileExtension($result['gameurl']);
$game_url = '../swf/' . $game_file;
download_file($gameurl, $game_url);
$gamefile = 'swf/' . $game_file;
// Download and save 100x100 thumbnail pic
$smallthumb = $pre . "_" . $slug . "." . GetFileExtension($result['thumburl']);
$sm_thumb = '../img/' . $smallthumb;
download_file($thumburl, $sm_thumb);
$gamethumb = 'img/' . $smallthumb;
// Download and save 200x200 thumbnail pic
$gamethumb200 = '';
/*if(!empty($result['thumbnail_200x200']) || $type == 0) {
$t_url = str_replace("..", "", $result['thumbnail_200x200']);
$mediumthumb = $pre."_200_" . $slug . "." . GetFileExtension($result['thumbnail_200x200']);
$med_thumb = '../img/' . $mediumthumb;
download_file($t_url, $med_thumb);
$gamethumb200 = 'img/' . $mediumthumb;
} else {
$gamethumb200 = '';
}*/
/////////////////////////////////////////////////////////////////////////////////////////////////
// Remove code comment to download the game screen images - depends on availabilty in the feed //
/////////////////////////////////////////////////////////////////////////////////////////////////
/*
// Download and save screen 1 pic
if($result['screenthumburl1']) {
$t_url = str_replace("..", "", $result['screenthumburl1']);
$largethumb = $pre."_screen1_" . $slug . "." . GetFileExtension($result['screenthumburl1']);
$screen1_thumb = '../img/' . $largethumb;
download_file($t_url, $screen1_thumb);
}
// Download and save screen 2 pic
if($result['screenthumburl2']) {
$t_url = str_replace("..", "", $result['screenthumburl2']);
$largethumb = $pre."_screen2_" . $slug . "." . GetFileExtension($result['screenthumburl2']);
$screen2_thumb = '../img/' . $largethumb;
download_file($t_url, $screen2_thumb);
}
// Download and save screen 3 pic
if($result['screenthumburl3']) {
$t_url = str_replace("..", "", $result['screenthumburl3']);
$largethumb = $pre."_screen3_" . $slug . "." . GetFileExtension($result['screenthumburl3']);
$screen3_thumb = '../img/' . $largethumb;
download_file($t_url, $screen3_thumb);
}
// Download and save screen 4 pic
if($result['screenthumburl2']) {
$t_url = str_replace("..", "", $result['screenthumburl4']);
$largethumb = $pre."_screen4_" . $slug . "." . GetFileExtension($result['screenthumburl4']);
$screen4_thumb = '../img/' . $largethumb;
download_file($t_url, $screen4_thumb);
}
*/
$desc = yasDB_clean($result['description']);
// Prep for DB insert
$instructions = yasDB_clean($result['instructions']);
$keywords = $result['keywords'];
$keywords = yasDB_clean($keywords);
$gamename = yasDB_clean($gamename);
$gamefile = yasDB_clean($gamefile);
$gamethumb = yasDB_clean($gamethumb);
$height = $result['height'];
$width = $result['width'];
$query->close();
$query = yasDB_insert("INSERT INTO `games` (`id`, `title`, `description`, `instructions`, `keywords`, `file`, `height`, `width`, `category`, `plays`, `code`, `type`, `source`, `sourceid`, `thumbnail`, `thumbnail_200`, `screen1`, `screen2`, `screen3`, `screen4`) VALUES (NULL, '{$gamename}', '{$desc}', '{$instructions}', '{$keywords}', '{$gamefile}', '{$height}', '{$width}', {$category}, 0, '', 'SWF', 'PLAYTOMIC', {$gameid}, '{$gamethumb}', '{$gamethumb200}', '{$screen1_thumb}', '{$screen2_thumb}','{$screen3_thumb}','{$screen4_thumb}')", false);
if (!$query) {
echo 'Error updating Games database';
return false;
}
$query = yasDB_update("UPDATE `playtomicfeed` SET isinstalled = 1 WHERE id = '{$result['id']}'", false);
if (!query) {
echo 'Error updating $table database';
return false;
}
return true;
}
示例3: elseif
} elseif (strlen($post_text) > 30) {
$errormsg = 'Your text cannot be greater then 30 characters.';
} elseif (strlen($post_url) > 65) {
$errormsg = 'Your url cannot be greater then 65 characters.';
} elseif (strlen($post_reciprocal) > 65) {
$errormsg = 'Your Reciprocal link cannot be greater then 65 characters.';
} elseif ($passed) {
$checklink = new checkLink();
$response = $checklink->validateLink($post_reciprocal, $setting['siteurl']);
switch ($response) {
case LINKFOUND:
if ($setting['approvelinks'] == 'no') {
yasDB_insert("INSERT INTO links(`url`, `text`, `description`, `reciprocal`, `approved`, `email`)\r\r\n\t\t\t\t\t\t\tVALUES('{$post_url}', '{$post_text}', '{$post_desc}', '{$post_reciprocal}', 'no', '{$post_linkemail}')");
$successmsg = "Your link has been added. It will not show up until an admin approves the link. </br>An email will be sent on approval.";
} else {
yasDB_insert("INSERT INTO links(`url`, `text`, `description`, `reciprocal`, `approved`, `email`)\r\r\n\t\t\t\t\t\t\tVALUES('{$post_url}', '{$post_text}', '{$post_desc}', '{$post_reciprocal}', 'yes', '{$post_linkemail}')");
$successmsg = 'Your link has been added and approved pending a manual review by an admin.';
}
break;
case LINKNOTFOUND:
$errormsg = "We did not find our link on your web page " . $post_reciprocal . ". </br>Please make sure you have added it and it is a hard link and then resubmit the request.";
break;
case LINKFOUNDNOFOLLOW:
$errormsg = 'Our link was found but you have added a rel="nofollow" attribute. Please remove this and resubmit the request. </br>We use a scheduled back link checker. Please respect our link exchange.';
break;
case LINKDATAERROR:
$errormsg = 'We received an error while checking for our link on your web page ' . $post_reciprocal . '. </br>Please check that you typed the reciprocal link correctly and resubmit the request';
break;
}
// send email to admin notifying of the link request
$message = 'Link exchange request through ' . $setting['siteurl'] . "\r\n";
示例4: install_mgfgame
function install_mgfgame($gameid)
{
global $mysqli;
$query = yasDB_select("SELECT * FROM `mgffeed` WHERE `id` = '{$gameid}'", false);
$result = $query->fetch_array(MYSQLI_ASSOC);
// Download and save game file
if ($result['file']) {
$g_url = str_replace("..", "", $result['file']);
$game_file = basename($g_url);
$game_file = "mgf_" . $result['title'] . "." . GetFileExtension($result['file']);
$game_url = '../swf/' . $game_file;
download_file($g_url, $game_url);
} else {
return false;
}
// Download and save thumbnail pic
if ($result['thumbnail']) {
$t_url = str_replace("..", "", $result['thumbnail']);
$smallthumb = "mgf_" . $result['title'] . "." . GetFileExtension($result['thumbnail']);
$sm_thumb = '../img/' . $smallthumb;
download_file($t_url, $sm_thumb);
}
$desc = yasDB_clean($result['description']);
// Prep for DB insert
$gamename = yasDB_clean($result['title']);
$keywords = yasDB_clean($result['keywords']);
$gamefile = yasDB_clean(str_replace("../", "", $game_url));
$gamethumb = yasDB_clean(str_replace("../", "", $sm_thumb));
$gamethumb200 = yasDB_clean(str_replace("../", "", $med_thumb));
$height = intval($result['height']);
$width = intval($result['width']);
$instructions = yasDB_clean($result['instructions']);
$keywords = yasDB_clean($result['keywords']);
$category = $result['category'];
$review = yasDB_clean($result['review']);
$query->close();
$query = yasDB_insert("INSERT INTO `games` (`id`, `title`, `description`, `instructions`, `keywords`, `file`, `height`, `width`, `category`, `plays`, `code`, `type`, `source`, `sourceid`, `thumbnail`, `ismochi`, `thumbnail_200`, `screen1`, `screen2`, `screen3`, `screen4`, `review`, `active`) VALUES (NULL, '{$gamename}', '{$desc}', '{$instructions}', '{$keywords}', '{$gamefile}', {$height}, {$width}, {$category}, 0, '', 'SWF', 'OTHER', {$gameid}, '{$gamethumb}', 0, '{$gamethumb200}', '', '','','', '{$review}', 1)", false);
if (!$query) {
echo 'Error updating Games database';
return false;
}
$query = yasDB_update("UPDATE mgffeed SET installed = '1' WHERE id = {$result['id']}", false);
if (!$query) {
echo 'Error updating mgffeed database';
return false;
}
return true;
}
示例5: yasDB_clean
<div id="center-column">
<div class="top-bar">
<h1>Cpanel - Ads</h1>
<div class="breadcrumbs"><a href="index.php?act=ads" title="Manage Ads">Manage Ads</a></div>
</div><br />
<div class="select-bar">
<label>
<h3>Add Ads</h3>
</label>
</div>
<?php
if (isset($_POST['add_ads'])) {
$name = yasDB_clean($_POST['name']);
$code = stripslashes($_POST['code']);
yasDB_insert("INSERT INTO `ads` ( `id` , `name` , `code`) VALUES ('', '" . $name . "', '" . $code . "')", false);
echo 'Ad added!';
} else {
?>
<div class="table">
<img src="img/bg-th-left.gif" width="8" height="7" alt="" class="left" />
<img src="img/bg-th-right.gif" width="7" height="7" alt="" class="right" />
<form name="add_ads" method="post" action="index.php?act=addads">
<table class="listing form" cellpadding="0" cellspacing="0">
<tr>
<th class="full" colspan="2">Ads</th>
</tr>
<tr>
<td class="first" width="172"><strong>Name</strong></td>
<td class="last"><input type="text" name="name" maxlength="255" /></td>
</tr>
<tr class="bg">
示例6: yasDB_clean
$name = yasDB_clean($_POST['name']);
} else {
if (isset($_SESSION['user'])) {
$name = $_SESSION['user'];
} else {
$name = '';
}
}
if (remoteFileExists($tn) === true) {
$thumb = 'img/' . preg_replace('#\\W#', '', $title) . rand(0, pow(10, 5)) . '.' . get_file_extension($tn);
download_file($tn, $setting['sitepath'] . '/' . $thumb);
} else {
$thumb = '';
}
}
yasDB_insert("INSERT INTO games (title, description, category, thumbnail, keywords, file, height, width, type, active) values ('{$title}', '{$desc}', " . intval($_POST['category']) . ", '{$thumb}', '{$keywords}', '{$file}', {$height}, {$width}, '" . yasDB_clean($_POST['type']) . "', 1)", false);
if (isset($_SESSION['user'])) {
$user = yasDB_clean($_SESSION['user']);
//yasDB_update("UPDATE `user` set videos = videos +1 WHERE username = '$user'"); // add a video to users profile
}
echo '<center>Media successfully added!</font><br/>';
echo '<a href="index.php?">Click here to proceed</a></center>';
} else {
?>
<div class="table">
<form enctype="multipart/form-data" action="" method="post">
<table class="listing form" cellpadding="0" cellspacing="0">
<tr>
<th class="full" colspan="2">ADD YOUTUBE VIDEOS TO ALL PET HUMOR</th>
</tr>
<tr>
示例7: install_vascogame
function install_vascogame($gameid)
{
global $mysqli;
$query = yasDB_select("SELECT * FROM `vascogames` WHERE `id` = '{$gameid}'", false);
$result = $query->fetch_array(MYSQLI_ASSOC);
$categories = array('action games' => 2, 'adventure games' => 3, 'strategy games' => 10, 'skill games' => 10, 'puzzle games' => 1, 'arcade games' => 9, 'shooting games' => 5, 'sports games' => 4, 'misc games' => 7, 'car games' => 4);
//Strategy
// Download and save game file
if ($result['file']) {
$g_url = str_replace("..", "", $result['file']);
$game_file = basename($g_url);
$game_file = "vasco_" . preg_replace('#\\W#', '', $result['title']) . "." . GetFileExtension($result['file']);
$game_url = '../swf/' . $game_file;
download_file($g_url, $game_url);
} else {
return false;
}
// Download and save thumbnail pic
if ($result['thumbnail']) {
$t_url = str_replace("..", "", $result['thumbnail']);
$smallthumb = "vasco_" . preg_replace('#\\W#', '', $result['title']) . "." . GetFileExtension($result['thumbnail']);
$thumb = '../img/' . $smallthumb;
download_file($t_url, $thumb);
}
$desc = yasDB_clean($result['description']);
// Prep for DB insert
$gamename = yasDB_clean($result['title']);
$gamefile = yasDB_clean(str_replace("../", "", $game_url));
$gamethumb = yasDB_clean(str_replace("../", "", $thumb));
$height = $result['height'];
$width = $result['width'];
$c = $result['category'];
$category = $categories[$c];
$query->close();
if ($category == null || $category == '' || $category == 0) {
$category == 7;
}
$query = yasDB_insert("INSERT INTO `games` (`id`, `title`, `description`, `instructions`, `keywords`, `file`, `height`, `width`, `category`, `plays`, `code`, `type`, `source`, `sourceid`, `thumbnail`, `thumbnail_200`, `screen1`, `screen2`, `screen3`, `screen4`) VALUES (NULL, '{$gamename}', '{$desc}', '', '', '{$gamefile}', {$height}, {$width}, {$category}, 0, '', 'SWF', 'VASCOGAMES', {$gameid}, '{$gamethumb}', '', '', '','','')", false);
if (!$query) {
echo 'Error updating Games database';
return false;
}
$query = yasDB_update("UPDATE `vascogames` SET `installed` = 1 WHERE `id` = {$result['id']}", false);
if (!query) {
echo 'Error updating vascogames database';
return false;
}
return true;
}
示例8: yasDB_clean
">
<?php
exit;
}
if ($passed) {
$username = yasDB_clean($_POST["username2"]);
$password = md5(yasDB_clean($_POST["password"]));
$name = yasDB_clean($_POST["name"]);
$email = yasDB_clean($_POST["email"]);
$website = yasDB_clean($_POST["website"]);
$date = time() + 0 * 24 * 60 * 60;
$plays = 0;
$points = 0;
$stmt = yasDB_select("SELECT * FROM user WHERE username LIKE '{$username}'");
if ($stmt->num_rows == 0) {
$stmt = yasDB_insert("INSERT INTO `user` (username, password, name, email, website, plays, points, date) VALUES ('{$username}','{$password}','{$name}','{$email}','{$website}','{$plays}','{$points}', '{$date}')", false);
if ($stmt) {
?>
<script>alert("Registered: You can now log in");</script>
<META HTTP-EQUIV="Refresh" CONTENT="0; URL=<?php
echo $setting['siteurl'];
?>
">
<?php
exit;
} else {
$stmt->close();
?>
<script>alert("Action Failed");</script>
<META HTTP-EQUIV="Refresh" CONTENT="0; URL=<?php
echo $setting['siteurl'];
示例9: yasDB_admin
<div class="top-bar">
<h1>Cpanel - Insert Code</h1>
<div class="breadcrumbs"><a href="index.php?act=addmedia" title="Ad Media">Add Media</a> / <a href="index.php?act=managegames" title="Manage Games">Manage Games</a> / <a href="index.php?act=uploadgames" title="Upload Games">Upload Games</a> / <a href="index.php?act=brokenfiles" title="Broken Files">Broken Files</a></div>
</div><br />
<div class="select-bar">
<label>
<h3>Add Embed Code</h3>
</label>
</div>
<?php
if (isset($_POST['add'])) {
$title = yasDB_admin($_POST['title']);
$desc = yasDB_admin($_POST['description']);
$thumb = yasDB_admin($_POST['thumbnail']);
$code = yasDB_admin($_POST['code']);
yasDB_insert("INSERT INTO games (title, description, category, thumbnail, code, height, width, type) values ('{$title}', '{$desc}', '{$_POST['category']}', '{$thumb}', '{$code}', '', '', 'CustomCode')", false);
echo '<center>Embed Code successfully added!<br/><br/>';
echo '<a href="index.php?act=addmedia">Click here to proceed</a><center>';
} else {
?>
<div class="table">
<img src="img/bg-th-left.gif" width="8" height="7" alt="" class="left" />
<img src="img/bg-th-right.gif" width="7" height="7" alt="" class="right" />
<form enctype="multipart/form-data" action="" method="post">
<table class="listing form" cellpadding="0" cellspacing="0">
<tr>
<th class="full" colspan="2">Add Code</th>
</tr>
<tr>
<td class="first" width="172"><strong>Title</strong></td>
<td class="last"><input type="text" name="title" style="width:275px;"/></td>
示例10: array
print '<div id="status">error</div><div id="message"> No file was uploaded</div>';
break;
}
} else {
print '<div id="status">success</div><div id="message">Your Avatar has been updated.';
$avatarfile = 'useruploads/' . $filename;
$settings = array('w' => 100, 'h' => 100);
$image = new SimpleImage();
$image->load($setting['siteurl'] . 'avatars/' . $avatarfile);
if ($image->getHeight() > $image->getWidth()) {
$image->resizeToHeight(100);
} else {
$image->resizeToWidth(100);
}
$image->save($setting['sitepath'] . '/avatars/' . $avatarfile);
$avatar = 1;
$userid = yasDB_clean($_POST['userid']);
yasDB_update("UPDATE `user` SET useavatar='{$avatar}', avatarfile='{$avatarfile}' WHERE id='{$userid}'");
yasDB_insert("INSERT INTO `avatars` (userid, avatar) VALUES ('{$userid}', '{$avatarfile}')");
?>
<script type="text/javascript">
$('#avatarimage').attr("src", "<?php
echo $setting['siteurl'];
?>
/avatars/" + "<?php
echo $avatarfile;
?>
");
</script>
<?php
}
示例11: yasDB_insert
$message->setSubject('Contact message from ' . $username . ' through ' . $setting['sitename']);
// Set the From address with an associative array
$message->setFrom(array($email => $username));
// Set the To addresses with an associative array
$message->setTo(array($setting['email'] => 'Admin'));
$body = "<br/><b>Name:</b> " . $username . "<br/><br/><b>Return email:</b> " . $email . "<br/><br/><b>Reason:</b> Sent from Career Opportunities Form<br/><br/><b>Message:</b> " . $usermessage;
$message->setBody($body, 'text/html', 'iso-8859-2');
$message->attach(Swift_Attachment::fromPath($target)->setFilename($filename));
if ($mailer->send($message)) {
echo "Message sent, Thank You.";
} else {
echo "Message failed to send.";
}
}
} else {
yasDB_insert("INSERT INTO contact (name,email,message,created_date) VALUES('{$name}','{$email}','{$usermessage}','{$time}')");
echo "<h2>Thank You !</h2>";
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'To: Admin <' . $setting['email'] . '>' . "\r\n";
$headers .= 'From: ' . $username . ' <' . $username . '>' . "\r\n";
$subject = 'Contact message from ' . $username . ' through ' . $setting['sitename'];
$reason = yasDB_clean($_POST['reason']);
$message = "<br/><b>Name:</b> " . $username . "<br/><br/><b>Return email:</b> " . $email . "<br/><br/><b>Reason:</b> " . $reason . "<br/><br/><b>Message:</b> " . $usermessage;
if (@mail($setting['email'], $subject, stripslashes($message), $headers)) {
echo '<span style="color:red;">Message sent</span><br/><br/>';
} else {
echo '<span style="color:red;">Error sending message</span><br/><br/>';
}
}
} else {
示例12: elseif
</tr>
</table>
</div>
</form>
<?php
}
} elseif (isset($_POST['edit'])) {
if (empty($_POST['subject']) || empty($_POST['text'])) {
echo '<center>One or more fields was left empty.<br />';
echo '<a href="index.php?act=managetopics&edit=' . $_POST['id'] . '">Click here to go back</a></center>';
} else {
yasDB_update("UPDATE forumtopics SET subject = '" . yasDB_clean($_POST['subject']) . "', views = '{$_POST['views']}', date = '{$_POST['date']}', name = '{$_POST['name']}', text = '{$_POST['text']}', cat = '" . yasDB_clean($_POST['cat']) . "' where id = {$_POST['id']}", false);
$result = yasDB_select("SELECT id FROM forumtopics WHERE id = {$_POST['id']}");
if ($_POST['featured'] == 'yes') {
if ($result->num_rows == 0) {
yasDB_insert("INSERT INTO forumtopics (id) VALUES({$_POST['id']})");
}
} elseif ($_POST['featured'] == 'no') {
yasDB_delete("DELETE FROM forumtopics WHERE id = {$_POST['id']}");
}
echo '<p align="center">Topic Successfully edited!<br />';
if (!empty($_POST['m'])) {
echo '<center><a href="index.php?act=managetopics">Click here to proceed</a></p></center>';
} else {
echo '<center><a href="index.php?act=brokenfiles">Click here to proceed</a></p></center>';
}
}
} elseif (!empty($_GET['delete'])) {
$query = yasDB_select("SELECT id,name FROM forumtopics WHERE id = '{$_GET['delete']}'", false);
if ($query->num_rows == 0) {
echo '<center>You cannot delete a Topic that does not exist!<br />';
示例13: elseif
</table>
</div>
</form>
<?php
}
} elseif (isset($_POST['edit'])) {
if (empty($_POST['title']) || empty($_POST['thumbnail'])) {
echo '<center>One or more fields was left empty.<br />';
echo '<a href="index.php?act=managegames&edit=' . intval($_POST['id']) . '">Click here to go back</a></center>';
} else {
$pid = intval($_POST['id']);
yasDB_update("UPDATE games SET title = '" . yasDB_clean($_POST['title']) . "', description = '" . yasDB_clean($_POST['description']) . "', instructions = '" . yasDB_clean($_POST['instructions']) . "', code = '" . yasDB_clean($_POST['gamecode']) . "',keywords = '" . yasDB_clean($_POST['keywords']) . "', category = " . intval($_POST['category']) . ", height = " . intval($_POST['gameheight']) . ", width = " . intval($_POST['gamewidth']) . ", type = '" . yasDB_clean($_POST['type']) . "', thumbnail = '" . yasDB_clean($_POST['thumbnail']) . "', file = '" . yasDB_clean($_POST['file']) . "', active=" . intval($_POST['active']) . ", review='" . yasDB_clean($_POST['review']) . "' where id = {$pid}", false);
$result = yasDB_select("SELECT gameid FROM featuredgames WHERE gameid = {$pid}");
if ($_POST['featured'] == 'yes') {
if ($result->num_rows == 0) {
yasDB_insert("INSERT INTO featuredgames (gameid) VALUES({$pid})");
}
} elseif ($_POST['featured'] == 'no') {
yasDB_delete("DELETE FROM featuredgames WHERE gameid = {$pid}");
}
echo '<p align="center">File Successfully edited!<br />';
if (!empty($_POST['m'])) {
if (isset($_SESSION['editurl']) && $_SESSION['editurl'] != '') {
$eurl = $_SESSION['editurl'];
} else {
$eurl = 'index.php?act=managegames';
}
echo '<center><a href="' . $eurl . '">Click here to proceed</a></p></center>';
$_SESSION['editurl'] = '';
} else {
echo '<center><a href="index.php?act=brokenfiles">Click here to proceed</a></p></center>';
示例14: yasDB_clean
<h1>Cpanel - Links Exchange</h1>
<div class="breadcrumbs"><a href="index.php?act=links">Links</a></div>
</div><br />
<div class="select-bar">
<label>
<h3>Add Link</h3>
</label>
</div>
<?php
if (isset($_POST['add_link'])) {
$url = yasDB_clean($_POST['url']);
$des = yasDB_clean($_POST['description']);
$text = yasDB_clean($_POST['text']);
$reciprocal = yasDB_clean($_POST['reciprocal']);
$email = yasDB_clean($_POST['email']);
yasDB_insert("INSERT INTO links ( `id` , `url` , `text`, `description`, `email`, `in`, `out`, `reciprocal`, `approved`) VALUES ('', '" . $url . "', '" . $text . "', '" . $des . "', '" . $email . "', '0', '0', '" . $reciprocal . "', 'yes')");
echo '<center>Link added!<br>
<a href="index.php?act=addlink" />Continue</a></center>';
} else {
?>
<div class="table">
<img src="img/bg-th-left.gif" width="8" height="7" alt="" class="left" />
<img src="img/bg-th-right.gif" width="7" height="7" alt="" class="right" />
<form name="add_link" method="post" action="index.php?act=addlink">
<table class="listing form" cellpadding="0" cellspacing="0">
<tr>
<th class="full" colspan="2">Add A Link</th>
</tr>
<tr>
<td class="first" width="172"><strong>Title</strong></td>
<td class="last"><input type="text" name="text" maxlength="255" /></td>
示例15: session_start
<?php
session_start();
include "db_functions.inc.php";
if (isset($_SESSION['userid'])) {
$gameid = yasDB_clean($_GET['gid']);
$userid = yasDB_clean($_SESSION['userid']);
$query = yasDB_select("SELECT `gameid` FROM `favourite` WHERE `userid` = {$userid} && `gameid` = {$gameid}");
if ($query->num_rows == 0) {
yasDB_insert("INSERT INTO `favourite` (userid, gameid) VALUES ({$userid}, {$gameid})");
}
}