php-general Digest 3 Dec 2009 08:26:43 -0000 Issue 6470

Topics (messages 300211 through 300235):

Re: Best way to read first 20 characters of a string?
        300211 by: João Cândido de Souza Neto
        300212 by: Daniel Brown
        300213 by: Majk.Skoric.eventim.de
        300214 by: Devendra Jadhav
        300215 by: Chris Payne

Re: Disabling button onclick in IE
        300216 by: Skip Evans
        300217 by: Skip Evans
        300218 by: Ashley Sheridan
        300219 by: Skip Evans
        300232 by: tedd

Powerpoint from PHP?
        300220 by: Skip Evans
        300221 by: Ashley Sheridan
        300222 by: Skip Evans
        300223 by: Ryan Sun
        300224 by: Ashley Sheridan
        300225 by: Skip Evans
        300226 by: Ashley Sheridan
        300228 by: Shawn McKenzie
        300233 by: Skip Evans

Re: Can I get the IP address from a visitor?
        300227 by: tedd

Re: Emergency! Performance downloading big files
        300229 by: דניאל דנון

Re: Compatiabilty issues
        300230 by: Shawn McKenzie

remove namespace from xml
        300231 by: Augusto Flavio

imagettftext() and East Asian Font rendering
        300234 by: shiplu

Finding out the first possible booking date with php
        300235 by: Merlin Morgenstern

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 ---
Have you tried tha substr PHP function?


"Chris Payne" <[email protected]> escreveu na mensagem 
news:[email protected]...
> Hi everyone,
>
> I'm pulling data from a mysql database, but need only the first 20
> characters of each string for a short description, what is the best
> method to just grab the first 20 characters from a string regardless
> of whether they are letters or numbers?
>
> Chris 



--- End Message ---
--- Begin Message ---
On Wed, Dec 2, 2009 at 10:11, Chris Payne <[email protected]> wrote:
> Hi everyone,
>
> I'm pulling data from a mysql database, but need only the first 20
> characters of each string for a short description, what is the best
> method to just grab the first 20 characters from a string regardless
> of whether they are letters or numbers?

<?php
$chars = substr($yourInput,0,20);
?>

-- 
</Daniel P. Brown>
[email protected] || [email protected]
http://www.parasane.net/ || http://www.pilotpig.net/
Looking for hosting or dedicated servers?  Ask me how we can fit your budget!

--- End Message ---
--- Begin Message ---
Not exaclty a php thingie but well ;)

Sql: Select left(column, 20) as c 
from table.

Or you can do it with “select substr(columnname, 0,20)“. See the mysql manual. 
Dunno which of the two is faster, but i think “left“ is.

Majk

----- Original Message -----
From: [email protected] <[email protected]>
To: [email protected] <[email protected]>
Sent: Wed Dec 02 16:11:55 2009
Subject: [PHP] Best way to read first 20 characters of a string?

Hi everyone,

I'm pulling data from a mysql database, but need only the first 20
characters of each string for a short description, what is the best
method to just grab the first 20 characters from a string regardless
of whether they are letters or numbers?

Chris

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


--- End Message ---
--- Begin Message ---
mysql substr function
http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_substr

On Wed, Dec 2, 2009 at 8:41 PM, Chris Payne <[email protected]>wrote:

> Hi everyone,
>
> I'm pulling data from a mysql database, but need only the first 20
> characters of each string for a short description, what is the best
> method to just grab the first 20 characters from a string regardless
> of whether they are letters or numbers?
>
> Chris
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Devendra Jadhav
देवेंद्र जाधव

--- End Message ---
--- Begin Message ---
Thank you everyone, I REALLY appreciate it.  Sorry my head isn't in
place today and I couldn't think.

Chris

On Wed, Dec 2, 2009 at 10:18 AM, Devendra Jadhav <[email protected]> wrote:
> mysql substr function
> http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_substr
>
> On Wed, Dec 2, 2009 at 8:41 PM, Chris Payne <[email protected]>
> wrote:
>>
>> Hi everyone,
>>
>> I'm pulling data from a mysql database, but need only the first 20
>> characters of each string for a short description, what is the best
>> method to just grab the first 20 characters from a string regardless
>> of whether they are letters or numbers?
>>
>> Chris
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>
>
>
> --
> Devendra Jadhav
> देवेंद्र जाधव
>

