RE: [PHP] Upload size limit stays at 8MB

2011-05-05 Thread Ross Hansen

Hey,

There is also an option for post_max_size = xM
x being the number specified.
This should be located in your php.ini file somewhere. check to make sure that 
this is set high enough else it could also be causing the issue.



> To: php-general@lists.php.net
> Date: Thu, 5 May 2011 21:51:26 -0700
> From: ji...@sohnen-moe.com
> Subject: [PHP] Upload size limit stays at 8MB
> 
> Hello,
>   apache v2.2.15 (Linux/SUSE)
>   phpv5.3.3
>   linux  v2.6.34.7-0.7-desktop #1 SMP
> 
>   I updated  to change
> upload_max_filesize = 2M
> to
> upload_max_filesize = 60M.
>   php_info() shows the changed value; "echo
> ini_get(upload_max_filesize)" shows the changed value. Yet when I
> attempt an upload, I get this in the error log:
> 
> PHP Warning:  POST Content-Length of 39246714 bytes exceeds the limit of
> 8388608 bytes in Unknown on line 0, referer: http://www.sma.com/sma/upload/
> 
>   Hmm. "Unknown on line 0"? A bit vague.
>   8MB max seems a bit less than the 60MB listed.
>   Where else could PHP be getting settings info?
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
  

[PHP] Upload size limit stays at 8MB

2011-05-05 Thread James Moe
Hello,
  apache v2.2.15 (Linux/SUSE)
  phpv5.3.3
  linux  v2.6.34.7-0.7-desktop #1 SMP

  I updated  to change
upload_max_filesize = 2M
to
upload_max_filesize = 60M.
  php_info() shows the changed value; "echo
ini_get(upload_max_filesize)" shows the changed value. Yet when I
attempt an upload, I get this in the error log:

PHP Warning:  POST Content-Length of 39246714 bytes exceeds the limit of
8388608 bytes in Unknown on line 0, referer: http://www.sma.com/sma/upload/

  Hmm. "Unknown on line 0"? A bit vague.
  8MB max seems a bit less than the 60MB listed.
  Where else could PHP be getting settings info?


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



[PHP] Re: php-general Digest 5 May 2011 21:55:09 -0000 Issue 7299

2011-05-05 Thread e-letter
Readers,

Looking through the mail lists archives, only the following message
seems to advise about the possibility to use gnuplot:
http://marc.info/?l=php-general&m=96248542218029&w=2

Is it possible to start gnuplot using php, to plot a graph from
postgresql data. For example, a table is created in the required
gnuplot data file format so the command for gnuplot would be something
like:

plot <"SELECT * FROM gnuplotdatatable;"

But can't see a php command to start gnuplot in the first step. Any help please?

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



Re: [PHP] Customize link

2011-05-05 Thread Jim Lucas
On 5/5/2011 3:38 PM, Michael Simiyu wrote:
> Dan,
> 
> thanks for the reply.this is the code that shows/lists the categories
> 

you need to make the following check look at $_GET instead of $_POST.  Or, I
hate to suggest it, you can use $_REQUEST.  It includes $_GET, $_POST, and
others all in one variable.

>  if (isset($_POST['category_'.$c->id])) echo 'checked="checked"';

[snipped]

> 
> i can see the categories ids and i just want to get a custom link for each
> category and essentially hide this section from my memebers
> 
> Thanks
> 
> 
> On May 6, 2011, at 1:28 AM, Daniel Brown wrote:
> 
>> >
>> $cat_ids = array(1,3,5,7,13,15,24,36,81,92);
>>
>> echo ''.PHP_EOL;
>> foreach ($cat_ids as $cid) {
>>
>>echo '  >
>>if (isset($_GET['cat_id']) && $_GET['cat_id'] == $cid) {
>>echo ' selected="selected"';
>>}
>>
>>echo '">'.$cid.''.PHP_EOL;
>> }
>> echo ''.PHP_EOL;
>>
>> ?>
> 
> 


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



Re: [PHP] Customize link

2011-05-05 Thread Michael Simiyu

Dan,

thanks for the reply.this is the code that shows/lists the  
categories


	$cats = $download_taxonomies- 
>get_parent_cats();


if (!empty($cats)) {
foreach ( $cats as $c ) {
	echo 'id="category_'.$c->id.'" ';
		if (isset($_POST['category_'.$c->id])) echo  
'checked="checked"';

echo ' /> 
'.$c->id.' - '.$c->name.'';


// Do Children

if (!function_exists('cat_form_output_children')) {

function cat_form_output_children($child) {

global $download_taxonomies;

if ($child) {
	echo 'type="checkbox" name="category_'.$child->id.'" id="category_'.$child- 
>id.'" ';
	if (isset($_POST['category_'.$child->id])) echo  
'checked="checked"';

   
 echo ' /> '.$child->id.' - '.$child->name.'';



echo '';
		$download_taxonomies- 
>do_something_to_cat_children($child->id, 'cat_form_output_children',  
'cat_form_output_no_children');

  
  echo '';


  
  echo '';

}

}

function cat_form_output_no_children() {

echo '';

}

}

echo '';
			$download_taxonomies->do_something_to_cat_children($c->id,  
'cat_form_output_children', 'cat_form_output_no_children');

echo 
'';

echo 
'';
}
}
?>

i can see the categories ids and i just want to get a custom link for  
each category and essentially hide this section from my memebers


Thanks


On May 6, 2011, at 1:28 AM, Daniel Brown wrote:


'.PHP_EOL;
foreach ($cat_ids as $cid) {

   echo '  '.$cid.''.PHP_EOL;
}
echo ''.PHP_EOL;

?>



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



RE: [PHP] Customize link

2011-05-05 Thread admin

