 |
|
 |
|
Next: More php trouble *pulling hair out*
|
| Author |
Message |
External

Since: Feb 16, 2008 Posts: 11
|
(Msg. 1) Posted: Sat Feb 16, 2008 2:30 am
Post subject: want to get content of one php file in another php file Archived from groups: comp>lang>php (more info?)
|
|
|
i have one php file having content
Contents of ex1.php file
<body>
<?php
$content = "c://webserver/www/abc.php";
$handle = fopen($content, "r");
echo fread($handle,filesize($content));
?>
</body>
this is reading abc.php file in which i m simply using an echo
statement. When i execute ex1.php file i cant see the php statement of
abc.php file
content of abc.php file is
<?php echo "hello";?> >> Stay informed about: want to get content of one php file in another php file |
|
| Back to top |
|
 |  |
External

Since: Jan 06, 2008 Posts: 14
|
(Msg. 2) Posted: Sat Feb 16, 2008 7:03 pm
Post subject: Re: want to get content of one php file in another php file [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
sarika wrote:
> i have one php file having content
>
> Contents of ex1.php file
> <body>
> <?php
> $content = "c://webserver/www/abc.php";
> $handle = fopen($content, "r");
> echo fread($handle,filesize($content));
> ?>
> </body>
> this is reading abc.php file in which i m simply using an echo
> statement. When i execute ex1.php file i cant see the php statement of
> abc.php file
>
> content of abc.php file is
> <?php echo "hello";?>
That's interesting, I've found out that it's the browser that's hiding <?php
?> tags within .phpx pages. Probably to avoid short tags scripts (on a
server that doesn't allow them) from getting leaked by visitors who don't
know about this browser trick, until the dev' realizes his error.
Not a good thing, IMO; dev's should take care, themselves, and it's still
not secure since the hidden string is still in the rendered source. And now
we don't know how to escape this one. Do we?
-thibī >> Stay informed about: want to get content of one php file in another php file |
|
| Back to top |
|
 |  |
External

Since: Aug 11, 2004 Posts: 1367
|
(Msg. 3) Posted: Sat Feb 16, 2008 7:03 pm
Post subject: Re: want to get content of one php file in another php file [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
thibī wrote:
> sarika wrote:
>> i have one php file having content
>>
>> Contents of ex1.php file
>> <body>
>> <?php
>> $content = "c://webserver/www/abc.php";
>> $handle = fopen($content, "r");
>> echo fread($handle,filesize($content));
>> ?>
>> </body>
>> this is reading abc.php file in which i m simply using an echo
>> statement. When i execute ex1.php file i cant see the php statement of
>> abc.php file
>>
>> content of abc.php file is
>> <?php echo "hello";?>
>
> That's interesting, I've found out that it's the browser that's hiding
> <?php ?> tags within .phpx pages. Probably to avoid short tags scripts
> (on a server that doesn't allow them) from getting leaked by visitors
> who don't know about this browser trick, until the dev' realizes his error.
>
> Not a good thing, IMO; dev's should take care, themselves, and it's
> still not secure since the hidden string is still in the rendered
> source. And now we don't know how to escape this one. Do we?
>
> -thibī
>
This is normal operation. The interpreter does not parse files read
with fread(). If you just want to include them in the script, include
or require them.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex.TakeThisOut@attglobal.net
================== >> Stay informed about: want to get content of one php file in another php file |
|
| Back to top |
|
 |  |
External

Since: Jan 06, 2008 Posts: 14
|
(Msg. 4) Posted: Sat Feb 16, 2008 10:41 pm
Post subject: Re: want to get content of one php file in another php file [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
Jerry Stuckle wrote:
> thibī wrote:
>> sarika wrote:
>>> i have one php file having content
>>>
>>> Contents of ex1.php file
>>> <body>
>>> <?php
>>> $content = "c://webserver/www/abc.php";
>>> $handle = fopen($content, "r");
>>> echo fread($handle,filesize($content));
>>> ?>
>>> </body>
>>> this is reading abc.php file in which i m simply using an echo
>>> statement. When i execute ex1.php file i cant see the php statement of
>>> abc.php file
>>>
>>> content of abc.php file is
>>> <?php echo "hello";?>
>>
>> That's interesting, I've found out that it's the browser that's hiding
>> <?php ?> tags within .phpx pages. Probably to avoid short tags scripts
>> (on a server that doesn't allow them) from getting leaked by visitors
>> who don't know about this browser trick, until the dev' realizes his
>> error.
>>
>> Not a good thing, IMO; dev's should take care, themselves, and it's
>> still not secure since the hidden string is still in the rendered
>> source. And now we don't know how to escape this one. Do we?
>>
>> -thibī
>>
>
> This is normal operation. The interpreter does not parse files read
> with fread(). If you just want to include them in the script, include
> or require them.
>
I think the purpose here is to actually output the source.
Well, we've got highlight_[file/string](), but maybe akira wants 'more'.
-thibī >> Stay informed about: want to get content of one php file in another php file |
|
| Back to top |
|
 |  |
External

Since: Aug 11, 2004 Posts: 1367
|
(Msg. 5) Posted: Sat Feb 16, 2008 10:41 pm
Post subject: Re: want to get content of one php file in another php file [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
thibī wrote:
> Jerry Stuckle wrote:
>> thibī wrote:
>>> sarika wrote:
>>>> i have one php file having content
>>>>
>>>> Contents of ex1.php file
>>>> <body>
>>>> <?php
>>>> $content = "c://webserver/www/abc.php";
>>>> $handle = fopen($content, "r");
>>>> echo fread($handle,filesize($content));
>>>> ?>
>>>> </body>
>>>> this is reading abc.php file in which i m simply using an echo
>>>> statement. When i execute ex1.php file i cant see the php statement of
>>>> abc.php file
>>>>
>>>> content of abc.php file is
>>>> <?php echo "hello";?>
>>>
>>> That's interesting, I've found out that it's the browser that's
>>> hiding <?php ?> tags within .phpx pages. Probably to avoid short tags
>>> scripts (on a server that doesn't allow them) from getting leaked by
>>> visitors who don't know about this browser trick, until the dev'
>>> realizes his error.
>>>
>>> Not a good thing, IMO; dev's should take care, themselves, and it's
>>> still not secure since the hidden string is still in the rendered
>>> source. And now we don't know how to escape this one. Do we?
>>>
>>> -thibī
>>>
>>
>> This is normal operation. The interpreter does not parse files read
>> with fread(). If you just want to include them in the script, include
>> or require them.
>>
>
> I think the purpose here is to actually output the source.
> Well, we've got highlight_[file/string](), but maybe akira wants 'more'.
>
> -thibī
>
OK, then you need to use html_entities() to convert the html special
characters.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex.TakeThisOut@attglobal.net
================== >> Stay informed about: want to get content of one php file in another php file |
|
| Back to top |
|
 |  |
External

Since: Jan 06, 2008 Posts: 14
|
(Msg. 6) Posted: Sat Feb 16, 2008 10:56 pm
Post subject: Re: want to get content of one php file in another php file [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
Jerry Stuckle wrote:
> thibī wrote:
>> Jerry Stuckle wrote:
>>> thibī wrote:
>>>> sarika wrote:
>>>>> i have one php file having content
>>>>>
>>>>> Contents of ex1.php file
>>>>> <body>
>>>>> <?php
>>>>> $content = "c://webserver/www/abc.php";
>>>>> $handle = fopen($content, "r");
>>>>> echo fread($handle,filesize($content));
>>>>> ?>
>>>>> </body>
>>>>> this is reading abc.php file in which i m simply using an echo
>>>>> statement. When i execute ex1.php file i cant see the php statement of
>>>>> abc.php file
>>>>>
>>>>> content of abc.php file is
>>>>> <?php echo "hello";?>
>>>>
>>>> That's interesting, I've found out that it's the browser that's
>>>> hiding <?php ?> tags within .phpx pages. Probably to avoid short
>>>> tags scripts (on a server that doesn't allow them) from getting
>>>> leaked by visitors who don't know about this browser trick, until
>>>> the dev' realizes his error.
>>>>
>>>> Not a good thing, IMO; dev's should take care, themselves, and it's
>>>> still not secure since the hidden string is still in the rendered
>>>> source. And now we don't know how to escape this one. Do we?
>>>>
>>>> -thibī
>>>>
>>>
>>> This is normal operation. The interpreter does not parse files read
>>> with fread(). If you just want to include them in the script,
>>> include or require them.
>>>
>>
>> I think the purpose here is to actually output the source.
>> Well, we've got highlight_[file/string](), but maybe akira wants 'more'.
>>
>> -thibī
>>
>
> OK, then you need to use html_entities() to convert the html special
> characters.
>
Ha, yep !
That was obvious..
Thanks. >> Stay informed about: want to get content of one php file in another php file |
|
| Back to top |
|
 |  |
| Related Topics: | add content to word or pdf file using php - Hello everybody! I would like to have some code in php, which would add some content (e.g. one line) in a ms word or a pdf file (whichever is easiest) that is already stored in the website. To be more specific: I am trying to develop a form that the..
Parsing SVG file for PHP content - Apache - Hi all, I have some SVG scripts I made a couple of years ago, which contain some PHP code to pull data from a SQL Server DB. These scripts ran OK when they were in an IIS environment (where it's easy to assign a script-type to a particular process or..
how do you open a file with quote marks in the file name o.. -
getting the name of the PHP file - Hi! I am a PHP beginner, and I don't know my way around. Let's say I have a file named as "file.php". Is there a special variable that already includes the file name, or should I just manually code it into the script; i.e. $filename = "...
File selection? - I'm running some php scripts locally (Windoze XP) to operate on local files and, at least partly because I can't seem to access the parameters via argv[] or get it to print out in my DOS box, it seems sensible to run it via a web page (I'm running.. |
|
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|
 |
|
|