Page Source Problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ChrisBull
Forum Commoner
Posts: 42
Joined: Fri Aug 20, 2010 7:43 am

Page Source Problem

Post by ChrisBull »

This is really strange, I have created a small little demo to help explain my problem.

I have a page,

Code: Select all

meta data stuff, title, style links etc.

<?php

$viewPage = "one";

//Switch statement goes here and either changes $viewPage or leaves it alone/

?>
<body>
<?php require_once( $viewPage )?>
</body>
The person who views the page always views the "one" page first and then the page is refreshed and the 'switch statement' changes the value to display a different page. This is all working perfectly. BUT after the refresh and the page displays different content, if i right click and view source, the page source has the code from the previous page, the "one" page???? Doesnt make any sence, normally I wouldnt mind, but it stops all of the <a> tags from working that are in the new content.
ANyone know how to fix this???

Many Thanks
Chris
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Re: Page Source Problem

Post by josh »

You're going to replace the problematic part with an un-helpful comment and expect us to solve the problem anyways? We're a community of programmers, not wizards ;-)

For your information, viewing source may or may not issue another request. That isn't guaranteed to you by any standards. Its totally left up to the browser & browser configuration.
ChrisBull
Forum Commoner
Posts: 42
Joined: Fri Aug 20, 2010 7:43 am

Re: Page Source Problem

Post by ChrisBull »

Um thanks i guess can't quite tell if i should feel insulted though... either way i took on what you said and tested it in firefox instead of chrome and the page source shows what its meant to, the a tag not working was because i missed the = sign silly me.
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Re: Page Source Problem

Post by josh »

ChrisBull wrote:Um thanks i guess can't quite tell if i should feel insulted though....
Not intended in a negative manner, just my way of communicating how to help us help you
User avatar
Jonah Bron
DevNet Master
Posts: 2764
Joined: Thu Mar 15, 2007 6:28 pm
Location: Redding, California

Re: Page Source Problem

Post by Jonah Bron »

josh wrote:
ChrisBull wrote:Um thanks i guess can't quite tell if i should feel insulted though....
Not intended in a negative manner, just my way of communicating how to help us help you
Observe the winking emoticon.
Post Reply