php-general Digest 31 Jul 2010 13:21:18 -0000 Issue 6873
Topics (messages 307263 through 307266):
Re: [site is acting strange] - blank pages, download index.php, or works fine
307263 by: David Hutto
Re: Trapping for PDF Type and file size in a UPLOAD form...
307264 by: Hans Ã
hlin
Text editor for Ubuntu with FTP
307265 by: Jordan Jovanov
Re: How to upload via SFTP with allow_url_open disabled?
307266 by: Thomas Anderson
Administrivia:
To subscribe to the digest, e-mail:
[email protected]
To unsubscribe from the digest, e-mail:
[email protected]
To post to the list, e-mail:
[email protected]
----------------------------------------------------------------------
--- Begin Message ---
On Fri, Jul 30, 2010 at 8:50 PM, David Hutto <[email protected]> wrote:
> On Fri, Jul 30, 2010 at 8:49 PM, David Hutto <[email protected]> wrote:
>> On Fri, Jul 30, 2010 at 2:50 PM, Ashley Sheridan
>> <[email protected]> wrote:
>>> On Fri, 2010-07-30 at 13:38 -0400, Adam Richardson wrote:
>>>
>>>> On Fri, Jul 30, 2010 at 11:35 AM, Bill Guion <[email protected]> wrote:
>>>>
>>>> > At 6:45 PM -0600 7/29/10, Tristan wrote:
>>>> >
>>>> > Yeah like i said site works 95% of the time when navigating. PHP5.2,
>>>> > Mysql
>>>> >> 5. The site is completely dynamic so it wouldn't work at all if that was
>>>> >> the
>>>> >> case of it not being installed right.
>>>> >>
>>>> >> so the other 5% of the time is blank pages and download index.php files.
>>>> >> In
>>>> >> Firefox when you get a blank page, if you click view source it will show
>>>> >> all
>>>> >> the code that should be there but, I can't tell if it's requesting the
>>>> >> page
>>>> >> again when you do that. It never fails 2 times in a row. A refresh will
>>>> >> always fix it. When you look in firebug there is no html so it leads me
>>>> >> to
>>>> >> believe FF may be doing just that...going for a second request instead
>>>> >> of
>>>> >> viewing currently opened source? In IE8 I would get something like
>>>> >>
>>>> >> diagnose problem button
>>>> >>
>>>> >> more information drop down with
>>>> >>
>>>> >> this problem can be caused by a variety of issues..this is a completely
>>>> >> typical M$ error with no valid help
>>>> >>
>>>> >>
>>>> >>
>>>> >> chrome same thing with
>>>> >>
>>>> >> web page cannot be displayed
>>>> >>
>>>> >> more information etc...
>>>> >>
>>>> >>
>>>> >>
>>>> >>
>>>> >>
>>>> >> On Thu, Jul 29, 2010 at 6:36 PM, David McGlone <[email protected]>
>>>> >> wrote:
>>>> >>
>>>> >> On Thu, 2010-07-29 at 18:11 -0600, Tristan wrote:
>>>> >>> > I have the strangest issue with my host. They can't figure it out
>>>> >>> and
>>>> >>> I'm
>>>> >>> > completely perplexed. We have other sites running on the server just
>>>> >>> fine.
>>>> >>> > However, this new site is acting very weird. Sometimes we get blank
>>>> >>> pages,
>>>> >>> > sometimes we get a blank page and then a dialog pops up asking if we
>>>> >>> want
>>>> >>> to
>>>> >>> > download index.php, and then sometimes the site is working fine. Any
>>>> >>> ideas
>>>> >>> > on this?
>>>> >>> >
>>>> >>> > I'm at ends. Appreciate any advice. For authentication we are using
>>>> >>> mysql
>>>> >>> > auth module in apache/linux and proxy pass. We removed proxy pass to
>>>> >>> see
>>>> >>> if
>>>> >>> > that was it but, it wasn't. its a members.domain.com subdomain if
>>>> >>> that
>>>> >>> > helps.
>>>> >>>
>>>> >>> Do you have php-mysql installed?
>>>> >>>
>>>> >>>
>>>> >>> --
>>>> >>> Blessings,
>>>> >>> David M.
>>>> >>>
>>>> >>>
>>>> >>>
>>>> > Does the page validate at http://jigsaw.w3.org/css-validator/?
>>>> >
>>>> > -----===== Bill =====-----
>>>> > --
>>>> >
>>>> > Don't find fault. Find a remedy. - Henry Ford
>>>> >
>>>> >
>>>> >
>>>> > --
>>>> > PHP General Mailing List (http://www.php.net/)
>>>> > To unsubscribe, visit: http://www.php.net/unsub.php
>>>> >
>>>> >
>>>> Tristan,
>>>>
>>>> The good news is that you're not crazy. I've had this exact issue (at
>>>> least
>>>> in terms of symptoms) when working with one of my client's websites.
>>>>
>>>> The bad news is that this was long ago, I was using a shared host, and I'm
>>>> not the one who cause or, more importantly, fixed the problem. That said,
>>>> I've strained my memory to try and recall what might have been said in the
>>>> follow-up from the host, and it seems like there was a mime-type handling
>>>> issue (again, I could be completely wrong, this is just a faint memory.)
>>>>
>>>> Another faint memory: are you able to see a difference in behavior when you
>>>> view an index file with the file included in the url (
>>>> http://yoursite.com/index.php) as opposed to when you view the page without
>>>> it in the url (http://yoursite.com)?
>>>>
>>>> Sorry, I wish I still had my email exchange with the company to see what
>>>> information they provided after the fix :(
>>>>
>>>> Adam
>>>>
>>>
>>> Actually, you just saying that made me think of a similar problem I had
>>> once with IIS serving up files. It was XML files rather than PHP, but
>>> the Mime issue does ring a bell!
>>>
>>> Is the server you're using IIS Tristan?
>>>
>>> Thanks,
>>> Ash
>>> http://www.ashleysheridan.co.uk
>>>
>>>
>>>
>
>>Forgot to hit reply all:
I'm not sure if this helps, or even relates, but the one time I had a
hosting account for a microsoft app named NopCommerce, when I would
try to visit the page, it seemed to only allow one connection at a
time, because of some MS DB user limitation or something, and I didn't
attempt anymore with it.
Might relate, might not.
>>
>
--- End Message ---
--- Begin Message ---
**********************************************
Hans Åhlin
Tel: +46761488019
icq: 275232967
http://www.kronan-net.com/
irc://irc.freenode.net:6667 - TheCoin
**********************************************
2010/7/30 Pete Ford <[email protected]>
> On 29/07/10 19:10, tedd wrote:
>
>> At 9:50 AM -0700 7/29/10, Don Wieland wrote:
>>
>>> I am trying to create an UPLOAD form and need to figure a way to only
>>> allow PDF files to be selected.
>>>
>>
>> The short answer is you can't -- not from php. You can create a standard
>> form and upload it from there, but you don't have control over file type.
>>
>> So you can't stop people from uploading anything to your site via the
>> form, but you can look at the document once it's there and inspect it.
>> Using a HEX Editor, I see that most pdf file have the first four bytes
>> as "%PDF" so you might check that before moving the file to somewhere
>> important. But that doesn't stop spoofing.
>>
>>
The pdf files also ends with "startxref [some numbers] %%EOF"
> Other than that, I can't see any way to do it.
>>
>> Cheers,
>>
>> tedd
>>
>
> Second what tedd says, with a bit more: on a Linux backend system I run
> uploaded files through the 'file' command with a decent magic file to detect
> the file type. I also run every upload through a virus scanner (clamscan,
> for example) before I accept it.
> If your PHP backend is windows then you might need to do some research to
> find a good file-type detection routine, although the virus scanning should
> be possible.
>
> You certainly cannot trust the client side to do any checking. In any case,
> JavaScript doesn't (shouldn't) have access to the file you are trying to
> upload, so there's not much you can do there. You might achieve something
> client-side with Flash, or a Java uploader applet, I suppose.
>
> Cheers
> Pete
>
> --
> Peter Ford, Developer phone: 01580 893333 fax: 01580 893399
> Justcroft International Ltd.
> www.justcroft.com
> Justcroft House, High Street, Staplehurst, Kent TN12 0AH United Kingdom
> Registered in England and Wales: 2297906
> Registered office: Stag Gates House, 63/64 The Avenue, Southampton SO17 1XS
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
Hello to All,
I only whant to star discussion for who is the best programm to write
php and html script. I use dreamweaver, but now I change my OS to ubuntu
and I want some suggestions for some Text editor for FTP for Ubuntu
Thanks A lot
Jordan Jovanov
--- End Message ---
--- Begin Message ---
You might have better luck with phpseclib's Net_SFTP, which uses fsockopen:
http://phpseclib.sourceforge.net/documentation/net.html#net_sftp_example
Good luck!
On Thu, Jul 29, 2010 at 12:13 PM, Scott Teresi <[email protected]> wrote:
> I'm attempting to send a file over SFTP in PHP, but all the examples I find
> online do something like this:
>
> $stream = @fopen("ssh2.sftp://xxxxxxxxxxxxxxxxxx", 'w');
> @fwrite($stream, $data_to_send)
>
> This requires "allow_url_fopen" to be enabled on the server, to get a stream
> for the remote file.
>
> I maintain the server but would like to keep "allow_url_fopen" disabled. If
> I do that, how can I send a file over SFTP?
>
> Thanks for any help people can provide!!
>
> Scott Teresi
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---