[PHP] PAGE TURNED BECOME SOURCE CODE VIEW..

2006-07-14 Thread BBC
Hi list... Thank for answering my questions before. I love to be a member of
this list. Guys... I got another problem with GD library v2. I don't know
why every time the script run the syntax which uses GD, the page turned
becomes source code view. So when we need that page in normal view, we had
to push the 'back button' twice.

This is insecure for my page cause every body can see the source which I
should hide it. And it'll take some more time, every time we need to keep it
working normally; pushing the 'back button' twice is needed.

Does anyone have any ideas how to get page runs normally? I mean it was ok
the browser can do the script but it couldn't' show the page in normal view

Thank for your input.
 Best Regards
BBC
 **o0o**

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



Re: [PHP] PAGE TURNED BECOME SOURCE CODE VIEW..

2006-07-14 Thread Kim Christensen

On 7/9/06, BBC [EMAIL PROTECTED] wrote:

I don't know why every time the script run the syntax which uses GD, the page 
turned
becomes source code view. So when we need that page in normal view, we had
to push the 'back button' twice.


I guess we would need to see some code samples to get things going,
preferrably the GD part which seems to be the issue :-)

Best regards
--
Kim Christensen

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



[PHP] Re: Multiple sessions

2006-07-14 Thread Tony Marston
I have found a way to allow multiple browser sessions regardless of which 
browser is being used. Read about it at 
http://www.tonymarston.net/php-mysql/client-clones.html

-- 
Tony Marston
http://www.tonymarston.net
http://www.radicore.org

Philip Thompson [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 Hi.

 Is there a way to have multiple sessions open in one browser 
 (specifically, Firefox or Safari)? For example, IE does not transfer 
 session data from one window to another, however, Firefox does. So,  if 
 one user opens a session and then his/her friend wants to open a 
 different session of that same program on the same computer, (s)he is  not 
 able to without overwriting the first session data.

 I have thought of one solution, but have yet to test it. Upon the  first 
 user logging in, I could assign them as session ID (along with  the one 
 that PHP creates). I could then verify that ID is being used  on each 
 page. For the second user, I could create a different one and  do the same 
 as the first. 

 ? // User 1
 $_SESSION[my_special_id] = abcd; // created upon logging in

 if ($_SESSION[is_logged_in] 
 $_SESSION[my_special_id] == $_GET[my_special_id]) {
 // do stuff
 }
 ?

 ? // User 2 in a different window of Firefox
 $_SESSION[my_special_id] = efgh; // created upon logging in

 if ($_SESSION[is_logged_in] 
 $_SESSION[my_special_id] == $_GET[my_special_id]) {
 // do stuff
 }
 ?

 Notice that they both share the same is_logged_in variable, but a 
 different my_special_id variable. Actually, I just noticed  something. 
 If User 1 logs out and kills is_logged_in, that would  also kill it for 
 User 2.

 I don't know. I've confused myself now. Any suggestions? Common 
 practices?

 Thanks in advance,
 ~Philip 

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



Re: [PHP] PAGE TURNED BECOME SOURCE CODE VIEW..

2006-07-14 Thread BBC


 On 7/9/06, BBC [EMAIL PROTECTED] wrote:
  I don't know why every time the script run the syntax which uses GD, the 
  page turned
  becomes source code view. So when we need that page in normal view, we had
  to push the 'back button' twice.
 
 I guess we would need to see some code samples to get things going,
 preferrably the GD part which seems to be the issue :-)

Here are the Codes I used :

$tumbsize = 150;
$imgfile = $some_where;
$imgdst = $where_to;
header('Content-type: image/jpeg');
list($width,$height) = getimagesize($imgfile);
$imgratio = $width/$height;
if($imgratio1)
{
 $newwidth = $tumbsize;
 $newheight = (int)($tumbsize / $imgratio);
}else{
 $newheight = $tumbsize;
 $newwidth = (int)($tumbsize * $imgratio);
}
$tumb = ImageCreateTrueColor($newwidth,$newheight);
$source = ImageCreateFromJpeg($imgfile);
$hai = 
ImageCopyResized($tumb,$source,0,0,0,0,$newwidth,$newheight,$width,$height);
ImageJpeg($tumb,$imgdst,100);
if ($hai)
{
echo Resizing is successfulbr ;
}else{
copy($some_where,$where_to);
}

And thank for your input..

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



Re: [PHP] PAGE TURNED BECOME SOURCE CODE VIEW..

2006-07-14 Thread Andrei

I think you should make up your mind what u display to user... image
or text...

Andrei

BBC wrote:
 
 On 7/9/06, BBC [EMAIL PROTECTED] wrote:
 I don't know why every time the script run the syntax which uses GD, the 
 page turned
 becomes source code view. So when we need that page in normal view, we had
 to push the 'back button' twice.
 I guess we would need to see some code samples to get things going,
 preferrably the GD part which seems to be the issue :-)
 
 Here are the Codes I used :
 
 $tumbsize = 150;
 $imgfile = $some_where;
 $imgdst = $where_to;
 header('Content-type: image/jpeg');
 list($width,$height) = getimagesize($imgfile);
 $imgratio = $width/$height;
 if($imgratio1)
 {
  $newwidth = $tumbsize;
  $newheight = (int)($tumbsize / $imgratio);
 }else{
  $newheight = $tumbsize;
  $newwidth = (int)($tumbsize * $imgratio);
 }
 $tumb = ImageCreateTrueColor($newwidth,$newheight);
 $source = ImageCreateFromJpeg($imgfile);
 $hai = 
 ImageCopyResized($tumb,$source,0,0,0,0,$newwidth,$newheight,$width,$height);
 ImageJpeg($tumb,$imgdst,100);
 if ($hai)
 {

Well either you display an image (which you should do bcuz you set
already the header) or you display a text...

 echo Resizing is successfulbr ;
 }else{
 copy($some_where,$where_to);
 }
 
 And thank for your input..
 

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



Re: [PHP] session_start/session_write_close creates multiple sessioncookie headers. How to fix this.

2006-07-14 Thread Mathijs

Chris wrote:

Mathijs wrote:

Hello again,

I Use session_write_close() so the page loads quicker because i use 
session on multiple place.

This because session has protection for race conditions.

Now it works very well and i don't have any problems at all.
I only see that there are multiple session cookie headers set.
I Personally think that one is enough :P.

How can i make it so that it just sets just one and not set this 
header every time i call session_start or session_write_close.

Because i don't know when the cookie is set.


I think this will be an either/or situation.

Either it only sends one session cookie header and you don't use 
session_write_close all over the place..


or, it sends multiple cookies and you do use session_write_close all 
over the place.


The internals of php would set this behaviour, not something you can 
change without changing the C code.




Hmmm...
I find it kinda strange that it sets the same uniqueId with the same session 
name more then once.
It would be logical to just have one.. And overwrite the previous session 
cookie.
Any other thing would be an programmers fault in my opinion.
Because you can't have more then one session id per session cookie name.
Also, the browser won't send all the cookies back.
This is just useless overhead.

But it seems that i have to live with it (for now).
I think ill report this as an bug to PHP.

