Re: [PHP] checking for duplicate values among five variables

2007-07-07 Thread Kenn Murrah

Thanks, Robert ... that was EXACTLY what I needed.

kennM


Robert Cummings wrote:

On Fri, 2007-07-06 at 23:03 -0400, Robert Cummings wrote:
  

On Fri, 2007-07-06 at 21:51 -0500, Kenn Murrah wrote:

Can anyone help me with a way to determine of two or more variables have 
the same value?  For instance,


$a1 = 1000
$a2 = 2000
$a3 = 2000
$a4 = 4000
$a5 = 5000

I want check these five variables and determine whether, as in this 
case, two or more of the variables  have the same value.


Any suggestions how I can do this?
  

?php

$a1 = 1000;
$a2 = 2000;
$a3 = 2000;
$a4 = 4000;
$a5 = 5000;

$hits = array();
for( $i = 0; $i  5; $i++ )



Should be:

for( $i = 1; $i = 5; $i++ )

  

{
$hits[${'a'.$i}][] = 'a'.$i;
}
 
foreach( $hits as $value = $vars )

{
if( count( $vars )  1 )
{
echo 'Value: '.$value.\n;
print_r( $vars );
}
}

?



Cheers,
Rob.
  


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



[PHP] checking for duplicate values among five variables

2007-07-06 Thread Kenn Murrah
Can anyone help me with a way to determine of two or more variables have 
the same value?  For instance,


$a1 = 1000
$a2 = 2000
$a3 = 2000
$a4 = 4000
$a5 = 5000

I want check these five variables and determine whether, as in this 
case, two or more of the variables  have the same value.


Any suggestions how I can do this?

Thanks in advance.

kenn

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



Re: [PHP] PHP or Bridge (card game)

2007-02-10 Thread Kenn Murrah

pub wrote:

which do you think is harder to learn, PHP or bridge?

Well, PHP *can* be a lot more complicated, but at least it's more or 
less predictable, and I've RARELY had a bridge partner that played the 
game predictably and consistently 


kennM

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



[PHP] elementary question about reading an array ...

2004-04-01 Thread Kenn Murrah
Greetings.

In code that I did not create (and do not entirely understand), an array 
($db) was created which, if displayed with print_r($db), shows the 
following:

Array ( [0] = bc Object ( [fullname] = Kent Huffman [industry] = 
Technology Solutions [url] = /tsi [address1] = 2300 W. Plano Parkway 
[city] = Plano [state] = TX [zip] = 75075 [country] = USA [direct] 
= +1 (972) 577 3890 [email] = [EMAIL PROTECTED] [orderID] = PSC5 
[financialdeptID] = MARCO10 [quantity] = 250 [messagetoprinter] = 
[shippingmethod] = FedEx Express Saver [ship2name] = Kent Huffman 
[ship2address1] = 2300 W. Plano Parkway [ship2address2] = [ship2city] 
= Plano [ship2state] = TX [ship2zip] = 75075 [ship2country] = USA 
[ship2phone] = +1 (972) 577 3890 ) )



My elementary question is:  how do I reference one  item in the array?  
For instance, if I want

$fullname = Kent Huffman

