php-general Digest 6 Jun 2005 15:48:41 -0000 Issue 3497

2005-06-06 Thread php-general-digest-help

php-general Digest 6 Jun 2005 15:48:41 - Issue 3497

Topics (messages 216462 through 216493):

Displaying an Outlook Calendar on a webpage using PHP
216462 by: Justin.Baiocchi.csiro.au
216490 by: tg-php.gryffyndevelopment.com

categories and sub categories
216463 by: Merlin

Re: stripping html tags
216464 by: Dotan Cohen

about the absolutely path
216465 by: yangshiqi

Compiling PDO statically into PHP 5.0.4
216466 by: Andreas Korthaus

linux php editor
216467 by: Clive Zagno
216470 by: Jack Jackson
216485 by: Greg Donald
216486 by: John Nichel
216489 by: Greg Donald
216492 by: John Nichel
216493 by: Rory Browne

Re: replace striing éèêà
216468 by: Jochem Maas

Re: looping through an array problem
216469 by: Jochem Maas

PHP5 with Apache 1.3.29
216471 by: XMG

How to submit a form that has a file included ?
216472 by: Mário Gamito
216473 by: Jay Blanchard
216475 by: Mathieu Dumoulin

Implode? Explode?
216474 by: Jack Jackson
216482 by: Brent Baisley

Re: What is faster?
216476 by: Mark Cain
216477 by: Jochem Maas
216478 by: Marek Kilimajer

Regex help
216479 by: RaTT
216487 by: Philip Hallstrom

PHP bug within multi. dimensional arrays?
216480 by: Merlin
216481 by: Matthew Weier O'Phinney
216483 by: Richard Davey
216484 by: Merlin
216491 by: Merlin

headers and session
216488 by: Alessandro Rosa

Administrivia:

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

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

To post to the list, e-mail:
php-general@lists.php.net


--
---BeginMessage---
Hello all,
 
I am trying to publish an Outlook Calendar on a web page using PHP and
COM. I have managed to track down on the net some examples of how it
could be done. The most promising is the code below. However, all that
happens is that outlook.exe is started on the server, but nothing is
displayed on the web page and it just times-out.
 
I am running PHP 4.0.18 on Windows 2003 server and I have Outlook 2002
installed on the server.
Does anybody know why it doesn't work?
 
Thanks 
Justin
 
 
 
?php 
$comobjOutlook = new COM(outlook.application) or die(Unable to
instantiate outlook);
 

//$comobjOutlook - Activate;
 

# This is your mailbox name just like it appears in your Folders view.
It might be 'Inbox' or something else. 
$targetmailboxname = Mailbox - Baiocchi, Justin (CSIRO IT, Armidale);
 

# This is the folder you're looking for. In this case, I'm looking for
calendar items, but you can look for 
# any folder. You need to add another loop to look for subfolders.
Although there's probably a better 
# way, that's how I did it when I needed to get to Personal
Folders/Inbox/Subfoldername 
$targetfoldername = Calendar; 
 

$objNamespace = $comobjOutlook-GetNameSpace(MAPI); 
$objFolders = $objNamespace-Folders(); 
$mailboxcount = $objFolders - Count(); 
 

$foundmailbox = FALSE; 
for ($i=1; $i=$mailboxcount; $i++) { 
  $folderitem = $objFolders -Item($i); 
  if ($folderitem - Name == $targetmailboxname) { 
$objMailbox = $folderitem; 
$foundmailbox = TRUE; 
  } 
} 
 

$foundcal = FALSE; 
if ($foundmailbox) { 
  $objFolders = $objMailbox-Folders(); 
  $foldercount = $objFolders - Count(); 
 

  for ($i=1; $i=$foldercount; $i++) { 
$folderitem = $objFolders - Item($i); 
if ($folderitem - Name == $targetfoldername) { 
  $objCalendar = $folderitem; 
  $foundcal = TRUE; 
} 
  } 
 

  if ($foundcal) { 
$objItems = $objCalendar-Items(); 
$itemcount = $objItems-Count(); 
 

for ($i=1; $i=$itemcount; $i++) { 
  $apptitem = $objItems - Item($i); 
  $apptstart = $apptitem - Start(); 
  $apptend = $apptitem - End(); 
  $apptallday = $apptitem - AllDayEvent(); 
  $apptrecur = $apptitem - IsRecurring(); 
  $apptsubject = $apptitem - Subject(); 
  $apptlocation = $apptitem - Location(); 
 

  $secondsadj = $apptstart - 14400; 
  $startadj = date(m/d/Y H:i:s, mktime(0,0,$secondsadj,1,1,1970));

 

  $secondsadj = $apptend - 14400; 
  $endadj = date(m/d/Y H:i:s, mktime(0,0,$secondsadj,1,1,1970)); 
 

  if($apptallday) { $allday = All Day; } else { $allday = ; } 
  if($apptrecur) { $recurring = Recurring; } else { $recurring =
; } 
 

  echo $apptsubject @ $apptlocation\r\nFrom: $startadj To:
$endadj\r\n; 
  if ($allday   OR $recurring  ) echo $allday
$recurring\r\n; 
  echo \r\n\r\n; 
} 
 

  } else { 
die (Did not find calendar folder); 
  } 
 

} else { 
  die(Did not find target mailbox: $targetmailboxname); 
} 
? 
 
 
---End Message---
---BeginMessage---
That looks like some of my code.. or a derivative of my code.   For some 
reason, my PC at work here is 

[PHP] categories and sub categories

2005-06-06 Thread Merlin

Hi there,

I am trying to retrieve cat and subcategories out of 2 db tables and output them 
via php. That seems not to be that trivial.


My goal is to have output like this:

- Languages
: php
: asp
- Fruites
: apples
: peaches

Therefore I do have a table cat and a tabel sub_cat and the values are filled 
into the arrays $cat[main][name] and $cat[sub][name].


Now here is my output try:

for ($i=0;$icount($cat[main][name]);$i++){
# output main cat
echo $cat[main][name][$i];

# output subcats which belong to this main cat
for ($k=0;$kcount($cat[sub][name]);$k++){
cat[sub][name][$k];
}
};

I am lost here and could need some advice. Any help is appreciated.

Merlin

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



Re: [PHP] Re: stripping html tags

2005-06-06 Thread Dotan Cohen
On 6/6/05, Chris Shiflett [EMAIL PROTECTED] wrote:
 Dotan Cohen wrote:
  IF you know every single tag that exists! And being how I only wanted
  to remove four of them, the list of 'what to remove' is so much more
  compact than the 'leave those' list!
 
 For what purpose are you wanting to remove tags? If this is for data
 that you plan to send to the client, then your approach is poor.
 
 Your reasoning is exactly why you should never try to guess which tags
 to remove - you're almost certain to forget something. This is why so
 many people create PHP applications with security vulnerabilities.
 
 If I've misunderstood your intent, then perhaps your approach is fine,
 but I wanted to point out the risk in your approach.
 
 Chris
 
 P.S. You should never modify invalid data in order to make it valid.
 Thus, I think strip_tags() is also a poor approach and not something I
 ever recommend using. Filtering input and escaping output are the best
 practices.
 
 --
 Chris Shiflett
 Brain Bulb, The PHP Consultancy
 http://brainbulb.com/
 

I am trying to access my local pop3 mail via wap. When I get home I
download the messages, but while away I need access to them. I am
trying to strip those tags from html mails so that they will display
in my wap browser.

Dotan
http://lyricslist.com/lyrics/pages/artist_albums.php/238/Guns%20N'%20Roses
Guns N' Roses Lyrics

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



[PHP] about the absolutely path

