Got a problem making 2 php based pages work

  • delta1
  • Newbie
  • Newbie
  • delta1
  • Posts: 6

Post 3+ Months Ago

Ok the majority of you gentlemen (and any ladies present) are light years ahead of me when it comes to all this web creation work. I'm a hack and I admit so please be patient with me.

Ok...

I have been working on a couple of pages written in a combination of php and html.
I decided to add a second gallery page. The first page works great!! you click on it and it loads withou any problems. However when I tried to install the second gallery it just clicks back to the index page.

Now I'm sure that whatever I'm doing wrong or missing is so obvious that it could bite me. But as I said, I'm a hack and I've got a lot to learn. So if someone could show me what I'm missing, I would really be appreciative.

----------------

Index page.
Code: [ Select ]
<?php
    $menu = array('','','','','','','');
    $content = 'about';
    if(isset($_GET['id'])){
        switch($_GET['id']){
            case 'about': $menu[0]='img_active'; break;
            case 'galerie': $menu[1]='img_active'; $content = $_GET['id']; break;
            case 'galerie 2': $menu[2]='img_active'; $content = $_GET['id']; break;
            case 'accueil': $menu[3]='img_active'; $content = $_GET['id']; break;
            case 'fessebouc': $menu[4]='img_active'; $content = $_GET['id']; break;
            case 'myspace': $menu[5]='img_active'; $content = $_GET['id']; break;
            default: $menu[0]='img_active';
        }
    } else {
        $menu[0]='img_active';
    }
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "gone//gonew3gone/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="gone//gonew3gone/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Tabarnak</title>

<script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
<script src="js/jquery.prettyPhoto.js" type="text/javascript" charset="utf-8"></script>
<link type="text/css" href="css/prettyPhoto.css" rel="stylesheet" />    

<link type="text/css" href="css/index.css" rel="stylesheet" />
</head>

<body>
<div align="center">

    <div id="head_1" align="right">
      <div id="menu_wrapper"></div>
    <ul class="menu_ul">
        <li><a href="index.php?id=about" class="img_button <?php echo $menu[0]; ?>">Accueil</a></li>
      <li><a href="index.php?id=galerie" class="img_button <?php echo $menu[1]; ?>">Galerie</a></li>
      <li><a href="index.php?id=anna" class="img_button <?php echo $menu[2]; ?>">Galerie 2</a></li>
      <li><a href="gone//Deleted website url for the forum" class="img_button <?php echo $menu[2]; ?>">Blog</a></li>
    </ul>
      <ul class="menu_ul">
        <li><a href="index.php?id=accueil" class="img_button <?php echo $menu[3]; ?>">.</a></li>
     
    </ul>    
  </div>
  
    <div id="head_wrapper1">&nbsp;</div>
  <div id="head_mov_up">&nbsp;</div>
  <div id="head_mov">&nbsp;</div>
  <div id="head_mov_down">&nbsp;</div>
  <div id="content">
      <?php include('content/'.$content.'.php'); ?>
  </div>
  <div id="foot_1">
      <span id="tabarnak_copy">Tabarnak&copy; <?php echo date('Y'); ?></span>
  </div>
  
</div>
</body>
</html>
  1. <?php
  2.     $menu = array('','','','','','','');
  3.     $content = 'about';
  4.     if(isset($_GET['id'])){
  5.         switch($_GET['id']){
  6.             case 'about': $menu[0]='img_active'; break;
  7.             case 'galerie': $menu[1]='img_active'; $content = $_GET['id']; break;
  8.             case 'galerie 2': $menu[2]='img_active'; $content = $_GET['id']; break;
  9.             case 'accueil': $menu[3]='img_active'; $content = $_GET['id']; break;
  10.             case 'fessebouc': $menu[4]='img_active'; $content = $_GET['id']; break;
  11.             case 'myspace': $menu[5]='img_active'; $content = $_GET['id']; break;
  12.             default: $menu[0]='img_active';
  13.         }
  14.     } else {
  15.         $menu[0]='img_active';
  16.     }
  17. ?>
  18. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "gone//gonew3gone/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  19. <html xmlns="gone//gonew3gone/1999/xhtml">
  20. <head>
  21. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  22. <title>Tabarnak</title>
  23. <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
  24. <script src="js/jquery.prettyPhoto.js" type="text/javascript" charset="utf-8"></script>
  25. <link type="text/css" href="css/prettyPhoto.css" rel="stylesheet" />    
  26. <link type="text/css" href="css/index.css" rel="stylesheet" />
  27. </head>
  28. <body>
  29. <div align="center">
  30.     <div id="head_1" align="right">
  31.       <div id="menu_wrapper"></div>
  32.     <ul class="menu_ul">
  33.         <li><a href="index.php?id=about" class="img_button <?php echo $menu[0]; ?>">Accueil</a></li>
  34.       <li><a href="index.php?id=galerie" class="img_button <?php echo $menu[1]; ?>">Galerie</a></li>
  35.       <li><a href="index.php?id=anna" class="img_button <?php echo $menu[2]; ?>">Galerie 2</a></li>
  36.       <li><a href="gone//Deleted website url for the forum" class="img_button <?php echo $menu[2]; ?>">Blog</a></li>
  37.     </ul>
  38.       <ul class="menu_ul">
  39.         <li><a href="index.php?id=accueil" class="img_button <?php echo $menu[3]; ?>">.</a></li>
  40.      
  41.     </ul>    
  42.   </div>
  43.   
  44.     <div id="head_wrapper1">&nbsp;</div>
  45.   <div id="head_mov_up">&nbsp;</div>
  46.   <div id="head_mov">&nbsp;</div>
  47.   <div id="head_mov_down">&nbsp;</div>
  48.   <div id="content">
  49.       <?php include('content/'.$content.'.php'); ?>
  50.   </div>
  51.   <div id="foot_1">
  52.       <span id="tabarnak_copy">Tabarnak&copy; <?php echo date('Y'); ?></span>
  53.   </div>
  54.   
  55. </div>
  56. </body>
  57. </html>


The Gallery page that WORKS
Code: [ Select ]
<script type="text/javascript">
$(function() {
    $(document).ready(function(){
        $(".gallery a[rel^='prettyPhoto']").prettyPhoto({theme:'dark_rounded'});
    });
});
</script>
<h1>Galerie</h1>
<p>

<div align="center" class="gallery">
    <a href="gone//deleted webite url for the forum/gal/gd/anna/IMG_1011.jpg" rel="prettyPhoto[galleryC]"><img src="gone//deleted webite url for the forum/gal/gd/anna/pt/IMG_1011.jpg"/></a>
  <a href="gone//deleted webite url for the forum/gal/gd/anna/IMG_1153.jpg" rel="prettyPhoto[galleryC]"><img src="gone//deleted webite url for the forum/gal/gd/anna/pt/IMG_1146.jpg"/>
    <a href="gone//deleted webite url for the forum/gal/gd/IMG_0011.jpg" rel="prettyPhoto[galleryC]"><img src="gone//deleted webite url for the forum/gal/gd/anna/pt/IMG_1153.jpg"/></a>
   <a href="gone//deleted webite url for the forum/gal/gd/anna/IMG_1154.jpg" rel="prettyPhoto[galleryC]"><img src="gone//deleted webite url for the forum/gal/gd/anna/pt/IMG_1154.jpg"/></a>
  <a href="gone//deleted webite url for the forum/gal/gd/anna/IMG_1164.jpg" rel="prettyPhoto[galleryC]"><img src="gone//deleted webite url for the forum/gal/gd/anna/pt/IMG_1164.jpg"/></a>
  <a href="gone//deleted webite url for the forum/gal/gd/anna/IMG_1170.jpg" rel="prettyPhoto[galleryC]"><img src="gone//deleted webite url for the forum/gal/gd/anna/pt/IMG_1170.jpg"/></a>
  <a href="gone//deleted webite url for the forum/gal/gd/anna/IMG_1173.jpg" rel="prettyPhoto[galleryC]"><img src="gone//deleted webite url for the forum/gal/gd/anna/pt/IMG_1173.jpg"/></a>
  <a href="gone//deleted webite url for the forum/gal/gd/anna/IMG_1178.jpg" rel="prettyPhoto[galleryC]"><img src="gone//deleted webite url for the forum/gal/gd/anna/pt/IMG_1178.jpg"/></a>
  <a href="gone//deleted webite url for the forum/gal/gd/anna/IMG_1188.jpg" rel="prettyPhoto[galleryC]"><img src="gone//deleted webite url for the forum/gal/gd/anna/pt/IMG_1188.jpg"/></a>
  <a href="gone//deleted webite url for the forum/gal/gd/anna/IMG_1195.jpg" rel="prettyPhoto[galleryC]"><img src="gone//deleted webite url for the forum/gal/gd/anna/pt/IMG_1195.jpg"/></a>
  <a href="gone//deleted webite url for the forum/gal/gd/anna/IMG_1203.jpg" rel="prettyPhoto[galleryC]"><img src="gone//deleted webite url for the forum/gal/gd/anna/pt/IMG_1203.jpg"/></a>
  <a href="gone//deleted webite url for the forum/gal/gd/anna/IMG_1217.jpg" rel="prettyPhoto[galleryC]"><img src="gone//deleted webite url for the forum/gal/gd/anna/pt/IMG_1217.jpg"/></a>
