php-general Digest 14 Jul 2006 14:32:59 -0000 Issue 4239

Topics (messages 239455 through 239465):

Re: [totaly off t****]
        239455 by: Robert Cummings

Zend Studio, phpMyAdmin, and mysql.sock
        239456 by: Dave M G
        239464 by: David Tulloh

PAGE TURNED BECOME SOURCE CODE VIEW..
        239457 by: BBC
        239458 by: Kim Christensen
        239460 by: BBC
        239461 by: Andrei

Re: Multiple sessions
        239459 by: Tony Marston

Re: session_start/session_write_close creates multiple sessioncookie headers. 
How to fix this.
        239462 by: Mathijs
        239463 by: Mathijs

regular expression to extract from the middle of a string
        239465 by: Steve Turnbull

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [email protected]


----------------------------------------------------------------------
--- Begin Message ---
On Thu, 2006-07-13 at 22:11, Ligaya Turmelle wrote:
> Jay Blanchard wrote:
> > [snip]
> > ...stuff...
> > [/snip]
> > 
> > I think I can help, because <em>I</em> am the man.
> > 
> And when you are tired of listening to the men yell about how great they 
> are...
> 
> I, the WOMAN, will actually do it

Yes! But with which of the men? *ducks*


-- 
.------------------------------------------------------------.
| 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.          |
`------------------------------------------------------------'

--- End Message ---
--- Begin Message ---
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

--- End Message ---
--- Begin Message ---
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
> 

--- End Message ---
--- Begin Message ---
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============
                     **o<0>o**

--- End Message ---
--- Begin Message ---
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

--- End Message ---
--- Begin Message ---

> 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($imgratio>1)
{
 $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 successful<br> ";
}else{
copy($some_where,$where_to);
}

And thank for your input..

--- End Message ---
--- Begin Message ---
    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($imgratio>1)
> {
>  $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 successful<br> ";
> }else{
> copy($some_where,$where_to);
> }
> 
> And thank for your input..
> 

--- End Message ---
--- Begin Message ---
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 

--- End Message ---
--- Begin Message ---
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.

--- End Message ---
--- Begin Message ---
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.


---
avast! Antivirus: Outbound message clean.
Virus Database (VPS): 0628-4, 07-13-2006
Tested on: 07-14-2006 11:59:42
avast! - copyright (c) 1988-2006 ALWIL Software.
http://www.avast.com

--- End Message ---
--- Begin 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

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/

--- End Message ---

Reply via email to