Thx.
Mathijs.

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



Re: [PHP] Zend Studio, phpMyAdmin, and mysql.sock

2006-07-14 Thread David Tulloh
This sounds like a Zend Studio problem and question.
It could possibly be a MySQL or even a phpMyAdmin question.
It doesn't really have anything to do with PHP.

You paid Zend for the product, ask them how it works.


David

Dave M G wrote:
 PHP List,
 
 I am trying out Zend Studio for editing and debugging my PHP scripts.
 
 When I first ran it, it kept giving me this error:
 Can't connect to local MySQL server through socket /tmp/mysql.sock
 
 After some research on the web, I found that this could be solved by
 editing /etc/mysql/my.conf so that it said:
 socket = /tmp/mysql.sock
 
 I was not thrilled about the idea of changing my MySQL server to meet
 the needs of one application, but I wanted to see if it would work, and
 it does.
 
 But, now phpMyAdmin doesn't work, saying:
 The server is not responding (or the local MySQL server's socket is not
 correctly configured)
 
 So what I really want to do is put my /etc/mysql/my.conf file back to
 the way it was, and make Zend listen on mysql's default socket, not on
 /tmp/mysql.sock.
 
 But, after much searching on the web, and in the Zend forums, I can't
 find any information on configuring Zend in this matter.
 
 What do I need to do to make Zend listen on the MySQL socket that I want
 it to listen on?
 
 (Which, by the way, is /var/run/mysqld/mysqld.sock)
 
 Thank you for any advice.
 
 -- 
 Dave M G
 

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



[PHP] regular expression to extract from the middle of a string

2006-07-14 Thread Steve Turnbull
Hey folks

I don't want to just get you to do the work, but I have so far tried
in vain to achieve something...

I have a string similar to the following;

cn=emailadmin,ou=services,dc=domain,dc=net

I want to extract whatever falls between the 'cn=' and the following
comma - in this case 'emailadmin'.

Question(s);
is this possible via a regular expression?
does php have a better way of doing this?

Some pointers would be greatly appreciated. Once I have working, I will
be creating a function which will cater for this and will post to this
list if anyone is interested?

Cheers
Steve

-- 
Steve Turnbull

Digital Content Developer
YHGfL Foundation

e [EMAIL PROTECTED]
t 01724 275030

The YHGfL Foundation Disclaimer can be found at:
http://www.yhgfl.net/foundation-services/yhgfl-email-disclaimer/

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



Re: [PHP] regular expression to extract from the middle of a string

2006-07-14 Thread Dave Goodchild

On 14/07/06, Steve Turnbull [EMAIL PROTECTED] wrote:


Hey folks

I don't want to just get you to do the work, but I have so far tried
in vain to achieve something...

I have a string similar to the following;

cn=emailadmin,ou=services,dc=domain,dc=net

I want to extract whatever falls between the 'cn=' and the following
comma - in this case 'emailadmin'.

Question(s);
is this possible via a regular expression?
does php have a better way of doing this?

Some pointers would be greatly appreciated. Once I have working, I will
be creating a function which will cater for this and will post to this
list if anyone is interested?

Cheers
Steve

I think you will have to use minimal matching to ensure you only grab the
first sequence. the following pattern should do the trick:




'/cn=(\w+,?)




--
http://www.web-buddha.co.uk
http://www.projectkarma.co.uk


Re: [PHP] regular expression to extract from the middle of a string

2006-07-14 Thread tg-php
I believe someone gave the regex code for it already, but if you wanted to do 
it the clumsy way (for those of us who are regex challenged still) here's an 
alternative:

$str = cn=emailadmin,ou=services,dc=domain,dc=net;

$argsarray = explode(,, $str);

foreach ($argsarray as $argstr) {
  list($arg, $val) = explode(=, $argstr);
  $newarr[$arg] = $val;
}

echo $newarr['cn'];



Then you have access to all the parameters being given.


I'm pretty sure there's a more elegant way to do this even the clumsy way I did 
it, but just giving a basic example of how else you might be able to get that 
information.

-TG


= = = Original message = = =

Hey folks

I don't want to just get you to do the work, but I have so far tried
in vain to achieve something...

I have a string similar to the following;

cn=emailadmin,ou=services,dc=domain,dc=net

I want to extract whatever falls between the 'cn=' and the following
comma - in this case 'emailadmin'.

Question(s);
is this possible via a regular expression?
does php have a better way of doing this?

Some pointers would be greatly appreciated. Once I have working, I will
be creating a function which will cater for this and will post to this
list if anyone is interested?

Cheers
Steve

-- 
Steve Turnbull


___
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.

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



[PHP] Re: regular expression to extract from the middle of a string

2006-07-14 Thread Al

Steve Turnbull wrote:

Hey folks

I don't want to just get you to do the work, but I have so far tried
in vain to achieve something...

I have a string similar to the following;

cn=emailadmin,ou=services,dc=domain,dc=net

I want to extract whatever falls between the 'cn=' and the following
comma - in this case 'emailadmin'.

Question(s);
is this possible via a regular expression?
does php have a better way of doing this?

Some pointers would be greatly appreciated. Once I have working, I will
be creating a function which will cater for this and will post to this
list if anyone is interested?

Cheers
Steve



$pattern= %cn=([a-z]+)%i;   //Or, if numbers are ok, you an use \w 
instead of [a-z]

preg_match($pattern, $your_string, $match);

$value= $match[1];

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



Re: [PHP] Zend Studio, phpMyAdmin, and mysql.sock

2006-07-14 Thread Dave M G

David Tulloh,

This sounds like a Zend Studio problem and question.
It could possibly be a MySQL or even a phpMyAdmin question.
It doesn't really have anything to do with PHP.
  
I realize that Zend Studio is separate from PHP, but I would hardly go 
so far as to say it has nothing to do with PHP. Zend is the company 
that *makes* PHP. Zend is a development environment for creating PHP.


So I don't think it's at all unreasonable to think that maybe there are 
people here who use it (or even develop it) on this list.


And I do realize that Zend has its own forum, and I have posted there. 
But the question has gone for days without response, so I'm broadening 
my search.


What else should one do when one gets no response in a more specific forum?

You paid Zend for the product, ask them how it works.
  
Well, what I have is the trial version, which they say they support, but 
they have not responded to my email sent to them. So I don't know if I'm 
far down the priority list for not having paid yet or if they just 
usually take days to answer or what.


In any case, this list is called PHP general. Am I really so 
unreasonable in thinking that asking about how to set up a PHP 
development environment so that I can debug my PHP scripts without it 
conflicting with the PHP database administration system is on-topic?


--
Dave M G

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



Re: [PHP] Zend Studio, phpMyAdmin, and mysql.sock

2006-07-14 Thread Dan McCullough

in phpmyadmin config.default.php you can specify the socket that it
should be looking for. have you tried that?

On 7/14/06, Dave M G [EMAIL PROTECTED] wrote:

David Tulloh,
 This sounds like a Zend Studio problem and question.
 It could possibly be a MySQL or even a phpMyAdmin question.
 It doesn't really have anything to do with PHP.

I realize that Zend Studio is separate from PHP, but I would hardly go
so far as to say it has nothing to do with PHP. Zend is the company
that *makes* PHP. Zend is a development environment for creating PHP.

So I don't think it's at all unreasonable to think that maybe there are
people here who use it (or even develop it) on this list.

And I do realize that Zend has its own forum, and I have posted there.
But the question has gone for days without response, so I'm broadening
my search.

What else should one do when one gets no response in a more specific forum?
 You paid Zend for the product, ask them how it works.

Well, what I have is the trial version, which they say they support, but
they have not responded to my email sent to them. So I don't know if I'm
far down the priority list for not having paid yet or if they just
usually take days to answer or what.

In any case, this list is called PHP general. Am I really so
unreasonable in thinking that asking about how to set up a PHP
development environment so that I can debug my PHP scripts without it
conflicting with the PHP database administration system is on-topic?

--
Dave M G

--
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] Zend Studio, phpMyAdmin, and mysql.sock

2006-07-14 Thread Robert Cummings
On Fri, 2006-07-14 at 11:57, Dave M G wrote:
 David Tulloh,
  This sounds like a Zend Studio problem and question.
  It could possibly be a MySQL or even a phpMyAdmin question.
  It doesn't really have anything to do with PHP.

 I realize that Zend Studio is separate from PHP, but I would hardly go 
 so far as to say it has nothing to do with PHP. Zend is the company 
 that *makes* PHP. Zend is a development environment for creating PHP.

While Zend definitely lends a hand, saying that it makes PHP seems to
take away the credit all the other volunteers who add to PHP deserve.
PHP existed before Zend, Zend is just one of the stepping stones in its
evolution.

 So I don't think it's at all unreasonable to think that maybe there are 
 people here who use it (or even develop it) on this list.
 
 And I do realize that Zend has its own forum, and I have posted there. 
 But the question has gone for days without response, so I'm broadening 
 my search.

Sounds like you're not getting your money's worth. Personally I don't
know why anyone would by Zend EXCEPT for the support since there are
plenty of free alternatives.

 What else should one do when one gets no response in a more specific forum?
  You paid Zend for the product, ask them how it works.

 Well, what I have is the trial version, which they say they support, but 
 they have not responded to my email sent to them. So I don't know if I'm 
 far down the priority list for not having paid yet or if they just 
 usually take days to answer or what.

There's a bucket someplace... look up and you'll see all the paying
people above you.

 In any case, this list is called PHP general. Am I really so 
 unreasonable in thinking that asking about how to set up a PHP 
 development environment so that I can debug my PHP scripts without it 
 conflicting with the PHP database administration system is on-topic?

You have asked a Zend specific question, the problem lies with Zend it
would seem, and not PHP. While the two are obviously related, your
question is not about PHP.

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



Re: [PHP] Zend Studio, phpMyAdmin, and mysql.sock

2006-07-14 Thread Paul Nowosielski
You could make a symbolic link from /tmp/ to whereever the real socket is. 
Then you won't have to change your other configurations.


Thank you,

-- 
Paul Nowosielski

On Thursday 13 July 2006 22:53, Dave M G wrote:
 PHP List,

 I am trying out Zend Studio for editing and debugging my PHP scripts.

 When I first ran it, it kept giving me this error:
 Can't connect to local MySQL server through socket /tmp/mysql.sock

 After some research on the web, I found that this could be solved by
 editing /etc/mysql/my.conf so that it said:
 socket = /tmp/mysql.sock

 I was not thrilled about the idea of changing my MySQL server to meet
 the needs of one application, but I wanted to see if it would work, and
 it does.

 But, now phpMyAdmin doesn't work, saying:
 The server is not responding (or the local MySQL server's socket is not
 correctly configured)

 So what I really want to do is put my /etc/mysql/my.conf file back to
 the way it was, and make Zend listen on mysql's default socket, not on
 /tmp/mysql.sock.

 But, after much searching on the web, and in the Zend forums, I can't
 find any information on configuring Zend in this matter.

 What do I need to do to make Zend listen on the MySQL socket that I want
 it to listen on?

 (Which, by the way, is /var/run/mysqld/mysqld.sock)

 Thank you for any advice.

 --
 Dave M G

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



Re: [PHP] Zend Studio, phpMyAdmin, and mysql.sock

2006-07-14 Thread Ray Hauge
On Thursday 13 July 2006 21:53, Dave M G wrote:
 PHP List,

 I am trying out Zend Studio for editing and debugging my PHP scripts.

 When I first ran it, it kept giving me this error:
 Can't connect to local MySQL server through socket /tmp/mysql.sock

 After some research on the web, I found that this could be solved by
 editing /etc/mysql/my.conf so that it said:
 socket = /tmp/mysql.sock

 I was not thrilled about the idea of changing my MySQL server to meet
 the needs of one application, but I wanted to see if it would work, and
 it does.

 But, now phpMyAdmin doesn't work, saying:
 The server is not responding (or the local MySQL server's socket is not
 correctly configured)

 So what I really want to do is put my /etc/mysql/my.conf file back to
 the way it was, and make Zend listen on mysql's default socket, not on
 /tmp/mysql.sock.

 But, after much searching on the web, and in the Zend forums, I can't
 find any information on configuring Zend in this matter.

 What do I need to do to make Zend listen on the MySQL socket that I want
 it to listen on?

 (Which, by the way, is /var/run/mysqld/mysqld.sock)

 Thank you for any advice.

 --
 Dave M G

I ran into this problem myself.  I had to not use --skip-networking.  I use 
Slackware linux, so that was in the /etc/rc.d/rc.mysqld script.

I don't know why that would make PHPMyAdmin not work though.

HTH

-- 
Ray Hauge
Programmer/Systems Administrator
American Student Loan Services
www.americanstudentloan.com
1.800.575.1099

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



Re: [PHP] Zend Studio, phpMyAdmin, and mysql.sock

2006-07-14 Thread Michael Rasmussen
On Sat, 15 Jul 2006 00:57:18 +0900, Dave M G wrote:

 
 In any case, this list is called PHP general. Am I really so
 unreasonable in thinking that asking about how to set up a PHP development
 environment so that I can debug my PHP scripts without it conflicting with
 the PHP database administration system is on-topic?
In your Zend folder there is a folder called bin. In that folder you
should see to other folders: php4 and php5. In each of those folders you
should fine a file called php.ini. In that file add the following
instruction:
mysql.default_socket=/path/to/mysqld.sock

-- 
Hilsen/Regards
Michael Rasmussen
http://keyserver.veridis.com:11371/pks/lookup?op=getsearch=0xE3E80917

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



Re: [PHP] regular expression to extract from the middle of a string

2006-07-14 Thread Kim Christensen

On 7/14/06, Steve Turnbull [EMAIL PROTECTED] wrote:

I have a string similar to the following;

cn=emailadmin,ou=services,dc=domain,dc=net

I want to extract whatever falls between the 'cn=' and the following
comma - in this case 'emailadmin'.



$pattern= /[^=]+=([^,]+)/;
preg_match($pattern, $string, $matches);
print_r($matches);