2005-06-06 Thread yangshiqi
I have a php application (let's call it app A) which is developed separated
in a test domain name, like http://testa.xxx.com http://testa.xxx.com/ /.

But now I have to move it to another app (called B) using
http://testb.xxx.com http://testb.xxx.com/ /, and the app A becomes just a
subsystem of app B.

The access url is changed to http://testb.xxx.com/a/.

Then I meet a problem that the app A 's links, the path and other elements
in it are set like '/Main.php', '/art/logo.gif' by an absolutely path.

The app A is very independent and I do not want to disperse it to app B.

So how can I get this effect: when the user input the url, '
http://testb.xxx.com/a/ ', the app A will work fine?

Can I just modify some configuration about yapache to fit this requirement?

 

 

 

 

 

 

 

Best regards,

Yang Shiqi

 

 

 

 



[PHP] Compiling PDO statically into PHP 5.0.4

2005-06-06 Thread Andreas Korthaus

Hi!

I would like to compile PDO + PDO_sqlite statically into PHP 5.0.4. 
First I downloaded PDO-0.3.tgz and PDO_SQLITE-0.3.tgz and extracted them 
to /my/phpsrcdir/ext. I renamed the directories from PDO-0.3 to pdo 
and from PDO_SQLITE-0.3 to pdo_sqlite.


I tried to follow these instructions: 
http://www.php.net/manual/en/install.pecl.static.php


so from /my/phpsrcdir I executed:

./buildconf --force

But after this I tried

./configure --help | grep -i pdo

without any results.

So I did not know which ./configure parameters where necessary, so I 
extracted these .tgz-files to another location (not in /my/phpsrcdir) 
and used phpize to find out which ./configure parameters I need. So I 
found out that I have to use


--enable-pdo --with-pdo-sqlite

I did not expect it to work, but I tried to execute the following 
./configure command:


./configure \
  --prefix=/my/phpbindir/ \
  --enable-pdo \
  --with-pdo-sqlite \
  --enable-memory-limit

It did not fail, but after make  make install there is no pdo-support 
compiled in.


What is going wrong here? What can I do?


kind regards
Andreas

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



[PHP] linux php editor

2005-06-06 Thread Clive Zagno
what php GUI editors do you recommend. Ive used bluefish before, any 
other recommendations, thanks


clive

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



Re: [PHP] replace striing éèêà

2005-06-06 Thread Jochem Maas

John Taylor-Johnston wrote:
Can someone show me how to get rid of international characters in 
$string? Is there a function already made?


the acute/grave accents on the chars are called 'diacritics'

You cannot use accented characters in a name reference : a 
name=montréal.

I guess this below is a start. Is there a better way?
John

http://ca.php.net/manual/en/function.str-replace.php
$string = àâéèç;
|$find = array(à, â, é, è, ç);
||$||replacewith|| = array(a, a, e, e, c);||
$onlyconsonants = str_replace($vowels, $replacewith, $string);



?php
// you could do something like:

function getUndiacritical($word)
{

$base_drop_char_match =   array('^', '$', '', '(', ')', '', '', '`', '\'', '', '|', ',', '@', '_', '?', '%', '-', 
'~', '+', '.', '[', ']', '{', '}', ':', '\\', '/', '=', '#', '\'', ';', '!');
$base_drop_char_replace = array(' ', ' ', ' ', ' ', ' ', ' ', ' ', '',  '',   ' ', ' ', ' ', ' ', '',  ' ', ' ', '',  ' 
', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' , ' ', ' ', ' ', ' ',  ' ', ' ');


$xtr_drop_char_match   = array('à', 'â', 'ä', 'æ', 'è', 'ê', 'ì', 'î', 'ð', 'ò', 'ô', 'ö', 'ø', 'ú', 'ü', 'ß', 'á', 'ã', 
'å', 'ç', 'é', 'ë', 'í', 'ï', 'ñ', 'ó', 'õ', 'ù', 'û', 'ý', 'ÿ');
$xtr_drop_char_replace = array('a', 'a', 'a', 'a', 'e', 'e', 'i', 'i', 'o', 'o', 'o', 'o', 'o', 'u', 'u', 's', 'a', 'a', 
'a', 'c', 'e', 'e', 'i', 'i', 'n', 'o', 'o', 'u', 'u', 'y', 'y');


$drop_char_match   = array_merge( $base_drop_char_match, $xtr_drop_char_match );
$drop_char_replace = array_merge( $base_drop_char_replace, 
$xtr_drop_char_replace );

return str_replace($drop_char_match, $drop_char_replace, $word);

}

// alternatively


function getUndiacritical2($word)
{

$base_drop_char_match =   array('^', '$', '', '(', ')', '', '', '`', '\'', '', '|', ',', '@', '_', '?', '%', '-', 
'~', '+', '.', '[', ']', '{', '}', ':', '\\', '/', '=', '#', '\'', ';', '!');
$base_drop_char_replace = array(' ', ' ', ' ', ' ', ' ', ' ', ' ', '',  '',   ' ', ' ', ' ', ' ', '',  ' ', ' ', '',  ' 
', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' , ' ', ' ', ' ', ' ',  ' ', ' ');


$xtr_drop_char_match   = array('à', 'â', 'ä', 'æ', 'è', 'ê', 'ì', 'î', 'ð', 'ò', 'ô', 'ö', 'ø', 'ú', 'ü', 'ß', 'á', 'ã', 
'å', 'ç', 'é', 'ë', 'í', 'ï', 'ñ', 'ó', 'õ', 'ù', 'û', 'ý', 'ÿ');
$xtr_drop_char_replace = array('a', 'a', 'a', 'a', 'e', 'e', 'i', 'i', 'o', 'o', 'o', 'o', 'o', 'u', 'u', 's', 'a', 'a', 
'a', 'c', 'e', 'e', 'i', 'i', 'n', 'o', 'o', 'u', 'u', 'y', 'y');


$drop_char_match   = join('',array_merge( $base_drop_char_match, 
$xtr_drop_char_match ));
$drop_char_replace = join('',array_merge( $base_drop_char_replace, 
$xtr_drop_char_replace ));

return strtr($drop_char_match, $drop_char_replace, $word);

}


?

I doubt either of these funcs is perfect but it hopefully gives you a clue in 
the right
redirection.

rgds,
Jochem



|



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



Re: [PHP] looping through an array problem

2005-06-06 Thread Jochem Maas

Jack Jackson wrote:
Forgive me if this comes twice: my ISP had a service blackout for three 
hours and I don't know what went:



If my last post read (and I see that it did) that I was defending myself
as opposed to falling ALL OVER my sword, I apologize: allow me to be clear:

No, you're all correct and M. Sokolewicz doubly so: I had
unintentionally selected fields from the wrong table for no reason other
than  lack of sleep coupled with lack of experience and a desperation to
try to understand

The problem was that I was pulling data in a manner both useless and
complex from a thoroughly unnecessary table (I could tell you all why
but you'll all just laugh at me more)

I am grateful for all the help everyone has offered up to now and hope I
did not offend  - I was trying in my last post to indicate that I  was
an idiot, and it appears I've come off as arrogant. I promise it was not
my intent!


don't worry - I got the idea that maybe there was some confusion
- nothing else. oh and I don't think anyone is/will laugh at you
(well most of us won't ;-/), we have all been 'there' :-)

so all is well.




[Then I wrote::]

Ah. I just remembered one reason I had done it involving the art_id field:

I have more publishers in the db than are currently associated with 
artworks. I don't want a publisher to appear unless there is at least 
one image associated with it. So I did this to avoid having people see a 
link to the Sneezy Acres Tribune only to arrive at the next page and 
see, There are no images associated with this publisher.




Jochem Maas wrote:


Jack Jackson wrote:




M. Sokolewicz wrote:


Jack Jackson wrote:

Thanks for all the replies. Jochem, thank you for this code, which 
will take me all night to understand (though I bet it works). I 
also note that SELECT DISTINCT worked here, too


Also as many of you noticed before me, the art_id was in there as a 
fly in the ointment.





by that statement I ment the exact same thing Jochem ment in his 2nd 
part; I have NO idea why you're selecting *ANYTHING* from the arts 
table... it's *useless* if you don't need the data...





Er, yes, that was what I meant: I had unintentionally included that 
bit.Thank you for your help.




Er, Jack - your original query was:

SELECT art.art_id,art.publisher_id,publisher.publisher_name,
FROM art
LEFT JOIN publisher
ON publisher.publisher_id=art.publisher_id

which is a selection on the art table... ( with a typo)
if you did:

SELECT art.publisher_id,publisher.publisher_name
FROM art
LEFT JOIN publisher
ON publisher.publisher_id=art.publisher_id

nothing would change. and if you did:

SELECT publisher.publisher_id,publisher.publisher_name
publisher

i.e. not 'unintentionally' selecting from the arts table.
then you would not have had a problem in the first place?!

I think I'm missing something ;-)





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



Re: [PHP] linux php editor

2005-06-06 Thread Jack Jackson



Clive Zagno wrote:
what php GUI editors do you recommend. Ive used bluefish before, any 
other recommendations, thanks


clive


I love Jedit http://www.jedit.com

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



[PHP] PHP5 with Apache 1.3.29

2005-06-06 Thread XMG
I am trying to build Apache 1.3.29 on Fedora to use with mod_ssl and PHP5. 
After having built this all with no apparent problems I see this error 
message in the Apache error_log on startup:


   [Mon Jun  6 06:32:21 2005] [warn] Loaded DSO libexec/libphp5.so uses 
plain Apache 1.3 API,

   this module might crash under EAPI! (please recompile it with -DEAPI)

Ok, so I went back and changed the configuration for mod_ssl 
(mod_ssl-2.8.16-1.3.29) so that it would configure Apache to use the -DEAPI 
switch, e.g.:


./configure \
   --with-apache=../apache_1.3.29 \
   --with-ssl=../openssl-0.9.7c \
   --prefix=/usr/local/apache \
   --enable-module=so \
   --disable-rule=EAPI

That seemed to work ok, and when I make Apache I see lines like this for gcc 
so sure looks like the switch is being applied:


   gcc -c  -I./os/unix -I./include   -DLINUX=22 -DMOD_SSL=208116
   -DUSE_HSREGEX -DEAPI `./apaci` modules.c

Then I re-installed PHP5 and configured it again to use this Apache, but I 
am still seeing this warning in the startup log. So I was hoping that 
someone here perhaps has seen this error before and has a clue as what it is 
about? :)


Thanks in advance,

Lawrence Kennon
www.theNewAgeSite.com

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



[PHP] How to submit a form that has a file included ?

2005-06-06 Thread Mário Gamito
Hi,

I want to have a form with text fields and a browse field for
uploading a file.

Let's say i have a form with just two fields:

form name=form1 method=post action=action.php
  tr
   td
Employee:br /
Name: input name=name type=text id=name size=50
   /td
  /tr

 Employee File (a .doc):
  Now, i want here a browse button, so users when clicking on it trigers
the os File Open box to choose the file to upload.

/form

My question is: what is the code i need in the form ?
And the form tag, is it allright like it is ?

Thank you in advance.

Warm regards,
Mário Gamito

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



RE: [PHP] How to submit a form that has a file included ?

2005-06-06 Thread Jay Blanchard
[snip]
I want to have a form with text fields and a browse field for
uploading a file.
...
  Now, i want here a browse button, so users when clicking on it trigers
the os File Open box to choose the file to upload.
...
My question is: what is the code i need in the form ?
And the form tag, is it allright like it is ?
[/snip]

Read this section, http://us4.php.net/manual/en/features.file-upload.php it has 
examples.

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



[PHP] Implode? Explode?

2005-06-06 Thread Jack Jackson

Hi all,
I'm trying to fetch similar things - in this case, rows which share a 
series ID no - and bring them into an array and display them grouped by 
 what makes them similar (in this case, series id). I looked at implode 
and explode which seem wrong for this - the only separator I can see is 
that they're each in a table cell.


The result of my query returns something like:

art_id   series_id art_titleseries_name
2   1  Weddings 2004Summer Special
4   1  Summer In The City   Summer Special
5   2  Bags of NY   Op-Art
7   2  Dogs of NY   Op-Art


I'd like to create a list of links to each art_id grouped together as 
series, href code obviously not complete but demonstrative:


pSummer Specialbr /
a href='2'Weddings 2004/a | a href='4'Summer In The City/p

pOp-Artbr /
a href='5'Bags of NY/a | a href='7'Dogs of NY/p


?

Thanks in advance,
Jack

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



Re: [PHP] How to submit a form that has a file included ?

2005-06-06 Thread Mathieu Dumoulin

Jay Blanchard wrote:

[snip]
I want to have a form with text fields and a browse field for
uploading a file.
...
  Now, i want here a browse button, so users when clicking on it trigers
the os File Open box to choose the file to upload.
...
My question is: what is the code i need in the form ?
And the form tag, is it allright like it is ?
[/snip]

Read this section, http://us4.php.net/manual/en/features.file-upload.php it has 
examples.


Never tried this?

input type=file name=wathever size=100

;)

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



Re: [PHP] What is faster?

2005-06-06 Thread Mark Cain
I see your point about including the timing code in the calculation itself
and while it does add time to the process, he is not just timing this
code -- he is timing this code against another.  Meaning we don't want to
know How fast is this code? per se -- we want to know Which is faster?
So, arguably from the faster point of view, as long as the time mech is in
both tests, the question will be answered with a degree of certainty.  From
the days of my boyhood, even if the race route were two times around the
big oak tree, the faster runner would still win the race.

Question for you, please:

In your post you say:

 time. For example, using something like ab will let you test your code
 in its raw form - without the timing and looping.

What is ab?  I am somewhat limited in my depth and scope of php and so I
have never seen this before.  Care to point me in a direction where I could
learn more?

Mark Cain




- Original Message -
From: Chris Shiflett [EMAIL PROTECTED]
To: Mark Cain [EMAIL PROTECTED]
Cc: Andy Pieters [EMAIL PROTECTED]; php-general@lists.php.net
Sent: Sunday, June 05, 2005 9:56 PM
Subject: Re: [PHP] What is faster?


 Mark Cain wrote:
  I checked the first expression with 1,000 iterations and it
  took 0.00745 seconds.
 
  Here is the code I used.

 [snip]

  $start1 = vsprintf('%d.%06d', gettimeofday());

 Although many would argue that it's pointless to worry over such small
 details (and they have valid arguments), it's better to construct your
 benchmark so that the timing mechanism impacts your code as little as
 possible.

 Although consistency is difficult to achieve without some effort, you
 can at least get your timing mechanism out of the code that you want to
 time. For example, using something like ab will let you test your code
 in its raw form - without the timing and looping.

 I also dislike unit tests that are part of the code they're meant to
 test. :-)

 Hope that helps.

 Chris

 --
 Chris Shiflett
 Brain Bulb, The PHP Consultancy
 http://brainbulb.com/



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



Re: [PHP] What is faster?

2005-06-06 Thread Jochem Maas

Mark Cain wrote:

I see your point about including the timing code in the calculation itself
and while it does add time to the process, he is not just timing this
code -- he is timing this code against another.  Meaning we don't want to
know How fast is this code? per se -- we want to know Which is faster?
So, arguably from the faster point of view, as long as the time mech is in
both tests, the question will be answered with a degree of certainty.  From
the days of my boyhood, even if the race route were two times around the
big oak tree, the faster runner would still win the race.

Question for you, please:

In your post you say:



time. For example, using something like ab will let you test your code
in its raw form - without the timing and looping.



What is ab?  I am somewhat limited in my depth and scope of php and so I
have never seen this before.  Care to point me in a direction where I could
learn more?


apache benchmark, try:

 man ab

on your local linux cmd line (assuming you have apache installed)



Mark Cain




- Original Message -
From: Chris Shiflett [EMAIL PROTECTED]
To: Mark Cain [EMAIL PROTECTED]
Cc: Andy Pieters [EMAIL PROTECTED]; php-general@lists.php.net
Sent: Sunday, June 05, 2005 9:56 PM
Subject: Re: [PHP] What is faster?




Mark Cain wrote:


I checked the first expression with 1,000 iterations and it
took 0.00745 seconds.

Here is the code I used.


[snip]



$start1 = vsprintf('%d.%06d', gettimeofday());


Although many would argue that it's pointless to worry over such small
details (and they have valid arguments), it's better to construct your
benchmark so that the timing mechanism impacts your code as little as
possible.

Although consistency is difficult to achieve without some effort, you
can at least get your timing mechanism out of the code that you want to
time. For example, using something like ab will let you test your code
in its raw form - without the timing and looping.

I also dislike unit tests that are part of the code they're meant to
test. :-)

Hope that helps.

Chris

--
Chris Shiflett
Brain Bulb, The PHP Consultancy
http://brainbulb.com/







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



Re: [PHP] What is faster?

2005-06-06 Thread Marek Kilimajer

Mark Cain wrote:

I see your point about including the timing code in the calculation itself
and while it does add time to the process, he is not just timing this
code -- he is timing this code against another.  Meaning we don't want to
know How fast is this code? per se -- we want to know Which is faster?


You want to also know which one parses faster

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



[PHP] Regex help

2005-06-06 Thread RaTT
Hi Guys, 

I am currently creating a once off text parser for a rather large
document that i need to strip out bits of information on certain
lines.

The line looks something like :


Adress line here, postcode, country Tel: +27 112233665 Fax: 221145221
Website: http://www.urlhere.com E-Mail: [EMAIL PROTECTED] TAGINCAPS: CAPS
RESPONSE Tag2: blah


I need to retreive the text after each marker i.e Tel: Fax: E-Email:
TAGINCAPS: ...

I have the following regex /Tel:\s*(.[^A-z:]+)/ and
/Fax:\s*(.[^A-z:]+)/ all these work as expected and stop just before
the next Tag. However I run into hassels  around the TAGINCAPS as the
response after it is all in caps and i cant get the Regex to stop just
before the next tag: which may be either all caps or lowercase.

I cant seem to find the regex that will retreive all chartures just
before a word with a :  regalrdless of case.

I have played around with the regex coach but still seem to be comming
up short so i thought i would see if anybody can see anything i might
have missed.

any help most appreciated. 

Regards 
Jarratt

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



[PHP] PHP bug within multi. dimensional arrays?

2005-06-06 Thread Merlin

Hi there,

I am outputting an multidim. array. That works fine, except one thing. The first 
letter of the value inside dimension 1 always gets printed.


For example:

I fill the arrays:
while ($row = mysql_fetch_object($result)){ 
$cat[$row-main_id][name]= $row-main_name;   
$cat[$row-main_id][$row-sub_id][name] = $row-sub_name;   
   
}

Then I output them:
foreach ($cat AS $maincat){
echo $maincat[name].':';
foreach($maincat AS $subcat){
echo $subcat[name].$br;
}
echo $br;
}

Which does result in:

Europe:E
Germany
UK

North America:N
US
CA

As you can see I get the extra letters N and E. Is this an php error or did I do 
something wrong?


Thanx for any hint,

Merlin

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



[PHP] Re: PHP bug within multi. dimensional arrays?

2005-06-06 Thread Matthew Weier O'Phinney
* Merlin [EMAIL PROTECTED]:
 Hi there,

 I am outputting an multidim. array. That works fine, except one thing. The 
 first 
 letter of the value inside dimension 1 always gets printed.

 For example:

 I fill the arrays:
 while ($row = mysql_fetch_object($result)){   
   $cat[$row-main_id][name]   = $row-main_name;  
   $cat[$row-main_id][$row-sub_id][name] = $row-sub_name;   
 
 }

First off, if you're creating associative arrays, you should quote the
keys:

$cat[$row-main_id]['name'] = $row-main_name;

If you don't do so, PHP assumes you're using a constant value for the
key name.

 Then I output them:
 foreach ($cat AS $maincat){
   echo $maincat[name].':';

Quote your keys!

   foreach($maincat AS $subcat){

You do realize that the above will also loop over the index 'name',
right?...

   echo $subcat[name].$br;

and since it does, the first element in that array is 'name', which
isn't an array, but a string. Since the 'name' constant isn't defined,
it will interpret that as 'true', or 1, and so it takes the first
character of that string.

   }
   echo $br;
 }

 Which does result in:

 Europe:E
 Germany
 UK

 North America:N
 US
 CA

 As you can see I get the extra letters N and E. Is this an php error or did I 
 do 
 something wrong?

So, what you should probably do is create an additional layer in your
multi-dimensional array for the subcategories, and have it of the form
sub_id = sub_name:

$cat[$row-main_id]['subs'][$row-sub_id] = $row-sub_name; 

Then loop over that:

foreach ($cat as $main_cat) {
echo $maincat['name'] . :\n;
foreach ($maincat['subs'] as $sub_id = $sub_name) {
echo $sub_name$br; // could also use $sub_id here if
 // desired
}
}

-- 
Matthew Weier O'Phinney   | WEBSITES:
Webmaster and IT Specialist   | http://www.garden.org
National Gardening Association| http://www.kidsgardening.com
802-863-5251 x156 | http://nationalgardenmonth.org
mailto:[EMAIL PROTECTED] | http://vermontbotanical.org

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



Re: [PHP] Implode? Explode?

2005-06-06 Thread Brent Baisley
You're close, but you need to group your data on the series_id first. 
You can do that by looping through your array and creating another 
array using series_id as the array key. You'll end up with a list of 
arrays named after the series_id.


foreach( $result_set as $result_item ) {
//Add an array item to the series_id slot of the grouped_result array
	$grouped_result[ $result_item['series_id'] ][]	= 
array('id'=$result_items['art_id'], 
'title'=$result_item['art_title']);

}

Now you have your data grouped by series_id. Each item of the 
grouped_result array will contain one or more arrays which contain the 
art_id and art_title.


If you are not familiar with multidimensional arrays, this may be a 
little confusing.




On Jun 6, 2005, at 8:32 AM, Jack Jackson wrote:


Hi all,
I'm trying to fetch similar things - in this case, rows which share a 
series ID no - and bring them into an array and display them grouped 
by  what makes them similar (in this case, series id). I looked at 
implode and explode which seem wrong for this - the only separator I 
can see is that they're each in a table cell.


The result of my query returns something like:

art_id   series_id art_titleseries_name
2   1  Weddings 2004Summer Special
4   1  Summer In The City   Summer Special
5   2  Bags of NY   Op-Art
7   2  Dogs of NY   Op-Art


I'd like to create a list of links to each art_id grouped together as 
series, href code obviously not complete but demonstrative:


pSummer Specialbr /
a href='2'Weddings 2004/a | a href='4'Summer In The City/p

pOp-Artbr /
a href='5'Bags of NY/a | a href='7'Dogs of NY/p


?

Thanks in advance,
Jack

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



--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search  Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577

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



Re: [PHP] PHP bug within multi. dimensional arrays?

2005-06-06 Thread Richard Davey
Hello Merlin,

Monday, June 6, 2005, 2:51:39 PM, you wrote:

M while ($row = mysql_fetch_object($result)){
M $cat[$row-main_id][name]   = $row-main_name;
M $cat[$row-main_id][$row-sub_id][name] =
M $row-sub_name;   
M }

Quote array keys.. ALWAYS quote them:

$cat[$blah]['name'] = $whatever

Otherwise PHP will think [name] is trying to use a constant and
substitute a value accordingly.

M foreach ($cat AS $maincat){
M echo $maincat[name].':';
M foreach($maincat AS $subcat){
M echo $subcat[name].$br;
M }
M echo $br;
M }

M As you can see I get the extra letters N and E. Is this an php
M error or did I do something wrong?

You did something wrong ;) If you don't quote the array keys it'll
assume a constant, which in turn would assume a 1 which will give you
the first character of the string.

Best regards,

Richard Davey
-- 
 http://www.launchcode.co.uk - PHP Development Services
 I do not fear computers. I fear the lack of them. - Isaac Asimov

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



Re: [PHP] PHP bug within multi. dimensional arrays?

2005-06-06 Thread Merlin

Richard Davey wrote:

Hello Merlin,

Monday, June 6, 2005, 2:51:39 PM, you wrote:

M while ($row = mysql_fetch_object($result)){
M $cat[$row-main_id][name]   = $row-main_name;
M $cat[$row-main_id][$row-sub_id][name] =
M $row-sub_name;   
M }


Quote array keys.. ALWAYS quote them:

$cat[$blah]['name'] = $whatever

Otherwise PHP will think [name] is trying to use a constant and
substitute a value accordingly.

M foreach ($cat AS $maincat){
M echo $maincat[name].':';
M foreach($maincat AS $subcat){
M echo $subcat[name].$br;
M }
M echo $br;
M }

M As you can see I get the extra letters N and E. Is this an php
M error or did I do something wrong?

You did something wrong ;) If you don't quote the array keys it'll
assume a constant, which in turn would assume a 1 which will give you
the first character of the string.

Best regards,

Richard Davey


Hi Richard,

that sounds absolutly plausible and I now qoted it the way you recommended. 
However I do get the same result. Still the first letter.


Any other ideas?

Thank you in advance,
Merlin

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



Re: [PHP] linux php editor

2005-06-06 Thread Greg Donald
On 6/6/05, Clive Zagno [EMAIL PROTECTED] wrote:
 what php GUI editors do you recommend.
 any other recommendations, thanks

vim


-- 
Greg Donald
Zend Certified Engineer
http://destiney.com/

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



Re: [PHP] linux php editor

2005-06-06 Thread John Nichel

Greg Donald wrote:

On 6/6/05, Clive Zagno [EMAIL PROTECTED] wrote:


what php GUI editors do you recommend.
any other recommendations, thanks



vim


You newbies and your fancy editors.  Back in my day, you got vi, and you 
were happy with it.  ;)


--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]

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



Re: [PHP] Regex help

2005-06-06 Thread Philip Hallstrom

I am currently creating a once off text parser for a rather large
document that i need to strip out bits of information on certain
lines.

The line looks something like :


Adress line here, postcode, country Tel: +27 112233665 Fax: 221145221
Website: http://www.urlhere.com E-Mail: [EMAIL PROTECTED] TAGINCAPS: CAPS
RESPONSE Tag2: blah

I need to retreive the text after each marker i.e Tel: Fax: E-Email:
TAGINCAPS: ...

I have the following regex /Tel:\s*(.[^A-z:]+)/ and
/Fax:\s*(.[^A-z:]+)/ all these work as expected and stop just before
the next Tag. However I run into hassels  around the TAGINCAPS as the
response after it is all in caps and i cant get the Regex to stop just
before the next tag: which may be either all caps or lowercase.

I cant seem to find the regex that will retreive all chartures just
before a word with a :  regalrdless of case.

I have played around with the regex coach but still seem to be comming
up short so i thought i would see if anybody can see anything i might
have missed.


Any reason you can't match everything from TAGINCAPS through the end of 
the line, then once you have that stored in a string, split it on :'s to 
extract the pieces you want?  Even elements would be the tag, odd would be 
the value...


just a thought.

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



[PHP] headers and session

2005-06-06 Thread Alessandro Rosa
Hi to all,

I got a problem while storing session variables.

?php
session_start();
header( Cache-control: private );

require_once(config.inc.php);


$_SESSION['session_psw'] = $_POST['txtPassword'];
$_SESSION['session_user'] = $_POST['txtIdUtente'];



$PHPcmd = $GLOBALS['gestionale_path_name'].test/2.php ;

header( Location: .$PHPcmd );

?

After the call to header(...), the values of session variables are lost.

I think I should fix this up with some settings in my php.ini

Could you help me, please?

Alessandro Rosa

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



Re: [PHP] linux php editor

2005-06-06 Thread Greg Donald
On 6/6/05, John Nichel [EMAIL PROTECTED] wrote:
 You newbies and your fancy editors.  Back in my day, you got vi, and you
 were happy with it.  ;)

# dd if=/dev/tty of=/dev/hda1


-- 
Greg Donald
Zend Certified Engineer
http://destiney.com/

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



Re: [PHP] Displaying an Outlook Calendar on a webpage using PHP

2005-06-06 Thread tg-php
That looks like some of my code.. or a derivative of my code.   For some 
reason, my PC at work here is having issues with PHP instantiating with COM so 
I can't test this, but the code you posted is conspicuously missing all the 
braces { }.  I'm guessing that's not your issue though... or else you'd be 
getting some kind of error maybe.

Anyway, here's a re-braced version of the code.   It should produce something 
when run through a web browser, but you might View Source and see what shows up 
there.

This does require Outlook to be installed on the PC that PHP is running on, as 
that's how COM works.   I never messed around with remote COM calls, but I'm 
sure there's some way to do that.

If someone wants to try this code and see if there are other issues besides the 
missing braces.  I don't see anything obviously wrong with it (besides maybe 
some sloppy programming on my part :).  I'll see about checking it when I get 
home tonight if I have time.

?php
$comobjOutlook = new COM(outlook.application) or die(Outlook not loaded);

//$comobjOutlook - Activate;

# This is your mailbox name just like it appears in your Folders view.
# It might be 'Inbox' or something else.
$targetmailboxname = Mailbox - Baiocchi, Justin (CSIRO IT, Armidale);


# This is the folder you're looking for. In this case, I'm looking for calendar
# items, but you can look for any folder. You need to add another loop to look
# for subfolders. Although there's probably a better way, that's how I did it 
when 
# I needed to get to Personal Folders/Inbox/Subfoldername
$targetfoldername = Calendar;

$objNamespace = $comobjOutlook-GetNameSpace(MAPI);
$objFolders = $objNamespace-Folders();
$mailboxcount = $objFolders - Count();


$foundmailbox = FALSE;
for ($i=1; $i=$mailboxcount; $i++) {
  $folderitem = $objFolders -Item($i);
  if ($folderitem - Name == $targetmailboxname) {
$objMailbox = $folderitem;
$foundmailbox = TRUE;

$foundcal = FALSE;
if ($foundmailbox) {
  $objFolders = $objMailbox-Folders();
  $foldercount = $objFolders - Count();

  for ($i=1; $i=$foldercount; $i++) {
$folderitem = $objFolders - Item($i);
if ($folderitem - Name == $targetfoldername) {
  $objCalendar = $folderitem;
  $foundcal = TRUE;
}
  }
}


if ($foundcal) {
  $objItems = $objCalendar-Items();
  $itemcount = $objItems-Count();

  for ($i=1; $i=$itemcount; $i++) {
$apptitem = $objItems - Item($i);
$apptstart = $apptitem - Start();
$apptend = $apptitem - End();
$apptallday = $apptitem - AllDayEvent();
$apptrecur = $apptitem - IsRecurring();
$apptsubject = $apptitem - Subject();
$apptlocation = $apptitem - Location();

$secondsadj = $apptstart - 14400;
$startadj = date(m/d/Y H:i:s, mktime(0,0,$secondsadj,1,1,1970));

$secondsadj = $apptend - 14400;
$endadj = date(m/d/Y H:i:s, mktime(0,0,$secondsadj,1,1,1970));

if($apptallday)  $allday = All Day;  else  $allday = ;
if($apptrecur)  $recurring = Recurring;  else  $recurring = ;

echo $apptsubject @ $apptlocation\r\nFrom: $startadj To: $endadj\r\n;

if ($allday   OR $recurring  ) echo $allday $recurring\r\n;
echo \r\n\r\n;
  }
} else {
  die (Did not find calendar folder);
}
  } else {
die(Did not find target mailbox: $targetmailboxname);
  }
}
?



= = = Original message = = =

Hello all,
 
I am trying to publish an Outlook Calendar on a web page using PHP and
COM. I have managed to track down on the net some examples of how it
could be done. The most promising is the code below. However, all that
happens is that outlook.exe is started on the server, but nothing is
displayed on the web page and it just times-out.
 
I am running PHP 4.0.18 on Windows 2003 server and I have Outlook 2002
installed on the server.
Does anybody know why it doesn't work?
 
Thanks 
Justin


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

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



[PHP] Re: PHP bug within multi. dimensional arrays?

2005-06-06 Thread Merlin

Matthew Weier O'Phinney wrote:

* Merlin [EMAIL PROTECTED]:


Hi there,

I am outputting an multidim. array. That works fine, except one thing. The first 
letter of the value inside dimension 1 always gets printed.


For example:

I fill the arrays:
while ($row = mysql_fetch_object($result)){ 
$cat[$row-main_id][name]= $row-main_name;   
$cat[$row-main_id][$row-sub_id][name] = $row-sub_name;   
   
}



First off, if you're creating associative arrays, you should quote the
keys:

$cat[$row-main_id]['name'] = $row-main_name;

If you don't do so, PHP assumes you're using a constant value for the
key name.



Then I output them:
foreach ($cat AS $maincat){
echo $maincat[name].':';



Quote your keys!



foreach($maincat AS $subcat){



You do realize that the above will also loop over the index 'name',
right?...



echo $subcat[name].$br;



and since it does, the first element in that array is 'name', which
isn't an array, but a string. Since the 'name' constant isn't defined,
it will interpret that as 'true', or 1, and so it takes the first
character of that string.



}
echo $br;
}

Which does result in:

Europe:E
Germany
UK

North America:N
US
CA

As you can see I get the extra letters N and E. Is this an php error or did I do 
something wrong?



So, what you should probably do is create an additional layer in your
multi-dimensional array for the subcategories, and have it of the form
sub_id = sub_name:

$cat[$row-main_id]['subs'][$row-sub_id] = $row-sub_name;

Then loop over that:

foreach ($cat as $main_cat) {
echo $maincat['name'] . :\n;
foreach ($maincat['subs'] as $sub_id = $sub_name) {
echo $sub_name$br; // could also use $sub_id here if
 // desired
}
}



This is very helpful and does work. However I did not understand it completley. 
What if I want to add another value, for example name2 or name3.

It looks like this example is limited to id and name.
Could I just add:
$cat[$row-main_id]['subs'][$row-sub_id] = $row-name2;   

Guess not. Can you tell me how to add other fields to the array?

Thank you in advance, Merlin

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



Re: [PHP] linux php editor

2005-06-06 Thread John Nichel

Greg Donald wrote:

On 6/6/05, John Nichel [EMAIL PROTECTED] wrote:


You newbies and your fancy editors.  Back in my day, you got vi, and you
were happy with it.  ;)



# dd if=/dev/tty of=/dev/hda1


Now we just need the punch card people to speak up.

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]

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



Re: [PHP] linux php editor

2005-06-06 Thread Rory Browne
Cut the red, connect the blue, and green..

In seriousness though I like vim, and Kate.

On 6/6/05, John Nichel [EMAIL PROTECTED] wrote:
 Greg Donald wrote:
  On 6/6/05, John Nichel [EMAIL PROTECTED] wrote:
 
 You newbies and your fancy editors.  Back in my day, you got vi, and you
 were happy with it.  ;)
 
 
  # dd if=/dev/tty of=/dev/hda1
 
 Now we just need the punch card people to speak up.
 
 --
 John C. Nichel
 ÜberGeek
 KegWorks.com
 716.856.9675
 [EMAIL PROTECTED]
 
 --
 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: headers and session

2005-06-06 Thread Matthew Weier O'Phinney
* Alessandro Rosa [EMAIL PROTECTED]:
 Hi to all,

 I got a problem while storing session variables.

 ?php
 session_start();
 header( Cache-control: private );

 require_once(config.inc.php);

 
 $_SESSION['session_psw'] = $_POST['txtPassword'];
 $_SESSION['session_user'] = $_POST['txtIdUtente'];

 

 $PHPcmd = $GLOBALS['gestionale_path_name'].test/2.php ;

 header( Location: .$PHPcmd );

 ?

 After the call to header(...), the values of session variables are lost.

Does config.inc.php have any whitespace following the closing ? tag, or
does it output any HTML? That could be your culprit.

What happens if you do your $_SESSION setting *before* the require, but
directly after the initial header() call?

-- 
Matthew Weier O'Phinney   | WEBSITES:
Webmaster and IT Specialist   | http://www.garden.org
National Gardening Association| http://www.kidsgardening.com
802-863-5251 x156 | http://nationalgardenmonth.org
mailto:[EMAIL PROTECTED] | http://vermontbotanical.org

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



[PHP] Re: headers and session

2005-06-06 Thread JB05UK

You have two calls to header?


The first should be changed to:-

session_cache_limiter('private');

http://php.net/manual/en/function.session-cache-limiter.php




Alessandro Rosa wrote:

Hi to all,

I got a problem while storing session variables.

?php
session_start();
header( Cache-control: private );

require_once(config.inc.php);


$_SESSION['session_psw'] = $_POST['txtPassword'];
$_SESSION['session_user'] = $_POST['txtIdUtente'];



$PHPcmd = $GLOBALS['gestionale_path_name'].test/2.php ;

header( Location: .$PHPcmd );

?

After the call to header(...), the values of session variables are lost.

I think I should fix this up with some settings in my php.ini

Could you help me, please?

Alessandro Rosa


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



[PHP] headers and session

2005-06-06 Thread Alessandro Rosa
 Does config.inc.php have any whitespace following the closing ? tag, or
 does it output any HTML? That could be your culprit.

 What happens if you do your $_SESSION setting *before* the require, but
 directly after the initial header() call?

He knew that header may give problems with whitespaces, but this was not the
case.

With regard to your secondo question, it works !
that is, the code now looks like:

?php
session_start();


$_SESSION['session_psw'] = $_POST['txtPassword'];
$_SESSION['session_user'] = $_POST['txtIdUtente'];


header( Cache-control: private );

require_once(config.inc.php);
$PHPcmd = $GLOBALS['gestionale_path_name'].test/2.php ;

header( Location: .$PHPcmd );

?


But could someone explain me why ?

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



Re: [PHP] linux php editor

2005-06-06 Thread Clive Zagno
the truth is Ive been developing on windows, because of some .net 
developments.


Ive been starting most new projects as web applications and using 
php/mysql. On windows I used ultredit, then I found a product called 
phpedit, which I liked, now Im trying to move to linux.


what I really want is a app that can do that predictive text thing, you 
know when it start showing me the possible php syntax as Im typing it 
in. Two reasons for this is it help with debugging as I get the syntax 
correct the first time and secondly I think its cool.



clive

Rory Browne wrote:

Cut the red, connect the blue, and green..

In seriousness though I like vim, and Kate.

On 6/6/05, John Nichel [EMAIL PROTECTED] wrote:


Greg Donald wrote:


On 6/6/05, John Nichel [EMAIL PROTECTED] wrote:



You newbies and your fancy editors.  Back in my day, you got vi, and you
were happy with it.  ;)



# dd if=/dev/tty of=/dev/hda1


Now we just need the punch card people to speak up.

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]

--
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] linux php editor

2005-06-06 Thread John Nichel

Clive Zagno wrote:
the truth is Ive been developing on windows, because of some .net 
developments.


Ive been starting most new projects as web applications and using 
php/mysql. On windows I used ultredit, then I found a product called 
phpedit, which I liked, now Im trying to move to linux.


what I really want is a app that can do that predictive text thing, you 
know when it start showing me the possible php syntax as Im typing it 
in. Two reasons for this is it help with debugging as I get the syntax 
correct the first time and secondly I think its cool.


http://www.zend.com/store/products/zend-studio/index.php

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]

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



Re: [PHP] PHP and Zend

2005-06-06 Thread JB05UK

Ok thanks



Richard Lynch wrote:

On Sun, June 5, 2005 12:08 am, JamesBenson said:


This program makes use of the Zend Scripting Language Engine:
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies with Zend
Extension Manager v1.0.7, Copyright (c) 2003-2005, by Zend Technologies
with Zend Optimizer v2.5.10, Copyright (c) 1998-2005, by Zend Technologies

Ive had it installed before on another copy but never seen this before,
normally has an image plus just one version listed,



I think you've just done it right.

Note that the version numbers are for distinctly different Zend products:

Engine
Extension Manager
Optimizer

Zend is kind enough to inform you of all of these, which is a Good Thing.

Unless there is something inherently wrong with the versions mis-matching
I'm not aware of, you have nothing to fix. :-)

I could be sarky and suggest you un-install the ones you don't want :-)



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



[PHP] headers and session (2)

2005-06-06 Thread Alessandro Rosa
I want to thank you all for previous helpings.

Really the first code was easy to be solved, but
this is how it shall work out. This is a program running
locally and the trouble is that session vars are stored
in local files. I must avoid to store a plain text password
therein, thus I need to crypt and save it into session.

When 2.php file just displays session data (it is test environemnt),
but the output is blank !

Suggest a different approach ?

Alessandro Rosa
 

?php
session_start();


require_once('crypting.php');
require_once(dirname(__FILE__).'/../mysql_wrap/mysql_man.php');

$handle_db = connect_to_mysql_server();
$psw = $_POST['txtPassword'];
$psw = encrypt( $psw, get_crypt_key() );
sql_disconnect( $handle_db );

$_SESSION['session_user'] = $_POST['txtIdUtente'];
$_SESSION['session_password'] = $psw;


session_cache_limiter('private');

require_once(config.inc.php);
$PHPcmd = $GLOBALS['gestionale_path_name'].phpcode/login/2.php ;

header( Location: .$PHPcmd );

?

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



[PHP] Re: linux php editor

2005-06-06 Thread Manuel Lemos

Hello,

on 06/06/2005 04:41 PM Clive Zagno said the following:
what php GUI editors do you recommend. Ive used bluefish before, any 
other recommendations, thanks


Personally I just use Kate that comes with KDE, but it is just an editor 
with PHP syntax highlighting support.


Now, if you are looking for something more integrated with the PHP 
development with debugging support and other features, Zend Studio 4 may 
be a good investment. Here is an in depth review:


http://www.phpclasses.org/reviews/id/B0009JKH8M.html#review62

--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html

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



[PHP] Re: headers and session (2)

2005-06-06 Thread JB05UK
Ahhh, for storing session passwords...if you really need to store a 
password in the session then try using md5, like so...


$psw = md5($_POST['txtPassword']);


Then to verify a users password just do the same and compare to the 
stored md5 value in your database.


But, its a very bad idea storing passwords in your sessions full stop if 
using a shared server.




James





Alessandro Rosa wrote:

I want to thank you all for previous helpings.

Really the first code was easy to be solved, but
this is how it shall work out. This is a program running
locally and the trouble is that session vars are stored
in local files. I must avoid to store a plain text password
therein, thus I need to crypt and save it into session.

When 2.php file just displays session data (it is test environemnt),
but the output is blank !

Suggest a different approach ?

Alessandro Rosa
 


?php
session_start();


require_once('crypting.php');
require_once(dirname(__FILE__).'/../mysql_wrap/mysql_man.php');

$handle_db = connect_to_mysql_server();
$psw = $_POST['txtPassword'];
$psw = encrypt( $psw, get_crypt_key() );
sql_disconnect( $handle_db );

$_SESSION['session_user'] = $_POST['txtIdUtente'];
$_SESSION['session_password'] = $psw;


session_cache_limiter('private');

require_once(config.inc.php);
$PHPcmd = $GLOBALS['gestionale_path_name'].phpcode/login/2.php ;

header( Location: .$PHPcmd );

?


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



[PHP] protect file access outside webroot

2005-06-06 Thread Bosky, Dave
If I want to protect document from being directly accessed from the web
and only allow them to be served by a file, what's the best location to
upload them?

Currently I upload them the htsdata directory, is this the best
location? 

 

Thanks.

Dave



HTC Disclaimer:  The information contained in this message may be privileged 
and confidential and protected from disclosure. If the reader of this message 
is not the intended recipient, or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.  If you have received this communication in error, please notify us 
immediately by replying to the message and deleting it from your computer.  
Thank you.


Re: [PHP] linux php editor

2005-06-06 Thread JB05UK


Clive Zagno wrote:
 what I really want is a app that can do that predictive text thing, you
 know when it start showing me the possible php syntax as Im typing it
 in. Two reasons for this is it help with debugging as I get the syntax
 correct the first time and secondly I think its cool.




Bluefish does that for HTML so it could be extended to PHP, I use it on 
Fedora and like it so far, color highlighting etc







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



[PHP] Re: protect file access outside webroot

2005-06-06 Thread JB05UK


Bosky, Dave wrote:


Currently I upload them the htsdata directory, is this the best
location? 




Any location outside your webroot is fine.

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



[PHP] This is happening why?

2005-06-06 Thread Chris Boget
Run this code:

?
if( 0 == 'NULL' ) {
  echo 'NULL' == 0br;
} else {
  echo 'NULL' != 0br;
}
?

Is this just a case of PHP converting variable types for comparison?

thnx,
Chris

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



Re: [PHP] Displaying an Outlook Calendar on a webpage using PHP

2005-06-06 Thread M Saleh EG
But why would you do that when you can share the Calendar over outlook?

On 6/6/05, [EMAIL PROTECTED] [EMAIL PROTECTED] 
wrote: 
 
 That looks like some of my code.. or a derivative of my code. For some 
 reason, my PC at work here is having issues with PHP instantiating with COM 
 so I can't test this, but the code you posted is conspicuously missing all 
 the braces { }. I'm guessing that's not your issue though... or else you'd 
 be getting some kind of error maybe.
 
 Anyway, here's a re-braced version of the code. It should produce 
 something when run through a web browser, but you might View Source and see 
 what shows up there.
 
 This does require Outlook to be installed on the PC that PHP is running 
 on, as that's how COM works. I never messed around with remote COM calls, 
 but I'm sure there's some way to do that.
 
 If someone wants to try this code and see if there are other issues 
 besides the missing braces. I don't see anything obviously wrong with it 
 (besides maybe some sloppy programming on my part :). I'll see about 
 checking it when I get home tonight if I have time.
 
 ?php
 $comobjOutlook = new COM(outlook.application) or die(Outlook not 
 loaded);
 
 //$comobjOutlook - Activate;
 
 # This is your mailbox name just like it appears in your Folders view.
 # It might be 'Inbox' or something else.
 $targetmailboxname = Mailbox - Baiocchi, Justin (CSIRO IT, Armidale);
 
 
 # This is the folder you're looking for. In this case, I'm looking for 
 calendar
 # items, but you can look for any folder. You need to add another loop to 
 look
 # for subfolders. Although there's probably a better way, that's how I did 
 it when
 # I needed to get to Personal Folders/Inbox/Subfoldername
 $targetfoldername = Calendar;
 
 $objNamespace = $comobjOutlook-GetNameSpace(MAPI);
 $objFolders = $objNamespace-Folders();
 $mailboxcount = $objFolders - Count();
 
 
 $foundmailbox = FALSE;
 for ($i=1; $i=$mailboxcount; $i++) {
 $folderitem = $objFolders -Item($i);
 if ($folderitem - Name == $targetmailboxname) {
 $objMailbox = $folderitem;
 $foundmailbox = TRUE;
 
 $foundcal = FALSE;
 if ($foundmailbox) {
 $objFolders = $objMailbox-Folders();
 $foldercount = $objFolders - Count();
 
 for ($i=1; $i=$foldercount; $i++) {
 $folderitem = $objFolders - Item($i);
 if ($folderitem - Name == $targetfoldername) {
 $objCalendar = $folderitem;
 $foundcal = TRUE;
 }
 }
 }
 
 
 if ($foundcal) {
 $objItems = $objCalendar-Items();
 $itemcount = $objItems-Count();
 
 for ($i=1; $i=$itemcount; $i++) {
 $apptitem = $objItems - Item($i);
 $apptstart = $apptitem - Start();
 $apptend = $apptitem - End();
 $apptallday = $apptitem - AllDayEvent();
 $apptrecur = $apptitem - IsRecurring();
 $apptsubject = $apptitem - Subject();
 $apptlocation = $apptitem - Location();
 
 $secondsadj = $apptstart - 14400;
 $startadj = date(m/d/Y H:i:s, mktime(0,0,$secondsadj,1,1,1970));
 
 $secondsadj = $apptend - 14400;
 $endadj = date(m/d/Y H:i:s, mktime(0,0,$secondsadj,1,1,1970));
 
 if($apptallday) $allday = All Day; else $allday = ;
 if($apptrecur) $recurring = Recurring; else $recurring = ;
 
 echo $apptsubject @ $apptlocation\r\nFrom: $startadj To: $endadj\r\n;
 
 if ($allday   OR $recurring  ) echo $allday $recurring\r\n;
 echo \r\n\r\n;
 }
 } else {
 die (Did not find calendar folder);
 }
 } else {
 die(Did not find target mailbox: $targetmailboxname);
 }
 }
 ?
 
 
 
 = = = Original message = = =
 
 Hello all,
 
 I am trying to publish an Outlook Calendar on a web page using PHP and
 COM. I have managed to track down on the net some examples of how it
 could be done. The most promising is the code below. However, all that
 happens is that outlook.exe is started on the server, but nothing is
 displayed on the web page and it just times-out.
 
 I am running PHP 4.0.18 on Windows 2003 server and I have Outlook 2002
 installed on the server.
 Does anybody know why it doesn't work?
 
 Thanks
 Justin
 
 
 ___
 Sent by ePrompter, the premier email notification software.
 Free download at http://www.ePrompter.com.
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 


-- 
M.Saleh.E.G
97150-4779817


Re: [PHP] Displaying an Outlook Calendar on a webpage using PHP

2005-06-06 Thread tg-php
Reasons:

1. Because you can.

2. Because I believe you need Exchange Server and IIS running to share outlook 
calendars out via the web(?)

3. Because the project has a requirement to do it this way

4. Because he likes a challenge



The question Is this the best way to accomplish your goal is a good one 
because if there's a smarter/better way, I'm sure even inflexible bosses can be 
made to bend a bit, but asking Why? always feels like someone's asking Are 
you a moron?  hah..  

-TG



= = = Original message = = =

But why would you do that when you can share the Calendar over outlook?

On 6/6/05, [EMAIL PROTECTED] [EMAIL PROTECTED] 
wrote: 
 
 That looks like some of my code.. or a derivative of my code. For some 
 reason, my PC at work here is having issues with PHP instantiating with COM 
 so I can't test this, but the code you posted is conspicuously missing all 
 the braces  . I'm guessing that's not your issue though... or else you'd 
 be getting some kind of error maybe.
 
 Anyway, here's a re-braced version of the code. It should produce 
 something when run through a web browser, but you might View Source and see 
 what shows up there.
 
 This does require Outlook to be installed on the PC that PHP is running 
 on, as that's how COM works. I never messed around with remote COM calls, 
 but I'm sure there's some way to do that.
 
 If someone wants to try this code and see if there are other issues 
 besides the missing braces. I don't see anything obviously wrong with it 
 (besides maybe some sloppy programming on my part :). I'll see about 
 checking it when I get home tonight if I have time.
 
 ?php
 $comobjOutlook = new COM(outlook.application) or die(Outlook not 
 loaded);
 
 //$comobjOutlook - Activate;
 
 # This is your mailbox name just like it appears in your Folders view.
 # It might be 'Inbox' or something else.
 $targetmailboxname = Mailbox - Baiocchi, Justin (CSIRO IT, Armidale);
 
 
 # This is the folder you're looking for. In this case, I'm looking for 
 calendar
 # items, but you can look for any folder. You need to add another loop to 
 look
 # for subfolders. Although there's probably a better way, that's how I did 
 it when
 # I needed to get to Personal Folders/Inbox/Subfoldername
 $targetfoldername = Calendar;
 
 $objNamespace = $comobjOutlook-GetNameSpace(MAPI);
 $objFolders = $objNamespace-Folders();
 $mailboxcount = $objFolders - Count();
 
 
 $foundmailbox = FALSE;
 for ($i=1; $i=$mailboxcount; $i++) 
 $folderitem = $objFolders -Item($i);
 if ($folderitem - Name == $targetmailboxname) 
 $objMailbox = $folderitem;
 $foundmailbox = TRUE;
 
 $foundcal = FALSE;
 if ($foundmailbox) 
 $objFolders = $objMailbox-Folders();
 $foldercount = $objFolders - Count();
 
 for ($i=1; $i=$foldercount; $i++) 
 $folderitem = $objFolders - Item($i);
 if ($folderitem - Name == $targetfoldername) 
 $objCalendar = $folderitem;
 $foundcal = TRUE;
 
 
 
 
 
 if ($foundcal) 
 $objItems = $objCalendar-Items();
 $itemcount = $objItems-Count();
 
 for ($i=1; $i=$itemcount; $i++) 
 $apptitem = $objItems - Item($i);
 $apptstart = $apptitem - Start();
 $apptend = $apptitem - End();
 $apptallday = $apptitem - AllDayEvent();
 $apptrecur = $apptitem - IsRecurring();
 $apptsubject = $apptitem - Subject();
 $apptlocation = $apptitem - Location();
 
 $secondsadj = $apptstart - 14400;
 $startadj = date(m/d/Y H:i:s, mktime(0,0,$secondsadj,1,1,1970));
 
 $secondsadj = $apptend - 14400;
 $endadj = date(m/d/Y H:i:s, mktime(0,0,$secondsadj,1,1,1970));
 
 if($apptallday) $allday = All Day; else $allday = ;
 if($apptrecur) $recurring = Recurring; else $recurring = ;
 
 echo $apptsubject @ $apptlocation\r\nFrom: $startadj To: $endadj\r\n;
 
 if ($allday   OR $recurring  ) echo $allday $recurring\r\n;
 echo \r\n\r\n;
 
  else 
 die (Did not find calendar folder);
 
  else 
 die(Did not find target mailbox: $targetmailboxname);
 
 
 ?
 
 
 
 = = = Original message = = =
 
 Hello all,
 
 I am trying to publish an Outlook Calendar on a web page using PHP and
 COM. I have managed to track down on the net some examples of how it
 could be done. The most promising is the code below. However, all that
 happens is that outlook.exe is started on the server, but nothing is
 displayed on the web page and it just times-out.
 
 I am running PHP 4.0.18 on Windows 2003 server and I have Outlook 2002
 installed on the server.
 Does anybody know why it doesn't work?
 
 Thanks
 Justin


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

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



Re: [PHP] This is happening why?

2005-06-06 Thread tg-php
Yeah.. you're comparing a string, 'NULL' with an integer 0.  You're not 
comparing NULL with anything, you're comparing a string that contains the word 
'NULL'.

You can use === to do an exact comparison without conversion.

echo intval('NULL');

intval('NULL') === 0



= = = Original message = = =

Run this code:

?
if( 0 == 'NULL' ) 
  echo 'NULL' == 0br;
 else 
  echo 'NULL' != 0br;

?

Is this just a case of PHP converting variable types for comparison?

thnx,
Chris

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


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

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



Re: [PHP] Implode? Explode?

2005-06-06 Thread Jack Jackson



Brent Baisley wrote:
You're close, but you need to group your data on the series_id first. 
You can do that by looping through your array and creating another array 
using series_id as the array key. You'll end up with a list of arrays 
named after the series_id.


foreach( $result_set as $result_item ) {
//Add an array item to the series_id slot of the grouped_result array
$grouped_result[ $result_item['series_id'] ][]= 
array('id'=$result_items['art_id'], 'title'=$result_item['art_title']);

}


That did the trick, Brent. Thanks so much for this useful information.

Now you have your data grouped by series_id. Each item of the 
grouped_result array will contain one or more arrays which contain the 
art_id and art_title.


If you are not familiar with multidimensional arrays, this may be a 
little confusing.


A little is right! But tanks for the intro to multi-dimensional arrays!

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



RE: [PHP] This is happening why?

2005-06-06 Thread Jay Blanchard
[snip]
?
if( 0 == 'NULL' ) {
  echo 'NULL' == 0br;
} else {
  echo 'NULL' != 0br;
}
?
[/snip]

Interesting, to be sure. I even flipped the test
if('NULL' == 0)

Of course, once I made 0 a string '0' the test evaluated FALSE. So 0
(integer) is TRUE and 'NULL' is TRUE, which means that you asked if(TRUE
== TRUE), which is, of course, TRUE.

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



Re: [PHP] linux php editor

2005-06-06 Thread Marek Kilimajer

Clive Zagno wrote:
the truth is Ive been developing on windows, because of some .net 
developments.


Ive been starting most new projects as web applications and using 
php/mysql. On windows I used ultredit, then I found a product called 
phpedit, which I liked, now Im trying to move to linux.


what I really want is a app that can do that predictive text thing, you 
know when it start showing me the possible php syntax as Im typing it 
in. Two reasons for this is it help with debugging as I get the syntax 
correct the first time and secondly I think its cool.


In ~/.vimrc:

 autocompletion for php functions
set dictionary-=/path/to/funclist.txt dictionary+=/path/to/funclist.txt
set complete-=k complete+=k

 check syntax of current php file
map C-B :w !php -l %CR

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



Re: [PHP] linux php editor

2005-06-06 Thread Danny Brow
On Mon, 2005-06-06 at 18:09 -0800, Clive Zagno wrote:
 the truth is Ive been developing on windows, because of some .net 
 developments.
 
 Ive been starting most new projects as web applications and using 
 php/mysql. On windows I used ultredit, then I found a product called 
 phpedit, which I liked, now Im trying to move to linux.
 
 what I really want is a app that can do that predictive text thing, you 
 know when it start showing me the possible php syntax as Im typing it 
 in. Two reasons for this is it help with debugging as I get the syntax 
 correct the first time and secondly I think its cool.
 

Komodo

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



[PHP] headers and session (question)

2005-06-06 Thread Alessandro Rosa
Here's below the solution (the encryption will be shortly performed
into login.php).

1 ?php
2 session_start();

3 $_SESSION['session_user'] = $_POST['txtIdUtente'];
4 $_SESSION['session_password'] = $_POST['txtPassword'];

5 $PHPcmd = login.php ;

6 header( Location: .$PHPcmd );
7 ?


But a QUESTION now :

if line 5 is replaced by these two lines, say here 5a and 5b:

5a require_once(config.inc.php);
5b $PHPcmd = $GLOBALS['gestionale_path_name'].phpcode/login/login.php ;

this does not work (meaning user and psw are not passed to login.php);
but again the below code works again:

5a require_once(config.inc.php);
5b $PHPcmd = $gestionale_path_name.phpcode/login/login.php ;


Thanks,

Alessandro
 

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



[PHP] Re: headers and session (question)

2005-06-06 Thread JamesBenson
I use sessions, I also dont store the users password into the session, 
if you use flat file sessions on a shared server then storing the 
password should be avoided,


What I do is take a username and password, verify their details against 
database, if their details match one in database I simply add their 
username to the session, to check if someone is logged in I just check 
whether their username exists in the session, if it does I deliver my 
protected content but if not I display a login box.








Alessandro Rosa wrote:

Here's below the solution (the encryption will be shortly performed
into login.php).

1 ?php
2 session_start();

3 $_SESSION['session_user'] = $_POST['txtIdUtente'];
4 $_SESSION['session_password'] = $_POST['txtPassword'];

5 $PHPcmd = login.php ;

6 header( Location: .$PHPcmd );
7 ?


But a QUESTION now :

if line 5 is replaced by these two lines, say here 5a and 5b:

5a require_once(config.inc.php);
5b $PHPcmd = $GLOBALS['gestionale_path_name'].phpcode/login/login.php ;

this does not work (meaning user and psw are not passed to login.php);
but again the below code works again:

5a require_once(config.inc.php);
5b $PHPcmd = $gestionale_path_name.phpcode/login/login.php ;


Thanks,

Alessandro
 


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



Re: [PHP] linux php editor... Quanta +... The best!

2005-06-06 Thread Andy Pieters
On Monday 06 June 2005 21:41, Clive Zagno wrote:
 what php GUI editors do you recommend. Ive used bluefish before, any
 other recommendations, thanks

Hi 

I have been using Quanta + ever since I discovered it.  Try it you'll like it 
too.  

Features include (but not limited to) code completion, code insight, color 
coding, debug support, spell checking

It also has a very good project management system which can upload your 
project with one keypress.

It is part of the kdewebdev package.

You'll find more information on this page

http://kdewebdev.org/


Hopoe this helps


Kind regards


Andy



-- 
Registered Linux User Number 379093
-- --BEGIN GEEK CODE BLOCK-
Version: 3.1
GAT/O/E$ d-(---)+ s:(+): a--(-)? C$(+++) UL$ P-(+)++
L+++$ E---(-)@ W++$ !N@ o? !K? W--(---) !O !M- V-- PS++(+++)
PE--(-) Y+ PGP++(+++) t+(++) 5-- X++ R*(+)@ !tv b-() DI(+) D+(+++) G(+)
e$@ h++(*) r--++ y--()
-- ---END GEEK CODE BLOCK--
--
Check out these few php utilities that I released
 under the GPL2 and that are meant for use with a 
 php cli binary:
 
 http://www.vlaamse-kern.com/sas/
--

--

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



Re: [PHP] linux php editor... Quanta +... The best!

2005-06-06 Thread Rory Browne
Is there a particular reason why you changed the subject? It screws up
threads on some clients - including mine.

On 6/6/05, Andy Pieters [EMAIL PROTECTED] wrote:
 On Monday 06 June 2005 21:41, Clive Zagno wrote:
  what php GUI editors do you recommend. Ive used bluefish before, any
  other recommendations, thanks
 
 Hi
 
 I have been using Quanta + ever since I discovered it.  Try it you'll like it
 too.
 
 Features include (but not limited to) code completion, code insight, color
 coding, debug support, spell checking
 
 It also has a very good project management system which can upload your
 project with one keypress.
 
 It is part of the kdewebdev package.
 
 You'll find more information on this page
 
 http://kdewebdev.org/
 
 
 Hopoe this helps
 
 
 Kind regards
 
 
 Andy
 
 
 
 --
 Registered Linux User Number 379093
 -- --BEGIN GEEK CODE BLOCK-
 Version: 3.1
 GAT/O/E$ d-(---)+ s:(+): a--(-)? C$(+++) UL$ P-(+)++
 L+++$ E---(-)@ W++$ !N@ o? !K? W--(---) !O !M- V-- PS++(+++)
 PE--(-) Y+ PGP++(+++) t+(++) 5-- X++ R*(+)@ !tv b-() DI(+) D+(+++) G(+)
 e$@ h++(*) r--++ y--()
 -- ---END GEEK CODE BLOCK--
 --
 Check out these few php utilities that I released
  under the GPL2 and that are meant for use with a
  php cli binary:
 
  http://www.vlaamse-kern.com/sas/
 --
 
 --
 
 --
 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: PHP bug within multi. dimensional arrays?

2005-06-06 Thread Matthew Weier O'Phinney
* Merlin [EMAIL PROTECTED] :
 Matthew Weier O'Phinney wrote:
  * Merlin [EMAIL PROTECTED] :
   I am outputting an multidim. array. That works fine, except one thing. 
   The first 
   letter of the value inside dimension 1 always gets printed.
  
   For example:
  
   I fill the arrays:
   while ($row = mysql_fetch_object($result)){   
 $cat[$row- main_id][name]  = $row- main_name; 
 $cat[$row- main_id][$row- sub_id][name] = $row- sub_name;
   
   }
  
  First off, if you're creating associative arrays, you should quote the
  keys:
  
  $cat[$row- main_id]['name'] = $row- main_name;
  
  If you don't do so, PHP assumes you're using a constant value for the
  key name.
  
   Then I output them:
   foreach ($cat AS $maincat){
 echo $maincat[name].':';
  
  Quote your keys!
  
 foreach($maincat AS $subcat){
  
  You do realize that the above will also loop over the index 'name',
  right?...
  
  
 echo $subcat[name].$br;
  
  and since it does, the first element in that array is 'name', which
  isn't an array, but a string. Since the 'name' constant isn't defined,
  it will interpret that as 'true', or 1, and so it takes the first
  character of that string.
  
  
 }
 echo $br;
   }
  
   Which does result in:
  
   Europe:E
   Germany
   UK
  
   North America:N
   US
   CA
  
   As you can see I get the extra letters N and E. Is this an php error or 
   did I do 
   something wrong?
  
  So, what you should probably do is create an additional layer in your
  multi-dimensional array for the subcategories, and have it of the form
  sub_id = sub_name:
  
  $cat[$row- main_id]['subs'][$row- sub_id] = $row- sub_name;  
  
  Then loop over that:
  
  foreach ($cat as $main_cat) {
  echo $maincat['name'] . :\n;
  foreach ($maincat['subs'] as $sub_id = $sub_name) {
  echo $sub_name$br; // could also use $sub_id here if
   // desired
  }
  }
  

 This is very helpful and does work. However I did not understand it 
 completley. 
 What if I want to add another value, for example name2 or name3.
 It looks like this example is limited to id and name.
 Could I just add:
 $cat[$row- main_id]['subs'][$row- sub_id] = $row- name2;   

 Guess not. Can you tell me how to add other fields to the array?

You should probably do some studying up on multidimensional and/or
nested arrays so you can get a better handle on this stuff.

If you need to be able to add multiple names for a sub_id, do it as an
array:

$cat[$row-main_id]['subs'][$row-sub_id][] = $row-name1;
$cat[$row-main_id]['subs'][$row-sub_id][] = $row-name2;
$cat[$row-main_id]['subs'][$row-sub_id][] = $row-name3;

However, this will break your loop above -- you'll need another layer of
looping added in:

foreach ($cat as $main_cat) {
echo $maincat['name'] . :\n;
foreach ($maincat['subs'] as $sub_id = $names) {
foreach ($names as $name) {
echo $name$br; // could also use $sub_id here if
 // desired
}
}
}

Hope that helps.

-- 
Matthew Weier O'Phinney   | WEBSITES:
Webmaster and IT Specialist   | http://www.garden.org
National Gardening Association| http://www.kidsgardening.com
802-863-5251 x156 | http://nationalgardenmonth.org
mailto:[EMAIL PROTECTED] | http://vermontbotanical.org

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



[PHP] Re: headers and session (question)

2005-06-06 Thread Matthew Weier O'Phinney
* Alessandro Rosa [EMAIL PROTECTED]:
 Here's below the solution (the encryption will be shortly performed
 into login.php).

 1 ?php
 2 session_start();

 3 $_SESSION['session_user'] = $_POST['txtIdUtente'];
 4 $_SESSION['session_password'] = $_POST['txtPassword'];

 5 $PHPcmd = login.php ;

 6 header( Location: .$PHPcmd );
 7 ?


 But a QUESTION now :

 if line 5 is replaced by these two lines, say here 5a and 5b:

 5a require_once(config.inc.php);
 5b $PHPcmd = $GLOBALS['gestionale_path_name'].phpcode/login/login.php ;

 this does not work (meaning user and psw are not passed to login.php);
 but again the below code works again:

 5a require_once(config.inc.php);
 5b $PHPcmd = $gestionale_path_name.phpcode/login/login.php ;

Again, look at your config.inc.php and make sure it's not sending any
output. If you have even a blank line before an opening ?php tag or a
blank line following, output will have been sent, and you will not be
able to send a cookie or additional HTTP headers.

-- 
Matthew Weier O'Phinney   | WEBSITES:
Webmaster and IT Specialist   | http://www.garden.org
National Gardening Association| http://www.kidsgardening.com
802-863-5251 x156 | http://nationalgardenmonth.org
mailto:[EMAIL PROTECTED] | http://vermontbotanical.org

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



RE: [PHP] dynamic drop down

2005-06-06 Thread Chris W. Parker
Danny Brow mailto:[EMAIL PROTECTED]
on Saturday, June 04, 2005 2:45 PM said:

 So how do you refresh the page when the drop down is selected?

With javascript or force the user to click a submit button.


Chris.

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



Re: [PHP] PHP bug within multi. dimensional arrays?

2005-06-06 Thread Richard Lynch
On Mon, June 6, 2005 6:51 am, Merlin said:
 I am outputting an multidim. array. That works fine, except one thing. The
 first
 letter of the value inside dimension 1 always gets printed.

 For example:

 I fill the arrays:
 while ($row = mysql_fetch_object($result)){
   $cat[$row-main_id][name]   = $row-main_name;

For the record, name does not turn into 0, 1, nor TRUE here, but simply
becomes 'name' which is what you should have typed in the first place.

Set error_reporting(E_ALL) to get more details.

   $cat[$row-main_id][$row-sub_id][name] = $row-sub_name;
 }

 Then I output them:
 foreach ($cat AS $maincat){
   echo $maincat[name].':';

echo maincat is: '$maincat'br /\n;

   foreach($maincat AS $subcat){

echo subcat is: '$subcat'br /\n;

   echo $subcat[name].$br;
   }
   echo $br;
 }

 Which does result in:

 Europe:E

You are passing 'Europe' as $subcat, and then trying to treat it like an
array when you do $subcat['name'].

PHP will let you treat a string as an array of characters, if you insist.

At this point, PHP *does* turn 'name' into the index 0 because you can
only index strings as character arrays using integer indices.

$subcat['name'] = 'Europe'['name'] = 'Europe'[0] = 'E'

 Germany
 UK

 North America:N
 US
 CA

 As you can see I get the extra letters N and E. Is this an php error or
 did I do
 something wrong?



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

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



Re: [PHP] dynamic drop down

2005-06-06 Thread Denyl Meneses Guillén
in the drop down  look up : onChange=your java script 

- Original Message - 
From: Chris W. Parker [EMAIL PROTECTED]
To: Danny Brow [EMAIL PROTECTED]; PHP-Users
php-general@lists.php.net
Sent: Monday, June 06, 2005 2:34 PM
Subject: RE: [PHP] dynamic drop down


Danny Brow mailto:[EMAIL PROTECTED]
on Saturday, June 04, 2005 2:45 PM said:

 So how do you refresh the page when the drop down is selected?

With javascript or force the user to click a submit button.


Chris.

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


-- 
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.323 / Virus Database: 267.6.4 - Release Date: 06/06/2005

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



Re: [PHP] Implode? Explode?

2005-06-06 Thread Richard Lynch
On Mon, June 6, 2005 5:32 am, Jack Jackson said:
 I'm trying to fetch similar things - in this case, rows which share a
 series ID no - and bring them into an array and display them grouped by
   what makes them similar (in this case, series id). I looked at implode
 and explode which seem wrong for this - the only separator I can see is
 that they're each in a table cell.

$query =  select series_id, ... from ... ;
$query .=  ORDER BY series_id, ... ;
$art = mysql_query($query) or die(mysql_error());
$series = array();
while (list($series_id, ...) = mysql_fetch_row($art)){
  $series[$series_name][] = a href=$art_id$art_title/a;
}
while (list($name, $links) = each($series)){
  echo p$namebr /, implode( | , $links), /p\n;
}



 The result of my query returns something like:

 art_id   series_id art_titleseries_name
 2 1  Weddings 2004Summer Special
 4 1  Summer In The City   Summer Special
 5   2  Bags of NY   Op-Art
 7   2  Dogs of NY   Op-Art


 I'd like to create a list of links to each art_id grouped together as
 series, href code obviously not complete but demonstrative:

 pSummer Specialbr /
 a href='2'Weddings 2004/a | a href='4'Summer In The City/p

 pOp-Artbr /
 a href='5'Bags of NY/a | a href='7'Dogs of NY/p


You could actually use:

ORDER BY series_date, series_name, series_id, art_id, art_title, art_id

or something like that, so long you are sorting first and foremost by the
SERIES information, and any other sorting happens AFTER all series_*
fields.

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

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



Re: [PHP] about the absolutely path

2005-06-06 Thread Richard Lynch
On Mon, June 6, 2005 1:54 am, yangshiqi said:
 I have a php application (let's call it app A) which is developed
 separated
 in a test domain name, like http://testa.xxx.com http://testa.xxx.com/
 /.

 But now I have to move it to another app (called B) using
 http://testb.xxx.com http://testb.xxx.com/ /, and the app A becomes just
 a
 subsystem of app B.

 The access url is changed to http://testb.xxx.com/a/.

 Then I meet a problem that the app A 's links, the path and other elements
 in it are set like '/Main.php', '/art/logo.gif' by an absolutely path.

 The app A is very independent and I do not want to disperse it to app B.

 So how can I get this effect: when the user input the url, '
 http://testb.xxx.com/a/ ', the app A will work fine?

 Can I just modify some configuration about yapache to fit this
 requirement?

You could try the BASEHREF tag, but I don't think that ever got
wide-spread browser support, much less W3C status...

mod_rewrite seems like it would be good, but how would you know to use
/a/Foo.html instead of /Foo.html?  I guess you could do it only on
ErrorDocument, but then you'll be stuck if you ever need to have
/c/Foo.html...  Might be worth pursuing.

You could, perhaps, keep all of a on testa.xxx.com, and force B to link to
a.xxx.com rather than really move it.  They can co-exist on the same
server with VirtualHost settings.  [He says blithely, never having
actually got that to work on his own box...]

H, that reminds me...  Does VirtualHost rely on, like, /etc/hosts
having hostnames for all those made-up hostnames I use?  I had assumed all
those hostnames were just internal unique markers for httpd.conf with no
real-worl meaning...  Was that just silly of me or what?

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

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



Re: [PHP] Re: stripping html tags

2005-06-06 Thread Richard Lynch
On Mon, June 6, 2005 1:05 am, Dotan Cohen said:
 I am trying to access my local pop3 mail via wap. When I get home I
 download the messages, but while away I need access to them. I am
 trying to strip those tags from html mails so that they will display
 in my wap browser.

So, on your current path, you are going to assume that nobody will send
you malicious email, targetted at your particular phone/wap model/device,
and only strip out the tags you think are messing with display...

Chris is suggesting that that's Bad Security, and he's right.

Viruses for wap devices are being developed at break-neck speeds.

Personally, I'd just call strip_tags() and not let ANY tags through, if I
wanted to try to read email through my phone in the first place...

Do you really need those fancy layouts and big images chewing up your cell
phone bandwidth/charges?...

Still, if you insist on ripping out only the 4 tags, preg shouldn't be
THAT hard...

The very first example on: http://us4.php.net/preg_replace shows how to
rip out the script tag and its contents.  It also rips out ALL html, but
you should be able to chop that second array element out, along with the
'', in the replacement array, and be pretty much done...

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

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



Re: [PHP] linux php editor... Quanta +... The best!

2005-06-06 Thread Andy Pieters
On Monday 06 June 2005 23:05, Rory Browne wrote:
 Is there a particular reason why you changed the subject? It screws up
 threads on some clients - including mine.
Well I wanted it to stand out.  

Didn't realize it would break the threads though.  I thought K-Mail put in 
additional headers to not be dependant on subjects...

Apparently I was wrong.  My mistake


Andy

-- 
Registered Linux User Number 379093
-- --BEGIN GEEK CODE BLOCK-
Version: 3.1
GAT/O/E$ d-(---)+ s:(+): a--(-)? C$(+++) UL$ P-(+)++
L+++$ E---(-)@ W++$ !N@ o? !K? W--(---) !O !M- V-- PS++(+++)
PE--(-) Y+ PGP++(+++) t+(++) 5-- X++ R*(+)@ !tv b-() DI(+) D+(+++) G(+)
e$@ h++(*) r--++ y--()
-- ---END GEEK CODE BLOCK--
--
Check out these few php utilities that I released
 under the GPL2 and that are meant for use with a 
 php cli binary:
 
 http://www.vlaamse-kern.com/sas/
--

--

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



Re: [PHP] stripping html tags

2005-06-06 Thread Richard Lynch

Your RegEx is probably fine...

But you are probably missing a closing quote in lines BEFORE line 39, and
PHP thinks everything up the the =^ is still part of some giant
monster long string that spans multiple lines, and then it gets to the
/head bit (because  your opening quote is really a closing quote for
something way earlier) and BAM!  /head don't mean nothing useful in PHP...

So all this discussion about security, strip_tags, and suchlike has
nothing to do with your original problem :-)

But, hey, ya learned some stuff, and that's never bad. :-)

On Sun, June 5, 2005 6:36 pm, Dotan Cohen said:
 On 6/6/05, Richard Lynch [EMAIL PROTECTED] wrote:
 On Sun, June 5, 2005 7:05 am, Dotan Cohen said:
  I took this example from php.net, but can't figure out where I went
  wrong. Why does this:
  $text = preg_replace(/head(.|\s)*?(.|\s)*?\/head/i ,  ,
 $text);
 
  throw this error:
  syntax error at line 265, column 39:
$text = preg_replace(/head(.|\s)*?(.|\s)*?\/head/i
 ,  , $text);
  ==^
 
  It seems to be pointing to the 'e' is 'head'. Why? Thanks.

 The pointing is often off by a few chars...

 For starters, you're not correctly using \, imho.

 \ is special in PHP strings.
 \ is ALSO special in RegEx.

 So your \s should be \\s, in case PHP makes \s special someday.

 I think the ? in there will also mess you up, maybe, as that ends PHP
 parsing...  Though it SHOULD be kosher inside a string...

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



 Could well be- I certainly didn't come up with that regex myself! What
 would you recommend to remove any tag, and the code enclosed? For
 instance: I love my tagbig/tag brother would become I love my
 brother?

 Dotan
 http://lyricslist.com/lyrics/pages/artist_albums.php/114/Chapman%2C%20Tracy
 Tracy Chapman Lyrics

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




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

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



RE: [PHP] dynamic drop down

2005-06-06 Thread Richard Lynch
On Mon, June 6, 2005 2:34 pm, Chris W. Parker said:
 Danny Brow mailto:[EMAIL PROTECTED]
 on Saturday, June 04, 2005 2:45 PM said:

 So how do you refresh the page when the drop down is selected?

 With javascript or force the user to click a submit button.

To be clear, and forestall the But that's not PHP! response...

 With javascriopt or force the user to click a submit button.
... that goes *back* to the server to load a PHP script.

So your onChange=... would have something that resulted in:
.location=somefancymenuscript.php
in it.

This would be incredibly inefficient and a really dumb way to do dynamic
drop down menus unless you can guarantee high-bandwidth low-latency in an
Intranet setting, and even then is probably not truly the BEST answer.

Which, after you boil away 10,000 posts to the PHP list turns out to be:

Use JavaScript.

Go away.

:-) :-) :-)

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

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



Re: [PHP] linux php editor... Quanta +... The best!

2005-06-06 Thread Robert Cummings
On Mon, 2005-06-06 at 18:14, Andy Pieters wrote:
 On Monday 06 June 2005 23:05, Rory Browne wrote:
  Is there a particular reason why you changed the subject? It screws up
  threads on some clients - including mine.

 Well I wanted it to stand out.  

I didn't know the mailing list was a popularity contest :/

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


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



Re: [PHP] linux php editor... Quanta +... The best!

2005-06-06 Thread Greg Donald
On 6/6/05, Robert Cummings [EMAIL PROTECTED] wrote:
 I didn't know the mailing list was a popularity contest :/

It's not?  Man..


-- 
Greg Donald
Zend Certified Engineer
http://destiney.com/

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



Re: [PHP] Craig's List Clone part deux

2005-06-06 Thread Michael O'Neal

Bumpanyone?

On May 31, 2005, at 10:11 AM, Michael O'Neal wrote:

Hi...I posted a while back looking for an open-source or affordable 
Craig's List clone built in PHP, and the advice was to search...there 
are a ton out there.


So far, the only one I've been able to come up with is AJ Classified 
Pro (http://www.ajsquare.com/ajclassifieds.php) which had some 
half-hearted reviews, and has a really cheesy website supporting it.  
So...I'll ask again to see if anyone knows of any others before I 
plunk down $250 for this semi-ok reviewed software.


Does anyone know of a Craig's List type setup out there that is worth 
trying?


Thanks,


mto

--

Michael O'Neal
Head Honcho
http://www.WhirledMedia.com
[EMAIL PROTECTED]
Boulder, Colorado
720.436.2922
IM:  AOL-emptyo1
MSN: [EMAIL PROTECTED]
Yahoo: bambisapartment

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




mto

--

Michael O'Neal
Head Honcho
http://www.WhirledMedia.com
[EMAIL PROTECTED]
Boulder, Colorado
720.436.2922
IM:  AOL-emptyo1
MSN: [EMAIL PROTECTED]
Yahoo: bambisapartment

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



[PHP] Re: headers and session (question)

2005-06-06 Thread JamesBenson
It wont get passed because your not passing it along to the script in 
anyway, at line 3/4 you set the details into the session, then you 
redirect them to the login page so in your login.php just call the 
session variables which you just stored at line 3/4.



login.php example:

?php
echo $_SESSION['session_user'];
echo $_SESSION['session_password'];
?


Now when you redirect the user it will have these session variables stored.



James



Alessandro Rosa wrote:

Here's below the solution (the encryption will be shortly performed
into login.php).

1 ?php
2 session_start();

3 $_SESSION['session_user'] = $_POST['txtIdUtente'];
4 $_SESSION['session_password'] = $_POST['txtPassword'];

5 $PHPcmd = login.php ;

6 header( Location: .$PHPcmd );
7 ?


But a QUESTION now :

if line 5 is replaced by these two lines, say here 5a and 5b:

5a require_once(config.inc.php);
5b $PHPcmd = $GLOBALS['gestionale_path_name'].phpcode/login/login.php ;

this does not work (meaning user and psw are not passed to login.php);
but again the below code works again:

5a require_once(config.inc.php);
5b $PHPcmd = $gestionale_path_name.phpcode/login/login.php ;


Thanks,

Alessandro
 


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



Re: [PHP] about the absolutely path

2005-06-06 Thread Jochem Maas

Richard Lynch wrote:

On Mon, June 6, 2005 1:54 am, yangshiqi said:


I have a php application (let's call it app A) which is developed
separated
in a test domain name, like http://testa.xxx.com http://testa.xxx.com/
/.

But now I have to move it to another app (called B) using
http://testb.xxx.com http://testb.xxx.com/ /, and the app A becomes just
a
subsystem of app B.

The access url is changed to http://testb.xxx.com/a/.

Then I meet a problem that the app A 's links, the path and other elements
in it are set like '/Main.php', '/art/logo.gif' by an absolutely path.

The app A is very independent and I do not want to disperse it to app B.

So how can I get this effect: when the user input the url, '
http://testb.xxx.com/a/ ', the app A will work fine?

Can I just modify some configuration about yapache to fit this
requirement?




maybe you could use the apache ProxyPass directive?

ProxyPass testb.xxx.com/a/ testa.xxx.com

or something like that. (I'm just half-remembering
a cool post by Rasmus L. so the syntax is probably off)





...


server with VirtualHost settings.  [He says blithely, never having
actually got that to work on his own box...]

H, that reminds me...  Does VirtualHost rely on, like, /etc/hosts
having hostnames for all those made-up hostnames I use?  I had assumed all


Richard try something like this (obviously add any required stuff like
DocumentRoot etc.

# you can do allsorts of stuff with the IP definition.
#NameVirtualHost 213.*:80
NameVirtualHost *:80

#  _DEFAULT_ - this vhost gets loaded. if nothing else matches
# -
VirtualHost _default_:80
ServerName www.l-i-e.com
ServerAlias l-i-e.com
DocumentRoot /var/www/l-i-e.com
/VirtualHost

VirtualHost *:80
ServerName richard.l-i-e.com
ServerAlias rlynch.l-i-e.com
# stuff
/VirtualHost

# whats this then!

VirtualHost 67.139.134.202:80
# if you create a directory
# in /var/webroots/ that
# matches the domainname given to apache
# then the dir will be served.

Directory /var/webroots
Options ExecCGI +FollowSymLinks
/Directory

UseCanonicalName Off

ServerName %0

# '%-2+' traps the penultimate and all preceding parts of the FQDN as given 
in the Host: header
# but I wasn't having much luck with it.
VirtualDocumentRoot /var/webroots/%0

# some std resources?
Alias  /css  /var/webroots/include/css
Alias  /js   /var/webroots/include/js

php_value auto_prepend_file /some/include/file.inc.php
/VirtualHost



those hostnames were just internal unique markers for httpd.conf with no
real-worl meaning...  Was that just silly of me or what?


Richard, I believe you can have apache do lookups on the given names but
by default its off at least - I never have any problem putting allsorts
non-existing domains in the vhost confs, as long as your local HOSTS file has a
suitable entry your rolling.

rgds,
Jochem





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



[PHP] The goto discussion on the Internals List

2005-06-06 Thread Chris Drozdowski
I perused the discussion about the inclusion of goto into the PHP 
language on the php.internals list.


From a PHP end-user's perspective, I would suggest that rather than 
focusing on adding new language constructs such as goto, that the 
development team put 100% focus on making what it already has as fast 
and stable as possible (and maybe iron out the Unicode issue) so that 
the corporate and hosting community will more readily accept it.


I've been begging my hosting company to upgrade to 5.0.x for months but 
they say we're going to wait until next year when it has stabilized.


That's really frustrating because I find 5.x's current features so 
compelling and useful.


Thanks,

C Drozdowski

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



[PHP] Re: Regex help

2005-06-06 Thread Al

RaTT wrote:
Hi Guys, 


I am currently creating a once off text parser for a rather large
document that i need to strip out bits of information on certain
lines.

The line looks something like :


Adress line here, postcode, country Tel: +27 112233665 Fax: 221145221
Website: http://www.urlhere.com E-Mail: [EMAIL PROTECTED] TAGINCAPS: CAPS
RESPONSE Tag2: blah


I need to retreive the text after each marker i.e Tel: Fax: E-Email:
TAGINCAPS: ...

I have the following regex /Tel:\s*(.[^A-z:]+)/ and
/Fax:\s*(.[^A-z:]+)/ all these work as expected and stop just before
the next Tag. However I run into hassels  around the TAGINCAPS as the
response after it is all in caps and i cant get the Regex to stop just
before the next tag: which may be either all caps or lowercase.

I cant seem to find the regex that will retreive all chartures just
before a word with a :  regalrdless of case.

I have played around with the regex coach but still seem to be comming
up short so i thought i would see if anybody can see anything i might
have missed.

any help most appreciated. 

Regards 
Jarratt


Add and i for case insensitive for all except the numbers type e.g.,

/TAGINCAPS:\s*(.[A-z:]+)/i

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



RE: [PHP] How to submit a form that has a file included ?

2005-06-06 Thread Rob Agar
hi Mario

 And the form tag, is it allright like it is ?

you'll need to add this: enctype=multipart/form-data

Rob

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



Re: [PHP] The goto discussion on the Internals List

2005-06-06 Thread Greg Donald
On 6/6/05, Chris Drozdowski [EMAIL PROTECTED] wrote:
 I perused the discussion about the inclusion of goto into the PHP
 language on the php.internals list.

Yeah, I've been following it as well..  seems there would be bigger
fish to fry, I dunno.  I benched Ruby and PHP doing some simple random
number addition recently and PHP is pretty slow in comparison.  If the
simple stuff is slow I imagine the complex stuff is pretty slow as
well.  Not bashing PHP at all, but I wouldn't call it 'fast' either.

I doubt many people would use goto anyway.  I have nothing against it
technically or personally, but over the years it's been burned into my
brain that using it is _bad_.  *shrug*  I suspect I might use it if it
were there.

I do think I'd make heavy use of ifsetor(), I would gladly use that instead of
$i = isset( $_GET[ 'i' ] ) ? $_GET[ 'i' ] : 0;

  From a PHP end-user's perspective, I would suggest that rather than
 focusing on adding new language constructs such as goto, that the
 development team put 100% focus on making what it already has as fast
 and stable as possible (and maybe iron out the Unicode issue) so that
 the corporate and hosting community will more readily accept it.

I hear ya on that.  I think it might be similar to the Apache 2 thing.
 We already got PHP4 which works pretty well so why risk it.  PHP5
runs great for me, but I see their point of view.

 I've been begging my hosting company to upgrade to 5.0.x for months but
 they say we're going to wait until next year when it has stabilized.

The guys at http://www.ocssolutions.com gave me PHP 5.04, MySQL 4.1,
and Ruby on Rails this weekend.  They will build a box to your spec,
even for a shared account.  I'm not affiliated with them in any way,
found them using Google.

 That's really frustrating because I find 5.x's current features so
 compelling and useful.

I find a great many of the new 5.0 features get emulated using PHP4
code in the user comments in the manual.


-- 
Greg Donald
Zend Certified Engineer
http://destiney.com/

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



RE: [PHP] Displaying an Outlook Calendar on a webpage using PHP

2005-06-06 Thread Justin.Baiocchi
Still no luck I am afraid. Same thing happens - it kicks off an instance
of Outlook.exe on the server, but the page never loads, it just stays
blank with a never-ending progress bar.

I thought it could be security related but have shared out my Calendar
with default having reviewer access.

I am using an Exchange server but don't want to follow the route of
sharing Calendars and accessing them in Outlook. 

Is the problem with the script that it has to access an Exchange server
to read the Calendar, even while Outlook is installed on the server and
configured with the same profile?

Thanks
Justin

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] 
Sent: Tuesday, 7 June 2005 1:01 AM
To: php-general@lists.php.net
Cc: Baiocchi, Justin (CSIRO IT, Armidale)
Subject: Re: [PHP] Displaying an Outlook Calendar on a webpage using PHP


That looks like some of my code.. or a derivative of my code.   For some
reason, my PC at work here is having issues with PHP instantiating with
COM so I can't test this, but the code you posted is conspicuously
missing all the braces { }.  I'm guessing that's not your issue
though... or else you'd be getting some kind of error maybe.

Anyway, here's a re-braced version of the code.   It should produce
something when run through a web browser, but you might View Source and
see what shows up there.

This does require Outlook to be installed on the PC that PHP is running
on, as that's how COM works.   I never messed around with remote COM
calls, but I'm sure there's some way to do that.

If someone wants to try this code and see if there are other issues
besides the missing braces.  I don't see anything obviously wrong with
it (besides maybe some sloppy programming on my part :).  I'll see about
checking it when I get home tonight if I have time.

?php
$comobjOutlook = new COM(outlook.application) or die(Outlook not
loaded);

//$comobjOutlook - Activate;

# This is your mailbox name just like it appears in your Folders view.
# It might be 'Inbox' or something else.
$targetmailboxname = Mailbox - Baiocchi, Justin (CSIRO IT, Armidale);


# This is the folder you're looking for. In this case, I'm looking for
calendar
# items, but you can look for any folder. You need to add another loop
to look
# for subfolders. Although there's probably a better way, that's how I
did it when 
# I needed to get to Personal Folders/Inbox/Subfoldername
$targetfoldername = Calendar;

$objNamespace = $comobjOutlook-GetNameSpace(MAPI);
$objFolders = $objNamespace-Folders();
$mailboxcount = $objFolders - Count();


$foundmailbox = FALSE;
for ($i=1; $i=$mailboxcount; $i++) {
  $folderitem = $objFolders -Item($i);
  if ($folderitem - Name == $targetmailboxname) {
$objMailbox = $folderitem;
$foundmailbox = TRUE;

$foundcal = FALSE;
if ($foundmailbox) {
  $objFolders = $objMailbox-Folders();
  $foldercount = $objFolders - Count();

  for ($i=1; $i=$foldercount; $i++) {
$folderitem = $objFolders - Item($i);
if ($folderitem - Name == $targetfoldername) {
  $objCalendar = $folderitem;
  $foundcal = TRUE;
}
  }
}


if ($foundcal) {
  $objItems = $objCalendar-Items();
  $itemcount = $objItems-Count();

  for ($i=1; $i=$itemcount; $i++) {
$apptitem = $objItems - Item($i);
$apptstart = $apptitem - Start();
$apptend = $apptitem - End();
$apptallday = $apptitem - AllDayEvent();
$apptrecur = $apptitem - IsRecurring();
$apptsubject = $apptitem - Subject();
$apptlocation = $apptitem - Location();

$secondsadj = $apptstart - 14400;
$startadj = date(m/d/Y H:i:s,
mktime(0,0,$secondsadj,1,1,1970));

$secondsadj = $apptend - 14400;
$endadj = date(m/d/Y H:i:s, mktime(0,0,$secondsadj,1,1,1970));

if($apptallday)  $allday = All Day;  else  $allday = ;
if($apptrecur)  $recurring = Recurring;  else  $recurring =
;

echo $apptsubject @ $apptlocation\r\nFrom: $startadj To:
$endadj\r\n;

if ($allday   OR $recurring  ) echo $allday
$recurring\r\n;
echo \r\n\r\n;
  }
} else {
  die (Did not find calendar folder);
}
  } else {
die(Did not find target mailbox: $targetmailboxname);
  }
}
?



= = = Original message = = =

Hello all,
 
I am trying to publish an Outlook Calendar on a web page using PHP and
COM. I have managed to track down on the net some examples of how it
could be done. The most promising is the code below. However, all that
happens is that outlook.exe is started on the server, but nothing is
displayed on the web page and it just times-out.
 
I am running PHP 4.0.18 on Windows 2003 server and I have Outlook 2002
installed on the server.
Does anybody know why it doesn't work?
 
Thanks 
Justin


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

--
PHP 

[PHP] Re: about the absolutely path

2005-06-06 Thread JamesBenson
If you have .htaccess and mod_rewrite with apache server you can use 
something like the following in a .htaccess file.





RewriteEngine on
RewriteBase /


RewriteRule ^(.*)/$ /e/$1






Thats just an example to get you started.

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



Re: [PHP] stripping html tags

2005-06-06 Thread Dotan Cohen
On 6/7/05, Richard Lynch [EMAIL PROTECTED] wrote:
 
 Your RegEx is probably fine...
 
 But you are probably missing a closing quote in lines BEFORE line 39, and
 PHP thinks everything up the the =^ is still part of some giant
 monster long string that spans multiple lines, and then it gets to the
 /head bit (because  your opening quote is really a closing quote for
 something way earlier) and BAM!  /head don't mean nothing useful in PHP...
 
 So all this discussion about security, strip_tags, and suchlike has
 nothing to do with your original problem :-)
 
 But, hey, ya learned some stuff, and that's never bad. :-)
 
 On Sun, June 5, 2005 6:36 pm, Dotan Cohen said:
  On 6/6/05, Richard Lynch [EMAIL PROTECTED] wrote:
  On Sun, June 5, 2005 7:05 am, Dotan Cohen said:
   I took this example from php.net, but can't figure out where I went
   wrong. Why does this:
   $text = preg_replace(/head(.|\s)*?(.|\s)*?\/head/i ,  ,
  $text);
  
   throw this error:
   syntax error at line 265, column 39:
 $text = preg_replace(/head(.|\s)*?(.|\s)*?\/head/i
  ,  , $text);
   ==^
  
   It seems to be pointing to the 'e' is 'head'. Why? Thanks.
 
  The pointing is often off by a few chars...
 
  For starters, you're not correctly using \, imho.
 
  \ is special in PHP strings.
  \ is ALSO special in RegEx.
 
  So your \s should be \\s, in case PHP makes \s special someday.
 
  I think the ? in there will also mess you up, maybe, as that ends PHP
  parsing...  Though it SHOULD be kosher inside a string...
 
  --
  Like Music?
  http://l-i-e.com/artists.htm
 
 
 
  Could well be- I certainly didn't come up with that regex myself! What
  would you recommend to remove any tag, and the code enclosed? For
  instance: I love my tagbig/tag brother would become I love my
  brother?
 
  Dotan
  http://lyricslist.com/lyrics/pages/artist_albums.php/114/Chapman%2C%20Tracy
  Tracy Chapman Lyrics
 
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 Like Music?
 http://l-i-e.com/artists.htm
 

You're right! The problem wasn't the regex- it was in getting the
parge to parse. I stated that in my second post- after I figured it
out. And again in another post. But the thread changed subject, as I
followed it...

I didn't know that there could be / are virus for mobile phones. Of
course I don't need all that fancy markup- truth is that I hate it. I
was modifying someone else's script and didn't want to hack it up too
much. But now I see that I'm better off removing all the tags like you
suggest.

Thanks to everyone who contributed to this thread. From you I learn.

http://lyricslist.com/lyrics/pages/artist_albums.php/425/Red%20Hot%20Chili%20Peppers
Red Hot Chili Peppers Lyrics

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



Re: [PHP] Japanese with UTF-8 and mysql

2005-06-06 Thread Mark Sargent

Peter Brodersen wrote:


On Thu, 2 Jun 2005 11:58:26 +0100, in php.general
[EMAIL PROTECTED] (Richard Davey) wrote:

 


I would recommend setting UTF-8 as the Content-type via PHP itself:
header('Content-type: UTF-8') - do it as one of the first things when
you're ready to output the HTML.
   



UTF-8 is a charset, not a Content-type.

A quick test shows that the HTTP header output from Apache would
contain:
Content-Type: UTF-8

The correct way - if one wants utf-8 as charset - is:
header(Content-Type: index/html; charset=utf-8);

 


Hi All,

yes, I've tried that as well, with no success. As I've stated, people, 
the static J renders fine, just not the dynamic stuff. Cheers.


Mark Sargent.

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