I'm sure that this code can be written more efficient, please tell me how,
but that's not my problem. The problem is that when i run this script all
lines are executed. I'm sure I'm doing something wrong, but can't find out
just what.
?php
if (isset($variable))
{
if ($variable
[snip]
?php
if (isset($variable))
{
if ($variable $constant)
{
Execute this code if $variable is less than $constant
}
elseif ($variable $constant)
{
Execute this code if $variable is more than $constant
}
elseif ($variable
stuff
}
else
{
other stuff
}
}
else
{
even more stuff
}
M
-Original Message-
From: Geir Anders Berge [mailto:[EMAIL PROTECTED]
Sent: 28 January 2005 19:05
To: php-general@lists.php.net
Subject: [PHP] Some questions about if and isset
Geir Anders Berge wrote:
I'm sure that this code can be written more efficient, please tell me how,
but that's not my problem. The problem is that when i run this script all
lines are executed. I'm sure I'm doing something wrong, but can't find out
just what.
Okay, it's REALLY hard to see how
Could anyone tell me, is it possible to connect to a persistent socket
after it has been opened by a different script? There is little
documentation on this function. I did a quick search on google and lots
of people say you can't, some say you can but its really hard and the
rest go...pf what??
--- Gareth Hastings [EMAIL PROTECTED] wrote:
Could anyone tell me, is it possible to connect to
a persistent socket after it has been opened by a
different script?
Sure. Think of it like a persistent database connection in
Oracle, where the listener is on socket 1521 for everyone.
The
: Re: [PHP] Some questions regarding pfsocketopen()
--- Gareth Hastings [EMAIL PROTECTED] wrote:
Could anyone tell me, is it possible to connect to
a persistent socket after it has been opened by a
different script?
Sure. Think of it like a persistent database connection in
Oracle
You will need to have everythng on the same page. Your program ends once the page
does.
Here are some examples straight from the manual.
?php
$fp = fsockopen (www.example.com, 80, $errno, $errstr, 30);
if (!$fp) {
echo $errstr ($errno)br\n;
} else {
fputs ($fp, GET / HTTP/1.0\r\nHost:
You will need to have everythng on the same page. Your program ends
once
the page does.
pfsocketopen() is persistent and stays open even after your script has
finished running until either the timeout period is reached or it gets
disconnected/closedI think. I just don't know how to
Cool... Maybe I will learn something.. :-)
Well in that case (I already deleted you last mail), where are you keeping the file
pointer?
You will need to register the var somewhere.. In a session perhaps?
Mike
Send me your code... I will play with it...
*** REPLY SEPARATOR
Well I didnt try to write or read to it...
But this works But all that's telling me is that the var is there.. not if it's
still open.. will leave that to you to find out... Let us know
--file s1.php ---
?php
session_start();
$sid
-
From: Michael J. Pawlowsky [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 02, 2003 4:32 PM
To: Gareth Hastings
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] Some questions regarding pfsocketopen()
Well I didnt try to write or read to it...
But this works But all that's telling me
Two comments from the manual that are interesting:
php dot net at domainofdarkness dot com
29-Jan-2001 04:26
OK, WRT to the p* functions opening a new connection when one already exists. It is my
understanting that (under Apache anyways) this is on a per-process basis. If you do a
'ps
to google :)
-Original Message-
From: Michael J. Pawlowsky [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 02, 2003 5:10 PM
To: Gareth Hastings; [EMAIL PROTECTED]
Subject: RE: [PHP] Some questions regarding pfsocketopen()
Two comments from the manual that are interesting
Well if you do find the solution please let us know. I would also like to add it to my
PHP lib archive.
I suppose it would be there for stuff like command line PHP.
Mike
*** REPLY SEPARATOR ***
On 02/01/2003 at 5:15 PM Gareth Hastings wrote:
Yes I saw those but what it
On Friday 03 January 2003 06:15 am, Gareth Hastings wrote:
Yes I saw those but what it made me think, what's the point of a
persistent socket if you can't use it again?
i think you could, after enough iterations and if the server allows,
get to a point where each process has its own
Hello
I'm a Chinese university student,I want to ask some questions about session.
These days I'm build a website for my university with PHP, But I meet a
question when I develop the part of User Management: After I have log out
from a user page(I use session_unset() and
] == $registered_login $_GET[ses] == session_id())
// ok autenticated
else
// error: not autenticated
From: mintbaggio [EMAIL PROTECTED]
To:
Subject: [PHP] Some questions.
Date: Tue, 13 Aug 2002 01:42:55 +0800
Hello
I'm a Chinese university student,I want to ask some questions about
on 13/08/02 3:42 AM, mintbaggio ([EMAIL PROTECTED]) wrote:
I'm a Chinese university student,I want to ask some questions about session.
These days I'm build a website for my university with PHP, But I meet a
question when I develop the part of User Management: After I have log out
from a
this (haven't got around to installing it).
Best Regards
Bob Irwin
Server Admin Web Programmer
Planet Netcom
- Original Message -
From: Justin French [EMAIL PROTECTED]
To: mintbaggio [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Tuesday, August 13, 2002 12:21 PM
Subject: Re: [PHP] Some
How about the sessions?
doesn't sessions also needs to send header data (before any other output)?
the sessions are registered normally..
At 17:07 12/11/01 -0800, Christopher William Wesley wrote:
Your problem probably is including the miec.php from the .shtml
document. Does the .shtml
But what about the session? It get's registered... doesn't sessions also
need to send header information?
it gets registered... it just doesn't persist...
At 17:07 12/11/01 -0800, you wrote:
Your problem probably is including the miec.php from the .shtml
document. Does the .shtml document send
I've recently had a problem with sessions, and came up with a problem that
apparently has no solution...
I want to understand why EXACTLY it does't work...
From what I understand about sessions (reading PHP Docs), cookies are
default and URLs holding the session_id are used if the cookies
Your problem probably is including the miec.php from the .shtml
document. Does the .shtml document send any output to the browser before
including your .php script? If so, you're not going to be able to send
any cookies from the .php script. Once any standard output makes it to
the browser
Does anyone here use PHPUnit?
1. If a test script needs some external input to do testing
(notably, database connect info), is it a good idea to present
an HTML form to ask input from user? Or should it also be able
to prompt the user for these in case the test script is run by the PHP
25 matches
Mail list logo