$detailcheck = mysql_fetch_assoc($convus); // $count="0"; if ($repeatinguser == $detailcheck["username"]) { $count = "SELECT MAX(id) FROM `tbl`"; $maximum = mysql_query($count); $v = mysql_fetch_row($maximum); $id_value = $v[0]; $id_value++; $repeatinguser = "******"; $ups = "INSERT INTO `tbl` (`id`, `name`, `email`, `username`,`gender`, `mobile`, `encpassword`,`uniqueid`,`role_id`)\n\t\t VALUES (NULL,'{$name}','{$email}','{$repeatinguser}','{$gender}', '{$mobile}', '{$encpassword}','','0')"; $convus = mysql_query($ups); header('Refresh:10; url=login.php'); $var = "Successfully registered"; $output = "an email has been sent to your registered email-id" . "<br>" . "Plz log in with the same credentials" . "<br>" . "the page is being transferred plz wait" . "<br>" . "thankyou for registration"; } else { $resource = insertdata($name, $username, $email, $gender, $mobile, $encpassword); if ($resource) { header('Refresh:10; url=login.php'); $var = "Successfully registered"; $output = "an email has been sent to your registered email-id" . "<br>" . "Plz log in with the same credentials" . "<br>" . "the page is being transferred plz wait" . "<br>" . "thankyou for registration"; } else { header('Refresh:2; url=registration.php'); $var = "Could not process"; } } if ($var === "Successfully registered") { $to = $email; $subject = "successfully registered to innotraining"; $msg = "your username for login is:{$repeatinguser}<br/>"; $from = "From :innotrainning@drupal.com "; mail($to, $subject, $msg, $from);
<?php include '../includes/dbutil.php'; include 'includes/validation.php'; $parameters = array('user_id', 'post_id', 'post_type'); $is_parameter_available = is_post_parameters_exists($parameters); if ($is_parameter_available == 0) { extract($_POST); $count = get_row_count_by_condition("users", "WHERE upid=" . $user_id); if ($count > 0) { $usrData = array('user_id' => $user_id, 'post_id' => $post_id, 'post_type' => $post_type); //$pcount=get_row_count_by_condition("post_add","WHERE post_id=".$_SESSION['last_id']." and upid=".$_SESSION['upid']); insertdata($usrData, 'short_lists'); //$result['post_id'] = mysql_insert_id(); $result['status'] = 'success'; echo json_encode($result); } else { echo json_encode(array("status" => "failed")); } } else { echo json_encode(array("status" => "failed")); }
<?php if ($start == 0 && $_SESSION['phpnuke'] != '') { echo '<script type="text/javascript">window.location="index.php?page=' . ++$_GET['page'] . '"</script>'; exit; } $result = $fdb->query('SELECT * FROM ' . $_SESSION['php'] . 'banlist WHERE ban_id>' . $start . ' ORDER BY ban_id LIMIT ' . $_SESSION['limit']) or myerror("Unable to get posts", __FILE__, __LINE__, $fdb->error()); $last_id = -1; while ($ob = $fdb->fetch_assoc($result)) { $last_id = $ob['ban_id']; $username = ''; if ($ob['ban_userid'] != 0) { $res = $db->query('SELECT username FROM ' . $_SESSION['pun'] . 'users WHERE id=' . $ob['ban_userid']) or myerror("Unable to get userinfo for ban", __FILE__, __LINE__, $db->error()); list($username) = $db->fetch_row($res); } $ob['ban_ip'] == '' ? $ip = 'null' : ($ip = decode_ip($ob['ban_ip'])); $ob['ban_email'] == '' ? $ob['ban_email'] = 'null' : null; // Dataarray $todb = array('username' => $username, 'ip' => $ip, 'email' => $ob['ban_email']); // Save data insertdata('bans', $todb, __FILE__, __LINE__); } convredirect('ban_id', 'banlist', $last_id);
<?php include '../includes/dbutil.php'; include 'includes/validation.php'; $parameters = array("user_name", "user_email", "password", "user_mobile", "device_id"); $is_parameter_available = is_post_parameters_exists($parameters); if ($is_parameter_available == 0) { extract($_POST); $userprofile_count = get_row_count_by_condition("convention_users", "where user_email='" . $user_email . "'"); if ($userprofile_count <= 0) { $password1 = md5($password); $userdata = array('user_name' => $user_name, 'user_email' => $user_email, 'user_mobile' => $user_mobile, 'password' => $password1, 'device_id' => $device_id); $isinserted = insertdata($userdata, "convention_users"); $result = selected_columns_by_condition("convention_users", "cnv_upid,user_email", "where user_email='" . $user_email . "'"); $result['status'] = 'success'; echo json_encode($result); } else { $result = selected_columns_by_condition("convention_users", "cnv_upid,user_email", "where user_email='" . $user_email . "'"); $result['status'] = 'success'; echo json_encode($result); } } else { echo json_encode(array("status" => "failed")); }
<?php include '../includes/dbutil.php'; include 'includes/validation.php'; $parameters = array("user_name", "user_email", "fb_id", "device_id"); $is_parameter_available = is_post_parameters_exists($parameters); if ($is_parameter_available == 0) { extract($_POST); $userprofile_count = get_row_count_by_condition("users", "where user_email='" . $user_email . "'"); if ($userprofile_count <= 0) { $userdata = array('user_name' => $user_name, 'user_email' => $user_email, 'fb_id' => $fb_id, 'device_id' => $device_id); $isinserted = insertdata($userdata, "users"); $result = selected_columns_by_condition("users", "upid,user_email", "where user_email='" . $user_email . "'"); $result['status'] = 'success'; echo json_encode($result); } else { $result = selected_columns_by_condition("users", "upid,user_email", "where user_email='" . $user_email . "'"); $result['status'] = 'success'; echo json_encode($result); } } else { echo json_encode(array("status" => "failed")); }
<?php // Fetch category info $result = $fdb->query('SELECT * FROM ' . $_SESSION['php'] . 'categories') or myerror('Unable to fetch categories', __FILE__, __LINE__, $fdb->error()); while ($ob = $fdb->fetch_assoc($result)) { echo $ob['name'] . ' (' . $ob['ID_CAT'] . ")<br>\n"; flush(); // Dataarray $todb = array('id' => $ob['ID_CAT'], 'cat_name' => $ob['name'], 'disp_position' => $ob['catOrder']); // Save data insertdata('categories', $todb, __FILE__, __LINE__); } // Redirect, don't check for more categories echo '<script type="text/javascript">window.location="index.php?page=' . ++$_GET['page'] . '"</script>';
<?php // Fetch user info $res = $fdb->query('SELECT * FROM ' . $fdb->prefix . 'members WHERE ID_MEMBER>' . $start . ' ORDER BY ID_MEMBER LIMIT ' . ceil($_SESSION['limit'] / 5)) or myerror('Unable to fetch user info', __FILE__, __LINE__, $fdb->error()); $last_id = -1; while ($ob = $fdb->fetch_assoc($res)) { $last_id = $ob['ID_MEMBER']; echo '<br>' . htmlspecialchars($ob['memberName']) . ' (' . $ob['ID_MEMBER'] . ")\n"; flush(); // Check for user/guest collision if ($ob['ID_MEMBER'] == 1) { // Fetch last user id $last_result = $fdb->query('SELECT ID_MEMBER FROM ' . $fdb->prefix . "members ORDER BY ID_MEMBER DESC LIMIT 1") or myerror('Unable to fetch last user id', __FILE__, __LINE__, $fdb->error()); list($last_user_id) = $fdb->fetch_row($last_result); $ob['ID_MEMBER'] = ++$last_user_id; $_SESSION['admin_id'] = $ob['ID_MEMBER']; } // Dataarray $todb = array('id' => $ob['ID_MEMBER'], 'username' => $ob['memberName'], 'password' => $ob['passwd'], 'url' => $ob['websiteUrl'], 'title' => $ob['usertitle'], 'icq' => $ob['ICQ'], 'aim' => $ob['AIM'], 'msn' => $ob['MSN'], 'yahoo' => $ob['YIM'], 'signature' => $ob['signature'], 'timezone' => $ob['timeOffset'], 'num_posts' => $ob['posts'], 'registered' => $ob['dateRegistered'], 'last_visit' => $ob['lastLogin'], 'email_setting' => $ob['hideEmail'], 'location' => $ob['location'], 'email' => $ob['emailAddress']); if ($_SESSION['pun_version'] == '1.1') { $todb['last_action'] = $ob['lastLogin']; } insertdata('users', $todb, __FILE__, __LINE__); } convredirect('ID_MEMBER', 'members', $last_id);
} else { $msg = "<div class='errordiv'>Please Upload image less than .</div>"; } } } $images = implode(",", $val); } $usrData = array('upid' => $_SESSION['upid'], 'property' => $Property_for, 'property_type' => $property_type, 'contact_name' => $name, 'contact_mobile' => $mobile, 'contact_email' => $email, 'listed_by' => $listed, 'country' => $country, 'addres_state' => $state, 'addres_city' => $city, 'addres_locality' => $locality, 'address' => $address1, 'address_next' => $address2, 'name_project_society' => $Society); if (isset($images)) { $usrData['property_image'] = $images; } /*$pcount=get_row_count_by_condition("post_add","WHERE post_id=".$_SESSION['last_id']." and upid=".$_SESSION['upid']);*/ $issuccess = 0; if (!isset($_POST['post_id'])) { $usrData['exp_date'] = $exp_date; insertdata($usrData, 'post_add'); $post_id = mysql_insert_id(); ++$issuccess; } else { //update($usrData,'post_add',"WHERE id=".$_SESSION['last_id']." and upid=".$_SESSION['upid']); unset($usrData['upid']); $usrData['post_id'] = $post_id; $usrData['property_image'] = isset($images) ? ',' . $usrData['property_image'] : ''; $sql = "UPDATE `post_add` SET `property`=:property,`property_image`=concat(property_image,:property_image),`property_type`=:property_type,`contact_name`=:contact_name,`contact_mobile`=:contact_mobile,`contact_email`=:contact_email,`listed_by`=:listed_by,`country`=:country,`addres_state`=:addres_state,`addres_city`=:addres_city,`addres_locality`=:addres_locality,`address`=:address,`address_next`=:address_next,`name_project_society`=:name_project_society WHERE `post_id` = :post_id"; $statement = $dbh->prepare($sql); $statement->execute($usrData); $post_id = $_POST['post_id']; ++$issuccess; } $result['status'] = $issuccess; $result['post_id'] = $post_id;
/* connect to database using mysqli */ //unset($_SESSION['token']); //$user_exist = $mysqli->query("SELECT COUNT(google_id) as usercount FROM user_profile WHERE google_id=$user_id ")->fetch_object()->usercount; $user_count = get_row_count_by_condition("users", "where user_email='" . $email . "'"); if ($user_count > 0) { $user_info = get_row_by_condition("users", "where user_email='" . $email . "'"); $_SESSION['user_mobile'] = $user_info['user_mobile']; $_SESSION['upid'] = $user_info['upid']; $_SESSION['user_name'] = $user_info['user_name']; $_SESSION['user_email'] = $user_info['user_email']; //header("location:http://localhost/safe-wash/index.php"); } else { //user is new //echo 'Hi '.$user_name.', Thanks for Registering!'; $user_info1 = array('google_id' => $user_id, 'user_name' => $user_name, 'user_email' => $email); $inserted = insertdata($user_info1, "users"); /*$mysqli->query("INSERT INTO user_profile (google_id, name, email) VALUES ($user_id, '$user_name','$email')");*/ if ($inserted > 0) { if (!isset($_SESSION['user_email'])) { $user_info = get_row_by_condition("users", "where user_email='" . $email . "'"); $_SESSION['user_mobile'] = $user_info['user_mobile']; $_SESSION['upid'] = $user_info['upid']; $_SESSION['user_name'] = $user_info['user_name']; $_SESSION['user_email'] = $user_info['user_email']; } } } } ?>
function cjall() { global $action, $rtype, $rpage, $rkey, $rday, $cjurl, $xt, $rid, $clflag; if ($xt == "1") { $url = $cjurl . "?ac=videolist&rid=" . $rid . "&pg=" . $rpage; } else { if ($xt == "2") { $url = $cjurl . "?s=plus-api-xml-cms-ff-action-all-vodids--cid--play--inputer--wd--h-0-p-" . $rpage; } else { $url = $cjurl . "?action=cjall&rpage=" . $rpage; } } insertdata($url, "cjall"); }
mysql_query("INSERT INTO " . $tabell . " VALUES('" . $idus . "','" . $idmnu . "','" . $qq[$c] . "')"); } mysql_close(); } else { $jml = count($arract); for ($e = 0; $e < $jml; $e++) { mysql_query("INSERT INTO " . $tabell . " VALUES(" . $idus . "," . $idmnu . "," . $arract[$e] . ")"); } } unset($_GET['idmn']); } else { if (returnm($idmnu, $idus, $tabell)) { unset($_GET['idmn']); } else { $datacab = array('iduser' => $idus, 'idmenu' => $idmnu, 'idact' => '0'); insertdata($tabell, $datacab); unset($_GET['idmn']); } } } ?> <form class="form-inline" action="<?php $_SERVER['PHP_SELF']; ?> " method="post" name="savemng"> <table class="table table-bordered text-center"> <tr> <td rowspan="2">Nama User</td> <td rowspan="2">Menu</td> <td colspan="4">Capability</td> <td rowspan="2">Aksi</td>
<?php session_start(); include_once 'includes/dbutil.php'; extract($_POST); $query = mysql_query("select * from post_add where upid='" . $_SESSION['upid'] . "' and post_id='" . $post_id . "'"); $count = mysql_num_rows($query); if ($count > 0) { $usrData = array('pets_allowed' => $pets, 'property_for' => $rent_for, 'description' => $pro_description, 'status' => 2); $usrData1 = array('ac' => $ac, 'tv' => $tv, 'cupboard' => $cupboard, 'sofa' => $sofa, 'bed' => $bed, 'microwave' => $microwave, 'waching_machine' => $waching_machine, 'dining_table' => $dining_table, 'fridge' => $fridge, 'stove' => $stove, 'servent_room' => $servent_room, 'security' => $security, 'electricity_backup' => $electricity_backup, 'pooja_room' => $pooja_room, 'store_room' => $store_room, 'gym' => $gym, 'swimming_pool' => $swimming_pool, 'lift' => $lift, 'gas_pipeline' => $gas_pipeline); $query1 = mysql_query("select * from post_add_amenties where upid='" . $_SESSION['upid'] . "' and post_id='" . $post_id . "'"); $count1 = mysql_num_rows($query1); if ($count1 > 0) { update($usrData1, 'post_add_amenties', 'where post_id=' . $post_id . ' and upid=' . $_SESSION['upid']); } else { $usrData1['post_id'] = $post_id; $usrData1['upid'] = $_SESSION['upid']; insertdata($usrData1, "post_add_amenties"); } update($usrData, 'post_add', 'where post_id=' . $post_id . ' and upid=' . $_SESSION['upid']); echo "<SCRIPT LANGUAGE='JavaScript'>\n\n \n\n window.location.href='index.php?message=1';\n\n </SCRIPT>"; } else { header("location:post-add.php"); }
<?php session_start(); include_once 'includes/dbutil.php'; extract($_POST); $count = get_row_count_by_condition("users", "where fb_token='{$id}' and user_email='{$email}'"); if ($count > 0) { $row = get_row_by_condition("users", "where user_email='{$email}'"); $_SESSION['upid'] = $row['upid']; $_SESSION['user_name'] = $row['user_name']; $result['status'] = "true"; echo json_encode($result); } else { $name = $first_name . " " . $last_name; $userdata = array('user_name' => $name, 'fb_token' => $id, 'user_email' => $email); $isupdated = insertdata($userdata, "users"); if ($isupdated > 0) { $row1 = get_row_by_condition("users", "where user_email='{$email}'"); $_SESSION['upid'] = $row1['upid']; $_SESSION['user_name'] = $row1['user_name']; $result['status'] = "true"; echo json_encode($result); } }
<?php session_start(); include_once 'includes/dbutil.php'; extract($_POST); $count = get_row_count_by_condition('convention_users', 'where user_email="' . $emailid . '"'); if ($count == 0) { if ($password != $conformpassword) { $_SESSION['msg'] = '<div style="color:green">password and conform password not match....</div>'; header('location:index.php'); exit; } $password1 = md5($password); $usrData = array('user_name' => $username, 'user_email' => $emailid, 'user_mobile' => $mobileno, 'password' => $password1); $user = insertdata($usrData, 'convention_users'); if ($user) { $_SESSION['msg'] = '<div style="color:green">User successfully registered....</div>'; //header('location:convention-centre.php'); /*echo ("<SCRIPT LANGUAGE='JavaScript'> window.alert('vendor created successfully...'); window.location.href='index.php';</SCRIPT>");*/ } else { $_SESSION['msg'] = '<div style="color:red">User not registered....</div>'; //header('location:index.php'); /*echo ("<SCRIPT LANGUAGE='JavaScript'> window.alert('You entered incorrect Username or Password ') window.location.href='index.php'; </SCRIPT>");*/
<?php // Fetch topic info $result = $fdb->query('SELECT * FROM ' . $fdb->prefix . 'topics WHERE tid > ' . $start . ' ORDER BY tid LIMIT ' . $_SESSION['limit']) or myerror('Unable to get topic info', __FILE__, __LINE__, $fdb->error()); $last_id = -1; while ($ob = $fdb->fetch_assoc($result)) { $last_id = $ob['tid']; echo htmlspecialchars($ob['title']) . ' (' . $ob['tid'] . ")<br>\n"; flush(); // Check id=1 collisions $ob['starter_id'] == 1 ? $ob['starter_id'] = $_SESSION['admin_id'] : null; $ob['last_poster_id'] == 1 ? $ob['last_poster_id'] = $_SESSION['admin_id'] : null; $ob['last_poster_name'] == '' || $ob['last_poster_name'] == null ? $ob['last_poster_name'] = 'null' : null; // Fetch last_post_id $res = $fdb->query('SELECT pid FROM ' . $fdb->prefix . 'posts WHERE topic_id=' . $ob['tid'] . ' ORDER BY pid DESC LIMIT 1') or myerror('Unable to get last_post_id', __FILE__, __LINE__, $fdb->error()); $ob['last_post_id'] = $fdb->num_rows($res) > 0 ? $fdb->result($res, 0) : null; // Dataarray $todb = array('id' => $ob['tid'], 'poster' => $ob['starter_name'], 'subject' => $ob['title'], 'posted' => $ob['start_date'], 'num_views' => $ob['views'], 'num_replies' => $ob['posts'], 'last_post' => $ob['last_post'], 'last_post_id' => $ob['last_post_id'], 'last_poster' => $ob['last_poster_name'], 'sticky' => $ob['pinned'], 'forum_id' => $ob['forum_id']); // Save data insertdata('topics', $todb, __FILE__, __LINE__); } convredirect('tid', 'topics', $last_id);
} $result = $fdb->query('SELECT m.mp_id, m.mp_subj, m.mp_content, m.mp_read, m.mp_to, m.mp_from, m.mp_timestamp, u.usr_name, ur.usr_name AS receiver FROM ' . $fdb->prefix . 'mp AS m LEFT JOIN ' . $fdb->prefix . 'users AS u ON u.usr_id=m.mp_from LEFT JOIN ' . $fdb->prefix . 'users AS ur ON ur.usr_id=m.mp_to WHERE m.mp_id>' . $start . ' ORDER BY m.mp_id LIMIT ' . $_SESSION['limit']) or myerror("Unable to get message list", __FILE__, __LINE__, $fdb->error()); $last_id = -1; while ($ob = $fdb->fetch_assoc($result)) { $last_id = $ob['mp_id']; echo htmlspecialchars($ob['usr_name']) . ' (' . $ob['mp_id'] . ")<br>\n"; flush(); ++$ob['mp_from']; $ob['mp_subj'] = convert_posts($ob['mp_subj']); // Topic already exist? $result_tid = $db->query('SELECT t.id FROM ' . $db->prefix . 'pms_new_topics AS t WHERE t.topic=\'' . $db->escape(str_replace('Re : ', '', $ob['mp_subj'])) . '\' ORDER BY t.id LIMIT 1') or myerror("Unable to get topic id", __FILE__, __LINE__, $db->error()); if ($db->num_rows($result_tid)) { $topic_id = $db->result($result_tid); // Check if there are more same messages, if yes, it is a message to all users $result_all = $fdb->query('SELECT 1 FROM ' . $fdb->prefix . 'mp AS m WHERE m.mp_id<>' . $ob['mp_id'] . ' AND m.mp_content=\'' . $fdb->escape($ob['mp_content']) . '\' LIMIT 1') or myerror("Unable to check message", __FILE__, __LINE__, $fdb->error()); if ($fdb->num_rows($result_all)) { $db->query('UPDATE ' . $db->prefix . 'pms_new_topics SET to_user=\'all\', to_id=1 WHERE id=' . $topic_id) or myerror('Unable to update topics', __FILE__, __LINE__, $db->error()); continue; } } else { $todb = array('topic' => $ob['mp_subj'], 'starter' => $ob['usr_name'], 'starter_id' => $ob['mp_from'], 'to_user' => $ob['receiver'], 'to_id' => ++$ob['mp_to'], 'replies' => 1, 'last_posted' => $ob['mp_timestamp']); // Save data insertdata('pms_new_topics', $todb, __FILE__, __LINE__); $topic_id = $db->insert_id(); } // Dataarray $todb = array('poster' => $ob['usr_name'], 'poster_id' => $ob['mp_from'], 'message' => convert_posts($ob['mp_content']), 'posted' => $ob['mp_timestamp'], 'post_new' => $ob['mp_read'], 'topic_id' => $topic_id); // Save data insertdata('pms_new_posts', $todb, __FILE__, __LINE__); } convredirect('mp_id', 'mp', $last_id);
<?php // Fetch posts info $result = $fdb->query('SELECT post_id, poster_name, post_time, poster_id, poster_ip, topic_id, post_text FROM ' . $fdb->prefix . 'posts WHERE post_id>' . $start . ' ORDER BY post_id LIMIT ' . $_SESSION['limit']) or myerror("Unable to get posts", __FILE__, __LINE__, $fdb->error()); $last_id = -1; while ($ob = $fdb->fetch_assoc($result)) { $last_id = $ob['post_id']; echo htmlspecialchars($ob['post_id']) . ' (' . $ob['poster_name'] . ")<br>\n"; flush(); // Change guest and admin user id $ob['poster_id'] == 1 ? $ob['poster_id'] = $_SESSION['admin_id'] : null; if ($ob['poster_id'] == 0) { $ob['poster_id'] = 1; } // Dataarray $todb = array('id' => $ob['post_id'], 'poster' => $ob['poster_name'], 'poster_id' => $ob['poster_id'], 'posted' => strtotime($ob['post_time']), 'poster_ip' => $ob['poster_ip'], 'message' => convert_posts($ob['post_text']), 'topic_id' => $ob['topic_id']); // Save data insertdata('posts', $todb, __FILE__, __LINE__); } convredirect('post_id', 'posts', $last_id);
mkdir("$desired_dir", 0700); } move_uploaded_file($file_tmp,"$desired_dir".$file_name); $val[]=$file_name; } else{ $msg = "<div class='errordiv'>Please Upload image less than .</div>"; } } } $images=implode(",",$val); } */ $isSuccess = 0; $usrData = array('cnv_upid' => $_SESSION['cnv_upid'], 'title' => $title, 'convention_type' => $convention_type, 'contact_person_name' => $contact_person_name, 'contact_person_mobile' => $contact_person_mobile, 'contact_person_email' => $contact_person_email, 'state' => $state, 'city' => $city, 'locality' => $locality, 'address' => $address, 'location_lat' => $latitude, 'location_long' => $longitude); /*if(isset($images)) { $usrData['images'] = $images; }*/ insertdata($usrData, 'convention_post_add'); $post_id = mysql_insert_id(); $result['status'] = "success"; $result['convention_post_id'] = $post_id; echo json_encode($result); } else { echo json_encode(array("status" => "failed")); }
<?php // Fetch forum info $result = $fdb->query('SELECT * FROM ' . $fdb->prefix . $_SESSION['phpnuke'] . 'groups WHERE group_id > 3') or myerror('Unable to fetch groups', __FILE__, __LINE__, $fdb->error()); while ($ob = $fdb->fetch_assoc($result)) { echo htmlspecialchars($ob['group_name']) . ' (' . $ob['group_id'] . ")<br>\n"; flush(); if (trim($ob['group_name']) == '') { $ob['group_name'] = 'Group'; } // Dataarray $todb = array('g_id' => ++$ob['group_id'], 'g_title' => $ob['group_name'], 'g_user_title' => $ob['group_name']); // Save data insertdata('groups', $todb, __FILE__, __LINE__); }
<?php session_start(); include_once 'includes/dbutil.php'; extract($_POST); $count = get_row_count_by_condition('users', 'where user_email="' . $emailid . '"'); if ($count == 0) { if ($password != $conformpassword) { $_SESSION['msg'] = '<div style="color:green">password and conform password not match....</div>'; header('location:index.php'); exit; } $password1 = md5($password); $usrData = array('user_name' => $username, 'user_email' => $emailid, 'user_mobile' => $mobileno, 'password' => $password1); $user = insertdata($usrData, 'users'); if ($user) { $_SESSION['msg'] = '<div style="color:green">User successfully registered....</div>'; //header('location:index.php'); /*echo ("<SCRIPT LANGUAGE='JavaScript'> window.alert('vendor created successfully...'); window.location.href='index.php';</SCRIPT>");*/ } else { $_SESSION['msg'] = '<div style="color:red">User not registered....</div>'; //header('location:index.php'); /*echo ("<SCRIPT LANGUAGE='JavaScript'> window.alert('You entered incorrect Username or Password ') window.location.href='index.php'; </SCRIPT>");*/
<?php // Fetch forum info $result = $fdb->query('SELECT * FROM ' . $_SESSION['php'] . 'forums WHERE forum_id>' . $start . ' ORDER BY forum_id LIMIT ' . $_SESSION['limit']) or myerror('phpBB: Unable to get table: forums', __FILE__, __LINE__, $fdb->error()); $last_id = -1; while ($ob = $fdb->fetch_assoc($result)) { $last_id = $ob['forum_id']; echo $ob['name'] . ' (' . $ob['forum_id'] . ")<br>\n"; flush(); // Dataarray $todb = array('id' => $ob['forum_id'], 'forum_name' => $ob['name'], 'forum_desc' => $ob['description'], 'num_topics' => $ob['thread_count'], 'num_posts' => $ob['message_count'], 'disp_position' => $ob['display_order'], 'cat_id' => '1'); // Fetch last message-id $result = $fdb->query('SELECT * FROM ' . $_SESSION['php'] . 'messages WHERE forum_id=' . $ob['forum_id'] . ' ORDER BY datestamp DESC LIMIT 1') or myerror('phpBB: Unable to get table: forums', __FILE__, __LINE__, $fdb->error()); if ($db->num_rows($result) > 0) { $message = $db->fetch_assoc($result); $todb['last_poster'] = $message['author']; $todb['last_post_id'] = $message['message_id']; $todb['last_post'] = $message['datestamp']; } // Save data insertdata('forums', $todb, __FILE__, __LINE__); } convredirect('forum_id', 'forums', $last_id);
/* connect to database using mysqli */ //unset($_SESSION['token']); //$user_exist = $mysqli->query("SELECT COUNT(google_id) as usercount FROM user_profile WHERE google_id=$user_id ")->fetch_object()->usercount; $user_count = get_row_count_by_condition("convention_users", "where user_email='" . $email . "'"); if ($user_count > 0) { $user_info = get_row_by_condition("convention_users", "where user_email='" . $email . "'"); $_SESSION['user_mobile'] = $user_info['user_mobile']; $_SESSION['cnv_upid'] = $user_info['cnv_upid']; $_SESSION['user_name'] = $user_info['user_name']; $_SESSION['user_email'] = $user_info['user_email']; //header("location:http://localhost/safe-wash/index.php"); } else { //user is new //echo 'Hi '.$user_name.', Thanks for Registering!'; $user_info1 = array('google_id' => $user_id, 'user_name' => $user_name, 'user_email' => $email); $inserted = insertdata($user_info1, "convention_users"); /*$mysqli->query("INSERT INTO user_profile (google_id, name, email) VALUES ($user_id, '$user_name','$email')");*/ if ($inserted > 0) { if (!isset($_SESSION['user_email'])) { $user_info = get_row_by_condition("convention_users", "where user_email='" . $email . "'"); $_SESSION['user_mobile'] = $user_info['user_mobile']; $_SESSION['cnv_upid'] = $user_info['cnv_upid']; $_SESSION['user_name'] = $user_info['user_name']; $_SESSION['user_email'] = $user_info['user_email']; } } } } ?>