--- End Message ---
--- Begin Message ---
Yup. That was it. I found that Googling around as well.

Eesh.

Skip

Andrew Ballard wrote:
On Tue, Dec 1, 2009 at 4:06 PM, Skip Evans <[email protected]> wrote:
Hey all,

You probably remember me asking about disabling a submit button when it is
clicked to prevent double clicks submitting  a form for CC processing.

I put the following code into the submit button and it works fine on
FireFox, but... hold your breath... not on IE.

The button gets disabled but the form just sits there, not submitting. At
first I just had

onclick="this.disabled=true;"

and that worked in FF also, but not in IE. Then I added the

document.ticket_form.submit();

But even that doesn't work with IE.

Below is the whole snippet for the button.

<input type="submit" name="submit" value="Purchase Ticket(s)"
id="submit_tickets" onclick="this.disabled=true;
document.ticket_form.submit();">

Any suggestions would be greatly appreciated.


It looks like IE has an issue with your button being named "submit",
and is replacing the submit() method of the form with the element
named "submit". Try changing the name of the button.

Andrew



--
====================================
Skip Evans
PenguinSites.com, LLC
503 S Baldwin St, #1
Madison WI 53703
608.250.2720
http://penguinsites.com
------------------------------------
Those of you who believe in
telekinesis, raise my hand.
 -- Kurt Vonnegut

--- End Message ---
--- Begin Message ---
Hey all,

Tedd & Ash, yes, I'm definitely looking into solving it server side, but I need this quick fix while I come with a solution more along the lines of what you've both suggested.

Ash, how do you store the time stamp when the first request comes through? Do you use a session variable or something like that and when each request comes through compare the data with any previous request within the half second or so?

Skip

tedd wrote:
At 9:16 PM +0000 12/1/09, Ashley Sheridan wrote:
On Tue, 2009-12-01 at 15:06 -0600, Skip Evans wrote:
wow, i really think you're going about this all the wrong way.

Ash:

I thought the same thing considering that I went through the exact same problem and provided a solution, which he never mentioned.

Cheers,

tedd


--
====================================
Skip Evans
PenguinSites.com, LLC
503 S Baldwin St, #1
Madison WI 53703
608.250.2720
http://penguinsites.com
------------------------------------
Those of you who believe in
telekinesis, raise my hand.
 -- Kurt Vonnegut

--- End Message ---
--- Begin Message ---
On Wed, 2009-12-02 at 10:09 -0600, Skip Evans wrote:

> Hey all,
> 
> Tedd & Ash, yes, I'm definitely looking into solving it server 
> side, but I need this quick fix while I come with a solution 
> more along the lines of what you've both suggested.
> 
> Ash, how do you store the time stamp when the first request 
> comes through? Do you use a session variable or something like 
> that and when each request comes through compare the data with 
> any previous request within the half second or so?
> 
> Skip
> 
> tedd wrote:
> > At 9:16 PM +0000 12/1/09, Ashley Sheridan wrote:
> >> On Tue, 2009-12-01 at 15:06 -0600, Skip Evans wrote:
> >> wow, i really think you're going about this all the wrong way.
> > 
> > Ash:
> > 
> > I thought the same thing considering that I went through the exact same 
> > problem and provided a solution, which he never mentioned.
> > 
> > Cheers,
> > 
> > tedd
> > 
> 
> -- 
> ====================================
> Skip Evans
> PenguinSites.com, LLC
> 503 S Baldwin St, #1
> Madison WI 53703
> 608.250.2720
> http://penguinsites.com
> ------------------------------------
> Those of you who believe in
> telekinesis, raise my hand.
>   -- Kurt Vonnegut
> 


I'll tell you about the problem I had.

One site was offering up contact details for sale on a contract basis.
The names were presented in a list of links, and clicking through
purchased those details for a 24-hour period.

When a visitor clicked on a link, it added an entry into a database
along with the current time. Because links are all GET data, the process
was performed twice by some browsers. Each time a details page was
displayed it checked to see if these details were requested by the same
user (using the login details) within a certain time period. If no
record was found, then a new purchase entry was made.