how can I write that statement?  I thought $fullname = $db[0]['fullname' 
would work.  It obviously doesn't, and I've tried a dozen other things, 
including RTFM and several other tutorials, to no avail.

Can someone help?

Thanks.

p.s.  and since I've exposed my ignorance on this subject, can anyone 
point moint me to a good tutorial on the subject of arrays?  I've tried 
to find one that would help, I swear I did, but while I'm beginning to 
understand the assignment of values to an array, the reading of them (as 
in this example) still baffles me ... thanks again for the help.

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


Re: [PHP] elementary question about reading an array ...

2004-04-01 Thread Kenn Murrah

[snip]
In code that I did not create (and do not entirely understand), an array
($db) was created which, if displayed with print_r($db), shows the 
following:

Array ( [0] = bc Object ( [fullname] = Kent Huffman [industry] = 
Technology Solutions [url] = /tsi [address1] = 2300 W. Plano Parkway 
[city] = Plano [state] = TX [zip] = 75075 [country] = USA [direct] 
= +1 (972) 577 3890 [email] = [EMAIL PROTECTED] [orderID] = PSC5 
[financialdeptID] = MARCO10 [quantity] = 250 [messagetoprinter] = 
[shippingmethod] = FedEx Express Saver [ship2name] = Kent Huffman 
[ship2address1] = 2300 W. Plano Parkway [ship2address2] = [ship2city] 
= Plano [ship2state] = TX [ship2zip] = 75075 [ship2country] = USA 
[ship2phone] = +1 (972) 577 3890 ) )

My elementary question is:  how do I reference one  item in the array?  
For instance, if I want

$fullname = Kent Huffman

how can I write that statement?  I thought $fullname = $db[0]['fullname'

would work.  It obviously doesn't, and I've tried a dozen other things, 
including RTFM and several other tutorials, to no avail.
[/snip]

this will display a single element

$fullname =  $db['fullname'];
echo fullname;
you can just
echo $db['fullname'];
That's what I thought at first, but that's not working ... in fact, I 
just copied and pasted both your snippets, and neither of them worked 
here  odd, isn't it?

What the heck am I doing wrong here ?


 

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


Re: [PHP] elementary question about reading an array ...

2004-04-01 Thread Kenn Murrah
You can always count on this list ... the winning answer was

echo $db[0]-fullname  // ah !!!

thanks to everyone who helped me...



Red Wingate wrote:

Yet again maybe one would check the output before replying:

Array (
  [0] = bc Object (
[fullname] = Kent Huffman
...
  )
)
This is what we see:

echo $db['fullname'];  // nope
echo $db[0]-fullname  // ah !!!
 -- red

Kenn Murrah wrote:

[snip]

[snip]
In code that I did not create (and do not entirely understand), an 
array

($db) was created which, if displayed with print_r($db), shows the 
following:

Array ( [0] = bc Object ( [fullname] = Kent Huffman [industry] = 
Technology Solutions [url] = /tsi [address1] = 2300 W. Plano 
Parkway [city] = Plano [state] = TX [zip] = 75075 [country] = 
USA [direct] = +1 (972) 577 3890 [email] = [EMAIL PROTECTED] 
[orderID] = PSC5 [financialdeptID] = MARCO10 [quantity] = 250 
[messagetoprinter] = [shippingmethod] = FedEx Express Saver 
[ship2name] = Kent Huffman [ship2address1] = 2300 W. Plano Parkway 
[ship2address2] = [ship2city] = Plano [ship2state] = TX 
[ship2zip] = 75075 [ship2country] = USA [ship2phone] = +1 (972) 
577 3890 ) )

My elementary question is:  how do I reference one  item in the 
array?  For instance, if I want

$fullname = Kent Huffman

how can I write that statement?  I thought $fullname = 
$db[0]['fullname'

would work.  It obviously doesn't, and I've tried a dozen other 
things, including RTFM and several other tutorials, to no avail.
[/snip]

this will display a single element

$fullname =  $db['fullname'];
echo fullname;
you can just
echo $db['fullname'];
That's what I thought at first, but that's not working ... in fact, I 
just copied and pasted both your snippets, and neither of them worked 
here  odd, isn't it?

What the heck am I doing wrong here ?
[snip]

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


[PHP] extracting data from XML file to PHP variable ..

2004-03-31 Thread Kenn Murrah
Greetings.

I've been RTFM all morning and for the live of me can't figure out how
to relate the element name to its data, e.g. if the element name is
fullname and the data is John Doe' how do I achieve $fullname =
John Doe  I must not be understanding how xml_parse works, and
my searches have turned up nothing.
Any help would be appreciated.

thanks.



function startElement($xml_parser, $name, $attributes) {

print(piEncountered Start Element For: /i$name\n);
}
function endElement($xml_parser, $name) {
print(piEncountered End Element For: i/$name\n);
}
function characterData($xml_parser, $data) {
if ($data != \n) {
$data = ereg_replace (\:, , $data);
print (piEncountered Character Data: /i$data\n);
}
}
function load_data($file) {
$fh = fopen($file, r) or die (pCOULD NOT OPEN FILE!);
$data = fread($fh, filesize($file));
return $data;
}
$xml_parser = xml_parser_create();
xml_set_element_handler ($xml_parser, startElement, endElement);
xml_set_character_data_handler($xml_parser, characterData);
xml_parse($xml_parser, load_data($file)) or die (pERROR PARSING XML!);
xml_parser_free($xml_parser) ;


 Yahoo! Groups Sponsor --

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


Re: [PHP] Re: extracting data from XML file to PHP variable ..

2004-03-31 Thread Kenn Murrah
Jason:

Yes, I am aware of the problem.  However, for the very simple XML files 
that I'm being asked to process, it's not an issue -- each file has, for 
example, one and only one occurrence of fullname  So, while I 
realize that any solution I achieve for this project will have virtually 
no portability to any future project, it would help me out of a terrible 
mind in dealing with today's issue :-)

thanks.

kenn

Jason Barnett wrote:

Kenn Murrah wrote:

Greetings.

I've been RTFM all morning and for the live of me can't figure out how
to relate the element name to its data, e.g. if the element name is
fullname and the data is John Doe' how do I achieve $fullname =
John Doe  I must not be understanding how xml_parse works, and
my searches have turned up nothing.


Perhaps you should consider how you want your data structured.  I'm 
not sure what you're doing exactly, but consider the following file:
root
  people
person
  fullnameJohn Doe/fullname
/person
  /people
  person
fullnameKen Murrah/fullname
  /person
  person
fullnameJason Barnett/fullname
  /person
/root

Do you see the problem?  By assigning the character data to the 
element tag each time, you would end up with $fullname = Jason 
Barnett.  Would you want this to be an array instead to grab all 
fullname tags?

Any help would be appreciated.

thanks.



function startElement($xml_parser, $name, $attributes) {
print(piEncountered Start Element For: /i$name\n);
}
function endElement($xml_parser, $name) {
print(piEncountered End Element For: i/$name\n);
}
function characterData($xml_parser, $data) {
if ($data != \n) {
$data = ereg_replace (\:, , $data);
print (piEncountered Character Data: /i$data\n);
}
}
function load_data($file) {
$fh = fopen($file, r) or die (pCOULD NOT OPEN FILE!);
$data = fread($fh, filesize($file));
return $data;
}
$xml_parser = xml_parser_create();
xml_set_element_handler ($xml_parser, startElement, endElement);
xml_set_character_data_handler($xml_parser, characterData);
xml_parse($xml_parser, load_data($file)) or die (pERROR PARSING 
XML!);
xml_parser_free($xml_parser) ;


If you're trying to keep track of attributes more directly you might 
try using the Dom functions instead.
PHP4: http://www.php.net/domxml
(recommended) PHP5: https://www.zend.com/php5/articles/php5-xmlphp.php

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


[PHP] odd, sporatic upload problem ...

2004-03-05 Thread Kenn Murrah
Greetings.

I have an odd (to me) problem  ... from most computers, the upload code 
(shown, in part, below) works just fine  but from at least one 
computer, if the user uploads a small file (under 1meg), it works 
properly . but if he uploads a larger file he gets either a page not 
found (Internet Explorer) or no data (Netscape) error  other 
users can upload files of any size, with no problem 

Does anyone have any ideas? 

The code (though I'm not at all sure it's relevent) is below:

$customer_trimmed = eregi_replace([^[:alnum:]\.],,$customer) ;
$customer_shortened = substr($customer_trimmed,0,18);
$customer_trimmed = $customer_shortened;
$folder_name = $customer_trimmed . date(mdyHis);
$old_umask = umask();
mkdir('/home/upco/uploads/' . $folder_name, 0777);
//umask($old_umask);
$dest_dir = '/home/upco/uploads/' . $folder_name;

error_reporting(0);

$summary_info = You have successfully uploaded the following 
file(s):br ;
for ($i=0; $icount($_FILES['userFile']['name']); $i++)
{
$new_name = $_FILES['userFile']['name'][$i];
$parsed_name = eregi_replace([^[:alnum:]\.],,$new_name) ;
$dest = $dest_dir . '/' . $parsed_name;
if (!file_exists ($dest)) {
copy($_FILES['userFile']['tmp_name'][$i], $dest) ; 
$changepermissions = chmod($dest, 0777);

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


Re: [PHP] odd, sporatic upload problem ...

2004-03-05 Thread Kenn Murrah
No, it happens immediately upon clicking the submit button on the 
previous page 

Sam Masiello wrote:

How long is it before the Page Not Found error occurs?  Is the browser
possibly timing out?
--Sam

Kenn Murrah wrote:
 

Greetings.

I have an odd (to me) problem  ... from most computers, the upload
code (shown, in part, below) works just fine  but from at least
one 
computer, if the user uploads a small file (under 1meg), it works
properly . but if he uploads a larger file he gets either a page not
found (Internet Explorer) or no data (Netscape) error  other
users can upload files of any size, with no problem 

Does anyone have any ideas?

The code (though I'm not at all sure it's relevent) is below:

$customer_trimmed = eregi_replace([^[:alnum:]\.],,$customer) ;
$customer_shortened = substr($customer_trimmed,0,18);
$customer_trimmed = $customer_shortened; $folder_name =
$customer_trimmed . date(mdyHis);   

$old_umask = umask();
mkdir('/home/upco/uploads/' . $folder_name, 0777);
//umask($old_umask); 

$dest_dir = '/home/upco/uploads/' . $folder_name;

error_reporting(0);

$summary_info = You have successfully uploaded the following
file(s):br ;
for ($i=0; $icount($_FILES['userFile']['name']); $i++)
{
$new_name = $_FILES['userFile']['name'][$i];
$parsed_name = eregi_replace([^[:alnum:]\.],,$new_name) ; $dest =
$dest_dir . '/' . $parsed_name; if (!file_exists ($dest)) {
copy($_FILES['userFile']['tmp_name'][$i], $dest) ; $changepermissions
= chmod($dest, 0777);  
   

 



[PHP] PHP syntax error or javascript mistake?

2003-11-19 Thread Kenn Murrah
Greetings:

I can't decide if my problem is PHP or Javascript, but I've been staring 
at this line of code for too long without being able to see why it's 
behaving the way it is 

I'm trying to open a new window on top of the current window, and it 
does that, but the original (bottom) window changes to read Object 
Window ... I can get back to the original with the Back button but of 
course don't want to ask that of the user ... I simply want a new window 
to appear on top of the original, after which the user can close the top 
window and be back where he started 

what the heck am I doing wrong?

Oh, here's the code:

echo a 
href='javascript:window.open(\$fg_id\,\\,\height=400,width=300,left=80,top=80,scrollbars=1\)';

Thanks VERY much in advance ...

KM

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


[PHP] passing PHP variables to Javascript ...

2003-11-17 Thread Kenn Murrah
Greetings.

I need to be able to pass a PHP variable to a Javascript and can't 
figure out how to do it.  In short, the Javascript win() statement is 
used open a page as defined in PHP -- i.e., $php_name = 
http://www.somewhere.com/something/3.jpg; , a filename that was 
generated dynamically in PHP ... how do I pass that variable to my 
Javascript routine?

(Pardon me if this is more of a Javascript issue than a PHP issue -- I 
couldn't decide where to ask for help first :-)

Thank in advance.

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


[PHP] searching for javascript (or others) that can be used in conjunctionwith PHP for file folder uploads

2003-08-29 Thread Kenn Murrah
Greetings.

(I've seen this subject discussed, but cannot find a solution in the 
archives.)

I have a file upload site to which I need to add code for uploading of 
an entire folder/subdirectory ... I realize this can't be done in PHP 
alone but I'm hoping that a solution (possibly involving Javascript) can 
be found that can be added to my existing PHP solution ... I've seen 
ASP-related sites that can do this, but I can't find a way with PHP ...

Can anyone point me to a javascript (or other) script that I can buy and 
incorporate into my PHP ?

Thanks for the advice.

Kenn

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


[PHP] uploading entire directory, with or without compression ...

2003-04-02 Thread Kenn Murrah
Greetings.

I have a web site which permits my clients to upload a file via php4, and it
works great ... however, some clients have requested that they be able to
upload entire directories from their windows or macintosh computers ... that
is, to select the entire folder rather than doing one file at a time.

Is this possible?

And perhaps related: could a script be contructed to create an archive file
on the client side which, in turn, could be uploaded?  That would achieve
the same effect by allowing the client to create an archive with multiple
files.

I can't really see how that would be possible in PHP, but I'm hoping one of
you much more experienced folks could see a solution.

Thanks in advance.




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



Re: [PHP] uploading entire directory, with or without compression ...

2003-04-02 Thread Kenn Murrah
yes, of course they can ... but i'm looking for a way to automate the
process for them (a method which may not exist) .. i suppose i can give them
the option to upload multiple files using multiple input fields, but I'd
really like to find a way to select an entire folder instead ...


- Original Message -
From: Marek Kilimajer [EMAIL PROTECTED]
To: Kenn Murrah [EMAIL PROTECTED]
Cc: php list [EMAIL PROTECTED]
Sent: Wednesday, April 02, 2003 7:47 AM
Subject: Re: [PHP] uploading entire directory, with or without compression
...


 Your clients can zip the folder, upload the zip file, and then you can
 on the server side use PclZip class to read the content

 Kenn Murrah wrote:

 Greetings.
 
 I have a web site which permits my clients to upload a file via php4, and
it
 works great ... however, some clients have requested that they be able to
 upload entire directories from their windows or macintosh computers ...
that
 is, to select the entire folder rather than doing one file at a time.
 
 Is this possible?
 
 And perhaps related: could a script be contructed to create an archive
file
 on the client side which, in turn, could be uploaded?  That would achieve
 the same effect by allowing the client to create an archive with multiple
 files.
 
 I can't really see how that would be possible in PHP, but I'm hoping one
of
 you much more experienced folks could see a solution.
 
 Thanks in advance.
 
 
 
 
 
 


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




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



Re: [PHP] Is there a PHP for Dummies?

2003-03-28 Thread Kenn Murrah
well, B., i've read a LOT of 'em .. it sort of depends on YOUR background as
to which is best ...

i like Professional PHP Programming from Wrox ... don't bother with
Beginning PHP Programming from Wrox ... it'll probably insult your
intelligence ...

one of the first i ever read, when i was first getting started, was PHP
Essentials by Meloni ... simple, but some GOOD examples to study, and when
you finish, you'll have a decent foundation for more study ..

my current personal favorite is Mastering PHP 4.1 from Sybex ... good
writing style, and it covers (obviously) 4.1, which a LOT of books out don't
do ... so it eliminates THAT frustration ...

HTH

kenM


- Original Message -
From: Beauford.2002 [EMAIL PROTECTED]
To: PHP General [EMAIL PROTECTED]
Sent: Friday, March 28, 2003 3:53 PM
Subject: [PHP] Is there a PHP for Dummies?


 I'm really tired of trying to figure out the PHP manual and need something
 that explains things in plain straight forward English. Like
 get_magic_quotes_gpc() for example - the manual says how to use it and
what
 it returns - but nowhere can I find out what it's for. Does it count
sheep,
 do a quote of the day, or what - maybe I'm just stupid - but in any event
I
 have spent more time in the last two weeks searching for things and
getting
 no answers - Any help in pointing me a good straight forward
tutorial/manual
 would be appreciated.

 B.



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




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



Re: [PHP] Is there a PHP for Dummies?

2003-03-28 Thread Kenn Murrah
oh, and that reminds me ... another O'Reilly title, PHP Cookbook is REALLY
helpful if, like a lot of us, you like to learn from examples ...


- Original Message -
From: Mike [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, March 28, 2003 4:10 PM
Subject: Re: [PHP] Is there a PHP for Dummies?


 Try out Programming PHP by Rasmus Lerdorf from O'Reilly. I got it and
 learned everything from it. Once you've read the book once or twice, you
 can just use the PHP Manual...

 -Michael
 On Fri, 2003-03-28 at 12:53, Beauford.2002 wrote:
  I'm really tired of trying to figure out the PHP manual and need
something
  that explains things in plain straight forward English. Like
  get_magic_quotes_gpc() for example - the manual says how to use it and
what
  it returns - but nowhere can I find out what it's for. Does it count
sheep,
  do a quote of the day, or what - maybe I'm just stupid - but in any
event I
  have spent more time in the last two weeks searching for things and
getting
  no answers - Any help in pointing me a good straight forward
tutorial/manual
  would be appreciated.
 
  B.



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




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



Re: [PHP] Removing columns from a text file

2003-03-27 Thread Kenn Murrah
could you just write a simple awk script to read each line and write out
only the columns you wish to keep?


- Original Message -
From: CPT John W. Holmes [EMAIL PROTECTED]
To: George Pitcher [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: Thursday, March 27, 2003 9:50 AM
Subject: Re: [PHP] Removing columns from a text file


  I have a text file file ready to go into a Filemaker database. It has
over
  5000 rows, each containing over 500 columns.
 
  If I do a straight import I can only pull in the first 442 colums, but
all
  records. I can't take it in via Excel for the same reason - column limit
  stops at 'IV' - never got that far before.
 
  Is there a way to remove columns from the file using php on a fgets()
 basis?
  I can identify which columns I can do without quite easily - certainly
  enough to pare the file down to a reasonable extent.

 You can't just remove columns. You'd have to read in each line, chop off
 the end (however much you want), and re-write it to a separate file. The
 load the second file you just created into Filemaker.

  An alternative would be to create a MySQL Table and drop columns there.

 You could probably use the LOAD DATA INFILE query to do this quickly.

 ---John Holmes...


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




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



[PHP] need help with parsing form input ...

2003-03-11 Thread Kenn Murrah
Greetings.

I'm out of my league here, not knowing enough about regular expressions yet
to do this, so I desperately need someone's help ...

I need to parse form input to eliminate unwanted characters (punctuation,
mostly) ... for instance, if the web site visitor types  smith,susan--33
into the field, i want to parse that line to eliminate the initial space,
the comma, and the dashes so that $myvariable=smithsusan33 

any help in doing this would be GREATLY appreciate.

thanks.



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



[PHP] Re: need help with parsing form input ...

2003-03-11 Thread Kenn Murrah
Thanks ... one more thing:  is there  a way to modify this to allow a period
(dot) to included, as well as the alha and num characters?

once again, thanks.



function make_alphanum($string_val) {
return eregi_replace([^[:alnum:]], , $string_val);
}
strips everything except ALPHA and NUM Chars


Joel


Kenn Murrah [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Greetings.

 I'm out of my league here, not knowing enough about regular expressions
yet
 to do this, so I desperately need someone's help ...

 I need to parse form input to eliminate unwanted characters (punctuation,
 mostly) ... for instance, if the web site visitor types  smith,susan--33
 into the field, i want to parse that line to eliminate the initial space,
 the comma, and the dashes so that $myvariable=smithsusan33 

 any help in doing this would be GREATLY appreciate.

 thanks.





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



[PHP] problem changing max file upload size

2003-03-05 Thread Kenn Murrah
Greetings.

I'm having trouble uploading large files via PHP ... in my php.ini file, i
have the lines:

post_max_size = 100M
upload_max_filesize = 100M

yet I still can't get large files to upload.

What am I doing wrong?

Thanks in advance.




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



[PHP] problems adjusting size of permissable file upload

2003-01-06 Thread Kenn Murrah
Greetings.

My code to upload file is working fine with very small files but not with
larger ones 

Here's what I've tried so far:

1.  I've edited my php.ini file to read: upload_max_filesize = 100M

2.  I've the following line to my html file:
input type=hidden name=MAX_FILE_SIZE value=1 

when i try to upload a file of about 5 megs, it's fine ... if i try about 8
megs, it isn't ...

Can anyone tell me what I'm doing wrong?

p.s. ... how do i determine what version of PHP is running on my server?

Thanks,




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




Re: [PHP] problems adjusting size of permissable file uploadRESOLVED

2003-01-06 Thread Kenn Murrah
that worked ... thanks !!

  - Original Message - 
  From: Adam Voigt 
  To: Kenn Murrah 
  Cc: php list 
  Sent: Monday, January 06, 2003 8:48 AM
  Subject: Re: [PHP] problems adjusting size of permissable file upload


  There's also a max POST size variable in the php.ini, try upping that 
  cause the default is 8 MB if I'm not mistaken. 

  On Mon, 2003-01-06 at 09:46, Kenn Murrah wrote: 
Greetings. 

My code to upload file is working fine with very small files but not with 
larger ones  

Here's what I've tried so far: 

1. I've edited my php.ini file to read: upload_max_filesize = 100M 

2. I've the following line to my html file: 
input type=hidden name=MAX_FILE_SIZE value=1  

when i try to upload a file of about 5 megs, it's fine ... if i try about 8 
megs, it isn't ... 

Can anyone tell me what I'm doing wrong? 

p.s. ... how do i determine what version of PHP is running on my server? 

Thanks, 




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

-- 
Adam Voigt ([EMAIL PROTECTED])
The Cryptocomm Group
My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc
   




[PHP] loading a different web page ...

2003-01-06 Thread Kenn Murrah
i know this is an elementary question, but i can't even figure out what to
search for at php.net 

i need php code that, when executed, takes you to a different web page, i.e.
when browser goes to www.abc.com, he's automatically redirected to
www.xyz.com ...

thanks in advance for the help.



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




[PHP] writing uploaded file to another drive on another network?

2002-12-17 Thread Kenn Murrah
admitting in advance that this may be a REALLY stupid question ..

i've created a page for uploading files using PHP, and it works fine ... is
it possible to write that uploaded file to another drive, on another
network?

for instance, my PHP pages are currently being hosted offsite ... would it
be possible to direct the uploaded pages to a box that's located at the
office? something like 192.168.100.41/home/mydirectory ???

thanks, and feel free to laugh at my question :-)




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




[PHP] controlling ownership on file uploads ...

2002-11-27 Thread Kenn Murrah
Greetings.

I've written a simple form to allow my clients to upload files to me, and it
works fine EXCEPT that the uploaded file is owned by www and I while I can
read the file, I don't have the necessary permissions to delete it when done
...

Since this site is being hosted elsewhere, is there a way I can control
ownership so that I can delete the file?  I've written my ISP/web hoster and
received no response -- usually that's their subtle way of telling me I
should ask the PHP quiestion here :-)

Any and all help would be appreciated.

Thanks,

kenn



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




Re: [PHP] controlling ownership on file uploads ...

2002-11-27 Thread Kenn Murrah
but if i don't have the permissions to do that ... ???


- Original Message -
From: Jason Wong [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, November 27, 2002 11:35 AM
Subject: Re: [PHP] controlling ownership on file uploads ...


 On Thursday 28 November 2002 01:04, Adam Voigt wrote:
  exec(/bin/chown newuser:newuser /path/to/file);

 The user running apache  (in this case 'www') will most likely not have
the
 requisite permissions to perform that operation.

  On Wed, 2002-11-27 at 12:03, Kenn Murrah wrote:
   Greetings.
  
   I've written a simple form to allow my clients to upload files to me,
and
   it works fine EXCEPT that the uploaded file is owned by www and I
while
   I can read the file, I don't have the necessary permissions to delete
it
   when done ...

 Use chmod() to make the file(s) rw by 'others'.

 --
 Jason Wong - Gremlins Associates - www.gremlins.biz
 Open Source Software Systems Integrators
 * Web Design  Hosting * Internet  Intranet Applications Development *

 /*
 Beware of Programmers who carry screwdrivers.
 -- Leonard Brandwein
 */


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





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




[PHP] using .htaccess file to set max upload file size

2002-11-13 Thread Kenn Murrah
greetings.

a couple of years ago, i used a .htaccess file to specify the maximum size for files i 
was uploading via html / php ... for the live of me, i can't find that file, or 
remember exactly how it needed to be written ...

can anyone refresh my memory?

thanks,

kenn





Re: [PHP] using .htaccess file to set max upload file size SOLVED

2002-11-13 Thread Kenn Murrah
Jon:

You are absolutely right (and FYI, the units are bytes) ...

Thanks so much for your help on this topic (as well as a  couple of others
lately, when I neglected to writ to thanks )

kennM
- Original Message -
From: Jon Haworth [EMAIL PROTECTED]
To: 'Kenn Murrah' [EMAIL PROTECTED]; php list
[EMAIL PROTECTED]
Sent: Wednesday, November 13, 2002 11:57 AM
Subject: RE: [PHP] using .htaccess file to set max upload file size


 Hi Kenn,

  a couple of years ago, i used a .htaccess file to specify
  the maximum size for files i was uploading via html / php

 http://www.php.net/manual/en/configuration.changes.php

 Probably something like (untested):

   php_value upload_max_filesize 1024

 I'm not sure what unit the size is assumed to be, though :-)

 Cheers
 Jon

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







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




[PHP] progress bar for use with PHP uploads

2002-11-12 Thread Kenn Murrah
Greetings 

Can anyone point me in the direction of a Javascript code snippet that would display a 
progress bar for a PHP upload?  I'm sure it can be done that way, but honestly, I lack 
the Javascript skills to make it happen   

Any and all help would be appreciated.

Thanks.

Kenn




[PHP] re-installation problem ...

2002-08-09 Thread Kenn Murrah

Greetings.

I've had to reinstall linux/apache/php on my new laptop ... if i browse
http://localhost, i'm told that i'm running
apache-advancedExtranetServer/1.3.20 (mandrake linux/3mdk) mod_ssl/2.8.4
OpenSSL/0.9.6b PHP/4.0.6.

sounded as though i'd successfully recreated my server, yet when i try
to browse my *.php files, i see the code, in its entirety ...

so, what have i done wrong?  how can i fix this mess i've gotten myself
into?

thanks for the help.

kenn






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




Re: [PHP] remembering variables between pages when using forms ...

2001-10-18 Thread Kenn Murrah

didn't want to bother everyone with all the code, but here's a mildly edited
version ...



here's the form:
form name=form1 method=post action=main.php target=_top 
input type=hidden name=city value=?php echo $city; ? 
input type=hidden name=password value=?php echo $password; ? 

?php echo city is  . $city. brpassword is  . $password; ?

  You're authorized ! Click
  input type=submit name=Submit value=HERE
  to continue.
/form


--
here's the framed page called by the form:
html
head
titlePaymentech Print Orders/title
base target=main
/head

frameset rows=85,*

frameset cols=200,*
frame frameborder=0 noresize marginwidth=0 marginheight=0
scrolling=no src=top.html
frame frameborder=0 noresize marginwidth=0 marginheight=0
scrolling=no src=top_right.html bordercolor=#c32933
/frameset

frameset cols=200,*
frame frameborder=0 noresize marginwidth=0 marginheight=0
scrolling=no src=middle_left.php 
frame frameborder=0 noresize marginwidth=20 marginheight=20
src=middle.php name=main 
/frameset

/framesetnoframes
body bgcolor=#FF
/noframes


-

and here's the page within the frame where i'm trying to use the values from
the form above:

?php
echo city is  . $city . brpassword is  . $password;
?
table width=520 border=0 cellspacing=3 cellpadding=5 height=348



thanks again,

ken


- Original Message -
From: Dave Watkinson [EMAIL PROTECTED]
To: baker downloads [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Thursday, October 18, 2001 11:04 AM
Subject: RE: [PHP] remembering variables between pages when using forms ...


where's your code ken?

are you being strict with the case of the variable name?

is the hidden element within the forms tags???




-Original Message-
From: baker downloads [mailto:[EMAIL PROTECTED]]
Sent: 18 October 2001 17:13
To: [EMAIL PROTECTED]
Subject: [PHP] remembering variables between pages when using forms ...


i hope i can make my question understood ...

i've input a value $city in my form, and i can retrieve it on the
following
page (the page which was the action of the form)  ... but then, when i
try
to use a hidden type to move it to my next page (which is a form), i
lose
the value ... i cannot access it from a page within the form ...

does that make sense?  if so, can anyone help?

thanks in advance.

ken




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] hosting

2001-07-26 Thread Kenn Murrah

this DOES sound like a nice one ... but has anyone actually used them?  can
someone give me an idea about realibility for commerical purposes?

Thanks,

KennM


-Original Message-
From: Aniceto Lopez [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 26, 2001 10:43 AM
To: PHP list
Subject: [PHP] hosting


Nice one: http://100megswebhosting.com

- 100 MB of disk space
- 3 GB of bandwidth
- 10 subdomains
- 10 FTP accounts
- control panel
- cgi-bin
- built-in CGI scripts
- PHP 4
- FrontPage extensions
- mySQL
- 10 POP e-mail accounts
- unlimited e-mail forwarding
- unlimited autoresponders
- SSL capable
- shopping cart
- Real Audio/Video
- telnet/SSH
- password protected directories
- raw access logs
- full website statistics
- search engine submission

$10 per month, $55 for 6 months, $100 per year


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] concatentation problems ...

2001-07-19 Thread Kenn Murrah

Greetings.

I've searched the manual and can't find what I need ... PLEASE point me in
the right direction.

I need to concatenate several variables, some of which are text and some of
which are integers ... e.g.

$desired_string = $number . $text . $number2 . $text

where $text and $text2 are strings and $number and $number2 are integers ...

always seems to truncate after first number ...

i know this is elementary, but if someone could point me to the proper
document, i'd really appreciate it.

Thanks,

kenny


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] concatentation problems ...

2001-07-19 Thread Kenn Murrah

never mind ... one lousy missing double quote on the form ... geez


-Original Message-
From: Kenn Murrah [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 19, 2001 3:00 PM
To: [EMAIL PROTECTED]
Subject: [PHP] concatentation problems ...


Greetings.

I've searched the manual and can't find what I need ... PLEASE point me in
the right direction.

I need to concatenate several variables, some of which are text and some of
which are integers ... e.g.

$desired_string = $number . $text . $number2 . $text

where $text and $text2 are strings and $number and $number2 are integers ...

always seems to truncate after first number ...

i know this is elementary, but if someone could point me to the proper
document, i'd really appreciate it.

Thanks,

kenny


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]