If your options are dynamically created you could check the value passed
against each option are mark the match with "SELECTED";


Example Static:
Echo "5".PHP_EOL;


Example Dynamic

for($a=1, $a <= 15; $a++)
{
Echo " ".$a."".PHP_EOL;
}


Just a though



Richard L. Buskirk

-Original Message-
From: Michael Simiyu [mailto:simiyu.mich...@gmail.com] 
Sent: Thursday, May 05, 2011 6:10 PM
To: php-general@lists.php.net
Subject: [PHP] Customize link

Hello,

Here is the scenario

I have a form with the folloing fields  i. Title  ii. Category (This  
is a drop down with a list of categories which have id's - am using  
wordpress )  iii. upload file field

now what i want to do is to be able to customize a link like
http://www.mysite.com/addfile&cat_id=5 
  so that when i access the link it has one of the categories in the  
drop down selected..reason is i dont want users to see the  
different types of categories

So i guess my question is how to configure a meu item in a drop down  
to be automatically selected in a link...

Thanks

-- 
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] Customize link

2011-05-05 Thread Daniel Brown
On Thu, May 5, 2011 at 18:10, Michael Simiyu  wrote:
>
> So i guess my question is how to configure a meu item in a drop down to be
> automatically selected in a link...

'.PHP_EOL;
foreach ($cat_ids as $cid) {

echo '  '.$cid.''.PHP_EOL;
}
echo ''.PHP_EOL;

?>
-- 

Network Infrastructure Manager
http://www.php.net/

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



[PHP] Customize link

2011-05-05 Thread Michael Simiyu

Hello,

Here is the scenario

I have a form with the folloing fields  i. Title  ii. Category (This  
is a drop down with a list of categories which have id's - am using  
wordpress )  iii. upload file field


now what i want to do is to be able to customize a link like http://www.mysite.com/addfile&cat_id=5 
 so that when i access the link it has one of the categories in the  
drop down selected..reason is i dont want users to see the  
different types of categories


So i guess my question is how to configure a meu item in a drop down  
to be automatically selected in a link...


Thanks

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



[PHP] PHP 5.2.17 zend_mm_panic Called

2011-05-05 Thread Bruce Bailey

Hi

I recently upgraded from PHP 5.2.3 to PHP 5.2.17.

After that, some of my pages keep failing with either Segfaults or calls to 
zend_mm_panic.  My gdb backtrace shows:

(gdb) bt
#0  zend_mm_panic (message=0xb71fbda4 "zend_mm_heap corrupted") at 
/src/php-5.2.17/Zend/zend_alloc.c:92
#1  0xb70a1555 in zend_mm_remove_from_free_list (heap=0x80a61c8, 
mm_block=0x422d97a4) at /src/php-5.2.17/Zend/zend_alloc.c:838
#2  0xb70a0a21 in _zend_mm_free_int (heap=0x80a61c8, p=0x422d9964) at 
/src/php-5.2.17/Zend/zend_alloc.c:1984
#3  0xb70a0f8e in _efree (ptr=0x422d97d4) at 
/src/php-5.2.17/Zend/zend_alloc.c:2311
#4  0xb70a91c9 in free_zend_constant (c=0x82f8398) at 
/src/php-5.2.17/Zend/zend_variables.h:35
#5  0xb70bc4cc in zend_hash_apply_deleter (ht=0x80a6978, p=0x82f8358) at 
/src/php-5.2.17/Zend/zend_hash.c:611
#6  0xb70bc7ba in zend_hash_reverse_apply (ht=0x80a6978, apply_func=0xb70a922c 
)
at /src/php-5.2.17/Zend/zend_hash.c:760
#7  0xb70a9523 in clean_non_persistent_constants () at 
/src/php-5.2.17/Zend/zend_constants.c:162
#8  0xb70aa1a5 in shutdown_executor () at 
/src/php-5.2.17/Zend/zend_execute_API.c:303
#9  0xb70b4a83 in zend_deactivate () at /src/php-5.2.17/Zend/zend.c:860
#10 0xb708102e in php_request_shutdown (dummy=0x0) at 
/src/php-5.2.17/main/main.c:1504
#11 0xb711106e in apache_php_module_main (r=0x828ce5c, display_source_mode=0) 
at /src/php-5.2.17/sapi/apache/sapi_apache.c:59
#12 0xb7111a5b in send_php (r=0x828ce5c, display_source_mode=0, filename=0x0) 
at /src/php-5.2.17/sapi/apache/mod_php5.c:666
#13 0xb7111b67 in send_parsed_php (r=0x828ce5c) at 
/src/php-5.2.17/sapi/apache/mod_php5.c:681
#14 0x08054aa4 in ap_invoke_handler ()
#15 0x0806a2db in process_request_internal ()
#16 0x0806a737 in ap_internal_redirect ()
#17 0x400a071f in mod_gzip_redir1_handler () from 
/adp/home/www_serv/libexec/mod_gzip.so
#18 0x4009eb06 in mod_gzip_handler () from 
/adp/home/www_serv/libexec/mod_gzip.so
#19 0x08054aa4 in ap_invoke_handler ()
#20 0x0806a2db in process_request_internal ()
#21 0x0806a33a in ap_process_request ()
#22 0x0806109c in child_main ()
#23 0x08061322 in make_child ()
#24 0x08061661 in perform_idle_server_maintenance ()
#25 0x08061c9a in standalone_main ()
#26 0x080622ba in main ()

Has anyone seen this before?  Any assistance would be greatly appreciated.

Thanks in advance,

Bruce
  

Re: [PHP] filter_var using regex

2011-05-05 Thread Ashley Sheridan
On Thu, 2011-05-05 at 13:39 -0600, Jason Gerfen wrote:

> On 05/04/2011 03:10 PM, Ashley Sheridan wrote:
> > On Wed, 2011-05-04 at 13:46 -0600, Jason Gerfen wrote:
> > 
> >> On 05/04/2011 01:27 PM, Ashley Sheridan wrote:
> >>> On Wed, 2011-05-04 at 13:20 -0600, Jason Gerfen wrote:
> >>>
>  I am running into a problem using the REGEXP option with filter_var().
> 
>  The string I am using: 09VolunteerApplication.doc
>  The PCRE regex I am using:
>  /^[a-z0-9]\.[doc|pdf|txt|jpg|jpeg|png|docx|csv|xls]{1,4}$/Di
> 
>  The function in it's entirety:
>  return (!filter_var('09VolunteerApplication.doc',
>  FILTER_VALIDATE_REGEXP,
>  array('options'=>array('regexp'=>'/^[a-z0-9]\.[doc|pdf|txt|jpg|jpeg|png|docx|csv|xls]{1,4}$/Di'
>  ? false : true;
> 
>  Anyone have any insight into this?
> 
> >>>
> >>>
> >>> You missed a + in your regex, at the moment you're only checking to see
> >>> if a file starts with a single a-z or number and then is followed by the
> >>> period. Then you're checking for oddly for one to four extensions in the
> >>> list, are you sure you want to do that? And the square brackets are used
> >>> to match characters, not strings, use the standard brackets to allow
> >>> from a choice of strings
> >>>
> >>> Try this:
> >>>
> >>> '/^[a-z0-9]+\.(doc|pdf|txt|jpg|jpeg|png|docx|csv|xls)$/Di'
> >>>
> >>> One other thing you should be aware of maybe, filenames won't always
> >>> consist of just the letters a-z and numbers 0-9, they may contain
> >>> accented or foreign letters, hyphens, spaces and a number of other
> >>> characters depending on the client machines OS. Windows allows very few
> >>> characters for example compared to the Unix-like OS's like MacOS and
> >>> Linux.
> >>>
> >>
> >> Both are valid PCRE regex's. However the rules regarding usage of
> >> parenthesis for an XOR string does not explain a similar regex being
> >> used with the filter_var() like so:
> >>
> >> return (filter_var('kc-1', FILTER_VALIDATE_REGEXP,
> >> array('options'=>array('regexp'=>'/^[kc\-1|kc\-color|gr\-1|fa\-1|un\-1|un\-color|ben\-1|bencolor|sage\-1|sr\-1|st\-1]{1,8}$/Di')))
> >> ? true : false;
> >>
> >> The above returns string(4) "kc-1"
> >>
> >> Another test using the following works similarly:
> >>
> >> return (filter_var('u0368839', FILTER_VALIDATE_REGEXP,
> >> array('options'=>array('regexp'=>'/^[gp|u|gx]{1,2}[\d+]{6,15}$/Di'))) ?
> >> true : false;
> >>
> >> The above returns string(8) "u0368839"
> >>
> >> And
> >> return (filter_var('u0368839', FILTER_VALIDATE_REGEXP,
> >> array('options'=>array('regexp'=>'/^[gp|u|gx]{1,2}[\d+]{6,15}$/Di'))) ?
> >> true : false;
> >>
> >> returns string(8) "gp123456"
> >>
> >> As you can see these three examples use the start [] as XOR conditionals
> >> for multiple strings as prefixes.
> >>
> >>
> >>
> > 
> > 
> > Not quite, you think they match correctly because that's all you're
> > testing for, and you're not looking for anything that might disprove
> > that. Using your last example, it will also match these strings:
> > 
> > gu0368839
> > xx0368839
> > p0368839
> > 
> > 
> > I tested your first regex with '09VolunteerApplication.doc' and it
> > doesn't work at all until you add in that plus after the basename match
> > part of the regex:
> > 
> > ^[a-z0-9]+\.[doc|pdf|txt|jpg|jpeg|png|docx|csv|xls]{1,4}$
> > 
> > However, your regex (with the plus) also matches these strings:
> > 
> > 09VolunteerApplication.docp
> > 09VolunteerApplication.docj
> > 09VolunteerApplication.doc|<-- note it's matching the literal bar
> > character
> > 
> > Making the changes I suggested (^[a-z0-9]+\.(doc|pdf|txt|jpg|jpeg|png|
> > docx|csv|xls)$) means the regex works as you expect. Square brackets in
> > a regex match a range, not a literal string, and without any sort of
> > modifier, match only a single instance of that range. So in your
> > example, you're matching a 4 character extension containing any of the
> > following characters '|cdfgjlnopstx', and a basename containing only 1
> > character that is either an a-z or a number.
> > 
> 
> You are right, after a few other tests I stand corrected. My apologies.
> However according to the documentation for filter_var() and the PCRE
> regexp option if it returns false, which it is, this is indicating an
> error with the regex.
> 
> In addition to this I would like to point out that the same regex using
> the older preg_match() function works as it should while the character
> class following by the pattern (+) fails the validation portion of the
> regex.
> 
> print_r(var_dump(filter_var('09VolunteerApplication.doc',
> FILTER_VALIDATE_REGEXP,
> array('options'=>array('regexp'=>'/^[a-z0-9]+\.(doc|pdf|txt|jpg|jpeg|png|docx|csv|xls){1,4}$/Di');
> 
> returns false (invalid regex) when using the character matching class
> [a-z0-9]+ with the filter_var() function with the FILTER_VALIDATE_REGEXP
> option
> 
> print_r(var_dump(preg_match('/^[a-z0-9]+\.(doc|pdf|txt|jpg|jpeg|png|doc

Re: [PHP] Re: iPhone apology - was Re: [PHP] Re: Installing on a Mac: include_path issues

2011-05-05 Thread Richard Quadling
On 5 May 2011 17:46, Jason Pruim  wrote:
>
>
> Jason Pruim
>
> On May 5, 2011, at 12:29 PM, Ken Kixmoeller  wrote:
>
>> On Thu, May 5, 2011 at 9:52 AM, Richard Quadling  wrote:
>>> On 5 May 2011 15:08, Mike Mackintosh  
>>> wrote:
 Sent from my iPhone
>>>
>>> Why do all iPhone users apologize for sending mail from their iPhone?
>>
>> 1. Apparently, iphone software top-posts replies. For some people,
>> that alone constitutes a federal (if not intergalactic) crime.
>
> Very true...
>
>>
>> 2. This signature addition seems to have started with the Blackberry.
>> Some people got upset with concise replies (like "fine") thinking them
>> to be snippy, when they were due to limited typing capabilities.
>
> The signature can be set/moved on the iPhone depending on where you want it.
>>
>> 3. Advertising for Apple.
>
> Like they need more? Hehe
>
> Btw... Sent this from my iPhone :)
>
>>
>

When I read it, it just looks like an apology. I'm imagining some
bowing and scraping fool desperately begging for forgiveness. Imagine
a cross between John Merrick and Quasimodo, with a big dollop of Igor
thrown in.

"Please forgive me master, I can only top post and tell the world I'm
a ba, b, b!"


-- 
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY

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



Re: [PHP] filter_var using regex

2011-05-05 Thread Jason Gerfen
On 05/04/2011 03:10 PM, Ashley Sheridan wrote:
> On Wed, 2011-05-04 at 13:46 -0600, Jason Gerfen wrote:
> 
>> On 05/04/2011 01:27 PM, Ashley Sheridan wrote:
>>> On Wed, 2011-05-04 at 13:20 -0600, Jason Gerfen wrote:
>>>
 I am running into a problem using the REGEXP option with filter_var().

 The string I am using: 09VolunteerApplication.doc
 The PCRE regex I am using:
 /^[a-z0-9]\.[doc|pdf|txt|jpg|jpeg|png|docx|csv|xls]{1,4}$/Di

 The function in it's entirety:
 return (!filter_var('09VolunteerApplication.doc',
 FILTER_VALIDATE_REGEXP,
 array('options'=>array('regexp'=>'/^[a-z0-9]\.[doc|pdf|txt|jpg|jpeg|png|docx|csv|xls]{1,4}$/Di'
 ? false : true;

 Anyone have any insight into this?

>>>
>>>
>>> You missed a + in your regex, at the moment you're only checking to see
>>> if a file starts with a single a-z or number and then is followed by the
>>> period. Then you're checking for oddly for one to four extensions in the
>>> list, are you sure you want to do that? And the square brackets are used
>>> to match characters, not strings, use the standard brackets to allow
>>> from a choice of strings
>>>
>>> Try this:
>>>
>>> '/^[a-z0-9]+\.(doc|pdf|txt|jpg|jpeg|png|docx|csv|xls)$/Di'
>>>
>>> One other thing you should be aware of maybe, filenames won't always
>>> consist of just the letters a-z and numbers 0-9, they may contain
>>> accented or foreign letters, hyphens, spaces and a number of other
>>> characters depending on the client machines OS. Windows allows very few
>>> characters for example compared to the Unix-like OS's like MacOS and
>>> Linux.
>>>
>>
>> Both are valid PCRE regex's. However the rules regarding usage of
>> parenthesis for an XOR string does not explain a similar regex being
>> used with the filter_var() like so:
>>
>> return (filter_var('kc-1', FILTER_VALIDATE_REGEXP,
>> array('options'=>array('regexp'=>'/^[kc\-1|kc\-color|gr\-1|fa\-1|un\-1|un\-color|ben\-1|bencolor|sage\-1|sr\-1|st\-1]{1,8}$/Di')))
>> ? true : false;
>>
>> The above returns string(4) "kc-1"
>>
>> Another test using the following works similarly:
>>
>> return (filter_var('u0368839', FILTER_VALIDATE_REGEXP,
>> array('options'=>array('regexp'=>'/^[gp|u|gx]{1,2}[\d+]{6,15}$/Di'))) ?
>> true : false;
>>
>> The above returns string(8) "u0368839"
>>
>> And
>> return (filter_var('u0368839', FILTER_VALIDATE_REGEXP,
>> array('options'=>array('regexp'=>'/^[gp|u|gx]{1,2}[\d+]{6,15}$/Di'))) ?
>> true : false;
>>
>> returns string(8) "gp123456"
>>
>> As you can see these three examples use the start [] as XOR conditionals
>> for multiple strings as prefixes.
>>
>>
>>
> 
> 
> Not quite, you think they match correctly because that's all you're
> testing for, and you're not looking for anything that might disprove
> that. Using your last example, it will also match these strings:
> 
> gu0368839
> xx0368839
> p0368839
> 
> 
> I tested your first regex with '09VolunteerApplication.doc' and it
> doesn't work at all until you add in that plus after the basename match
> part of the regex:
> 
> ^[a-z0-9]+\.[doc|pdf|txt|jpg|jpeg|png|docx|csv|xls]{1,4}$
> 
> However, your regex (with the plus) also matches these strings:
> 
> 09VolunteerApplication.docp
> 09VolunteerApplication.docj
> 09VolunteerApplication.doc|<-- note it's matching the literal bar
> character
> 
> Making the changes I suggested (^[a-z0-9]+\.(doc|pdf|txt|jpg|jpeg|png|
> docx|csv|xls)$) means the regex works as you expect. Square brackets in
> a regex match a range, not a literal string, and without any sort of
> modifier, match only a single instance of that range. So in your
> example, you're matching a 4 character extension containing any of the
> following characters '|cdfgjlnopstx', and a basename containing only 1
> character that is either an a-z or a number.
> 

You are right, after a few other tests I stand corrected. My apologies.
However according to the documentation for filter_var() and the PCRE
regexp option if it returns false, which it is, this is indicating an
error with the regex.

In addition to this I would like to point out that the same regex using
the older preg_match() function works as it should while the character
class following by the pattern (+) fails the validation portion of the
regex.

print_r(var_dump(filter_var('09VolunteerApplication.doc',
FILTER_VALIDATE_REGEXP,
array('options'=>array('regexp'=>'/^[a-z0-9]+\.(doc|pdf|txt|jpg|jpeg|png|docx|csv|xls){1,4}$/Di');

returns false (invalid regex) when using the character matching class
[a-z0-9]+ with the filter_var() function with the FILTER_VALIDATE_REGEXP
option

print_r(var_dump(preg_match('/^[a-z0-9]+\.(doc|pdf|txt|jpg|jpeg|png|docx|csv|xls){1,4}$/i',
'09VolunteerApplication.doc')));

return int(1) indicating a valid regex as well as a valid match.

I believe this should be reported as a bug but I appreciate your
assistance and insights.


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

Re: [PHP] Re: Installing on a Mac: include_path issues

2011-05-05 Thread Ken Kixmoeller
On Thu, May 5, 2011 at 9:08 AM, Mike Mackintosh
 wrote:
> What are the permissions on the include directory?
> --

Well, I swear that I had set the permissions to r/w for these
directories, but after I did it (again?), now I get a whole *new* set
of errors which seem to be about connecting to MySQL.

So, pending further investigation, it seems like *this* problem is solved.

Many, many thanks to all who responded.

Ken

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



Re: [PHP] Re: iPhone apology - was Re: [PHP] Re: Installing on a Mac: include_path issues

2011-05-05 Thread Jason Pruim


Jason Pruim

On May 5, 2011, at 12:29 PM, Ken Kixmoeller  wrote:

> On Thu, May 5, 2011 at 9:52 AM, Richard Quadling  wrote:
>> On 5 May 2011 15:08, Mike Mackintosh  wrote:
>>> Sent from my iPhone
>> 
>> Why do all iPhone users apologize for sending mail from their iPhone?
> 
> 1. Apparently, iphone software top-posts replies. For some people,
> that alone constitutes a federal (if not intergalactic) crime.

Very true...

> 
> 2. This signature addition seems to have started with the Blackberry.
> Some people got upset with concise replies (like "fine") thinking them
> to be snippy, when they were due to limited typing capabilities.

The signature can be set/moved on the iPhone depending on where you want it. 
> 
> 3. Advertising for Apple.

Like they need more? Hehe

Btw... Sent this from my iPhone :)

> 

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



[PHP] Re: iPhone apology - was Re: [PHP] Re: Installing on a Mac: include_path issues

2011-05-05 Thread Ken Kixmoeller
On Thu, May 5, 2011 at 9:52 AM, Richard Quadling  wrote:
> On 5 May 2011 15:08, Mike Mackintosh  wrote:
>> Sent from my iPhone
>
> Why do all iPhone users apologize for sending mail from their iPhone?

1. Apparently, iphone software top-posts replies. For some people,
that alone constitutes a federal (if not intergalactic) crime.

2. This signature addition seems to have started with the Blackberry.
Some people got upset with concise replies (like "fine") thinking them
to be snippy, when they were due to limited typing capabilities.

3. Advertising for Apple.

Ken

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



[PHP] iPhone apology - was Re: [PHP] Re: Installing on a Mac: include_path issues

2011-05-05 Thread Richard Quadling
On 5 May 2011 15:08, Mike Mackintosh  wrote:
> Sent from my iPhone

Why do all iPhone users apologies for sending mail from their iPhone.

It's like someone saying "Sorry, I've only got IE6".

-- 
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY

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



Re: [PHP] mysql error

2011-05-05 Thread Daniel Brown
On Thu, May 5, 2011 at 10:29, Grega Leskovšek  wrote:
> Can smbd please look  at this sentence - I got an error and do not
> know how to fix it - I am still very unfamiliar with MYSQL:
>
> CREATE TABLE log (  idlog int auto_increment not null,  imepriimek
> varchar(50),  clock timestamp,  action varchar(30),  onfile
> varchar(100), filesize float(6,2), uniqueid(idlog) );
>
> ERROR 1064 (42000): You have an error in your SQL syntax; check the
> manual that corresponds to your MySQL server version for the right
> syntax to use near '(idlog) )' at line 1

This is by no means a PHP question, and should not be asked on the
PHP General mailing list.  Please ask questions in the appropriate
place; for this, the MySQL General list is the correct forum, and
they've been CC'd.  In the future, if it relates to a PHP database
issue, you may want to use the PHP Database mailing list, also CC'd.
This not only means you'll get more on-target help faster, but also
helps in archiving data in the proper location for future searchers.

-- 

Network Infrastructure Manager
http://www.php.net/

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



Re: [PHP] mysql error

2011-05-05 Thread Andre Polykanine
Hello Grega,

What do you mean by uniqueid(idlog)?

-- 
With best regards from Ukraine,
Andre
Skype: Francophile
My blog: http://oire.org/menelion (mostly in Russian)
Twitter: http://twitter.com/m_elensule
Facebook: http://facebook.com/menelion

 Original message 
From: Grega Leskovšek 
To: php-general
Date created: , 5:29:44 PM
Subject: [PHP] mysql error


  Can smbd please look  at this sentence - I got an error and do not
know how to fix it - I am still very unfamiliar with MYSQL:

CREATE TABLE log (  idlog int auto_increment not null,  imepriimek
varchar(50),  clock timestamp,  action varchar(30),  onfile
varchar(100), filesize float(6,2), uniqueid(idlog) );

ERROR 1064 (42000): You have an error in your SQL syntax; check the
manual that corresponds to your MySQL server version for the right
syntax to use near '(idlog) )' at line 1

-- When the sun rises I receive and when it sets I forgive ->
http://moj.skavt.net/gleskovs/
Always in Heart, Grega Leskovšek

-- 
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] mysql error

2011-05-05 Thread Grega Leskovšek
Can smbd please look  at this sentence - I got an error and do not
know how to fix it - I am still very unfamiliar with MYSQL:

CREATE TABLE log (  idlog int auto_increment not null,  imepriimek
varchar(50),  clock timestamp,  action varchar(30),  onfile
varchar(100), filesize float(6,2), uniqueid(idlog) );

ERROR 1064 (42000): You have an error in your SQL syntax; check the
manual that corresponds to your MySQL server version for the right
syntax to use near '(idlog) )' at line 1

-- When the sun rises I receive and when it sets I forgive ->
http://moj.skavt.net/gleskovs/
Always in Heart, Grega Leskovšek

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



Re: [PHP] Re: Installing on a Mac: include_path issues

2011-05-05 Thread Mike Mackintosh
What are the permissions on the include directory?

Sent from my iPhone

On May 5, 2011, at 9:42, Ken Kixmoeller  wrote:

> On Thu, May 5, 2011 at 5:59 AM, Mike Mackintosh
>  wrote:
>> Run phpinfo() or php -I and see if the PHP.ini file is being loaded.
> 
> php.ini shows the include_path correctly, as:
>   
> /Users/ken/Documents/Clients/comped_php:/Users/ken/Documents/Clients/jaguar_php
> 
> Oops, that line was supposed to say "phpinfo() shows the include_path
> correctly." Sorry for the confusion. phpinfo() runs just fine and
> shows me what I expected.
> 
> Ken
> 
> -- 
> 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] filter_var using regex

2011-05-05 Thread Jason Gerfen
On 05/04/2011 03:10 PM, Ashley Sheridan wrote:
> On Wed, 2011-05-04 at 13:46 -0600, Jason Gerfen wrote:
> 
>> On 05/04/2011 01:27 PM, Ashley Sheridan wrote:
>>> On Wed, 2011-05-04 at 13:20 -0600, Jason Gerfen wrote:
>>>
 I am running into a problem using the REGEXP option with filter_var().

 The string I am using: 09VolunteerApplication.doc
 The PCRE regex I am using:
 /^[a-z0-9]\.[doc|pdf|txt|jpg|jpeg|png|docx|csv|xls]{1,4}$/Di

 The function in it's entirety:
 return (!filter_var('09VolunteerApplication.doc',
 FILTER_VALIDATE_REGEXP,
 array('options'=>array('regexp'=>'/^[a-z0-9]\.[doc|pdf|txt|jpg|jpeg|png|docx|csv|xls]{1,4}$/Di'
 ? false : true;

 Anyone have any insight into this?

>>>
>>>
>>> You missed a + in your regex, at the moment you're only checking to see
>>> if a file starts with a single a-z or number and then is followed by the
>>> period. Then you're checking for oddly for one to four extensions in the
>>> list, are you sure you want to do that? And the square brackets are used
>>> to match characters, not strings, use the standard brackets to allow
>>> from a choice of strings
>>>
>>> Try this:
>>>
>>> '/^[a-z0-9]+\.(doc|pdf|txt|jpg|jpeg|png|docx|csv|xls)$/Di'
>>>
>>> One other thing you should be aware of maybe, filenames won't always
>>> consist of just the letters a-z and numbers 0-9, they may contain
>>> accented or foreign letters, hyphens, spaces and a number of other
>>> characters depending on the client machines OS. Windows allows very few
>>> characters for example compared to the Unix-like OS's like MacOS and
>>> Linux.
>>>
>>
>> Both are valid PCRE regex's. However the rules regarding usage of
>> parenthesis for an XOR string does not explain a similar regex being
>> used with the filter_var() like so:
>>
>> return (filter_var('kc-1', FILTER_VALIDATE_REGEXP,
>> array('options'=>array('regexp'=>'/^[kc\-1|kc\-color|gr\-1|fa\-1|un\-1|un\-color|ben\-1|bencolor|sage\-1|sr\-1|st\-1]{1,8}$/Di')))
>> ? true : false;
>>
>> The above returns string(4) "kc-1"
>>
>> Another test using the following works similarly:
>>
>> return (filter_var('u0368839', FILTER_VALIDATE_REGEXP,
>> array('options'=>array('regexp'=>'/^[gp|u|gx]{1,2}[\d+]{6,15}$/Di'))) ?
>> true : false;
>>
>> The above returns string(8) "u0368839"
>>
>> And
>> return (filter_var('u0368839', FILTER_VALIDATE_REGEXP,
>> array('options'=>array('regexp'=>'/^[gp|u|gx]{1,2}[\d+]{6,15}$/Di'))) ?
>> true : false;
>>
>> returns string(8) "gp123456"
>>
>> As you can see these three examples use the start [] as XOR conditionals
>> for multiple strings as prefixes.
>>
>>
>>
> 
> 
> Not quite, you think they match correctly because that's all you're
> testing for, and you're not looking for anything that might disprove
> that. Using your last example, it will also match these strings:
> 
> gu0368839
> xx0368839
> p0368839
> 
> 
> I tested your first regex with '09VolunteerApplication.doc' and it
> doesn't work at all until you add in that plus after the basename match
> part of the regex:
> 
> ^[a-z0-9]+\.[doc|pdf|txt|jpg|jpeg|png|docx|csv|xls]{1,4}$
> 
> However, your regex (with the plus) also matches these strings:
> 
> 09VolunteerApplication.docp
> 09VolunteerApplication.docj
> 09VolunteerApplication.doc|<-- note it's matching the literal bar
> character
> 
> Making the changes I suggested (^[a-z0-9]+\.(doc|pdf|txt|jpg|jpeg|png|
> docx|csv|xls)$) means the regex works as you expect. Square brackets in
> a regex match a range, not a literal string, and without any sort of
> modifier, match only a single instance of that range. So in your
> example, you're matching a 4 character extension containing any of the
> following characters '|cdfgjlnopstx', and a basename containing only 1
> character that is either an a-z or a number.
> 

You are right, after a few other tests I stand corrected. My apologies.
However according to the documentation for filter_var() and the PCRE
regexp option if it returns false, which it is, this is indicating an
error with the regex.

Here are the changes I have made:
print_r(var_dump(filter_var('09VolunteerApplication.doc',
FILTER_VALIDATE_REGEXP,
array('options'=>array('regexp'=>'/^[a-z0-9]+\.(doc|pdf|txt|jpg|jpeg|png|docx|csv|xls){1,4}$/Di');

I appreciate your assistance and insights.

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



Re: [PHP] Re: Installing on a Mac: include_path issues

2011-05-05 Thread Ken Kixmoeller
On Thu, May 5, 2011 at 5:59 AM, Mike Mackintosh
 wrote:
> Run phpinfo() or php -I and see if the PHP.ini file is being loaded.

 php.ini shows the include_path correctly, as:
   
 /Users/ken/Documents/Clients/comped_php:/Users/ken/Documents/Clients/jaguar_php

Oops, that line was supposed to say "phpinfo() shows the include_path
correctly." Sorry for the confusion. phpinfo() runs just fine and
shows me what I expected.

Ken

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



Re: [PHP] Re: Installing on a Mac: include_path issues

2011-05-05 Thread Ken Kixmoeller
On Wed, May 4, 2011 at 11:51 PM, David Robley  wrote:
>> php.ini shows the include_path correctly, as:
> If I remember correctly, include and friends have two parts to the error
> message but you've only shown us one. For a guess, is it possible the
> apache process doesn't have permissions for those directories and/or the
> files within them?

Yes, it ia  two-parter. I showed the second. The first is:

Warning: include_once(smm_header.php) [function.include-once]: failed
to open stream: No such file or directory in
/Users/ken/Sites/smm_registration/smmcomputereducation.php on line 1

I am checking out the "rights" issue --- sounds like a great lead. Thank you.

Ken

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



Re: [PHP] Re: Installing on a Mac: include_path issues

2011-05-05 Thread Ken Kixmoeller
On Thu, May 5, 2011 at 4:40 AM, Richard Quadling  wrote:
> On 5 May 2011 05:51, David Robley  wrote:
>> Ken Kixmoeller wrote:
>>
> include_path should only contain directories, not filenames. [1]

Thanks. Yes, both of those are directories.

Ken

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



Re: [PHP] Closing Session (Revisited)

2011-05-05 Thread Steve Staples
On Thu, 2011-05-05 at 21:41 +1000, Roger Riordan wrote:
> On Thu, 31 Mar 2011 16:40:06 -0400, eth...@earthlink.net (Ethan Rosenberg) 
> wrote:
> ...
> >> > > Can you rephrase the question, Ethan, or give more details?  From
> >> > >the way it sounds, you're concerned that destroying a session will
> >> > >have implications for other sessions as well, which is not the case
> >> > >(unless all sessions are shared).  For example, if you have Chrome,
> >> > >Firefox, and Internet Exploder all active, the sessions should be
> >> > >different, if even from the very same computer.  However, multiple
> >> > >tabs in the same browser will generally be the same session (unless
> >> > >it's something like Chrome's Incognito feature).
> ...
> 
> I have developed a common engine which I use for several different websites. 
> I had been
> using PHP 5.2.? and IE6 (yes; I know!), and had been able to have multiple 
> sessions open
> at once, displaying the same or different websites, without them interfering 
> with each
> other. This was incredibly useful; I could be looking at, or even edit, 
> different parts of
> the same, or different, websites simultaneously without any problems.
> 
> But I recently had a hard disk crash and had to re-install all the system 
> software. Now I
> have PHP 5.3 and IE 8, and find that if I try to do this the various sessions 
> interfere
> with each other. From the above comment I gather that this is because IE 8 
> combines all
> the instances, whereas previously each instance was treated as a different 
> user.
> 
> Is there any simple way to make IE 8 treat each instance as a new user, or 
> should I switch
> to Chrome and use the Incognito feature?
> 
> Roger Riordan AM
> http://www.corybas.com/
> 

The Incognito feature wont give you the results you're looking for.
>From my experience, the incognito window(s) and tab(s) share the same
memory/cookie/session space, which is different from the main window...
which means you will run into the same issue.

Once you close all your incognito windows/tabs, you will release those
cookies/sessions/memory space and if you open a new one afterwards, then
you will be fine, but if one tabs stays open, no go :(

Have you looked at the http://ca3.php.net/session_name function, and
putting that into your site just after your session_start() ?  I believe
that will fix your issues (as long as your session names are unique),
but i am not 100% sure.

Steve



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



Re: [PHP] Closing Session (Revisited)

2011-05-05 Thread Roger Riordan
On Thu, 31 Mar 2011 16:40:06 -0400, eth...@earthlink.net (Ethan Rosenberg) 
wrote:
...
>> > > Can you rephrase the question, Ethan, or give more details?  From
>> > >the way it sounds, you're concerned that destroying a session will
>> > >have implications for other sessions as well, which is not the case
>> > >(unless all sessions are shared).  For example, if you have Chrome,
>> > >Firefox, and Internet Exploder all active, the sessions should be
>> > >different, if even from the very same computer.  However, multiple
>> > >tabs in the same browser will generally be the same session (unless
>> > >it's something like Chrome's Incognito feature).
...

I have developed a common engine which I use for several different websites. I 
had been
using PHP 5.2.? and IE6 (yes; I know!), and had been able to have multiple 
sessions open
at once, displaying the same or different websites, without them interfering 
with each
other. This was incredibly useful; I could be looking at, or even edit, 
different parts of
the same, or different, websites simultaneously without any problems.

But I recently had a hard disk crash and had to re-install all the system 
software. Now I
have PHP 5.3 and IE 8, and find that if I try to do this the various sessions 
interfere
with each other. From the above comment I gather that this is because IE 8 
combines all
the instances, whereas previously each instance was treated as a different user.

Is there any simple way to make IE 8 treat each instance as a new user, or 
should I switch
to Chrome and use the Incognito feature?

Roger Riordan AM
http://www.corybas.com/

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



Re: [PHP] Re: Installing on a Mac: include_path issues

2011-05-05 Thread Mike Mackintosh
Run phpinfo() or php -I and see if the PHP.ini file is being loaded.

Sent from my iPhone

On May 5, 2011, at 5:40, Richard Quadling  wrote:

> On 5 May 2011 05:51, David Robley  wrote:
>> Ken Kixmoeller wrote:
>> 
>>> Hey, folks -- --
>>> 
>>> I am switching over my development (I hope) to a Mac. Having some
>>> trouble with the configuration. Rudimentary scripts run fine in the
>>> document_root, but beyond that, my scripts in the include_path are not
>>> found.
>>> 
>>> The include_path has a couple of directories in which I have my
>>> foundation classes and a clients application classes and other
>>> programs. For various reasons, I put them into my "Documents/Clients"
>>> folder. When I create to set the path to these files in PHP, they are:
>>> 
>>>  /Users/ken/Documents/Clients/comped_php
>>>  /Users/ken/Documents/Clients/jaguar_php
>>> 
>>> PHP doesn't find them, which has me stumped.
>>> 
>>> php.ini shows the include_path correctly, as:
>>>   
>>> /Users/ken/Documents/Clients/comped_php:/Users/ken/Documents/Clients/jaguar_php
>>> 
>>> the document_root, configured in Apache is: /Users/ken/Sites/
>>> 
>>> The errors show as:
>>> include_once() [function.include]: Failed opening 'smm_header.php' for
>>> inclusion
>>> 
>> (include_path='/Users/ken/Documents/Clients/comped_php:/Users/ken/Documents/Clients/jaguar_php')
>>> in /Users/ken/Sites/smm_registration/smmcomputereducation.php on line 1
>>> 
>>> Any ideas or suggestions?
>>> 
>>> Thanks,
>>> 
>>> Ken
>> 
>> If I remember correctly, include and friends have two parts to the error
>> message but you've only shown us one. For a guess, is it possible the
>> apache process doesn't have permissions for those directories and/or the
>> files within them?
>> 
>> 
>> 
>> Cheers
>> --
>> David Robley
>> 
>> I've got Parkinson's disease. And he's got mine.
>> Today is Setting Orange, the 52nd day of Discord in the YOLD 3177.
>> 
>> 
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>> 
>> 
> 
> include_path should only contain directories, not filenames. [1]
> 
> Richard.
> 
> [1] http://docs.php.net/manual/en/ini.core.php#ini.include-path
> 
> -- 
> Richard Quadling
> Twitter : EE : Zend
> @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY
> 
> -- 
> 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] Re: Installing on a Mac: include_path issues

2011-05-05 Thread Richard Quadling
On 5 May 2011 05:51, David Robley  wrote:
> Ken Kixmoeller wrote:
>
>> Hey, folks -- --
>>
>> I am switching over my development (I hope) to a Mac. Having some
>> trouble with the configuration. Rudimentary scripts run fine in the
>> document_root, but beyond that, my scripts in the include_path are not
>> found.
>>
>> The include_path has a couple of directories in which I have my
>> foundation classes and a clients application classes and other
>> programs. For various reasons, I put them into my "Documents/Clients"
>> folder. When I create to set the path to these files in PHP, they are:
>>
>>  /Users/ken/Documents/Clients/comped_php
>>  /Users/ken/Documents/Clients/jaguar_php
>>
>> PHP doesn't find them, which has me stumped.
>>
>> php.ini shows the include_path correctly, as:
>>   
>> /Users/ken/Documents/Clients/comped_php:/Users/ken/Documents/Clients/jaguar_php
>>
>> the document_root, configured in Apache is: /Users/ken/Sites/
>>
>> The errors show as:
>> include_once() [function.include]: Failed opening 'smm_header.php' for
>> inclusion
>>
> (include_path='/Users/ken/Documents/Clients/comped_php:/Users/ken/Documents/Clients/jaguar_php')
>> in /Users/ken/Sites/smm_registration/smmcomputereducation.php on line 1
>>
>> Any ideas or suggestions?
>>
>> Thanks,
>>
>> Ken
>
> If I remember correctly, include and friends have two parts to the error
> message but you've only shown us one. For a guess, is it possible the
> apache process doesn't have permissions for those directories and/or the
> files within them?
>
>
>
> Cheers
> --
> David Robley
>
> I've got Parkinson's disease. And he's got mine.
> Today is Setting Orange, the 52nd day of Discord in the YOLD 3177.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

include_path should only contain directories, not filenames. [1]

Richard.

[1] http://docs.php.net/manual/en/ini.core.php#ini.include-path

-- 
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY

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