Voila! (Untested for now, I'm pretty drunk so sorry if it ain't workin
out like you want to)

--
Kim Christensen

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



Re: [PHP] regular expression to extract from the middle of a string

2006-07-14 Thread Russell Jones

Ill probably get attacked viciously for this with pitchforks and machetes,
but I get sick and tired of trying to figure out regular expressions a lot
of times, so I use the following functions... getSingleMatch(),
getMultiMatch(), getSingleMatchBackwards()


function getSingleMatch($start,$end,$content) {
// finds the first match giving a beginning and a part of string that
you want to grab

// eg: to get the title from an html document, you would just use the
command getSingleMatch('title','/title',$html);


$exp = explode($start,$content);
$exp2 = explode($end,$exp[1]);

return $exp2[0];
}


function getMultiMatch($start,$end,$content) {
// finds all the non-embeded matches based on a beginning and ending string
// eg: to get all the h1 tags in an html document, you would use
getMultiMatch('h1','/h1',$html);

$exp = explode($start,$content);
foreach($exp as $pi) {

if(stristr($pi,$end)) {
$ex2 = explode($end,$pi);
$matches[] = $ex2[0];


}


}

return $matches;

}

function getSingleMatchBackwards($start,$end,$content) {
// the same as getSingleMatch except it goes backwards to forwards. This
helps in cases where the
// most distinct delimiter is at the end of your target rather than the
beginning.

$exp = explode($end,$content);
$exp2 = explode($start,$exp[0]);


return $exp2[count($exp2)-1];

}






On 7/14/06, Kim Christensen [EMAIL PROTECTED] wrote:


On 7/14/06, Steve Turnbull [EMAIL PROTECTED] wrote:
 I have a string similar to the following;

 cn=emailadmin,ou=services,dc=domain,dc=net

 I want to extract whatever falls between the 'cn=' and the following
 comma - in this case 'emailadmin'.


$pattern= /[^=]+=([^,]+)/;
preg_match($pattern, $string, $matches);
print_r($matches);

Voila! (Untested for now, I'm pretty drunk so sorry if it ain't workin
out like you want to)

--
Kim Christensen

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




[PHP] List Nastiness (Was: RE: [PHP] Zend Studio, phpMyAdmin, and mysql.sock)

2006-07-14 Thread KermodeBear
Thanks Mr. Rasmussen. (o:

To the rest:
There has been quite a bit of mean spiritedness on the list lately. I don't
know if it is the weather, some strange astrological phenomenon, or
something else entirely, but can we tone it down a bit? There has been way
too much flame war-esque behavior lately. 

We're supposed to help each other here, no? Can't we all just get along?

If someone says something nasty it's possible to just ignore it. Let it go.
If you -need- to retort, then I would appreciate it if it was taken off
list.

Thanks!

 In any case, this list is called PHP general. Am I really so
 unreasonable in thinking that asking about how to set up a PHP
development
 environment so that I can debug my PHP scripts without it conflicting
with
 the PHP database administration system is on-topic?
 In your Zend folder there is a folder called bin. In that folder you
 should see to other folders: php4 and php5. In each of those folders you
 should fine a file called php.ini. In that file add the following
 instruction:
 mysql.default_socket=/path/to/mysqld.sock

 -- 
 Hilsen/Regards
 Michael Rasmussen
 http://keyserver.veridis.com:11371/pks/lookup?op=getsearch=0xE3E80917


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



[PHP] Recurs Directory Delete

2006-07-14 Thread Mark Steudel
I was hoping someone could give me a hand, I'm trying to create a delete
folders function that recursively deletes folders and files from a given
directory. Here's what I have so far, but its not working I keep getting 

Warning: rmdir(wwwroot/resources/applications/44/series/25/modules/29)
[function.rmdir]: Directory not empty in
wwwroot\common\class.directories.php on line 28

function deleteFolders( $resource )
{
if( is_dir( $resource ) )
{
if( $dir = opendir( $resource ) )
{
while( false !== ( $file == readdir( $dir ) ) )
{
if( $file != '.'  $file != '..' )
{

$this-deleteFolders($resource.'/'.$file );
}
}
closedir($dir);
rmdir($resource);
}
else 
{
$this-LOG .= __LINE__ . : Unable to open
directory\r\n;
}
}
else 
{

if( is_file( $resource ) )
{   
unlink( $resource );
}
else 
{
$this-LOG .= __LINE__ . : Unknown path:
$resource\r\n;
}
}
}

TIA, mark

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



Re: [PHP] Zend Studio, phpMyAdmin, and mysql.sock

2006-07-14 Thread tedd
At 1:42 PM -0400 7/14/06, Robert Cummings wrote:
You have asked a Zend specific question, the problem lies with Zend it
would seem, and not PHP. While the two are obviously related, your
question is not about PHP.

Cheers,
Rob.

Rob:

You're certainly right, but do you think that a developer's question as to how 
to set up a php IDE should be out of the realm of a general php question?

On one hand, it's common to tell posters to RTFM, but then we also tell them to 
go elsewhere if they ask a question who's answer is not in the manual -- is 
that right?

I'm not arguing, I'm just asking for clarification.

tedd

-- 

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

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



RE: [PHP] List Nastiness (Was: RE: [PHP] Zend Studio, phpMyAdmin, and mysql.sock)

2006-07-14 Thread Jay Blanchard
[snip]
To the rest:
There has been quite a bit of mean spiritedness on the list lately. I
don't
know if it is the weather, some strange astrological phenomenon, or
something else entirely, but can we tone it down a bit? There has been
way
too much flame war-esque behavior lately. 

We're supposed to help each other here, no? Can't we all just get along?

If someone says something nasty it's possible to just ignore it. Let it
go.
If you -need- to retort, then I would appreciate it if it was taken off
list.
[/snip]

Blow it out your socks Bear. Either that or let me see your PHP
sheriff's badge.








/you had to know that was coming

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



Re: [PHP] Recurs Directory Delete

2006-07-14 Thread tedd
At 11:55 AM -0700 7/14/06, Mark Steudel wrote:
I was hoping someone could give me a hand, I'm trying to create a delete
folders function that recursively deletes folders and files from a given
directory.

This works for me:

?php

$path = tmp;
if ($handle = opendir($path))
{
while (false !== ($file = readdir($handle)))
{
if ($file != .  $file != ..)
{
$file_array[] = $file;
}
}
closedir($handle);
}

if (isset($file_array))
{
echo (br/ before delete);
echo (pre);
print_r($file_array);   
echo(/pre);

foreach ($file_array as $value)
{
unlink($path/$value);
}
}
else
{
echo (br/ nothing to delete);
}
?

hth's

tedd
-- 

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

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



[PHP] Re: regular expression to extract from the middle of a string

2006-07-14 Thread Adam Zey

Steve Turnbull wrote:

Hey folks

I don't want to just get you to do the work, but I have so far tried
in vain to achieve something...

I have a string similar to the following;

cn=emailadmin,ou=services,dc=domain,dc=net

I want to extract whatever falls between the 'cn=' and the following
comma - in this case 'emailadmin'.

Question(s);
is this possible via a regular expression?
does php have a better way of doing this?

Some pointers would be greatly appreciated. Once I have working, I will
be creating a function which will cater for this and will post to this
list if anyone is interested?

Cheers
Steve



The fastest way to do this probably does not involve explodes or regular 
expressions. I would wager that the fastest method would be to do a 
strpos to find cn=, then a strpos to find the next comma (strpos 
supports offsets to start looking for), and then substr out the segment 
you've identified.


However, if cn= is ALWAYS first, it's actually a lot simpler. Then it 
becomes something like this:


$mystring = cn=emailadmin,ou=services,dc=domain,dc=net;
$cnpart = substr($mystring, 2, strpos($mystring, ,) - 3 );

My offsets might be a bit off there, I always get confused with them and 
have to verify by running the code in case I mixed up a zero-based 
character position or something :P


Regards, Adam.

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



Re: [PHP] Recurs Directory Delete

2006-07-14 Thread Jochem Maas
Mark Steudel wrote:
 I was hoping someone could give me a hand, I'm trying to create a delete
 folders function that recursively deletes folders and files from a given
 directory. Here's what I have so far, but its not working I keep getting 
 
 Warning: rmdir(wwwroot/resources/applications/44/series/25/modules/29)
 [function.rmdir]: Directory not empty in
 wwwroot\common\class.directories.php on line 28


do you have the relevant permissions to unlink() the files in question?
try dumping/collecting some debugging infomation a bit like this
function does:

/* delete everything in the $dir */
function recursiveDelete($dir)
{
$msgs = array(
\n.\n.'deleting everthing in: '.$dir,
\n.'---'
);

if ($handle = /[EMAIL PROTECTED]/opendir($dir)) {
while (($file = readdir($handle)) !== false) {
if (($file == .) || ($file == ..)) {
continue;
}

if (is_dir($dir.'/'.$file)) {
   // call self for this directory
   $msgs = array_merge($msgs, recursiveDelete($dir.'/'.$file));
   $r  = rmdir ($dir.'/'.$file);
   $msgs[] = \n.'deleting dir.: '.$dir.'/'.$file.($r?' 
SUCCESSFUL':' FAILED');
}
else {
   $r  = unlink($dir.'/'.$file); // remove this file
   $msgs[] = \n.'deleting file: '.$dir.'/'.$file.($r?' 
SUCCESSFUL':' FAILED');
}

}

/[EMAIL PROTECTED]/closedir($handle);
return $msgs;
}

/* return an array of messages always - for the call array_merge() */
return array();
}


 
 function deleteFolders( $resource )
 {
   if( is_dir( $resource ) )
   {
   if( $dir = opendir( $resource ) )
   {
   while( false !== ( $file == readdir( $dir ) ) )
   {
   if( $file != '.'  $file != '..' )
   {
   
 $this-deleteFolders($resource.'/'.$file );
   }
   }
   closedir($dir);
   rmdir($resource);
   }
   else 
   {
   $this-LOG .= __LINE__ . : Unable to open
 directory\r\n;
   }
   }
   else 
   {
   
   if( is_file( $resource ) )
   {   
   unlink( $resource );
   }
   else 
   {
   $this-LOG .= __LINE__ . : Unknown path:
 $resource\r\n;
   }
   }
 }
 
 TIA, mark
 

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



Re: [PHP] Zend Studio, phpMyAdmin, and mysql.sock

2006-07-14 Thread Robert Cummings
On Fri, 2006-07-14 at 14:57, tedd wrote:
 At 1:42 PM -0400 7/14/06, Robert Cummings wrote:
 You have asked a Zend specific question, the problem lies with Zend it
 would seem, and not PHP. While the two are obviously related, your
 question is not about PHP.
 
 Cheers,
 Rob.
 
 Rob:
 
 You're certainly right, but do you think that a developer's question as to 
 how to set up a php IDE should be out of the realm of a general php question?
 
 On one hand, it's common to tell posters to RTFM, but then we also tell them 
 to go elsewhere if they ask a question who's answer is not in the manual -- 
 is that right?
 
 I'm not arguing, I'm just asking for clarification.

Well I didn't tell him to take a hike, I merely clarified why some
others might not find his question quite on topic. I didn't think my
response was negative towards the OP, and having re-read it I still
don't think it was negative. It was just a comment on how he might want
to lower his expectations of the list when fielding a Zend question. I
mean it's akin to saying Hi I generate HTML using PHP, can you tell me
how to add borders to my table?. Anyways, we answer those questions all
the time and sometimes we tell the poster to go use google or yahoo or
whatnot. As someone said in the past, was it John Nichel? It seems we on
the PHP list are experts on everything Internet. We're asked everything
from tcp to sql to css to js to ftp to insert whatever I've missed.

At any rate, I wasn't going to bother responding at all, but giving all
the credit to Zend struck me as wrong, and once I responded to that I
thought the bottom of the bucket analogy fitting, and then, and ... well
anyways :)

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



Re: [PHP] Recurs Directory Delete

2006-07-14 Thread Richard Lynch
On Fri, July 14, 2006 2:07 pm, tedd wrote:
 At 11:55 AM -0700 7/14/06, Mark Steudel wrote:
I was hoping someone could give me a hand, I'm trying to create a
 delete
folders function that recursively deletes folders and files from a
 given
directory.

If you want to delete EVERYTHING, an exec(rm -r $path) could
potentially be much more efficient.

You'd be trading the cost of opening up a mini-shell against PHP
iteration, so it would depend on the number of directories, but if
there are LOTS of files, the rm -r will probably win.

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] Zend Studio, phpMyAdmin, and mysql.sock

2006-07-14 Thread Richard Lynch
ln -s /var/run/mysqld/mysqld.sock /tmp/mysql.sock

As far as I know, the default for MySQL out of the box is /tmp/mysql.sock

You'd have to complain to Zend Support to get a configure directive
for this, if they don't already have one.

On Thu, July 13, 2006 11:53 pm, Dave M G wrote:
 PHP List,

 I am trying out Zend Studio for editing and debugging my PHP scripts.

 When I first ran it, it kept giving me this error:
 Can't connect to local MySQL server through socket /tmp/mysql.sock

 After some research on the web, I found that this could be solved by
 editing /etc/mysql/my.conf so that it said:
 socket = /tmp/mysql.sock

 I was not thrilled about the idea of changing my MySQL server to meet
 the needs of one application, but I wanted to see if it would work,
 and
 it does.

 But, now phpMyAdmin doesn't work, saying:
 The server is not responding (or the local MySQL server's socket is
 not
 correctly configured)

 So what I really want to do is put my /etc/mysql/my.conf file back to
 the way it was, and make Zend listen on mysql's default socket, not on
 /tmp/mysql.sock.

 But, after much searching on the web, and in the Zend forums, I can't
 find any information on configuring Zend in this matter.

 What do I need to do to make Zend listen on the MySQL socket that I
 want
 it to listen on?

 (Which, by the way, is /var/run/mysqld/mysqld.sock)

 Thank you for any advice.

 --
 Dave M G

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




-- 
Like Music?
http://l-i-e.com/artists.htm

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



RE: [PHP] Recurs Directory Delete

2006-07-14 Thread Mark Steudel
I wish, I'm on an IIS box.

Mark

-Original Message-
From: Richard Lynch [mailto:[EMAIL PROTECTED] 
Sent: Friday, July 14, 2006 2:09 PM
To: tedd
Cc: Mark Steudel; php-general@lists.php.net
Subject: Re: [PHP] Recurs Directory Delete

On Fri, July 14, 2006 2:07 pm, tedd wrote:
 At 11:55 AM -0700 7/14/06, Mark Steudel wrote:
I was hoping someone could give me a hand, I'm trying to create a
 delete
folders function that recursively deletes folders and files from a
 given
directory.

If you want to delete EVERYTHING, an exec(rm -r $path) could
potentially be much more efficient.

You'd be trading the cost of opening up a mini-shell against PHP
iteration, so it would depend on the number of directories, but if
there are LOTS of files, the rm -r will probably win.

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] Zend Studio, phpMyAdmin, and mysql.sock

2006-07-14 Thread Richard Lynch
On Fri, July 14, 2006 10:57 am, Dave M G wrote:
 David Tulloh,
 This sounds like a Zend Studio problem and question.
 It could possibly be a MySQL or even a phpMyAdmin question.
 It doesn't really have anything to do with PHP.

 I realize that Zend Studio is separate from PHP, but I would hardly go
 so far as to say it has nothing to do with PHP.

But like a few thousand products/projects out there, we really can't
try to support all of them with all their foibles.

 Zend is the company
 that *makes* PHP.

I used to work for Zend.

They would be VERY peeved to have you saying this, because it's simply
not true, and they know it.

 Zend is a development environment for creating PHP.

 So I don't think it's at all unreasonable to think that maybe there
 are
 people here who use it (or even develop it) on this list.

You can also assume that there are people on this list who go scuba
diving.  That does not make scuba gear questions on-topic.

 What else should one do when one gets no response in a more specific
 forum?

Ignore people who bitch at you for posting, especially when you said
up-front that you weren't getting any support from Zend, and when
you've obviously tried several different things.

 You paid Zend for the product, ask them how it works.

 Well, what I have is the trial version, which they say they support,
 but
 they have not responded to my email sent to them. So I don't know if
 I'm
 far down the priority list for not having paid yet or if they just
 usually take days to answer or what.

That's definitely a problem.

If the trial support is supposed to match the paid support, then I
guess you now know that the support can be slow.

 In any case, this list is called PHP general. Am I really so
 unreasonable in thinking that asking about how to set up a PHP
 development environment so that I can debug my PHP scripts without it
 conflicting with the PHP database administration system is on-topic?

I personally think you weren't that far off, though you could have
posted that you were just using the trial version for evaluation,
which I don't think was in the original.

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] GD to database directly

2006-07-14 Thread Richard Lynch
On Thu, July 13, 2006 6:49 pm, Kevin Waterson wrote:
 This one time, at band camp, Richard Lynch [EMAIL PROTECTED] wrote:

 If you've benchmarked on YOUR hardware and have a proven savings,
 fine, post your tests and output.

 Already done in previous threads.

Actually, to be pedantic, you've provided a reference to a dead tree
magazine, which I don't happen to have...

 nowhere do I say the db is faster than file system. Just that various
 methods of db access are
 faster than others. I fail to see you point here? Do you have one?

Yes.

If your primary consideration is performance, then you need to test on
YOUR hardware with YOUR setup.

 I have simply asked a question of those debunking the idea of binary
 storage how much
 of a performance hit do they think it takes, I have done _my_
 homework, I wonder if
 others have?
 You are quick to ask for benchmarks. Where are yours?

My primary consideration has never been performance.

I'm more concerned about the disaster recovery of a DB from a crashed
hard drive, which has been cluttered up with binary data, making data
recovery.

Other considerations are that your DB client/server buffer size has to
be large enough to handle the images.

Then your field storage size has to be large enough.

Given the number of posts here in PHP-General alone, of people getting
tripped up by these things, I have concluded that cramming images into
the DB is far more trouble than it is worth.

It *seems* like a Good Idea until you actually do it for awhile, and
then run into all these snags.

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] PAGE TURNED BECOME SOURCE CODE VIEW..

2006-07-14 Thread Richard Lynch
On Sun, July 9, 2006 12:00 pm, BBC wrote:
 Hi list... Thank for answering my questions before. I love to be a
 member of
 this list. Guys... I got another problem with GD library v2. I don't
 know
 why every time the script run the syntax which uses GD, the page
 turned
 becomes source code view. So when we need that page in normal view, we
 had
 to push the 'back button' twice.

Show us the URL to your page, and its source...

We cannot guess from this description what you've managed to do.

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] PAGE TURNED BECOME SOURCE CODE VIEW..

2006-07-14 Thread Richard Lynch
On Fri, July 14, 2006 3:34 am, BBC wrote:
 On 7/9/06, BBC [EMAIL PROTECTED] wrote:

 $tumbsize = 150;
 $imgfile = $some_where;
 $imgdst = $where_to;
 header('Content-type: image/jpeg');
 list($width,$height) = getimagesize($imgfile);
 $imgratio = $width/$height;
 if($imgratio1)
 {
  $newwidth = $tumbsize;
  $newheight = (int)($tumbsize / $imgratio);
 }else{
  $newheight = $tumbsize;
  $newwidth = (int)($tumbsize * $imgratio);
 }
 $tumb = ImageCreateTrueColor($newwidth,$newheight);
 $source = ImageCreateFromJpeg($imgfile);
 $hai =
 ImageCopyResized($tumb,$source,0,0,0,0,$newwidth,$newheight,$width,$height);
 ImageJpeg($tumb,$imgdst,100);
 if ($hai)
 {
 echo Resizing is successfulbr ;

This right here is going to mess things up...

You've told the browser that you are sending a JPEG.

The text above is not part of a valid JPEG.

Use error_log() and check your Apache/whatever error logs when
generating non HTML output.

 }else{
 copy($some_where,$where_to);
 }

 And thank for your input..

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




-- 
Like Music?
http://l-i-e.com/artists.htm

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



RE: [PHP] Recurs Directory Delete

2006-07-14 Thread Mark Steudel
Thanks all for the help, I figured it out:

This line was giving me grief :) doh!

while( false !== ( $file == readdir( $dir ) ) )

Mark


