HTML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignHTML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #16  
Old January 17th, 2005, 12:08 AM
MasterMinds MasterMinds is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Oct 2004
Posts: 556 MasterMinds Negative: is most likely a SPAMMER and a traitor to the cause. 
Time spent in forums: 2 Days 12 h 9 sec
Reputation Power: 0
I DID IT!!!!!!!!!!!!! YAY

HAHA

This rocks. Thank you guys SO MUCH for all the help. I figured out the rest, about making my own IF statement for the main index.php load cuzz $page has no value upon first load.

THen the links use kravvitz' think and it works.

THANKS!

Reply With Quote
  #17  
Old January 17th, 2005, 03:59 PM
SimonGreenhill's Avatar
SimonGreenhill SimonGreenhill is offline
(retired)
Dev Shed God 11th Plane (10000 - 10499 posts)
 
Join Date: Dec 2003
Location: The Laboratory
Posts: 10,101 SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)  Folding Points: 4925 Folding Title: Novice Folder
Time spent in forums: 3 Months 3 Weeks 6 h 8 m 34 sec
Reputation Power: 0
Facebook
MasterMinds - make sure you limit the possible page values. Don't let any page request go through. There are a number of php worms taking advantage of sites that do that.

Reply With Quote
  #18  
Old January 17th, 2005, 04:12 PM
MasterMinds MasterMinds is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Oct 2004
Posts: 556 MasterMinds Negative: is most likely a SPAMMER and a traitor to the cause. 
Time spent in forums: 2 Days 12 h 9 sec
Reputation Power: 0
Quote:
Originally Posted by SimonGreenhill
MasterMinds - make sure you limit the possible page values. Don't let any page request go through. There are a number of php worms taking advantage of sites that do that.


Hi. Let me see if I get this right.

Ok basically, upon the original index page load $page has NO value at all. I used an IF statement to say that if page has no value, then use $page = page1.php

Then what happens is, if page does have a value (from the url obviously) it uses that value.

Here is my original IF then - done out of the blue just from guessing, since I don't do PHP - although I guess now thanks to this thread I sort of do

Code:
<?php

	if($page == '')
		{
		$page = "page1.php";
		}

?>


Ok. So now I need to tell it firstly that I allow other values, and say that if it has this other value send it here, so far I offer values page1.php and page2.php

Code:

<?php

	if($page == '')
		{
		$page = "page1.php";
		}

         if($page == 'page1.php')
                {
                $page == "page1php";
                }

          if($page == 'page2.php')
                {
                 $page == "page2.php};
                 }

           else()
               {
                $page == "goawayhacker.php"
               }

?>


Ok that is my wild guess. It allows only the values i put in the function - and will redirect to tubgirl if someone tries to mess with it

ok anyways - I am guessing the shorter way is to use some statement that sasy "if $page does equal this, or this, or this etc.. then..."

I just dunno that syntax since I'm not a programmer

Lemme know the critique Simon thanks!

Reply With Quote
  #19  
Old January 17th, 2005, 04:22 PM
Akh's Avatar
Akh Akh is offline
|<.+#f@#+.&.|
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Mar 2002
Location: norway
Posts: 3,009 Akh User rank is General 4th Grade (Above 100000 Reputation Level)Akh User rank is General 4th Grade (Above 100000 Reputation Level)Akh User rank is General 4th Grade (Above 100000 Reputation Level)Akh User rank is General 4th Grade (Above 100000 Reputation Level)Akh User rank is General 4th Grade (Above 100000 Reputation Level)Akh User rank is General 4th Grade (Above 100000 Reputation Level)Akh User rank is General 4th Grade (Above 100000 Reputation Level)Akh User rank is General 4th Grade (Above 100000 Reputation Level)Akh User rank is General 4th Grade (Above 100000 Reputation Level)Akh User rank is General 4th Grade (Above 100000 Reputation Level)Akh User rank is General 4th Grade (Above 100000 Reputation Level)Akh User rank is General 4th Grade (Above 100000 Reputation Level)Akh User rank is General 4th Grade (Above 100000 Reputation Level)Akh User rank is General 4th Grade (Above 100000 Reputation Level)Akh User rank is General 4th Grade (Above 100000 Reputation Level)Akh User rank is General 4th Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 4 Days 17 h 35 m 11 sec
Reputation Power: 1223
isn't it better to use switch instead a bunch of if-statements?

something like http://no.php.net/manual/en/control...witch.php#30037
__________________

Reply With Quote
  #20  
Old January 17th, 2005, 04:29 PM
SimonGreenhill's Avatar
SimonGreenhill SimonGreenhill is offline
(retired)
Dev Shed God 11th Plane (10000 - 10499 posts)
 
