function sendLoginDetails($email) { global $sitename; global $logo; $query = MYSQL_QUERY("SELECT `Username`,`Password` FROM `ChallengeMembers` WHERE `Email` = '" . $email . "' ") or die(MYSQL_ERROR()); if ($query) { if (MYSQL_NUM_ROWS($query)) { while ($row = MYSQL_FETCH_ARRAY($query)) { $userpassword = $row['Password']; $username = $row['Username']; } /*send email*/ include 'email_class.php'; $em = new EmailTemplate(); $subject = ucfirst($sitename) . " Login Details"; $headers = "From: " . ucwords($sitename) . " <*****@*****.**> \r\n" . 'X-Mailer: PHP/' . phpversion(); $headers .= 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $email_message = $username . ",<br /><br /> Thank you for your interest in joining our challenges.\n\t\t\t\t\t\t\t\t\t<br /><br />\n\t\t\t\t\t\t\t\t\tThe following are your login data:\n\t\t\t\t\t\t\t\t\t<br>\n\t\t\t\t\t\t\t\t\tUsername : <b>" . $username . "</b><br />\n\t\t\t\t\t\t\t\t\tPassword : <b>" . $userpassword . "</b>\n\t\t\t\t\t\t\t\t\t<br /><br />\n\t\t\t\t\t\t\t\t\tThank you.<br />\n\t\t\t\t\t\t\t\t\t<b>" . $sitename . "</b>"; $emailmessage = $em->get($logo, $sitename, $email_message); /*first send to guest */ $sentmail = mail($email, $subject, $emailmessage, $headers); /*end of send email*/ return "OK"; } else { return $email . "not found in database."; } } else { return "Email not found in database."; } }
function CheckIfVerified($code) { $query = MYSQL_QUERY("SELECT `ChallengeMemberId` FROM `ChallengeMembers` WHERE VerificationCode = '" . $code . "' ") or die(MYSQL_ERROR()); if (MYSQL_NUM_ROWS($query) > 0) { while ($row = MYSQL_FETCH_ARRAY($query)) { $member_id = $row['ChallengeMemberId']; $result = MYSQL_QUERY("UPDATE `ChallengeMembers` SET `Verified` = '1' WHERE `ChallengeMemberId` = '" . $member_id . "' ") or die(MYSQL_ERROR()); } return true; } else { return false; } }
function getSponsoredChallengesClosedCount($challenger_id){ $query = MYSQL_QUERY("SELECT COUNT(*) AS total FROM `Challenges` WHERE `CompanyId` = '".$sponsor_id."' AND `Solved` = '1' ") OR DIE(MYSQL_ERROR()); if($query){ if(MYSQL_NUM_ROWS($query) > 0){ while($row = MYSQL_FETCH_ARRAY($query)){ $total = $row['total']; } return $total; }else{ return 0; } }else{ return 0; } }
<?php } if ($_GET['want'] == 'login') { ?> <title>تسجيل الدخول كـ : مستخدم</title> <div class="container"> <div class="w3-animate-bottom w3-padding-16" style="padding: 0px 8px; background: #F8F8F8;"> <h2 class="w3-padding-16">تسجيل الدخول كـ : مستخدم</h2> <?php if (isset($_POST['goL'])) { $eml = htmlspecialchars($_POST['email']); $pas = htmlspecialchars($_POST['pass']); if (empty($eml) || empty($pas)) { $error = 'أرجاء ملئ جميع الحقول'; } else { $sql = mysql_query("SELECT * FROM users WHERE u_email='" . $eml . "' AND u_password='******' ") or die(MYSQL_ERROR()); $row = mysql_fetch_assoc($sql); if ($eml == $row['u_email'] and $pas == $row['u_password'] and $row['u_type'] == 'consumer') { $_SESSION['uid'] = $row['u_id']; $_SESSION['uname'] = $row['u_name']; $_SESSION['uemail'] = $row['u_email']; $_SESSION['upass'] = $row['u_password']; $_SESSION['uphone1'] = $row['u_phone1']; $_SESSION['uphone2'] = $row['u_phone2']; $_SESSION['ucountry'] = $row['u_country']; $_SESSION['ustock'] = $row['u_stock']; $_SESSION['utype'] = $row['u_type']; echo '<meta http-equiv="refresh" content="3;">'; $success = 'You Have Been Successfully Logged In, Redirecting...'; } else { $error = 'البريد الإلكتروني أو كلمة المرور ليست صحيحة';
//#now handle spaces in between words //$keyword_query = split(" ", $KEYWORDS); //$q=""; //while(list($key, $val)=each($keyword_query)) //{ // if($val<>" " and strlen($val) >0) // { // $q.= "name like '%$val%' or "; // } //} //$q=substr($q,0,(strlen($q)-3));#the string ends upwtih an extra OR tagged on at the end which we don't want, this line erases it $COND = $CATEGORY . $COMPARE . "{$SCORE}"; //$big_query = "SELECT * FROM ORGANIZATION WHERE // $q // AND name = '".$NAME."' // "; echo '<u><h3>Business Name Results</h3><u>'; $name_query = "SELECT * FROM ORGANIZATION WHERE name = '" . $NAME . "'"; $name_data = @MYSQL_QUERY($name_query) or die("Query failed with error: " . MYSQL_ERROR()); while ($row = MYSQL_FETCH_ARRAY($name_data)) { echo " Name: {$row['name']}, City: {$row['city']}, Province: {$row['province']}, Industry: {$row['industry']}<br>"; } echo '<u><h3>Results for your category criteria</h3><u>'; $category_query = "SELECT * FROM RATING WHERE {$COND}"; $category_data = @MYSQL_QUERY($category_query) or die("Query failed with error: " . MYSQL_ERROR()); while ($row = MYSQL_FETCH_ARRAY($category_data)) { echo "{$row['orgname']}<br>"; } echo '<a href="my_page.php">Go Back</a>'; include 'db_close.php'; include 'footer.php';
<form class="w3-container w3-card-4 w3-white" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?> " > <?php if (isset($_POST['go'])) { $idI = htmlspecialchars(mysql_real_escape_string($_POST['u_id'])); $insert = mysql_query("Insert into `workspace` VALUES (NULL, '" . htmlspecialchars($_POST['name']) . "', '" . htmlspecialchars($_POST['des']) . "', '" . htmlspecialchars($_POST['privacy']) . "', '{$idI}')"); if ($insert) { $sql = mysql_query("SELECT * FROM `workspace` WHERE w_u_id='{$idI}'") or die(MYSQL_ERROR()); $row1 = mysql_fetch_assoc($sql); $_SESSION['wid'] = $row1['w_id']; $_SESSION['wname'] = $row1['w_name']; echo "<meta http-equiv='refresh' content='0;URL=http://localhost/EasyDev/u/6/" . $_SESSION['wname'] . "'>"; } else { echo MYSQL_ERROR(); } } ?> <input type="hidden" name="u_id" value="<?php echo $id; ?> " /> <h2>Input</h2> <br> <div class="w3-group"> <input id="workspace" name="name" class="w3-input" type="text" style="width:95%" required=""> <label for="workspace" class="w3-label">Workspace Name</label> </div> <div class="w3-group"> <textarea id="textarea" name="des" class="w3-input" style="width:95%" required=""></textarea>
function JBXM_list_xml_schemas() { $sql = "SELECT * From xml_export_schemas "; $result = JB_mysql_query($sql) or die(MYSQL_ERROR()); ?> <table border=0 cellSpacing="1" cellPadding="3" bgColor="#d9d9d9" > <tr bgColor="#eaeaea"> <td><b>Schema Id</b></td> <td><b>Schema Name</b></td> <td><b>Type</b></td> <td><b>Action</b></td> <td><b>Description</b></td> </tr> <?php while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { ?> <tr bgcolor="<?php echo $row['schema_id'] == $_REQUEST['schema_id'] && $_REQUEST['schema_id'] ? '#FFFFCC' : '#ffffff'; ?> "> <td><?php echo $row['schema_id']; ?> </td> <td><?php echo $row['schema_name']; ?> </td> <td>Jobs<?php //echo $row['form_id']; ?> </td> <td nowrap><a href="<?php echo htmlentities($_SERVER['PHP_SELF']); ?> ?&schema_id=<?php echo $row['schema_id']; ?> ">Edit</a> | <a href="<?php echo htmlentities($_SERVER['PHP_SELF']); ?> ?config=yes&form_id=<?php echo $row['form_id']; ?> &schema_id=<?php echo $row['schema_id']; ?> ">Configure XML Structure</a> </td> <td><?php echo jb_escape_html($row['description']); ?> </td> </tr> <?php } ?> </table> <?php }
$files = "No language files were found in " . $florensia->language_abs . "/{$langkey}"; } $content .= "<div><table style='width:100%'><tr><td style='width:50%'>{$dbentrys}</td><td>{$files}</td></tr></table></div>"; } $florensia->output_page($content); } elseif (isset($_GET['db']) && $flolang->lang[$_GET['lang']]) { if (!$flouser->get_permission("mod_language", $_GET['lang'])) { $florensia->output_page($flouser->noaccess()); } $query = "SELECT " . mysql_real_escape_string($dbtables['flobase_' . $_GET['db']]) . ", name_" . mysql_real_escape_string($_GET['lang']) . ", name_en FROM " . mysql_real_escape_string("flobase_" . $_GET['db']); if ($querylangfile = MYSQL_QUERY($query)) { if (isset($_POST['save'])) { //normal "update" while ($langfile = MYSQL_FETCH_ARRAY($querylangfile)) { if (!MYSQL_QUERY("UPDATE " . mysql_real_escape_string('flobase_' . $_GET['db']) . " SET name_" . mysql_real_escape_string($_GET['lang']) . "='" . mysql_real_escape_string(strip_tags($_POST[$langfile[$dbtables['flobase_' . $_GET['db']]]])) . "' WHERE " . $dbtables['flobase_' . $_GET['db']] . "='" . $langfile[$dbtables['flobase_' . $_GET['db']]] . "'")) { $content .= "<div class='warning'>ERROR while saving: <br /><b>" . $langfile[$dbtables['flobase_' . $_GET['db']]] . "</b><br />" . $florensia->escape($_POST[$langfile[$dbtables['flobase_' . $_GET['db']]]]) . "<br /><span class='small'>" . MYSQL_ERROR() . "</span></div>"; $error = true; } } if (!$error) { $content .= "<div class='successful' style='text-align:center;'>Successfully updated</div>"; } else { $content .= "<div class='warning' style='text-align:center;'>An error occurred while updating.</div>"; } $querylangfile = MYSQL_QUERY($query); } $savelangfile = "<div style='text-align:right; margin-bottom:2px;'><input type='submit' name='save' value='Save this language file'></div>"; $content .= "\n\t\t\t<div class='subtitle' style='margin-bottom:10px;'><a href='{$florensia->root}/admincp.php'>AdminCP</a> > <a href='{$florensia->root}/adminlang.php'>Languages</a> > " . $florensia->escape($_GET['db']) . " (" . $flolang->lang[$_GET['lang']]->languagename . ")</div>\n\t\t\t<div><form action='" . $florensia->escape($_SERVER['REQUEST_URI']) . "' method='post'>\n\t\t\t{$savelangfile}\n\t\t"; while ($langfile = MYSQL_FETCH_ARRAY($querylangfile)) { $content .= "\n\t\t\t\t<div class='subtitle' style='margin-bottom:2px;'>" . $langfile[$dbtables['flobase_' . $_GET['db']]] . "</div>\n\t\t\t\t<div class='bordered' style='margin-bottom:2px;'><span class='small'>" . $langfile['name_en'] . "</span></div>\n\t\t\t\t<div class='bordered' style='margin-bottom:10px; text-align:center;'><textarea name='" . $langfile[$dbtables['flobase_' . $_GET['db']]] . "' style='width:98%; height:60px;'>" . $langfile['name_' . $_GET['lang']] . "</textarea></div>\n\t\t\t"; }
CURLOPT_USERAGENT => '' ), $max_redirect); $mychallenge_api = "http://mychallenge.com/api/upload.php?type=profile&url=".$target_path; $client_file->get($mychallenge_api); $result = $client_file->currentResponse('body'); $file_arr = json_decode($result,true); $error = 0; if (!$file_arr['error']){ $new_avatar_filename = $logo = $file_arr['url'];; $update_avatar = MYSQL_QUERY("UPDATE `ChallengeMembers` SET Photo = '".$new_avatar_filename."' WHERE ChallengeMemberId = '".$_SESSION['ChallengeMemberId']."' ") OR DIE(MYSQL_ERROR()); }else{ $error_msg = "Mychallenge API error."; $new_avatar_filename = $target_path; $update_avatar = MYSQL_QUERY("UPDATE `ChallengeMembers` SET Photo = '".$new_avatar_filename."' WHERE ChallengeMemberId = '".$_SESSION['ChallengeMemberId']."' ") OR DIE(MYSQL_ERROR()); } } else{ $error_msg = "There was an error uploading the file, please try again!"; } } if($update_query){ $save_result = '<div class="message-success"><span>You successfully updated your profile. '.$error_msg.'</span></div>'; }
#this file adds a rating to an organization include "header.php"; include "db_connect.php"; #variables $ID = $_POST["id"]; $SOCIAL_VALUES = $_POST["social_values"]; $QUALITY_WORKPLACE = $_POST["quality_of_workplace"]; $PROFESSIONALISM_MANAGEMENT = $_POST["professionalism_management"]; $FAIRNESS_EVAL = $_POST["fairness_eval"]; $OPENNESS_WITH_STAFF = $_POST["openness_with_staff"]; $COOPERATION_AMONG_EMPLOYEES = $_POST["cooperation_employees"]; $ENCOURAGE_INNOVATION = $_POST["encourage_innovation"]; $REWARD_SYSTEM = $_POST["rewards"]; $ACCEPTANCE_IDEAS = $_POST["acceptance_ideas"]; $WAGES = $_POST["fair_wages"]; $RECOGNITION_ACHIEVEMENT = $_POST["recognition_achievement"]; $QUALITY_BENEFITS = $_POST["benefits"]; $SUPPORT_EMPLOYEES = $_POST["support"]; $LEVEL_STRESS = $_POST["stress"]; $LEVEL_COLLEGIALITY = $_POST["collegiality"]; $LEVEL_BUREAUCRACY = $_POST["bureaucracy_red_tape"]; $POSSIBILITY_ADVANCEMENT = $_POST["advancement"]; $SUPPORT_FAMILY = $_POST["family_support"]; #/variables #statements to insert into the database $statement = "UPDATE rating set social_values={$SOCIAL_VALUES}, quality_of_workplace= {$QUALITY_WORKPLACE}, professionalism_management={$PROFESSIONALISM_MANAGEMENT},\r\n\t\t\t\t\t\tfairness_eval={$FAIRNESS_EVAL}, openness_with_staff={$OPENNESS_WITH_STAFF}, cooperation_employees= {$COOPERATION_AMONG_EMPLOYEES},\r\n\t\t\t\t\t\tencourage_innovation={$ENCOURAGE_INNOVATION}, rewards={$REWARD_SYSTEM}, acceptance_ideas={$ACCEPTANCE_IDEAS}, fair_wages={$WAGES},\r\n\t\t\t\t\t\trecognition_achievement={$RECOGNITION_ACHIEVEMENT}, benefits={$QUALITY_BENEFITS}, support={$SUPPORT_EMPLOYEES},\r\n\t\t\t\t\t\tstress={$LEVEL_STRESS}, collegiality = {$LEVEL_COLLEGIALITY}, bureaucracy_red_tape={$LEVEL_BUREAUCRACY}, advancement={$POSSIBILITY_ADVANCEMENT},\r\n\t\t\t\t\t\tfamily_support={$SUPPORT_FAMILY} WHERE id = {$ID}"; $result = MYSQL_QUERY($statement) or die("Error : " . MYSQL_ERROR()); echo "Rating accepted!<br>\r\n\tIf you would like to update your comments their id number is" . $ID; echo "<br><a href='my_page.php'>return to home page</a>"; include "db_close.php"; include "footer.php";
<?php include "header.php"; include "db_connect.php"; $NET_NAME = $_POST["names"]; $query = MYSQL_QUERY("DELETE FROM users WHERE net_name like '{$NET_NAME}'") or die(MYSQL_ERROR()); echo "User successfuly deleted!<br>\r\n\t<a href='my_page.php'>return to your main page</a>"; include "db_close.php"; include "footer.php";
function insertfeedback($user_id, $item_id) { $sql = "insert into reviews set user_id='" . $user_id . "', item_id='" . $item_id . "',\n\t\t \treviews='" . mysql_real_escape_string($_POST['comment']) . "',rating='" . $_POST['ratng2'] . "', accuracy='" . $_POST['ratng1'] . "', communication='" . $_POST['ratng'] . "',date=now()"; $res = mysql_query($sql) or die(MYSQL_ERROR()); return mysql_affected_rows(); }
function jb_list_xml_import_feeds() { $sql = "SELECT * FROM xml_import_feeds"; $result = JB_mysql_query($sql) or die(MYSQL_ERROR()); $feed_id = (int) $_REQUEST['feed_id']; if (mysql_num_rows($result) > 0) { ?> <small>(XML Import patch v2.0)</small> <table border=0 cellSpacing="1" cellPadding="3" bgColor="#d9d9d9" > <tr bgColor="#eaeaea"> <td><b>Feed Id</b></td> <td><b>Feed Name</b></td> <td><b>Description</b></td> <td><b>IP Allow</b></td> <td><b>Status</b></td> <td><b>Pickup Method</b></td> <td><b>Action</b></td> </tr> <?php while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { if (!$_REQUEST['feed_id'] || $_REQUEST['feed_id'] == $row['feed_id']) { $row['status'] = jb_xml_import_update_status($row); } ?> <tr bgcolor="<?php echo $row['feed_id'] == $_REQUEST['feed_id'] ? '#FFFFCC' : '#ffffff'; ?> "> <td><?php echo $row['feed_id']; ?> </td> <td><a href="<?php echo htmlentities($_SERVER['PHP_SELF']); ?> ?action=edit_feed&feed_id=<?php echo $row['feed_id']; ?> "><?php echo jb_escape_html($row['feed_name']); ?> </a></td> <td><?php echo jb_escape_html($row['description']); ?> </td> <td><?php echo jb_escape_html($row['ip_allow']); ?> </td> <td><?php //echo jb_escape_html($row['status']); if ($row['status'] == 'READY') { echo '<font color="green"><b>Ready to import</b></font>'; } if ($row['status'] == 'NEW_SAMPLE') { echo '<br><a href="' . $_SERVER['PHP_SELF'] . '?action=setupstruct&feed_id=' . jb_escape_html($row['feed_id']) . '" style="color:maroon; font-weight: bold;">Please setup feed structure!</a>'; } if ($row['status'] == 'SET_FIELDS') { echo '<br><a href="' . $_SERVER['PHP_SELF'] . '?action=setupfields&feed_id=' . jb_escape_html($row['feed_id']) . '" style="color:maroon; font-weight: bold;">Please map your fields!</a>'; } ?> </td> <td><?php echo jb_escape_html($row['pickup_method']); ?> </td> <td nowrap><?php if ($row['status'] == 'READY' && $row['pickup_method'] != 'POST') { echo '<A href="' . htmlentities($_SERVER['PHP_SELF']) . '?action=fetch&feed_id=' . $row['feed_id'] . '">Fetch'; } if ($row['status'] == 'READY' && $row['pickup_method'] != 'POST') { echo '</A> |'; } ?> <a href="<?php echo htmlentities($_SERVER['PHP_SELF']); ?> ?action=setupstruct&feed_id=<?php echo jb_escape_html($row['feed_id']); ?> ">Set Structure</a> | <a href="<?php echo $_SERVER['PHP_SELF']; ?> ?action=setupfields&feed_id=<?php echo jb_escape_html($row['feed_id']); ?> ">Map Fields</a> | <a href="<?php echo htmlentities($_SERVER['PHP_SELF']); ?> ?action=edit_feed&feed_id=<?php echo $row['feed_id']; ?> "><img border=0 src='edit.gif'></a> <a href="<?php echo htmlentities($_SERVER['PHP_SELF']); ?> ?action=del_feed&feed_id=<?php echo $row['feed_id']; ?> " onclick="if (!confirmLink(this, 'Delete, are you sure?')) return false;" ><img border=0 src="delete.gif" ></a><br> <?php if ($row['status'] == 'READY' && $row['pickup_method'] == 'POST') { if ($row['feed_key'] != '') { $key = '&key=' . $row['feed_key']; } ?> Pickup URL: <input style='font-size:11px' onfocus="this.select()" type="text" size='70' value="<?php echo JB_escape_html(JB_BASE_HTTP_PATH . 'jb-xml-pickup.php?feed_id=' . $row['feed_id'] . $key); ?> "> <?php } ?> </td> </tr> <?php $row = array(); } } ?> </table> <?php }
<?php include 'header.php'; include 'db_connect.php'; $COMMENTS = $_POST['comments']; $COMPANY = $_POST["companyname"]; $AUTHORITY = $_POST["authority"]; $statement = "INSERT INTO supervisor (authority, company_name) " . "VALUES ('{$AUTHORITY}', '{$COMPANY}')"; $query = MYSQL_QUERY($statement) or die("Sup Query failed with error: " . MYSQL_ERROR()); $ID = MYSQL_INSERT_ID(); $statement = "INSERT INTO supervisor_comments (id_num, comments, orgname)\r\n\tVALUES ('" . $ID . "', '" . $COMMENTS . "', '" . $COMPANY . "')"; $query = MYSQL_QUERY($statement) or die("Sup Comm Query failed with error: " . MYSQL_ERROR()); ?> Your comments will be reviewed by a system administrator and removed if deemed inappropriate.<br> If you would like to update your comments their ID# is <?php echo $ID; ?> <a href='my_page.php'>my page</a>" <?php include 'footer.php'; include 'db_close.php';
if (isset($_POST['go1'])) { $uemail = mysql_real_escape_string($_POST['email']); $upass = mysql_real_escape_string($_POST['pass']); if (!$uemail || !$upass) { //التأكد ان المدخلات فارغة die('<meta http-equiv="refresh" content="2;">enter all fields'); } else { $valEmail = mysql_real_escape_string($_POST['email']); $level_check = mysql_query("SELECT * FROM users where u_email ='" . $valEmail . "'"); $rowLevel = mysql_fetch_array($level_check); if ($rowLevel['u_level'] == 0) { echo ' <b>If you have registered ..You have to activate the account</b>'; } else { //التأكد المدخلات صحيحة $sql = mysql_query("SELECT * FROM users WHERE u_email='" . $uemail . "' AND u_pass='******' ") or die(MYSQL_ERROR()); $row = mysql_fetch_assoc($sql); if (!$row) { die('Login Failed!!<br />Try Again... <meta http-equiv="refresh" content="3;">'); } } if ($uemail == $row['u_email'] || $upass == $row['u_pass']) { $_SESSION['id'] = $row['u_id']; $_SESSION['ufname'] = $row['u_fname']; $_SESSION['ulname'] = $row['u_lname']; $_SESSION['uemail'] = $row['u_email']; $_SESSION['upass'] = $row['u_pass']; $_SESSION['country'] = $row['u_country']; $_SESSION['address'] = $row['u_address']; $_SESSION['city'] = $row['u_city']; $_SESSION['membership'] = $row['u_membership'];
<?php include 'header.php'; include 'db_connect.php'; $PRICE = $_POST['newprice']; $statement = "UPDATE ad_price SET price = {$PRICE}"; $query = MYSQL_QUERY($statement) or die("query error: " . MYSQL_ERROR()); echo 'Prices updated.'; include 'footer.php'; include 'db_close.php'; ?>
$florensia->sitetitle("Languages"); $dbtables = array('flobase_guides_categories' => 'id', 'flobase_item_categories' => 'id', 'flobase_item_columns' => 'id', 'flobase_item_effect' => 'effectid', 'flobase_item_types' => 'itemtypeid', 'flobase_landclass' => 'classid', 'flobase_menubar' => 'id', 'flobase_npc_columns' => 'id', 'flobase_seaclass' => 'classid', 'flobase_seal_optionlang' => 'sealid', 'flobase_skill_columns' => 'id'); $lang = "nl"; $copylang = "de"; $error = false; $content = "<div class='subtitle'>Adding new language \"{$lang}\"...</div>"; $content .= "<div class='bordered'>Working on DB...</div>"; foreach ($dbtables as $dbtable => $copykey) { $content .= "<div>{$dbtable} with {$copykey}</div>"; MYSQL_QUERY("ALTER TABLE {$dbtable} ADD name_{$lang} TEXT NOT NULL;"); $querycopy = MYSQL_QUERY("SELECT {$copykey}, name_{$copylang} FROM {$dbtable}"); while ($copy = MYSQL_FETCH_ARRAY($querycopy)) { if (!MYSQL_QUERY("UPDATE {$dbtable} SET name_{$lang}='" . mysql_real_escape_string($copy['name_' . $copylang]) . "' WHERE {$copykey}='" . $copy[$copykey] . "'")) { $content .= "<div class='warning'>{$dbtable}: " . MYSQL_ERROR() . "</div>"; $error = true; } } } $content .= "<div>Copying language files (flobase_languagefiles)</div>"; MYSQL_QUERY("ALTER TABLE flobase_languagefiles ADD lang_{$lang} TEXT NOT NULL, ADD lang_{$lang}_flag TINYINT( 1 ) NOT NULL DEFAULT '1';"); $querycopy = MYSQL_QUERY("SELECT varname, lang_{$copylang} FROM flobase_languagefiles"); while ($copy = MYSQL_FETCH_ARRAY($querycopy)) { if (!MYSQL_QUERY("UPDATE flobase_languagefiles SET lang_{$lang}='" . mysql_real_escape_string($copy['lang_' . $copylang]) . "' WHERE varname='" . $copy['varname'] . "'")) { $content .= "<div class='warning'>flobase_languagefiles: " . MYSQL_ERROR() . "</div>"; $error = true; } } if (!$error) { $content .= "<div style='margin-top:10px;' class='successful'>Great! No errors occoured.</div>"; } $florensia->output_page($content);
<?php error_reporting(0); include 'config/conreglog.php'; $p_id = @$_GET['id']; $sql = mysql_query("SELECT * FROM products WHERE id ='" . $p_id . "'") or die(MYSQL_ERROR()); $row_title = mysql_fetch_assoc($sql); ?> <title><?php echo $row_title['name']; ?> </title> <?php include 'head.php'; include "file/header.php"; $p_id = $_GET['id']; if (isset($_GET['id'])) { $get_pro_d = mysql_query("SELECT * FROM products WHERE id ='" . $p_id . "'"); $row_pro_d = mysql_fetch_array($get_pro_d); } ?> <div class="w3-row w3-container w3-center w3-padding-64 "> <div class="w3-half w3-center white" style="width:100%;" > <div class="w3-col l12 "> <div class="panel" > <div class="panel_title text-r"><h1><?php echo $row_pro_d['name']; ?> </h1></div> <div class="panel_body">
//any MySQL table or any MySQL database on your server //DEFINE SQL QUERY: //edit this to suit your needs /* Leave the connection info below as it is: just edit the above. (Editing of code past this point recommended only for advanced users.) */ //create MySQL connection $Connect = @MYSQL_CONNECT($DB_Server, $DB_Username, $DB_Password) or die("Couldn't connect to MySQL:<br>" . MYSQL_ERROR() . "<br>" . MYSQL_ERRNO()); //select database $Db = @MYSQL_SELECT_DB($DB_DBName, $Connect) or die("Couldn't select database:<br>" . MYSQL_ERROR() . "<br>" . MYSQL_ERRNO()); //execute query $result = @MYSQL_QUERY($sql, $Connect) or die("Couldn't execute query:<br>" . MYSQL_ERROR() . "<br>" . MYSQL_ERRNO()); //if this parameter is included ($w=1), file returned will be in word format ('.doc') //if parameter is not included, file returned will be in excel format ('.xls') if (isset($w) && $w == 1) { $file_type = "msword"; $file_ending = "doc"; } else { $file_type = "vnd.ms-excel"; $file_ending = "xls"; } //header info for browser: determines file type ('.doc' or '.xls') HEADER("Content-Type: application/{$file_type}"); HEADER("Content-Disposition: attachment; filename=database_dump.{$file_ending}"); HEADER("Pragma: no-cache"); HEADER("Expires: 0"); /* Start of Formatting for Word or Excel */