On the detail page dynamic image gallery

I have a page master listing 8 products. I inserted a picture gallery dynamic on the details page that looks ok, but has a major flaw: when you click on a thumbnail for the main picture opens on the wrong page. for example if you click on the page... dragons.php? id = 3 the main image opens on... /dragons.php/ID=1 and shows the following url:.../dragons.php?image=btf.jpg (or whatever the name of the image file).

I have just started using php and I would appreciate some advice on how to solve this problem.

The following are the relevant sections of the code?

$vardragon_dragons_species = "1";
if (isset($_GET['id'])) {
  $vardragon_dragons_species = $_GET['id'];
}
mysql_select_db($database_cjwebsite, $cjwebsite);
$query_dragons_species = sprintf("SELECT dragons.Order, dragons.family, dragons.Latin, dragons.English, dragons.Img1, dragons.Img2, dragons.Img3, dragons.img4, dragons.Img5, dragons.text, `dragons gallery`.filename, `dragons gallery`.caption, dragons.id, `dragons gallery`.image_id, dragons.id FROM dragons, `dragons gallery` WHERE dragons.id = `dragons gallery`.image_id AND dragons.id=%s", GetSQLValueString($vardragon_dragons_species, "int"));
$dragons_species = mysql_query($query_dragons_species, $cjwebsite) or die(mysql_error());
$row_dragons_species = mysql_fetch_assoc($dragons_species);
$totalRows_dragons_species = mysql_num_rows($dragons_species);

if (isset($_GET['image'])) {
  $mainImage = $_GET['image'];
  }
else {
  $mainImage = $row_dragons_species['filename']; }

<body>
  
  <div class="main_image"><img src="../images/dragons/<?php echo $mainImage; ?>" alt="<?php echo $row_dragons_species['caption']; ?>" />
  <div class="capt"><?php echo $row_dragons_species['caption']; ?></div>

<ul class="gallery">
        <?php do { 
                  
      if ($row_dragons_species['filename'] == $mainImage) {
                 $row_dragons_species['caption'];
               }?>
  <li><a href="<?php echo $_SERVER['PHP_SELF'];?>?image=<?php echo $row_dragons_species['filename']; ?>"><img src="../images/dragons/thumbs/<?php echo $row_dragons_species['filename']; ?>" alt="<?php echo $row_dragons_species['caption']; ?>"  /></a></li>
  <?php } while ($row_dragons_species = mysql_fetch_assoc($dragons_species)); ?>
  </ul>

Thank you very much

CJ

I think I see what is the problem. If I understand correctly, you get the thumbnails to the right when the page is loaded first from the master page, but not when you click on a thumbnail.