You could use this sort of thing on your own system as a general idea.

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



--- End Message ---
--- Begin Message --- Okay, I'll work on something along those lines. In the meantime, the JS will work better than nothing.

Thanks,
Skip

Ashley Sheridan wrote:

I'll tell you about the problem I had.

One site was offering up contact details for sale on a contract basis. The names were presented in a list of links, and clicking through purchased those details for a 24-hour period.

When a visitor clicked on a link, it added an entry into a database along with the current time. Because links are all GET data, the process was performed twice by some browsers. Each time a details page was displayed it checked to see if these details were requested by the same user (using the login details) within a certain time period. If no record was found, then a new purchase entry was made.

You could use this sort of thing on your own system as a general idea.

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



--
====================================
Skip Evans
PenguinSites.com, LLC
503 S Baldwin St, #1
Madison WI 53703
608.250.2720
http://penguinsites.com
------------------------------------
Those of you who believe in
telekinesis, raise my hand.
 -- Kurt Vonnegut

--- End Message ---
--- Begin Message ---
At 10:09 AM -0600 12/2/09, Skip Evans wrote:
Hey all,

Tedd & Ash, yes, I'm definitely looking into solving it server side, but I need this quick fix while I come with a solution more along the lines of what you've both suggested.

A quick fix?

You've spent more time writing your question than it would take to do a quick fix.

Quick fix:

1. Use javascript to deactivate the Submit button after it's clicked.

Here's an example of a javascript fix:

http://www.webbytedd.com/forms/single-submit1

2. Just in case the user has javascript disabled, then have your php form generate a token and place that value in a session. That way, upon a refresh (double click) you can check if the session contains anything and if it does, then don't do anything.

Here's an example of a php fix:

http://www.webbytedd.com/forms/single-submit2

Keep in mind that your browser's session will be in effect upon testing this. You should be able to get the idea.

Permanent fix:

Contact the Credit Card processing company and have them turn "Duplicate Suppression" to ON.

Cheers,

tedd

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

--- End Message ---
--- Begin Message ---
Hey all,

I have a client who creates PowerPoint presentations to sell their clients on projects. What he would like his site to do is allow his clients to arrange their own PP presentations from an existing collection of slides with images, but then add their own text.

So the problem I need to solve is to take a set of PP slides with images, and then insert text into each one below the image and then assemble a .ppt file consisting of the selected slides.

I'm Googling around now for a solution, but if anyone has tackled this before and can point me in a productive direction heaps of praise will be orated at my next "heap praise on people" party.

...in other words, thanks,
Skip

--
====================================
Skip Evans
PenguinSites.com, LLC
503 S Baldwin St, #1
Madison WI 53703
608.250.2720
http://penguinsites.com
------------------------------------
Those of you who believe in
telekinesis, raise my hand.
 -- Kurt Vonnegut

--- End Message ---
--- Begin Message ---
On Wed, 2009-12-02 at 10:19 -0600, Skip Evans wrote:

> Hey all,
> 
> I have a client who creates PowerPoint presentations to sell 
> their clients on projects. What he would like his site to do 
> is allow his clients to arrange their own PP presentations 
> from an existing collection of slides with images, but then 
> add their own text.
> 
> So the problem I need to solve is to take a set of PP slides 
> with images, and then insert text into each one below the 
> image and then assemble a .ppt file consisting of the selected 
> slides.
> 
> I'm Googling around now for a solution, but if anyone has 
> tackled this before and can point me in a productive direction 
> heaps of praise will be orated at my next "heap praise on 
> people" party.
> 
> ...in other words, thanks,
> Skip
> 
> -- 
> ====================================
> Skip Evans
> PenguinSites.com, LLC
> 503 S Baldwin St, #1
> Madison WI 53703
> 608.250.2720
> http://penguinsites.com
> ------------------------------------
> Those of you who believe in
> telekinesis, raise my hand.
>   -- Kurt Vonnegut
> 


I don't think that's possible. You could look at the Microsoft XML
formats to see if you can take that apart, but it would be tricky. It
might be far easier to do it with the Open Office presentation format,
but again, I don't know of any libraries that are capable of doing this.

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



