Re: [PHP] More PHP Includes

2009-03-11 Thread tedd

At 9:59 AM -0400 3/10/09, Gary wrote:

Thanks again for all the help.

I created a simple page of all includes (header, menu, 3 columns).  I mixed
the file types up. The menu (projectseven PMM) I saved as a library item,
works fine.  Had an HTML file in there, but I am guessing that having 2 page
declarations along with an extra set of  and  tags was playing
havoc with the code, so I removed them. Same thing when I created a php page
and saved it as filename.inc.php, so I removed all the declarations and
tags, again seems to work fine. Also included a simple .txt file.

I did get some strange results in that all of the  were highlighted
after the menu, and I had to remove and insert again to correct.

So is this the best way, to create a php page, remove all of the html tags
and page declarations and name it filename.inc.php? (I'm using DW CS3)

Also, something I do not understand, I included a small txt file in a page
of a customer and it shows fine, however this file is not on the server...is
this normal?



Gary:

If you want to see how this all plays out in a demo, try this:

http://sperling.com/examples/include-demo/

Go through the complete demo and you'll see how the 
header/footer/menu include things work.


Cheers,

tedd

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] More PHP Includes

2009-03-11 Thread 9el
On Wed, Mar 11, 2009 at 6:16 AM, Gary  wrote:

> Jochem
>
> Thanks for your reply, the project seven and DW was just for a point of
> information, same as if you have an issue with a computer you generally
> find
> it a good idea to list your operating system and other pertinent facts.


What Jochem told is true, IDEs like DW is good for mainly designers but
could be a feeder for a matured man (coder).
For IDE I support using something like Netbeans PDT.


>
> I had coded the scripts and files by hand.



The way you asked about the files you included reflects you have some basic
lack of understanding of the way they should look like /organized(not
intended any slightest offense). But this discussion would open your eyes.
The file where your include other files is rendered as a single HTML file
so, think in that way, it would be just easy to understand.

>
>
> The file was not on the server and it did not point back to my hard drive,
> it was hand coded and not uploaded to the server, which is why it was
> curious.



Yes this curiosity is really helpful. As I mentioned about the intrusion
probability this way. Try collecting the ZCE exam Guide and you can study
the 'Security'  Chapter there.