</div>
<p>
&nbsp;&nbsp;</p><p>
&nbsp;&nbsp;</p><p>
&nbsp;&nbsp;</p>
<table border="0">
 <tr>
  <td><!-- START FreeVideoCodinggone -->
<embed src="gone//deleted webite url for the forum/flvplayer.swf?file=gone//deleted webite url for the forum/vd/amour_001.flv&autoStart=false" width="640" height="480" quality="high" type="application/x-shockwave-flash" pluginspage="gone//gonemacromediagone/go/getflashplayer"></embed>
<!-- END FreeVideoCodinggone --></td>
  <td>&nbsp;</td>
  <td>&nbsp;</td>
  <td>&nbsp;</td>
 </tr>
 <tr>
  <td>&nbsp;</td>
  <td><div align="center"><a href="gone//deleted webite url for the forum">deleted webite url for the forum</a></div></td>
  <td>&nbsp;</td>
  <td>&nbsp;</td>
 </tr>
 <tr>
  <td>&nbsp;</td>
  <td>&nbsp;</td>
  <td>&nbsp;</td>
  <td>&nbsp;</td>
 </tr>
 <tr>
  <td>&nbsp;</td>
  <td>&nbsp;</td>
  <td>&nbsp;</td>
  <td>&nbsp;</td>
 </tr>
</table>
<p align="center">Copyright ©2012 Tous droits réservés (all rights reserved.) </p>
  1. <script type="text/javascript">
  2. $(function() {
  3.     $(document).ready(function(){
  4.         $(".gallery a[rel^='prettyPhoto']").prettyPhoto({theme:'dark_rounded'});
  5.     });
  6. });
  7. </script>
  8. <h1>Galerie</h1>
  9. <p>
  10. <div align="center" class="gallery">
  11.     <a href="gone//deleted webite url for the forum/gal/gd/anna/IMG_1011.jpg" rel="prettyPhoto[galleryC]"><img src="gone//deleted webite url for the forum/gal/gd/anna/pt/IMG_1011.jpg"/></a>
  12.   <a href="gone//deleted webite url for the forum/gal/gd/anna/IMG_1153.jpg" rel="prettyPhoto[galleryC]"><img src="gone//deleted webite url for the forum/gal/gd/anna/pt/IMG_1146.jpg"/>
  13.     <a href="gone//deleted webite url for the forum/gal/gd/IMG_0011.jpg" rel="prettyPhoto[galleryC]"><img src="gone//deleted webite url for the forum/gal/gd/anna/pt/IMG_1153.jpg"/></a>
  14.    <a href="gone//deleted webite url for the forum/gal/gd/anna/IMG_1154.jpg" rel="prettyPhoto[galleryC]"><img src="gone//deleted webite url for the forum/gal/gd/anna/pt/IMG_1154.jpg"/></a>
  15.   <a href="gone//deleted webite url for the forum/gal/gd/anna/IMG_1164.jpg" rel="prettyPhoto[galleryC]"><img src="gone//deleted webite url for the forum/gal/gd/anna/pt/IMG_1164.jpg"/></a>
  16.   <a href="gone//deleted webite url for the forum/gal/gd/anna/IMG_1170.jpg" rel="prettyPhoto[galleryC]"><img src="gone//deleted webite url for the forum/gal/gd/anna/pt/IMG_1170.jpg"/></a>
  17.   <a href="gone//deleted webite url for the forum/gal/gd/anna/IMG_1173.jpg" rel="prettyPhoto[galleryC]"><img src="gone//deleted webite url for the forum/gal/gd/anna/pt/IMG_1173.jpg"/></a>
  18.   <a href="gone//deleted webite url for the forum/gal/gd/anna/IMG_1178.jpg" rel="prettyPhoto[galleryC]"><img src="gone//deleted webite url for the forum/gal/gd/anna/pt/IMG_1178.jpg"/></a>
  19.   <a href="gone//deleted webite url for the forum/gal/gd/anna/IMG_1188.jpg" rel="prettyPhoto[galleryC]"><img src="gone//deleted webite url for the forum/gal/gd/anna/pt/IMG_1188.jpg"/></a>
  20.   <a href="gone//deleted webite url for the forum/gal/gd/anna/IMG_1195.jpg" rel="prettyPhoto[galleryC]"><img src="gone//deleted webite url for the forum/gal/gd/anna/pt/IMG_1195.jpg"/></a>
  21.   <a href="gone//deleted webite url for the forum/gal/gd/anna/IMG_1203.jpg" rel="prettyPhoto[galleryC]"><img src="gone//deleted webite url for the forum/gal/gd/anna/pt/IMG_1203.jpg"/></a>
  22.   <a href="gone//deleted webite url for the forum/gal/gd/anna/IMG_1217.jpg" rel="prettyPhoto[galleryC]"><img src="gone//deleted webite url for the forum/gal/gd/anna/pt/IMG_1217.jpg"/></a>
  23. </div>
  24. <p>
  25. &nbsp;&nbsp;</p><p>
  26. &nbsp;&nbsp;</p><p>
  27. &nbsp;&nbsp;</p>
  28. <table border="0">
  29.  <tr>
  30.   <td><!-- START FreeVideoCodinggone -->
  31. <embed src="gone//deleted webite url for the forum/flvplayer.swf?file=gone//deleted webite url for the forum/vd/amour_001.flv&autoStart=false" width="640" height="480" quality="high" type="application/x-shockwave-flash" pluginspage="gone//gonemacromediagone/go/getflashplayer"></embed>
  32. <!-- END FreeVideoCodinggone --></td>
  33.   <td>&nbsp;</td>
  34.   <td>&nbsp;</td>
  35.   <td>&nbsp;</td>
  36.  </tr>
  37.  <tr>
  38.   <td>&nbsp;</td>
  39.   <td><div align="center"><a href="gone//deleted webite url for the forum">deleted webite url for the forum</a></div></td>
  40.   <td>&nbsp;</td>
  41.   <td>&nbsp;</td>
  42.  </tr>
  43.  <tr>
  44.   <td>&nbsp;</td>
  45.   <td>&nbsp;</td>
  46.   <td>&nbsp;</td>
  47.   <td>&nbsp;</td>
  48.  </tr>
  49.  <tr>
  50.   <td>&nbsp;</td>
  51.   <td>&nbsp;</td>
  52.   <td>&nbsp;</td>
  53.   <td>&nbsp;</td>
  54.  </tr>
  55. </table>
  56. <p align="center">Copyright ©2012 Tous droits réservés (all rights reserved.) </p>



