Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2010
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.11 KB | None | 0 0
  1.  
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4.  
  5. <head>
  6. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  7. <link href="css_photo.css" rel="stylesheet" type="text/css" />
  8. <title>
  9. Trial Gallery
  10. </title>
  11. </head>
  12.  
  13. <body>
  14.  
  15.  
  16. <?php
  17.           session_start();
  18.           $_SESSION['p'];
  19. ?>
  20.  
  21. <?php                        
  22.       $p_MAX = 3;
  23.       $p_MIN = 1;
  24.                                                
  25.       if (isset($_POST['next']))
  26.       {
  27.              ++$_SESSION['p'];
  28.                                                                
  29.              if ($_SESSION['p'] > $p_MAX)
  30.              $_SESSION['p'] = $p_MIN;                                                                              
  31.       }
  32.                                                
  33.       if (isset($_POST['prev']))
  34.       {
  35.              --$_SESSION['p'];
  36.                                                                
  37.              if ($_SESSION['p'] < $p_MIN)
  38.              $_SESSION['p'] = $p_MAX;
  39.       }                                                            
  40. ?>
  41.    
  42.         <div>
  43.             <img src="Screenshot1.png" id="<?php
  44.             if ($_SESSION['p'] == 1)
  45.             {
  46.                 echo $_SESSION['p'];
  47.             }
  48.            
  49.             else echo "none" . $_SESSION['p']; ?>" />
  50.            
  51.             <img src="Screenshot2.png" id="<?php
  52.             if ($_SESSION['p'] == 2)
  53.             {
  54.                 echo $_SESSION['p'];
  55.             }
  56.            
  57.             else echo "none" . $_SESSION['p']; ?>" />
  58.            
  59.             <img src="Screenshot3.png" id="<?php
  60.             if ($_SESSION['p'] == 3)
  61.             {
  62.                 echo $_SESSION['p'];
  63.             }
  64.            
  65.             else echo "none" . $_SESSION['p']; ?>" />
  66.         </div>
  67.        
  68.         <form method="post" id="listform" name="listform">
  69.         <ul>
  70.             <li>
  71.                 <input type="submit" id="prev" name="prev" value="Previous" />
  72.             </li>
  73.             <li>
  74.                 <input type="submit" id="next" name="next" value="Next" />
  75.             </li>
  76.         </ul>
  77.         </form>
  78.                        
  79. </body>
  80. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement