PHP - Generating Url For Each Table Id
As a complete newbie, I'm not sure Ive got the terminology right in my subject header. But this is what I am trying to do.
I have a soccer stats site with data entered into each of numerous 'seasons', accessible via a drop-down menu, as he http://www.fleethistory.co.uk/stats/matches.php Now regardless of what season I select, the URL will stay the same as above. What I want to do is have users go direct to a particular season from a link without having to use the drop-down. How would I generate a unique URL for each of the seasons listed in the drop-down? Don't know if you need the PHP code, but here it is just in case: Code: [Select] <?php /* *************************************************************************** * tplSoccerStats * ----------------------------------------------------------------------- * Copyright: TPL Design * email: info@tpl-design.com * www: www.tpl-design.com/tplsoccerstats *************************************************************************** */ // Starts a new session or resumes the current one. session_start(); // Get db host, db username, db password, and db name from admin/user.php // (each team has its own db). include('admin/user.php'); // Establish db connection. Select appropriate team db. $connection = mysql_connect("$host", "$user", "$password") or die(mysql_error()); mysql_select_db("$txt_db_name", $connection) or die(mysql_error()); // Get preferences stored in db. $sql = "SELECT * FROM tplss_preferences WHERE ID = '0'"; $pref = mysql_query($sql, $connection) or die(mysql_error()); $pdata = mysql_fetch_array($pref); mysql_free_result($pref); // Include php preferences. include('preferences.inc'); // Use session defaults if available, otherwise set them from database values. if ((!isSet($_SESSION['defaultseasonid_tplss'])) || (!isSet($_SESSION['defaultmatchtypeid_tplss'])) || (!isSet($_SESSION['defaultlanguage_tplss']))) { $_SESSION['defaultseasonid_tplss'] = $pdata['DefaultSeasonID']; $_SESSION['defaultmatchtypeid_tplss'] = $pdata['DefaultMatchTypeID']; $_SESSION['defaultlanguage_tplss'] = $pdata['DefaultLanguage']; } $defaultseasonid = $_SESSION['defaultseasonid_tplss']; $defaultmatchtypeid = $_SESSION['defaultmatchtypeid_tplss']; $defaultlanguage = $_SESSION['defaultlanguage_tplss']; // Include language based global vars, in our case english, e.g. $txt_preview = 'Preview' include('language.inc'); // Include pafc banner and menu bar. include('header.php'); // Start an html form. echo '<form method="post" action="change.php">' . "\n"; // Print images at top of form if we have them (we don't). $image_url = "images/header.jpg"; $image_url2 = "images/header.gif"; if(file_exists($image_url) || file_exists($image_url2)) { echo '<table align="center" width="' . $tb_width . '" cellspacing="0" cellpadding="0" border="0">' . "\n"; echo "<tr>\n"; echo '<td align="center">' . "\n"; if (file_exists($image_url)) { echo '<img src="' . $image_url . '" ALT=""><br>' . "\n"; } elseif (file_exists($image_url2)) { echo '<img src="' . $image_url2 . '" ALT="">' . "\n"; } echo "</td></tr></table>\n\n"; } ?> <!-- Print change bar table --> <table align="center" width="<?php echo $tb_width ?>" cellspacing="0" cellpadding="0" border="0" bgcolor="<?php echo $border_c ?>"> <tr> <td> <table width="100%" cellspacing="1" cellpadding="5" border="0"> <tr> <td bgcolor="<?php echo $inside_c ?>" align="center"> <?= $txt_change ?>: <select name="season"> <option value="0"><?= $txt_all ?></option> <?php $sql = "SELECT * FROM tplss_seasonnames WHERE SeasonPublish = '1' ORDER BY SeasonName DESC"; $get_seasons = mysql_query($sql, $connection) or die(mysql_error()); while($data = mysql_fetch_array($get_seasons)) { if($data['SeasonID'] == $defaultseasonid) echo '<option value="' . $data['SeasonID'] . '" SELECTED>' . $data['SeasonName'] . "</option>\n"; else echo '<option value="' . $data['SeasonID'] . '">' . $data['SeasonName'] . "</option>\n"; } mysql_free_result($get_seasons); ?> </select> or Competition: <select name="matchtype"> <option value="0"><?= $txt_all ?></option> <?php $sql = "SELECT * FROM tplss_matchtypes ORDER BY MatchTypeName"; $get_types = mysql_query($sql, $connection) or die(mysql_error()); while($data = mysql_fetch_array($get_types)) { if($data['MatchTypeID'] == $defaultmatchtypeid) echo '<option value="' . $data['MatchTypeID'] . '" SELECTED>' . $data['MatchTypeName'] . "</option>\n"; else echo '<option value="' . $data['MatchTypeID'] . '">' . $data['MatchTypeName'] . "</option>\n"; } mysql_free_result($get_types); ?> </select> <input type="submit" name="submit" value="Select"> </td> </tr> </table> </td> </tr> </table> <!-- Print outer fixture tables --> <table align="center" width="<?php echo $tb_width ?>" cellspacing="0" cellpadding="0" border="0" bgcolor="<?php echo $border_c ?>"> <tr> <td> <table width="100%" cellspacing="1" cellpadding="5" border="0"> <tr> <td bgcolor="<?php echo $inside_c ?>" align="center"> <!-- Print inner fixture table --> <table width="<?= $tb2_width ?>%" cellspacing="0" cellpadding="4" border="0"> <tr> <td align="left" valign="middle" bgcolor="#D01818"> <font color="#FFffff"><b>Date</b></font> </td> <td align="center" valign="middle" bgcolor="#D01818"> <font color="#FFffff"><b>H/A</b></font> </td> <td align="left" valign="middle" bgcolor="#D01818"> <font color="#FFffff"><b>Opponent</b></font> </td> <td align="left" valign="middle" bgcolor="#D01818"> <font color="#FFffff"><b>Competition</b></font> </td> <td align="center" valign="middle" bgcolor="#D01818" colspan="2"> <font color="#FFffff"><b>Result</b></font> </td> <td align="center" valign="middle" bgcolor="#D01818"> <font color="#FFffff"><b>Att</b></font> </td> <td align="center" valign="middle" bgcolor="#D01818"> <font color="#FFffff"><b>Details</b></font> </td> </tr> <?php // Construct db query to get fixtures from database. $selectClause = "SELECT M.MatchID AS id, M.MatchAdditionalType AS additype, O.OpponentName AS opponent, O.OpponentID AS oppid, M.MatchGoals AS goals, M.MatchGoalsOpponent AS goals_opponent, M.MatchPenaltyGoals AS penalty_goals, M.MatchPenaltyGoalsOpponent AS penalty_goals_opponent, M.MatchOvertime AS overtime, M.MatchPenaltyShootout AS penalty_shootout, DATE_FORMAT(M.MatchDateTime, '%M %Y') AS month, DATE_FORMAT(M.MatchDateTime, '%a %e') AS date, DATE_FORMAT(M.MatchDateTime, '%H:%i') AS time, M.MatchPlaceID AS place, M.MatchAttendance AS att, M.MatchPublish AS publish, MT.MatchTypeName AS typename, P.PreviewText AS prewtext FROM ( tplss_matches M, tplss_matchtypes MT, tplss_opponents O ) LEFT OUTER JOIN tplss_previews P ON M.MatchID = P.PreviewMatchID "; if (($defaultseasonid != 00) && ($defaultmatchtypeid != 0)) { $whereClause = "WHERE M.MatchTypeID = '$defaultmatchtypeid' AND M.MatchSeasonID = '$defaultseasonid' AND M.MatchTypeID = MT.MatchTypeID AND M.MatchOpponent = O.OpponentID "; } elseif (($defaultseasonid == 0) && ($defaultmatchtypeid != 0)) { $whereClause = "WHERE M.MatchTypeID = '$defaultmatchtypeid' AND M.MatchTypeID = MT.MatchTypeID AND M.MatchOpponent = O.OpponentID "; } elseif (($defaultseasonid != 0) && ($defaultmatchtypeid == 0)) { $whereClause = "WHERE M.MatchSeasonID = '$defaultseasonid' AND M.MatchTypeID = MT.MatchTypeID AND M.MatchOpponent = O.OpponentID "; } elseif (($defaultseasonid == 0) && ($defaultmatchtypeid == 0)) { $whereClause = "WHERE M.MatchTypeID = MT.MatchTypeID AND M.MatchOpponent = O.OpponentID "; } $orderByClause = "ORDER BY M.MatchDateTime"; // Execute query. $sql = $selectClause . $whereClause . $orderByClause; $get_matches = mysql_query($sql, $connection) or die(mysql_error()); // Loop round fixtures (which come back from database in date order). while($data = mysql_fetch_array($get_matches)) { // Print a month header row each time we hit a new month. if ($data['month'] <> $lastMonth) { echo "<tr>\n"; echo '<td align="left" valign="middle" bgcolor="#7c0606" colspan="9">'; echo '<font color="#FFffff"><b>' . $data['month'] . "</b></font>"; echo "</td>\n"; echo "</tr>\n\n"; $lastMonth = $data['month']; } // Assign home/away based vars. if ($data['place'] == 1) { $placeBg = $bg4; $venue = "H"; } else { $placeBg = $bg3; $venue = "A"; } // Print date and venue. echo"<tr>\n"; echo '<td align="left" valign="middle" bgcolor="' . $placeBg . '">'; echo $data['date']; echo "</td>\n"; echo '<td align="center" valign="middle" bgcolor="' . $placeBg . '">'; echo $venue; echo "</td>\n"; // Print opponent team name (as a link if possible). echo '<td align="left" valign="middle" bgcolor="' . $placeBg . '">'; if ($data['oppid'] == 1) { echo '$data[opponent]'; } else { echo '<a href="opponent.php?opp=' . $data['oppid'] . '">' . $data['opponent'] . "</a>"; } echo "</td>\n"; // Print competition type. echo '<td align="left" valign="middle" bgcolor="' . $placeBg . '">'; echo $data['typename']; if ($data['additype'] != '') { echo " / " . $data['additype']; } echo "</td>\n"; // Print result, attendance and match report. if ($data['goals'] == NULL || $data['goals_opponent'] == NULL) { // No goals recorded - match can't have been played yet - print empty fields. echo '<td bgcolor="' . $placeBg . '"> </td>' . "\n"; echo '<td bgcolor="' . $placeBg . '"> </td>' . "\n"; echo '<td bgcolor="' . $placeBg . '"> </td>' . "\n"; echo '<td align="center" valign="middle" bgcolor="' . $placeBg . '">'; if ($data['prewtext'] == '') { echo " "; } else { echo '<a href="preview.php?id=' . $data['id'] . '">' . $txt_preview . "</a>"; } echo "</td>\n"; } else { // Goals recorded - figure out result and score - print required fields. if ($data['penalty_goals'] == NULL || $data['penalty_goals_opponent'] == NULL) { if ($data['goals'] > $data['goals_opponent']) $result = '<img src="images/win.jpg">'; elseif ($data['goals'] < $data['goals_opponent']) $result = '<img src="images/lose.jpg">'; else $result = '<img src="images/draw.jpg">'; $score = $data['goals'] . " - " . $data['goals_opponent']; } else { if ($data['penalty_goals'] > $data['penalty_goals_opponent']) $result = "<b>W</b>"; else $result = "L"; $score = $data['goals'] . " - " . $data['goals_opponent'] . " (" . $data['penalty_goals'] . " - " . $data['penalty_goals_opponent'] . ")"; } echo '<td align="center" valign="middle" bgcolor="' . $placeBg . '">' . $result . "</td>\n"; echo '<td align="center" valign="middle" bgcolor="' . $placeBg . '">' . $score . "</td>\n"; echo '<td align="center" valign="middle" bgcolor="' . $placeBg . '">' . $data['att'] . "</td>\n"; if($data['publish'] == 1) { echo '<td align="center" valign="middle" bgcolor="' . $placeBg . '"><a href="matchdetails.php?id=' . $data['id'] . '">Yes</td></a></td>' . "\n"; } else { echo '<td align="center" valign="middle" bgcolor="' . $placeBg . '"> </td></a></td>' . "\n"; } } echo "</tr>\n\n"; } // Free resultset. mysql_free_result($get_matches); ?> </table> </td> </tr> </table> </td> </tr> </table> <?php // Print tpl soccers stats message. include('bottom.txt'); ?> </form> <?php // Finish off html. include('footer.php'); ?> Similar TutorialsHi all, I want to create an array from the output of a table. In the table cell I have some numbers where for each number I would like to relate it to a value in another table. However using the code below I get Array ( => "26","27","28","29","30","31" ) from the print_r($arr); meaning that $range ins't being treated as an array, and hence, the second query only gives one value. Code: [Select] $showIng = mysql_query("SELECT * FROM recipe WHERE name = '$dish'") or die(mysql_error()); $rowShowIng = mysql_fetch_assoc($showIng); $range = $rowShowIng['keyno']; $arr = array($range); print_r($arr); foreach ($arr as &$value) { $getIng = mysql_query("SELECT * FROM keywords WHERE keyid = '$value'") or die(mysql_error()); $rowGetIng = mysql_fetch_assoc($getIng); echo $rowGetIng['ingredient']; } So, I want to know how I can create the array from $range Thanks What I'm trying to do here is generate a table based on a form in which the user selects two options. The first option tells the script which database entries to put in the table, the second option tells it how to arrange them. The first works perfectly, the second not at all - it doesn't produce an error, it just doesn't do anything. I've found a number of tutorials that seem to suggest that the problem is somewhere in my punctuation around ORDER BY '$POST[sort]' but I've been unable to find a solution that actually works. Any help would be much appreciated, my code is below. Thank you! mysql_select_db($database, $con); $result = mysql_query("SELECT * FROM main WHERE state='$_POST[state]' ORDER BY '$POST[sort]'"); if(mysql_num_rows($result)==0){ echo "<p align='left'>View Pantries by State</p><div id='stateform'> <form action='../admin/viewstate.php' method='post'> <select name='state' /> <option value='AL'>Alabama</option> <option value='AK'>Alaska</option> <option value='AZ'>Arizona</option> </select> <select name='sort' /> <option value='name'>Name</option> <option value='id'>Id</option> <option value='city'>City</option> <option value='zip'>Zip</option> <option value='timestamp'>Timestamp</option> </select> <input type='submit' value='Go'></input></form> </div>"; } else{ echo "<p align='left'>View Pantries by State</p> <div id='stateform'> <form action='../admin/viewstate.php' method='post'> <select name='state' /> <option value='AL'>Alabama</option> <option value='AK'>Alaska</option> <option value='AZ'>Arizona</option> </select> <select name='sort' /> <option value='name'>Name</option> <option value='id'>Id</option> <option value='city'>City</option> <option value='zip'>Zip</option> <option value='timestamp'>Timestamp</option> </select> <input type='submit' value='Go'></input></form> </div>"; echo "<div id='fptext'><span class='h1'>Food Pantries for " . $_POST['state'] . "</span><br><br></div>"; } echo "<table border='1' align='center' cellpadding='3' width='900px'> <tr> <th>ID</th> <th>Name</th> <th>Type</th> <th>Address</th> <th>State</th> <th>Phone</th> <th>E-mail</th> <th>Website</th> <th>Hours</th> <th>Requirements</th> <th>Additional Information</th> <th>Lat</th> <th>Lng</th> <th>Update</th> </tr>"; while($row = mysql_fetch_array($result)) { echo "<tr>"; echo "<td>" . $row['id'] . "</td>"; echo "<td>" . $row['name'] . "</td>"; echo "<td>" . $row['type'] . "</td>"; echo "<td>" . $row['address'] . "</td>"; echo "<td>" . $row['state'] . "</td>"; echo "<td>" . $row['phone'] . "</td>"; echo "<td>"; echo "<a href=mailto:".$row['email'].">".$row['email']."</a>"; echo "</td>"; echo "<td>"; echo "<a href=".$row['website']."\>".$row['website']."</a>"; echo "</td>"; echo "<td>" . $row['hours'] . "</td>"; echo "<td>" . $row['requirements'] . "</td>"; echo "<td>" . $row['additional'] . "</td>"; echo "<td>" . $row['lat'] . "</td>"; echo "<td>" . $row['lng'] . "</td>"; echo "<td><a href='../public/updatepage.php?id=".$row['id']."'>Update Pantry</a></td>"; echo "</tr>"; } echo "</table>"; mysql_close($con); ?> Hi, I'm trying to make a dynamic html table to contain the mysql data that is generated via php. I'm trying to display a user's friends in a table of two columns and however many rows, but can't seem to figure out what is needed to make this work. Here's my code as it stands: Code: [Select] <?php //Begin mysql query $sql = "SELECT * FROM friends WHERE username = '{$_GET['username']}' AND status = 'Active' ORDER BY friends_with ASC"; $result = mysql_query($sql); $count = mysql_num_rows($result); $sql_2 = "SELECT * FROM friends WHERE friends_with = '{$_GET['username']}' AND status = 'Active' ORDER BY username ASC"; $result_2 = mysql_query($sql_2); $count_2 = mysql_num_rows($result_2); while ($row = mysql_fetch_array($result)) { echo $row["friendswith"] . "<br>"; } while ($row_2 = mysql_fetch_array($result_2)) { echo $row_2["username"] . "<br>"; } ?> The above simply outputs all records of a user's friends (their usernames) in alphabetical order. The question of how I'd generate a new row each time a certain amount of columns have been met, however, is beyond me. Anyone know of any helpful resources that may solve my problem? Thanks in advance =) Friends I am new to php and i have to submit my coursework in php by 3rd dec, I stuck at one place where i have to upload multiple photo and one can see all the photo he has uploaded and can edit or delete that photo so i have done uploading now i am showing those pics in table by running loop and generating tr and td but now i have two buttons with each row edit and delete now when i clicked on one delete or edit that pic should be delete or give text box to edit description of pic, Please help me how to do that....... There is a section in my site in which i will need to give the user 3 options: Generate Specific User Text As: 1. pdf 2. .doc 3. .txt 4. print in html The 4th option is simple. The other three are completely new to me. I know little bit about fopen, fwrite and fclose, however these are commands that write files to the server. I need to write files to the users computer. Is the best way for this to be: 1. the user clicks .txt 2. the .txt is written to the server 3. the .txt is then downloaded to the users computer by the user 4. the .txt is then deleted from the server All 4 steps to be done with one click from the user. Might there not be traffic problems if lots and lots of users are doing this at the same time? Any pushes in right direction here would be great, there seems to be hundreds of sites saying different solutions Hi, I've written some code to take information from an SQL database and write it out in the RSS format (Although it doesn't validate). The problem is i'd like the page to have the .rss (or .xml) file extension, I'm not sure if there's any advantages in having this but thought i'd ask. I've got the following code: Code: [Select] <?php header('Content-type: text/xml'); print '<?xml version="1.0"?>'; print '<rss version="2.0">'; print '<channel>'; include("phpfunctions.php"); db_connect(); //select all from users table $select="SELECT title, link, description FROM news"; $result = mysql_query($select) or die(mysql_error()); //If nothing is returned display error no records if (mysql_num_rows($result) < 1) { die("No records"); } //loop through the results and write each as a new item while ($row = mysql_fetch_assoc($result)) { $item_title = $row["title"]; $item_link = $row["link"]; $item_desc = $row["description"]; print '<item>'; print '<title>' . $item_title . '</title>'; print '<link>' . $item_link . '</link>'; print '<description>' . $item_desc . '</description>'; print '</item>'; } print '</channel>'; print '</rss>'; ?> This seems to work fine as i get what i expect and i'm assuming i can do the same to output .xml but is there a way to have it in a proper .rss / .xml file so that an aggregator or someone could read this properly. Cheers, Reece Hi All - I wanted to know if there is any existing script to generate an eticket when a user books a ticket through a website. Thanks Does anyone know of a free php library to create pdf417 2d barcodes? hi guys, im trying to resize and save a thumbnail version of images uploaded to my site in a sub folder (thumbs). I've currently got: $image=imagecreatefromjpeg($filepath); list($width, $height) = getimagesize($filepath); $new_width = 200; $new_height= 150; $image_p=imagecreatetruecolor($new_width, $new_height); imagecopyresampled($image_p, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height); // Save the image imagejpeg($image_p, '/thumbs'.$filepath); // Free up memory imagedestroy($image_p); but it appears to do nothing, but it also doesn't return any errors? could someone help me out please? thanks!
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>
I am using this code to evaluate whether checkboxes within a group have been selected: function IsChecked($chkname,$value) { if(!empty($_POST[$chkname])) { foreach($_POST[$chkname] as $chkval) { if($chkval == $value) { return true; } } } return false; } Now, I've decided that I want to add a message upon finding NO SELECTED checkbox items, but it is not functioning as desired. if(empty($_POST[$chkname])) { echo("You didn't select any checkboxes."); } How can I get this or something similar to trigger? Hi all, I want some help regarding my banking project. I have a customer registration form in my project.After successfully completion of the form users have to click on the "Open Account" button.Thereafter a customer id(Auto increment value) should be generated.It was stored in the database where other form details are also being stored. How can i call to this one by one customer id's?? Heshan, Hi, I am using php to generate an xml file of the following structure Code: [Select] <?xml version="1.0" encoding="UTF-8"?> <!-- An excerpt of an egocentric social network --> <graphml xmlns="http://graphml.graphdrawing.org/xmlns"> <graph edgedefault="directed"> <!-- data schema --> <key id="name" for="node" attr.name="name" attr.type="string"/> <key id="gender" for="node" attr.name="gender" attr.type="string"/> <!-- nodes --> <node id="1"> <data key="name">Jeff</data> <data key="gender">M</data> </node> <node id="2"> <data key="name">Ed</data> <data key="gender">M</data> </node> <node id="3"> <data key="name">Christiaan</data> <data key="gender">M</data> </node> <node id="4"> <data key="name">Emily</data> <data key="gender">F</data> </node> <node id="5"> <data key="name">Adam</data> <data key="gender">M</data> </node> <!-- emily's friends --> <edge source="1" target="2"></edge> <!-- adam's friends --> <edge source="2" target="3"></edge> <!-- cynthia's friends --> <edge source="3" target="4"></edge> <!-- joylette's friends --> <edge source="4" target="5"></edge> <!-- amanda's friends --> <edge source="5" target="1"></edge> <edge source="5" target="2"></edge> <edge source="5" target="3"></edge> <edge source="5" target="4"></edge> </graph> </graphml> and below is my code: Code: [Select] public function createXML($resultID){ header("Content-type: text/xml"); $xml_output = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"; $xml_output .= "<graphml xmlns=\"http://graphml.graphdrawing.org/xmlns\">\n"; $xml_output .= "<graph edgedefault=\"directed\">\n"; $xml_output .= "<key id=\"name\" for=\"node\" attr.name=\"sender\" attr.type=\"string\"/>\n"; for($x = 1 ; $x < mysql_num_rows($resultID) ; $x++){ $row = mysql_fetch_assoc($resultID); $xml_output .= "\t<node id=$x>\n"; $xml_output .= "\t\t<data key=\"name\">" . $row['sender'] . "</data>\n"; $xml_output .= "\t</node>\n"; } $xml_output .= "</graph>\n"; $xml_output .= "</graphml>"; echo $xml_output; } } $snxml = new SocialNetworkXML; $holdResult = $snxml->setQuery("select sender from message1"); $snxml->createXML($holdResult); But in browser its giving me this message: Code: [Select] XML Parsing Error: not well-formed Location: http://localhost/........./SocialNetXML.class.php Line Number 5, Column 11: <node id=1> -----------------^ What am I doing wrong here ? thanks in advance. OK, what I am trying to do is generate a dynamic variable name. I want to setup a foreach statement that will generate variable names based on an array of data. $numbers = array('one', 'two', 'three', 'four', 'five', 'six', 'seven'); foreach ($numbers as $number) { } What I need, is for a bunch of variables to be generated and filled with content. $variable_one_label = "Blah"; $variable_two_label = "Blah Again"; How can I generate the dynamic variable based on the array value? I searched online and seen some complex c and c# code which I didn't understand much of. But how do I generate an array with all string combinations based on length and from a charset? E.g. charset = {'a', 'b', 'c'} Length = 2. Then it should generate first all 1-char strings: a b c Then all 2-char strings: aa ab ac ba bb bc ca cb cc And then all added to the same array. I think there's some way of doing it with recursion but to me it's like thinking with a 4th dimension my mind can't grasp this logic! I'm trying to generate a page with javascript in it with PHP. But the quotations are causing me problems, I need a third set of quotations. Here is the part I am having trouble with: echo"<div class='level'>Edit:</div><div class='box'><input type = 'text' size='50' name='cat' value='$cat'/> <b><input type='button' value='+ Details' onclick='document.getElementById('rev$clicker').style.display='block';'/></b> </div><br>"; When I view the html it comes out onclick='document.getElementById('rev$clicker').style.display='block';' I can't use "" quotations for 'block' and 'rev$clicker' because that would exit from the echo and I can't exit php because I need the $clicker variable. Hello, I want to create a custom user profile, by allowing admin to add them from admin panel then users can fill their values. How can I create such system ? Thanks. Hello house, I am new to coding, I have a project about generating school terminal results and using pin to check results in codeigniter framework. Any help will be appreciated. Thanks
Hello everyone, I've been working on this for about 2 days now, and I just can't seem to figure it out so I need some help from someone here. I have a database with three items (will be more, but for now there's three). The database keeps a record of the days that each item is reserved. I want to be able to select and generate a list of items that are available on a specific day. Here is what I have so far: Code: [Select] <?php $result = mysql_query("SELECT `prodid` FROM reservations WHERE `resdate` = '$resdate'") or die (mysql_error()); while ($row = mysql_fetch_row($result)) { $resprodid = $row[0]; $result2 = mysql_query("SELECT `prodid`,`prodname` FROM products"); $row2 = mysql_fetch_row($result2); $prodid = $row2[0]; $prodname= $row2[1]; if ($prodid != $resprodid) { echo $prodid; } } ?> The result that I'm getting are not correct. I either get only one unit listed, or none. Any help would be appreciated. Thanks! I am creating a drink recipe site. So far I have created the mysql table and the page where i can enter in the drink name ingredients ect. and it inserts into the table. Could some one point me in the right direction where when I make an entry into this table a new page is created from the content. How would I go about doing this? |