I have followed the tutorial found at http://tutorials.alsacreations.com/frames/suite.php

So far, I have the acceuil page loading when we first go to the page. But the links give me a "not found" error.

I have tried this with hardcoding the actual server address (with the files uploaded to the proper location) http://www.mydomain.com/folder/file.htm

I have tried it using relative links file.htm

I have set the first link on the menu to load the EXACT same page as the intial view...and I still get a not found error (even though that page is displaying perfectly in it's "pseudo frame" on initial load..) Oh help. I'm sooooooooo confused..

In other words, I can get any page I want to load initially..but when it comes to dynamically changing the content of the div it always gives me a "not found" error even when the link is set to the same page as the initial page

Here's the code for the frame:
<div class="frame">
<pre>
<?php 
if (!isset($_GET['page'])) $page= 'accueil'; else $page= $_GET['page']; 
 switch($page)
{
case 'accueil': include ('test.php');break;
case 'presentation': include ('MOSEPT2006.htm');break;

} 
?></pre>
</div>
<!--end frame div-->



And here's the code for the menu (placed in a div that is a left column for navigation items only)

<div align="left" style="padding-left: 5px">
  
<ul><a href="frames2.php?page=accueil">Accueil</a></ul>
<ul><a href="frames2.php?page=presentation">Catalogue General<br /> 2.79 MB en PDF</a></ul><!--end ul div--> 

</div> 

Modifié par ahen8 (18 Sep 2006 - 18:40)
???
I prefer this for your menu :

<ul class="menu>
     <li><a href="frames2.php?page=accueil">Accueil</a></li>
     <li><a href="frames2.php?page=presentation">Catalogue General (2.79 MB en PDF)</a></li>
</ul>


and add your div style (align:left,...) in a ul.menu property in your css.

Sorry but my english is so poor.
Is it a "404 not found" error, or a "cannot include whatever.php because /path/folder/whatever.php was not found on the server" ?
masseuro a écrit :
???
I prefer this for your menu :

<ul class="menu>
     <li><a href="frames2.php?page=accueil">Accueil</a></li>
     <li><a href="frames2.php?page=presentation">Catalogue General (2.79 MB en PDF)</a></li>
</ul>


and add your div style (align:left,...) in a ul.menu property in your css.

Sorry but my english is so poor.


Don't worry, I'm sure my french is even worse.

Actually, to be clear, the navigation is already in a vertnav class that I created, but doesn't show here - sorry..and only specifies the look of the vertical navigation menu (no calls to other html files or such)

(I had to use that ugly "<div align="left" style="padding-left: 5px">" part to get the nav div to render correctly across myriad browsers. ouch ouch ouch and I hate to use <br> to position text, but I find that for the same reason of cross browser display, I am forced to go that way..any suggestions would be very gratefully taken!)

Really my main concern at this point is why will the frame div show the page specified in the PHP script at startup, but clicking on the acceuill link in the navigation menu produces "file not found" error..even when the page requested is set to be exactly the same page as the one that loads initially. In other words, when you first go to the page you see in the frame test.php - okay, that's good. But if you click on the first link of the navigation menu, which is set to acceuil...you get a "file not found" error.

And this file is EVERYWHERE> on my server at the root, on my dev machine in the site development root folder, in Inetpub/wwwroot, can be viewed from http://localhost/wwwroot/test.php.


What's going wrong here that clicking the link does not load the page into the frame div?

my dilema is to get the contents of the frame div working...and I'm not sure that you're suggestion (while totally normal) will fix that?

yark! Smiley eek

ahen8
mpop a écrit :
Is it a "404 not found" error, or a "cannot include whatever.php because /path/folder/whatever.php was not found on the server" ?



No, it's not the gentle, lovely, easily fixed 404 error (that until today I despised - but now realize that as errors go, it's rather nice actually.)

It's just a generic "La page est introuvable
Il se peut que la page que vous recherchez ait été supprimée, ait changé de nom ou soit momentanément indisponible."

