-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 16, 2005 2:27 PM
To: php-general@lists.php.net
Subject: [PHP] How to access any function of a any class?
Hello.
Please consider this:
class A {
[snip]
class B {
[snip]
class Container{
I'm trying to learn functions (just started). I can't see why this fails:
?php
function count($var)
{
if ($var == 10){
$result = $var + 10;
return $result;
}
else {
$result = $var + 20;
return $result;
}
}
$setvar = 10;
count($setvar);
echo $result;
?
I probably just didn't understand my manual.
Hi all,
(Apologies for the larger than normal wrapping - there are some long lines)
I'm playing with SimpleXML for reading REST responses from Amazon Web Services.
Having successfuly read the response to my request I'd like to perform an xpath
query
on the result. I've pared down the original
Hi
Dont call you function count
-Original Message-
From: William Stokes [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 17, 2005 10:25 AM
To: php-general@lists.php.net
Subject: [PHP] VERY basic function question
I'm trying to learn functions (just started). I can't see why this fails:
On Thu, 17 Mar 2005 10:24:31 +0200, William Stokes [EMAIL PROTECTED] wrote:
I'm trying to learn functions (just started). I can't see why this fails:
?php
function count($var)
You cannot use count as a function name - count() actually does
something - see the php manual
{
if ($var == 10){
And another thing
Let say you called you function count1
Change :
count1($setvar);
to :
$result = count1($setvar);
echo $result;
-Original Message-
From: William Stokes [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 17, 2005 10:25 AM
To: php-general@lists.php.net
Subject: [PHP] VERY
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 16, 2005 2:27 PM
To: php-general@lists.php.net
Subject: [PHP] How to access any function of a any class?
Hello.
Please consider this:
class A {
[snip]
class B {
[snip]
class
Abandon all your hopes, this will not work (unless you do some heavy
programming/patching) because modules interfere with each other. I've been
trying this for a week without success.
Still the best/easiest approach is to set up ordinary apache/PHP4 server
combination with proxy support
Versioned libraries do not work either.
Bostjan
On Wednesday 16 March 2005 23:11, Rasmus Lerdorf wrote:
Kim Madsen wrote:
-Original Message-
From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 15, 2005 4:05 AM
That's why I'd like to stick with apache2 + php5
Hi, Jason,
Thanks a lot for suggestion. Does it mean that I have tried to
serialize some object (like adodb db object)? How I can eliminate this?
I really cannot find where this object or whatever else is going to be
serailized. The problematic line of code just serialized an array.
On Mar
Hi
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 17, 2005 10:04 AM
I'm sorry Kim, but it is possible, I've made a web hosting control panel
using entirely this approach and it is working very well for months now.
A
demo:
on 3/16/05 12:46 PM, Todd Trent at [EMAIL PROTECTED] wrote:
- This could be hosted on shared hosting server.
- Opt-in list could be less than 100 or in the 1000¹s.
- May need a way to track sending success.
Check this out:
http://phpmailer.sourceforge.net/
I use it to create HTML emails,
Is session time measured in seconds or minutes?
Regards
Jacques
Jacques [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
What is the life time of a PHP session object (variable)? Which
conditional test can I perform to check if the session object has timed
out?
Jacques
--
Lo all,
echo ConvertTime($AcctSessionTime/90); # Returns: 03:17:46.77
I am trying to drop the .whatever.. Thus,
list($Duration, $none) = split('.', ConvertTime($AcctSessionTime/90), 2);
However, $Duration is empty, and $none has the whole string from
ConvertTime As I said, something
On Thu, 17 Mar 2005 12:19:38 +0100, Ken [EMAIL PROTECTED] wrote:
Header for download script
http://localhost/download.php?fid=1SID=bb9309b20034a71e4c59382028afd1c3user=strikers
GET /download.php?fid=1SID=bb9309b20034a71e4c59382028afd1c3user=strikers
i forgot to add: pressing go has the same effect as refresh.
On Thu, 17 Mar 2005 12:20:12 +0100, Ken [EMAIL PROTECTED] wrote:
On Thu, 17 Mar 2005 12:19:38 +0100, Ken [EMAIL PROTECTED] wrote:
Header for download script
sir,
i downloaded the zip from
http://php.chregu.tv/sql2xml/. and then i couldnt know what i am suppose
to do..
when i tried running the file am getting error
Fatal error: main() [function.require]: Failed opening required
'XML/sql2xml.php' (include_path='.:/usr/local/lib/php') in
[] was the answer... Something stupid sorted :)
--
Chris
- Original Message -
From: Chris Knipe [EMAIL PROTECTED]
To: php-general@lists.php.net
Sent: Thursday, March 17, 2005 1:16 PM
Subject: [PHP] something stupid... split().
Lo all,
echo ConvertTime($AcctSessionTime/90); # Returns:
-Original Message-
From: Chris Knipe [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 17, 2005 12:16 PM
To: php-general@lists.php.net
Subject: [PHP] something stupid... split().
echo ConvertTime($AcctSessionTime/90); # Returns: 03:17:46.77
I am trying to drop the .whatever..
I dont think so, because nothing is declared private in the present
code.
But they _might_ be as default in PHP5 ;-) That´s the really annoying
difference between JAVA and C++, one is public by default, the other is
private by default. I don´t know which approach they´ve chosen in PHP5, I
Looking for the most code efficient way to do multiple boolean OR's on one
line
if ($name==andrea) OR ($name==john)
Ta
AD
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Looking for the most code efficient way to do multiple boolean OR's on one
line
if ($name==andrea) OR ($name==john)
Ta
AD
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Looking for the most code efficient way to do multiple boolean OR's on one
line
if ($name==andrea) OR ($name==john)
Ta
AD
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
can do:
if ($name==andrea || $name==john)
On 17 Mar 2005, at 11:59, AndreaD wrote:
if ($name==andrea) OR ($name==john)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Hi,
I have a mysql database where i store a user name and date when he registered.
The date format is like this 2005-03-17 02:41:51.
How can i found out how many minutes passed from the date he registered till
now.
Thanks in advance for your help !
Rob Richards kindly sent me the following response via email - posting it here
as he's not subscribed.
You need to register a namespace for XPath since there's a default
namesapce.
$xml = simplexml_load_file('test.xml');
/* Register arbitrary namesapce prefix for xpath*/
I have about 10 text boxes each taking in value (ages) , The code I have
checks for a value and if it is set it then sets the cookie to that value.
The else just clears the value. On the next page I use a foreach to get the
values but I think there must be a quicker way to collect the data
This works...
if ($name == jim || andrea || tommy)
I must have had an extra ( somewhere.
AD
AndreaD [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Looking for the most code efficient way to do multiple boolean OR's on one
line
if ($name==andrea) OR ($name==john)
Ta
AD
--
Difficult to be definitive without seeing your code, but I would be
tempted by the use of arrays...
cheers
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
and if u've got several checks for just $name, u could use in_array
(http://php.net/in_array).
if (in_array($name, array('andrea', 'john', 'jane')))
it's case sensitive so if the array has all lower-case letters, u
might wanna use strtolower (http://php.net/strtolower) on $name.
for general
store the date as a 'unix timestamp', so you can easily compare
the stored timestamp with the current timestamp, by doing a
simple calculation you can get the duration in minutes without
a headache.
http://www.php.net/time
vk.
On Thu, 17 Mar 2005 14:32:48 +0200, [EMAIL PROTECTED]
[EMAIL
[snip]
when I define a number as
$number = 2.00
then echo it the number shows as 2. How can I get the two zeros to show?
This is not in any of my books but a fairly easy solution I'll bet!
[/snip]
http://www.php.net/number_format
--
PHP General Mailing List (http://www.php.net/)
To
AndreaD wrote:
I have about 10 text boxes each taking in value (ages) , The code I have
checks for a value and if it is set it then sets the cookie to that value.
The else just clears the value. On the next page I use a foreach to get the
values but I think there must be a quicker way to
Think what I want to do then is create two arrays, one for the values of the
age and one for the correponding name e.g.
$age = array() // this is the inputed textbox values
$name= array('john', 'bob', 'tim')
Then I need to assign the the ages to cookie of the persons name by using a
for or
I don't know whats wrong with this. Can someone help please.
?php
require sql.php;
function shit_func($var)
{
$sql = select * from users where sessionid='$sessionid' ;
$kys = mysql_query($sql);
$user = mysql_fetch_row($kys);
$k_tun = $user[0];
$ok1 = $user[4];
$ok2 = $user[5];
$ok3 = $user[6];
AndreaD wrote:
This works...
But not the way you think it does.
if ($name == jim || andrea || tommy)
This if statement will first check to see if $name == jim (oh yeah,
you are missing quotes around jim, andrea, and tommy, by the way). Then,
it does *NOT* check to see if $name == andrea.
Test for a lock file when the script starts, and remove it when the
script ends. This isn't 100% reliable, but it's the typical solution to
this problem. If the script fails, the lock file may not be removed
(ever have a Mozilla browser crash and tell you the default profile is
locked?), so be
Will
Whatever you are making available in the required file sql.php, it is
not accessible by the function shit_func. Define the connection string
or whatever as a global inside function shit_func and it should work,
else make the connection within the function - not such a good idea...
chris
--
K Karthik wrote:
...
i downloaded the zip from
http://php.chregu.tv/sql2xml/. and then i couldnt know what i am suppose
to do..
when i tried running the file am getting error
Fatal error: main() [function.require]: Failed opening required
'XML/sql2xml.php'
Andrei Verovski wrote:
Hi, Jason,
Thanks a lot for suggestion. Does it mean that I have tried to
serialize some object (like adodb db object)? How I can eliminate this?
I really cannot find where this object or whatever else is going to be
serailized. The problematic line of code just
I would be tempted to do the following.
First, I would setup the html form so that the text boxes are named
something like 'age[Andrea]', 'age[Bob]', etc. When the form submitted,
this will give you an array, accessible as $_POST['age'] (or
$_GET['age'] depending on whether you used POST or GET
Scott Haneda wrote:
...
I use it to create HTML emails, send them to 1000's of people. I think I
did a test to 30K or so, it handled it fine using mail locally.
HTML emails [shudder]
As for tracking, what we do is embed a image bug in the html and track when
that loads, it is getting less
Jacques wrote:
Is session time measured in seconds or minutes?
seconds
--
Teach a man to fish...
NEW? | http://www.catb.org/~esr/faqs/smart-questions.html
STFA | http://marc.theaimsgroup.com/?l=php-generalw=2
STFM | http://php.net/manual/en/index.php
STFW | http://www.google.com/search?q=php
Yeah, after hitting the send button, I looked again at what I sent and
realized something else. Having already caused PHP to put the stuff into
an array, by the way I suggested constructing the form, you can
eliminate the foreach loop, and just use the assignment operator to get
PHP to copy
I had my admin change the
session.use_trans_sid = 1
to =0
no more sess ID in the URL - woo hoo
I guess this has to be 0 or in later versions 4.3.0
session.use_only_cookies = 1
*
Hello
I have tested this app on my machine but it doesnt do this - but
Thanks for all your replies.
I liked Jeffs approach as it was more straightforward and using
age[Andrea] for the texboxes creates les confusion when doing the foreach
statement.
I didn't quite get the cookie vs session bit. Are you saying they [cookies]
use greater resources?
AD
AndreaD
This may be a stupid question. If it is, could somebody do a one line reply
of it is. That way I will know to turn my attention elsewhere.
I've gone through about 45 pages of archives trying to glean anything useful
out of it, and either it's the same answer or the version is about 4 years
out of
Hi,
I've read:
http://dev.mysql.com/doc/mysql/en/create-table.html
Would anyone code/approach this differently?
#
$server = localhost;
$user = myname;
$pass = mypass;
$db = mydb;
$table = demo_assignment1;
[EMAIL PROTECTED] wrote:
when I define a number as
$number = 2.00
then echo it the number shows as 2. How can I get the two zeros to show?
This is not in any of my books but a fairly easy solution I'll bet!
please consider php.net as your book too ;-)
have fun with the following:
?php
$newLine =
Steven Altsman wrote:
This may be a stupid question. If it is, could somebody do a one line reply
of it is. That way I will know to turn my attention elsewhere.
...
It's not a stupid question, it's just that the people that have read it
so far (including me) don't really know the answer. I
DuSTiN KRySaK wrote:
Does anyone know of a PHP source code formatter to clean up sloppy code
that runs on OS X?
maybe the php tidy extension works?
http://php.net/tidy
d
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Does anyone know what kind of string encoding this is :
regreg
mAreg
and how can I decode this?
--
Diana Castillo
Global Reservas, S.L.
C/Granvia 22 dcdo 4-dcha
28013 Madrid-Spain
Tel : 00-34-913604039 Ext 216
Fax : 00-34-915228673
email: [EMAIL PROTECTED]
Web : http://www.hotelkey.com
symbulos partners wrote:
Dear friends,
we would like to migrate a server where we host several websites (in virtual
hosting) to PHP 5 with Apache 2.
Technical support at the hosting provider told us there are still problems
about safety of threads on php 5 + Apache 2 (management of memory). They
Mignon Hunter wrote:
Ok I got this to work but I'm not sure how -- and am having trouble
re-producing the data:
My script I have so far is:
$lines = file('test2.csv');
foreach ($lines as $line) {
$line_split = explode(,, $line);
if(!(empty($line_split[0]) ) ){
//echo I'm not empty;
AndreaD wrote:
Looking for the most code efficient way to do multiple boolean OR's on one
line
if ($name==andrea) OR ($name==john)
If you put an opening brace after that, you'll get a parse error. You're
also treating andrea and john as constants, which I'm guessing isn't
what you mean. I
Diana Castillo wrote:
Does anyone know what kind of string encoding this is :
regreg
mAreg
and how can I decode this?
That looks almost like an HTML entity:
reg;
Assuming that's what it is, and you just left off the semicolon, you can
decode it with this:
html_entity_decode()
Hope that helps.
AndreaD wrote:
I have about 10 text boxes each taking in value (ages), The code I have
checks for a value and if it is set it then sets the cookie to that value.
The else just clears the value. On the next page I use a foreach to get the
values but I think there must be a quicker way to collect
Yes, the link is http://www.radinks.com/upload/config.php
file_uploads = On
upload_max_filesize = 40M
max_input_time = 9000 (seconds)
memory_limit (not limited, per handload config, from source)
max_execution_time = 9000 (seconds)
post_max_size = 40M
also, hidden INPUT tag MAX_FILE_SIZE with
Kevin wrote:
Dear mr. Maas,
no need for 'mr' :-)
First of all my appologies for taking so long to respond. I had a family
death to attend to.
my condolences.
there is no need to apologise in any case.
...
why is OBC relevant, I read later on that you take the start of egyptian
civilization as
For the sake of someone who may benefit from this info:
I resolved this by removing the file
/usr/local/etc/php/extensions.ini
and then reinstalling the php5 base
and then reinstalling php5-extensions
-Original Message-
From: Al Arzaga
Sent: Wednesday, March 16, 2005 10:34 PM
To:
I've always known that you can specify a domain when you set a cookie,
and for kicks I experimented with a test page setting a cookie for the
yahoo.com. Seems to me that browsers wouldn't allow this as it could
create any number of security problems. I tried the following code, and
the yahoo
I tryed the function that aarondunlap.com sent the 28 dec 2004.
The browser open the window for download, I get the file on the client , same
size as the original but
when I want to open the file , it's corrupted.
It's like if the script file is mixed with the file I sent
(I tryed with IE and
Brian Dunning mailto:[EMAIL PROTECTED]
on Thursday, March 17, 2005 4:45 PM said:
Question: why didn't this work, is it supposed to work the way I was
trying, and if not, then what is that domain variable there for???
Answer:
Seems to me that browsers wouldn't allow this as it could
Brian Dunning wrote:
I've always known that you can specify a domain when you set a cookie,
and for kicks I experimented with a test page setting a cookie for the
yahoo.com. Seems to me that browsers wouldn't allow this as it could
create any number of security problems.
This is why the
Where did the string come from?
Jim
PHP WebBlog =
http://www.litfuel.net/plush/
Diana Castillo wrote:
Does anyone know what kind of string encoding this is :
regreg
mAreg
and how can I decode this?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
--- the forwarded message follows ---
Akses Internet TELKOMNet-Instan beri Diskon s.d. 50 % khusus untuk wilayah Jawa Timur.
Informasi selengkapnya di www.telkomnetinstan.com atau hub 0800-1-INSTAN
I suspect it's
for sub-domains of sites you administer and not completely different
domains altogether.
If this is true, and it's not possible for a site to set a cookie for a
completely different domain, then why do browsers have security options
to allow or prevent this specific action? I'm
Hi All,
This is a very interesting website.
Visit www.lifenit.com
Also I can refer one more sebsite for you..
www.merchantii.com
Hope these were Useful.
Rgds,
Freshersworld
First Job. Dream Job... Freshersworld.com
__
Do You
Visit www.Merchantii.com
--- Ahmed Abdel-Aliem [EMAIL PROTECTED] wrote:
hi
i use this code to send email from mysite
but when it sends to some accounts it repeats the
body part twice in
the same email while to other accounts it sends the
body one time only
can anyone help in that plz
What is with all the crap india programming sites spamming this list?
I for one, am not interested in web sites that are competing to take my
clients. If I have to explain one more time why it is NOT better to
pay less to deal with a company across the a few oceans versus' paying
more for
Wahyu SP wrote:
--- the forwarded message follows ---
Akses Internet TELKOMNet-Instan beri Diskon s.d. 50 % khusus untuk
wilayah Jawa Timur.
Informasi selengkapnya di www.telkomnetinstan.com atau hub
Hello,
Just simple question (I think?)
How to pass return value from function to the main program?
Here's example:
do some code in funtion to set the $res value:
} elseif ($rightsid == $oik6) {
$res = ok;
return $res;
} elseif ($rightsid == $oik7) {
$res = notok;
return $res;
}
How
72 matches
Mail list logo