toxictoad Posted May 12, 2008 Share Posted May 12, 2008 Hey all, I have this code I'm working with that connects to my database and returns all the relevant results (or "All if left on default) and I would like to know how I can click one of the records so that it takes me to a new page with more info on the chosen film. I know how to do this by adding a new html page for each record (but that would mean over 700 html pages) and the code allows you to do that but I don't know how I would get it to work so that clicking the link opens a single php page that's populated with all the relevant film info. Taking into account I haven't learned php from the beginning (just editing code) where do I start? I've attched the 2 files I've been working with and you can see it in action here http://phatjoints.com/mymovies/index3.php Hope you can help...thanks [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/105276-solved-displaying-more-info-about-chosen-record-on-a-new-page/ Share on other sites More sharing options...
soycharliente Posted May 12, 2008 Share Posted May 12, 2008 No need to make a single page for every record. Just 1 page that will display any record. You can use the $_GET method to grab the id of the record and go to the db to get the info and display it. Something like this should get you started. show.php <?php dbconnect(); // open db connection function myEscape($string) { $new = get_magic_quotes_gpc() ? stripslashes($string) : $string; $safe = mysql_real_escape_string($new); return $safe; } $record = $_GET['id']; foreach ($_GET as $key => $val) { $_GET[$key] = myEscape($val); // make the input safe } $sql = "SELECT * FROM `table` WHERE `id`='{$record}'"; $result = mysql_query($sql) OR DIE ("{$sql}<br />".mysql_error()); if (mysql_num_rows($result) > 0) { $error = FALSE; $row = mysql_fetch_assoc($result); $one = $row['one']; $two = $row['two']; $three = $row['three']; } else { $error = TRUE; } dbclose(); // close db connection ?> <html> <body> Title: <?php echo $one; ?><br /> Date: <?php echo $two; ?><br /> Notes: <?php echo $three; ?> </body> </html> And your links will be formatted like show.php?id=123 Quote Link to comment https://forums.phpfreaks.com/topic/105276-solved-displaying-more-info-about-chosen-record-on-a-new-page/#findComment-539123 Share on other sites More sharing options...
toxictoad Posted May 12, 2008 Author Share Posted May 12, 2008 Thanks charlieholder I'll have a good look at this and see if I can work it out Quote Link to comment https://forums.phpfreaks.com/topic/105276-solved-displaying-more-info-about-chosen-record-on-a-new-page/#findComment-539128 Share on other sites More sharing options...
toxictoad Posted May 12, 2008 Author Share Posted May 12, 2008 Can you explain this code to me a bit because I don't really understand what I'm meant to do with it This is for a new page right? How do I incorporate this into the current index3.php page? With this code would I have to have one of these in the code for each record in the database? $one = $row['one']; $two = $row['two']; $three = $row['three']; Thanks Quote Link to comment https://forums.phpfreaks.com/topic/105276-solved-displaying-more-info-about-chosen-record-on-a-new-page/#findComment-539303 Share on other sites More sharing options...
revraz Posted May 12, 2008 Share Posted May 12, 2008 Now you know why commenting code is important. Quote Link to comment https://forums.phpfreaks.com/topic/105276-solved-displaying-more-info-about-chosen-record-on-a-new-page/#findComment-539313 Share on other sites More sharing options...
craygo Posted May 12, 2008 Share Posted May 12, 2008 ok so what you do is make a link in the name. This would go in your while loop. Then what you to is sort of make a template of a page then insert all your values into the proper place <?php while ($dvd_row = @mysql_fetch_array($dvd_result)){ $id = $dvd_row[ $dvd_field[2][1] ]; // this would be the field which holds the unique ID of the row $name = $dvd_row[ $dvd_field[2][2] ]; // this would be the row which contains the name of the DVD // I will skip to the output of the name echo "<a href=\"details.php?id=$id\" />$name</a>"; // I use details.php you use whatever you like } ?> So looking at your page source for a space odyssey you would make a page called details.php <?php $id = $_GET['id']; $sql = "SELECT * FROM `dvd_table` WHERE `id` = '$id'"; $res = mysql_query($sql) or die(mysql_error()); $r = mysql_fetch_assoc($res); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>phatjoints.com :: Movies: 2001: A Space Odyssey</title> <style type="text/css"> <!-- body { background-color: #033A05; } .style1 { font-family: Verdana, Arial, Helvetica, sans-serif; color: #FFFFFF; } .style2 {font-family: Verdana, Arial, Helvetica, sans-serif; color: #FFFFFF; font-size: small; } .bordercolor { border: 2px solid #FFFFFF; } --> </style> <script language="JavaScript" type="text/JavaScript"> <!-- function MM_reloadPage(init) { //reloads the window if Nav4 resized if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) { document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }} else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload(); } MM_reloadPage(true); //--> </script> <script type="text/javascript" src="swfobject.js"></script> </head> <body> <div id="Layer1" style="position:absolute; width:187px; height:303px; z-index:1; top: 27px;"><img src="covers/<?php echo $r['imagefield']; ?>" width="194" height="307" border="2" class="bordercolor"></div> <div id="Layer3" style="position:absolute; width:157px; height:16px; z-index:3; left: 240px; top: 53px;" class="style1"> <h3>Year: <?php echo $r['year']; ?></h3> </div> <div id="Layer2" style="position:absolute; width:337px; height:38px; z-index:2; left: 234px; top: 1px;"> <h2 class="style1"><?php echo $r['title']; ?> </h2> </div> <div id="Layer4" style="position:absolute; width:336px; height:248px; z-index:4; left: 254px; top: 96px;" class="style1"> <h4>Plot</h4> <p class="style2"><?php echo nl2br(stripslashes($r['plot'])); ?></p> </div> <div id="Layer5" class="style2" style="position:absolute; width:210px; height:115px; z-index:5; left: 10px; top: 345px;"> <p align="left"><strong>My Rating</strong>: <?php echo $r['rating']; ?></p> <p align="left"><strong>Genre</strong>: <?php echo $r['genre']; ?></p> <p align="left"><strong>Country</strong>: <?php echo $r['country']; ?></p> <p align="left"><strong>Director</strong>: <?php echo $r['director']; ?> </p> </div> <div id="Layer6" style="position:absolute; width:339px; height:184px; z-index:6; left: 253px; top: 377px;" class="style1"> <h4>Trailer</h4> <div align="center"> <class id="player1"></class> <?php echo ' <script type="text/javascript"> var s1 = new SWFObject("flvplayer.swf","single","350","240","7"); s1.addParam("allowfullscreen","true"); s1.addVariable("file","trailers/'.$r['trailer'].';"); s1.addVariable("image","preview.jpg"); s1.addVariable("width","350"); s1.addVariable("height","240"); s1.write("player1"); </script>'; ?> </div> </div> </body> </html> Just a quick one Ray Quote Link to comment https://forums.phpfreaks.com/topic/105276-solved-displaying-more-info-about-chosen-record-on-a-new-page/#findComment-539338 Share on other sites More sharing options...
toxictoad Posted May 13, 2008 Author Share Posted May 13, 2008 Hey Ray, thanks for your help on this I think I got a slight problem (ok maybe more than a slight one) I'm using phpMyAdmin, I've just added a primary field, set to auto increment (didn't create one in the first place) I then manually added 1,2,3, into that primary field for the three records in the db, after that I inserted a new record. I got an error about a duplicate item and the index field wasn't incremented (to 4) but the new record was entered. Does this mean that I have to remove all records for the index field to work correctly? Guess that's a side issue____________________________________________________________ Lets say that the index in the DB is working ok, I'm still a little unsure of what I need to do. each link is currently like http://www.phatjoints.com/video/dvds/00003 the 00003 isn't related to the record in the db and was created to store the html page, image, trailer and anything else related to the page. In the new design/method all the trailers/covers will be in 2 folders with those names and the DB will have the links to them. So the link to say 2001 A Space Odyssey will be changed to something like - http://www.phatjoints.com/dvds?id=2 is this right? if so I will need to know the correct id for each record yes? Quote Link to comment https://forums.phpfreaks.com/topic/105276-solved-displaying-more-info-about-chosen-record-on-a-new-page/#findComment-540203 Share on other sites More sharing options...
craygo Posted May 13, 2008 Share Posted May 13, 2008 yes that is correct you would need to pass the id to the template page so the query can get the details for the dvd. What I would do is create folders for the different parts /trailers/ /images/ /covers/ then you can store the names in the db and just link to it. Quote Link to comment https://forums.phpfreaks.com/topic/105276-solved-displaying-more-info-about-chosen-record-on-a-new-page/#findComment-540214 Share on other sites More sharing options...
toxictoad Posted May 13, 2008 Author Share Posted May 13, 2008 i think I'm seeing it... Does it matter where your code goes in the index3.php page? Quote Link to comment https://forums.phpfreaks.com/topic/105276-solved-displaying-more-info-about-chosen-record-on-a-new-page/#findComment-540250 Share on other sites More sharing options...
toxictoad Posted May 13, 2008 Author Share Posted May 13, 2008 if the new details.php page is called by the link will it already have the connection to the database? I've been testing things and one of the things I see is that if I open the details.php on its own there are errors thanks Quote Link to comment https://forums.phpfreaks.com/topic/105276-solved-displaying-more-info-about-chosen-record-on-a-new-page/#findComment-540368 Share on other sites More sharing options...
craygo Posted May 14, 2008 Share Posted May 14, 2008 Yes if you open it up on it's own you would need to reconnect to the database. Quote Link to comment https://forums.phpfreaks.com/topic/105276-solved-displaying-more-info-about-chosen-record-on-a-new-page/#findComment-540918 Share on other sites More sharing options...
toxictoad Posted May 14, 2008 Author Share Posted May 14, 2008 hey craygo, I amended the config.php and index.php files to include the new fileID/Index field and added your code to the beginning of the index.php page also put the details.php page you created but when I click the link I only get a page can't be displayed error? Here is the updated code [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/105276-solved-displaying-more-info-about-chosen-record-on-a-new-page/#findComment-541393 Share on other sites More sharing options...
craygo Posted May 15, 2008 Share Posted May 15, 2008 unless your config.php is connecting to the database AND running the query you will get no results. Also not sure what is going on with the entire array thing. I was just using what you had to fill in my example. Let me give you this example I will use `dvd` as my table name, `dvd_id` as the id field and `dvd_name` as the name field <?php $sql = "SELECT `dvd_id`, `dvd_name` FROM `dvd` ORDER BY `dvd_name`"; $dvd_result = mysql_query($sql) or die(mysql_error()); while ($dvd_row = @mysql_fetch_array($dvd_result)){ $id = $dvd_row['dvd_id']; // this would be the field which holds the unique ID of the row $name = $dvd_row['dvd_name']; // this would be the row which contains the name of the DVD // I will skip to the output of the name echo "<a href=\"details.php?id=$id\" />$name</a>"; // I use details.php you use whatever you like } ?> Ray Quote Link to comment https://forums.phpfreaks.com/topic/105276-solved-displaying-more-info-about-chosen-record-on-a-new-page/#findComment-541509 Share on other sites More sharing options...
toxictoad Posted May 15, 2008 Author Share Posted May 15, 2008 thank you for your patience Ray The config file does connect to the database which is how the index page does its thing. I'm not sure what's going on with the array thing either In the config file I now have this: /* The following variables define the column names to be retrieved from the MySQL table. */ $dvd_field[2][1] = "filmID"; $dvd_field[2][2] = "title"; $dvd_field[2][3] = "genre"; $dvd_field[2][4] = "year"; $dvd_field[2][5] = "rating"; $dvd_field[2][6] = "link"; $dvd_field[2][7] = "country"; $dvd_field[2][8] = "director"; =============================================== So your first code snippet <?php while ($dvd_row = @mysql_fetch_array($dvd_result)){ $id = $dvd_row[ $dvd_field[2][1] ]; // this would be the field which holds the unique ID of the row $name = $dvd_row[ $dvd_field[2][2] ]; // this would be the row which contains the name of the DVD // I will skip to the output of the name echo "<a href=\"details.php?id=$id\" />$name</a>"; // I use details.php you use whatever you like } ?> Should work right? But where in the index.php page does it need to go? There's this already // Grab result from db $dvd_result = @mysql_db_query($dvd_mysql_db, $dvd_query_string) or die ("Invalid query (result)"); while ($dvd_row = @mysql_fetch_array($dvd_result)) { $dvd_field_1 = $dvd_row[ $dvd_field[2][2] ]; $dvd_field_2 = $dvd_row[ $dvd_field[2][3] ]; $dvd_field_3 = $dvd_row[ $dvd_field[2][4] ]; $dvd_field_4 = $dvd_row[ $dvd_field[2][5] ]; $dvd_field_5 = $dvd_row[ $dvd_field[2][7] ]; $dvd_field_6 = $dvd_row[ $dvd_field[2][6] ]; $dvd_field_7 = $dvd_row[ $dvd_field[2][8] ]; ======================================== So should I be adding this to it? $id = $dvd_row[ $dvd_field[2][1] ]; // this would be the field which holds the unique ID of the row $name = $dvd_row[ $dvd_field[2][2] ]; // this would be the row which contains the name of the DVD // I will skip to the output of the name echo "<a href=\"details.php?id=$id\" />$name</a>"; // I use details.php you use whatever you like Quote Link to comment https://forums.phpfreaks.com/topic/105276-solved-displaying-more-info-about-chosen-record-on-a-new-page/#findComment-541549 Share on other sites More sharing options...
toxictoad Posted May 15, 2008 Author Share Posted May 15, 2008 if I add your code so it looks like this: while ($dvd_row = @mysql_fetch_array($dvd_result)) { $dvd_field_1 = $dvd_row[ $dvd_field[2][2] ]; $dvd_field_2 = $dvd_row[ $dvd_field[2][3] ]; $dvd_field_3 = $dvd_row[ $dvd_field[2][4] ]; $dvd_field_4 = $dvd_row[ $dvd_field[2][5] ]; $dvd_field_5 = $dvd_row[ $dvd_field[2][7] ]; $dvd_field_6 = $dvd_row[ $dvd_field[2][6] ]; $dvd_field_7 = $dvd_row[ $dvd_field[2][8] ]; // This section is from Ray -@ phpfreaks and is to link to more info page for chosen film while ($dvd_row = @mysql_fetch_array($dvd_result)){ $id = $dvd_row[ $dvd_field[2][1] ]; // this would be the field which holds the unique ID of the row $name = $dvd_row[ $dvd_field[2][2] ]; // this would be the row which contains the name of the DVD // I will skip to the output of the name echo "<a href=\"details.php?id=$id\" />$name</a>"; // I use details.php you use whatever you like } I get really strange things happen on the page, all the titles are returned as links but with no formatting at all, not in the table and each title has the exact same link "http://phatjoints.com/films/filmdb/details.php?id=" but I get a page cant be displayed error when clicking them. In the database there's a field for the link which is $dvd_field[2][6] and this part of the index.php makes the title ($dvd_field_1) into the link but the imdb part isn't being used, just a direct link to the details.php page (e.g. http://www.phatjoints.com/films/filmdb/details.php?id=1) ------------------------------------------------------------ if ( strtolower(substr($dvd_field_6, 0, 7)) == "http://" ) $dvd_link = "<a href=\"". $dvd_field_6 . "\">" . $dvd_field_1 . "</a>"; elseif ($dvd_imdb_links == 1) { if ($dvd_field_6 != 0 AND $dvd_field_6 != "") $dvd_link = "<a href=\"http://www.imdb.com/Title?" . $dvd_field_6 . "\">" . $dvd_field_1 . "</a>"; //$dvd_field_1 = "<div class=\"search2\"><font color=\"$dvd_text_color\"><a href=\"http://www.imdb.com/Title?" . $dvd_field_6 . "\">" . $dvd_field_1 . "</a></font></div>"; else $dvd_link = $dvd_field_1; } elseif ($dvd_imdb_links == 2) $dvd_link = "<a href=\"http://www.imdb.com/Tsearch?title=" . urlencode($dvd_field_1) . "&restrict=Movies+and+TV\">" . $dvd_field_1 . "</a>"; //$dvd_field_1 = "<div class=\"search2\"><font color=\"$dvd_text_color\"><a href=\"http://www.imdb.com/Tsearch?title=" . urlencode($dvd_field_1) . "&restrict=Movies+and+TV\">" . $dvd_field_1 . "</a></font></div>"; else $dvd_link = $dvd_field_1; $dvd_field_1 ="<div class=\"search2\"><font color=\"$dvd_text_color\">" . $dvd_link . "</font></div>"; echo "<tr valign=\"top\" bgcolor=\"$dvd_row_color\">\n"; --------------------------------------------------------------------------------------------------------- Quote Link to comment https://forums.phpfreaks.com/topic/105276-solved-displaying-more-info-about-chosen-record-on-a-new-page/#findComment-541608 Share on other sites More sharing options...
toxictoad Posted May 15, 2008 Author Share Posted May 15, 2008 ok I've removed the code that's not needed for the IMDB link and the links work as normal so it just looks like this now // Link code if ( strtolower(substr($dvd_field_6, 0, 7)) == "http://" ) $dvd_link = "<a href=\"". $dvd_field_6 . "\">" . $dvd_field_1 . "</a>"; // $dvd_field_6 is the Link Field in the DB and $dvd_field_1 is the Title $dvd_field_1 ="<div class=\"search2\"><font color=\"$dvd_text_color\">" . $dvd_link . "</font></div>"; echo "<tr valign=\"top\" bgcolor=\"$dvd_row_color\">\n"; // end of Link Code Just don't understand how I fit your code into it all... Quote Link to comment https://forums.phpfreaks.com/topic/105276-solved-displaying-more-info-about-chosen-record-on-a-new-page/#findComment-541623 Share on other sites More sharing options...
craygo Posted May 15, 2008 Share Posted May 15, 2008 OK looking at the config3.php and your index3.php this is what I did. config3.php i took out some of the variavle value just put them back <?php /***************************************************************************** * Edit password * *****************************************************************************/ $dvd_edit_password = "C0ff33&Spliffs"; // Password required to edit the // database. (This is not the same // as the MySQL password) /***************************************************************************** * Database settings * *****************************************************************************/ $dvd_mysql_username = ""; // MySQL user name $dvd_mysql_password = ""; // MySQL password (leave empty // if no password is required.) $dvd_mysql_db = ""; // MySQL database name $dvd_mysql_table = "dvds"; // MySQL table name // "dvds" is the default table // created by the "table.sql" file $dvd_mysql_host = "localhost"; // MySQL server host name // ("localhost" should be fine on // most systems) /***************************************************************************** * File locations * *****************************************************************************/ $dvd_index_url = "index3.php"; // URL of the index.php file $dvd_edit_url = "edit3.php"; // URL of the edit.php file $dvd_header_file = "header.php"; // Path and name of the header file $dvd_footer_file = "footer.php"; // Path and name of the footer file $dvd_styles_file = "styles.php"; // Path and name of the style sheet /***************************************************************************** * The following variables define the name of each column, as it will * * appear on the header * *****************************************************************************/ $dvd_field[1][1] = "Image"; // Column 1 $dvd_field[1][2] = "Title"; // Column 2 $dvd_field[1][3] = "Genre"; // Column 3 $dvd_field[1][4] = "Year"; // Column 4 $dvd_field[1][5] = "Rating"; // Column 5 $dvd_field[1][6] = "Country"; // Column 6 $dvd_field[1][7] = "Director"; // Column 7 /***************************************************************************** * The following variables define the column names to be retrieved from the * * MySQL table. * * * * NOTE: The sixth column (named "link" by default) is not displayed on * * the web page. It can be used to link directly to the Internet Movie * * Database, or to a URL of your choice. See the README file for more * * information. * *****************************************************************************/ $dvd_field[2][0] = "filmID"; // Name of MySQL table Column 0 ADDED THIS $dvd_field[2][1] = "image"; // Name of MySQL table Column 1 $dvd_field[2][2] = "title"; // Name of MySQL table Column 2 $dvd_field[2][3] = "genre"; // Name of MySQL table Column 3 $dvd_field[2][4] = "year"; // Name of MySQL table Column 4 $dvd_field[2][5] = "rating"; // Name of MySQL table Column 5 $dvd_field[2][6] = "link"; // Name of MySQL table Column 6 $dvd_field[2][7] = "country"; // Name of MySQL table Column 7 $dvd_field[2][8] = "director"; // Name of MySQL table Column 8 $dvd_field[2][9] = "plot"; // Name of MySQL table Column 9 ADDED THIS $dvd_field[2][10] = "trailer"; // Name of MySQL table Column 10 ADDED THIS /***************************************************************************** * IMDb link mode - See the README for more information. * *****************************************************************************/ $dvd_imdb_links = 1; // 1 = Direct links (using the IMDb record number) // 2 = Search links // 0 = No links /***************************************************************************** * Default maximum results per page. * * Valid settings are "50", "100", "200" or "all" * * "all" displays all results from the database on a single page. * *****************************************************************************/ $dvd_max_results_default = "all"; // Default Maximum results per page /***************************************************************************** * Colors and misc. settings * *****************************************************************************/ $dvd_search_text_color = "#FFFFFF"; // Search box text color $dvd_search_background_color = "#033A05"; // Search box background color $dvd_header_text_color = "#FFFFFF"; // Header/Footer text color $dvd_header_hover_color = "#12FF00"; // Header/Footer hover color $dvd_header_color = "#033A05"; // Header/Footer background color $dvd_text_color = "#FFFFFF"; // DVD Results text color $dvd_text_hover_color = "#12FF00"; // DVD Results hover color $dvd_table_bgcolor = "#12FF00"; // DVD Results table border color $dvd_row_color_1 = "#033A05"; // Row 1 background color $dvd_row_color_2 = "#033A05"; // Row 2 background color $dvd_body_bgcolor = "#033A05"; // Body background color $dvd_body_text_color = "#FFFFFF"; // Body text color $dvd_body_link_color = "#FFFFFF"; // Body link color $dvd_body_vlink_color = "#FFFFFF"; // Body visited link color $dvd_body_alink_color = "#12FF00"; // Body activated link color $dvd_body_hover_color = "#12FF00"; // Body hover color $dvd_page_title = "phatjoints.com Film Database"; // Page title $dvd_go_button = "go.gif"; // URL of the "go" button used on // the page /***************************************************************************** * End of configuration file. * *****************************************************************************/ ?> in index3.php just changed these lines <?php if ($dvd_field_6 != 0 AND $dvd_field_6 != "") $dvd_link = "<a href=\"http://www.imdb.com/Title?" . $dvd_field_6 . "\">" . $dvd_field_2 . "</a>"; //$dvd_field_1 = "<div class=\"search2\"><font color=\"$dvd_text_color\"><a href=\"http://www.imdb.com/Title?" . $dvd_field_6 . "\">" . $dvd_field_2 . "</a></font></div>"; else $dvd_link = "<a href=\"dvd/details.php?id=" . $dvd_field_0 . "\">" . $dvd_field_2 . "</a>"; // here is the link to dvd/details.php } elseif ($dvd_imdb_links == 2) $dvd_link = "<a href=\"http://www.imdb.com/Tsearch?title=" . urlencode($dvd_field_2) . "&restrict=Movies+and+TV\">" . $dvd_field_1 . "</a>"; //$dvd_field_2 = "<div class=\"search2\"><font color=\"$dvd_text_color\"><a href=\"http://www.imdb.com/Tsearch?title=" . urlencode($dvd_field_2) . "&restrict=Movies+and+TV\">" . $dvd_field_2 . "</a></font></div>"; else $dvd_link = "<a href=\"dvd/details.php?id=" . $dvd_field_0 . "\">" . $dvd_field_2 . "</a>"; // here is the link to dvd/details.php ?> And here is the dvd/details.php file <?php require('../config3.php'); $dvd_connect_string = @mysql_connect($dvd_mysql_host, $dvd_mysql_username, $dvd_mysql_password) or $db_error = 1; @mysql_select_db($dvd_mysql_db, $dvd_connect_string) or die("DataBase does not exist"); $id = $_GET['id']; $sql = "SELECT * FROM ".$dvd_mysql_table." WHERE ".$dvd_field[2][0]." = '$id'"; $res = mysql_query($sql) or die(mysql_error()); $r = mysql_fetch_assoc($res); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>phatjoints.com :: Movies: 2001: A Space Odyssey</title> <style type="text/css"> <!-- body { background-color: #033A05; } .style1 { font-family: Verdana, Arial, Helvetica, sans-serif; color: #FFFFFF; } .style2 {font-family: Verdana, Arial, Helvetica, sans-serif; color: #FFFFFF; font-size: small; } .bordercolor { border: 2px solid #FFFFFF; } --> </style> <script language="JavaScript" type="text/JavaScript"> <!-- function MM_reloadPage(init) { //reloads the window if Nav4 resized if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) { document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }} else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload(); } MM_reloadPage(true); //--> </script> <script type="text/javascript" src="swfobject.js"></script> </head> <body> <div id="Layer1" style="position:absolute; width:187px; height:303px; z-index:1; top: 27px;"><img src="covers/<?php echo $r[$dvd_field[2][1]]; ?>" width="194" height="307" border="2" class="bordercolor"></div> <div id="Layer3" style="position:absolute; width:157px; height:16px; z-index:3; left: 240px; top: 53px;" class="style1"> <h3>Year: <?php echo $r[$dvd_field[2][4]]; ?></h3> </div> <div id="Layer2" style="position:absolute; width:337px; height:38px; z-index:2; left: 234px; top: 1px;"> <h2 class="style1"><?php echo $r[$dvd_field[2][2]]; ?> </h2> </div> <div id="Layer4" style="position:absolute; width:336px; height:248px; z-index:4; left: 254px; top: 96px;" class="style1"> <h4>Plot</h4> <p class="style2"><?php echo nl2br(stripslashes($r[$dvd_field[2][9]])); ?></p> </div> <div id="Layer5" class="style2" style="position:absolute; width:210px; height:115px; z-index:5; left: 10px; top: 345px;"> <p align="left"><strong>My Rating</strong>: <?php echo $r[$dvd_field[2][5]]; ?></p> <p align="left"><strong>Genre</strong>: <?php echo $r[$dvd_field[2][3]]; ?></p> <p align="left"><strong>Country</strong>: <?php echo $r[$dvd_field[2][7]]; ?></p> <p align="left"><strong>Director</strong>: <?php echo $r[$dvd_field[2][8]]; ?> </p> </div> <div id="Layer6" style="position:absolute; width:339px; height:184px; z-index:6; left: 253px; top: 377px;" class="style1"> <h4>Trailer</h4> <div align="center"> <class id="player1"></class> <?php echo ' <script type="text/javascript"> var s1 = new SWFObject("flvplayer.swf","single","350","240","7"); s1.addParam("allowfullscreen","true"); s1.addVariable("file","trailers/'.$r[$dvd_field[2][10]].';"); s1.addVariable("image","preview.jpg"); s1.addVariable("width","350"); s1.addVariable("height","240"); s1.write("player1"); </script>'; ?> </div> </div> </body> </html> This is probably not complete but put in whatever you want to complete the page Ray Quote Link to comment https://forums.phpfreaks.com/topic/105276-solved-displaying-more-info-about-chosen-record-on-a-new-page/#findComment-541937 Share on other sites More sharing options...
toxictoad Posted May 16, 2008 Author Share Posted May 16, 2008 Ray thank you! It's taken me a while to get it working and I still need to put all the details page together but you sorted it and I have a better understanding of what's going on (maybe should have started with something easier) Much appreciated Quote Link to comment https://forums.phpfreaks.com/topic/105276-solved-displaying-more-info-about-chosen-record-on-a-new-page/#findComment-542947 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.