But the file is there, all perky and happy, right where it's supposed to be and right where it was pulled from for the initial view...(to test this I set my Acueil link to the same page in an effort to debug)

Which really stumps me, since this file is everywhere (see previous post)

I'm sure I'm just doing something totally stupid here and can't see it..

soupir
ahen8

PS Love the turban..I'm not kidding.
Modifié par ahen8 (18 Sep 2006 - 17:49)
ahen8 a écrit :
What's going wrong here that clicking the link does not load the page into the frame div?

There might be some misunderstanding. The "fake frames" technique does not provide a substitute to HTML frames. Not at all. It's a whole different way of not repeating content (for exemple HTML content for the headers and navigation of the global page structure) over several different files.

The "fake frames" PHP-based technique just provides a way to build one HTML file from different files.

What all this means is that you don't include an HTML page inside another HTML page (that's the real frames way of doing it) : you include some PHP code inside a PHP script. If the global PHP script generates HTML content (like, again, the page headers, global divs, navigation, etc.) and the included code also generates HTML code, you're basically including some html code at one location on a global HTML page.

You may know about it already. Sorry if this is not helpful.

Now, you must have done something wrong with the way you use the script. Otherwise it'd just work. Smiley cligne
But the only way that we can figure out what is wrong is if you post here the faulty code (at least the code for the links and the PHP code that includes the files).
If you have these files online on some PHP-capable server, that would be a way to test a few things as well.
I've uploaded the page to http://www.les3singes.com/wphp.php

Ignore ALL links except the one on the left (acueil) as the others have not even been set to correct pages.
(I am just trying to get this working so I can dig in to the format more and create all the other stuff for the site)

As you will see, the test.php will load into the frame when you go to the link. but when you click on "aceuil" you will get a not found error.

Thanks for your speedy responses!
ahen8 a écrit :
But the file is there, all perky and happy, right where it's supposed to be and right where it was pulled from for the initial view...(to test this I set my Acueil link to the same page in an effort to debug)

Which really stumps me, since this file is everywhere (see previous post)

Hmm, this could be a file permissions issue.
If the server that hosts your files is unix-based, files should have permissions. Accessing files through HTTP means that the user who requests a file (or, in the case of PHP, for a file to be processed) will be identified as "other" (i.e. with no special status). Your files should have the "644" permissions (or rw-r--r--), while your folders should be "755" (rwxr-xr-x). If it's not presented that way (with your FTP software, for instance), just make sure that "others" (users who are not owner of the file or from the file's related group) can read the PHP/HTM files (as well as needed style sheets, pictures, etc.).

ahen8 a écrit :
PS Love the turban..I'm not kidding.

Yeah, shopped hand-drawn turban over a Philip K. Dick photograph is teh win. Smiley lol
mpop a écrit :

Hmm, this could be a file permissions issue.
If the server that hosts your files is unix-based, files should have permissions. Accessing files through HTTP means that the user who requests a file (or, in the case of PHP, for a file to be processed) will be identified as "other" (i.e. with no special status). Your files should have the "644" permissions (or rw-r--r--), while your folders should be "755" (rwxr-xr-x). If it's not presented that way (with your FTP software, for instance), just make sure that "others" (users who are not owner of the file or from the file's related group) can read the PHP/HTM files (as well as needed style sheets, pictures, etc.).


Just checked. ALl file permissions are read except for site owner that can RWX. Also deleted Dreamweaver files that were creating some weird login thing I never created. ??? choke gasp wheeze

maybe I'll just do this the easy way and create a page for every link on the site - but I hate to be a quitter.rats. Smiley sweatdrop

thanks!
Modifié par ahen8 (18 Sep 2006 - 18:15)
ahen8 a écrit :
I've uploaded the page to http://www.les3singes.com/wphp.php

Ignore ALL links except the one on the left (acueil) as the others have not even been set to correct pages.
(I am just trying to get this working so I can dig in to the format more and create all the other stuff for the site)

