Jump to content

Fila54

Members
  • Posts

    4
  • Joined

  • Last visited

Fila54's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hello everyone I'm looking for some advice or simple code to create cookies system according to the new europe law. What I mean is that I have to make an information box about my cookies policy with a button 'accept'. When user press this button the cookie will be send to him just not to show this box again. I'm a beginner in php so please explain everything very clearly ( almost like to an idiot ;p ) and sorry for my english ! Thanks
  2. Fila54

    Justify images

    Hi ! I've got a little problem with creating my gallery. What I want is simply gallery which perfectly fits to my website. So I decided to make a lightbox gallery where thumbnails are justify. And there is my question how can I justify images in my div? I don't want to center them.
  3. Thanks for replies ! now everything is right but when I try to go to my guestbook page there is an error: Warning: require(subpages/guestbook/1.php) [function.require]: failed to open stream: No such file or directory in /index.php on line 75 My code looks like that: <?php if(!$page) { require("/subpages/main.php"); } elseif (file_exists('subpages/' . $page . '.php')) { require('subpages/' . $page . '.php'); } elseif ($page='gbook' && file_exists('subpages/guestbook/' . $page . '.php')) { require('subpages/guestbook/' . $page . '.php'); }else { echo '<div id="main"><span>The page you’re looking for cannot be found.</span></div>'; } ?> and the link to the guestbook in menu: <td><a class="link" href="index.php?page=gbook">Guestbook</a></td> When I tape /subpages/guestbook/gbook.php after my site address everything is fine and there is a guestbook site. Why the warning refers to the "1.php" ?
  4. Hi everyone ! I'm new here... So I got a little problem with creating my first website. I want to include files with the content of my subpages to the main index file. At the first I made a simple solution with switch. Where the urls to the files in the menu look like: href="index.php?page=1" than "page=2" and so on and the code in the place of subpages content was: <? switch ($_GET['page']) { case 2: include("/subpages/aboutme.php"); break; case 3: include("/subpages/a=gallery.php"); break; case 4: include("/subpages/movies.php"); break; case 5: include("/subpages/contact.php"); break; case 1: default: include("/subpages/main.php"); } ?> Of course this solution was correct and it was working BUT what about when someone change the url to the ..."index.php?page=10000000" just because being curious and to check what will happen (there isn't any site with the sign "The page you're looking for cannot be found") and the other reason why I want to upgrade my include solution was that I have to add another cases every time when I want to make another subpages. So I decided to change it and my new url code in menu looks like: href="index.php?page=aboutme" or href="index.php?page=gallery" (so after equal sign there is an exactly name of my subpage without ".php") and than the code which includes my content is: if (file_exists('subpages/' . $page . '.php')) { require('subpages/' . $page . '.php'); } else { echo '<div id="main"><span>The page you’re looking for cannot be found.</span></div>'; } where the $page=$_GET['page']; It is working too but only when I click on one of the subpages in my menu but what about default like in the switch solution? I mean the case when I go to my site typing url without selecting any subpage. Now there is just the sign "The page you're looking for cannot be found." My other question is that I want to add a guestbook which is in the other folder in subpages so the url is "subpages/guestbook/gbook.php". What should I change in my code which works only for the subpages folder? I try to do something like this but it doesn't work: if ($page='gbook' && file_exists('subpages/guestbook/' . $page . '.php')) { require('subpages/guestbook/' . $page . '.php'); } elseif ($page!='gbook' && file_exists('subpages/' . $page . '.php')) { require("subpages/' . $page . '.php'); } else { echo '<div id="main"><span>The page you’re looking for cannot be found.</span></div>'; } Sorry for the length of this topic but I want to avoid unnecessary questions and useless solutions and I want apologies for my English but I'm 17 and I'm from Poland so I've been still learning it !
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.