--- End Message ---
--- Begin Message --- Yeah, from Googling around I'm getting the impression there is not a PHP library capable of doing this. I guess the next best thing we can do is just let them download files with collections of slides and create the presentation themselves.

Skip

Ashley Sheridan wrote:

I don't think that's possible. You could look at the Microsoft XML formats to see if you can take that apart, but it would be tricky. It might be far easier to do it with the Open Office presentation format, but again, I don't know of any libraries that are capable of doing this.

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



--
====================================
Skip Evans
PenguinSites.com, LLC
503 S Baldwin St, #1
Madison WI 53703
608.250.2720
http://penguinsites.com
------------------------------------
Those of you who believe in
telekinesis, raise my hand.
 -- Kurt Vonnegut

--- End Message ---
--- Begin Message ---
php on windows server may have the capability...

On Wed, Dec 2, 2009 at 11:30 AM, Skip Evans <[email protected]> wrote:

> Yeah, from Googling around I'm getting the impression there is not a PHP
> library capable of doing this. I guess the next best thing we can do is just
> let them download files with collections of slides and create the
> presentation themselves.
>
> Skip
>
>
> Ashley Sheridan wrote:
>
>>
>> I don't think that's possible. You could look at the Microsoft XML formats
>> to see if you can take that apart, but it would be tricky. It might be far
>> easier to do it with the Open Office presentation format, but again, I don't
>> know of any libraries that are capable of doing this.
>>
>> Thanks,
>> Ash
>> http://www.ashleysheridan.co.uk
>>
>>
>>
> --
> ====================================
> Skip Evans
> PenguinSites.com, LLC
> 503 S Baldwin St, #1
> Madison WI 53703
> 608.250.2720
> http://penguinsites.com
> ------------------------------------
> Those of you who believe in
> telekinesis, raise my hand.
>  -- Kurt Vonnegut
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
On Wed, 2009-12-02 at 11:41 -0500, Ryan Sun wrote:

> php on windows server may have the capability...
> 
> On Wed, Dec 2, 2009 at 11:30 AM, Skip Evans <[email protected]> wrote:
> 
> > Yeah, from Googling around I'm getting the impression there is not a PHP
> > library capable of doing this. I guess the next best thing we can do is just
> > let them download files with collections of slides and create the
> > presentation themselves.
> >
> > Skip
> >
> >
> > Ashley Sheridan wrote:
> >
> >>
> >> I don't think that's possible. You could look at the Microsoft XML formats
> >> to see if you can take that apart, but it would be tricky. It might be far
> >> easier to do it with the Open Office presentation format, but again, I 
> >> don't
> >> know of any libraries that are capable of doing this.
> >>
> >> Thanks,
> >> Ash
> >> http://www.ashleysheridan.co.uk
> >>
> >>
> >>
> > --
> > ====================================
> > Skip Evans
> > PenguinSites.com, LLC
> > 503 S Baldwin St, #1
> > Madison WI 53703
> > 608.250.2720
> > http://penguinsites.com
> > ------------------------------------
> > Those of you who believe in
> > telekinesis, raise my hand.
> >  -- Kurt Vonnegut
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >


I think for COM stuff to work, you'd have to have MS Office installed on
the server. I wouldn't recommend that to anyone; that would be just
another way into the server should someone wish it. Windows and MS
Office are just about the most popular bits of software around, and
Windows is inherently insecure, such that I'd be unsurprised if their
Office software was as insecure.

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



--- End Message ---
--- Begin Message --- I wonder what other alternatives to PP might exist for a possible solution to this. I don't know squat about Flash, but the client is not married to PP, just needs some kind of presentation the side can assemble, again basically put images and text into something that can be displayed to potential clients.

The OpenOffice API suggestion from Leonard sounds a bit intriguing but the client doesn't have a huge budget for me to spend a lot of time experimenting.

I'm wondering what can be done with images and either ImageMagick or perhaps GD and then something.

Skip

Ashley Sheridan wrote:
On Wed, 2009-12-02 at 11:41 -0500, Ryan Sun wrote:

php on windows server may have the capability...

On Wed, Dec 2, 2009 at 11:30 AM, Skip Evans <[email protected]> wrote:

Yeah, from Googling around I'm getting the impression there is not a PHP
library capable of doing this. I guess the next best thing we can do is just
let them download files with collections of slides and create the
presentation themselves.