>
>
> "Jochem Maas"  wrote in message
> news:49b6fddd.20...@iamjochem.com...
> > Gary schreef:
> >> I'm sorry you were not able to understand the questions, but thank you
> >> for
> >> trying.
> >
> > a few tips:
> >
> > 1. don't assume people know what 'projectseven PMM'
> > 2. it's doubtful anyone worth their salt on this list uses or
> > knows much about a mind-bending, soul-destroyer like DreamWeaver.
> > 3. try your hand at building a page by hand using a simple text editor
> > and copious ammounts of searching/reading about HTML structure ... doing
> > it this way will help you to understand what goes wrong and why, when
> > DW tries to 'help you'.
> >
> >
> >
> >> The path to the include is not an absolute path.
> >
> > then it is on the server, somewhere on your php include_path.
> >
> >> "Jochem Maas"  wrote in message
> >> news:49b6b6d8.7050...@iamjochem.com...
> >>> Gary schreef:
>  Thanks again for all the help.
> 
>  I created a simple page of all includes (header, menu, 3 columns).  I
>  mixed
>  the file types up. The menu (projectseven PMM) I saved as a library
>  item,
>  works fine.  Had an HTML file in there, but I am guessing that having
> 2
>  page
>  declarations along with an extra set of  and  tags was
>  playing
>  havoc with the code, so I removed them. Same thing when I created a
> php
>  page
>  and saved it as filename.inc.php, so I removed all the declarations
> and
>  tags, again seems to work fine. Also included a simple .txt file.
> 
>  I did get some strange results in that all of the  were
>  highlighted
>  after the menu, and I had to remove and insert again to correct.
> 
>  So is this the best way, to create a php page, remove all of the html
>  tags
>  and page declarations and name it filename.inc.php? (I'm using DW CS3)
> >>> I'm quite sure I don't understand any of that ... so I'd hazard a guess
> >>> and so "no it's not the best way"
> >>>
>  Also, something I do not understand, I included a small txt file in a
>  page
>  of a customer and it shows fine, however this file is not on the
>  server...is
>  this normal?
> 
> >>> it's probably pointing to a file on your machine, e.g.
> >>> file://C:/path/to/file.txt,
> >>> that's something you see quite often with DW/FrontPage/ >>> WYSIWYG-PITA-editor here>.
> >>>
> 
> >>
> >>
> >>
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


RE: [PHP] More PHP Includes

2009-03-11 Thread Mayer, Jonathan


-Original Message-
From: Gary [mailto:gwp...@ptd.net] 
Sent: 11 March 2009 00:17
To: php-general@lists.php.net
Subject: Re: [PHP] More PHP Includes

>Jochem
>
>Thanks for your reply, the project seven and DW was just for a point of

>information, same as if you have an issue with a computer you generally
find 
>it a good idea to list your operating system and other pertinent facts.

>I had coded the scripts and files by hand.

>The file was not on the server and it did not point back to my hard
drive, 
>it was hand coded and not uploaded to the server, which is why it was 
>curious.


The way I sometimes go about making a website is to fully code up the
entire first page with a design I would like.
Menus/headers/footers/layout and all. Then, when I'm happy with it, I
cut it up into componant parts which I then include back in.

This way there is no chance of having repeated tags, and everything is
neatly organised. By the time you've cut it up, your index.php file will
likely have nothing more than a bunch of includes and possibly the text
specific to the index page.

Don't think that each included file needs to work on its own. It doesn't
matter if the included file doesn't open a tag if the page calling it
has opened the tag already (such as ). I've had an include that
formed part of a table, with the table created by a different included
file, and closed by yet another.



"Jochem Maas"  wrote in message 
news:49b6fddd.20...@iamjochem.com...
> Gary schreef:
>> I'm sorry you were not able to understand the questions, but thank
you 
>> for
>> trying.
>
> a few tips:
>
> 1. don't assume people know what 'projectseven PMM'
> 2. it's doubtful anyone worth their salt on this list uses or
> knows much about a mind-bending, soul-destroyer like DreamWeaver.
> 3. try your hand at building a page by hand using a simple text editor
> and copious ammounts of searching/reading about HTML structure ...
doing
> it this way will help you to understand what goes wrong and why, when
> DW tries to 'help you'.
>
>
>
>> The path to the include is not an absolute path.
>
> then it is on the server, somewhere on your php include_path.
>
>> "Jochem Maas"  wrote in message
>> news:49b6b6d8.7050...@iamjochem.com...
>>> Gary schreef:
>>>> Thanks again for all the help.
>>>>
>>>> I created a simple page of all includes (header, menu, 3 columns).
I
>>>> mixed
>>>> the file types up. The menu (projectseven PMM) I saved as a library

>>>> item,
>>>> works fine.  Had an HTML file in there, but I am guessing that
having 2
>>>> page
>>>> declarations along with an extra set of  and  tags was
>>>> playing
>>>> havoc with the code, so I removed them. Same thing when I created a
php
>>>> page
>>>> and saved it as filename.inc.php, so I removed all the declarations
and
>>>> tags, again seems to work fine. Also included a simple .txt file.
>>>>
>>>> I did get some strange results in that all of the  were 
>>>> highlighted
>>>> after the menu, and I had to remove and insert again to correct.
>>>>
>>>> So is this the best way, to create a php page, remove all of the
html
>>>> tags
>>>> and page declarations and name it filename.inc.php? (I'm using DW
CS3)
>>> I'm quite sure I don't understand any of that ... so I'd hazard a
guess
>>> and so "no it's not the best way"
>>>
>>>> Also, something I do not understand, I included a small txt file in
a
>>>> page
>>>> of a customer and it shows fine, however this file is not on the
>>>> server...is
>>>> this normal?
>>>>
>>> it's probably pointing to a file on your machine, e.g.
>>> file://C:/path/to/file.txt,
>>> that's something you see quite often with DW/FrontPage/>> WYSIWYG-PITA-editor here>.
>>>
>>>>
>>
>>
>>
> 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] More PHP Includes

2009-03-10 Thread Gary
Jochem

Thanks for your reply, the project seven and DW was just for a point of 
information, same as if you have an issue with a computer you generally find 
it a good idea to list your operating system and other pertinent facts.

I had coded the scripts and files by hand.

The file was not on the server and it did not point back to my hard drive, 
it was hand coded and not uploaded to the server, which is why it was 
curious.