Join Date: Dec 2003
Location: The Laboratory
Posts: 10,101 SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)  Folding Points: 4925 Folding Title: Novice Folder
Time spent in forums: 3 Months 3 Weeks 6 h 8 m 34 sec
Reputation Power: 0
Facebook
That's going to get so painful when you get lots of pages. It's probably better to use a switch statement as Akh said - and have a default: entry to just direct somewhere safe. You can also use in_array(), which I discussed in this thread.

Cheers,
Simon

Reply With Quote
  #21  
Old January 17th, 2005, 05:18 PM
MasterMinds MasterMinds is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Oct 2004
Posts: 556 MasterMinds Negative: is most likely a SPAMMER and a traitor to the cause. 
Time spent in forums: 2 Days 12 h 9 sec
Reputation Power: 0
EDIT: Learned how to use switch and got it to work. THANK YOU GUYS! I learned a lot from this thread, damn.

Reply With Quote
  #22  
Old January 17th, 2005, 05:30 PM
MCowboyE19 MCowboyE19 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 16 MCowboyE19 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 3 m 12 sec
Reputation Power: 0
Hello,

I highly recommend using PHP includes for this type of site. I have multiple sites running in this fashion. Create a main index.php page that will hold your menu and then create a table that will serve as a container for your information. When the user selects things from the menu pass them back to the index.php page with HTTP variables liek this.

index.php?pageID=news

The news will be able to load in the 'main table' table of your site without having to reload the rest of the index.php page (i.e. headers, footers, menus, copyright info, etc)

Here is a sample of the code used on the index.php page to include the rest:

Code:
<?php
		$id = $HTTP_GET_VARS["id"]; 
		
		if($id==null)
			{
			@include'PHP/news.php';
			}

		else
			{
			if(file_exists('PHP/'.$id.'.php'))
				{
				$page = "PHP/$id.php";
				@include($page);
				}
			else
				echo"Error: Could not include Page.";
			}
	?>

Reply With Quote
  #23  
Old January 17th, 2005, 05:37 PM
Kravvitz's Avatar
Kravvitz Kravvitz is offline
CSS & JS/DOM Adept
Dev Shed God 30th Plane (19500 - 19999 posts)
 
Join Date: Jul 2004
Location: USA
Posts: 19,893 Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level) 
Time spent in forums: 6 Months 2 Days 19 h 21 m 49 sec
Reputation Power: 4192
MCowboyE19, you are mistaken about how it works. It reloads the entire page, it just has the other files in cache so those don't have to be downloaded again.

Their is no requirement to use tables. Tableless layouts can work fine with includes as well.

Wouldn't it be easier to use TheJim01's solution?

Reply With Quote
  #24  
Old January 17th, 2005, 05:38 PM
MasterMinds MasterMinds is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Oct 2004
Posts: 556 MasterMinds Negative: is most likely a SPAMMER and a traitor to the cause. 
Time spent in forums: 2 Days 12 h 9 sec
Reputation Power: 0
Quote:
Originally Posted by MCowboyE19
Hello,

I highly recommend using PHP includes for this type of site. I have multiple sites running in this fashion. Create a main index.php page that will hold your menu and then create a table that will serve as a container for your information. When the user selects things from the menu pass them back to the index.php page with HTTP variables liek this.

index.php?pageID=news

The news will be able to load in the 'main table' table of your site without having to reload the rest of the index.php page (i.e. headers, footers, menus, copyright info, etc)

Here is a sample of the code used on the index.php page to include the rest:

Code:
<?php
		$id = $HTTP_GET_VARS["id"]; 
		
		if($id==null)
			{
			@include'PHP/news.php';
			}

		else
			{
			if(file_exists('PHP/'.$id.'.php'))
				{
				$page = "PHP/$id.php";
				@include($page);
				}
			else
				echo"Error: Could not include Page.";
			}
	?>



cowboy - this is what I am doing, thanks to all the help in this htread. thank you for the suggestion, i love these php includes and vars.inc and template.inc and the switch thingie.

so much good stuff i can do from those now.

Reply With Quote
  #25  
Old January 31st, 2005, 04:21 PM
scotthallett scotthallett is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 1 scotthallett User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 m 12 sec
Reputation Power: 0
Ive tried both, but still have errors when $page is blank

Ive tried this for my index.php:



<?
require('intro.html');
require('header.html');
require('leftnav.html');

/********** Load Main Content **********/

$page = $HTTP_GET_VARS["page"];

if($page==null)
{
@include'body.html';
}

else
{
if(file_exists($page))
{
$page = "$page";
@include($page);
}
else
echo"Error: Could not include Page.";
}

/********** End Main Content **********/

require('footer.html');
?>


as well as this:

<?
require('intro.html');
require('header.html');
require('leftnav.html');

/********** Load Main Content **********/

if($page == '')
{
$page = "body.html";
}

$pagename = $_GET['page'];

