Re: [PHP] fpassthru failure with mozilla

2004-10-12 Thread ApexEleven
Why use fpassthru? I just use readfile, is there a difference?


On Tue, 12 Oct 2004 11:11:54 -0500, Matt M. <[EMAIL PROTECTED]> wrote:
> > $filepath = "bla/bla/files/";
> > $filename = "file.zip";
> > $fullpath = "$filepath/$filename";
> >
> > header( ' Pragma: ');
> > header( ' Content-Type: application/force-download' );
> > header( ' Content-Type: application/octet-stream ' );
> > header( ' Content-length:'.(string)(filesize($fullpath)));
> > header( ' Cache-Control: private' );
> > header( " Content-Disposition: attachment; filename='$filename'");
> >
> > $fh = fopen("$filepath/$filename", "rb");
> > fpassthru($fh);
> 
> it looks good to me.  You might want to try: header('Pragma:
> no-cache'); instead of header( ' Pragma: ');
> 
> Also, install http://livehttpheaders.mozdev.org/ on mozilla.  Will
> help with debugging
> 
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
<<
Jasper Howard - Database Administration
ApexEleven.com
530 559 0107
--->>

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



Re: [PHP] creating a folder in php

2004-10-12 Thread ApexEleven
ok dudes, we understand, as much fun as I have downloading and reading
your awsome requests, lets just stop beating the horse, it's bee dead
for quite a while now...


On Tue, 12 Oct 2004 15:02:19 -0400, PHP Junkie <[EMAIL PROTECTED]> wrote:
> 
> >> I want an IDE that will let me speak code into it. Anyone else want
> >> anything?
> 
> Oh.. I'd like a flat-screen monitor that would interpret the program that I
> have in my mind, generate the code for it on screen, save it and run the
> program everytime I say "KaBoom".
> 
> I'd like a side-order of that IDE that will let me speak code into it as
> well..
> 
> And a bag of Spicier Doritos!! Can't get enough of those.
> 
> Thanks,
> Junkie
> 
> 
> 
> 
> On 10/12/04 2:48 PM, "Greg Donald" <[EMAIL PROTECTED]> wrote:
> 
> > On Tue, 12 Oct 2004 13:35:13 -0500, Jay Blanchard
> > <[EMAIL PROTECTED]> wrote:
> >> I want an IDE that will let me speak code into it. Anyone else want
> >> anything?
> >
> > I'd like a clone of myself to do my 9-5 x 5 for me.
> >
> > Oh yeah, and a bag of cheetos.   Thanks.
> >
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
<<
Jasper Howard - Database Administration
ApexEleven.com
530 559 0107
--->>

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



Re: [PHP] Re: Determine variable with the lowest value?

2004-10-14 Thread ApexEleven
/* Untested Code */

$arr[0]['id'] = 3;
$arr[0]['name] = 'Mike';
$arr[1]['id'] = 2;
$arr[1]['name'] = 'Bob';
$arr[2]['id'] = 5;
$arr[2]['name'] = 'Jane';

array_multisort($arr['id'],$arr['name']);

print "It's ".$arr[0]['name']."'s Turn To Take Out The Garbage!";

/* End Untested Code */


On Thu, 14 Oct 2004 11:26:56 -0500, Matt M. <[EMAIL PROTECTED]> wrote:
> On Thu, 14 Oct 2004 10:52:20 -0500, BOOT <[EMAIL PROTECTED]> wrote:
> > OK thanks but I guess I didn't explain what I am trying to do properly.
> >
> > I need to be able to identify the variable name as well as pick the variable
> > with the lowest value.
> >
> > Something like this:
> >
> > Whose turn is it to take out the garbage?
> >
> > Mike has done it 3 times
> > Bob has done it 2 times
> > Jane has done it 5 times
> > etc...
> >
> > Therefore its Bob's turn.
> 
> 
> $arr['Mike'] = 3;
> $arr['Bob'] = 2;
> $arr['Jane'] = 5;
> 
> foreach ($arr as $key => $value) {
>echo $key.' has done it '.$value.' times';
> }
> asort($arr);
> print 'It is '.key($arr).'\'s turn';
> 
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
<<
Jasper Howard - Database Administration
ApexEleven.com
530 559 0107
--->>

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



Re: [PHP] intenger

2004-10-14 Thread ApexEleven
settype($var,int);


On Thu, 14 Oct 2004 14:19:28 -0300 (ART), Juan Pablo Herrera
<[EMAIL PROTECTED]> wrote:
> Please, i need output a intenger, what function can i use for this?.
> Print?, echo?
> 
> Thank you.
> JP
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
<<
Jasper Howard - Database Administration
ApexEleven.com
530 559 0107
--->>

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



Re: [PHP] include()ing into a variable

2004-10-14 Thread ApexEleven
I believe that include() returns true|false, so $a would equal true if
the file is included and false if it is not.


On Thu, 14 Oct 2004 10:35:15 -0700 (PDT), Mag <[EMAIL PROTECTED]> wrote:
> Hi,
> I have never done this before (but in my first test it
> seems to work), I am include()ing a file into a
> variable like this:
> 
> $a=include("th-file.php");
> 
> Will this give me any extra problems later on? or is
> this resource intensive?
> 
> The reason I am doing this is because I want to put
> whole pages into a variable then write the contents of
> the variable to a static html file...
> 
> eg:
> $a=include("header.php");
> $a .= " calcalutions etc here>";
> $a .= include "footer.php";
> ->fopen and write $a to newfile: something.html
> 
> Thats the idea anyway this is the first time I am
> experimenting with this approach, so I want to know is
> this "legal" in php and if I should be expecting any
> problems. The final pages to output can be around 100k
> I guess and I will be outputting every 3-60 mins.
> 
> Thanks,
> Mag
> 
> =
> --
> - The faulty interface lies between the chair and the keyboard.
> - Creativity is great, but plagiarism is faster!
> - Smile, everyone loves a moron. :-)
> 
> ___
> Do you Yahoo!?
> Declare Yourself - Register online to vote today!
> http://vote.yahoo.com
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
<<
Jasper Howard - Database Administration
ApexEleven.com
530 559 0107
--->>

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



Re: [PHP] add item to end of (multidimensional) array

2004-10-15 Thread ApexEleven
How come you guys always go for the simplest answer? why not do something like,

$num = count($arrPt);
$arrPt[$num]['name'] = "Figntin' Bob";
$arrPt[$num]['address'] = "Under the Broad Street Bridge";

Live a little...

-Jasper


On Fri, 15 Oct 2004 09:07:43 -0500, Chris Boget <[EMAIL PROTECTED]> wrote:
> > You mean like this...
> > $sub = array
> > (
> > 'name' => 'Ahnold',
> > 'address' => '123 Someplace Nice',
> > );
> >
> > $bigArray[] = $sub;
> 
> Something else that will work is the following:
> 
> $arrPt =& $Arr[];
> $arrPt['name'] = 'bob';
> $arrPt['address'] = 'wherever';
> 
> thnx,
> Chris
> 
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
<<
Jasper Howard - Database Administration
ApexEleven.com
530 559 0107
--->>

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



[PHP] $_FILES Not Populating On File Upload

2004-10-22 Thread ApexEleven
I've googled the question and found no answer that has fixed my
problem. I also searched this list to try and find the answer to no
avail.

My problem is that after my form submits data to another script the
$_FILES global returns nothing but "array()" when I try to "print_r()"
it. I coppied the scripts directly from one server to another. Here is
a sample of my form:
[snippet]










[/snippet]
All I could find was some posts saying that some php.ini settings
needed to be set correctly, and I believe they are on the server I'm
trying to run my script on.

file_uploads=On
max_execution_time=90
max_input_time=-1
memory_limit=8M
post_max_size=10M
register_globals=On
upload_max_filesize=10M
upload_tmp_dir=/tmp

NOTE: I got all those values off my phpinfo().

I have had this problem before but do not know how it got fixed, any
help would be much appreciated,

-- 
<<
Jasper Howard - Database Administration
ApexEleven.com
530 559 0107
--->>

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



[PHP] VOTE TODAY

2004-11-02 Thread ApexEleven
I can't wait for the replies...

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



Re: [PHP] help me split chars w/o spaces by 2... like: 2004

2004-12-09 Thread ApexEleven
I did something like this a while back, I believe I used chunk_split

[code]

[/code]

it'll output something along the lines of:
20
04

Hope this helps,

-- 
<<
Jasper Howard - Database Administration
ApexEleven.com
530 559 0107
--->>

On Thu, 9 Dec 2004 10:21:49 +0800, Louie Miranda <[EMAIL PROTECTED]> wrote:
>  $hello2 = chop($year_split);
> echo $hello2;
> ?>
> 
> outputs: 2004
> 
> Whats the correct syntax for it? The manual said..
> 
> This function is an alias of rtrim().
> 
> and:
> 
> rtrim
> (PHP 3, PHP 4 )
> 
> rtrim --  Strip whitespace from the end of a string
> 
> 
> 
> 
> On Wed, 08 Dec 2004 18:11:19 -0800, Tyler Replogle <[EMAIL PROTECTED]> wrote:
> > have you tride using chop() ?
> > # begin code
> > $year_split = date("Y");
> > $chars = chop($year_split);
> > $chars[0] // = 2
> > $chars[1] // = 0
> > $chars[2] // = 0
> > $chars[3]  //= 4
> > # end code
> > I hope that will help
> >
> > >From: Louie Miranda <[EMAIL PROTECTED]>
> > >Reply-To: Louie Miranda <[EMAIL PROTECTED]>
> > >To: [EMAIL PROTECTED]
> > >Subject: [PHP] help me split chars w/o spaces by 2... like: 2004
> > >Date: Thu, 9 Dec 2004 09:55:57 +0800
> > >MIME-Version: 1.0
> > >Received: from pb1.pair.com ([216.92.131.4]) by mc6-f24.hotmail.com with
> > >Microsoft SMTPSVC(5.0.2195.6713); Wed, 8 Dec 2004 17:56:52 -0800
> > >Received: (qmail 21242 invoked by uid 1010); 9 Dec 2004 01:56:02 -
> > >Received: (qmail 21150 invoked by uid 1010); 9 Dec 2004 01:56:01 -
> > >X-Message-Info: 6sSXyD95QpUKIecQn+Z/xIP21pcg8LTu
> > >Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
> > >Precedence: bulk
> > >list-help: 
> > >list-unsubscribe: 
> > >list-post: 
> > >Delivered-To: mailing list [EMAIL PROTECTED]
> > >Delivered-To: [EMAIL PROTECTED]
> > >Delivered-To: [EMAIL PROTECTED]
> > >DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws;s=beta;
> > >d=gmail.com;
> > >h=received:message-id:date:from:reply-to:to:subject:mime-version:content-type:content-transfer-encoding;
> > >
> > >b=gp2OcpYqK7wZkSMBhO5OvxdTzhTOQdM1+n9ZtLJ4lmsKWFpVRb9Y2kyjNIrRIX/rvXeFfwCVGh7LT6kub0DMmCGdeRiLKeCjJkxK4fWxSrP2D+FexciD2lT8ASKD7TNYC3YGIZLZbk5UEJIq9Yx2TkbIdgNd/Op3+iEviy1scI4=
> > >Return-Path: [EMAIL PROTECTED]
> > >X-OriginalArrivalTime: 09 Dec 2004 01:56:53.0406 (UTC)
> > >FILETIME=[5AF313E0:01C4DD92]
> >
> >
> > >
> > >Help me split chars w/o spaces by 2... like: 2004
> > >How can i make it?
> > >
> > >first: 20
> > >second: 04
> > >
> > >Im working on this..
> > >
> > ># begin code
> > >$year_split = date("Y");
> > >$chars = preg_split('//', $year_split, -1, PREG_SPLIT_NO_EMPTY);
> > ># end code
> > >
> > >But it splits the whole "2004" string..
> > >
> > >Array
> > >(
> > > [0] => 2
> > > [1] => 0
> > > [2] => 0
> > > [3] => 4
> > >)
> > >
> > >
> > >--
> > >Louie Miranda
> > >http://www.axishift.com
> > >
> > >--
> > >PHP General Mailing List (http://www.php.net/)
> > >To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> >
> >
> 
> --
> Louie Miranda
> http://www.axishift.com
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
<<
Jasper Howard - Database Administration
ApexEleven.com
530 559 0107
--->>

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



Re: [PHP] first letter

2004-12-20 Thread ApexEleven
[begin untested code]
$name = 'John';
echo substr($fname,0,1);
[end untested code]

That will print the first letter of the variable $name.

substr(string,int start, int length);

int length is optional.



On Mon, 20 Dec 2004 19:59:49 +0200, Ahmed Abdel-Aliem <[EMAIL PROTECTED]> wrote:
> hi
> if i have for example this variable
> 
> $name = "John";
> 
> how can i echo the first letter only so the result on the browser will be "J"
> 
> can anyone help ?
> 
> --
> Ahmed Abdel-Aliem
> www.ApexScript.com
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
<<
Jasper Howard - Database Administration
ApexEleven.com
530 559 0107
--->>

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



Re: [PHP] Sort by string length...

2004-12-21 Thread ApexEleven
How about iterating though the strings and putting string values and
lengths in an array:

[begin untested code]
$strings = array('i','am','who');
$string_count = array();
foreach ($strings as $string) {
 $string_count['value'][] = $string;
 $string_count['length'][] = strlen($string);
}
array_multisort($string_count['length'],SORT_ASC,SORT_NUMERIC,$string_count['value']);

[/end untested code]

This'll take an array of strings and sort them from shortest to longest.

There may be some other function already made, this was just off the
top of my head.


On Tue, 21 Dec 2004 16:18:52 -0500 (EST), Russell P Jones
<[EMAIL PROTECTED]> wrote:
> Any idea how to sort an array by string length?
> 
> Russ Jones
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
<<
Jasper Howard - Database Administration
ApexEleven.com
530 559 0107
--->>

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