php-general Digest 14 Aug 2010 20:36:13 -0000 Issue 6893

Topics (messages 307461 through 307472):

Re: PHP Reference
        307461 by: Peter Lind
        307462 by: Karl DeSaulniers
        307463 by: Andre Polykanine
        307464 by: Karl DeSaulniers
        307465 by: Ashley Sheridan
        307466 by: Karl DeSaulniers
        307467 by: tedd

Re: It's Friday (a MySQL Question)
        307468 by: tedd
        307469 by: chris h

PHP upload hangs on Safari
        307470 by: Don Wieland
        307471 by: Ashley Sheridan

Need to check pdf for xss
        307472 by: Sebastian Ewert

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-gene...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
On 14 August 2010 08:08, Karl DeSaulniers <k...@designdrumm.com> wrote:
> Hello all,
> I was wondering, can you reference php in a url string like you can
> javascript.
> EG:
> "javascript:someFunction()"
>
> Can you do something similar in php like
>
> "php:someFunction()"
>
> I am thinking that you can not do this, but was wondering if there was
> something like that.
> Thanks,

No, you can't.

Regards
Peter

-- 
<hype>
WWW: http://plphp.dk / http://plind.dk
LinkedIn: http://www.linkedin.com/in/plind
BeWelcome/Couchsurfing: Fake51
Twitter: http://twitter.com/kafe15
</hype>

--- End Message ---
--- Begin Message ---
That is what I thought.
Thank you for confirming.

Karl


On Aug 14, 2010, at 1:54 AM, Peter Lind wrote:

On 14 August 2010 08:08, Karl DeSaulniers <k...@designdrumm.com> wrote:
Hello all,
I was wondering, can you reference php in a url string like you can
javascript.
EG:
"javascript:someFunction()"

Can you do something similar in php like

"php:someFunction()"

I am thinking that you can not do this, but was wondering if there was
something like that.
Thanks,

No, you can't.

Regards
Peter

--
<hype>
WWW: http://plphp.dk / http://plind.dk
LinkedIn: http://www.linkedin.com/in/plind
BeWelcome/Couchsurfing: Fake51
Twitter: http://twitter.com/kafe15
</hype>

Karl DeSaulniers
Design Drumm
http://designdrumm.com


--- End Message ---
--- Begin Message ---
Hello Karl,

If I understood you properly, try this:
<?SomeFunction();?>
-- 
With best regards from Ukraine,
Andre
Skype: Francophile
Twitter: http://twitter.com/m_elensule
Facebook: http://facebook.com/menelion

----- Original message -----
From: Karl DeSaulniers <k...@designdrumm.com>
To: php-general <php-gene...@lists.php.net>
Date: Saturday, August 14, 2010, 9:08:20 AM
Subject: [PHP] PHP Reference

Hello all,
I was wondering, can you reference php in a url string like you can  
javascript.
EG:
"javascript:someFunction()"

Can you do something similar in php like

"php:someFunction()"

I am thinking that you can not do this, but was wondering if there  
was something like that.
Thanks,


Karl DeSaulniers
Design Drumm
http://designdrumm.com



--- End Message ---
--- Begin Message ---
Thank you Andre.
Yes, I had been doing it that way, but was just wondering if PHP had a reference like that of javascript with the colin : in it.

Best,

Karl


On Aug 14, 2010, at 3:50 AM, Andre Polykanine wrote:

Hello Karl,

If I understood you properly, try this:
<?SomeFunction();?>
--
With best regards from Ukraine,
Andre
Skype: Francophile
Twitter: http://twitter.com/m_elensule
Facebook: http://facebook.com/menelion

----- Original message -----
From: Karl DeSaulniers <k...@designdrumm.com>
To: php-general <php-gene...@lists.php.net>
Date: Saturday, August 14, 2010, 9:08:20 AM
Subject: [PHP] PHP Reference

Hello all,
I was wondering, can you reference php in a url string like you can
javascript.
EG:
"javascript:someFunction()"

Can you do something similar in php like

"php:someFunction()"

I am thinking that you can not do this, but was wondering if there
was something like that.
Thanks,


Karl DeSaulniers
Design Drumm
http://designdrumm.com



Karl DeSaulniers
Design Drumm
http://designdrumm.com


--- End Message ---
--- Begin Message ---
On Sat, 2010-08-14 at 01:57 -0500, Karl DeSaulniers wrote:

> That is what I thought.
> Thank you for confirming.
> 
> Karl
> 
> 
> On Aug 14, 2010, at 1:54 AM, Peter Lind wrote:
> 
> > On 14 August 2010 08:08, Karl DeSaulniers <k...@designdrumm.com>  
> > wrote:
> >> Hello all,
> >> I was wondering, can you reference php in a url string like you can
> >> javascript.
> >> EG:
> >> "javascript:someFunction()"
> >>
> >> Can you do something similar in php like
> >>
> >> "php:someFunction()"
> >>
> >> I am thinking that you can not do this, but was wondering if there  
> >> was
> >> something like that.
> >> Thanks,
> >
> > No, you can't.
> >
> > Regards
> > Peter
> >
> > -- 
> > <hype>
> > WWW: http://plphp.dk / http://plind.dk
> > LinkedIn: http://www.linkedin.com/in/plind
> > BeWelcome/Couchsurfing: Fake51
> > Twitter: http://twitter.com/kafe15
> > </hype>
> 
> Karl DeSaulniers
> Design Drumm
> http://designdrumm.com
> 
> 


The reason you can't is because PHP is on the server and Javascript is
local (e.g. the browser).

Even if the PHP code you're executing is through localhost, because PHP
needs the server to run, it has to be run on the server, and exposing
functions directly like this would expose all sorts of security issues
(imagine calling up a getUserDetails() on a website you're not logged
into for example, which would mean every function of a system would need
some sort of user auth check and would slow the whole thing to a crawl)

Thanks,
Ash
http://www.ashleysheridan.co.uk



--- End Message ---
--- Begin Message ---

On Aug 14, 2010, at 5:19 AM, Ashley Sheridan wrote:

On Sat, 2010-08-14 at 01:57 -0500, Karl DeSaulniers wrote:

That is what I thought.
Thank you for confirming.

Karl


On Aug 14, 2010, at 1:54 AM, Peter Lind wrote:

> On 14 August 2010 08:08, Karl DeSaulniers <k...@designdrumm.com>
> wrote:
>> Hello all,
>> I was wondering, can you reference php in a url string like you can
>> javascript.
>> EG:
>> "javascript:someFunction()"
>>
>> Can you do something similar in php like
>>
>> "php:someFunction()"
>>
>> I am thinking that you can not do this, but was wondering if there
>> was
>> something like that.
>> Thanks,
>
> No, you can't.
>
> Regards
> Peter
>
> --
> <hype>
> WWW: http://plphp.dk / http://plind.dk
> LinkedIn: http://www.linkedin.com/in/plind
> BeWelcome/Couchsurfing: Fake51
> Twitter: http://twitter.com/kafe15
> </hype>

Karl DeSaulniers
Design Drumm
http://designdrumm.com



The reason you can't is because PHP is on the server and Javascript is local (e.g. the browser).

Even if the PHP code you're executing is through localhost, because PHP needs the server to run, it has to be run on the server, and exposing functions directly like this would expose all sorts of security issues (imagine calling up a getUserDetails() on a website you're not logged into for example, which would mean every function of a system would need some sort of user auth check and would slow the whole thing to a crawl)

Thanks,
Ash
http://www.ashleysheridan.co.uk




I see. Very good point. Thanks Ash.
I figured it was because of the whole pre-processing part of PHP.
Thanks for the explination.
Best,

Karl DeSaulniers
Design Drumm
http://designdrumm.com


--- End Message ---
--- Begin Message ---
At 1:08 AM -0500 8/14/10, Karl DeSaulniers wrote:
Hello all,
I was wondering, can you reference php in a url string like you can javascript.
EG:
"javascript:someFunction()"

Can you do something similar in php like

"php:someFunction()"

I am thinking that you can not do this, but was wondering if there was something like that.
Thanks,

Karl:

As others have answered, no php doesn't work that way.

However, you can still send/receive strings through a url via a $_GET) and direct the actions of a receiving php script and you can do the same thing via a $_POST.

As such, a "php:someFunction()" could be a:

url?php=someFunction

Where the receiving script takes the command and runs someFunction().

However, I would shorten it a bit and say

url?php=18

Where php would be the command to run a function and 18 would be the function you want to run.

So, while you can't use the same syntax as javascript, you can get the same performance.

Cheers,

tedd


--
-------
http://sperling.com/

--- End Message ---
--- Begin Message ---
At 6:53 PM -0400 8/13/10, chris h wrote:
Tedd I don't know if this will resolve your issue or not, but have you looked into using mysqldump?

<http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html>http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html

That's what I use for my backups.


Chris.

Chris:

I would like to do that, but I simply don't know how.

I think the reason for that is that I usually work on shared hosted accounts and the hosts don't permit command line stuff -- so I think, but I could be wrong. Plus, I stopped doing command line stuff back in the Apple ][ days.