-Original Message-
From: Jochem Maas [mailto:[EMAIL PROTECTED] 
Sent: Friday, July 14, 2006 12:12 PM
To: Mark Steudel
Cc: php-general@lists.php.net
Subject: Re: [PHP] Recurs Directory Delete

Mark Steudel wrote:
 I was hoping someone could give me a hand, I'm trying to create a delete
 folders function that recursively deletes folders and files from a given
 directory. Here's what I have so far, but its not working I keep getting 
 
 Warning: rmdir(wwwroot/resources/applications/44/series/25/modules/29)
 [function.rmdir]: Directory not empty in
 wwwroot\common\class.directories.php on line 28


do you have the relevant permissions to unlink() the files in question?
try dumping/collecting some debugging infomation a bit like this
function does:

/* delete everything in the $dir */
function recursiveDelete($dir)
{
$msgs = array(
\n.\n.'deleting everthing in: '.$dir,
 
\n.'---'
);

if ($handle = /[EMAIL PROTECTED]/opendir($dir)) {
while (($file = readdir($handle)) !== false) {
if (($file == .) || ($file == ..)) {
continue;
}

if (is_dir($dir.'/'.$file)) {
   // call self for this directory
   $msgs = array_merge($msgs, recursiveDelete($dir.'/'.$file));
   $r  = rmdir ($dir.'/'.$file);
   $msgs[] = \n.'deleting dir.: '.$dir.'/'.$file.($r?'
SUCCESSFUL':' FAILED');
}
else {
   $r  = unlink($dir.'/'.$file); // remove this file
   $msgs[] = \n.'deleting file: '.$dir.'/'.$file.($r?'
SUCCESSFUL':' FAILED');
}

}

/[EMAIL PROTECTED]/closedir($handle);
return $msgs;
}

/* return an array of messages always - for the call array_merge() */
return array();
}


 
 function deleteFolders( $resource )
 {
   if( is_dir( $resource ) )
   {
   if( $dir = opendir( $resource ) )
   {
   while( false !== ( $file == readdir( $dir ) ) )
   {
   if( $file != '.'  $file != '..' )
   {
   
 $this-deleteFolders($resource.'/'.$file );
   }
   }
   closedir($dir);
   rmdir($resource);
   }
   else 
   {
   $this-LOG .= __LINE__ . : Unable to open
 directory\r\n;
   }
   }
   else 
   {
   
   if( is_file( $resource ) )
   {   
   unlink( $resource );
   }
   else 
   {
   $this-LOG .= __LINE__ . : Unknown path:
 $resource\r\n;
   }
   }
 }
 
 TIA, mark
 

-- 
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] Image submit with mouse over

2006-07-14 Thread Skip Evans

Hi all,

Brand new to the list, so here's my question. I am 
 implementing a bunch of Dreamweaver templates a 
designer has built into a PHP app, and one thing 
she did is create a submit button (image) that 
uses mouse over JS:


a href=user.php?req=login target=_top 
onMouseOver=MM_swapImage('signin','','/theme/images/admin/button_signin2.gif',1) 
onMouseOut=MM_swapImgRestore()img 
src=/theme/images/admin/button_signin.gif 
alt=Sign In name=signin width=86 height=20 
border=0/a


But notice this is an href, and it also needs to 
submit $_POST data through a couple of form fields 
that appear above. So what I tried to do in order 
to be able to retrieve the POST data on the 
receiving end was convert it to the following:


input type=image 
src=/theme/images/admin/button_signin.gif 
onfocus=MM_swapImage('signin','','/theme/images/admin/button_signin2.gif',1)

onblur=MM_swapImgRestore()

...However, the onfocus and onblur are not 
swapping out the images, as I had hoped. (Against 
all odds, maybe I should add.)


I know the client will pout and sniffle if they 
don't get their mouse over affect, so I am hoping 
for a solution.


Any suggestions would be greatly appreciated.

Thanks!
--
Skip Evans
Big Sky Penguin, LLC
61 W Broadway
Butte, Montana 59701
406-782-2240

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



Re: [PHP] Recurs Directory Delete

2006-07-14 Thread Adam Zey
So? Windows has this thing called the del command that does the same 
thing as rm.


Regards, Adam.

Mark Steudel wrote:

I wish, I'm on an IIS box.

Mark

-Original Message-
From: Richard Lynch [mailto:[EMAIL PROTECTED] 
Sent: Friday, July 14, 2006 2:09 PM

To: tedd
Cc: Mark Steudel; php-general@lists.php.net
Subject: Re: [PHP] Recurs Directory Delete

On Fri, July 14, 2006 2:07 pm, tedd wrote:

At 11:55 AM -0700 7/14/06, Mark Steudel wrote:

I was hoping someone could give me a hand, I'm trying to create a
delete
folders function that recursively deletes folders and files from a
given
directory.


If you want to delete EVERYTHING, an exec(rm -r $path) could
potentially be much more efficient.

You'd be trading the cost of opening up a mini-shell against PHP
iteration, so it would depend on the number of directories, but if
there are LOTS of files, the rm -r will probably win.



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



Re: [PHP] Image submit with mouse over

2006-07-14 Thread Skip Evans
My apologies to all. I assumed that JS questions 
would be entertained as the application is within 
a PHP app.


Sorry,
Skip

Chris W. Parker wrote:

Skip Evans mailto:[EMAIL PROTECTED]
on Friday, July 14, 2006 4:13 PM said:



Hi all,



Hey.



Brand new to the list, so here's my question.



[snip]



...However, the onfocus and onblur are not
swapping out the images, as I had hoped. (Against
all odds, maybe I should add.)



[snip]



Any suggestions would be greatly appreciated.



Being new to list is possibly why you're confused. This is a PHP list.
You should look for a Javascript mailing list or web forum.


Good luck!
Chris.




--
Skip Evans
Big Sky Penguin, LLC
61 W Broadway
Butte, Montana 59701
406-782-2240

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



Fwd: [PHP] Recurs Directory Delete

2006-07-14 Thread Andrew Kreps

[forwarding my response to the list, as the reply function didn't quite work]


Actually, that's not true.  'rm -rf' removes all files, directories
and subdirectories.  Microsoft's del has no analogy to that (although
there was a deltree command in older versions of DOS).  You still have
to manually (or programmatically) iterate through the directory
structure and run 'del *.*' and then 'rd directory' in every single
subdirectory to achieve the same result that the single command 'rm
-rf' gives you on UNIX-like systems.

On 7/14/06, Adam Zey [EMAIL PROTECTED] wrote:

So? Windows has this thing called the del command that does the same
thing as rm.

Regards, Adam.



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



Re: Fwd: [PHP] Recurs Directory Delete

2006-07-14 Thread Adam Zey

Andrew Kreps wrote:
[forwarding my response to the list, as the reply function didn't quite 
work]



Actually, that's not true.  'rm -rf' removes all files, directories
and subdirectories.  Microsoft's del has no analogy to that (although
there was a deltree command in older versions of DOS).  You still have
to manually (or programmatically) iterate through the directory
structure and run 'del *.*' and then 'rd directory' in every single
subdirectory to achieve the same result that the single command 'rm
-rf' gives you on UNIX-like systems.

On 7/14/06, Adam Zey [EMAIL PROTECTED] wrote:

So? Windows has this thing called the del command that does the same
thing as rm.

Regards, Adam.



Sure it does. I logged into a Win2K box and got help for rmdir/rd:

C:\rmdir /?
Removes (deletes) a directory.

RMDIR [/S] [/Q] [drive:]path
RD [/S] [/Q] [drive:]path

/S  Removes all directories and files in the specified directory
in addition to the directory itself.  Used to remove a 
directory

tree.

/Q  Quiet mode, do not ask if ok to remove a directory tree with /S

It seems like rmdir /S /Q directory is exactly identical to rm -rf 
directory. It deletes a directory tree (the -r), and doesn't prompt 
or display anything (the -f).


So, yes, this *CAN* be done on Windows. Sorry if I was wrong about del 
originally, but my point stands, Windows is not entirely crippled when 
it comes to the shell :)


Regards, Adam.

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



Re: Fwd: [PHP] Recurs Directory Delete

2006-07-14 Thread Andrew Kreps

Hey, *that's* where the deltree functionality went.  I wondered about
that.  I just tested that out, and it works like a charm!  Thanks for
the tip!


On 7/14/06, Adam Zey [EMAIL PROTECTED] wrote:

Andrew Kreps wrote:
 [forwarding my response to the list, as the reply function didn't quite
 work]


 Actually, that's not true.  'rm -rf' removes all files, directories
 and subdirectories.  Microsoft's del has no analogy to that (although
 there was a deltree command in older versions of DOS).  You still have
 to manually (or programmatically) iterate through the directory
 structure and run 'del *.*' and then 'rd directory' in every single
 subdirectory to achieve the same result that the single command 'rm
 -rf' gives you on UNIX-like systems.

 On 7/14/06, Adam Zey [EMAIL PROTECTED] wrote:
 So? Windows has this thing called the del command that does the same
 thing as rm.

 Regards, Adam.


