functions - <? $info_query = mysql_query("SELECT *...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
<? $info_query = mysql_query("SELECT * FROM ".$prefix."ProFolio_info ORDER BY id DESC LIMIT 0,1"); if(mysql_num_rows($info_query) < 1){ $red = "Location: install.php"; header($red); die(); } while($info_row = mysql_fetch_array($info_query)){ //Login Information $username = $info_row['username']; $password = $info_row['password']; //Specific Variables $info_id = $info_row['id']; $firstname = html_entity_decode($info_row['firstname']); $lastname = html_entity_decode($info_row['lastname']); $email = html_entity_decode($info_row['email']); $phone = html_entity_decode($info_row['phone']); $about_page = html_entity_decode($info_row['page_about']); $contact_page = html_entity_decode($info_row['page_contact']); $sitename = ucwords(strtolower($firstname)).' '.ucwords(strtolower($lastname)); } //You can change these headings below. They will affect the words that show up on the lefthand side links. $link1 = "home"; $link2 = "portfolio"; $link3 = "about"; $link4 = "contact"; //Login System - For Security Reasons, Do Not Change The Following Unless Your Know What You're Changing $LOGGEDIN = 'no'; $username = trim(strtolower($username)); $password = trim(strtolower($password)); if($_GET['logout'] == 'yes'){ setcookie("PFlogin", "", mktime(12,0,0,1, 1, 1000)); setcookie("PFpassw", "", mktime(12,0,0,1, 1, 1000)); $self = "Location: ".str_replace("?logout=yes", "", $_SERVER['REQUEST_URI']); header( "$self" ); } if($_COOKIE['PFlogin'] == md5($username)){ if($_COOKIE['PFpassw'] == md5($password)){ $LOGGEDIN = 'yes'; } } } if(isset($_POST['login_button'])){ $sub_username = trim(strtolower($_POST['username'])); $sub_password = trim(strtolower($_POST['password'])); $time = 86400 + time(); setcookie('PFlogin', md5($username), $time); setcookie('PFpassw', md5($password), $time); $LOGGEDIN = "yes"; } }
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
//General Variables $default_title = ''; $reply = ''; $show_customize = 0; $show_manage = 0; $show_settings = 0; $show_add = 0; $imagetypes = array("image/gif", "image/jpeg", "image/pjpeg", "image/jpg", "image/png", "image/png-x"); $image_extensions = array("jpg", "pjpeg", "png-x", "png", "jpeg", "gif"); $ok = 0; if($LOGGEDIN == 'yes'){ //Show Manage if After Delete if($_GET['s'] == 'm'){ $show_manage = 1; } if($_GET['s'] == 'e'){ $show_settings = 1; } function clean($n){ $n = trim(strip_tags($n)); $n = htmlentities($n, ENT_QUOTES); return $n; } function clean_page($n){ $n = nl2br(trim($n)); $n = htmlentities($n, ENT_QUOTES); return $n; } //Add To Portfolio If Set (Make sure it isn't a bot) if(isset($_POST['add_button']) && $_POST['human'] == '' && $LOGGEDIN == 'yes'){ $show_manage = 0; $show_add = 1; if(!file_exists('Files')){ mkdir('Files', 0777); } if(!file_exists('Files_Icons')){ mkdir('Files_Icons', 0777); } if(!file_exists('Files_Previews')){ mkdir('Files_Previews', 0777); } function file_clean($n){ $n = str_replace(' ', '_', $n);
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This document was uploaded on 11/01/2011.

Page1 / 9

functions - &lt;? $info_query = mysql_query(&quot;SELECT *...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online