[PHP] Re: files outside of documentRoot

2011-10-09 Thread Ricardo Martinez
The files are, png, pdf and flv.

Only users login can see or download it.

thx ;>

On Sat, Oct 8, 2011 at 11:16 PM, Shawn McKenzie wrote:

> On 10/08/2011 03:40 PM, Ricardo Martinez wrote:
> > Hi List!
> >
> > I need to access files outside the DocumentRoot.
> >
> > I've been looking for info and documentation, and I've read that it can
> be
> > done using symbolic links and another way is by using headers.
> >
> > I want to know, what do you think, what is the best way, and if anyone
> knows
> > a good doc about of it.
> >
> > Thanks!!!
> >
>
> It depends on what you mean by "files".  Are they PHP files that need to
> be run, or images, or files that need to be downloaded by the user?
>
> For PHP, you would add the external dir to your include path.
>
> For images you can use a php file as the img src and that file sets the
> appropriate headers and uses readfile() to get and echo the image data:
> getimage.php?image=someimage.gif
>
> For download files you would do it in the same manner as for images:
> download.php?file=somefile.zip
>
>
> --
> Thanks!
> -Shawn
> http://www.spidean.com
>



-- 
Ricardo
___
IT Architect
website: http://www.pulsarinara.com


Re: [PHP] Server Side Include translator as PHP functions