As you will see, the test.php will load into the frame when you go to the link. but when you click on "aceuil" you will get a not found error.

Thanks for your speedy responses!

Is the global page (with the PHP script that includes other files) the wphp.php file or the frames2.php file ?

If there is a frames2.php file in the exact same folder than the wphp.php file, than I can't think of why the server would not find it, except for file permissions issues. But, such problems normally produce a "403 access not granted" error, not a "404 file not found" one. Smiley sweatdrop
Modifié par mpop (18 Sep 2006 - 18:19)
ahen8 a écrit :
maybe I'll just do this the easy way and create a page for every link on the site - but I hate to be a quitter.rats. Smiley sweatdrop

Then there's the solution that you send me the files (in a zip file for instance) so I can check it out.

By the way, could you edit your very first message (using the edit button at the top right of said message) and use the [ code] and [ /code] tags to wrap the code you post on this forum? That would be great.
Note : no spaces in [ code] and [ /code].
mpop a écrit :

Is the global page (with the PHP script that includes other files) the wphp.php file or the frames2.php file ?

If there is a frames2.php file in the exact same folder than the wphp.php file, than I can't think of why the server would not find it, except for file permissions issues. But, such problems normally produce a "403 access not granted" error, not a "404 file not found" one. Smiley sweatdrop


no, wphp.php is is the main page...(like index.php would be)
the frame div is where the stuff should get pulled into with the script..

BUT whoa, hold on a second...nothing about creating a frames2.php file in the tutorial! (insert flush of probable shame here) perhaps this is the problem.? (i'm so sorry to put you through this.)

I will be happy to zip it all up for you and send it...send it...where?

Also, you may critique as you like the layout and such. I have inherited this monster from another web "dude" and have only just succeeded in making it, how to say this, palatable...

I am normally dealing with DBs so this is a new thing for me. Would that they needed a new DB!

thanks!
ahen8 a écrit :
no, wphp.php is is the main page...(like index.php would be)

Then your links should like like that :
<a href="wphp.php?page=accueil">Accueil</a>

You call the script (here wphp.php) and then you give it some parameters (here the parameter "page" has the value "accueil"). This parameter is the one whose value you test with the PHP script, this telling the PHP engine to include that file for this parameter. Make sure that the file to include is available at the given destination. Smiley cligne

ahen8 a écrit :
(i'm so sorry to put you through this.)

Don't worry about that. For each technology we start learning, we all have to start from zero, right?

ahen8 a écrit :
I will be happy to zip it all up for you and send it...send it...where?

If this message didn't help and you're stuck, you can send it to: fverschelde at gmail dot com.
Alright, I think I got it....

Remember I said I took this over from another guy?
and that it was doing that weird security check I didn't expect?
and that it was weird that it wasn't finding the same page that it had already pulled through?

WELL (insert heaving sigh here), I woke up around 5AM with an idea...(at this point you should be getting a little scared.. Smiley lol

Gave me the idea that somewhere, somewhere, there was a path being created dynamically...

And sure enough. In an old include file that gets called when another include gets called, there was some ancient code that was dynamically creating a bad path (really bad, as in a path that just no longer exists...sigh) when I deleted that, I stopped getting the security check, and then I changed the links to refer to the new page wphp.php and voila!

so to recap for all of you out there that need this solution, your link code for the menu must be changed to reflect the calling page..that is:

<a href="[i]frames2.php[/i]?page=accueil">


should be changed to:
<a href="[i]yourcallingpage.php[/i]?page=accueil">



I can't believe it was that easy.

THANK YOU SO MUCH FOR YOUR HELP!!!!

And your patience with this php newbie. It really made my start into it a much less 'lonely' endeavor. So instead of feeling like I will never get it, I now feel like I WILL get it and I'm not alone trying to do it either!

Really, you can't know how much you've helped!

Ahen8