Jump to content

Archived

This topic is now archived and is closed to further replies.

PAFTprod

Integrating a gallery in an existing webpage (PHP)

Recommended Posts

Ok my current websites functions in this way:

I got an index.php which contains the template of the website, it uses url links for the menus like this:

[i]<a href="?page=media"> IMAGE LINK </a>[/i]

further down on the page where i want it to change depending on which menu button u click i got this:

[i]<?php
$page = $HTTP_GET_VARS['page'];
if (!isset($page) || $page == "") { $page = "home"; }
include ("$page.php");
?>[/i]


So in the case above it would load the media.php file into the index.php page..

[b]Problem 1:[/b]

Now i want to use the same concept, but on the media.php page i want links to a video page, gallery page etc.. both being under another folder /video and /gallery respectively. I want it so that when i click the gallery link the gallery.php loads in the place of the media.php. It has to keep my index.php on the rest of the page. I really dont know how to do the php linking for this - going into a subfolder.

[b]2nd Problem:[/b]

I've managed to put the gallery into the same folder as the rest of my site and make it display inside my index.php as gallery.php. This is extremely messy in my FTP so i need to solve problem 1 first. When problem 1 is solved i need to fix this:

As soon as i click a link from the gallery that i imported from an online freeware script.. say another page inside theg gallery it jumps out of my index.php page..and goes into standard gallery page removing the rest of my website design. So my question is what do i do to fix these links so that it keeps within my index.php file? And what do i write?

-----------

If anyone can help me out with this.. i would be extremely greatful!

Share this post


Link to post
Share on other sites
Sorry about the thread bumping.. but ive been trying to figure this out for the entire day.. and my thread disappeared to page 3 so was worryin about not getting a response. Please someone help me!

Share this post


Link to post
Share on other sites
I am having a hard time understanding the problems...

But this is wrong:
[code=php:0][hr]<?php
$page = $HTTP_GET_VARS['page'];
if (!isset($page) || $page == "") { $page = "home"; }
include ("$page.php");
?>[/code][hr]

Change it to:
[code=php:0][hr]<?php
$page = $HTTP_GET_VARS['page'];
if (!isset($_GET['page']) || $_GET['page']== "") {$page = "home";}
else{$page = $_GET['page'];};
include ($page.".php");
?>[/code][hr]


Orio.

Share this post


Link to post
Share on other sites
Aite i made the change that you wrote..

<?php
$page = $HTTP_GET_VARS['page'];
if (!isset($_GET['page']) || $_GET['page']== "") {$page = "home";}
else{$page = $_GET['page'];};
include ($page.".php");
?>

but the one i wrote works as well. The problem is that i got a gallery script that is in a sub-folder from my index.php ( /index.php and my gallery script in /gallery/index.php) - I want to link to it properly using php, so was wondering how to do that in the following:

<a href="?????"> IMAGE LINK </a>


-------------------- 2nd problem is this:

Lets say that ive fixed the issue above - I now face this problem:

As soon as i click a link on the gallery/index.php that has been imported into my /index.php it jumps out of my /index.php file and shows the gallery in a completely refreshed window without my original /index.php design.

According to the guys that wrote this gallery script i need to do the following:

[i]Since v0.9.10 it has been possible to include singapore into your web design using external.php. Just place this code where you want singapore to appear: <?php include("path/to/singapore/external.php");?> (supplying the correct relative or absolute path to singapore instead of '/path/to/singapore'). There are, however, a few things that need to be noted:

You will almost certainly need to edit your chosen template in order that the HTML generated is still valid. For example you do not want two <html> start tags, two <head> sections etc. Alternatively you can use the external template (available to download from the website) which is the default template with the unnecessary (X)HTML removed.

If the file into which you are including singapore is named something other than index.php or it requires additional GET variables (such as page etc.) then you will need to change index_file_url to reflect this. For example if the page you are including singapore into is site.php?page=gallery you will need to change index_file_url to site.php?page=gallery&amp; [/i]

Now i tried both solutions.. and i got the following error on my page:


[i]Warning: main(): open_basedir restriction in effect. File(/gallery/external.php) is not within the allowed path(s): (/.../:/usr/lib/php:/usr/local/lib/php:/tmp) in /.../public_html/testing2/test.php on line 7

Warning: main(/gallery/external.php): failed to open stream: Operation not permitted in /..../public_html/testing2/test.php on line 7

Warning: main(): open_basedir restriction in effect. File(/gallery/external.php) is not within the allowed path(s): (/..../:/usr/lib/php:/usr/local/lib/php:/tmp) in /...../public_html/testing2/test.php on line 7

Warning: main(/gallery/external.php): failed to open stream: Operation not permitted in /..../public_html/testing2/test.php on line 7

Warning: main(): Failed opening '/gallery/external.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /..../public_html/testing2/test.php on line 7[/i]

Share this post


Link to post
Share on other sites
Orio you got any idea now? Or do i need to re-explain.. maybe im making this a lot more complicated then it is?

Share this post


Link to post
Share on other sites

×

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.