Granted this is another hole in my knowledge, but I think that even if I knew how, I don't think it would solve my current problem. Am I wrong?

Cheers,

tedd

--
-------
http://sperling.com/

--- End Message ---
--- Begin Message ---
Well you certainly can not use this without the command line, however some
hosts restrict you from the command line but still allow you to run commands
via php's exec() function (Rackspace Sites is an example of this).

pseudo code example:
exec('mysqldump [options] --all-databases ... ');

Of course this is only if your hoster supports it, and if the user has
proper mysql privileges (which I think are SELECT, LOCK TABLES, and SHOW
VIEW).

mysqldump is a great program with many options so you can dump your db just
the way you want it ;)  If it's something you can and choose to use I would
suggest reading over the link I sent you so you can customize it's output.


Chris.

On Sat, Aug 14, 2010 at 8:51 AM, tedd <t...@sperling.com> wrote:

> At 6:53 PM -0400 8/13/10, chris h wrote:
>
>> Tedd I don't know if this will resolve your issue or not, but have you
>> looked into using mysqldump?
>>
>> <http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html>
>> http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html
>>
>>
>> That's what I use for my backups.
>>
>>
>> Chris.
>>
>
> Chris:
>
> I would like to do that, but I simply don't know how.
>
> I think the reason for that is that I usually work on shared hosted
> accounts and the hosts don't permit command line stuff -- so I think, but I
> could be wrong. Plus, I stopped doing command line stuff back in the Apple
> ][ days.
>
> Granted this is another hole in my knowledge, but I think that even if I
> knew how, I don't think it would solve my current problem. Am I wrong?
>
>
> Cheers,
>
> tedd
>
> --
> -------
> http://sperling.com/
>

--- End Message ---
--- Begin Message ---
Hi,

I have a page that has 9 form actions which upload individual files one at a time. On my own server, it runs fine and there are no hangs. But when I install on my clients server. I creased their "upload_max_filesize" to 100MB.

Still I get random hanging.

Is there any thing else that I should be looking at to remedy this hanging?

Don Wieland
D W   D a t a   C o n c e p t s
~~~~~~~~~~~~~~~~~~~~~~~~~
d...@dwdataconcepts.com
Direct Line - (949) 305-2771

Integrated data solutions to fit your business needs.

Need assistance in dialing in your FileMaker solution? Check out our Developer Support Plan at:
http://www.dwdataconcepts.com/DevSup.html

Appointment 1.0v9 - Powerful Appointment Scheduling for FileMaker Pro 9 or higher
http://www.appointment10.com

For a quick overview -
http://www.appointment10.com/Appt10_Promo/Overview.html


--- End Message ---
--- Begin Message ---
On Sat, 2010-08-14 at 08:08 -0700, Don Wieland wrote:

> Hi,
> 
> I have a page that has 9 form actions which upload individual files  
> one at a time. On my own server, it runs fine and there are no hangs.  
> But when I install on my clients server. I creased their  
> "upload_max_filesize" to 100MB.
> 
> Still I get random hanging.
> 
> Is there any thing else that I should be looking at to remedy this  
> hanging?
> 
> Don Wieland
> D W   D a t a   C o n c e p t s
> ~~~~~~~~~~~~~~~~~~~~~~~~~
> d...@dwdataconcepts.com
> Direct Line - (949) 305-2771
> 
> Integrated data solutions to fit your business needs.
> 
> Need assistance in dialing in your FileMaker solution? Check out our  
> Developer Support Plan at:
> http://www.dwdataconcepts.com/DevSup.html
> 
> Appointment 1.0v9 - Powerful Appointment Scheduling for FileMaker Pro  
> 9 or higher
> http://www.appointment10.com
> 
> For a quick overview -
> http://www.appointment10.com/Appt10_Promo/Overview.html
> 


So, is it one form with 9 <input type="file"/> elements, or 9 forms, as
I was a little unsure from your email.

Are you sure it's hanging? Have you given enough time for the files to
transfer over the Internet? Is it only Safari that it appears to hang
with? Try using Firefox with Firebug installed to see what client-server
communication is actually going on, as that might show you where any
problem is.

Thanks,
Ash
http://www.ashleysheridan.co.uk



--- End Message ---
--- Begin Message ---
Hi,

before I allow to upload images I read them and check for several html
tags. If they exist I don't allow the upload. Is their any need to check
pdf files, too? At the time I'm doing this, but the result is that many
files are denied because of unallowed html tags.

--- End Message ---

Reply via email to