PHP - Updating Picture & Text On Several Pages
Hi,
I have a 125 X 156 jpeg image with some text underneath in the right column of my home page and the same image and text in the right column of 47 other pages. When I update the image and text in my home page I don't want to do the same 47 other times. So I have placed the image and text in a separate file. I am guessing I have to insert preg_replace() function at the places where I want the updates to be made. My knowledge of PHP is not that great. So can anyone give me the exact function and parameters I have to use to replace the image and text. I would be very grateful. Similar TutorialsHi all I have a MySQL data base that is saving information from a form. One the form a user can add a business name which is text and a logo if they have one. Now on my web page I want to beabe to display the picture if present if not I would like it to display the business name. How do I do this please. I know how to conect to DB etc just having problems getting my head around this problem. Hey guys, im new hear so im not shore how things work. Iv got a project where we are ment to alow users to record a bug fault in a computer, currently i have a page that looks like ths: <?php if (empty($_POST['bug_ID'])) echo "<p>You must enter a BUG ID number</p>"; else { $bugID = addslashes($_POST['bug_ID']); $name = addslashes($_POST['bug_name']); umask(0007); if (!file_exists("../../data/lab05")) mkdir("../../data/lab05", 02777); $lab05 = fopen("../../data/lab05/". "$bugID.txt", "a"); if (is_writable("../../data/lab05/NewBug.txt")) { if (fwrite($lab05, $bugID . ", " . $name . "\n")) echo "<p>Thank you entering a new bug</p>"; else echo "<p>Cannot add bug</p>"; } else echo "<p>Cannot write to the file.</p>"; fclose($lab05); } ?> this code runs fine however I also need to write a sperate page that allows for users to search and up date bugs recorded, I want them to search using the bug_ID field and we are ment to use the fgets method but am unshore, anyhelp would be much apricated. thank you How do I do I prevent a broken image icon if there is no image? Here is my code: Code: [Select] <?php if ($_POST){ $county = $_POST['county']; } $con = mysql_connect("localhost","",""); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("", $con); $imageLocation = $row['imageurl1']; $result = mysql_query("SELECT * FROM places WHERE `county` = '".mysql_real_escape_string($county)."' order by `date_created` DESC"); if ( mysql_num_rows($result) > 0 ) { echo "<strong>Click Headers to Sort</strong>"; echo "<table border='0' align='center' bgcolor='#999969' cellpadding='3' bordercolor='#000000' table class='sortable' table id='results'> <tr> <th> Title </th> <th> Borough </th> <th> Town </th> <th> Phone </th> <th> Rooms </th> <th> Bath </th> <th> Fees </th> <th> Rent </th> <th> Image </th> </tr>"; while($row = mysql_fetch_array($result)) { echo "<tr> <td bgcolor='#FFFFFF' style='color: #000' align='center'> <a href='classified/places/index.php?id=".$row['id']."'>" . $row['title'] . "</a></td> <td bgcolor='#FFFFFF' style='color: #000' align='center'>" . $row['county'] . "</td> <td bgcolor='#FFFFFF' style='color: #000' align='center'>" . $row['town'] . "</td> <td bgcolor='#FFFFFF' style='color: #000' align='center'>" . $row['phone'] . "</td> <td bgcolor='#FFFFFF' style='color: #000' align='center'>" . $row['rooms'] . "</td> <td bgcolor='#FFFFFF' style='color: #000' align='center'>" . $row['bath'] . "</td> <td bgcolor='#FFFFFF' style='color: #000' align='center'>" . $row['feeornofee'] . "</td> <td bgcolor='#FFFFFF' style='color: #000' align='center'>" . $row['rent'] . "</td> <td bgcolor='#FFFFFF' style='color: #000' align='center'><img src=user/". $row['imageurl1'] ." width='50'></td> </tr>"; } echo "</table>"; print_r($apts); } else { echo "<p> </p><p> </p> No Results <br /><p> </p><FORM><INPUT TYPE='button' VALUE='Go Back' onClick='history.go(-1);return true;'></FORM> and Refine Your Search <p> </p><p> </p>"; } ?> Thanks in advance Here goes.
I am trying to retrieve info. from mySql database and update 3 textfields.
I also have 4 selects on the form that need populating during the running of the program. My problem is using console I can see the info - Customer name - but it does not appear in the text field. The onchange request in the DIV container seems to be where it fails. Here are the files I am using:
1. add_an_order.php
<html> <head> <title>Add an Order</title> <link href = "css/style.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="include/jquery-1.11.1.min.js"></script> </head> <body> <div id="header"><img src="images/logo.png" /></div> <div id="nav"> <div id="nav_wrapper"> <ul> <li><a href="index.php">Orders</a></li><li> <a href="customers.php">Customers</a></li><li> <a href="contacts.php">Contacts</a></li><li> <a href="batteries.php">Batteries</a></li><li> <a href="#">Queries</a> </li> </ul> </div> </div> <div id="main"> <?php echo '<h3 id="menOpt">Add an Order</h3><hr>'; // Check for a form submission. /* if ($_SERVER['REQUEST_METHOD'] == 'POST') { $errors = array(); $required_fields = array('customer_name', 'customer_address', 'city', 'telephone'); foreach ($required_fields as $fieldname) { if (!isset($_POST[$fieldname]) || empty($_POST[$fieldname])) { $errors[] = strtoupper($fieldname); } } if (empty($errors)) { include ('include/dbconnect.php'); $name = mysqli_real_escape_string($con, trim(strip_tags($_POST['customer_name']))); $contact = mysqli_real_escape_string($con, trim(strip_tags($_POST['contact']))); $address = mysqli_real_escape_string($con, trim(strip_tags($_POST['customer_address']))); $city = mysqli_real_escape_string($con, trim(strip_tags($_POST['city']))); $telephone = mysqli_real_escape_string($con, trim(strip_tags($_POST['telephone']))); $telephone = preg_replace('/[^0-9]/', '', $telephone); if (isset($_POST['deepc'])) { $deepc = 1; } else { $deepc = 0; } if (isset($_POST['problemc'])) { $problemc = 1; } else { $problemc = 0; } $problem = mysqli_real_escape_string($con, trim(strip_tags($_POST['problem']))); if (isset($_POST['blacklist'])) { $blacklist = 1; } else { $blacklist = 0; } if (isset($_POST['pickup'])) { $pickup = 1; } else { $pickup = 0; } $query = "INSERT INTO customers ( customer_name, contact, customer_address, city, telephone, deep_cycle, problem_customer, problem, blacklist, pickup) VALUES ('$name', '$contact', '$address', '$city', '$telephone', $deepc, $problemc, '$problem', $blacklist, $pickup)"; $r = mysqli_query($con, $query); if (mysqli_affected_rows($con) == 1) { echo '<p class="success">Customer has been successfully added.</p>'; } else { $message = "Could not add customer."; $message .= "<br />" . mysqli_error($con); } mysqli_close($con); } else { // We have errors. $message = count($errors) . " error(s) on the form."; } } // End: if ($_SERVER['REQUEST_METHOD'] == 'POST'). */ // Leave PHP and display the form. ?> <?php if (!empty($message)) { echo '<p class="error">' . $message . '</p>'; } ?> <?php // Output list of fields that have errors. if (!empty($errors)) { echo '<p class="error">'; foreach ($errors as $error) { echo $error . '<br />'; } echo '</p>'; } ?> <div class="container"> <form action="<?php $_SERVER['PHP_SELF']; ?>" method="post"> <fieldset> <label>Business: <span class="important"> *</span><select name="customer_name" id="customer_name" onchange="request_fill(this.value)" value="<?php if (isset($_POST['customer_name'])) echo $_POST['customer_name']; ?>" ></select></label> <label>Address: <input type="text" name="address" id="add_a" value="<?php if (isset($_POST['customer_address'])) echo $_POST['customer_address']; ?>" /></label> <label>City: <input type="text" name="city" id="city" value="<?php if (isset($_POST['city'])) echo $_POST['city']; ?>" /></label> <label>Phone: <input type="text" name="telephone" value="<?php if (isset($_POST['telephone'])) echo $_POST['telephone']; ?>" /></label> <label>Manufacturer: <span class="important"> *</span><select name="manufacturer" id="manufacturer" onchange="request_mod(this.value)" value="<?php if (isset($_POST['manufacturer'])) echo $_POST['manufacturer']; ?>" ></select></label> <label>Model: <span class="important"> *</span><select name="model" id="model" onchange="form_yr(this.value)" value="<?php if (isset($_POST['model'])) echo $_POST['model']; ?>" ></select></label> <label>Year: <span class="important"> *</span><select name="battery" id="bat_disp" value="<?php if (isset($_POST['battery'])) echo $_POST['year'] ?>" ></select></label> <label>Quantity: <span class="important"> *</span><input type="text" name="quantity" id="quantity" value="<?php if (isset($_POST['quantity'])) echo $_POST['quantity']; ?>" /></label> <label>Warranty ? <input type="checkbox" name="warranty" <?php if ($_POST['warranty']) echo " checked"; ?> /></label> <label>Exchange ? <input type="checkbox" name="exchange" <?php if ($_POST['exchange']) echo " checked"; ?> /></label> <input type="submit" name="submit" value="Add Order" /> or <a href="index.php">Cancel</a> </fieldset> </form> </div> <script type="text/javascript" src="include/functions.js"></script> <script> $(document).ready(function() { $('.container').hide(); $('.container').fadeIn(1000); request_cust(); request_man(); }); </script> <?php include ('include/footer.php'); 2. request_fill function request_fill() { var cust2 = 'customer'; var ad = document.getElementById("add_a"); var hr = new XMLHttpRequest(); hr.open("POST", "battery_parser.php", true); hr.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); hr.onreadystatechange = function() { if(hr.readyState == 4 && hr.status == 200) { var dataArray = hr.responseText; ad.innerHTML = dataArray[1]; } } hr.send("&cust2="+cust2); } 3. battery_parser.php <?php include_once("include/dbconnect.php"); if (isset($_POST['cust2'])) { $cust2 = $_POST['cust2']; $sql = "SELECT customer_address FROM customers WHERE customer_id = 2"; $query = mysqli_query($con, $sql); $dataString = ''; while($row = mysqli_fetch_array($query, MYSQLI_ASSOC)){ $add = $row["customer_address"]; $dataString = $add; } mysqli_close($con); echo $dataString; exit(); } else { exit(); } ?> I have problem that only last text field is updated, how should I fix this? Here's the code <?php if(isset($_POST["update"])){ mysql_query("UPDATE categories SET name_category = '".$_POST['category']."' WHERE ID= ".$_POST['currentCat']." ") or die(mysql_error()); mysql_query("UPDATE podkategorije SET name_subcategory = '".$_POST['subcategory']."' WHERE id_subCat= ".$_POST['currentSubCat']." ") or die(mysql_error()); } ?> <form action="" method="post" > <?php //creating texfields from db $query = "SELECT k.ID, k.name_category, pk.name_subcategory, pk.id_subCat FROM `categories` AS k JOIN `subcategories` AS pk ON pk.id_mainCat = k.ID"; $result = mysql_query($query) or die(mysql_error()); $currentCat = false; while($row = mysql_fetch_array($result)) { //so it doesn't repeat itself if($currentCat != $row['ID']) { //display of main Categories ?> <ul> <li> <br/><input name="categories" type="text" value="<?php echo $row['name_category']; ?>" /> </li> </ul> <? $currentCat = $row['ID']; } //display subcategories ?> <input name="subcategories" type="text" value="<?php echo $row['name_category']; ?>" /><br/> <input type="hidden" name="currentCat" value="<?php echo $row['ID']; ?>" /> <input type="hidden" name="currentSubCat" value="<?php echo $row['id_subCat']; ?>" /> <? } ?> <br /> <input type="button" value="Back" onClick="history.go(-1);return true;"> <input type="submit" value="Update" name="update"/> </form> Hi Guys, I wonder if you can help me before I go crazy? I have the task of updating a site by adding text to every page, at the moment there are three pages on the live website that show both images and text, I am to update the remaining 6 with text to go with the images.... I thought this was all fine and dandy, added the text in, checked the code, uploaded to the FTP site and nothing, only 1 page worked. I am stuck as I have used the same method to add text to all the pages yet those elusive pages refuse to show text! This is driving me crazy and i am hoping that one of you guys has come across this before and will be able to highlight a missing piece of code or have a solution? I do appreciate your time and any suggestions that you have. I have attached the page below. Thanks guys! How do i remove with %20%20%20 from a pictures name? Silly question but my pictures wont show because of the %20%20%20 in the picturename. Hello! My problem is that in my forum I want to display the picutre of their user and if they do not have a picture I want to show the standard one. I got all of this working on another part of the page but for some reason I can only get it to display the standard picture and not their custom picture... The code looks like this: Code: [Select] <?php // Now query any responses out of the database and place in a dynamic list $sqll = mysql_query("SELECT id FROM myMembers"); while($row = mysql_fetch_array($sqll)){ $id = $row["id"]; $check_pic = "..//members/$id/image01.jpg"; $default_pic = "..//members/0/image01.jpg"; if (file_exists($check_pic)) { $user_pic = "<img src=\"$check_pic\" align=\"left\" width=\"80px\" border=\"0\" />"; // forces picture to be 120px wide and no more } else { $user_pic = "<img src=\"$default_pic\" align=\"left\" width=\"80px\" border=\"0\" />"; // forces default picture to be 120px wide and no more } } $all_responses = ""; $sql = mysql_query("SELECT * FROM forum_posts WHERE otid='$thread_id' AND type='b'"); $numRows = mysql_num_rows($sql); if ($numRows < 1) { $all_responses = '<div id="none_yet_div">No respond has been posted yet.</div>'; } else { while($row = mysql_fetch_array($sql)){ $reply_author = $row["post_author"]; $reply_author_id = $row["post_author_id"]; $date_n_time = $row["date_time"]; $convertedTime = ($myAgoObject -> convert_datetime($date_n_time)); $whenReply = ($myAgoObject -> makeAgo($convertedTime)); $reply_body = $row["post_body"]; $all_responses .= '<div class="response_top_div"> ' . $thread_title . ' | ' . $whenReply . ' <a href="../profile.php?id=' . $reply_author_id . '">' . $reply_author . '</a> said:</div> <div class="response_div" style="padding-left:20px; vertical-align:text-top;">' . $user_pic . ' <div style="padding-left:117px;"> ' . $reply_body . '</div></div>'; } } ?> Please help me if you can! Thank you! Hello everyone and thanks for reading my request for help
I am working on a basic game where 3 - 5 images will be displayed on each page for the user to see (there should be about 5 pages), each of these images will have a value e.g. -1, +1, 0, -10, +12. When the user clicks on an image his/her score will change and the next page with 3 - 5 new images will be shown. When all of the pages have been shown and the user has a score of lets just say 20 or more then more pages will be displayed, if not then a new page will display stating that the game is over.
My question is how do I give each image a value and how do I show a new set of images based on the overall "score" of the player after the first set of pages have been shown?
And is there a way to display the players score on the page?
Thanks and any answers will be appreciated.
If you know of any videos which may help please tell me
:-\
Hello everyone, I have a PHP shopping cart I am working on. I have all my pictures stored in a folder url directory of my project. In my SQL database I have an image table that holds all of the image names. When I load the picture names with my php It somehow adds some extra random characters to the directory path: /img/%7B$row_product_image[name]%7D 404 (Not Found) If I hardcode the image directory img/picturename.jpg It works. Here is what I have. <?php include_once "objects/database.php"; include_once "objects/product.php"; include_once "objects/product_images.php"; // object instances $database = new Database(); $db = $database->getConnection(); $product = new Product($db); $product_image = new ProductImage($db); $recordsPerPage = 1; while($row = $stmt->fetch(PDO::FETCH_ASSOC)) { extract($row); echo '<div class="col-md-4 mb-2">'; echo '<div class="product-id d-none">{$id}</div>'; echo '<a href="product.php?id={$id}" class="product-link">'; $product_image->product_id = $pid; $stmt_product_image = $product_image->readFirst(); while($row_product_image = $stmt_product_image->fetch(PDO::FETCH_ASSOC)) { echo '<div class="mb-1">'; echo '<img src="img/{$row_product_image[name]}" class="w-100" />'; echo '</div>'; } echo '<div class="product-name mb-1">{$name}</div>'; echo '</a>'; echo '</div>'; } class ProductImage { private $pdoConn; private $table_name = "product_images"; public $id; public $product_id; public $name; public $timestamp; public function __construct($dbconn) { $this->pdoConn = $dbconn; } function readFirst() { // SELECT query $query = "SELECT id, pid, name " . "FROM " . $this->table_name . " " . "WHERE pid = ? " . "ORDER BY name DESC " . "LIMIT 0, 1"; // prepare query statement $stmt = $this->pdoConn->prepare($query); // sanitize $this->product_id=htmlspecialchars(strip_tags($this->product_id)); // bind variable as parameter $stmt->bindParam(1, $this->product_id); // execute query $stmt->execute(); // return values return $stmt; } } ?>
I'm trying to do sort of like a web comics site where you make your own comic, add your own characters, text bubbles, backgrounds, etc. Problem is I have no idea how I could output that. Can I somehow make "a print screen out of whatever the browser returns" ?. Can anyone help? Can some please help. I have a mysql database. In the table I have added a colum for pictures as VARCHAR and inserted the locations of the pictures. The pictures are in a seperate folder. I am trying to display the images in a php file but can't see where I am going wrong. This topic has been moved to HTML Help. http://www.phpfreaks.com/forums/index.php?topic=333109.0 Hello all, im fairly new, but i have a question that i cant answer. is it possible to use the contents of a folder as a website background as in my pictures folder would be a tile of the same size images as my website background? and if i upload some more photos it automatically updates the background? and it would get gradually smaller as the more pictures came into the folder like 2 pics would be side by side 4 would be one in each corner and 6 and 8 and so forth so basically it sizes them equally so that it fills the page. any ideas ? cheers Hi, I have the following table: ID picName description date 1 Us Time.jpg A couple watching the sunset at Ballintoy Harbour 2011-02-04 2 Pic.jpg This is the house on Castle Island taken in fog. 2011-02-03 3 catblack.jpg Pic of a cat 2011-02-05 I am trying to display th picName that belongs to the highest date but only know how to display all pictures. Can anybody help me? Here is what I have: <?php include("db.inc"); $cxn = mysqli_connect($host,$user,$password,$dbname) or die ("couldn't connect to server"); /* Select */ $query = "SELECT * FROM pictures"; $result = mysqli_query($cxn,$query) or die ("Couldn't execute query."); while($row = mysqli_fetch_assoc($result)) { echo "<tr><td colspan=2> </td> <td><img src='./images/{$row['picName']}' border='0' width='500' height='400' /><p></td></tr>\n"; } ?> here is my code , its supposed to show a picture , but it doesnt i use a function in a function ... function posts Code: [Select] function posts($query, $action_type) { $session = $logOptions_id; if($action_type=="newPost") { $class = "class='new'"; } else { $class = ""; } while($row = mysql_fetch_array($query)) { $id = $row['id']; $to_id = $row['to_id']; $from_id = $row['from_id']; $post = stripslashes(linkify(nl2br(htmlentities($row['post'])))); $type = $row['type']; $state = $row['state']; $date = time_stamp($row['date']); ?> <li id=<?php print $id?>> <div class="post-left"></div> <div class="post-right"> <!---ARROW--> <div class="arrow-border"><div class="arrow"></div></div> <div class="post-body"><div class="post-Spic"><?php Spic($from_id, 55)?></div><?php print $post?></div> <div class="post-top"> <a class="post-name" href="profile.php?id=<?php print $from_id?>"><?php name($from_id)?></a> | <a href="#/posts&id=<?php print $id?>" class="post-date" title="<?php print date('l, jS \of F, Y \a\t g:ia ', $row['date']);?>"><?php print $date?></a> | <a class="post-comment" id="comment-toggle<?php print $id?>" onClick="comment_toggle('<?php print $id?>')">Comment</a> |<?php/*<a class="post-like" id="PostLike<?php print $id?>" onClick="<?php print $like_unlike?>('<?php print $id?>')"><?php print ucwords($like_unlike)?></a> <div class="num-likes" id="NumLikes<?php print $id?>"><?php print $num_likes?>*/?></div> </div> </li>function Spic Code: [Select] function Spic($id, $px) { if($px) { if($px>=0&&$px<=42) { $size = "_30"; } else if($px>=43&&$px<=70) { $size = "_55"; } else if($px>=71&&$px<=97) { $size = "_85"; } else if($px>=98&&$px<=155) { $size = "_110"; } else if($px>=156&&$px<=425) { $size = "_200"; } else if($px>=426) { $size = "_650"; } } else { $size = ''; } { $check_pic = "members/$id/image01.jpg"; $default_pic = "members/0/image01.jpg"; if (file_exists($check_pic)) { $user_pic = "<img src=\"$check_pic?$cacheBuster\" $size />"; } else { $user_pic = "<img src=\"$default_pic\" $size />"; } } Hello, I was wondering how you can find out the extension of the image (so .gif, or .jpg). Because i need to make an image uploader thingy, and i want to change the name of the picture to some random string, but keep the extension the same. My friend said i could do it in regex but i have no idea.. Thanks Jragon. I was wondering how most people use salt or what is the order of the steps to use salt? Does the script take the new password then encrypt it then add salt and in encrypt it again, are they just added together and then encrypted or is it a combination of something like that? And I guess the de-encrypting would be the reverse. Not looking for code just the big picture. Thanks S ok here is the portfolio.php page where it shows from db pictures ordered by 'formid'. When i click to a picture i want me to send to the portofolio_single.php page and show datas (name, date_added, title, etc) of that picture. when i click another picture from portfolio.php send me to the same php and echo different datas (datas of another picture) I wrote to h ref=portfolio_single.php?sid=<?php echo formid?> and trying to get that from portfolio_single.php with sessio. and then show datas but it doesnt work. anyone knows how to do this? Here is portfolio.php: Code: [Select] <?php require_once('Connections/ecommerce_dbcon.php'); ?> <?php if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { if (PHP_VERSION < 6) { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; } $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? doubleval($theValue) : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } mysql_select_db($database_ecommerce_dbcon, $ecommerce_dbcon); $query_portofolioPicRec = "SELECT picture FROM `form` ORDER BY formid DESC"; $portofolioPicRec = mysql_query($query_portofolioPicRec, $ecommerce_dbcon) or die(mysql_error()); $row_portofolioPicRec = mysql_fetch_assoc($portofolioPicRec); $totalRows_portofolioPicRec = mysql_num_rows($portofolioPicRec); mysql_select_db($database_ecommerce_dbcon, $ecommerce_dbcon); $query_formidRec = "SELECT formId FROM `form`"; $formidRec = mysql_query($query_formidRec, $ecommerce_dbcon) or die(mysql_error()); $row_formidRec = mysql_fetch_assoc($formidRec); $totalRows_formidRec = mysql_num_rows($formidRec); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title> Portfolio</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <!-- Stylesheets --> <link rel="stylesheet" href="css/reset.css" /> <link rel="stylesheet" href="css/styles.css" /> <!-- Scripts --> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"></script> <!--[if IE 6]> <script src="js/DD_belatedPNG_0.0.8a-min.js"></script> <script> /* EXAMPLE */ DD_belatedPNG.fix('.button'); /* string argument can be any CSS selector */ /* .png_bg example is unnecessary */ /* change it to what suits you! */ </script> <![endif]--> </head> <body class="portfolio"> <div id="wrapper" class="container_12 clearfix"> <!-- Navigation Menu --> <ul id="navigation" class="grid_8"> <li><a href="contact.php"><span class="meta">Get in touch</span><br />Contact Us</a></li> <li><a href="blog.php"><span class="meta">Latest news</span><br />Blog</a></li> <li><a href="portfolio.php" class="current"><span class="meta">Our latest work</span><br />Portfolio</a></li> <li><a href="about.php"><span class="meta">Who are we?</span><br />About</a></li> <li><a href="index.php"><span class="meta">Homepage</span><br />Home</a></li> </ul> <div class="hr grid_12 clearfix"> </div> <!-- Portfolio Items --> <!-- Section 1 --> <!-- Section 3 --> <div class="catagory_1 clearfix"> <!-- Row 1 --> <div class="grid_3 textright" > <span class="meta">Our Latest and Greatest Work</span> <h4 class="title ">Portfolio</h4> <div class="hr clearfix dotted"> </div> <p>Here you can see all the cars that exist in our database. You can navigate through all of them.</p> </div> <div class="grid_9"> <table > <tr> <?php $portofolioPicRec_endRow = 0; $portofolioPicRec_columns = 3; // number of columns $portofolioPicRec_hloopRow1 = 0; // first row flag do { if($portofolioPicRec_endRow == 0 && $portofolioPicRec_hloopRow1++ != 0) echo "<tr>"; ?> <td><a class="portfolio_item float alpha" href="portfolio_single.php?sid=<?php echo $row_formidRec['formId']; ?> ; ?>"> <span>Read More</span> <img class="" src="adminform_images/<?php echo $row_portofolioPicRec['picture']; ?>" alt=""/></a></td> <?php $portofolioPicRec_endRow++; if($portofolioPicRec_endRow >= $portofolioPicRec_columns) { ?> </tr> <?php $portofolioPicRec_endRow = 0; } } while ($row_portofolioPicRec = mysql_fetch_assoc($portofolioPicRec)); if($portofolioPicRec_endRow != 0) { while ($portofolioPicRec_endRow < $portofolioPicRec_columns) { echo("<td> </td>"); $portofolioPicRec_endRow++; } echo("</tr>"); }?> </table> </div> </div> <div class="hr grid_12 clearfix"> </div> </div><!--end wrapper--> </body> </html> <?php mysql_free_result($portofolioPicRec); mysql_free_result($formidRec); ?> and here is portfolio_single.php: Code: [Select] <?php session_start(); $who = (int) $_GET['sid']; require_once('Connections/ecommerce_dbcon.php'); ?> <?php if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { if (PHP_VERSION < 6) { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; } $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? doubleval($theValue) : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } mysql_select_db($database_ecommerce_dbcon, $ecommerce_dbcon); $query_portfolioSingleRec = "SELECT * FROM `form` where formid='$who'"; $portfolioSingleRec = mysql_query($query_portfolioSingleRec, $ecommerce_dbcon) or die(mysql_error()); $row_portfolioSingleRec = mysql_fetch_assoc($portfolioSingleRec); $totalRows_portfolioSingleRec = mysql_num_rows($portfolioSingleRec); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Aurelius | Portfolio >> Project Title</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <!-- Stylesheets --> <link rel="stylesheet" href="css/reset.css" /> <link rel="stylesheet" href="css/styles.css" /> <!-- Scripts --> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"></script> <script type="text/javascript" src="js/jquery.roundabout-1.0.min.js"></script> <script type="text/javascript" src="js/jquery.easing.1.3.js"></script> <script type="text/javascript" src="js/jquery.roundabout-shapes-1.1.js"></script> <script type="text/javascript"> $(document).ready(function() { //Start up our Project Preview Carosuel $('ul#folio_scroller').roundabout({ easing: 'easeOutInCirc', shape: 'waterWheel', duration: 600 }); }); </script> <!--[if IE 6]> <script src="js/DD_belatedPNG_0.0.8a-min.js"></script> <script> /* EXAMPLE */ DD_belatedPNG.fix('.button'); /* string argument can be any CSS selector */ /* .png_bg example is unnecessary */ /* change it to what suits you! */ </script> <![endif]--> </head> <body> <div id="wrapper" class="container_12 clearfix"> <!-- Text Logo --> <h1 id="logo" class="grid_4">Aurelius</h1> <!-- Navigation Menu --> <ul id="navigation" class="grid_8"> <li><a href="contact.php"><span class="meta">Get in touch</span><br />Contact Us</a></li> <li><a href="blog.php"><span class="meta">Latest news</span><br />Blog</a></li> <li><a href="portfolio.php" class="current"><span class="meta">Our latest work</span><br />Portfolio</a></li> <li><a href="about.php"><span class="meta">Who are we?</span><br />About</a></li> <li><a href="index.php"><span class="meta">Homepage</span><br />Home</a></li> </ul> <div class="hr grid_12 clearfix"> </div> <!-- Catch Line and Link --> <h2 class="grid_12 caption clearfix">Our <span>portfolio</span>, home to our latest, and greatest work.</h2> <div class="hr grid_12 clearfix"> </div> <!-- Column 1 / Project Information --> <div class="grid_4"> <a class="meta" href="#">www.siteurlgoeshere.com</a> <h4 class="title">Project Name</h4> <div class="hr dotted clearfix"> </div> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. <b>Mauris vel porta erat.</b> Quisque sit amet risus at odio pellentesque sollicitudin. Proin suscipit molestie facilisis. Aenean vel massa magna. Proin nec lacinia augue. Mauris venenatis libero nec odio viverra consequat. In hac habitasse platea dictumst.</p> <p>Cras vestibulum lorem et dui mollis sed posuere leo semper. Integer ac ultrices neque. Cras lacinia orci a augue tempor egestas. Sed cursus, sem ut vehicula vehicula, ipsum est mattis justo, at volutpat nibh arcu sit amet risus. Vestibulum tincidunt, eros ut commodo laoreet, arcu eros ultrices nibh, ac auctor est dui vel nibh.</p> <p class="clearfix"> <a href="portfolio.php" class="button float"><< Back to Portfolio</a> <a href="#" class="button float right">Visit Site</a> </p> </div> <!-- Column 2 / Image Carosuel --> <div id="folio_scroller_container" class="grid_8 cleafix"> <ul id="folio_scroller"> <li><span>Homepage</span><a href="#"><img alt="" src="adminform_images/<?php echo $row_portfolioSingleRec['picture']; ?>" /></a></li> </ul> </div> </div><!--end wrapper--> </body> </html> <?php mysql_free_result($portfolioSingleRec); ?> |