What is happening now is that $_GET ['id'] is defined when the page reloads after clicking on a thumbnail. Thus, you must add the correct ID in the miniature link like this:

  • ?image=&id="><?php echo $row_dragons_species['caption']; ?>
  • Tags: Dreamweaver

    Similar Questions

    • Go to the details page: solution more simple/best

      Hello.

      DW CS3, PHP & mySQL.

      What would you recommend as the solution the most simple/better to have a link to the page of results to the details page?

      I used CS3 built in SB for whole Page master detail. But, really, I don't like it. It messes up my full and re-written result page
      my details page. Only, I copied the link to details page and delete the rest.

      I then downloaded appliqué, with much support from Felix of http://www.felixone.it/extensions/freeextdetailen.asp?IDProdotto=FX_PHPMissing I downloaded this extension. It works very well.

      For a long time, maybe more than a year, someone helped me to make a link to the page of details without any extension. But now I don't remember how. I'm sure that we have no extension.

      I would really appreciate your opinion and your support.

      Thanx for as much.

      Deon

      It is very easy to do without extension.

      1. Create a link to the details page by clicking on the icon of the folder next to the link field in the property inspector.
      2. In the select a file dialog box, navigate to the detail page, and then click parameters next to the URL field.
      3. In the settings dialog box, type the name of the primary key in the name field.
      4. Click lightning icon to the right of the value field, and then select the primary key of the Recordset.
      5. Click OK to close the dialog boxes.

      This creates a URL that looks like this:

      ">Go to details
      

      When displayed in a browser, which produces a URL that looks like this: detail.php? product_id = 45.

      On the details page, use the URL parameter for the primary key to select the correct record in the Recordset.

    • Is it possible to disable the "edit layout" link on the Details page for the record

      Is it possible to disable the "edit layout" link on the Details page for the record? Not home pages, I know there is a switch for that, but I thought that it was one for the detail pages?

      I want to disable what I don't want users who record their own layouts, they stick to the related sections defined in the default layout. The problem is that if they want to have access to some lists associated with when the opportunity is of a certain type, but NOT other types. If they saved the page layout (using the "Change layout" link) and change the record type, they will see the related provisions that were set to "Not available" in the default layout (IE step 4) for this 'type '.

      Robbo, for now it is not possible to disable the page layout to change the Registration Details page.

    • Text of the position under CSS image gallery

      I do a basic css image gallery that I learned from W3

      the CSS and HTML is listed below

      I've set up and it works fine, I just want to put some text in the Gallery, I'm not legends sense or under images or something like that... I'm done with the image gallery I want to start a new paragraph.

      I tried just to start a new after the Gallery of images with the < p > tags and it lines up right next to the image gallery. I used the < br > tag and still snaps at his side. I can operate using about 6 < p > tags with them, but I know there must be an easier way, then that, just get under the inbetween image gallery.

      Anyone know how?

      Thank you

      < html >

      < head >

      < style type = "text/css" >

      div.img

      {

      margin: 2px;

      border: 1px solid #0000ff;

      height: auto;

      Width: auto;

      float: left;

      text-align: center;

      }

      IMG div.img

      {

      Display: inline;

      margin: 3px;

      border: 1px solid #ffffff;

      }

      div.img a: hover img

      {

      border: 1px solid #0000ff;

      }

      div.DESC

      {

      text-align: center;

      Police-weight: normal;

      Width: 120px;

      margin: 2px;

      }

      < / style >

      < / head >

      < body >

      < div class = "img" >

      < a target = "_blank" href = "klematis_big.htm" >

      < img src = "klematis_small.jpg" alt = "Clematis" width = "110" height = "90" / > "

      < /a >

      < div class = "desc" > add a description to the image here < / div >

      < / div >

      < div class = "img" >

      < a target = "_blank" href = "klematis2_big.htm" >

      < img src = "klematis2_small.jpg" alt = "Clematis" width = "110" height = "90" / > "

      < /a >

      < div class = "desc" > add a description to the image here < / div >

      < / div >

      < div class = "img" >

      < a target = "_blank" href = "klematis3_big.htm" >

      < img src = "klematis3_small.jpg" alt = "Clematis" width = "110" height = "90" / > "

      < /a >

      < div class = "desc" > add a description to the image here < / div >

      < / div >

      < div class = "img" >

      < a target = "_blank" href = "klematis4_big.htm" >

      < img src = "klematis4_small.jpg" alt = "Clematis" width = "110" height = "90" / > "

      < /a >

      < div class = "desc" > add a description to the image here < / div >

      < / div >

      < / body >

      < / html >

      Add the following code after the last image


      GRAMPS

    • display title in the following page dynamically, how?

      I turn pages each with a title different tour...

      like this one:

      111.JPG

      what I want is, when someone clicks on the "Réservation" button at the top left, the tour title appears automatically on the top of the booking page (program name):

      222.JPG

      Program name: (Alexander the great)

      How can I achieve that?

      Http://deltatoursegypt.com/tours/tours_details/classical_tours/ALE xander_the_great.html have the booking link code looks like this:

    • Reservation
    • Change http://deltatoursegypt.com/reservation.html to http://deltatoursegypt.com/reservation. php extension

      On http://www.deltatoursegypt.com/reservation. code php select edit as follows:

      
      
    • How to get the path page dynamically

      Hello.

      How to get the path to the current page in the processRequest of the controller method? e.g. "/ oracle/apps/ak/sandbox sand/webui/SamplePG.

      -wheleph

      pageContext.getParameter ("page");

      This line will give you exactly what you want...
      Thank you
      Annapurneswar

    • Adding movieclip "loading" in the dynamic image gallery?

      Hello again,

      I finished my Gallery of images based on the XML, but the direct test after I realized I did a rookie mistake and not to put some kind of placeholder "loading" loop movie clip while the thumbnails - and the images at full size - are responsible. Images will appear randomly when loading and I would like to be able to insert a placeholder clip while they load and exchange with the thumbnails/images after that that it was loaded. The placeholder clip is in my library (loadingLoop), but I have problems to make it work properly.

      Here is the original function that transforms the XML and adds thumbnails; It's when I try to insert the clip of space reserved by XML child node (each attempt I did just keep throwing more errors, so I failed in my attempts to avoid confusion), and I joined the XML file for testing. And a preview or help would be appreciated.

      Browse to the external XML file and trigger the xmlLoaded when finished
      xmlLoader.load (new URLRequest("data/artGallery.xml"));
      xmlLoader.addEventListener (Event.COMPLETE, xmlLoaded);

      Load the XML file and process the location of images
      function xmlLoaded(event:Event):void {}
      XML = XML (event.target.data);
      analyze the nodes in the XML file
      xmlList = xml.children ();
      count the number of nodes in the XML via XMLList
      trace (xmlList.length ());
      loop to load all of the vignettes, based on the number of nodes in the XMLList
      "I am" = all of the child nodes in the XML file
      for (var i: int = 0; i < xmlList.length (); i ++) {}

      Add loadingLoop movie clip by node and wait for thumbnail to load before swapping with thumbnails imageLoader <-help!


      for each node, create a new instance to put on stage
      imageLoader = new Loader();
      load each thumbnail from its location by the 'thumb' of the XML node attribute
      imageLoader.load (new URLRequest (xmlList [i] .attribute ("thumb")));
      position of the miniature instances per XML node (horizontally on stage)
      imageLoader.x = i * 110 + 10; thumbs has so 100 x 100, + 10 for width, plus + 10 of left border
      imageLoader.y = 10;
      for each node in the XML list, the instance name with the path to the location of the image full size
      imageLoader.name = xmlList [i] .attribute ("source");
      for each node in the XML list, add a drop shadow
      imageLoader.filters = [thumbDShadow];
      Add thumbnails to stage
      addChild (imageLoader);
      dropTween = new Tween (imageLoader, "y", Bounce.easeOut,-100, 10, 1, true);
      implemented vignettes to wait click Run showPicture
      imageLoader.addEventListener (MouseEvent.CLICK, showPicture);
      set thumbnails to scale up when spilled
      imageLoader.addEventListener (MouseEvent.ROLL_OVER, sizeUP);
      }
      }

      my mistake.  use:

      function xmlLoaded(event:Event):void {}
      XML = XML (event.target.data);
      xmlList = xml.children ();
      for (var i: int = 0; i< xmllist.length();="" i++)="">

      var mc:MovieClip = new MovieClip();

      MC. Ivar = i;

      addChild (mc);

      MC. LDR = new Loader();
      MC. LDR. Load (new URLRequest (xmlList [i] .attribute ("thumb")));
      MC. LDR. Name = xmlList [i] .attribute ("source");

      MC.x = i * 110 + 10; thumbs has so 100 x 100, + 10 for width, plus + 10 of left border


      mc.addChild (mc.ldr);

      MC.loadingloop = new loadingLoop();

      mc.addChild (mc.loadingloop);
      MC.filters = [thumbDShadow];


      mc.ldr.contentLoaderInfo.addEventListener (Event.COMPLETE, removeLoop);

      mc.addEventListener (MouseEvent.CLICK, showPicture);
      mc.addEventListener (MouseEvent.ROLL_OVER, sizeUP);
      }
      function removeLoop(event:Event):void {}
            event.target.loader.parent.removeChild (MovieClip (event.target.loader.parent) .loadingloop);
      }
      }

    • Is there a way to change the date limit of the details page of Salesforce agreement once that agreement came out to the Signature?

      Currently, the only way to change your Salesforce is by going to "manage agreements." The problem is that the registration of Salesforce and echosign are more synchronized. Is there a way for users to go to the agreement and be able to change the date limit?

      Hi esluskonis,

      I'm sorry, but it is not possible to change the time of the signing of the document by using Salesforce.

      Kind regards

      Ana Maria

    • Detail of the Master Page results question

      I'm using CS5, with MySQL databases

      So my situation is the following-

      I have a dynamic video site with the videos contained in specific properties. The done property page part of a set of pages master detail that connects to the video Details page.

      For example, I have property on a page buttons ('property x', "property y" and "z property"). If a visitor clicks on say 'property x', they are sent to the property page for "property x" where all related videos 'property x' are listed as thumbnails ("video one", "video b" and "video c '"). The visitor can then click on a thumbnail to tell "video c ', where they are then directed to the details page for" video c ' and they can watch the video. It all works correctly.

      What I'm trying to do however, is get all the videos associated with the assigned properties also appears in the details of the page. As in the example above, I need all the videos that are associated ONLY 'property x' ("video one", "video b" and "video c" ") is displayed on the details page for"video one"," video b "or" video c.

      I've been racking my brain on this for several weeks now without much luck, so any help would be GREATLY appreciated.

      > Wouldn't be better to repost the question in the right place?

      No, I just mentioned for future reference.

      Assuming you want to these "related video" to be included in the same detail Recordset...

      SELECT properties.propertyWebname, properties.propertyAbbrv, properties.propertyTitle, properties.propertyID, properties.propertyDesc, videos.videoTitle, videos.videoDesc, videos.videoID

      Properties, videos

      WHERE properties.propertyID = videos.property and video.propery in (select property of videos where video.ID = colname)

      That should give you a list of all the videos that are in the same category as the primary a passed to the page. If you want to create a separate Recordset of simply connected video to display on another section of the page, and then delete the folder 'primary' based on the results

      SELECT properties.propertyWebname, properties.propertyAbbrv, properties.propertyTitle, properties.propertyID, properties.propertyDesc, videos.videoTitle, videos.videoDesc, videos.videoID

      Properties, videos

      WHERE properties.propertyID = videos.property and video.propery in (select property of videos where video.ID = colname) and videos.videoID <> colname

    • Master page link to a details page displays only the first record

      Hello

      Could someone tell me please how to fix this problem:

      I have a master page that lists all users of my, and I have links next to them to take them to the specific user details. However, the links of all other records only show details for the first record.

      This is the link that is supposed to brings me to the details page:

      < a href = "patientlist2.php? Patient_id = <? PHP echo $row_rsPatients ["Patient_id"];? > "> <?" PHP echo $row_rsPatientlist ["Patient_id"];? > < / a >

      I have the same problem when you try to update the files, only the first record will appear.

      I'd appreciate any help.

      Thank you

      There is probably something wrong with your recordset. Test the query in the window of recordset for the generation of game records to ensure that you get the results desired of the recordset before placing and repeat on the page.

    • Rendered Automator PDF Pages as Images not Convtering

      So this is really weird.  I followed the app in Automator.  The file that results is not a JPEG, but just an another PDF file.  What I'm missing here?

      Ask the Finder items

      Copies the items from the Finder

      Rename items

      Make the PDF Pages as Images

      I found the answer.  I needed to adjust the order of the steps.  It is now:

      Ask the Finder items

      Make the PDF Pages as Images

      Move the items from the Finder

      Rename Finder items

      Works like a charm now.

    • Show/hide media download on Web App Details Page

      Is it possible to display a Web App List View and detail to the public view BUT hide a download of media that is on the display page of detail behind a registration form protected area? The idea is that when people submit the form, they see download media.

      I have normally introduce visitors to the Web site with a list of items in the Web application view and hide the detail view behind a Secure area registration form. The disadvantage of this approach is to 1. potential subscribers are limited to the amount of info provided in 2 and the list view. You cannot advertise the link to the page to display the element a Web App detail which, in our situation, acts as a landing page to promote an e-book.

      Hey,.

      The best way to achieve this might be something in this direction:

      1. attach the download items support

      2. do not secure the webapps

      3. on the details page for webapp, using cash, check if the currently logged-on user has access to the secure area and if so list media download. Otherwise, display a form "register now to get access.

      Here's how to get the secure areas from which the current user has access to- the secure areas of the logged in user has access to that list

      Kind regards

      Mihai

    • iRecruitment candidate offers to the error page

      Dear all,
      When I create candidate offer in the Irec after personal in detail the basis for offer and click Next it gives me error "you have encountered an unexpected error. Please contact the system administrator for assistance. "

      Any help please!

      Hello

      You can action the offer (once approved) since the details of the candidate page. Supply established, once you ask the approved offer, click on the name of the applicant. You should see the tab offers in the details page of the candidate with the approved offer. See actions in the menu on the right for all the actions that you can take the offer. one of them will be probably called send offer or make an offer (don't remember clearly)

      Kind regards
      Laulagnet

    • Disable the detail view?

      Hello

      IM using a web application to create a listing, members who will be essentially a list of people, having each one ideally have a category. The page with the list view can be seen here:

      http://www.bicesterchamber.co.UK/Member-Directory

      For now I have disabled the link thanks to the detail page, however it will still indexed by the search engines and site search which is obviously not ideal. Could someone point me in the right direction for the best solution please?

      I should also ideally create a search form for users can refine all ads based on their category, found here:

      http://www.bicesterchamber.co.UK/membership

      Ive had a look at the search engine web app but that pulls in the categories at the level of the site, which is too broad for this use.

      I hope it is clear at all,

      Thank you

      Tom

      In your model of the detail view, you must create a template for it and redirect it with a header meta tag in the HTML template in your home directory.

      "for example: http://www.bicesterchamber.co.uk/member-directory" >

      This will then give you the solution desired for your redirection.

      You can also publish a model for web app view of detail that isn't any detail on this to reduce the risk of it being indexed and found.

      Hope it's a useful method for you.

    • How to return to the correct page on Cancel

      Greetings,

      I have several Apex applications and many of them have the same 'problem '. I have dealt with this, but whenever I create a new application or report that it bothers me. :-)

      I usually have a page of common details and several reports in any give Apex application. No need to create multiple pages of detail (one for each report) where 1 is sufficient. On all reports, a person can click on a link to go to the details page for a specific line, but when they click Cancel in the page of detail that it is configured to create a branch to a specific report and the chances are that it is not the report that they were access to the detail page. I want so that it creates a branch to the accurate report from the person. Make sense? How do I do that? I guess that part of the solution is to have the detail of the page to know who to report a person clicks to get the detail page. Don't know how to do it again.

      Any help is greatly appreciated.

      THX, Tony

      Hello

      I don't know how to do this through purely APEX applications (do not write in a table in the DB).

      However, you can do as part of a is

      a. create a component of demand, say FRETURN_TO_PAGE
      b. write an application with Point treatment process after a footer that has

      :FRETURN_TO_PAGE := :APP_PAGE_ID;
      

      Add the status of type "Current Page is no in Expression1 (commas list of pages)" and add all the Master report of page numbers in 1 delimitd comma Expression
      c. in the details report directorates in the branch of Page instead put a digital page number & FRETURN_TO_PAGE. (the last period is important)

      That should do it. As and as you add a new report, you can simply add the page number in the process described above.

      Kind regards

    Maybe you are looking for

    • Be a problem using a charger better?

      I'm using 2nd generation of bike g and it takes a lot of time to load. If the phone will face any problem if I use a more powerful charger?

    • Battery Lenovo Edge 15 unauthorized error

      I have a Lenovo Edge 15 80H10004US. It's about five months. Recently, I noticed that the battery has a red X on it, and although it is reported that plugged in charge, he never takes a charge. If I disconnect the AC power that the laptop turns off in

    • license problem

      Hi all I have a problem today - I use a multipurpose for LabView license, I wanted to install LV on a different PC, but the installer tells me that my license is not a good license for LabView. You have the same problem? Kind regards Marcin

    • HOW DO WE INSTALL UPDATES WHEN THEY KEEP CONTINUALLY FAIL?

      I have problems with windows server 2003, install windows and security updates. How can I go on the resolution of these issues?

    • Impossible to share file error: the specified service does not exist as an installed service

      Original title: Impossible to share a folder in Vista I have Vista Home Basic 2007 with service pack 1. My software provider tries to share a file on the network and is unable to do so and has no solution. The error message is something like "not sev