The gallery page that does NOT work

Quote:
<script type="text/javascript">
$(function() {
$(document).ready(function(){
$(".gallery a[rel^='prettyPhoto']").prettyPhoto({theme:'dark_rounded'});
});
});
</script>
<h1>Galerie</h1>
<p>

<div align="center" class="gallery">
<a href="gone//deleted website url for the forum/gal/gd/anna/IMG_1011.jpg" rel="prettyPhoto[galleryC]"><img src="gone//deleted website url for the forum/gal/gd/anna/pt/IMG_1011.jpg"/></a>
<a href="gone//deleted website url for the forum/gal/gd/anna/IMG_1153.jpg" rel="prettyPhoto[galleryC]"><img src="gone//deleted website url for the forum/gal/gd/anna/pt/IMG_1146.jpg"/>
<a href="gone//deleted website url for the forum/gal/gd/IMG_0011.jpg" rel="prettyPhoto[galleryC]"><img src="gone//deleted website url for the forum/gal/gd/anna/pt/IMG_1153.jpg"/></a>
<a href="gone//deleted website url for the forum/gal/gd/anna/IMG_1154.jpg" rel="prettyPhoto[galleryC]"><img src="gone//deleted website url for the forum/gal/gd/anna/pt/IMG_1154.jpg"/></a>
<a href="gone//deleted website url for the forum/gal/gd/anna/IMG_1164.jpg" rel="prettyPhoto[galleryC]"><img src="gone//deleted website url for the forum/gal/gd/anna/pt/IMG_1164.jpg"/></a>
<a href="gone//deleted website url for the forum/gal/gd/anna/IMG_1170.jpg" rel="prettyPhoto[galleryC]"><img src="gone//deleted website url for the forum/gal/gd/anna/pt/IMG_1170.jpg"/></a>
<a href="gone//deleted website url for the forum/gal/gd/anna/IMG_1173.jpg" rel="prettyPhoto[galleryC]"><img src="gone//deleted website url for the forum/gal/gd/anna/pt/IMG_1173.jpg"/></a>
<a href="gone//deleted website url for the forum/gal/gd/anna/IMG_1178.jpg" rel="prettyPhoto[galleryC]"><img src="gone//deleted website url for the forum/gal/gd/anna/pt/IMG_1178.jpg"/></a>
<a href="gone//deleted website url for the forum/gal/gd/anna/IMG_1188.jpg" rel="prettyPhoto[galleryC]"><img src="gone//deleted website url for the forum/gal/gd/anna/pt/IMG_1188.jpg"/></a>
<a href="gone//deleted website url for the forum/gal/gd/anna/IMG_1195.jpg" rel="prettyPhoto[galleryC]"><img src="gone//deleted website url for the forum/gal/gd/anna/pt/IMG_1195.jpg"/></a>
<a href="gone//deleted website url for the forum/gal/gd/anna/IMG_1203.jpg" rel="prettyPhoto[galleryC]"><img src="gone//deleted website url for the forum/gal/gd/anna/pt/IMG_1203.jpg"/></a>
<a href="gone//deleted website url for the forum/gal/gd/anna/IMG_1217.jpg" rel="prettyPhoto[galleryC]"><img src="gone//deleted website url for the forum/gal/gd/anna/pt/IMG_1217.jpg"/></a>
</div>
<p>
&nbsp;&nbsp;</p><p>
&nbsp;&nbsp;</p><p>
&nbsp;&nbsp;</p>
<div align="center">
<table border="0">
<tr>
<td><!-- START FreeVideoCodinggone --><!-- END FreeVideoCodinggone --></td>
<td><div align="center"><a href="gone//deleted website url for the forum">Deleted website URL for the forum</a></div></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><div align="center"><a href="gone//deleted website url for the forum">deleted website url for the forum</a></div></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>
</div>
<p align="center">Copyright ©2012. Tous droits réservés (all rights reserved.) </p>
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • typhon
  • Guru
  • Guru
  • User avatar
  • Posts: 1294
  • Loc: Memphis, Tn