2011-10-09 Thread Tedd Sperling
On Oct 8, 2011, at 8:48 PM, Tommy Pham wrote:
On Sat, Oct 8, 2011 at 5:33 PM, Complex  wrote:
> 
>> Thanks for the advice, I'm aware of all that, but I'm looking for a
>> specific PHP solution at the moment. Unless you have advice on how I
>> can update the SSI includes on the larger website *without* having to
>> also update the PHP includes for this smaller website?
>> 
>> I take it that you don't know of such a function; do you have a
>> recommendation for a good function or program repository I could
>> search? The couple that I was looking at (such as
>> http://php.resourceindex.com/) don't look like they've received a
>> whole lot of attention lately, and may not be the best sources.
>> 
> 
> Did you look at my suggestion as work around such as replacing the SSI
> mechanism for a particular path/URL with PHP?  Use of 'Conditional
> expressions' [1] maybe necessary which is beyond the scope of this list.
> 
> "What are SSI?
> 
> SSI (Server Side Includes) are directives that are placed in HTML pages, and
> evaluated on the server while the pages are being served. They let you add
> dynamically generated content to an existing HTML page, without having to
> serve the entire page via a CGI program, or other dynamic technology.
> 
> The decision of when to use SSI, and when to have your page entirely
> generated by some program, is usually a matter of how much of the page is
> static, and how much needs to be recalculated every time the page is served.
> SSI is a great way to add small pieces of information, such as the current
> time. But if a majority of your page is being generated at the time that it
> is served, you need to look for some other solution." [1]
> 
> Last time I checked, SSI, either on httpd or IIS, doesn't have any means to
> do dynamically, including generating headers, as you intended.
> 
> Regards,
> Tommy

My question is:

"Why SSI?"

I used SSI circa 1990's (before PHP) to include common code. However, it 
required me to also have .shtml suffixes on the files that used them. Since 
PHP, it's simple to use PHP include statements to accomplish the same thing.

So, I see no reason to use SSI's at all. What am I not understanding in this 
problem?

Cheers,

tedd


_
t...@sperling.com
http://sperling.com










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



Re: [PHP] Server Side Include translator as PHP functions

2011-10-09 Thread Complex
Tedd,

The crucial detail you're lookign for is my lack of choice or control
in the matter, for all sorts of reasons that are actually quite stupid
but not possible for *me* to change, and not possible for anyone else
to change quickly. Thus I am looking for a solution to the problem at
hand, instead of a suggestion for what the entire org should be doing
instead. I know what they should be doing instead, but that's not my
decision. It's not like I'm building a new website this way; I'm
trying to move forwards with an existing and large website. The more
different code-bases we have for different parts of the site, the
harder it will be to actually change to something else (PHP-based, I
pray).

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



Re: [PHP] Server Side Include translator as PHP functions

2011-10-09 Thread Complex
On Sat, Oct 8, 2011 at 8:48 PM, Tommy Pham  wrote:
> On Sat, Oct 8, 2011 at 5:33 PM, Complex  wrote:
>>
>> Thanks for the advice, I'm aware of all that, but I'm looking for a
>> specific PHP solution at the moment. Unless you have advice on how I
>> can update the SSI includes on the larger website *without* having to
>> also update the PHP includes for this smaller website?
>>
>> I take it that you don't know of such a function; do you have a
>> recommendation for a good function or program repository I could
>> search? The couple that I was looking at (such as
>> http://php.resourceindex.com/) don't look like they've received a
>> whole lot of attention lately, and may not be the best sources.
>
> Did you look at my suggestion as work around such as replacing the SSI
> mechanism for a particular path/URL with PHP?  Use of 'Conditional
> expressions' [1] maybe necessary which is beyond the scope of this list.
>
> "What are SSI?
>
> SSI (Server Side Includes) are directives that are placed in HTML pages, and
> evaluated on the server while the pages are being served. They let you add
> dynamically generated content to an existing HTML page, without having to
> serve the entire page via a CGI program, or other dynamic technology.
>
> The decision of when to use SSI, and when to have your page entirely
> generated by some program, is usually a matter of how much of the page is
> static, and how much needs to be recalculated every time the page is served.
> SSI is a great way to add small pieces of information, such as the current
> time. But if a majority of your page is being generated at the time that it
> is served, you need to look for some other solution." [1]
>
> Last time I checked, SSI, either on httpd or IIS, doesn't have any means to
> do dynamically, including generating headers, as you intended.
>
> Regards,
> Tommy
>
> [1] http://httpd.apache.org/docs/current/howto/ssi.html
>

Tommy,

Yes, thanks, I did see that:
change  
to 


does not work on our servers. (I hesitate to say that it doesn't work
anywhere; I don't have enough experience with that.)
What happened when I tried this is that the page displays the raw PHP
instead of the results of the PHP. The server executes the PHP first,
and then executes the SSI instructions, such that the following *does*
work.

(mind you, I've seen plenty of notes that you should/have to use
virtual() instead)



Regarding SSI not doing anything dynamic: Yes, that's mostly true. The
only dynamism you can get is using if/elsif/else statements while
checkign things like the current URL path, which are ridiculously
clunky.

So the point of this question was to find an *existing and tested*
non-module set of functions that I could employ to translate a
particular include into a set of PHP commands, and then use PHP to add
some dynamic content.

And do you see my main point here, please? I'd use PHP to add some
dynamic content WITHOUT CHANGING THE MAIN CODEBASE that is
unfortunately but definitely stuck in SSI.

I'll probably have to skip that idea, but I'll try to look elsewhere
for such a set of functions. I'd like to write them in the future, but
that's not going to happen within the next couple days. And if anyone
is still scraping their brow at the absolute HORROR  that we are using
SSI instead of the PHP that we should be using, please note that the
whole point of keeping the codebase the same everywhere is to move
everything into a new, modern codebase *real soon*.
-- 
--> CC <---

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



Re: [PHP] Re: files outside of documentRoot

2011-10-09 Thread Sean Greenslade
On Sun, Oct 9, 2011 at 9:52 AM, Ricardo Martinez wrote:

> The files are, png, pdf and flv.
>
> Only users login can see or download it.
>
> thx ;>
>
> On Sat, Oct 8, 2011 at 11:16 PM, Shawn McKenzie  >wrote:
>
> > On 10/08/2011 03:40 PM, Ricardo Martinez wrote:
> > > Hi List!
> > >
> > > I need to access files outside the DocumentRoot.
> > >
> > > I've been looking for info and documentation, and I've read that it can
> > be
> > > done using symbolic links and another way is by using headers.
> > >
> > > I want to know, what do you think, what is the best way, and if anyone
> > knows
> > > a good doc about of it.
> > >
> > > Thanks!!!
> > >
> >
> > It depends on what you mean by "files".  Are they PHP files that need to
> > be run, or images, or files that need to be downloaded by the user?
> >
> > For PHP, you would add the external dir to your include path.
> >
> > For images you can use a php file as the img src and that file sets the
> > appropriate headers and uses readfile() to get and echo the image data:
> > getimage.php?image=someimage.gif
> >
> > For download files you would do it in the same manner as for images:
> > download.php?file=somefile.zip
> >
> >
> > --
> > Thanks!
> > -Shawn
> > http://www.spidean.com
> >
>
> --
> Ricardo
> ___
> IT Architect
> website: http://www.pulsarinara.com
>


Sounds like the downloader php script would be perfect (what Shawn
suggested). Have the script check the login status, then (if valid) send the
proper headers for the file and read out the data with the script.

-- 
--Zootboy

Sent from my PC.


Re: [PHP] Server Side Include translator as PHP functions

2011-10-09 Thread Tedd Sperling
On Oct 9, 2011, at 11:41 AM, Complex wrote:

> Tedd,
> 
> The crucial detail you're lookign for is my lack of choice or control
> in the matter, for all sorts of reasons that are actually quite stupid
> but not possible for *me* to change, and not possible for anyone else
> to change quickly. Thus I am looking for a solution to the problem at
> hand, instead of a suggestion for what the entire org should be doing
> instead. I know what they should be doing instead, but that's not my
> decision. It's not like I'm building a new website this way; I'm
> trying to move forwards with an existing and large website. The more
> different code-bases we have for different parts of the site, the
> harder it will be to actually change to something else (PHP-based, I
> pray).
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

Without debating the question of choice, if I was confronted with a large web 
site that used SSI, I would inform the client of such and put together a bid as 
to my time to bring the site up to date. If not, then I think I would pass on 
working the site. In my experience, it's not worth my additional time to try to 
work around "out of date" technologies.

It is also been my experience that when I am confronted with something large 
scale, and when approved by the client, I simply do a site-wide find and 
replace (namely change "

Re: [PHP] Server Side Include translator as PHP functions

2011-10-09 Thread Tommy Pham
On Sun, Oct 9, 2011 at 8:41 AM, Complex  wrote:

> Tedd,
>
> The crucial detail you're lookign for is my lack of choice or control
> in the matter, for all sorts of reasons that are actually quite stupid
> but not possible for *me* to change, and not possible for anyone else
> to change quickly. Thus I am looking for a solution to the problem at
> hand, instead of a suggestion for what the entire org should be doing
> instead. I know what they should be doing instead, but that's not my
> decision. It's not like I'm building a new website this way; I'm
> trying to move forwards with an existing and large website. The more
> different code-bases we have for different parts of the site, the
> harder it will be to actually change to something else (PHP-based, I
> pray).
>
>
At the time when I was working with ASP and SSI, I suggested my client to
better rewrite the application in OOP language then do patchworks.  But he
_insisted_ on keeping existing code base.  So I did patchworks here and
there.  It got to the point where he finally wanted some additional features
much later that it was impossible to do with ASP and SSI.  It was then that
he finally decided to go with my suggestions, which is months later.  During
that time, I could have easily rewritten the application in PHP.  That's why
I suggested you to consider the site's function and features.  It maybe just
one thing that the client/boss wants now, then another, and another...
etc...  Eventually, you're going to through the same thing I did.

Good luck,
Tommy


[PHP] Re: PHP Download Of Application Question?

2011-10-09 Thread Alex McLain
>I am looking for a way to download a C based application binary, from
> an Apache / PHP server, via a client side Web Browser, and execute it
> seamlessly on the client side PC without storing it permanently on the
> client side
> hard disk drive. Temporary storage would be ok.
>
>I know this can be done because I have observed it operation in various
> applications. This concept allows a authorized customer to have the use of
> an application via the web without being able to keep or share the
> application
> binary.
>
>I am open to other approaches beyond Apache and PHP.
>
>So any ideas out there?
>
> Thanks for the help
> Thomas Dineen


That sounds like the kind of thing Java Web Start does.  There's lots on
Google about it.
http://download.oracle.com/javase/6/docs/technotes/guides/javaws/

-Alex


[PHP] Need help Wth PHP

2011-10-09 Thread Rod Lindgren

I have a hosting account and am trying to get a friend's website up and
running. We downloaded his existing site from his current host and uploaded
it to my host. It is currently under a subdomain, www.egypt.aragren.com
 . When I go there, I get an error message
that says, "Error establishing a database connection." What causes this and
how can I fix it? 


 

Sensei Rod Lindgren

 

Sent from my Gateway computer

 

 



Re: [PHP] Need help Wth PHP

2011-10-09 Thread James Yerge
On 10/09/2011 08:41 PM, Rod Lindgren wrote:
> I have a hosting account and am trying to get a friend's website up and
> running. We downloaded his existing site from his current host and uploaded
> it to my host. It is currently under a subdomain, www.egypt.aragren.com
>  . When I go there, I get an error message
> that says, "Error establishing a database connection." What causes this and
> how can I fix it? 
>
>
>  
>
> Sensei Rod Lindgren
>
>  
>
> Sent from my Gateway computer
>
>  
>
>  
>
>
This issue isn't related to PHP but the cause of the error is due to the
scripts' inability to make a connection to the database. The error looks
like it's coming from WordPress, I could be wrong but if that's the case
then you need to update the wp-config.php file to reflect the proper
credentials to log into the database.

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



RE: [PHP] Need help Wth PHP

2011-10-09 Thread Rod Lindgren
Interesting. The wp-config.php file only contains the following:











Not sure where to go from here. Thanks for the input. Any more input is
appreciated.

Rod

-Original Message-
From: James Yerge [mailto:ja...@nixsecurity.org] 
Sent: Sunday, October 09, 2011 5:46 PM
To: r...@okinawa-te.info
Cc: php-general@lists.php.net
Subject: Re: [PHP] Need help Wth PHP

On 10/09/2011 08:41 PM, Rod Lindgren wrote:
> I have a hosting account and am trying to get a friend's website up and
> running. We downloaded his existing site from his current host and
uploaded
> it to my host. It is currently under a subdomain, www.egypt.aragren.com
>  . When I go there, I get an error message
> that says, "Error establishing a database connection." What causes this
and
> how can I fix it? 
>
>
>  
>
> Sensei Rod Lindgren
>
>  
>
> Sent from my Gateway computer
>
>  
>
>  
>
>
This issue isn't related to PHP but the cause of the error is due to the
scripts' inability to make a connection to the database. The error looks
like it's coming from WordPress, I could be wrong but if that's the case
then you need to update the wp-config.php file to reflect the proper
credentials to log into the database.
-
No virus found in this message.
Checked by AVG - www.avg.com
Version: 10.0.1410 / Virus Database: 1520/3943 - Release Date: 10/07/11
-
No virus found in this message.
Checked by AVG - www.avg.com
Version: 10.0.1410 / Virus Database: 1520/3943 - Release Date: 10/07/11
-
No virus found in this message.
Checked by AVG - www.avg.com
Version: 10.0.1410 / Virus Database: 1520/3943 - Release Date: 10/07/11


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



Re: [PHP] Need help Wth PHP

2011-10-09 Thread Lester Caine

Rod Lindgren wrote:

Thanks for the link. I am now wondering if Wordpress is available on my
server.
If it's not, you can add it yourself in much the same way you uploaded the 
'profile' for the wordpress site ... http://wordpress.org/download/
Essentially it is just another PHP application, but you do need the database 
that goes with the original site.


--
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php

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