PHP - How To Not Display Picture Icon If No Picture In Mysql Database
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 Similar TutorialsCan 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. 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"; } ?> Hi 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. Hi, I need some assistance with coding a form to upload a picture into MySQL DB. This will be part of a form and have a field where the user can upload a picture from where-ever, click submit and the image is uploaded into MySQL. If anyone has done this and can offer assistance with the html coding, PHP and how to set the field in MySQL, I would be greatly appreciative. Whats the best way to make a database driven menu ? Right now I have a db that looks like id | boats | Inshore id | boats | Offshore id | boats | Bay Boats and so on I'm think of going to database 1 id-1 | boats database 2 id | 1 | inshore or would a multideminsional array work best. My goal is to have the short term format be Boats Inshore Offshore Bay Boats and in the long term a format whose style I can change later, I wanted to get ideas from people in the know and have done this before. Thanks in advance Hi all, creating a MYSQL, PHP & XHTML site designed to support local rugby clubs. Just putting the final touches to the functionality now so thanks for your help so far. I would like to provide site administrators with the ability to assign photos to a members profile when initially registering their account, I have no experience of dealing with what presumably will be a function that will upload a photo to a location and then linking it some how to data in the database. Thanks for your help, Tom 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! This topic has been moved to HTML Help. http://www.phpfreaks.com/forums/index.php?topic=333109.0 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 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 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? 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; } } ?>
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
Hi,
I am a complete beginner in PHP.
I am trying to create an online movie site as a training.
However, I am stuck on the last part.
I have created a first page with a list to sort the movies by year.
A second displaying the movies that were released the year selected.
On the third page I would like to have, when clicking on the picture in page 2 as a recap the picture of the movies, its title, synopsis and the year of released using the _GET method and generating a html link.
Just as shown he http://papystreaming.com/fr/
I am stuck on this last part as I am not able to generate a link only for ONE movie at the time.
Could anyone help please?
See below my (rather long) script.
Many thanks in advance.
****************Page 1*****************************
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="style.css">
<title>Cinéfil online</title>
</head>
<body>
<form action="movies.php" action="page1.php" method="get">
<fieldset>
<legend>Films</legend>
<p>
<label for="picture">Recherche de films par année :</label>
<select name="picture" id="picture">
<option value="2014">2014</option>
<option value="2015">2015</option>
<option value="2016">2016</option>
<option value="2017">2017</option>
<option value="2018">2018</option>
<option value="2019">2019</option>
</select>
</p>
<p id="submit" class="search">
<input id="bt" type="submit" name="Rechercher" value="Rechercher">
</p>
</fieldset>
</form>
</body>
</html>
****************Page 2*****************************
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="style.css">
<link rel="stylesheet" href="styles.css"> <!--************Added CSS -->
<?php
$images = [
['picture'=>'2014', 'image1'=>'img/hercules.jpg','movie1'=> 'Hercules','synopsis1' => 'Having endured his legendary twelve labors, Hercules, the Greek demigod, has his life as a sword-for-hire tested when the King of Thrace and his daughter seek his aid in defeating a tyrannical warlord', 'image2'=>'img/anarchy.jpg', 'movie2' => 'The Purge : Anarchy', 'synopsis2' => 'Three groups of people intertwine and are left stranded in the streets on Purge Night, trying to survive the chaos and violence that occurs. ', 'image3'=>'img/lucy.jpg', 'movie3' => 'Lucy', 'synopsis3' => 'A woman, accidentally caught in a dark deal, turns the tables on her captors and transforms into a merciless warrior evolved beyond human logic.', 'image4'=>'img/dracula-untold.jpg', 'movie4' => 'Dracula Untold','synopsis4' => 'As his kingdom is being threatened by the Turks, young prince Vlad Tepes must become a monster feared by his people in order to obtain the power needed to protect his own kingdom.', 'image5'=>'img/the-hobbit.jpg', 'movie5' => 'The Hobbit, Batte of the Five Armies', 'synopsis5' => 'Bilbo and company are forced to engage in a war against an array of combatants and keep the Lonely Mountain from falling into the hands of a rising darkness.', 'image6'=>'img/the-amazing-spider-man-2.jpg', 'movie6'=> 'The Amazing Spider Man 2', 'synopsis6' => 'When New York is put under siege by Oscorp, it is up to Spider-Man to save the city he swore to protect as well as his loved ones.', 'image7'=>'img/edge-of-tomorrow.jpg', 'movie7' => 'Edge of Tomorrow', 'synopsis7' => 'A soldier fighting aliens gets to relive the same day over and over again, the day restarting every time he dies.', 'image8'=>'img/grudge-match.jpg', 'movie8' => 'Grudge Match', 'synopsis8' => 'A pair of aging boxing rivals are coaxed out of retirement to fight one final bout, thirty years after their last match.', 'image9'=>'img/jamesy-boy.jpg', 'movie9' => 'Jamesy Boy', 'synopsis9' => 'A young gang member turns his life around in prison, thanks to the friendship he forms with a convicted murderer who becomes his mentor.', 'image10'=>'img/noah.jpg', 'movie10' => 'Noah', 'synopsis10' => 'Noah is chosen by God to undertake a momentous mission before an apocalyptic flood cleanses the world.', 'image11'=>'img/the-outsider.jpg', 'movie11'=> 'The Outsider', 'synopsis11' => 'The plot revolves around British military contractor Lex Walker, who is told his daughter has died. When he arrives in Los Angeles and discovers the body is not hers, he begins an investigation.', 'image12'=>'img/interstellar.jpg', 'movie12' => 'Interstellar', 'synopsis12' => 'A team of explorers travel through a wormhole in space in an attempt to ensure humanitys survival.', 'image13'=>'img/the-equalizer.jpg', 'movie13' => 'The Equalizer', 'synopsis13' => 'A man believes he has put his mysterious past behind him and has dedicated himself to beginning a new life. But when he meets a young girl under the control of ultra-violent Russian gangsters, he cant stand idly by...', 'image14'=>'img/the-book-of-life.jpg', 'movie14' => 'The Book of Life', 'synopsis14' => 'Manolo, a young man who is torn between fulfilling the expectations of his family and following his heart, embarks on an adventure that spans three fantastic worlds where he must face his greatest fears.', 'image15'=>'img/the-look-alike.jpg', 'movie15' => 'The Look Alike', 'synopsis15' => 'Sadies death propels a former basketball champion, a deaf beauty, a drug addict, and an aspiring actress into an unlikely romance and a desperate quest to appease drug-lord William Spinks.', 'image16'=>'img/pride.jpg', 'movie16'=> 'Pride', 'synopsis16' => 'U.K. gay activists work to help miners during their lengthy strike of the National Union of Mineworkers in the summer of 1984.', 'image17'=>'img/third-person.jpg','movie17' => 'Third Person', 'synopsis17' => 'Suzan, an Arab- Israeli woman, must reshape her identity when she discovers at 35 that she was born intersexual.', 'image18'=>'img/night-moves.jpg','movie18' => 'Night Moves', 'synopsis18' => 'Three radical environmentalists look to execute the protest of their lives: the explosion of a hydroelectric dam.', 'image19'=>'img/john-wick.jpg','movie19' => 'John Wick', 'synopsis19' => 'An ex-hit-man comes out of retirement to track down the gangsters that killed his dog and took everything from him.', 'image20'=>'img/i-origins.jpg','movie20' => 'I-Origins','synopsis20' => 'A molecular biologist and his laboratory partner uncover evidence that may fundamentally change society as we know it.'],
['picture'=>'2015', 'image1'=>'img/avengers-age-of-ultron.jpg','movie1'=> 'Avengers Age of Ultron', 'synopsis1' => 'When Tony Stark and Bruce Banner try to jump-start a dormant peacekeeping program called Ultron, things go horribly wrong and it is up to Earth mightiest heroes to stop the villainous Ultron.', 'image2'=>'img/jurassic-world.jpg', 'movie2' => 'Jurassic World', 'synopsis2' => 'A new theme park, built on the original site of Jurassic Park, creates a genetically modified hybrid dinosaur, the Indominus Rex, which escapes containment and goes on a killing spree.', 'image3'=>'img/survivor.jpg', 'movie3' => 'Survivor', 'synopsis3' => 'A Foreign Service Officer in London tries to prevent a terrorist attack set to hit New York City, but is forced to go on the run when she is framed for crimes she did not commit.', 'image4'=>'img/the-wave.jpg', 'movie4' => 'The Wave', 'synopsis4' => 'Although anticipated, no one is really ready when the mountain pass above the scenic, narrow Norwegian fjord Geiranger collapses and creates an 85-meter high violent tsunami.', 'image5'=>'img/spectre.jpg', 'movie5' => 'Spectre', 'synopsis5' => 'A cryptic message from 007 past sends him pitted against a mysterious terrorist organization called Spectre, and learns of its involvement in previous events of his most dangerous missions.', 'image6'=>'img/chappie.jpg','movie6'=> 'Chappie', 'synopsis6' => 'In the near future, crime is patrolled by a mechanized police force. When one police droid, Chappie, is stolen and given new programming, he becomes the first robot with the ability to think and feel for himself.', 'image7'=>'img/terminator-genisys.jpg', 'movie7' => 'Terminator Genisys', 'synopsis7' => 'When John Connor, leader of the human resistance, sends Sgt. Kyle Reese back to 1984 to protect Sarah Connor and safeguard the future, an unexpected turn of events creates a fractured timeline.', 'image8'=>'img/the-last-kingdom.jpg', 'movie8' => 'The Last Kingdom', 'synopsis8' => 'As Alfred the Great defends his kingdom from Norse invaders, Uhtred - born a Saxon but raised by Vikings - seeks to claim his ancestral birthright.', 'image9'=>'img/focus.jpg', 'movie9' => 'Focus', 'synopsis9' => 'In the midst of veteran con man Nickys latest scheme, a woman from his past - now an accomplished femme fatale - shows up and throws his plans for a loop.', 'image10'=>'img/kingsman-the-secret-service', 'movie10' => 'Kingsman The Secret Service', 'synopsis10' => 'A spy organization recruits an unrefined, but promising street kid into the agencys ultra-competitive training program, just as a global threat emerges from a twisted tech genius.', 'image11'=>'img/mission-impossible-rogue-nation.jpg', 'movie11'=> 'Mission Impossible Rogue Nation', 'synopsis11' => 'Ethan and team take on their most impossible mission yet, eradicating the Syndicate - an International rogue organization as highly skilled as they are, committed to destroying the IMF.', 'image12'=>'img/minority-report.jpg', 'movie12' => 'Minority Report', 'synopsis12' => '10 years after the end of Precrime in Washington DC one of the three PreCogs attempts to lead on a normal life while still suffering from visions of the future. Will they be able to hold it together or mentally breakdown and give up?', 'image13'=>'img/blindspot.jpg', 'movie13' => 'Blindspot', 'synopsis13' => 'Jane Doe is found in Times Square with no memory and mysterious tattoos on her body.', 'image14'=>'img/tracers.jpg', 'movie14' => 'Tracers', 'synopsis14' => 'Wanted by the Chinese mafia, a New York City bike messenger escapes into the world of parkour after meeting a beautiful stranger.', 'image15'=>'img/steve-jobs.jpg', 'movie15' => 'Steve Jobs','synopsis15' => 'Steve Jobs takes us behind the scenes of the digital revolution, to paint a portrait of the man at its epicenter. The story unfolds backstage at three iconic product launches, ending in 1998 with the unveiling of the iMac.', 'image16'=>'img/ant-man.jpg', 'movie16'=> 'Ant-Man', 'synopsis16' => 'Armed with a super-suit with the astonishing ability to shrink in scale but increase in strength, cat burglar Scott Lang must embrace his inner hero and help his mentor, Dr. Hank Pym, plan and pull off a heist that will save the world.', 'image17'=>'img/childhoods-end.jpg','movie17' => 'Childhood End', 'synopsis17' => 'After peaceful aliens invade earth, humanity finds itself living in a utopia under the indirect rule of the aliens, but does this utopia come at a price? ','image18'=>'img/extant.jpg','movie18' => 'Extant', 'synopsis18' => 'An astronaut struggles to learn how she became pregnant while on a thirteen-month-long solo space mission.', 'image19'=>'img/project-almanac.jpg','movie19' => 'Project Almanac', 'synopsis19' => 'A group of teens discover secret plans of a time machine, and construct one. However, things start to get out of control.', 'image20'=>'img/everest.jpg','movie20' => 'Everest','synopsis20' => 'The story of New Zealands Robert "Rob" Edwin Hall, who on May 10, 1996, together with Scott Fischer, teamed up on a joint expedition to ascend Mount Everest.'],
['picture'=>'2016', 'image1'=>'img/la-la-land.jpg','movie1'=> 'La La Land', 'synopsis1' => 'While navigating their careers in Los Angeles, a pianist and an actress fall in love while attempting to reconcile their aspirations for the future.', 'image2'=>'img/captain-america-civil-war.jpg', 'movie2' => 'Captain America: Civil War', 'synopsis2' => 'Political involvement in the Avengers affairs causes a rift between Captain America and Iron Man.', 'image3'=>'img/moana.jpg', 'movie3' => 'Moana', 'synopsis3' => 'In Ancient Polynesia, when a terrible curse incurred by the Demigod Maui reaches Moanas island, she answers the Ocean call to seek out the Demigod to set things right. ', 'image4'=>'img/free-state-of-jones.jpg', 'movie4' => 'Free State of Jones', 'synopsis4' => 'A disillusioned Confederate army deserter returns to Mississippi and leads a militia of fellow deserters and women in an uprising against the corrupt local Confederate government.', 'image5'=>'img/doctor-strange.jpg', 'movie5' => 'Doctor Strange', 'synopsis5' => 'While on a journey of physical and spiritual healing, a brilliant neurosurgeon is drawn into the world of the mystic arts.', 'image6'=>'img/preacher.jpg','movie6'=> 'Preacher', 'synopsis6' => 'After a supernatural event at his church, a preacher enlists the help of a vampire and his ex to find God.', 'image7'=>'img/luke-cage.jpg', 'movie7' => 'Luke Cage', 'synopsis7' => 'When a sabotaged experiment gives him super strength and unbreakable skin, Luke Cage becomes a fugitive attempting to rebuild his life in Harlem and must soon confront his past and fight a battle for the heart of his city.' , 'image8'=>'img/the-hateful-eight.jpg', 'movie8' => 'The Hateful Eight', 'synopsis8' => 'In the dead of a Wyoming winter, a bounty hunter and his prisoner find shelter in a cabin currently inhabited by a collection of nefarious characters.' , 'image9'=>'img/trolls.jpg', 'movie9' => 'Trolls', 'synopsis9' => 'After the Bergens invade Troll Village, Poppy, the happiest Troll ever born, and the curmudgeonly Branch set off on a journey to rescue her friends.','image10'=>'img/ghostbusters.jpg', 'movie10' => 'Ghostbusters', 'synopsis10' => 'Following a ghost invasion of Manhattan, paranormal enthusiasts Erin Gilbert and Abby Yates, nuclear engineer Jillian Holtzmann, and subway worker Patty Tolan band together to stop the otherworldly threat.', 'image11'=>'img/fantastic-beasts.jpg', 'movie11'=> 'Fantastic Beasts and Where to Find Them','synopsis11' => 'The adventures of writer Newt Scamander in New Yorks secret community of witches and wizards seventy years before Harry Potter reads his book in school.', 'image12'=>'img/the-magnificent-seven.jpg', 'movie12' => 'The Magnificent Seven', 'synopsis12' => 'Seven gunmen from a variety of backgrounds are brought together by a vengeful young widow to protect her town from the private army of a destructive industrialist.', 'image13'=>'img/genius.jpg', 'movie13' => 'Genius', 'synopsis13' => 'A chronicle of Max Perkinss time as the book editor at Scribner, where he oversaw works by Thomas Wolfe, Ernest Hemingway, F. Scott Fitzgerald and others.', 'image14'=>'img/cell.jpg', 'movie14' => 'Cell', 'synopsis14' => 'When a mysterious cell phone signal causes apocalyptic chaos, an artist is determined to reunite with his young son in New England.', 'image15'=>'img/arrival.jpg', 'movie15' => 'Arrival', 'synopsis15' => 'A linguist works with the military to communicate with alien lifeforms after twelve mysterious spacecraft appear around the world.', 'image16'=>'img/apocalypse.jpg', 'movie16'=> 'X-Men: Apocalypse', 'synopsis16' => 'In the 1980s the X-Men must defeat an ancient all-powerful mutant, En Sabah Nur, who intends to thrive through bringing destruction to the world.', 'image17'=>'img/collateral-beauty.jpg','movie17' => 'Collateral Beauty', 'synopsis17' => 'A man questions the universe by writing to Love, Time and Death. Receiving unexpected answers, he begins to see how these things interlock and how even loss can reveal moments of meaning and beauty.', 'image18'=>'img/warriors-gate.jpg','movie18' => 'The Warriors Gate', 'synopsis18' => 'A teenager is magically transported to China and learns to convert his video game skills into those of a Kung Fu warrior. ', 'image19'=>'img/max-steel.jpg','movie19' => 'Max Steel','synopsis19' => 'The adventures of teenager Max McGrath and his alien companion, Steel, who must harness and combine their tremendous new powers to evolve into the turbo-charged superhero Max Steel. ', 'image20'=>'img/skiptrace.jpg','movie20' => 'Skiptrace', 'synopsis20' => 'A detective from Hong Kong teams up with an American gambler to battle against a notorious Chinese criminal.'],
['picture'=>'2017', 'image1'=>'img/justice-league.jpg','movie1'=> 'Justice League', 'synopsis1' => 'Fueled by his restored faith in humanity and inspired by Supermans selfless act, Bruce Wayne enlists the help of his new-found ally, Diana Prince, to face an even greater enemy.
', 'image2'=>'img/blade-runner-2049.jpg', 'movie2' => 'Blade Runner 2049', 'synopsis2' => 'A young blade runners discovery of a long-buried secret leads him to track down former blade runner Rick Deckard, whos been missing for thirty years.', 'image3'=>'img/it.jpg', 'movie3' => 'It', 'synopsis3' => 'In the summer of 1989, a group of bullied kids band together to destroy a shape-shifting monster, which disguises itself as a clown and preys on the children of Derry, their small Maine town.', 'image4'=>'img/assassins-creed.jpg', 'movie4' => 'Assassins Creed', 'synopsis4' => 'A prequel to the Assassins Creed Franchise set in Egypt from 48 BC where Bayek, a Medjay, begins the foundation of the Assassins Brotherhood.', 'image5'=>'img/the-fate-of-the-furious.jpg','movie5'=> 'The Fate of the Furious', 'synopsis5' => 'When a mysterious woman seduces Dom into the world of terrorism and a betrayal of those closest to him, the crew face trials that will test them as never before.', 'image6'=>'img/dunkirk.jpg','movie6'=> 'Dunkirk', 'synopsis6' => 'Allied soldiers from Belgium, the British Empire, and France are surrounded by the German Army, and evacuated during a fierce battle in World War II.', 'image7'=>'img/rings.jpg', 'movie7' => 'Rings', 'synopsis7' => 'A young woman finds herself on the receiving end of a terrifying curse that threatens to take her life in 7 days.', 'image8'=>'img/planet-of-the-apes.jpg', 'movie8' => 'War for the Planet of the Apes', 'synopsis8' => 'After the apes suffer unimaginable losses, Caesar wrestles with his darker instincts and begins his own mythic quest to avenge his kind.', 'image9'=>'img/split.jpg', 'movie9' => 'Split', 'synopsis9' => 'Three girls are kidnapped by a man with a diagnosed 23 distinct personalities. They must try to escape before the apparent emergence of a frightful new 24th.', 'image10'=>'img/logan.jpg', 'movie10' => 'Logan', 'synopsis10' => 'In a future where mutants are nearly extinct, an elderly and weary Logan leads a quiet life. But when Laura, a mutant child pursued by scientists, comes to him for help, he must get her to safety.', 'image11'=>'img/hidden-figures.jpg', 'movie11'=> 'Hidden Figures', 'synopsis11' => 'The story of a team of female African-American mathematicians who served a vital role in NASA during the early years of the U.S. space program.', 'image12'=>'img/power-rangers.jpg', 'movie12' => 'Power Rangers', 'synopsis12' => 'A group of high-school students, who are infused with unique superpowers, harness their abilities in order to save the world.', 'image13'=>'img/aftermath.jpg', 'movie13' => 'Aftermath', 'synopsis13' => 'Two strangers lives become inextricably bound together after a devastating plane crash.', 'image14'=>'img/alias-grace.jpg', 'movie14' => 'Alias Grace', 'synopsis14' => 'In 19th-century Canada, a psychiatrist weighs whether a murderess should be pardoned due to insanity.', 'image15'=>'img/victoria-and-abdul.jpg', 'movie15' => 'Victoria and Abdul', 'synopsis15' => 'Queen Victoria strikes up an unlikely friendship with a young Indian clerk named Abdul Karim.', 'image16'=>'img/counterpart.jpg', 'movie16'=> 'Counterpart', 'synopsis16' => 'A hapless UN employee discovers the agency he works for is hiding a gateway to a parallel dimension thats in Cold War with our own, and where his other self is a top spy.', 'image17'=>'img/xxx-return-of-xander-cage.jpg','movie17' => 'XXX Return of Xander Cage', 'synopsis17' => 'Xander Cage is left for dead after an incident, though he secretly returns to action for a new, tough assignment with his handler Augustus Gibbons.', 'image18'=>'img/pirates.jpg','movie18' => 'Pirates of the Caribbean: Dead Men Tell No Tales' , 'synopsis18' => 'Captain Jack Sparrow searches for the trident of Poseidon while being pursued by an undead sea captain and his crew.', 'image19'=>'img/the-mummy.jpg','movie19' => 'The Mummy', 'synopsis19' => 'An ancient Egyptian princess is awakened from her crypt beneath the desert, bringing with her malevolence grown over millennia, and terrors that defy human comprehension. ', 'image20'=>'img/beauty-and-the-beast.jpg','movie20' => 'Beauty and the Beast', 'synopsis20' => 'A selfish prince is cursed to become a monster for the rest of his life, unless he learns to fall in love with a beautiful young woman he keeps prisoner.'],
['picture'=>'2018', 'image1'=>'img/black-panther.jpg','movie1'=> 'Black Panther', 'synopsis1' => 'TChalla, heir to the hidden but advanced kingdom of Wakanda, must step forward to lead his people into a new future and must confront a challenger from his countrys past.
', 'image2'=>'img/pacific-rim-uprising.jpg', 'movie2' => 'Pacific Rim : Uprising', 'synopsis2' => 'Jake Pentecost, son of Stacker Pentecost, reunites with Mako Mori to lead a new generation of Jaeger pilots, including rival Lambert and 15-year-old hacker Amara, against a new Kaiju threat.', 'image3'=>'img/deadpool-2.jpg', 'movie3' => 'Deadpool 2', 'synopsis3' => 'Foul-mouthed mutant mercenary Wade Wilson (AKA. Deadpool), brings together a team of fellow mutant rogues to protect a young boy with supernatural abilities from the brutal, time-traveling cyborg, Cable.', 'image4'=>'img/tomb-raider.jpg', 'movie4' => 'Tomb Raider', 'synopsis4' => 'Lara Croft, the fiercely independent daughter of a missing adventurer, must push herself beyond her limits when she discovers the island where her father disappeared.', 'image5'=>'img/darkest-hour.jpg', 'movie5' => 'Darkest Hour', 'synopsis5' => 'In May 1940, the fate of Western Europe hangs on British Prime Minister Winston Churchill, who must decide whether to negotiate with Adolf Hitler, or fight on knowing that it could mean a humiliating defeat for Britain and its empire.', 'image6'=>'img/rampage.jpg', 'movie6'=> 'Rampage', 'synopsis6' => 'When three different animals become infected with a dangerous pathogen, a primatologist and a geneticist team up to stop them from destroying Chicago.', 'image7'=>'img/creed.jpg', 'movie7' => 'Creed II', 'synopsis7' => 'Under the tutelage of Rocky Balboa, heavyweight contender Adonis Creed faces off against Viktor Drago, son of Ivan Drago.', 'image8'=>'img/mortal-engines.jpg', 'movie8' => 'Mortal Engines', 'synopsis8' => 'In a post-apocalyptic world where cities ride on wheels and consume each other to survive, two people meet in London and try to stop a conspiracy.', 'image9'=>'img/la-to-vegas.jpg', 'movie9' => 'L.A. to Vegas', 'synopsis9' => 'An ensemble workplace comedy about a group of underdogs trying to find their place in the world, set on the Friday night flight from LAX to Vegas and the returning flight on Sunday.', 'image10'=>'img/venom.jpg', 'movie10' => 'Venom', 'synopsis10' => 'A failed reporter is bonded to an alien entity, one of many symbiotes who have invaded Earth. But the being takes a liking to Earth and decides to protect it.', 'image11'=>'img/predator.jpg', 'movie11'=> 'The Predator', 'synopsis11' => 'When a young boy accidentally triggers the universes most lethal hunters return to Earth, only a ragtag crew of ex-soldiers and a disgruntled scientist can prevent the end of the human race.', 'image12'=>'img/rhapsody.jpg', 'movie12' => 'Bohemian Rhapsody', 'synopsis12' => 'The story of the legendary rock band Queen and lead singer Freddie Mercury, leading up to their famous performance at Live Aid (1985).', 'image13'=>'img/solo.jpg', 'movie13' => 'Solo: A Star Wars Story', 'synopsis13' => 'During an adventure into the criminal underworld, Han Solo meets his future co-pilot Chewbacca and encounters Lando Calrissian years before joining the Rebellion.', 'image14'=>'img/equalizer-2.jpg', 'movie14' => 'The Equalizer 2', 'synopsis14' => 'TChalla, heir to the hidden but advanced kingdom of Wakanda, must step forward to lead his people into a new future and must confront a challenger from his countrys past.', 'image15'=>'img/shape-of-water.jpg', 'movie15' => 'The Shape of Water', 'synopsis15' => 'At a top secret research facility in the 1960s, a lonely janitor forms a unique relationship with an amphibious creature that is being held in captivity. ', 'image16'=>'img/midnight-sun.jpg', 'movie16'=> 'Midnight Sun', 'synopsis16' => 'A 17-year-old girl suffers from a condition that prevents her from being out in the sunlight.', 'image17'=>'img/the-death-of-stalin.jpg','movie17' => 'The Death of Stalin', 'synopsis17' => 'Moscow, 1953. After being in power for nearly 30 years, Soviet dictator Josef Stalin takes ill and quickly dies. Now the members of the Council of Ministers scramble for power.', 'image18'=>'img/peter-rabbit.jpg','movie18' => 'Peter Rabbit', 'synopsis18' => 'Feature adaptation of Beatrix Potters classic tale of a rebellious rabbit trying to sneak into a farmers vegetable garden. ', 'image19'=>'img/24-hours-to-live.jpg','movie19' => '24 Hours to Live', 'synopsis19' => 'An assassin seeks redemption after being given a second chance at life.', 'image20'=>'img/the-cloverfield-paradox.jpg','movie20' => 'The Cloverfield Paradox', 'synopsis20' => 'Orbiting a planet on the brink of war, scientists test a device to solve an energy crisis, and end up face-to-face with a dark alternate reality.',],
['picture'=>'2019', 'image1'=>'img/aladdin.jpg','movie1'=> 'Aladdin', 'synopsis1' => 'A kindhearted street urchin and a power-hungry Grand Vizier vie for a magic lamp that has the power to make their deepest wishes come true.', 'image2'=>'img/alita-battle-angel.jpg', 'movie2' => 'Alita Battle Angel', 'synopsis2' => 'A deactivated female cyborg is revived, but cannot remember anything of her past life and goes on a quest to find out who she is.', 'image3'=>'img/annabelle.jpg', 'movie3' => 'Annabelle Comes Home', 'synopsis3' => 'Determined to keep Annabelle from wreaking more havoc, demonologists Ed and Lorraine Warren bring the possessed doll to the locked artifacts room in their home, placing her "safely" behind sacred glass and enlisting a priests holy blessing.', 'image4'=>'img/avengers-endgame.jpg', 'movie4' => 'Avengers Endgame', 'synopsis4' => 'After the devastating events of Avengers: Infinity War, the universe is in ruins. With the help of remaining allies, the Avengers assemble once more in order to undo Thanos actions and restore order to the universe.', 'image5'=>'img/captain-marvel.jpg', 'movie5' => 'Captain Marvel', 'synopsis5' => 'Carol Danvers becomes one of the universes most powerful heroes when Earth is caught in the middle of a galactic war between two alien races.', 'image6'=>'img/dragon-3.jpg','movie6'=> 'How to Train Your Dragon: The Hidden World', 'synopsis6' => 'When Hiccup discovers Toothless is not the only Night Fury, he must seek "The Hidden World", a secret Dragon Utopia before a hired tyrant named Grimmel finds it first.', 'image7'=>'img/glass.jpg', 'movie7' => 'Glass', 'synopsis7' => 'Security guard David Dunn uses his supernatural abilities to track Kevin Wendell Crumb, a disturbed man who has twenty-four personalities.', 'image8'=>'img/happy-birthdead-2-you.jpg', 'movie8' => 'Happy Death Day 2U', 'synopsis8' => 'Tree Gelbman discovers that dying over and over was surprisingly easier than the dangers that lie ahead. ', 'image9'=>'img/hellboy.jpg', 'movie9' => 'Hellboy', 'synopsis9' => 'Based on the graphic novels by Mike Mignola, Hellboy, caught between the worlds of the supernatural and human, battles an ancient sorceress bent on revenge.', 'image10'=>'img/hotel-mumbai.jpg', 'movie10' => 'Hotel Mumbai', 'synopsis10' => 'The true story of the Taj Hotel terrorist attack in Mumbai. Hotel staff risk their lives to keep everyone safe as people make unthinkable sacrifices to protect themselves and their families.', 'image11'=>'img/joker.jpg', 'movie11'=> 'Joker', 'synopsis11' => 'A failed stand-up comedian is driven insane and becomes a psychopathic murderer.', 'image12'=>'img/little.jpg', 'movie12' => 'Little', 'synopsis12' => 'A woman is transformed into her younger self at a point in her life when the pressures of adulthood become too much to bear.', 'image13'=>'img/pet-sematary.jpg', 'movie13' => 'Pet Sematary', 'synopsis13' => 'Dr. Louis Creed and his wife, Rachel, relocate from Boston to rural Maine with their two young children. The couple soon discover a mysterious burial ground hidden deep in the woods near their new home.', 'image14'=>'img/shazam.jpg', 'movie14' => 'Shazam','synopsis14' => 'We all have a superhero inside us, it just takes a bit of magic to bring it out. In Billy Batsons case, by shouting out one word - SHAZAM. - this streetwise fourteen-year-old foster kid can turn into the grown-up superhero Shazam.', 'image15'=>'img/the-lion-king.jpg', 'movie15' => 'The Lion King','synopsis15' => 'After the murder of his father, a young lion prince flees his kingdom only to learn the true meaning of responsibility and bravery.', 'image16'=>'img/tolkien.jpg', 'movie16'=> 'Tolkien', 'synopsis16' => 'Tolkien explores the formative years of the orphaned author as he finds friendship, love and artistic inspiration among a group of fellow outcasts at school.', 'image17'=>'img/toy-story-4.jpg','movie17' => 'Toy Story 4','synopsis17' => 'When a new toy called "Forky" joins Woody and the gang, a road trip alongside old and new friends reveals how big the world can be for a toy.', 'image18'=>'img/us.jpg','movie18' => 'Us', 'synopsis18' => 'A familys serene beach vacation turns to chaos when their doppelgängers appear and begin to terrorize them. ', 'image19'=>'img/xmen-dark-phoenix.jpg','movie19' => 'Xmen Dark Phoenix', 'synopsis19' => 'Jean Grey begins to develop incredible powers that corrupt and turn her into a Dark Phoenix. Now the X-Men will have to decide if the life of a team member is worth more than all the people living in the world. ','image20'=>'img/dumbo.jpg','movie20' => 'Dumbo','synopsis20' => 'A young elephant, whose oversized ears enable him to fly, helps save a struggling circus, but when the circus plans a new venture, Dumbo and his friends discover dark secrets beneath its shiny veneer.'],
];
$picture=$_GET['picture'];
foreach ($images as $key => $image)
{
if ($picture==$image ['picture'])
{
echo '<div id="wrapper" >';
echo "<h2> Résultats de recherche pour les films sortis en " .$image ['picture']. ' :</h2><br/>' ;
echo '<table>';
echo '<tr>';
echo '<td id="block"><a href="page1.php"><img src="' .$image ['image1']. '" height="220" width="148" /><p>' .$image ['synopsis1'].'</p><figcaption>'. $image ['movie1'].'</figcaption> </a> </td>';
echo '<td id="block"><a href="page1.php"><img src="' .$image ['image2']. '" height="220" width="148" /><p>' .$image ['synopsis2'].'</p><figcaption>'. $image ['movie2'].'</figcaption> </a> </td>';
echo '<td id="block"><a href="page1.php"><img src="' .$image ['image3']. '" height="220" width="148" /><p>' .$image ['synopsis3'].'</p><figcaption>'. $image ['movie3'].'</figcaption> </a> </td>';
echo '<td id="block"><a href="page1.php"><img src="' .$image ['image4']. '" height="220" width="148" /><p>' .$image ['synopsis4'].'</p><figcaption>'. $image ['movie4'].'</figcaption> </a> </td>';
echo '<td id="block"><a href="page1.php"><img src="' .$image ['image5']. '" height="220" width="148" /><p>' .$image ['synopsis5'].'</p><figcaption>'. $image ['movie5'].'</figcaption> </a> </td>';
echo '</tr>';
echo '<tr>';
echo '<td id="block"><a href="page1.php"><img src="' .$image ['image6']. '" height="220" width="148" /><p>' .$image ['synopsis6'].'</p><figcaption>'. $image ['movie6'].'</figcaption> </a> </td>';
echo '<td id="block"><a href="page1.php"><img src="' .$image ['image7']. '" height="220" width="148" /><p>' .$image ['synopsis7'].'</p><figcaption>'. $image ['movie7'].'</figcaption> </a> </td>';
echo '<td id="block"><a href="page1.php"><img src="' .$image ['image8']. '" height="220" width="148" /><p>' .$image ['synopsis8'].'</p><figcaption>'. $image ['movie8'].'</figcaption> </a> </td>';
echo '<td id="block"><a href="page1.php"><img src="' .$image ['image9']. '" height="220" width="148" /><p>' .$image ['synopsis9'].'</p><figcaption>'. $image ['movie9'].'</figcaption> </a> </td>';
echo '<td id="block"><a href="page1.php"><img src="' .$image ['image10']. '" height="220" width="148" /><p>' .$image ['synopsis10'].'</p><figcaption>'. $image ['movie10'].'</figcaption> </a> </td>';
echo '</tr>';
echo '<tr>';
echo '<td id="block"><a href="page1.php"><img src="' .$image ['image11']. '" height="220" width="148" /><p>' .$image ['synopsis11'].'</p><figcaption>'. $image ['movie11'].'</figcaption> </a> </td>';
echo '<td id="block"><a href="page1.php"><img src="' .$image ['image12']. '" height="220" width="148" /><p>' .$image ['synopsis12'].'</p><figcaption>'. $image ['movie12'].'</figcaption> </a> </td>';
echo '<td id="block"><a href="page1.php"><img src="' .$image ['image13']. '" height="220" width="148" /><p>' .$image ['synopsis13'].'</p><figcaption>'. $image ['movie13'].'</figcaption> </a> </td>';
echo '<td id="block"><a href="page1.php"><img src="' .$image ['image14']. '" height="220" width="148" /><p>' .$image ['synopsis14'].'</p><figcaption>'. $image ['movie14'].'</figcaption> </a> </td>';
echo '<td id="block"><a href="page1.php"><img src="' .$image ['image15']. '" height="220" width="148" /><p>' .$image ['synopsis15'].'</p><figcaption>'. $image ['movie15'].'</figcaption> </a> </td>';
echo '</tr>';
echo '<tr>';
echo '<td id="block"><a href="page1.php"><img src="' .$image ['image16']. '" height="220" width="148" /><p>' .$image ['synopsis16'].'</p><figcaption>'. $image ['movie16'].'</figcaption> </a> </td>';
echo '<td id="block"><a href="page1.php"><img src="' .$image ['image17']. '" height="220" width="148" /><p>' .$image ['synopsis17'].'</p><figcaption>'. $image ['movie17'].'</figcaption> </a> </td>';
echo '<td id="block"><a href="page1.php"><img src="' .$image ['image18']. '" height="220" width="148" /><p>' .$image ['synopsis18'].'</p><figcaption>'. $image ['movie18'].'</figcaption> </a> </td>';;
echo '<td id="block"><a href="page1.php"><img src="' .$image ['image19']. '" height="220" width="148" /><p>' .$image ['synopsis19'].'</p><figcaption>'. $image ['movie19'].'</figcaption> </a> </td>';
echo '<td id="block"><a href="page1.php"><img src="' .$image ['image20']. '" height="220" width="148" /><p>' .$image ['synopsis20'].'</p><figcaption>'. $image ['movie20'].'</figcaption> </a> </td>';
echo '</tr>';
echo '</table>';
echo "</div>";
}
}
/*
var_dump($images)
*/
?>
************************Page 3 ******************************
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="style.css">
<?php
$image = $_GET[ "image"];
$movie = $_GET[ "movie"];
$synopsis = $_GET["synopsis"];
?>
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="styles.css">
<title>Cinéfil Online Page 3</title>
</head>
<body>
<div id="wrapper">
<header id="main-header">
<nav id="main-nav" class="main-nav">
<ul>
<li class="nav-link"><a href="#">HOME</a></li>
<li class="nav-link"><a href="#">MOVIES</a></li>
<li class="nav-link"><a href="#">TV SHOWS</a></li>
<li class="nav-link"><a href="#">GENRE</a></li>
<li class="nav-link"><a href="#">YEARS</a></li>
</ul>
<label for="search">Search:</label>
<input type="search" id="search" name="search"
aria-label="Search through site content">
<button>Search</button>
<div class="clear"></div>
</nav>
</header>
<main id="main">
<section class="infos">
<h1><?php echo $movie; ?></h1>
<ul class=" details">
<li> Genres: Action, Drama, Thriller </li>
<li>Release date: 2016 </li>
<li>Language: English, French </li>
</ul>
</section>
<section id="left" class="fl">
<?php echo '<img src="' .$image. '" height="345" width="235" />' ; ?>
</section>
<section id="right" class="fl">
<video src="videoplayback.mp4" controls poster="sintel.jpg" width="610" height="350">
</video>
</section>
<div class="clear"></div>
<section class="infos">
<h3><?php echo $movie; ?></h3> <p><?php echo $synopsis; ?></p>
<img id="formats" src="formats.png" alt="formats" width="865">
</section>
</main>
<footer id="main-footer">
<p>Copyright © 2019 - This site does not store any files on its server. All contents are provided by non-affiliated third parties.</p>
</footer>
</div>
</body>
</html>
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); ?> 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 />"; } } This topic has been moved to Application Design. http://www.phpfreaks.com/forums/index.php?topic=353735.0 |