Post 3+ Months Ago

Am I missing something or is the code for the page that is not working the EXACT same as the code that is working.... same links, same images etc?????
  • delta1
  • Newbie
  • Newbie
  • delta1
  • Posts: 6

Post 3+ Months Ago

typhon wrote:
Am I missing something or is the code for the page that is not working the EXACT same as the code that is working.... same links, same images etc?????


I used the first gallery page as a template for the second gallery page. Which is why I can't understand it doesn't work.

When I'm on the index page (index.php) and I click on the first gallery page.. It loads and I get a url of index.php?id=galerie

BUT when I click on the link for the second gallery page I get a url of index.php?id=anna but instead of displaying the gallery I get the default content of the index.php page again.
  • mindfullsilence
  • Professor
  • Professor
  • User avatar
  • Posts: 854

Post 3+ Months Ago

As far as I can tell, there is no "anna" in your case statement, so your setting $image[0] = 'img_active'. That's all the script is doing when clicking on anything that isn't in the case statement. Is that what you want to happen?
  • delta1
  • Newbie
  • Newbie
  • delta1
  • Posts: 6

Post 3+ Months Ago

mindfullsilence wrote:
As far as I can tell, there is no "anna" in your case statement, so your setting $image[0] = 'img_active'. That's all the script is doing when clicking on anything that isn't in the case statement. Is that what you want to happen?



Thank you !!!!

It was right there under my nose and I could not figure it out because I'm a hack. I'm learning this stuff on the fly. (I'm a photographer and cameraman by trade... and I'm "old school" from back when we did our magick in labs not on computers)

I can't tell you how much of a headache this was and how much just couldn't put something that simple together. Once again I have got to say thank you and thanks to the owner of this forum for providing a venu that I could get another person to look at my pages.
  • mindfullsilence
  • Professor
  • Professor
  • User avatar
  • Posts: 854

Post 3+ Months Ago

Not a problem at all, delta. This kind of stuff happens to every programmer a LOT! Best thing you can do when you can't find the issue is to step away for 15 minutes or so and come back to it. If that doens't help, that's what we're here for.

Glad it's all worked out, happy coding!
  • spork
  • Brewmaster
  • Silver Member
  • User avatar
  • Posts: 6243
  • Loc: Seattle, WA

Post 3+ Months Ago

I enjoy Developer Duck :)
  • Zealous
  • Guru
  • Guru
  • User avatar
  • Posts: 1240
  • Loc: Sydney

Post 3+ Months Ago

spork wrote:
I enjoy Developer Duck :)


Ducks just got cooler, i think i will talk to my tux.

Post Information

  • Total Posts in this topic: 8 posts
  • Users browsing this forum: No registered users and 78 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.