//***** patching hole allowing external pages being loaded
//***** compatible with PHP 3, 4, & 5
$myfiles = array();
$ismine = false;
$thisdir = opendir('./');
while(($file = readdir($thisdir)) !== false){
if($file == $pagename){
$ismine = true;
}
}
closedir($thisdir);
//***** end patch

if($pagename == '' or $ismine == false){
$pagename = 'body.html';
}

require($pagename);

/********** End Main Content **********/

require('footer.html');
?>


But either way, if I address the URL without passing a $page variable, then I get an

Notice: Undefined index: page in c:\easyphp\www\index.php

error in the output, if I midify the URL with the variable, then there is no error???

Any ideas?

All help is greatly appreciated, thanks in advance...

Reply With Quote
  #26  
Old January 31st, 2005, 04:44 PM
ChiefWigs1982's Avatar
ChiefWigs1982 ChiefWigs1982 is offline
Cunning Linguist
Dev Shed God 11th Plane (10000 - 10499 posts)
 
Join Date: Jul 2003
Location: I used to live at home, now I stay at the house
Posts: 10,180 ChiefWigs1982 User rank is General 16th Grade (Above 100000 Reputation Level)ChiefWigs1982 User rank is General 16th Grade (Above 100000 Reputation Level)ChiefWigs1982 User rank is General 16th Grade (Above 100000 Reputation Level)ChiefWigs1982 User rank is General 16th Grade (Above 100000 Reputation Level)ChiefWigs1982 User rank is General 16th Grade (Above 100000 Reputation Level)ChiefWigs1982 User rank is General 16th Grade (Above 100000 Reputation Level)ChiefWigs1982 User rank is General 16th Grade (Above 100000 Reputation Level)ChiefWigs1982 User rank is General 16th Grade (Above 100000 Reputation Level)ChiefWigs1982 User rank is General 16th Grade (Above 100000 Reputation Level)ChiefWigs1982 User rank is General 16th Grade (Above 100000 Reputation Level)ChiefWigs1982 User rank is General 16th Grade (Above 100000 Reputation Level)ChiefWigs1982 User rank is General 16th Grade (Above 100000 Reputation Level)ChiefWigs1982 User rank is General 16th Grade (Above 100000 Reputation Level)ChiefWigs1982 User rank is General 16th Grade (Above 100000 Reputation Level)ChiefWigs1982 User rank is General 16th Grade (Above 100000 Reputation Level)ChiefWigs1982 User rank is General 16th Grade (Above 100000 Reputation Level)  Folding Points: 50746 Folding Title: Beginner FolderFolding Points: 50746 Folding Title: Beginner FolderFolding Points: 50746 Folding Title: Beginner Folder
Time spent in forums: 3 Months 3 Weeks 5 Days 19 h 56 m 47 sec
Reputation Power: 2037
This is a php issue, please ask php questions in the PHP Develmpent forum...
__________________
Support requests via PM will be ignored!
Sites: WordPress Metro Theme | Route of Queue
Read These: The General Rules Thread | The General FAQ Thread | NEW USERS - How to post a question


Reply With Quote
  #27  
Old January 31st, 2005, 08:57 PM
medialint's Avatar
medialint medialint is offline
Type Cast Exception
Dev Shed God 20th Plane (14500 - 14999 posts)
 
Join Date: Apr 2004
Location: OAKLAND CA | Adam's Point (Fairyland)
Posts: 14,939 medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)  Folding Points: 319635 Folding Title: Super Ultimate Folder - Level 1Folding Points: 319635 Folding Title: Super Ultimate Folder - Level 1Folding Points: 319635 Folding Title: Super Ultimate Folder - Level 1Folding Points: 319635 Folding Title: Super Ultimate Folder - Level 1Folding Points: 319635 Folding Title: Super Ultimate Folder - Level 1Folding Points: 319635 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 6 Months 2 Weeks 2 Days 1 h 38 m 6 sec
Reputation Power: 8490
Facebook
You got plenty of responses on implementing PHP or SSI includes, which is the way I'd go myself. Back to the question:

Q: Is it OK to use FRAMES for a site?

A: No. Here's why: when you use frames you load a file that in turn loads the framesets. However, when search engines bot the site they aren't necessarilly aware of the frames and therefore, if someone finds your site on a search they are likely to hit only that page, which won't load the frames, and thus your navigation is also lost.

I host a site for a friend of mine and despite my pointing this out to him he is reluctant to change it. I setup a dynamic site for him, but being not very savvy with things he wanted to just use his website designer tool (whatever he's using). When I look at his weblogs, it's painful. Thousands of hits to specific pages from searches which, of course, don't have the navigation to the rest of the site.

Presently I'm trying to talk him into figuring out how to turn those frames into includes with his program. *sigh*
__________________
medialint.com

“Today you are You, that is truer than true. There is no one alive who is Youer than You.” - Dr. Seuss

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignHTML Programming > Is it OK to use FRAMES for a site?

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap