Re: [PHP] Single Quotes vs Double Quotes

2003-09-09 Thread Raditha Dissanayake
Hi,
the $ sign inside single quotes is just a dollar sign. When you place it 
inside double quotes it's the start of a variable name.
This is because what is inside single quotes are unparsed while whats 
inside double quotes are parsed. For this reasong if you are having to 
print out lengthy string literals you should use single quotes. else you 
can always safely use doubles.



micro brew wrote:

Hi everyone,

Could somebody please explain to me the difference
between single quotes and double quotes in PHP.  It
seems like they can be used interchangeably a lot in
PHP but not always. For example:
This works:
header('Location: http://somedomain.com')
This does not work:
header('Location: $url')
This works:
header(Location: $url)
Why???  Sorry if this has been asked before, but I
didn't find a suitable answer in the archives.  TIA.
Mike

__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
 



--
http://www.radinks.com/upload
Drag and Drop File Uploader.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Question about MySQL 4.0

2003-09-09 Thread T. Hart
I'm just curious that if anything special has to be
done to PHP (besides recompiling) after upgrading to
MySQL 4.0. I noticed that they are removing C API
commands like mysql_connect() and was unsure if these
are the same ones that PHP uses. Any help would be
appreciated. Thanks.

__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

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



[PHP] Installing php with gd what a pain!

2003-09-09 Thread Dhaval Desai
Hello Guys,

I am trying to install php 4.3.2 with gd support. I have already installed 
zlib and jpeg-6b. My configure line options are as below:

./configure --with-gd --with-jpeg-dir=/usr/lib
it doesn't work.
I tried
./configure --with-gd --with-jpeg-dir=/usr/local/bin
it still doesn't work even tough all the cjpeg and djpeg files are there...


it says libjpeg not found for both

Could anybody tell me what could be wrong?

-Dhaval

_
MSN 8 with e-mail virus protection service: 2 months FREE* 
http://join.msn.com/?page=features/virus

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


Re: [PHP] adodb and php5

2003-09-09 Thread SLanger
Hello 

Did you compile mysql or any of the other databases into php5? As far as I 
know php5 does not come with mysql anymore because of some licence issues. 
So if you haven't compiled it yourself it shouldn't be available and hence 
not supported by adodb.

Just a guess

Regards
Stefan Langer

Re: [PHP] Installing php with gd what a pain!

2003-09-09 Thread Jason Wong
On Tuesday 09 September 2003 14:49, Dhaval Desai wrote:

 I am trying to install php 4.3.2 with gd support. I have already installed
 zlib and jpeg-6b. My configure line options are as below:

PHP + GD installation problems have been covered many times before on the list 
and almost everything there is to know about it are in the archives.

 ./configure --with-gd --with-jpeg-dir=/usr/lib
 it doesn't work.

Very likely,

  ./configure --with-gd --with-jpeg-dir=/usr

would work.

 it still doesn't work even tough all the cjpeg and djpeg files are there...


 
 it says libjpeg not found for both
 

It would be more helpful to state the *exact* error message. And very often 
googling on the error message would point you in the right direction.

 Could anybody tell me what could be wrong?

You gave the wrong directory for the --with-jpeg-dir option. But you didn't 
give enough details for us to help you, ie:

 - where your libjpeg files are installed
 - what the error message is

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
All vacations and holidays create problems, except for one's own
-- Murphy's Laws on Work n„1¤734
*/

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



Re: [PHP] Mail() question

2003-09-09 Thread Jason Wong
On Tuesday 09 September 2003 08:12, Ryan A wrote:

 I am trying to create a new newsletter software as the ones i found on
 hotscripts were just not good enough or mucho $$ which i dont have :-(

[snip]

All your questions have been covered before and the answers are in the 
archives.

 Please note that i I intend to add a kind of word merge functionality later
 on.
 eg:
 Dear ::name::,
 thank you for subscribing your email address: ::email::
 etc etc

For this, your only choice is to send mails out individually.

--  
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
There is no education that is not political.  An apolitical
education is also political because it is purposely isolating.
*/

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



[PHP] Session Variables in a Class

2003-09-09 Thread micro brew
Hi everyone,

I've been experimenting with sessions.  I can make
them work just fine in a normal PHP page.  But when I
create a class and try to define a session variable
within a method in the class it won't work.  I've
tried setting the session variable directly
($_SESSION['name']='somevalue') but that didn't work. 
The normal way of setting it -
session_start();
session_register('name'); 
$name='somevalue';

- didn't work either (within the class).

Am I just missing something obvious?  Any suggestions?
 TIA.

Mike

__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

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



RE: [PHP] Single Quotes vs Double Quotes

2003-09-09 Thread Ralph Guzman
Read this article:

http://www.zend.com/zend/tut/using-strings.php


-Original Message-
From: micro brew [mailto:[EMAIL PROTECTED] 
Sent: Monday, September 08, 2003 9:04 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Single Quotes vs Double Quotes

Hi everyone,

Could somebody please explain to me the difference
between single quotes and double quotes in PHP.  It
seems like they can be used interchangeably a lot in
PHP but not always. For example:

This works:
header('Location: http://somedomain.com')

This does not work:
header('Location: $url')

This works:
header(Location: $url)


Why???  Sorry if this has been asked before, but I
didn't find a suitable answer in the archives.  TIA.

Mike

__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

-- 
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] -f function ???

2003-09-09 Thread Ivo Fokkema
[snip]
 Does this parameter have anything to do with the -f option of the
Unix/Linux sendmail command?
[/snip]

I'm not a linux expert, but as far as I know, it's the same. It allows users
to set the Return-Path header with the mail() function, but this is
disallowed when your PHP is set to safe_mode.

HTH,

Ivo

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



Re: [PHP] Mail() question

2003-09-09 Thread Ryan A
Hey,
Thanks for replying.
I had a look at quick ezmlm but it seems to be more of a mailing list
software than a newsletter one, and since its not in php i cant really dig
in and shape it to my needs...:-(
Thanks anyway,
Cheers,
-Ryan

 Hi,
 Why don't you take a look at ezmlm instead. This is open source and free
 and widely considered to be the best around. But it's not in php though
:-)


 Ryan A wrote:

 Hi everyone,
 I am trying to create a new newsletter software as the ones i found on
 hotscripts were just not good enough or mucho $$ which i dont have :-(
 
 Have finished the basics but need some advise now.
 I am using a mysql database instead of text files.
 
 I have a table with the fields name and email, my questions are,
 1:is it better to use a for loop and then send each mail?
 2:should i first put all the names and addresses into an array?
 3:Is it better to send each mail independantly or use BCC? (one mail
 blast., will it work?)
 
 
 
 Please note that i I intend to add a kind of word merge functionality
later
 on.
 eg:
 Dear ::name::,
 thank you for subscribing your email address: ::email::
 etc etc
 
 Am expecting the list to grow to around 5000 or more.
 
 When replying if possible please give program examples or links as am not
 very familier with this.
 
 Thanks in advance,
 -Ryan
 
 
 
 
 
 We will slaughter you all! - The Iraqi (Dis)information ministers site
 http://MrSahaf.com
 
 
 


 -- 
 http://www.radinks.com/upload
 Drag and Drop File Uploader.





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



Re: [PHP] Mail() question

2003-09-09 Thread Ryan A
Hey Jason,
Thanks for replying.

I did search the archive for newsletter, newsletter software and
variations but didnt come up with much. I got a lot of german and other
results too from php general,debian etc

Will do another search on mail now.


  Please note that i I intend to add a kind of word merge functionality
later
  on.
  eg:
  Dear ::name::,
  thank you for subscribing your email address: ::email::
  etc etc

 For this, your only choice is to send mails out individually.

Thanks, maybe i can program an option something like
if ($mail_merge==1)
{send_singles();}
else
{send_bcc();}


Any advise is welcome.

Cheers,
-Ryan




 -- 
 Jason Wong - Gremlins Associates - www.gremlins.biz
 Open Source Software Systems Integrators
 * Web Design  Hosting * Internet  Intranet Applications Development *
 --
 Search the list archives before you post
 http://marc.theaimsgroup.com/?l=php-general
 --
 /*
 There is no education that is not political.  An apolitical
 education is also political because it is purposely isolating.
 */

 -- 
 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] Mail() question

2003-09-09 Thread Jason Wong
On Tuesday 09 September 2003 17:02, Ryan A wrote:

 I did search the archive for newsletter, newsletter software and
 variations but didnt come up with much. I got a lot of german and other
 results too from php general,debian etc

 Will do another search on mail now.

mass mailing, bulk mailing would probably be better search terms.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Systems programmers are the high priests of a low cult.
-- R.S. Barton
*/

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



[PHP] Re: Problem Coding a Tutorial

2003-09-09 Thread Kae Verens
Stephen Tiano wrote:
Kae,

Excuse my being dense, but I just want to get your meaning with the
lines you added. You're saying to substitute
if($_POST['submit']=='Sign!')

for

if ($submit == Sign!)

and  to try ('$_POST[name]', ...  (and not $_POST['name'])?
in your code, the first variable was $submit. The $_POST version of this 
is $_POST['submit'].
the second set of variables was /already within quotes/, therefore the 
quotes around the variable name should be left out.

the best way to write quoted variables is probably to exit quote mode 
first, but I thought that might be too confusing for just a little code. 
For example:
echo '$submit = '.$_POST['submit'];
instead of:
echo \$submit = $_POST[submit];

I hope that helps clarify it a bit.

Kae

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


Re: [PHP] Session Variables in a Class

2003-09-09 Thread Marco Schuler
Am Die, 2003-09-09 um 10.19 schrieb micro brew:
 Hi everyone,
 
 I've been experimenting with sessions.  I can make
 them work just fine in a normal PHP page.  But when I
 create a class and try to define a session variable
 within a method in the class it won't work.  I've
 tried setting the session variable directly
 ($_SESSION['name']='somevalue') but that didn't work. 
 The normal way of setting it -
 session_start();
 session_register('name'); 
 $name='somevalue';
 
 - didn't work either (within the class).
 
 Am I just missing something obvious?  Any suggestions?

You have to include the class-definition _before_ you start the session.
Read about it in the manual:

http://www.php.net/manual/en/language.oop.serialization.php

Hope that helps.

--
 Marco


  TIA.
 
 Mike
 
 __
 Do you Yahoo!?
 Yahoo! SiteBuilder - Free, easy-to-use web site design software
 http://sitebuilder.yahoo.com
 
 -- 
 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] Re: Mail() question

2003-09-09 Thread Kae Verens
Ryan A wrote:
Hi everyone,
I am trying to create a new newsletter software as the ones i found on
hotscripts were just not good enough or mucho $$ which i dont have :-(
Have finished the basics but need some advise now.
I am using a mysql database instead of text files.
I have a table with the fields name and email, my questions are,
1:is it better to use a for loop and then send each mail?
2:should i first put all the names and addresses into an array?
3:Is it better to send each mail independantly or use BCC? (one mail
blast., will it work?)
For short lists of emails, yes, it should be fine to send them in one go 
(one after the other). However, it takes time to send an email, and you 
are usually allowed only about 30 seconds of CPU time for your script.
  How I do it is to make a file listing the ids of the users, and the 
ids of the emails they're to receive, then I have a cron job which sends 
out one a minute.
  For heavier loads, you could add another cron job to get two a 
minute, and so on.

Kae

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


RE: [PHP] Try/Catch

2003-09-09 Thread --
Hello Jay,

   Yes, I´m running PHP5.
   And in my code you can see that the exception is
throwed in an a call to a methode from an aggregated
object in a suclassed one ($this-curl-GET()). The
GET() methode throws the excpetion if curl_exec
returns an error.

   But one would expect that the exception should be
caught after this call returns. Wouldn´t 

  Here is my code again for examplify:

 have something like this:

//...cut...
try {
 $res =
$this-curl-GET($this-url[0]);
} catch (Exception $e) {
 return FALSE;
}
   //...cut...

and in the curl class, something like this:   
   

   //...cut...
  $result = curl_exec ($this-rs);
  $this-err = curl_errno($this-rs);
  if ($this-err)
  throw new
Exception(curl_error($this-rs) .  (error in GET));
  //...cut...


--- Jay Blanchard
[EMAIL PROTECTED] wrote:
 [snip]
 Try/Catch
 
 Well, may question is about the Scope of Throwed
 Execeptions. 
 [/snip]
 
 What version of PHP are you running? Only V5 has
 this kind of exception
 handling. See http://www.php.net/zend-engine-2.php
 
 HTH!


__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

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



Re: [PHP] Installing php with gd what a pain!

2003-09-09 Thread Desi
You must also install devel packages from jpeg, png and so on...

Desi

Jason Wong wrote:
On Tuesday 09 September 2003 14:49, Dhaval Desai wrote:


I am trying to install php 4.3.2 with gd support. I have already installed
zlib and jpeg-6b. My configure line options are as below:


PHP + GD installation problems have been covered many times before on the list 
and almost everything there is to know about it are in the archives.


./configure --with-gd --with-jpeg-dir=/usr/lib
it doesn't work.


Very likely,

  ./configure --with-gd --with-jpeg-dir=/usr

would work.


it still doesn't work even tough all the cjpeg and djpeg files are there...


it says libjpeg not found for both



It would be more helpful to state the *exact* error message. And very often 
googling on the error message would point you in the right direction.


Could anybody tell me what could be wrong?


You gave the wrong directory for the --with-jpeg-dir option. But you didn't 
give enough details for us to help you, ie:

 - where your libjpeg files are installed
 - what the error message is
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Session Variables in a Class

2003-09-09 Thread CPT John W. Holmes
From: micro brew [EMAIL PROTECTED]
 I've been experimenting with sessions.  I can make
 them work just fine in a normal PHP page.  But when I
 create a class and try to define a session variable
 within a method in the class it won't work.  I've
 tried setting the session variable directly
 ($_SESSION['name']='somevalue') but that didn't work.
 The normal way of setting it -
 session_start();
 session_register('name');
 $name='somevalue';

 - didn't work either (within the class).

didn't work isn't very helpful to us. How useful would it be for me to
just answer you with it worked for me.

Show us some code examples (short ones) as to how this doesn't work, please.

---John Holmes...

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



Re: [PHP] Mail() question

2003-09-09 Thread Chris Hayes
At 09:40 9-9-03, you wrote:
On Tuesday 09 September 2003 08:12, Ryan A wrote:

 I am trying to create a new newsletter software as the ones i found on
 hotscripts were just not good enough or mucho $$ which i dont have :-(
 Please note that i I intend to add a kind of word merge functionality later
Knowing that PHP has problems sending mass mails I chose to send them as 
SMTP directly.

I used this class for it which is self explaining.
http://phpclasses.half2.nl/browse.html/package/346.html
I have not tried to put any load on it yet. It might be a good idea to 
prolong the timeout period in the class.

Don't forget to add the
 From:
 Reply-To:
 Return-Receipt-To: and
 Return-Path:
to the headers, as bounced mail might otherwise get lost.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] using fwrite to create PHP files

2003-09-09 Thread Ford, Mike [LSS]
On 05 September 2003 19:44, Chris Sherwood wrote:

 this is a sample of what I do when I need to write a php file
 
 $stringtowrite = ?PHP\n// Bulletin Board
 forum\n$.ForumId=.$tabletofind.;\n;
 
 $stringtowrite .=
 $.ForumActive='1';\n$.ForumName='.$sportname.';\n;
 
 $stringtowrite .= $.ForumDescription='.$sportname.
 forum';\n; 
 
 $stringtowrite .= $.ForumConfigSuffix='';\n;
 
 $stringtowrite .= $.ForumFolder='0';\n;
 
 $stringtowrite .= $.ForumParent='0';\n;
 
 $stringtowrite .= $.ForumLang='lang/english.php';\n;
 
 --- and so on until finally
 
 $fd=fopen($final_destination,w) or die (file won't open);
 /*if ($fd===false) {
 echo file create failed;
 exit();
 //return;
 } */
 fwrite($fd,$stringtowrite);
 fclose($fd);

Ouch!  This looks like a prime candidate for a heredoc 
(http://www.php.net/language.types.string#language.types.string.syntax.heredoc):

   $stringtowrite = STRINGTOWRITE
   // Bulletin Board forum
   \$ForumId=$tabletofind;
   \$ForumActive='1';
   \$ForumName='$sportname';
   \$ForumDescription='$sportname forum';
   \$ForumConfigSuffix='';
   \$ForumFolder='0';
   \$ForumParent='0';
   \$ForumLang='lang/english.php';
   STRINGTOWRITE;

You can even embed the heredoc directly in the fwrite():

   $fd=fopen($final_destination,w) or die (file won't open);
   fwrite($fd, FILECONTENT
   // Bulletin Board forum
   \$ForumId=$tabletofind;
   \$ForumActive='1';
   \$ForumName='$sportname';
   \$ForumDescription='$sportname forum';
   \$ForumConfigSuffix='';
   \$ForumFolder='0';
   \$ForumParent='0';
   \$ForumLang='lang/english.php';
   FILECONTENT
   );
   fclose($fd);

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning  Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

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



[PHP] Multiple image buttons

2003-09-09 Thread Hardik Doshi
Hi Group,

I have a page on which there are multiple image
buttons. Is there any way to determine which button is
pressed by the user? 

For example, there is a page on which i display all
the users of the system with the edit and delete
button beside each user entry. Now if admin wants to
delete one of the users then how can i know admin
pressed which button? It is possible with non-image
button but image button always give me x and y
co-ordinates.

Please let me know if you have any clue.

Thanks


__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

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



Re: [PHP] Multiple image buttons

2003-09-09 Thread CPT John W. Holmes
From: Hardik Doshi [EMAIL PROTECTED]

 I have a page on which there are multiple image
 buttons. Is there any way to determine which button is
 pressed by the user?

 For example, there is a page on which i display all
 the users of the system with the edit and delete
 button beside each user entry. Now if admin wants to
 delete one of the users then how can i know admin
 pressed which button? It is possible with non-image
 button but image button always give me x and y
 co-ordinates.

 Please let me know if you have any clue.

Use a method like this:

html
form method=POST action=test.php
input type=image src=image.gif name=image[1]
input type=image src=image.gif name=image[2]
input type=image src=image.gif name=image[3]
input type=image src=image.gif name=image[4]
/form
/html
?php
if(isset($_POST['image']))
{
$button = each($_POST['image']);

//$button['key'] will contain the number
//of the button that was clicked on
echo You pressed button {$button['key']};
}
?

Where the number in image[XX] will user_id of the user you want to edit or
delete.

---John Holmes...

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



Re: [PHP] Re: Mail() question

2003-09-09 Thread Jason Sheets
You can also use ini_set or .htaccess to increase the max execution time 
for the PHP script.  I have some reports that used to take 5 or 6 
minutes to run and this worked well, note though that IE has a timeout 
where it will close the connection if the page has not finished loading 
within n seconds, you can increase it in the registry.

Rather than waiting for mail() to complete for each e-mail you want to 
send an often recommended approach is writing the e-mail directly into 
the mail queue so your mail client picks it up when it runs.  Take a 
look at the PEAR Mail class, it is easy to use and supports multiple 
backends (http://pear.php.net).

Jason

Kae Verens wrote:

Ryan A wrote:

Hi everyone,
I am trying to create a new newsletter software as the ones i found on
hotscripts were just not good enough or mucho $$ which i dont have :-(
Have finished the basics but need some advise now.
I am using a mysql database instead of text files.
I have a table with the fields name and email, my questions are,
1:is it better to use a for loop and then send each mail?
2:should i first put all the names and addresses into an array?
3:Is it better to send each mail independantly or use BCC? (one mail
blast., will it work?)


For short lists of emails, yes, it should be fine to send them in one 
go (one after the other). However, it takes time to send an email, and 
you are usually allowed only about 30 seconds of CPU time for your 
script.
  How I do it is to make a file listing the ids of the users, and the 
ids of the emails they're to receive, then I have a cron job which 
sends out one a minute.
  For heavier loads, you could add another cron job to get two a 
minute, and so on.

Kae

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


[PHP] How do I get the result of a Division to 2 decimal places?

2003-09-09 Thread Shaun
Hi,

I am dividing a number by another number and printing the result to the
screen. How can I ensure that the number is rounded up to 2 decimal places?

Thanks for your help

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



[PHP] BMP - GD image?

2003-09-09 Thread DvDmanDT
Hello, I wanted to know if anyone has a good way to convert windows bitmaps
into png, jpeg, gif or something else that GD2 can work with? The reason for
this is that I wanna be able to colorize them in a special way which GD is
great at... Just that GD can't handle BMPs so... My first idea was to simply
convert the formats, but turns out that's not waay to easy... I only tried
the 8bit format which I nowdays think is VERY wierd... The palette indexing
isn't logical it seems... If anyone can explain the file format, I will just
write my own PHP script for this task...

Help anyone?

-- 
// DvDmanDT
MSN: [EMAIL PROTECTED]
Mail: [EMAIL PROTECTED]

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



Re: [PHP] How do I get the result of a Division to 2 decimal places?

2003-09-09 Thread Raditha Dissanayake
printf(%.2f,$number);

Shaun wrote:

Hi,

I am dividing a number by another number and printing the result to the
screen. How can I ensure that the number is rounded up to 2 decimal places?
Thanks for your help

 



--
http://www.radinks.com/upload
Drag and Drop File Uploader.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] How do I get the result of a Division to 2 decimal places?

2003-09-09 Thread Marco Schuler
Hi

Am Die, 2003-09-09 um 16.06 schrieb Shaun:
 Hi,
 
 I am dividing a number by another number and printing the result to the
 screen. How can I ensure that the number is rounded up to 2 decimal places?

Use printf with format strings like printf(Value: %.2f, $value);

http://php.net/manual/en/function.printf.php

--
 Marco

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



RE: [PHP] How do I get the result of a Division to 2 decimal places?

2003-09-09 Thread Jay Blanchard
[snip]
I am dividing a number by another number and printing the result to the
screen. How can I ensure that the number is rounded up to 2 decimal
places?
[/snip]

Why others never test these things I'll never know...but here is a small
test you can run

?php

/*
** rounding / number format test
*/

$number = 12.2345;

echo number_format($number, 4, '', ',').\n;
echo number_format($number, 3, '', ',').\n;
echo number_format($number, 2, '', ',').\n;
echo \n;
echo round($number, 4).\n;
echo round($number, 3).\n;
echo round($number, 2).\n;
?

The results 

12.2345
12.235
12.23

12.2345
12.235
12.23

Interesting, no? It would appear that under PHP4.2.1 on a test server
that number_format() exhibits the same behaviour as round().

Have a pleasant and productive day.

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



Re: [PHP] BMP - GD image?

2003-09-09 Thread Matthias Nothhaft
DvDmanDT wrote:
Hello, I wanted to know if anyone has a good way to convert windows bitmaps
into png, jpeg, gif or something else that GD2 can work with? The reason for
this is that I wanna be able to colorize them in a special way which GD is
great at... Just that GD can't handle BMPs so... My first idea was to simply
convert the formats, but turns out that's not waay to easy... I only tried
the 8bit format which I nowdays think is VERY wierd... The palette indexing
isn't logical it seems... If anyone can explain the file format, I will just
write my own PHP script for this task...
Help anyone?

Google is your friend ;-)
Try this:
http://www.dcs.ed.ac.uk/home/mxr/gfx/2d/BMP.txt

Hope this will help you,
Regards,
Matthias
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: PHP and Apache

2003-09-09 Thread Ray Mordy
Hi

After installing Apache then PHP, i was told by php that apache wasnt
configured, so i followed the instructions in the install.txt file. But
everytime i view the files through the local host but i only see the
written code, So how do i get this to work, assuming that Apache isnt
giving the details to php to decode.

I am using Win XP
Apache 1.3.23
MYSQL 3.23.49
PHP 4.1.1

any ideas on how i can solve this and do you need any more info?
Thanks



Ray Mordy
I.T CTC PLUS
www.Ctcplus.com
[EMAIL PROTECTED]

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



Re: [PHP] How do I get the result of a Division to 2 decimal places?

2003-09-09 Thread Marek Kilimajer
It is not mentioned in the manual, but it seems dec_point cannot be 
empty. If it is empty, default (.) is taken.

Jay Blanchard wrote:
[snip]
I am dividing a number by another number and printing the result to the
screen. How can I ensure that the number is rounded up to 2 decimal
places?
[/snip]
Why others never test these things I'll never know...but here is a small
test you can run
?php

/*
** rounding / number format test
*/
$number = 12.2345;

echo number_format($number, 4, '', ',').\n;
echo number_format($number, 3, '', ',').\n;
echo number_format($number, 2, '', ',').\n;
echo \n;
echo round($number, 4).\n;
echo round($number, 3).\n;
echo round($number, 2).\n;
?
The results 

12.2345
12.235
12.23
12.2345
12.235
12.23
Interesting, no? It would appear that under PHP4.2.1 on a test server
that number_format() exhibits the same behaviour as round().
Have a pleasant and productive day.

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


[PHP] addslashes() || Why the multiple slashes?

2003-09-09 Thread CF High
Hey All.

Simple ?

why does PHP add 3 slashes to the following var:

$apostrophe = I've got an apostrophe;

$slashed = addslashes($apostrophe);

echo $slashed;

Result: I\\\'ve got an apostrophe.

What's up with that -- why not just add a single backslash?

--Noah

--

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



Re: [PHP] Re: PHP and Apache

2003-09-09 Thread Chris Hayes
At 16:58 9-9-03, you wrote:
Hi

After installing Apache then PHP, i was told by php that apache wasnt
configured, so i followed the instructions in the install.txt file. But
everytime i view the files through the local host but i only see the
written code, So how do i get this to work, assuming that Apache isnt
giving the details to php to decode.
I am using Win XP
Apache 1.3.23
MYSQL 3.23.49
PHP 4.1.1
any ideas on how i can solve this and do you need any more info?
Thanks
Did you edit the Apache httpd.conf file? If so, what lines did you add?
Did you restart Apache after that?
Did Apache start successfully then?
How come PHP tells you Apache is not configured?? That's weird. What's the 
message?
Do you use http://localhost/path/file.php ? Or is the file called .htm?

http://nl.php.net/manual/en/install.windows.php

PS please start a new message when mailing to this list: rpelying to an 
existing thread means some people will see it appear in that thread

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


RE: [PHP] How do I get the result of a Division to 2 decimal places?

2003-09-09 Thread Jay Blanchard
[snip]
It is not mentioned in the manual, but it seems dec_point cannot be 
empty. If it is empty, default (.) is taken.

echo number_format($number, 4, '', ',').\n;

number_format() does allow an empty set of single quotes in the third
attribute which it will default to a period (.) for the decimal point.
number_format() does require that have all the attributes stated, or it
will throw an error.
So if you do this

echo number_format($number, 4, ',').\n;

You should get an error.

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



Re: [PHP] How do I get the result of a Division to 2 decimal places?

2003-09-09 Thread Marek Kilimajer
I meant you cannot set decimal point to be '', it will always display. 
Yes you can supply '' for the third argument.

Jay Blanchard wrote:

[snip]
It is not mentioned in the manual, but it seems dec_point cannot be 
empty. If it is empty, default (.) is taken.

echo number_format($number, 4, '', ',').\n;

number_format() does allow an empty set of single quotes in the third
attribute which it will default to a period (.) for the decimal point.
number_format() does require that have all the attributes stated, or it
will throw an error.
So if you do this
echo number_format($number, 4, ',').\n;

You should get an error.

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


RE: [PHP] How do I get the result of a Division to 2 decimal places?

2003-09-09 Thread Jay Blanchard
[snip]
I meant you cannot set decimal point to be '', it will always display. 
Yes you can supply '' for the third argument.
[/snip]

Ah!

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



Re: [PHP] addslashes() || Why the multiple slashes?

2003-09-09 Thread Marek Kilimajer
WFM.

Is $apostrophe from a REQUEST variable. Then it already is addslashed, 
as your magic_quotes_gpc is on in php.ini.

CF High wrote:

Hey All.

Simple ?

why does PHP add 3 slashes to the following var:

$apostrophe = I've got an apostrophe;

$slashed = addslashes($apostrophe);

echo $slashed;

Result: I\\\'ve got an apostrophe.

What's up with that -- why not just add a single backslash?

--Noah

--

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


Re: [PHP] Session Variables in a Class

2003-09-09 Thread micro brew
Here's my class.  I start the session in the
constructor and in later methods attempt to register
session variables.  You can see I've tried a couple
different methods but none of them maintain the
session variable values.  Any suggestions?

Mike

?php

class login {

//This variable tells the browser where to redirect to
the loginpage
var
$loginPage='http://www.somedomain.com/somepage.php';
var
$exitPage='http://www.somedomain.com/somepage.html';
var $loggedIn;
var $access;
var $accesslevel;

 function login($loggedIn, $access, $accesslevel) {   

  session_start();
  if ($loggedIn=='1') {
   $this-checkLogin();
  }
  if ($access=='1') {
   $this-checkAccess();
  }
  if ($access=='0'  $loggedIn=='0') {
   $this-authenticateLogin();
  }
 }
 
function checkLogin() { 
  
  if (session_is_registered('user')!='True') {
   session_register('unauthorizedaccess');
   $unauthorizedaccess=http://; .
$_SERVER['SERVER_NAME'] . $_SERVER['SCRIPT_NAME'];
   header(location: $this-loginPage);
   exit();
  }
 }
 
 function checkAccess() { 
   
   if (session_is_registered('permission')=='True') {
if
($HTTP_SESSION_VARS['permission']$this-accesslevel)
{
 session_destroy();
 header(location: $this-exitPage);
 exit();
}
   }
   else {
session_register('unauthorizedaccess');
$unauthorizedaccess=http://; .
$_SERVER[SERVER_NAME] . $_SERVER[SCRIPT_NAME];
header(location: $this-loginPage);
exit();
   }
 }

 function authenticateLogin() { 

  if ((!$HTTP_POST_VARS['un']) ||
(!$HTTP_POST_VARS['pw'])) {
   session_register('loginError');
   header(Location: $this-loginPage);
   exit();
  }

  else {

   include(includes/db_connect.inc);

   //call db_connect function from db_connect.inc
   db_connect() or trigger_error(MySQL error # .
mysql_errno() . : . mysql_error());

   $query=select * from users where username=\ .
addslashes($HTTP_POST_VARS['un']) .\ and
password=\ . addslashes($HTTP_POST_VARS['pw']) .
\;

   $result=mysql_query($query) or trigger_error(MySQL
error # . mysql_errno() . : . mysql_error());

   $foundCount = mysql_num_rows($result);

   if ($foundCount==1) {
session_register('user');
session_register('permission');
session_register('company');
session_unregister('loginError');
for ($i=0; $i  $foundCount; $i++) {
 $row=mysql_fetch_array($result); 
 $_SESSION['user']=$row['userID'];  
 $_SESSION['permission']=$row['permissionLevel']; 

 $_SESSION['company']=$row['companyID'];
}
if
(session_is_registered('unauthorizedaccess')=='True')
{

$location=$HTTP_SESSION_VARS['unauthorizedaccess'];
 session_unregister('unauthorizedaccess');
 header(Location: $location);
 exit();
}
   }
   else {
session_register('loginError');
header(Location: $this-loginPage);
exit();
   }
  }
 }


//closes class
}

?

--- CPT John W. Holmes [EMAIL PROTECTED]
wrote:
 From: micro brew [EMAIL PROTECTED]
  I've been experimenting with sessions.  I can make
  them work just fine in a normal PHP page.  But
 when I
  create a class and try to define a session
 variable
  within a method in the class it won't work.  I've
  tried setting the session variable directly
  ($_SESSION['name']='somevalue') but that didn't
 work.
  The normal way of setting it -
  session_start();
  session_register('name');
  $name='somevalue';
 
  - didn't work either (within the class).
 
 didn't work isn't very helpful to us. How useful
 would it be for me to
 just answer you with it worked for me.
 
 Show us some code examples (short ones) as to how
 this doesn't work, please.
 
 ---John Holmes...
 


__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

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



Re: [PHP] No answers found - Why var and why ?

2003-09-09 Thread Brad Pauly
André Cupini wrote:
But what's the diference of the sintax:
function bla($var)
That means the function will return a reference.

http://www.php.net/manual/en/functions.returning-values.php

- Brad

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


Re: [PHP] Encrypt/Serialize Source Code for Sale

2003-09-09 Thread Ivo Fokkema
Hi,

I've actually been looking for this kind of things for a while as well.
However, I would not want my client to install something to uncode the
scripts (probably causing the scripts to be unencoded easier). I found
these:

PHP OBFUSCATOR
http://richard.fairthorne.is-a-geek.com/utils_obfuscate.php

Phrozen
http://sourceforge.net/projects/phrozen/

POBS
http://pobs.mywalhalla.net/

Anyone have any recommendations or experience with any?

--
Ivo


Evan Nemerson [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Take a look at Turck MMCache (free) and Zend Encoder (not).

 http://www.turcksoft.com/en/e_mmc.htm
 http://www.zend.com/store/products/zend-encoder.php



 On Saturday 06 September 2003 01:59 pm, Charles Kline wrote:
  What methods are available (ups and downs) for encrypting and
  serializing php applications for sale?
 
  Thanks,
  Charles

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



[PHP] count() numerical arrays....

2003-09-09 Thread CF High
Hey all.

Another simple, yet baffling for me, question:

I have a comma delimited list of numbers; e.g. $num_list = 1,2,3,4

I split the number list to array -- $num_list_array = split(, $num_list)

I then count the number of elements -- $count = count($num_list_array);

I do not get 4 for $count, rather 1!

I can't stand coming up with cludgy workarounds just to count the number of
elements in a numerical list.

Any ideas?

--Noah

--

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



[PHP] Setting execution time for a loop

2003-09-09 Thread zavaboy
How do I set execution time for a for() loop?
Like I have a loop stop once it finds 3 things, but what happens when there
are only 2 things? It keeps looking for 30 seconds then shows this error:
Fatal error: Maximum execution time of 30 seconds exceeded in...

How can I set it to 3 seconds without a error?

-- 

- Zavaboy
[EMAIL PROTECTED]
www.zavaboy.com

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



Re: [PHP] count() numerical arrays....

2003-09-09 Thread Cesar Cordovez
Use explode instead...

$num_list_array = explode(, $num_list)

more information at php.net/explode

Cesar

CF High wrote:
Hey all.

Another simple, yet baffling for me, question:

I have a comma delimited list of numbers; e.g. $num_list = 1,2,3,4

I split the number list to array -- $num_list_array = split(, $num_list)

I then count the number of elements -- $count = count($num_list_array);

I do not get 4 for $count, rather 1!

I can't stand coming up with cludgy workarounds just to count the number of
elements in a numerical list.
Any ideas?

--Noah

--

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


Re: [PHP] count() numerical arrays....

2003-09-09 Thread Brad Pauly
CF High wrote:

I split the number list to array -- $num_list_array = split(, $num_list)

Any ideas?
split uses a regular expression. I think you want to use explode here.

$num_list_array = explode(',', $num_list)

- Brad

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


Re: [PHP] Lost Connection to MySQL server during query

2003-09-09 Thread Marek Kilimajer
Are you using mysql_pconnect or just mysql_connect?

Donald Tyler wrote:

I have a script that is processing data from a single table and splitting it
into smaller normalized tables.
 

The script takes anywhere between 5-10 minutes to complete, and as it runs
it constantly outputs a report on its progress.
 

The script seems to run fine the first time I run it, but with subsequent
runs (To see if it incorrectly creates duplicates of records etc), after a
couple of minutes the script ends with an error message saying Lost
connection to MySQL server during query.
 

During the first run, the script is mostly just chopping up the data and
placing it in the new tables, and doing a little comparing. But during
subsequent runs, all of the records in the new tables should already exist,
so the script see's this, and instead of creating new records, it compares
them to see if its correct.
 

Does anyone have any idea why it would be losing connection all the time?

 

This is just being run on a test server at the moment. Being used as the
server and also the client, configured as follows:
 

Windows XP Tablet Edition

PHP 4.3.3

PHP Extensions:   XmlRPC

MySQL 4.0.14

Apache 2.0.47

 

Please help, this has been making my life hell for a week now!

 

Thanks

 

 

Donald


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


Re: [PHP] addslashes() || Why the multiple slashes?

2003-09-09 Thread Brad Pauly
CF High wrote:

why does PHP add 3 slashes to the following var:

$apostrophe = I've got an apostrophe;

$slashed = addslashes($apostrophe);

echo $slashed;

Result: I\\\'ve got an apostrophe.

What's up with that -- why not just add a single backslash?
Do you have gpc_magic_quotes enabled?

- Brad

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


Re: [PHP] addslashes() || Why the multiple slashes?

2003-09-09 Thread Brad Pauly
Brad Pauly wrote:

CF High wrote:

why does PHP add 3 slashes to the following var:

$apostrophe = I've got an apostrophe;

$slashed = addslashes($apostrophe);

echo $slashed;

Result: I\\\'ve got an apostrophe.

What's up with that -- why not just add a single backslash?


Do you have gpc_magic_quotes enabled?
Oops. I meant magic_quotes_gpc.

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


[PHP] PREG-pattern, help needed

2003-09-09 Thread Tobias Talltorp
I need help with a preg-pattern for preg_replace_callback().

I need to match td(+all properties) and replace them with td
id=$counter.

This is as far as I have come in my code:

?php

$html = 'table border=1 id=myTable
tr
td
table border=1
tr
td width=20tabell2 cell1/td
td width=40tabell2 cell2/td
/tr
/table
/td
tdförsta cell i rad två/td
tdDetta är den sista/td
/tr
/table';

$counter = 0;
function bla($matches) {
global $counter;
$counter++;
return td id=\theId.$counter.\;
}


// this pattern is all wrong, since it matches and replaces all tags
echo preg_replace_callback(|([td][^]+)|i, bla, $html);

?


Any thoughts?
// Tobias

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



[PHP] Dynamic Multi Dimensional Arrays

2003-09-09 Thread Bobby Patel
Hello Everyone,

I want to emulate session objects (as opposed to variables). I stumbled 
upon creating multi-dimensional arrays, so I can do this:
$name = 'Bob';
$year = '2003';

$HTTP_SESSION_VARS[$user][$year] = 'registered';
which gives $HTTP_SESSION_VARS['Bob']['2003'] = 'registered';
but  I want to append an options array in this so what I want is:

$options = array (
  'income' = 1,
  'age' = 25
);
$HTTP_SESSION_VARS[$user][$options] = 'registered';
which gives:
  $HTTP_SESSION_VARS['Bob'][ [income]=1, [age]=25 ] = 'registered';
but this doesn't work. Is there any way I can have objects saved in 
sessions?

Bobby

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


[PHP] Is there an issue using sessions with IE/Mac?

2003-09-09 Thread Matt MacLeod
I've built a log in system which sets the user's id as a session if 
succesfully logged in. However, a user on IE5/Mac tells me that the site 
logs her out even though she has entered the correct login details. I 
have tried using her details on Firebird/Windows and have had no problems.

Are there any known issues using php sesisons with IE5/Mac?

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


[PHP] Dynamic Multi Dimensional Arrays

2003-09-09 Thread Bobby Patel
Hello Everyone,

I want to emulate session objects (as opposed to variables). I stumbled 
upon creating multi-dimensional arrays, so I can do this:
$name = 'Bob';
$year = '2003';

$HTTP_SESSION_VARS[$user][$year] = 'registered';
which gives $HTTP_SESSION_VARS['Bob']['2003'] = 'registered';
but  I want to append an options array in this so what I want is:

$options = array (
  'income' = 1,
  'age' = 25
);
(Where the $options array is created dynamically from passed POST data).
$HTTP_SESSION_VARS[$user][$options] = 'registered';
which gives:
  $HTTP_SESSION_VARS['Bob'][ [income]=1, [age]=25 ] = 'registered';
but this doesn't work. Is there any way I can have objects saved in 
sessions?

Bobby

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


Re: [PHP] Dynamic Multi Dimensional Arrays

2003-09-09 Thread Tom Rogers
Hi,

Tuesday, September 9, 2003, 2:19:28 PM, you wrote:
BP Hello Everyone,

BP I want to emulate session objects (as opposed to variables). I stumbled 
BP upon creating multi-dimensional arrays, so I can do this:
BP $name = 'Bob';
BP $year = '2003';

BP $HTTP_SESSION_VARS[$user][$year] = 'registered';
BP which gives $HTTP_SESSION_VARS['Bob']['2003'] = 'registered';

BP but  I want to append an options array in this so what I want is:

BP $options = array (
BP'income' = 1,
BP'age' = 25  
BP );

BP $HTTP_SESSION_VARS[$user][$options] = 'registered';
BP which gives:
BP$HTTP_SESSION_VARS['Bob'][ [income]=1, [age]=25 ] = 'registered';

BP but this doesn't work. Is there any way I can have objects saved in 
BP sessions?

BP Bobby

 you would have to give $user another key value
$options = array('income'=1.'age'=25);
$HTTP_SESSION_VARS[$user] = $options;
$HTTP_SESSION_VARS[$user]['status'] = 'registered';

also in these cases print_r($HTTP_SESSION_VARS[$user]) can be your
friend.

-- 
regards,
Tom

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



Re: [PHP] Dynamic Multi Dimensional Arrays

2003-09-09 Thread Brad Pauly
Bobby Patel wrote:

Hello Everyone,

I want to emulate session objects (as opposed to variables). I stumbled 
upon creating multi-dimensional arrays, so I can do this:
$name = 'Bob';
$year = '2003';

$HTTP_SESSION_VARS[$user][$year] = 'registered';
which gives $HTTP_SESSION_VARS['Bob']['2003'] = 'registered';
but  I want to append an options array in this so what I want is:

$options = array (
  'income' = 1,
  'age' = 25
);

$HTTP_SESSION_VARS[$user][$options] = 'registered';
which gives:
  $HTTP_SESSION_VARS['Bob'][ [income]=1, [age]=25 ] = 'registered';
but this doesn't work. Is there any way I can have objects saved in 
sessions?
There is, but I am not sure that is what you want. The reason you are 
getting the above result is because you are using $object (which is an 
array) as a key. Do you want an array element that holds the $options array?

$HTTP_SESSION_VARS[$user]['options'] = $options;

You could then add elements to this array like this:

$HTTP_SESSION_VARS[$user]['options']['registered'] = 1;

Is that what you are trying to do?

- Brad

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


Re: [PHP] PREG-pattern, help needed

2003-09-09 Thread Armand Turpel
Hi,
What about:

$string = preg_replace(/(td)[^]*/,\\1 id={$counter},$string);


atur


- Original Message - 
From: Tobias Talltorp [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, September 09, 2003 6:35 PM
Subject: [PHP] PREG-pattern, help needed


 I need help with a preg-pattern for preg_replace_callback().

 I need to match td(+all properties) and replace them with td
 id=$counter.

 This is as far as I have come in my code:

 ?php

 $html = 'table border=1 id=myTable
 tr
 td
 table border=1
 tr
 td width=20tabell2 cell1/td
 td width=40tabell2 cell2/td
 /tr
 /table
 /td
 tdförsta cell i rad två/td
 tdDetta är den sista/td
 /tr
 /table';

 $counter = 0;
 function bla($matches) {
 global $counter;
 $counter++;
 return td id=\theId.$counter.\;
 }


 // this pattern is all wrong, since it matches and replaces all tags
 echo preg_replace_callback(|([td][^]+)|i, bla, $html);

 ?


 Any thoughts?
 // Tobias

 -- 
 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] Dynamic Multi Dimensional Arrays

2003-09-09 Thread Bobby Patel
Brad Pauly wrote:
$HTTP_SESSION_VARS[$user]['options'] = $options;
yes this is what I wanted.

You could then add elements to this array like this:

$HTTP_SESSION_VARS[$user]['options']['registered'] = 1;

Is that what you are trying to do?

- Brad
I will try this out and see what happens.

Thank you Tom and Brad.

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


Re: [PHP] Is there an issue using sessions with IE/Mac?

2003-09-09 Thread Richard Baskett
on 9/9/03 9:33 AM, Matt MacLeod at [EMAIL PROTECTED] wrote:

 I've built a log in system which sets the user's id as a session if
 succesfully logged in. However, a user on IE5/Mac tells me that the site
 logs her out even though she has entered the correct login details. I
 have tried using her details on Firebird/Windows and have had no problems.
 
 Are there any known issues using php sesisons with IE5/Mac?
 
 Cheers,
 Matt

Not that I know of.. I have written most all my applications using IE5 on
the Mac as my primary browser and they all work great.. And now that I use
Safari they still work great..  So there is something wrong with the way
your cookies are being set I believe.. or some other problem.. because IE5
for mac can definitely use and work with sessions..

Cheers!

Rick

We should be taught not to wait for inspiration to start a thing.  Action
always generates inspiration.  Inspiration seldom generates action. - Frank
Tibolt

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



[PHP] Re: PHP and Apache

2003-09-09 Thread jsWalter
I have a complete setup and testing procedure for windows class machines.

Hope it can help you.

   www.torres.ws/dev/php

Walter

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



[PHP] Installing PHP with MySQL RPM version

2003-09-09 Thread Mark McCulligh
I am trying to ./configure PHP 4.3.3 on a system that already has MySQL
4.0.14 on it.

In the configure line --with-mysql=/path/to/mysql were is the path for RPM
versions of MySQL. I have search the computer but it looks like the mysql
files are all over the place.  Database files are in /var/lib/mysql   BIN
files are in /usr/bin/, etc...

If you install MySQL from a RPM what path do you put in the PHP configure
line

Thanks,
Mark.

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



Re: [PHP] Is there an issue using sessions with IE/Mac?

2003-09-09 Thread Lowell Allen
 I've built a log in system which sets the user's id as a session if
 succesfully logged in. However, a user on IE5/Mac tells me that the site
 logs her out even though she has entered the correct login details. I
 have tried using her details on Firebird/Windows and have had no problems.
 
 Are there any known issues using php sesisons with IE5/Mac?

For what it's worth (which may not be much), I've heard reports of problems
with IE5.2 in OSX when used with Entourage. A colleague's session was
failing after checking email with Entourage, and he said Microsoft confirmed
the problem. However -- I've since gone to OSX and can't duplicate the
problem on my system.

--
Lowell Allen

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



Re: [PHP] Is there an issue using sessions with IE/Mac?

2003-09-09 Thread Richard Baskett
on 9/9/03 11:46 AM, Lowell Allen at [EMAIL PROTECTED] wrote:

 I've built a log in system which sets the user's id as a session if
 succesfully logged in. However, a user on IE5/Mac tells me that the site
 logs her out even though she has entered the correct login details. I
 have tried using her details on Firebird/Windows and have had no problems.
 
 Are there any known issues using php sesisons with IE5/Mac?
 
 For what it's worth (which may not be much), I've heard reports of problems
 with IE5.2 in OSX when used with Entourage. A colleague's session was
 failing after checking email with Entourage, and he said Microsoft confirmed
 the problem. However -- I've since gone to OSX and can't duplicate the
 problem on my system.

Ah yes there was a huge problem with this.. basically every time Entourage
went and checked your mail.. or a ToDo, Calendar alert happened the
preferences that Entourage and IE shared (don't ask me why) we're
overwritten.. thus deleting any session info, etc that might have been in
the cookies in IE.  Im not sure if they fixed it yet.. but if you couldn¹t
duplicate the problem.. then it sounds like they have.  I finally got so
frustrated I went to other browsers.. and now am on Safari.. too bad IE,
which is ok since MS does not support the Mac version anymore anyways.

Cheers!

Rick

Today I begin to understand what love must be, if it exists When we are
parted, we each feel the lack of the other half of ourselves. We are
incomplete like a book in two volumes of which the first has been lost. That
is what I imagine love to be: incompleteness in absence. - Goncourt

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



Re: [PHP] Installing PHP with MySQL RPM version

2003-09-09 Thread Ray Hunter
 In the configure line --with-mysql=/path/to/mysql were is the path for RPM
 versions of MySQL. I have search the computer but it looks like the mysql
 files are all over the place.  Database files are in /var/lib/mysql   BIN
 files are in /usr/bin/, etc...

use --with-mysql or --with-mysql-sock

example:

./configure --with-mysql
./configure --with-mysql-sock=/var/lib/mysql/mysql.sock

hth

--
BigDog

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



Re: [PHP] Installing PHP with MySQL RPM version

2003-09-09 Thread Mark McCulligh
Thanks,

If you just use --with-mysql it will use PHP's built-in mysql client lib
3.23.49, but I have MySQL 4.0.14 installed. Won't this make a difference.  I
want to make sure PHP is compiled this the right libraries for MySQL.

Mark.


Ray Hunter [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
  In the configure line --with-mysql=/path/to/mysql were is the path for
RPM
  versions of MySQL. I have search the computer but it looks like the
mysql
  files are all over the place.  Database files are in /var/lib/mysql
BIN
  files are in /usr/bin/, etc...

 use --with-mysql or --with-mysql-sock

 example:

 ./configure --with-mysql
 ./configure --with-mysql-sock=/var/lib/mysql/mysql.sock

 hth

 --
 BigDog

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



[PHP] Brainiacs please help! PostgreSQL and foreach() problem

2003-09-09 Thread Peter Sharpe
I have a database full of names. each name could be linked to any number of
sub-names, each sub-name could be linked to any number of sub-sub-names, to
infinity (unlikely but possible).

I need to iterate through this nest of names starting with a main name; lets
call the main name Peter. Peter could have John, Tim  Mike working for him.
Tim could have Greg working for him.

function select_names($current_top_name){
global $dbh;

$sql = 
SELECT
 name_id_fk
FROM
 name_relation
WHERE
 top_name_id_fk = '.$current_top_name.'
;
$rs = pg_query($dbh, $sql);

if(($num_rows = pg_num_rows($rs))  0){

for($i=0;$i$num_rows;$i++){
$row = pg_fetch_row($rs, $i, PGSQL_ASSOC);
$associated_names[] = $row['name_id_fk'];
}

pg_free_result($rs);

} // end if(($num_rows = pg_num_rows($rs))  0)

return $associated_names;

} // end function select_names()

$current_top_name = 'Peter';

while(!$stop){

$assoc_names = select_names($current_top_name);

foreach($assoc_names as $key = $val){
print($val);
$more_assoc_names = select_names($val);
if($more_assoc_names){
ARG HELP IM NOT SMART ENOUGH
}

} // end while(!$stop)

} // end foreach($assoc_names as $key = $val)

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



Re: [PHP] Installing PHP with MySQL RPM version

2003-09-09 Thread Ray Hunter
mark,

from what i understand of the configuration script it will go out and
look in various locations for the mysql libraries. If you want to
specify something then I would suggest using the --with-mysql-sock and
pass the socket file. I like to use the socket file and have always had
great success with it even for mysql 4.0

--
BigDog


On Tue, 2003-09-09 at 12:59, Mark McCulligh wrote:
 Thanks,
 
 If you just use --with-mysql it will use PHP's built-in mysql client lib
 3.23.49, but I have MySQL 4.0.14 installed. Won't this make a difference.  I
 want to make sure PHP is compiled this the right libraries for MySQL.
 
 Mark.
 
 
 Ray Hunter [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
   In the configure line --with-mysql=/path/to/mysql were is the path for
 RPM
   versions of MySQL. I have search the computer but it looks like the
 mysql
   files are all over the place.  Database files are in /var/lib/mysql
 BIN
   files are in /usr/bin/, etc...
 
  use --with-mysql or --with-mysql-sock
 
  example:
 
  ./configure --with-mysql
  ./configure --with-mysql-sock=/var/lib/mysql/mysql.sock
 
  hth
 
  --
  BigDog

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



Re: [PHP] Installing PHP with MySQL RPM version

2003-09-09 Thread Mark McCulligh
Ok,

when I compiled with --with-mysql only, phpinfo() said:
Client API version: 3.23.49

I will recompile PHP with --with-mysql-sock instead.

I want to make sure PHP is using the right MySQL Client version.

Thanks,
Mark.

Ray Hunter [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 mark,

 from what i understand of the configuration script it will go out and
 look in various locations for the mysql libraries. If you want to
 specify something then I would suggest using the --with-mysql-sock and
 pass the socket file. I like to use the socket file and have always had
 great success with it even for mysql 4.0

 --
 BigDog


 On Tue, 2003-09-09 at 12:59, Mark McCulligh wrote:
  Thanks,
 
  If you just use --with-mysql it will use PHP's built-in mysql client lib
  3.23.49, but I have MySQL 4.0.14 installed. Won't this make a
difference.  I
  want to make sure PHP is compiled this the right libraries for MySQL.
 
  Mark.
 
 
  Ray Hunter [EMAIL PROTECTED] wrote in message
  news:[EMAIL PROTECTED]
In the configure line --with-mysql=/path/to/mysql were is the path
for
  RPM
versions of MySQL. I have search the computer but it looks like the
  mysql
files are all over the place.  Database files are in /var/lib/mysql
  BIN
files are in /usr/bin/, etc...
  
   use --with-mysql or --with-mysql-sock
  
   example:
  
   ./configure --with-mysql
   ./configure --with-mysql-sock=/var/lib/mysql/mysql.sock
  
   hth
  
   --
   BigDog

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



Re: [PHP] Installing PHP with MySQL RPM version

2003-09-09 Thread Brad Pauly
Mark McCulligh wrote:
when I compiled with --with-mysql only, phpinfo() said:
Client API version: 3.23.49
I will recompile PHP with --with-mysql-sock instead.
I don't think this will change the client version. It is my 
understanding that this will just tell the client to look in a specific 
place for the socket file.

I want to make sure PHP is using the right MySQL Client version.
I think you will need to specify the location using --with-mysql=[dir]. 
It is just a guess, but try --with-mysql=/usr

If you can't find where it is, one thing that might be worth considering 
is whether or not you need the 4.0 client lib. Take a look at this link:

http://www.mysql.com/doc/en/Upgrading-from-3.23.html

- Brad

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


[PHP] Help with Displaying RSS feed links

2003-09-09 Thread Frank Miller
Hello all,

I'm working on an entry page where I would like to show some of the
current headlines from technology websites. I've been following and
pretty much understand the article on devshed
http://www.devshed.com/Server_Side/PHP/PHPRDF/page1.html Plugging RDF
content into your Website. From what I gather from the article is that
he uses a foreach loop to display the Title, link and description which
could be anywhere from 5 to 15 links. I only have room on my page for 3
and then I plan on putting a more link taking visitors to a page where
I'll have more room.

I was reading in the Welling/Thomson book about converting a foreach
loop into another loop. Here is the original foreach loop and then what
I was trying to convert it to:

foreach ($items as $item)
{
echo trtda href= . $item[link] .  . $item[title] .
/abr . $item[description] .  /td/tr; }

//**
*

for ($row=0; $row2; $row++)
{
   while (list ( $key, $value) = each ($items[$row]))
{
echo trtda href= . $item[link] .  . $item[title] .
/abr . $item[description] .  /td/tr; 
}
}

Can anyone point me in the right direction? Right now I don't get an
error but I also don't get any text or results.

Thanks - Frank

Here is the code from the original article:

//

html
head
basefont face=Verdana
/head
body

table border=0 cellspacing=5 cellpadding=5
tr
tdbNew releases on freshmeat.net today:/b/td
/tr

?php
// XML file
$file = http://www.freshmeat.net/backend/fm-releases.rdf;;

// set up some variables for use by the parser
$currentTag = ;
$flag = ;
$count = 0;

// this is an associative array of channel data with keys
(title,link,description)
$channel = array();

// this is an array of arrays, with each array element representing an
item
// each outer array element is itself an associative array 
// with keys (title, link, description)
$items = array();

// opening tag handler
function elementBegin($parser, $name, $attributes)
{
global $currentTag, $flag;
$currentTag = $name;
// set flag if entering channel or item block
if ($name == ITEM)
{
$flag = 1;
}
else if ($name == CHANNEL)
{
$flag = 2;
}
}

// closing tag handler   
function elementEnd($parser, $name)
{
global $currentTag, $flag, $count;
$currentTag = ;

// set flag if exiting channel or item block
if ($name == ITEM)
{
$count++;
$flag = 0;
}
else if ($name == CHANNEL)
{
$flag = 0;
}
}

// character data handler
function characterData($parser, $data)
{
global $currentTag, $flag, $items, $count, $channel;
$data = trim(htmlspecialchars($data));
if ($currentTag == TITLE || $currentTag == LINK ||
$currentTag == DESCRIPTION)
{
// add data to $channels[] or $items[] array
if ($flag == 1)
{
$items[$count][strtolower($currentTag)] .=
$data;
}
else if ($flag == 2)
{
$channel[strtolower($currentTag)] .= $data;
}
}

}

// create parser
$xp = xml_parser_create();

// set element handler
xml_set_element_handler($xp, elementBegin, elementEnd);
xml_set_character_data_handler($xp, characterData);
xml_parser_set_option($xp, XML_OPTION_CASE_FOLDING, TRUE);
xml_parser_set_option($xp, XML_OPTION_SKIP_WHITE, TRUE);

// read XML file
if (!($fp = fopen($file, r))) 
{
  die(Could not read $file);
}

// parse data
while ($xml = fread($fp, 4096)) 
{
if (!xml_parse($xp, $xml, feof($fp))) 
{
die(XML parser error:  .
xml_error_string(xml_get_error_code($xp)));
}
}

// destroy parser
xml_parser_free($xp);

// now iterate through $items[] array
// and print each item as a table row

foreach ($items as $item)
{
echo trtda href= . $item[link] .  . $item[title] .
/abr . $item[description] .  /td/tr; }
?
/table
/body
/html

//**





Frank Miller
Computer Specialist and Webmaster
Texas AM University-Texarkana
2600 N. Robison Rd
Texarkana, Texas 75501
 
Office  165
Phone (903)223-3156 (2*2*61*37017349)
Fax (903)223-3139

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



Re: [PHP] Help with Displaying RSS feed links

2003-09-09 Thread Alister
On Tue, 9 Sep 2003 15:35:48 -0500
Frank Miller [EMAIL PROTECTED] wrote:

 Hello all,
 
 I'm working on an entry page where I would like to show some of the
 current headlines from technology websites. I've been following and
 pretty much understand the article on devshed
 http://www.devshed.com/Server_Side/PHP/PHPRDF/page1.html Plugging RDF
 content into your Website. From what I gather from the article is that
 he uses a foreach loop to display the Title, link and description
 which could be anywhere from 5 to 15 links. I only have room on my
 page for 3 and then I plan on putting a more link taking visitors to a
 page where I'll have more room.

 Can anyone point me in the right direction? Right now I don't get an
 error but I also don't get any text or results.

?php
// http://pear.php.net/manual/en/package.xml.xml-rss.example.php
require_once XML/RSS.php;

$rss = new XML_RSS(http://slashdot.org/slashdot.rdf;);
$rss-parse();
echo h1Headlines from a href=\http://slashdot.org\;Slashdot/a/h1\n;
echo ul\n;
$i = 0;
foreach ($rss-getItems() as $item) {
if ($i == 3) 
   break;
echo lia href=\ . $item['link'] . \ . $item['title'] . /a/li\n;
   $i++;
}
echo /ul\n;
?

Done.

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



[PHP] Some xml to array

2003-09-09 Thread Bc. Radek Kreja
Hello,

  I have following xml file:

?xml version=1.0 encoding=UTF-8 standalone=no?
epp xmlns=urn:ietf:params:xml:ns:epp-1.0 
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; 
xsi:schemaLocation=urn:ietf:params:xml:ns:epp-1.0 epp-1.0.xsd
response
result code=1000 
msgHello, how are you?/msg
/result
resData
osobaUdaje:infData
osobaUdaje:jmenoRadek Krejca/osobaUdaje:jmeno
osobaUdaje:jmenoAprijmeni
osobaUdaje:krestniRadek/osobaUdaje:krestni
osobaUdaje:prijmeniKrejca/osobaUdaje:prijmeni
/osobaUdaje:jmenoAprijmeni
osobaUdaje:postalInfo type=postal
osobaUdaje:addr
osobaUdaje:streetZizkova 226/3/osobaUdaje:street
osobaUdaje:cityCeske Budejovice/osobaUdaje:city
osobaUdaje:zip370 01/osobaUdaje:zip
osobaUdaje:countrycz/osobaUdaje:country
/osobaUdaje:addr
/osobaUdaje:postalInfo
osobaUdaje:email[EMAIL PROTECTED]/osobaUdaje:email
/osobaUdaje:infData
/resData
/response
/epp

  I can make following assoc. aray:

  msg = Hello, how are you?
  jmeno = Radek Krejca
  .
  .
  .

  How I can do that?

  Thanks Radek

-- 
Regards,
 Bc. Radek Krejca
 Starnet, s. r. o.
 [EMAIL PROTECTED]
 http://www.ceskedomeny.cz
 http://www.skdomeny.com
 http://www.starnet.cz
 ICQ: 65895541 

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



Re: [PHP] Help with Displaying RSS feed links

2003-09-09 Thread Matt Matijevich
could you use this for your loop?

$sizeArr = sizeof($items);
for ($row=0; $row$sizeArr; $row++)
{
echo trtda href= . $items[$row]['link'] .  .
$items[$row]['title'] .
/abr . $items[$row]['description'] .  /td/tr; 

}

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



[PHP] str_replace question

2003-09-09 Thread Al
I've got a simple expression quesxx where xx is a number from 0 to 99.

I want to replace it with simply ques.  That is, I want to remove the 
numbers.

Will str_replace do it, or must I use ereg_replace?

I haven't figured out from reading the php manual on regular expression 
how to do this simple thing. 

Thanks

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


RE: [PHP] str_replace question

2003-09-09 Thread Wouter van Vliet
$String = ques99;
preg_replace('/*\[a-z]+)[0-9]+(\)/', '$1$2', $String);

will most likeley do.

Btw, does anybody know why preg_replace is adviced over ereg_replace in the
manual? .. and if ereg_replace doesn't have any advantages over
preg_replace, couldn't this function get depricated?

 - -Oorspronkelijk bericht-
 - Van: Al [mailto:[EMAIL PROTECTED]
 - Verzonden: dinsdag 9 september 2003 23:21
 - Aan: [EMAIL PROTECTED]
 - Onderwerp: [PHP] str_replace question
 -
 -
 - I've got a simple expression quesxx where xx is a number
 - from 0 to 99.
 -
 - I want to replace it with simply ques.  That is, I want to remove the
 - numbers.
 -
 - Will str_replace do it, or must I use ereg_replace?
 -
 - I haven't figured out from reading the php manual on regular expression
 - how to do this simple thing.
 -
 - Thanks
 -
 - --
 - PHP General Mailing List (http://www.php.net/)
 - To unsubscribe, visit: http://www.php.net/unsub.php

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



[PHP] maillist php manger/interface

2003-09-09 Thread Boulytchev, Vasiliy
Ladies and Gents,
I need the following:
 
1.  A online place for people to subscribe to mailing list.
2.  A online place to unsibscribe from a mailing list.
3.  Several admins for different mailing lists.
4.  mysql integration.
 
What do you guys use?  Any free software out there?  I have reviewed
about a dozen, ready to pay for one.  No time to develop.
 
Vasiliy Boulytchev

Colorado Information Technologies Inc.

(719) 473-2800 x15

http://coinfotech.com/ 

 

 

 


RE: [PHP] countries,states and cities

2003-09-09 Thread Chris W. Parker
Augusto Cesar Castoldi mailto:[EMAIL PROTECTED]
on Monday, September 08, 2003 4:16 PM said:

 where can I download a database with all countries and
 states and cities?

I don't know but I would also be interested in this!!

 like:
 http://www.datingplace.com/servlet/NewRegistration

What? No North Korea? ;)



Chris.

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



RE: [PHP] countries,states and cities

2003-09-09 Thread Chris Shiflett
 where can I download a database with all countries and
 states and cities?

http://www.maxmind.com/

That's a good open source one with APIs for just about everything, including an
Apache module that you can use for real-time queries even under significant
load.

Hope that helps.

Chris

=
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/

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



[PHP] A complete EXIF extension?

2003-09-09 Thread Greg Militello
Hey all,
  I've been dealing with EXIF data in images for a while now.  Reading 
in PHP is available, however editing, or creating EXIF entries doesn't 
exist.

  I am going to work on a set of classes to interphase with libexif a C 
package at:
http://sourceforge.net/projects/libexif/

  The package itself, appears to have a license compatible with PHP 
(MIT license), and I beleive would make a great addition to PHP's 
graphics library.  Currently industry standards use EXIF all over the 
place, and very few languages (from what I have found) have really good 
support for EXIF.

  Integration to PHP would be ideal.  Say you resize an image using GD, 
currently the EXIF data that previously existed with your image is 
gone.  Now you could rewrite information back into your image.  EXIF 
also always for user defined feilds, which would mean I could attach a 
description directly to an image saving the use of a database or other 
datasource.

  I am not a C coder, and thus I don't fansy myself a writer of 
PHP/PECL extensions.  I was wondering if support for this kind of action 
is scheduled?  If not, is there a chance it might be?   I am willing to 
offer my own assistance in the matter, but I have zero experience in 
this realm.  Regaurdless of weather a PHP/PECL extension is created, 
I am planning to write abstraction for using this lib commandline.  But 
ideally for speed, and integration/permissions reasons this would exist 
as a PHP/PECL extension.

Thoughts?
-Greg Militello
?php
/**
* show email
*/
print junk . @ . st.eti . . . com;
?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] countries,states and cities

2003-09-09 Thread Kevin Stone

Chris W. Parker [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Augusto Cesar Castoldi mailto:[EMAIL PROTECTED]
on Monday, September 08, 2003 4:16 PM said:

 where can I download a database with all countries and
 states and cities?

I don't know but I would also be interested in this!!

 like:
 http://www.datingplace.com/servlet/NewRegistration

What? No North Korea? ;)

Chris.

--

The world is a big place.  To get you started here's the 2000 US Census
data.  The file you want is the one labled 'Places.zip'.  The schema is
available on the page but I've posted it below for convenience sake..
http://www.census.gov/geo/www/gazetteer/places2k.html

  a.. Columns 1-2: United States Postal Service State Abbreviation
  b.. Columns 3-4: State Federal Information Processing Standard (FIPS) code
  c.. Columns 5-9: Place FIPS Code
  d.. Columns 10-73: Name
  e.. Columns 74-82: Total Population (2000)
  f.. Columns 83-91: Total Housing Units (2000)
  g.. Columns 92-105: Land Area (square meters) - Created for statistical
purposes only.
  h.. Columns 106-119: Water Area(square meters) - Created for statistical
purposes only.
  i.. Columns 120-131: Land Area (square miles) - Created for statistical
purposes only.
  j.. Columns 132-143: Water Area (square miles) - Created for statistical
purposes only.
  k.. Columns 144-153: Latitude (decimal degrees) First character is blank
or - denoting North or South latitude respectively
  l.. Columns 154-164: Longitude (decimal degrees) First character is blank
or - denoting East or West longitude respectively
Enjoy!

Kevin

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



[PHP] divide

2003-09-09 Thread phpu
Hello,
I'm new in php and i've got allready a problem.
I wanna divide 2 numbers and the result to be an integer separated by comma. For 
example:
$number1=1000;
$number2=17;
$result=$number1 / $number2;
In this case the result is 588235.29411764
And I wanna the result to be like this 588,235

thanks


Re: [PHP] divide

2003-09-09 Thread phpu
yes but if the result is a number like this 34056983 i wanna display this number like 
this 34,056,983
Please help me with this one
  - Original Message - 
  From: Nathan Taylor 
  To: phpu 
  Sent: Wednesday, September 10, 2003 2:49 AM
  Subject: Re: [PHP] divide


  Check out number_format();

  www.php.net/number_format
- Original Message - 
From: phpu 
To: [EMAIL PROTECTED] 
Sent: Tuesday, September 09, 2003 7:50 PM
Subject: [PHP] divide


Hello,
I'm new in php and i've got allready a problem.
I wanna divide 2 numbers and the result to be an integer separated by comma. For 
example:
$number1=1000;
$number2=17;
$result=$number1 / $number2;
In this case the result is 588235.29411764
And I wanna the result to be like this 588,235

thanks



Re: [PHP] divide

2003-09-09 Thread phpu
Sorry
I've got it.
Thanks a lot
  - Original Message - 
  From: Nathan Taylor 
  To: phpu 
  Sent: Wednesday, September 10, 2003 2:59 AM
  Subject: Re: [PHP] divide


  Check out number_format() like I said.
- Original Message - 
From: phpu 
To: Nathan Taylor 
Cc: [EMAIL PROTECTED] 
Sent: Tuesday, September 09, 2003 8:04 PM
Subject: Re: [PHP] divide


yes but if the result is a number like this 34056983 i wanna display this number 
like this 34,056,983
Please help me with this one
  - Original Message - 
  From: Nathan Taylor 
  To: phpu 
  Sent: Wednesday, September 10, 2003 2:49 AM
  Subject: Re: [PHP] divide


  Check out number_format();

  www.php.net/number_format
- Original Message - 
From: phpu 
To: [EMAIL PROTECTED] 
Sent: Tuesday, September 09, 2003 7:50 PM
Subject: [PHP] divide


Hello,
I'm new in php and i've got allready a problem.
I wanna divide 2 numbers and the result to be an integer separated by comma. 
For example:
$number1=1000;
$number2=17;
$result=$number1 / $number2;
In this case the result is 588235.29411764
And I wanna the result to be like this 588,235

thanks




[PHP] argg - new install of php 4.3.3 on iis/w2k - post variables are empty

2003-09-09 Thread Tom H
Hi,

I wonder if anyone has got a fix or explanation for this;
I;ve just just installed php 4.3.3 on a new w2k server and uploaded a well
tested php application to the new site. basically the problem is that the
$HTTP_POST_VARS, $_POST variables are empty, its probably a config problem
somewhere, but as yet I'm unable to track it down.

Thanks in advance for any pointers on fixing this one!!

Cheers

Tom H

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



Re: [PHP] divide

2003-09-09 Thread Gabriel Guzman
On Tuesday 09 September 2003 05:04 pm, phpu wrote:
 yes but if the result is a number like this 34056983 i wanna display this
 number like this 34,056,983 Please help me with this one


that's exactly what number_format() does...  from the example on 
www.php.net/number_format :

?php

$number = 1234.56;

// english notation (default)
$english_format_number = number_format($number);
// 1,234

// French notation
$nombre_format_francais = number_format($number, 2, ',', ' ');
// 1 234,56

$number = 1234.5678;

// english notation without thousands seperator
$english_format_number = number_format($number, 2, '.', '');
// 1234.57

?

that's all there is to it. 

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



[PHP] Multiple Forms

2003-09-09 Thread Dan Anderson
Is it possible to tell a browser to send form a to URL a and form b to
URL b?

(i.e. post to two different URLS)

Thanks,

-Dan

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



RE: [PHP] str_replace question

2003-09-09 Thread Robert Cummings
I think (and don't quote me on this, and feel free to correct me :) that
preg_replace() is fast being based on perl regular expressions.
ereg_replace() however, follows the POSIX standard for regular
expression matching.

Cheers,
Rob.

On Tue, 2003-09-09 at 17:36, Wouter van Vliet wrote:
 $String = ques99;
 preg_replace('/*\[a-z]+)[0-9]+(\)/', '$1$2', $String);
 
 will most likeley do.
 
 Btw, does anybody know why preg_replace is adviced over ereg_replace in the
 manual? .. and if ereg_replace doesn't have any advantages over
 preg_replace, couldn't this function get depricated?
 
  - -Oorspronkelijk bericht-
  - Van: Al [mailto:[EMAIL PROTECTED]
  - Verzonden: dinsdag 9 september 2003 23:21
  - Aan: [EMAIL PROTECTED]
  - Onderwerp: [PHP] str_replace question
  -
  -
  - I've got a simple expression quesxx where xx is a number
  - from 0 to 99.
  -
  - I want to replace it with simply ques.  That is, I want to remove the
  - numbers.
  -
  - Will str_replace do it, or must I use ereg_replace?
  -
  - I haven't figured out from reading the php manual on regular expression
  - how to do this simple thing.
  -
  - Thanks
  -
  - --
  - PHP General Mailing List (http://www.php.net/)
  - To unsubscribe, visit: http://www.php.net/unsub.php
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

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



Re: [PHP] Multiple Forms

2003-09-09 Thread Robert Cummings
You can have two different forms posted to two different URLs. Not sure
if you can in a single submit post two different forms to two different
URLs except maybe with Javascript.

Cheers,
Rob.

On Tue, 2003-09-09 at 20:11, Dan Anderson wrote:
 Is it possible to tell a browser to send form a to URL a and form b to
 URL b?
 
 (i.e. post to two different URLS)
 
 Thanks,
 
 -Dan
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

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



[PHP] Explode and multple lines

2003-09-09 Thread Sweet T
Hello,

I am using php to explode the lines of a text file (delimited by a 
comma), break it into an array, and echo only one of the array elements. 
I have accomplished all of this, but it only echos the text for one 
line. How do I get php to scan multiple lines? I tried to introduce a 
line count, but I can't find any information on how I can create a loop.

An example would be:

For the below text file, I want to echo

dept, 10, 20, 40 ,30

empid, name, job, dept
10,Wilma Tucker, Sales Engineer, 10
43,James Whitmore, Unix SA, 20
50,Tricia Williams, Systems Developer, 40
427, Barry Regar, Administrative Assistant, 30
Thanks!

-T

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


[PHP] Re: maillist php manger/interface

2003-09-09 Thread zavaboy
I have been thinking on developing one for some time now.
I can make one for free for you, I also have a friend that wants one too.
It may take me a week or two, when do you need it?

If you're willing to wait 3 weeks max, I can make it for free.
I can even put it in your site if you want.
I'm going to work on it now so incase you want it.
I will not have power on the 10th or 11th due to electrical work.

I'll tell you what, you email me for anything regarding this project.
My email: [EMAIL PROTECTED]


Vasiliy Boulytchev [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Ladies and Gents,
I need the following:

1.  A online place for people to subscribe to mailing list.
2.  A online place to unsibscribe from a mailing list.
3.  Several admins for different mailing lists.
4.  mysql integration.

What do you guys use?  Any free software out there?  I have reviewed
about a dozen, ready to pay for one.  No time to develop.

Vasiliy Boulytchev

Colorado Information Technologies Inc.

(719) 473-2800 x15

http://coinfotech.com/

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



[PHP] Re: Explode and multple lines

2003-09-09 Thread David
Sweet T wrote:
Hello,

I am using php to explode the lines of a text file (delimited by a 
comma), break it into an array, and echo only one of the array elements. 
I have accomplished all of this, but it only echos the text for one 
line. How do I get php to scan multiple lines? I tried to introduce a 
line count, but I can't find any information on how I can create a loop.

An example would be:
Here is an example of how to loop through a array:

$array = file('data.txt');

foreach($array as $value) {
list($id, $name, $job, $dept) = preg_split('/,/', $value);
echo $dept;
}
How is your array setup?

For the below text file, I want to echo

dept, 10, 20, 40 ,30

empid, name, job, dept
10,Wilma Tucker, Sales Engineer, 10
43,James Whitmore, Unix SA, 20
50,Tricia Williams, Systems Developer, 40
427, Barry Regar, Administrative Assistant, 30
Thanks!

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


Re: [PHP] Some xml to array

2003-09-09 Thread Raditha Dissanayake
Hi,
Looks like a crash course is XML is in order :-) I suggest you take a 
look at the xml parser functions in the manual. to start off with. Then 
there are some good tutorials at w3schools.com

all the best

Bc. Radek Kreja wrote:

Hello,

 I have following xml file:

?xml version=1.0 encoding=UTF-8 standalone=no?
epp xmlns=urn:ietf:params:xml:ns:epp-1.0 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; 
xsi:schemaLocation=urn:ietf:params:xml:ns:epp-1.0 epp-1.0.xsd
response
result code=1000 
msgHello, how are you?/msg
/result
resData
osobaUdaje:infData
osobaUdaje:jmenoRadek Krejca/osobaUdaje:jmeno
osobaUdaje:jmenoAprijmeni
osobaUdaje:krestniRadek/osobaUdaje:krestni
osobaUdaje:prijmeniKrejca/osobaUdaje:prijmeni
/osobaUdaje:jmenoAprijmeni
osobaUdaje:postalInfo type=postal
osobaUdaje:addr
osobaUdaje:streetZizkova 226/3/osobaUdaje:street
osobaUdaje:cityCeske Budejovice/osobaUdaje:city
osobaUdaje:zip370 01/osobaUdaje:zip
osobaUdaje:countrycz/osobaUdaje:country
/osobaUdaje:addr
/osobaUdaje:postalInfo
osobaUdaje:email[EMAIL PROTECTED]/osobaUdaje:email
/osobaUdaje:infData
/resData
/response
/epp
 I can make following assoc. aray:

 msg = Hello, how are you?
 jmeno = Radek Krejca
 .
 .
 .
 How I can do that?

 Thanks Radek

 



--
http://www.radinks.com/upload
Drag and Drop File Uploader.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Encrypt/Serialize Source Code for Sale

2003-09-09 Thread Jason Sheets
Take a look at Turck MMCache and Zend Encoder, both will require your 
user to install a free Loader.  Turck MMCache is free, Zend Encoder is 
not, either will make your applications run faster.

You should workout good licensing deals with your clients because with 
enough motivation and time they will reverse engineer an encoded 
script.  The PHP Obfuscator was intresting but you need to test your 
application again after you use it because of the changes it makes to 
the code.

Most people recommend good legal licensing and a good relationship, if 
that isn't possible I'd use MMCache or Zend Encoder and accept someone 
may reverse engineer it at some point, either of these programs are 
better than something that obscures the code because the store the 
optimized bytecode which will accelerate the program where an encrypted 
source file will slow you down, an obscured one shouldn't slow you down 
much if at all but then there is the testing thing :).

Jason

Ivo Fokkema wrote:

Hi,

I've actually been looking for this kind of things for a while as well.
However, I would not want my client to install something to uncode the
scripts (probably causing the scripts to be unencoded easier). I found
these:
PHP OBFUSCATOR
http://richard.fairthorne.is-a-geek.com/utils_obfuscate.php
Phrozen
http://sourceforge.net/projects/phrozen/
POBS
http://pobs.mywalhalla.net/
Anyone have any recommendations or experience with any?

--
Ivo
Evan Nemerson [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 

Take a look at Turck MMCache (free) and Zend Encoder (not).

http://www.turcksoft.com/en/e_mmc.htm
http://www.zend.com/store/products/zend-encoder.php


On Saturday 06 September 2003 01:59 pm, Charles Kline wrote:
   

What methods are available (ups and downs) for encrypting and
serializing php applications for sale?
Thanks,
Charles
 

 

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


Re: [PHP] Session Variables in a Class

2003-09-09 Thread Curt Zirzow
* Thus wrote micro brew ([EMAIL PROTECTED]):
 Hi everyone,
 
 I've been experimenting with sessions.  I can make
 them work just fine in a normal PHP page.  But when I
 create a class and try to define a session variable
 within a method in the class it won't work.  I've
 tried setting the session variable directly
 ($_SESSION['name']='somevalue') but that didn't work. 
 The normal way of setting it -
 session_start();
 session_register('name'); 
 $name='somevalue';

You might want to read
  http://php.net/session

You are most likley running into a register_globals issue.

A couple things to note:

  . You must not mix $_SESSION[] access with session_register()
  anywhere in your script.

  . When you issue session_register('name') inside your class it is
  declaring the global var $name as a session var, not the $name in
  your script.



Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



[PHP] SID set or unset?

2003-09-09 Thread Jean-Christian IMbeault
Is the PHP constant SID always defined? I have found conflicting answer 
in the documentation. One page of the docs says it is always defined 
while another says it is defined only if the right cookie hasn't been 
passed to the server.

Also how can I check if the SID is set or not?

I have tried the following but get an error:

?php
if (isset(SID)) {}
?
Parse error: parse error, expecting `T_VARIABLE' or `'$''
Thanks,

Jean-Christian Imbeault

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


Re: [PHP] Lost Connection to MySQL server during query

2003-09-09 Thread Curt Zirzow
* Thus wrote Donald Tyler ([EMAIL PROTECTED]):
 
 The script seems to run fine the first time I run it, but with subsequent
 runs (To see if it incorrectly creates duplicates of records etc), after a
 couple of minutes the script ends with an error message saying Lost
 connection to MySQL server during query.

This is a good sign that mysql is crashing for some reason, check
your mysql logs and seek the mysql archives.

Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



Re: [PHP] Setting execution time for a loop

2003-09-09 Thread Curt Zirzow
* Thus wrote zavaboy ([EMAIL PROTECTED]):
 How do I set execution time for a for() loop?
 Like I have a loop stop once it finds 3 things, but what happens when there
 are only 2 things? It keeps looking for 30 seconds then shows this error:
 Fatal error: Maximum execution time of 30 seconds exceeded in...
 
 How can I set it to 3 seconds without a error?

What you explained seems that you're doing something wrong... can
you provide a small example of what you want to get done?



Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



[PHP] gforge

2003-09-09 Thread electroteque
anyone managed to get gforge working with mysql at all ? sorry if this might
be off topic but i found the link off this list, let me know thanks.

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



Re: [PHP] count() numerical arrays....

2003-09-09 Thread Curt Zirzow
* Thus wrote CF High ([EMAIL PROTECTED]):
 Hey all.
 
 Another simple, yet baffling for me, question:
 
 I have a comma delimited list of numbers; e.g. $num_list = 1,2,3,4
 
 I split the number list to array -- $num_list_array = split(, $num_list)
 
 I then count the number of elements -- $count = count($num_list_array);
 
 I do not get 4 for $count, rather 1!
 
 I can't stand coming up with cludgy workarounds just to count the number of
 elements in a numerical list.

So you just want to count how many digits their are?

$num_list = 1,2,3,4;
$count = substr_count($num_list, ,) + 1;

 http://php.net/substr_count


No sense of all the extra work in putting it into an array.

HTH,

Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



Re: [PHP] Brainiacs please help! PostgreSQL and foreach() problem

2003-09-09 Thread Raditha Dissanayake
Hi,

It's not very clear what you are trying to do. From what i understand 
from your mail, i think a recursive call to select_names would be the 
ideal solution. In these scenario you call select_names() once and from 
within the function you call select_name() again for the each of the 
matches on the first level.

You should be aware of the obvious drawback of recursive calls: memory 
consumption. If your tree strecthes to infinity as you feel it migh, you 
will get a stack overflow. :-)





Peter Sharpe wrote:

I have a database full of names. each name could be linked to any number of
sub-names, each sub-name could be linked to any number of sub-sub-names, to
infinity (unlikely but possible).
I need to iterate through this nest of names starting with a main name; lets
call the main name Peter. Peter could have John, Tim  Mike working for him.
Tim could have Greg working for him.
function select_names($current_top_name){
global $dbh;
$sql = 
SELECT
name_id_fk
FROM
name_relation
WHERE
top_name_id_fk = '.$current_top_name.'
;
$rs = pg_query($dbh, $sql);
if(($num_rows = pg_num_rows($rs))  0){

for($i=0;$i$num_rows;$i++){
$row = pg_fetch_row($rs, $i, PGSQL_ASSOC);
$associated_names[] = $row['name_id_fk'];
}
pg_free_result($rs);

} // end if(($num_rows = pg_num_rows($rs))  0)

return $associated_names;

} // end function select_names()

$current_top_name = 'Peter';

while(!$stop){

$assoc_names = select_names($current_top_name);

foreach($assoc_names as $key = $val){
print($val);
$more_assoc_names = select_names($val);
if($more_assoc_names){
ARG HELP IM NOT SMART ENOUGH
}
} // end while(!$stop)

} // end foreach($assoc_names as $key = $val)

 



--
http://www.radinks.com/upload
Drag and Drop File Uploader.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] ereg_replace vs. preg_replace [was: str_replace question]

2003-09-09 Thread Curt Zirzow
* Thus wrote Wouter van Vliet ([EMAIL PROTECTED]):
 
 Btw, does anybody know why preg_replace is adviced over ereg_replace in the
 manual? .. and if ereg_replace doesn't have any advantages over
 preg_replace, couldn't this function get depricated?

I've done some testing with  ereg and preg functions and
preg beats ereg by quite a bite (sorry don't have results)

preg is much more advanced and can do a lot more things than ereg
can. I think just by looking at the documentation (two separate
pages, not related to the functions), you can see that it is rather
thorough.

The biggest disadvantage  with preg is that since it is complex,
mistakes can easily be overlooked.

Only since 4.2.0 has preg_* functions been compiled by default so
if a person wanted to write scripts that were portable across many
different hosting sites  they would use ereg_* functions.

As for being deprecated, I doubt that will happen (as
mentioned above) ereg_* has been around for many years, since early
3.x versions.  Php developers may be familiar with the posix syntax
so instead of learning the perl version they have the option to use
the ereg_* functions.

Although I haven't heard any (php) claims as such but some people may want
to be 100% POSIX compatible :)
 

Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



Re: [PHP] SID set or unset?

2003-09-09 Thread Curt Zirzow
* Thus wrote Jean-Christian IMbeault ([EMAIL PROTECTED]):
 Is the PHP constant SID always defined? I have found conflicting answer 
 in the documentation. One page of the docs says it is always defined 
 while another says it is defined only if the right cookie hasn't been 
 passed to the server.
 
 Also how can I check if the SID is set or not?
 
 I have tried the following but get an error:
 
 ?php
 if (isset(SID)) {}
 ?
 Parse error: parse error, expecting `T_VARIABLE' or `'$''

SID is a constant, only variables can be tested with isset().
  http://php.net/isset

What you want is defined()
  http://php.net/defined

ie:
if (defined('SID')) {}




Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



[PHP] Re: yahoo messeger scrpt php

2003-09-09 Thread RoyD








Roy Daniel , ST , IT Application Support  Development EngineerPT
BERCA COMPUTEL


[EMAIL PROTECTED]//  [EMAIL PROTECTED]


ICQ : # 103507581 / Handphone : +62-8161192832 / yahoo_messeger :
roy_daniel91


   

Roy Daniel 

 To: Dasmeet [EMAIL PROTECTED]   
   
09/10/2003   cc: [EMAIL PROTECTED] 
11:37 AM Subject: yahoo messeger scrpt 
php(Document
 link: Roy Daniel) 

   




dear all how to created the script in php / html , that someone knows that
another people online / off line in yahoo messeger in page ?

thank you all ..






Roy Daniel , ST , IT Application Support  Development EngineerPT
BERCA COMPUTEL


[EMAIL PROTECTED]//  [EMAIL PROTECTED]


ICQ : # 103507581 / Handphone : +62-8161192832 / yahoo_messeger :
roy_daniel91


   
 
Dasmeet
 
[EMAIL PROTECTED]   To: [EMAIL PROTECTED] 
 
a.com   cc:   
 
 Subject: [PHP] Cpanel or Plesk
 
09/07/2003 
 
01:28 AM   
 
   
 
   
 




Hi!
I guess many of you must have used both CPanel and Plesk. Can you tell
me which one is better and what are the basic differences between them?
Also can accounts hosted on WHM/CPanel moved to Plesk?
Any information would be of great help.
Thanks in advance!
Dasmeet

--
--
Domainwala.com
Domain Names from Rs. $7.99 at http://www.domainwala.com
http://www.domainwala.com/headlines/index.php
http://www.domainwala.com/links

--
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



  1   2   >