"Jochem Maas"  wrote in message 
news:49b6fddd.20...@iamjochem.com...
> Gary schreef:
>> I'm sorry you were not able to understand the questions, but thank you 
>> for
>> trying.
>
> a few tips:
>
> 1. don't assume people know what 'projectseven PMM'
> 2. it's doubtful anyone worth their salt on this list uses or
> knows much about a mind-bending, soul-destroyer like DreamWeaver.
> 3. try your hand at building a page by hand using a simple text editor
> and copious ammounts of searching/reading about HTML structure ... doing
> it this way will help you to understand what goes wrong and why, when
> DW tries to 'help you'.
>
>
>
>> The path to the include is not an absolute path.
>
> then it is on the server, somewhere on your php include_path.
>
>> "Jochem Maas"  wrote in message
>> news:49b6b6d8.7050...@iamjochem.com...
>>> Gary schreef:
 Thanks again for all the help.

 I created a simple page of all includes (header, menu, 3 columns).  I
 mixed
 the file types up. The menu (projectseven PMM) I saved as a library 
 item,
 works fine.  Had an HTML file in there, but I am guessing that having 2
 page
 declarations along with an extra set of  and  tags was
 playing
 havoc with the code, so I removed them. Same thing when I created a php
 page
 and saved it as filename.inc.php, so I removed all the declarations and
 tags, again seems to work fine. Also included a simple .txt file.

 I did get some strange results in that all of the  were 
 highlighted
 after the menu, and I had to remove and insert again to correct.

 So is this the best way, to create a php page, remove all of the html
 tags
 and page declarations and name it filename.inc.php? (I'm using DW CS3)
>>> I'm quite sure I don't understand any of that ... so I'd hazard a guess
>>> and so "no it's not the best way"
>>>
 Also, something I do not understand, I included a small txt file in a
 page
 of a customer and it shows fine, however this file is not on the
 server...is
 this normal?

>>> it's probably pointing to a file on your machine, e.g.
>>> file://C:/path/to/file.txt,
>>> that's something you see quite often with DW/FrontPage/>> WYSIWYG-PITA-editor here>.
>>>

>>
>>
>>
> 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] More PHP Includes

2009-03-10 Thread Jochem Maas
Gary schreef:
> I'm sorry you were not able to understand the questions, but thank you for 
> trying.

a few tips:

1. don't assume people know what 'projectseven PMM'
2. it's doubtful anyone worth their salt on this list uses or
knows much about a mind-bending, soul-destroyer like DreamWeaver.
3. try your hand at building a page by hand using a simple text editor
and copious ammounts of searching/reading about HTML structure ... doing
it this way will help you to understand what goes wrong and why, when
DW tries to 'help you'.



> The path to the include is not an absolute path.

then it is on the server, somewhere on your php include_path.

> "Jochem Maas"  wrote in message 
> news:49b6b6d8.7050...@iamjochem.com...
>> Gary schreef:
>>> Thanks again for all the help.
>>>
>>> I created a simple page of all includes (header, menu, 3 columns).  I 
>>> mixed
>>> the file types up. The menu (projectseven PMM) I saved as a library item,
>>> works fine.  Had an HTML file in there, but I am guessing that having 2 
>>> page
>>> declarations along with an extra set of  and  tags was 
>>> playing
>>> havoc with the code, so I removed them. Same thing when I created a php 
>>> page
>>> and saved it as filename.inc.php, so I removed all the declarations and
>>> tags, again seems to work fine. Also included a simple .txt file.
>>>
>>> I did get some strange results in that all of the  were highlighted
>>> after the menu, and I had to remove and insert again to correct.
>>>
>>> So is this the best way, to create a php page, remove all of the html 
>>> tags
>>> and page declarations and name it filename.inc.php? (I'm using DW CS3)
>> I'm quite sure I don't understand any of that ... so I'd hazard a guess
>> and so "no it's not the best way"
>>
>>> Also, something I do not understand, I included a small txt file in a 
>>> page
>>> of a customer and it shows fine, however this file is not on the 
>>> server...is
>>> this normal?
>>>
>> it's probably pointing to a file on your machine, e.g. 
>> file://C:/path/to/file.txt,
>> that's something you see quite often with DW/FrontPage/> WYSIWYG-PITA-editor here>.
>>
>>>
> 
> 
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] More PHP Includes

2009-03-10 Thread Gary
I'm sorry you were not able to understand the questions, but thank you for 
trying.

The path to the include is not an absolute path.


"Jochem Maas"  wrote in message 
news:49b6b6d8.7050...@iamjochem.com...
> Gary schreef:
>> Thanks again for all the help.
>>
>> I created a simple page of all includes (header, menu, 3 columns).  I 
>> mixed
>> the file types up. The menu (projectseven PMM) I saved as a library item,
>> works fine.  Had an HTML file in there, but I am guessing that having 2 
>> page
>> declarations along with an extra set of  and  tags was 
>> playing
>> havoc with the code, so I removed them. Same thing when I created a php 
>> page
>> and saved it as filename.inc.php, so I removed all the declarations and
>> tags, again seems to work fine. Also included a simple .txt file.
>>
>> I did get some strange results in that all of the  were highlighted
>> after the menu, and I had to remove and insert again to correct.
>>
>> So is this the best way, to create a php page, remove all of the html 
>> tags
>> and page declarations and name it filename.inc.php? (I'm using DW CS3)
>
> I'm quite sure I don't understand any of that ... so I'd hazard a guess
> and so "no it's not the best way"
>
>> Also, something I do not understand, I included a small txt file in a 
>> page
>> of a customer and it shows fine, however this file is not on the 
>> server...is
>> this normal?
>>
>
> it's probably pointing to a file on your machine, e.g. 
> file://C:/path/to/file.txt,
> that's something you see quite often with DW/FrontPage/ WYSIWYG-PITA-editor here>.
>
>>
>>
> 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] More PHP Includes