Sure it does. I logged into a Win2K box and got help for rmdir/rd:

C:\rmdir /?
Removes (deletes) a directory.

RMDIR [/S] [/Q] [drive:]path
RD [/S] [/Q] [drive:]path

 /S  Removes all directories and files in the specified directory
 in addition to the directory itself.  Used to remove a
directory
 tree.

 /Q  Quiet mode, do not ask if ok to remove a directory tree with /S

It seems like rmdir /S /Q directory is exactly identical to rm -rf
directory. It deletes a directory tree (the -r), and doesn't prompt
or display anything (the -f).

So, yes, this *CAN* be done on Windows. Sorry if I was wrong about del
originally, but my point stands, Windows is not entirely crippled when
it comes to the shell :)

Regards, Adam.



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



RE: Fwd: [PHP] Recurs Directory Delete

2006-07-14 Thread Mark Steudel
Oooh, that's pretty neat. I was under the same impression as Andrew, that
DEL didn't do the same thing as rm -rf ... 

Thanks, Mark

-Original Message-
From: Adam Zey [mailto:[EMAIL PROTECTED] 
Sent: Friday, July 14, 2006 4:35 PM
To: Andrew Kreps
Cc: PHP General Mail List
Subject: Re: Fwd: [PHP] Recurs Directory Delete

Andrew Kreps wrote:
 [forwarding my response to the list, as the reply function didn't quite 
 work]
 
 
 Actually, that's not true.  'rm -rf' removes all files, directories
 and subdirectories.  Microsoft's del has no analogy to that (although
 there was a deltree command in older versions of DOS).  You still have
 to manually (or programmatically) iterate through the directory
 structure and run 'del *.*' and then 'rd directory' in every single
 subdirectory to achieve the same result that the single command 'rm
 -rf' gives you on UNIX-like systems.
 
 On 7/14/06, Adam Zey [EMAIL PROTECTED] wrote:
 So? Windows has this thing called the del command that does the same
 thing as rm.

 Regards, Adam.


Sure it does. I logged into a Win2K box and got help for rmdir/rd:

C:\rmdir /?
Removes (deletes) a directory.

RMDIR [/S] [/Q] [drive:]path
RD [/S] [/Q] [drive:]path

 /S  Removes all directories and files in the specified directory
 in addition to the directory itself.  Used to remove a 
directory
 tree.

 /Q  Quiet mode, do not ask if ok to remove a directory tree with /S

It seems like rmdir /S /Q directory is exactly identical to rm -rf 
directory. It deletes a directory tree (the -r), and doesn't prompt 
or display anything (the -f).

So, yes, this *CAN* be done on Windows. Sorry if I was wrong about del 
originally, but my point stands, Windows is not entirely crippled when 
it comes to the shell :)

Regards, Adam.

-- 
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] Image submit with mouse over

2006-07-14 Thread Tom Rogers
Hi,

Saturday, July 15, 2006, 9:13:04 AM, you wrote:
SE Hi all,

SE Brand new to the list, so here's my question. I am 
SE   implementing a bunch of Dreamweaver templates a 
SE designer has built into a PHP app, and one thing 
SE she did is create a submit button (image) that 
SE uses mouse over JS:

SE a href=user.php?req=login target=_top 
SE 
onMouseOver=MM_swapImage('signin','','/theme/images/admin/button_signin2.gif',1)
SE onMouseOut=MM_swapImgRestore()img 
SE src=/theme/images/admin/button_signin.gif 
SE alt=Sign In name=signin width=86 height=20 
border=0/a

SE But notice this is an href, and it also needs to 
SE submit $_POST data through a couple of form fields 
SE that appear above. So what I tried to do in order 
SE to be able to retrieve the POST data on the 
SE receiving end was convert it to the following:

SE input type=image 
SE src=/theme/images/admin/button_signin.gif 
SE 
onfocus=MM_swapImage('signin','','/theme/images/admin/button_signin2.gif',1)
SE onblur=MM_swapImgRestore()

SE ...However, the onfocus and onblur are not 
SE swapping out the images, as I had hoped. (Against 
SE all odds, maybe I should add.)

SE I know the client will pout and sniffle if they 
SE don't get their mouse over affect, so I am hoping 
SE for a solution.

SE Any suggestions would be greatly appreciated.

SE Thanks!
SE -- 
SE Skip Evans
SE Big Sky Penguin, LLC
SE 61 W Broadway
SE Butte, Montana 59701
SE 406-782-2240


to the href add onClick=formname.submit();return false;

or something like that.

-- 
regards,
Tom

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



Re: [PHP] GD to database directly

2006-07-14 Thread Kevin Waterson
This one time, at band camp, Richard Lynch [EMAIL PROTECTED] wrote:


 I'm more concerned about the disaster recovery of a DB from a crashed
 hard drive, which has been cluttered up with binary data, making data
 recovery.

One of the greatest benifits of binary DB storage is a single point
of back up
mysqldump db_name  backup.sql -u username -p
It really is as simple as that and no need to bother about referential
integrity when rebuilding, simple
mysql db_name  back.sql -u username -p

How much easier does it get?
 
 Then your field storage size has to be large enough.

LONGBLOB

 Given the number of posts here in PHP-General alone, of people getting
 tripped up by these things, I have concluded that cramming images into
 the DB is far more trouble than it is worth.
 
 It *seems* like a Good Idea until you actually do it for awhile, and
 then run into all these snags.

Oddly enough, I have never run into them. Nor has terraserver which stores
hundreds of thousands of images in its db, although not mysql.

Kevin

-- 
Democracy is two wolves and a lamb voting on what to have for lunch. 
Liberty is a well-armed lamb contesting the vote.

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