Skip


Ashley Sheridan wrote:

I don't think that's possible. You could look at the Microsoft XML formats
to see if you can take that apart, but it would be tricky. It might be far
easier to do it with the Open Office presentation format, but again, I don't
know of any libraries that are capable of doing this.

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



--
====================================
Skip Evans
PenguinSites.com, LLC
503 S Baldwin St, #1
Madison WI 53703
608.250.2720
http://penguinsites.com
------------------------------------
Those of you who believe in
telekinesis, raise my hand.
 -- Kurt Vonnegut

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




I think for COM stuff to work, you'd have to have MS Office installed on
the server. I wouldn't recommend that to anyone; that would be just
another way into the server should someone wish it. Windows and MS
Office are just about the most popular bits of software around, and
Windows is inherently insecure, such that I'd be unsurprised if their
Office software was as insecure.

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




--
====================================
Skip Evans
PenguinSites.com, LLC
503 S Baldwin St, #1
Madison WI 53703
608.250.2720
http://penguinsites.com
------------------------------------
Those of you who believe in
telekinesis, raise my hand.
 -- Kurt Vonnegut

--- End Message ---
--- Begin Message ---
On Wed, 2009-12-02 at 10:54 -0600, Skip Evans wrote:

> I wonder what other alternatives to PP might exist for a 
> possible solution to this. I don't know squat about Flash, but 
>   the client is not married to PP, just needs some kind of 
> presentation the side can assemble, again basically put images 
> and text into something that can be displayed to potential 
> clients.
> 
> The OpenOffice API suggestion from Leonard sounds a bit 
> intriguing but the client doesn't have a huge budget for me to 
> spend a lot of time experimenting.
> 
> I'm wondering what can be done with images and either 
> ImageMagick or perhaps GD and then something.
> 
> Skip
> 
> Ashley Sheridan wrote:
> > On Wed, 2009-12-02 at 11:41 -0500, Ryan Sun wrote:
> > 
> >> php on windows server may have the capability...
> >>
> >> On Wed, Dec 2, 2009 at 11:30 AM, Skip Evans <[email protected]> wrote:
> >>
> >>> Yeah, from Googling around I'm getting the impression there is not a PHP
> >>> library capable of doing this. I guess the next best thing we can do is 
> >>> just
> >>> let them download files with collections of slides and create the
> >>> presentation themselves.
> >>>
> >>> Skip
> >>>
> >>>
> >>> Ashley Sheridan wrote:
> >>>
> >>>> I don't think that's possible. You could look at the Microsoft XML 
> >>>> formats
> >>>> to see if you can take that apart, but it would be tricky. It might be 
> >>>> far
> >>>> easier to do it with the Open Office presentation format, but again, I 
> >>>> don't
> >>>> know of any libraries that are capable of doing this.
> >>>>
> >>>> Thanks,
> >>>> Ash
> >>>> http://www.ashleysheridan.co.uk
> >>>>
> >>>>
> >>>>
> >>> --
> >>> ====================================
> >>> Skip Evans
> >>> PenguinSites.com, LLC
> >>> 503 S Baldwin St, #1
> >>> Madison WI 53703
> >>> 608.250.2720
> >>> http://penguinsites.com
> >>> ------------------------------------
> >>> Those of you who believe in
> >>> telekinesis, raise my hand.
> >>>  -- Kurt Vonnegut
> >>>
> >>> --
> >>> PHP General Mailing List (http://www.php.net/)
> >>> To unsubscribe, visit: http://www.php.net/unsub.php
> >>>
> >>>
> > 
> > 
> > I think for COM stuff to work, you'd have to have MS Office installed on
> > the server. I wouldn't recommend that to anyone; that would be just
> > another way into the server should someone wish it. Windows and MS
> > Office are just about the most popular bits of software around, and
> > Windows is inherently insecure, such that I'd be unsurprised if their
> > Office software was as insecure.
> > 
> > Thanks,
> > Ash
> > http://www.ashleysheridan.co.uk
> > 
> > 
> > 
> 
> -- 
> ====================================
> Skip Evans
> PenguinSites.com, LLC
> 503 S Baldwin St, #1
> Madison WI 53703
> 608.250.2720
> http://penguinsites.com
> ------------------------------------
> Those of you who believe in
> telekinesis, raise my hand.
>   -- Kurt Vonnegut
> 


Images would likely be HUGE for a presentation! Have you thought about
PDF's instead? A PDF is pretty easy to put together, and there are
several free to use libraries out there for just such a thing.

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



--- End Message ---
--- Begin Message ---
Skip Evans wrote:
> I wonder what other alternatives to PP might exist for a possible
> solution to this. I don't know squat about Flash, but  the client is not
> married to PP, just needs some kind of presentation the side can
> assemble, again basically put images and text into something that can be
> displayed to potential clients.
> 
> The OpenOffice API suggestion from Leonard sounds a bit intriguing but
> the client doesn't have a huge budget for me to spend a lot of time
> experimenting.
> 
> I'm wondering what can be done with images and either ImageMagick or
> perhaps GD and then something.
> 
> Skip
> 

1. If they're not married to PP, why not just use HTML?  You can do all
of the same things on your own in PHP/HTML.  Also, this looks pretty
cool: http://meyerweb.com/eric/tools/s5/

2. If you save a PP as HTML or XML and inspect the tags you can see what
you need to do to build one.  Or PP will open the HTML or XML and it
will behave as a PP presentation if you give it a PP extension instead
of htm/html.  Also, a PP saved in HTML looks great in IE and has some PP
functionality.

-- 
Thanks!
-Shawn
http://www.spidean.com

--- End Message ---
--- Begin Message ---
Shawn McKenzie wrote:
1. If they're not married to PP, why not just use HTML?  You can do all
of the same things on your own in PHP/HTML.  Also, this looks pretty
cool: http://meyerweb.com/eric/tools/s5/


Bingo. That's what I'm going to propose. I can do a nice slide-like presentation in HTML the people can just log onto the web site to view.

Thanks all!

Skip

--
====================================
Skip Evans
PenguinSites.com, LLC
503 S Baldwin St, #1
Madison WI 53703
608.250.2720
http://penguinsites.com
------------------------------------
Those of you who believe in
telekinesis, raise my hand.
 -- Kurt Vonnegut

--- End Message ---
--- Begin Message ---
Hi:

My $0.02.

http://www.webbytedd.com/cccc/real-ip/

Open to suggestion/correction.

Cheers,

tedd

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

--- End Message ---
--- Begin Message ---
Try using CURL - with that you can download many links simultaneously!

On Wed, Dec 2, 2009 at 12:48 AM, Brian Dunning <[email protected]>wrote:

> This is a holiday-crunch emergency.
>
> I'm dealing with a client from whom we need to download many large PDF docs
> 24x7, several thousand per hour, all between a few hundred K and about 50
> MB. Their security process requires the files to be downloaded via https
> using a big long URL with lots of credential parameters.
>
> Here's how I'm doing it. This is on Windows, a quad Xeon with 16GB RAM:
>
> $ctx = stream_context_create(array('http' => array('timeout' => 1200)));
> $contents = file_get_contents($full_url, 0, $ctx);
> $fp = fopen('D:\\DocShare\\'.$filename, "w");
> $bytes_written = fwrite($fp, $contents);
> fclose($fp);
>
> It's WAY TOO SLOW. I can paste the URL into a browser and download even the
> largest files quite quickly, but the PHP method bottlenecks and cannot keep
> up.
>
> Is there a SUBSTANTIALLY faster way to download and save these files? Keep
> in mind the client's requirements cannot be changed. Thanks for any
> suggestions.
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Use ROT26 for best security

--- End Message ---
--- Begin Message ---
Ashley Sheridan wrote:
> On Wed, 2009-12-02 at 12:17 +0100, Julian Muscat Doublesin wrote:
> 
>> Sorry about the reply to all. the htaccess files worked correctly on a wamp
>> setup I had. All this happened once I did the big move to apache.
>>
>> On Wed, Dec 2, 2009 at 12:10 PM, Ashley Sheridan
>> <[email protected]>wrote:
>>
>>>   On Wed, 2009-12-02 at 12:10 +0100, Julian Muscat Doublesin wrote:
>>>
>>> I setup apache myself. That I'm sure of. I had a look at the php info and
>>> saw that mod_write in enabled. I checked the conf file and made sure that
>>> the AllowOverride is set to All.
>>>
>>> On Wed, Dec 2, 2009 at 11:55 AM, Ashley Sheridan <[email protected]>
>>> wrote:
>>>
>>>
>>>  On Wed, 2009-12-02 at 11:55 +0100, Julian Muscat Doublesin wrote:
>>>
>>> is this the issue.
>>>
>>> On Wed, Dec 2, 2009 at 11:55 AM, Julian Muscat Doublesin <
>>> [email protected]> wrote:
>>>
>>> I am runnning both IIS and Apache. The php webites are hosted on Apacahe.
>>>
>>>
>>>
>>> On Wed, Dec 2, 2009 at 11:41 AM, Ashley Sheridan <[email protected]>
>>> wrote:
>>>
>>>
>>> On Wed, 2009-12-02 at 11:42 +0100, Julian Muscat Doublesin wrote:
>>>
>>> Yes - running IIS 7.
>>>
>>> On Wed, Dec 2, 2009 at 11:27 AM, Ashley Sheridan <[email protected]>
>>> wrote:
>>>
>>>
>>> On Wed, 2009-12-02 at 10:27 +0100, Julian Muscat Doublesin wrote:
>>>
>>> Hello Everyone,
>>>
>>> I am having trouble with the mod_rewrite. This is not working on windows
>>> 64bit. I am also having trouble with the directory password protection.
>>> However thse bot work perfectly on my UNIX Mac.
>>>
>>> >From my experince I can see that this is due to file system compatibility.
>>> Can anyone confirm this. You would be of greate help as I am going through
>>> HELL right now. Can any suggest the best Unix or Linx OS for hosting phph
>>> websites and MySQL.
>>>
>>> Thank you very much in advanace.
>>>
>>>
>>>
>>> By any chance, are you using IIS on your Windows machine?
>>>
>>> Pretty much most hosting companies offer Linux web-hosting. My advice would
>>> be to try and use a company based in the same country as you are, because
>>> it's nice to be able to contact them during your hours when something goes
>>> wrong. And be ready to accept that things may go wrong at some point.
>>>
>>>   Thanks,
>>> Ash
>>> http://www.ashleysheridan.co.uk
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> That is why mod_rewrite isn't working! IIS doesn't support that. It has
>>> something else instead, by a name I forget just now. Afaik, you have to
>>> purchase the support for this other bit as an extra module though.
>>>
>>>
>>>   Thanks,
>>> Ash
>>> http://www.ashleysheridan.co.uk
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>  Are you sure the PHP ones are running under Apache? Just to check, see
>>> what you get in the $_SERVER array. Also, have you checked to see if
>>> mod_rewrite is enabled in the httpd.conf file?
>>>
>>>
>>>
>>>   Thanks,
>>> Ash
>>> http://www.ashleysheridan.co.uk
>>>
>>>
>>>
>>>
>>>
>>> OK, what does your .htaccess file look like? Also, have you named it
>>> correctly? It starts with a period (.) character, which Windows might
>>> sometimes complain about.
>>>
>>> PS, don't forget to hit reply to all, as the last few messages I keep
>>> having to copy the list back in!
>>>
>>>
>>>   Thanks,
>>> Ash
>>> http://www.ashleysheridan.co.uk
>>>
>>>
>>>
> 
> 
> Erm, Wamp is Apache!
> 
> Well, have you done other things in the .htaccess that are failing,
> causing the whole thing to fail?
> 

Or maybe not installed/enabled mod_rewrite?


-- 
Thanks!
-Shawn
http://www.spidean.com

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


i'm trying to connect to a SOAP Server but i'm having a problem. Look
the xml that i need send to the server:

// THIS IS THE XML CORRECT THAT NEED BE SENT TO THE SERVER

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";>
<soap:Body>
<CalcPrecoPrazo xmlns="http://tempuri.org/";>
        <nCdEmpresa>XXXXX</nCdEmpresa>
        <sDsSenha>XXXXXX</sDsSenha>
        <nCdServico>40010</nCdServico>
        <sCepOrigem>30840300</sCepOrigem>
        <sCepDestino>30840280</sCepDestino>
        <nVlPeso>10</nVlPeso>
        <nCdFormato>1</nCdFormato>
        <nVlComprimento>20</nVlComprimento>
        <nVlAltura>5</nVlAltura>
        <nVlLargura>10</nVlLargura
        ><nVlDiametro>0</nVlDiametro>
        <sCdMaoPropria>S</sCdMaoPropria>
        <nVlValorDeclarado>300</nVlValorDeclarado>
        <sCdAvisoRecebimento>S</sCdAvisoRecebimento>
</CalcPrecoPrazo>
</soap:Body>
</soap:Envelope>


And now the xml that i'm sending to the SOAP Server.


//THIS IS THE XML THAT THE PHP IS SENDING
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/";
xmlns:ns1="http://tempuri.org/";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/";
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";>
<SOAP-ENV:Body>
<ns1:CalcPrecoPrazo> // HOW CAN I REMOVE THIS NAMESPACE? ns1:
        <nCdEmpresa xsi:type="xsd:int">XXXXX</nCdEmpresa>
        <sDsSenha xsi:type="xsd:string">XXXXXX</sDsSenha>
        <nCdServico xsi:type="xsd:string">40096</nCdServico>
        <sCepOrigem xsi:type="xsd:string">30840280</sCepOrigem>
        <sCepDestino xsi:type="xsd:string">30840300</sCepDestino>
        <nVlPeso xsi:type="xsd:string">10</nVlPeso>
        <nCdFormato xsi:type="xsd:string">1</nCdFormato>
        <nVlComprimento xsi:type="xsd:string">5</nVlComprimento>
        <nVlAltura xsi:type="xsd:string">10</nVlAltura>
        <nVlLargura xsi:type="xsd:string">0</nVlLargura>
        <nVlDiametro xsi:type="xsd:string">300</nVlDiametro>
        <sCdMaoPropria xsi:type="xsd:string">N</sCdMaoPropria>
        <nVlValorDeclarado xsi:type="xsd:string">300</nVlValorDeclarado>
        <sCdAvisoRecebimento xsi:type="xsd:string">N</sCdAvisoRecebimento>
        </ns1:CalcPrecoPrazo>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>


How can i remove the ns1 from the Child CalcPrecoPrazo?

Some idea?



//here is the php code:

$client = new SoapClient(null, array('location' => $url,
                                     'uri'      =>
"http://tempuri.org/CalcPrecoPrazo";,
                                     'trace'    => 1 ));

$results = $client->CalcPrecoPrazo($empresaCod, $empresaSenha,
$codigoFrete, $cepOrigem, $cepDestino, $peso,
                                  (int)$formatoCd, (int)$comprimento, 
(int)$altura, (int)$largura,
(int)$VlDiametro,
                                  $codMaoPropria, (float)$valor, 
$codAvisoRecebimento);


thanks




Augusto Morais

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

I am creating an app where I have to show east asian text in image.
Those are utf8. Problem is when I try to display "কি হচ্ছে" in image,
it shows "ক ি হ চ ্ ছ ে"  without the circles.
How do I show it correctly.

Note: I am generating image, not html file.



-- 
A K M Mokaddim
My talks, talk.cmyweb.net
Follow me, twitter.com/shiplu

Innovation distinguishes bet ... ... (ask Steve Jobs the rest)

--- End Message ---
--- Begin Message ---
Hello everybody,

I am pretty much stuck with a problem and I was hoping to find some help here with you guys.

A PHP Script with MySQL as DB has to find out the first possible booking period available. I can't figure out the logic behind and if there is a trick with PHP to do it.

Following facts:
- There can only be 3 bookings in the same time period
- I want to find out the first period available
- There should be a less as possible periods that are unbooked

Example:
Start   End
1.12    14.12
4.12    18.12
5.12    19.12
In this example the first possible booking would be 14.12 - 28.12 as this is a time period where I can offer a place that holds a max of 3 bookings.

My Problem now is how to pull this info and process it?

Should I get all dates out of the DB and process them via PHP, or do a magical MYSQL Query (which by the way seems not to be possible in that case in my knowledge) ?

Let's asume we go with PHP. Has somebody an idea how to form that kind of logic?

Thank you for ANY help,

merlin

--- End Message ---

Reply via email to