2009-03-10 Thread 9el
On Tue, Mar 10, 2009 at 7:59 PM, Gary  wrote:

> Thanks again for all the help.
>
> I created a simple page of all includes (header, menu, 3 columns).  I mixed
> the file types up. The menu (projectseven PMM) I saved as a library item,
> works fine.  Had an HTML file in there, but I am guessing that having 2
> page
> declarations along with an extra set of  and  tags was playing
> havoc with the code, so I removed them. Same thing when I created a php
> page
> and saved it as filename.inc.php, so I removed all the declarations and
> tags, again seems to work fine. Also included a simple .txt file.
>
> I did get some strange results in that all of the  were highlighted
> after the menu, and I had to remove and insert again to correct.
>
> So is this the best way, to create a php page, remove all of the html tags
> and page declarations and name it filename.inc.php? (I'm using DW CS3)


If you think of the whole layout you know how to place the tags. that is
there cant be  twotags or two  tags etc.
So, it should be maintained well, that tags dont break and the html gets
valid and you do have working and expected output.

>
>
> Also, something I do not understand, I included a small txt file in a page
> of a customer and it shows fine, however this file is not on the
> server...is
> this normal?


As mentioned, for security reasons its not wise to include files without
.php extentions.  you should include like   myincludefile.inc.php  or
sometext.txt.php etc.

As you said you are allowing the txt file from outside the server, it is
another security risk as well.   allow_url_fopen  lets this to open others
file. But lets say the file is at the hand of a bad guy, and  he modifies
that with malicious code to intrude into your server.

Please read  php Security issues to know about them in details.   CSRF, XSS,
ClickJacking, Phishing, Code-injections, SQL injections etc etc etc.
http://shiflett.org/  for  PHP Web  Security issues is a must read.  also
http://phpsec.org

>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


Re: [PHP] More PHP Includes

2009-03-10 Thread Jochem Maas
Gary schreef:
> Thanks again for all the help.
> 
> I created a simple page of all includes (header, menu, 3 columns).  I mixed 
> the file types up. The menu (projectseven PMM) I saved as a library item, 
> works fine.  Had an HTML file in there, but I am guessing that having 2 page 
> declarations along with an extra set of  and  tags was playing 
> havoc with the code, so I removed them. Same thing when I created a php page 
> and saved it as filename.inc.php, so I removed all the declarations and 
> tags, again seems to work fine. Also included a simple .txt file.
> 
> I did get some strange results in that all of the  were highlighted 
> after the menu, and I had to remove and insert again to correct.
> 
> So is this the best way, to create a php page, remove all of the html tags 
> and page declarations and name it filename.inc.php? (I'm using DW CS3)

I'm quite sure I don't understand any of that ... so I'd hazard a guess
and so "no it's not the best way"

> Also, something I do not understand, I included a small txt file in a page 
> of a customer and it shows fine, however this file is not on the server...is 
> this normal? 
> 

it's probably pointing to a file on your machine, e.g. 
file://C:/path/to/file.txt,
that's something you see quite often with DW/FrontPage/.

> 
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] More PHP Includes

2009-03-10 Thread Gary
Thanks again for all the help.

I created a simple page of all includes (header, menu, 3 columns).  I mixed 
the file types up. The menu (projectseven PMM) I saved as a library item, 
works fine.  Had an HTML file in there, but I am guessing that having 2 page 
declarations along with an extra set of  and  tags was playing 
havoc with the code, so I removed them. Same thing when I created a php page 
and saved it as filename.inc.php, so I removed all the declarations and 
tags, again seems to work fine. Also included a simple .txt file.

I did get some strange results in that all of the  were highlighted 
after the menu, and I had to remove and insert again to correct.

So is this the best way, to create a php page, remove all of the html tags 
and page declarations and name it filename.inc.php? (I'm using DW CS3)

Also, something I do not understand, I included a small txt file in a page 
of a customer and it shows fine, however this file is not on the server...is 
this normal? 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php