php-general Digest 25 Jan 2006 14:52:57 -0000 Issue 3926

2006-01-25 Thread php-general-digest-help

php-general Digest 25 Jan 2006 14:52:57 - Issue 3926

Topics (messages 229203 through 229234):

Re: Google using PHP @ spam
229203 by: Peter Hoskin
229208 by: Robert Cummings

Re: $_SESSION saves all values but Class -- works on one server butnot 
another?! [second plead for help]
229204 by: Daevid Vincent
229224 by: Jochem Maas

Re: imagettftext, text values. How to add a new line? is it \n?
229205 by: Richard Correia

Re: Problem with Sessions
229206 by: Richard Correia

Re: 5) [PHP] query problem.
229207 by: Richard Correia

Re: Book Sample Code Help
229209 by: Poppy Alexandra

upload_max_filesize
229210 by: Daniel Lahey
229211 by: David Robley
229221 by: Richard Correia

QUARANTINED: Delivery reports about your e-mail
229212 by: WorkgroupMail Content Filter

Re: Google using PHP @ Google Store
229213 by: Dan Lowe
229215 by: Angelo Zanetti

E-Mail Filter/Parser
229214 by: Sascha Braun - immosky AG
229218 by: Sascha Braun - immosky AG

Re: How to check if an object exists
229216 by: David Grant

PHP / Apache + Error 500
229217 by: Thomas
229219 by: Albert
229222 by: Jochem Maas
229230 by: Thomas

Re: php5.0.5 include() terminates script BUGBUGBUGBUG
229220 by: alex

forwarding from virtual email account to real email account
229223 by: Binay
229225 by: Albert
229226 by: Jochem Maas
229228 by: Angelo Zanetti

absolute vs relative path?
229227 by: William Stokes
229229 by: Jim Moseby
229232 by: Geoff
229233 by: Barry
229234 by: Geoff

Re: Google using PHP @ http://www.google-store.com
229231 by: tedd

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---
Its hosted from 85.13.206.209.reverse.coreix.net - somehow I don't think 
this is a google owned site.


Yahoo use PHP and sponsor PHP - yet nobody talks about that :-/

James Benson wrote:
Looks like google are using PHP and oscommerce for their web store: 
http://www.google-store.com


Nice to see :)


James


-

http://www.ciwcertified.com - Master CIW Designer
http://www.zend.com - Zend Certified Engineer


http://www.jamesbenson.co.uk

-

---End Message---
---BeginMessage---
On Tue, 2006-01-24 at 21:41, Peter Hoskin wrote:
 Its hosted from 85.13.206.209.reverse.coreix.net - somehow I don't think 
 this is a google owned site.
 
 Yahoo use PHP and sponsor PHP - yet nobody talks about that :-/

Sure they do. Rasmus works for Yahoo and every once in a while one of
his posts will happen to contain a reference (and no, not as a
gratuitous plug :)

Cheers,
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.  |
`'
---End Message---
---BeginMessage---
Thank you, but again, not the problem.

The same code is on both servers. I'm not transfering from one server to
another. Only from page to page ON THE SAME SERVER. 

This has to be a configuration problem IMHO.

 -Original Message-
 From: James Benson [mailto:[EMAIL PROTECTED] 
 Sent: Tuesday, January 24, 2006 3:45 PM
 To: php-general@lists.php.net
 Subject: [PHP] Re: $_SESSION saves all values but Class -- 
 works on one server butnot another?! [second plead for help]
 
 Take a look at the following functions:-
 
 http://php.net/serialize
 http://php.net/unserialize
---End Message---
---BeginMessage---

Daevid Vincent wrote:

No no no. I'm NOT passing data between servers. It's just two pages on the
same server. One that sets up the session/class and the other page just
re-loads the session. 


When I talk about two different servers, I copy the entire source/db schema
from one server to the other so they are clones for all intents and
purposes.

One server works the way I'd expect.
The other doesn't.
SAME code on both. Same schema. Nearly identical LAMP versions.


keyword is 'Nearly' - please take into account that the behaviour
of php can change from version to version (sometimes the change is
completely unintentional and unwanted.):


[EMAIL PROTECTED]:/lockdown# php --version
PHP 

Re: [PHP] Google using PHP @ Google Store

2006-01-25 Thread Dan Lowe


On Jan 24, 2006, at 9:41 PM, Peter Hoskin wrote:

Its hosted from 85.13.206.209.reverse.coreix.net - somehow I don't  
think this is a google owned site.


It's implied right on the front page it's not directly run by Google.

Produced for Google Inc. by Merchandise Mania Limited

My guess is this is an outsource deal Google did because they don't  
want to get into the business of manufacturing t-shirts and coffee  
mugs. If you do a Google search for Google Store this site will  
show up as a sponsored link.


 -dan

--
Any event, once it has occurred, can be made to appear inevitable
by a competent historian. -Lee Simonson





[PHP] E-Mail Filter/Parser

2006-01-25 Thread Sascha Braun - immosky AG
Hi,

I started to write an E-Mail Parser so E-Mails from different Internet
Plattforms can be sorted automatically into an customer database.

Everything is working pretty fine, but only if all expected fields
appear in the Mail from the sending plattform.

But sometimes the Mails send out by a plattform doesnt contain all
fields the filter expects. And i dont know how to write the foreach
loop I am using to walk over the current field to check if the start
element of the next needed field occours so the parsing for the needed
element can stop somewhere and start reading the next field element.

A Filter looks like that, at the moment:

Array
(
[attribute] = Array
(
[plattform] = plattform.com
)

[firstname] = Array
(
[attribute] = Array
(
[read_init] = Name: 
[read_from] = Name: 
[read_to] =  
)

)

[name] = Array
(
[attribute] = Array
(
[read_init] =  
[read_from] =  
[read_to] = Anschrift: 
)

)

[adress] = Array
(
[attribute] = Array
(
[read_init] = Anschrift:
[read_from] = Anschrift:
[read_to] = ,
)

)

[plz] = Array
(
[attribute] = Array
(
[read_init] = ,
[read_from] = , 
[read_to] =  
)

)

[city] = Array
(
[attribute] = Array
(
[read_init] =  
[read_from] =  
[read_to] = E-Mail:
)

)

[email] = Array
(
[attribute] = Array
(
[read_init] = E-Mail: 
[read_from] = E-Mail: 
[read_to] = Telefon:
)

)

[phone] = Array
(
[attribute] = Array
(
[read_init] = Telefon: 
[read_from] = Telefon: 
[read_to] = Folgender
)

)

[comment1] = Array
(
[attribute] = Array
(
[read_init] = ussert:
[read_from] = ussert:
[read_to] = Kommentar: 
)

)

[comment2] = Array
(
[attribute] = Array
(
[read_init] = Kommentar: 
[read_from] = Kommentar: 
[read_to] = ===
)

)

[headline] = Array
(
[attribute] = Array
(
[read_init] = berschrift: 
[read_from] = berschrift: 
[read_to] = Anzeige 
)

)

[object] = Array
(
[attribute] = Array
(
[read_init] = Objekt Nr: 
[read_from] = Objekt Nr: 
[read_to] = )
)

)

)

And the filter funltion looks like that, at the moment:

private function filter_email($message)
// Filter upcomming email messages into the immetix database
{

if (is_dir($this - filter_folder)) {

if ($filters = opendir($this - filter_folder)) {

while(($filter = readdir($filters)) !== false) {

if ($filter != .  $filter != ..) {

$xml = new xml_mm($this - 
filter_folder.$filter);

if (!empty($xml - 
email_filter['attribute']['plattform']) 
substr_count(strtolower($message), $xml -
email_filter['attribute']['plattform'])) {

unset($xml - 
email_filter['attribute']);

foreach($xml - 
email_filter as $key = $value) {

if ($pos = 
strpos($message, $xml -
email_filter[$key]['attribute']['read_init'])) {


$message = substr($message, $pos + strlen($xml -

Re: [PHP] Google using PHP @ Google Store

2006-01-25 Thread Angelo Zanetti



Dan Lowe wrote:


On Jan 24, 2006, at 9:41 PM, Peter Hoskin wrote:

Its hosted from 85.13.206.209.reverse.coreix.net - somehow I don't  
think this is a google owned site.



It's implied right on the front page it's not directly run by Google.

Produced for Google Inc. by Merchandise Mania Limited

My guess is this is an outsource deal Google did because they don't  
want to get into the business of manufacturing t-shirts and coffee  
mugs. If you do a Google search for Google Store this site will  show 
up as a sponsored link.


 -dan


well at least they endorse it!

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



Re: [PHP] How to check if an object exists

2006-01-25 Thread David Grant
Derrick,

Derrick Shoemake wrote:
 It appears that the error I was getting wasn't really related to my
 problem. I'm getting a error in httpd-error.log
 
 httpd in free(): error: junk pointer, too high to make sense
 [Tue Jan 24 17:11:32 2006] [notice] child pid 22665 exit signal Abort
 trap (6)
 
 Is there any way to track down where the code is failing? It's not
 creating any dump file that I can see. I don't mind digging into this to
 either report a bug to php.net,  apache.org or even just fix the code
 myself and submit a patch to someone, but I'm a little new to the php
 and apache working together.

This might be related to PHP, but I would start out by asking around the
Apache community.

David
-- 
David Grant
http://www.grant.org.uk/

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



[PHP] PHP / Apache + Error 500

2006-01-25 Thread Thomas

Hi there!

I am sitting with something of a mystery and was wondering if there is
someone out that might have dealt with this before:

I have developed a site that runs well and fine on my machine
(XP/Apache2/PHP5/MySQL5). I am using PEAR::HTML_Template_Flexy as well as
Cache_Lite.

The site has been put up on the live server and works (mostly) fine there
too, with the exception of Internal Server errors 500, ever so often. It's
pretty random and can happen to any of the scripts (they all run through a
single index.php script that instantiates objects that then spit out the
resulting html).

I had a look at the Apache log file I got from the SP ... no clue. All I
know is that they use Apache 1.x/PHP5/Linux/MySQL(v4?).

They say that it is not their server but my scripts, however, if that was
the case I would get these errors on my machine too. Also, the randomness of
this also indicates that it can't really be my php scripts, otherwise it
would happen all the time.

Does anybody have any suggestion as to how I can solve this issue? I know
this is pretty vague information, but it's all I have (hence the confusion).

Thanks,
Thomas


SPIRAL EYE STUDIOS 
P.O. Box 37907, Faerie Glen, 0043

Tel: +27 12 362 3486
Fax: +27 12 362 3493 
Mobile: +27 82 442 9228
Email: [EMAIL PROTECTED]
Web: www.spiraleye.co.za 

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



Re: [PHP] E-Mail Filter/Parser

2006-01-25 Thread Sascha Braun - immosky AG
But how can i get the next key in a foreach loop?

Can't see how i can use a continue statement in that circumstance?

Am Mittwoch, den 25.01.2006, 11:28 +0200 schrieb Geoff:
 Possibly the continue statement would help you?
 
 Geoff.
 
 
 On 25 Jan 2006 at 10:12, Sascha Braun - immosky AG wrote:
 
  Hi,
  
  I started to write an E-Mail Parser so E-Mails from different Internet
  Plattforms can be sorted automatically into an customer database.
  
  Everything is working pretty fine, but only if all expected fields
  appear in the Mail from the sending plattform.
  
  But sometimes the Mails send out by a plattform doesnt contain all
  fields the filter expects. And i dont know how to write the foreach
  loop I am using to walk over the current field to check if the start
  element of the next needed field occours so the parsing for the needed
  element can stop somewhere and start reading the next field element.
  
  A Filter looks like that, at the moment:
  
  Array
  (
  [attribute] = Array
  (
  [plattform] = plattform.com
  )
  
  [firstname] = Array
  (
  [attribute] = Array
  (
  [read_init] = Name: 
  [read_from] = Name: 
  [read_to] =  
  )
  
  )
  
  [name] = Array
  (
  [attribute] = Array
  (
  [read_init] =  
  [read_from] =  
  [read_to] = Anschrift: 
  )
  
  )
  
  [adress] = Array
  (
  [attribute] = Array
  (
  [read_init] = Anschrift:
  [read_from] = Anschrift:
  [read_to] = ,
  )
  
  )
  
  [plz] = Array
  (
  [attribute] = Array
  (
  [read_init] = ,
  [read_from] = , 
  [read_to] =  
  )
  
  )
  
  [city] = Array
  (
  [attribute] = Array
  (
  [read_init] =  
  [read_from] =  
  [read_to] = E-Mail:
  )
  
  )
  
  [email] = Array
  (
  [attribute] = Array
  (
  [read_init] = E-Mail: 
  [read_from] = E-Mail: 
  [read_to] = Telefon:
  )
  
  )
  
  [phone] = Array
  (
  [attribute] = Array
  (
  [read_init] = Telefon: 
  [read_from] = Telefon: 
  [read_to] = Folgender
  )
  
  )
  
  [comment1] = Array
  (
  [attribute] = Array
  (
  [read_init] = ussert:
  [read_from] = ussert:
  [read_to] = Kommentar: 
  )
  
  )
  
  [comment2] = Array
  (
  [attribute] = Array
  (
  [read_init] = Kommentar: 
  [read_from] = Kommentar: 
  [read_to] = ===
  )
  
  )
  
  [headline] = Array
  (
  [attribute] = Array
  (
  [read_init] = berschrift: 
  [read_from] = berschrift: 
  [read_to] = Anzeige 
  )
  
  )
  
  [object] = Array
  (
  [attribute] = Array
  (
  [read_init] = Objekt Nr: 
  [read_from] = Objekt Nr: 
  [read_to] = )
  )
  
  )
  
  )
  
  And the filter funltion looks like that, at the moment:
  
  private function filter_email($message)
  // Filter upcomming email messages into the immetix database
  {
  
  if (is_dir($this - filter_folder)) {
  
  if ($filters = opendir($this - filter_folder)) {
  
  while(($filter = readdir($filters)) !== false) {
  
  if ($filter != .  $filter != ..) {
  
  $xml = new xml_mm($this - 
  filter_folder.$filter);
  
  if (!empty($xml - 
  email_filter['attribute']['plattform']) 
  substr_count(strtolower($message), $xml -
  email_filter['attribute']['plattform'])) {
  
  unset($xml - 
  email_filter['attribute']);
  

RE: [PHP] PHP / Apache + Error 500

2006-01-25 Thread Albert
Thomas wrote:
 I had a look at the Apache log file I got from the SP ... no clue. All I
 know is that they use Apache 1.x/PHP5/Linux/MySQL(v4?).

Did you look at the access_log or error_log?

The error_log should give you an indication of why it is happening.

Do you try to access system files or use a lot of memory? Are you sure that
the production server has all the modules installed that your testing server
has? Quite important, is the same version installed on your testing server
as on the production server?

 They say that it is not their server but my scripts, however, if that was
 the case I would get these errors on my machine too. Also, the randomness
 of this also indicates that it can't really be my php scripts, otherwise 
 it would happen all the time.

Yes and no. You can only say that with certainty if your test and production
environments are the same. 

If you are absolutely 100% certain that it is not your scripts, start
looking at the differences between what you have and what your ISP provides.

Alternatively test it on another server as well. 

Albert

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.375 / Virus Database: 267.14.22/239 - Release Date: 2006/01/24
 

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



Re: [PHP] php5.0.5 include() terminates script BUGBUGBUGBUG

2006-01-25 Thread alex
thanks all for your help.. i have upgraded to php5.1.2 and the problem has 
resolved itself...as it stands for me php5.0.5 cannot handle multiple 
include statments..
regards alex
Jochem Maas [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 David Hall wrote:
 Jochem Maas wrote:


 the first and second line you can alter it or just switch between 
 pending if you want it to display the file or just to tell you if it 
 exists or not so...applying this code just before my include 
 statments all verifys ok(thats the file exists) if i use line 1 
 nothing appearsit says the file exists according to line 2 yet it 
 wont display??? of course i REM either line out 
 accordingly.so...the register page starts with an include called 
 session.php in that session.php i have another 3 includes... 
 mailer.php,database.php and form.php each tested for line 2 and ok but 
 not for line 1 nothing appears if i move that phpinfo.php file around 
 into those directories(folders and subfolders) and test it then it ok's 
 for line 1 i get a display and ok for line 2 too. but of course 
 phpinfo.php when called doesnt have another include statement in it... 
 i really cant explain it perhaps php 5.0.5 doesnt support multiple 
 include statementsstrange???


 thats just silly.


 it just isn't displaying errors, doing all this nonsense with file exists 
 is a waste of time, just add two lines to the top of your script (that 
 includes the file):

 error_reporting(E_ALL);
 ini_set('display_errors','on');

 (or set these values in the php.ini if you have access to that)
 and look at what that tells you.  You might not understand the error at 
 first, but hopefully you will.  My guess is that it will tell you it 
 can't parse your included file.

 right - waste of time - not displaying errors.
 I have documented a problem that has existed since php5beta3 - namely 
 under certain
 conditions (only ever in big codebases in seems) a failed require 
 statement will NOT
 GENERATE ANY ERRORS REGARDLESS OF THE RELATED INI SETTINGS AND CAUSE THE
 ENGINE TO STOP PROCESSING. (you might guess that this problem is a little 
 annoying!)

 so the OP _may_ be a blithering idiot who hasn't turned on error reporting 
 to
 full BUT there is a very good chance that php is borking on one of his 
 includes/requires
 and crapping out WITHOUT any errors being reporting.

 so its seems like it should be nonsense but it reality there is a real 
 issue the OP
 could walking into.


 David Hall
 

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



Re: [PHP] upload_max_filesize

2006-01-25 Thread Richard Correia
check MAX_FILE_SIZE attribute of file tag.

Also does your webserver impose any file upload limit?

Thanks
Richard


On 1/25/06, Daniel Lahey [EMAIL PROTECTED] wrote:

 A client has started experiencing problems with uploading files
 larger than the default 2M set in php.ini.  The problem only started
 occurring a few weeks or so ago, and I cannot figure out how to get
 around it.  I have a php.ini file in the /public_html folder that reads:

 post_max_size 8388608
 upload_max_filesize 8388608

 I've also tried peppering the code with calls to ini_set
 ('upload_max_filesize', '8388608');   In desparation, I've also tried
 a .htaccess file that reads:



Re: [PHP] PHP / Apache + Error 500

2006-01-25 Thread Jochem Maas

Thomas wrote:

Hi there!

I am sitting with something of a mystery and was wondering if there is
someone out that might have dealt with this before:

I have developed a site that runs well and fine on my machine
(XP/Apache2/PHP5/MySQL5). I am using PEAR::HTML_Template_Flexy as well as


php5.WHAT?


Cache_Lite.


it's not completely impossible that HTML_Template_Flexy or Cache_Lite run
on either php5.1 and above OR on php5.0.4 and below but not both.



The site has been put up on the live server and works (mostly) fine there
too, with the exception of Internal Server errors 500, ever so often. It's
pretty random and can happen to any of the scripts (they all run through a
single index.php script that instantiates objects that then spit out the
resulting html).

I had a look at the Apache log file I got from the SP ... no clue. All I
know is that they use Apache 1.x/PHP5/Linux/MySQL(v4?).


php5.WHAT?

I would suggest getting both systems to run the same version of the software
packages you mention. it might cut out a few unknowns.



They say that it is not their server but my scripts, however, if that was
the case I would get these errors on my machine too. Also, the randomness of
this also indicates that it can't really be my php scripts, otherwise it
would happen all the time.

Does anybody have any suggestion as to how I can solve this issue? I know
this is pretty vague information, but it's all I have (hence the confusion).

Thanks,
Thomas


SPIRAL EYE STUDIOS 
P.O. Box 37907, Faerie Glen, 0043


Tel: +27 12 362 3486
Fax: +27 12 362 3493 
Mobile: +27 82 442 9228

Email: [EMAIL PROTECTED]
Web: www.spiraleye.co.za 



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



Re: [PHP] $_SESSION saves all values but Class -- works on one server but not another?! [second plead for help]

2006-01-25 Thread Jochem Maas

Daevid Vincent wrote:

No no no. I'm NOT passing data between servers. It's just two pages on the
same server. One that sets up the session/class and the other page just
re-loads the session. 


When I talk about two different servers, I copy the entire source/db schema
from one server to the other so they are clones for all intents and
purposes.

One server works the way I'd expect.
The other doesn't.
SAME code on both. Same schema. Nearly identical LAMP versions.


keyword is 'Nearly' - please take into account that the behaviour
of php can change from version to version (sometimes the change is
completely unintentional and unwanted.):


[EMAIL PROTECTED]:/lockdown# php --version
PHP 5.0.3 (cli) (built: Jan  5 2006 13:18:18)


PHP5.0.3


Copyright (c) 1997-2004 The PHP Group
Zend Engine v2.0.3, Copyright (c) 1998-2004 Zend Technologies
with Zend Extension Manager v1.0.9, Copyright (c) 2003-2005, by Zend
Technologies
with Zend Optimizer v2.6.0, Copyright (c) 1998-2005, by Zend
Technologies


the not working box doesn't run the Zend stuff - try turning it
off to see if that break your working machine (doubtful)



NOT WORKING BOX:
vmware apache2-php5 # php --version
PHP 5.0.5-pl3-gentoo (cli) (built: Dec 14 2005 15:44:04)


PHP5.0.5 (or even PHP5.0.5-pl3-gentoo what exotic flavor that might be)


given that the not working box is running php5.0.5 and the working box
a prior version gives me the sneaking suspicion (spelling!?) that
you may be looking at a reference related problem.

I assume your php CLI is from the same build as the apache module (or
whatever sapi your websaerver uses), correct? (otherwise you'll need
to look at the version info in phpinfo() as viewed via your webbrowser)


Copyright (c) 1997-2004 The PHP Group
Zend Engine v2.0.5, Copyright (c) 1998-2004 Zend Technologies
This is why I'm saying, it's not my PHP code or database or anything like
that.
It must be some kind of server configuration, but I can't figure out what it
would be. I've compared the php.ini files and don't see anything that seems
relevant. 


the session is not set to auto start on the not working server per chance?






-Original Message-
From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] 
Sent: Tuesday, January 24, 2006 4:54 PM

To: php-general@lists.php.net
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] $_SESSION saves all values but Class -- 
works on one server but not another?! [second plead for help]


You say it's working on one box and not on the other?  Maybe 
I'm wrong (and sounds like I am) but I thought that you 
couldn't pass objects between scripts even with serialize()?


Certainly sounds like it was working for you...   can anyone 
clarify what objects/variables/data types can be passed from 
script to script and what can't?


tg, try the manual.



I know things like database connections can't be shared (that 
is, you can't assign a MySQL connect link to a variable then 
pass that variable/connect to the next script, it needs to 
reconnect the next time around.. or am I wrong about that too? hah)


-TG
God I'm tired

= = = Original message = = =

Thought I'd give this another shot since I still can't figure 
it out after

nearly a week...

I have a gentoo server that doesn't save/restore the CLASS 
portion of a
session, but it does retain other $_SESSION values. This code 
works fine on

a debian box.

WORKING BOX:
[snip]





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



Re: [PHP] forwarding from virtual email account to real email account

2006-01-25 Thread Jochem Maas

Binay wrote:

Hi All,


Is it possible that we create a virtual email account(no physical existence) 
e.g [EMAIL PROTECTED] which will be associated with a real email account e.g. 
[EMAIL PROTECTED] so that if any body sends the email to virtual email account 
[EMAIL PROTECTED] will be automatically forwarded to the real email account 
[EMAIL PROTECTED] Is it achievable using PHP ? Please throw some light as this 
becoming a major requirement of my client.


how is it possible that you can list the following solutions/skills on
your website and not know what an email alias is???

Web Application Development
Website Design  Development
Web Hosting
Search Engine Ranking Services
Content Management Solution
e-Commerce Solutions
B2B  B2C Portal Development
Intranet  Extranet Solutions
Document Management System
e-CRM Solutions
Supply Chain Management
Sales Force Automation
Workflow Management Solutions



Thanks in adance,
Binay


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



[PHP] absolute vs relative path?

2006-01-25 Thread William Stokes
Hello,

I Have a web site on one server and a test site on another. How can I build 
the hyperlinks so that they work on both servers without modification.

For example build this link dynamically:
http://www.domain.com/www/test.php

In test server the same should be:
http://internalserver/www/test.php

Thanks
-Will 

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



Re: [PHP] forwarding from virtual email account to real email account

2006-01-25 Thread Angelo Zanetti


Binay wrote:

Hi All,


Is it possible that we create a virtual email account(no physical existence) 
e.g [EMAIL PROTECTED] which will be associated with a real email account e.g. 
[EMAIL PROTECTED] so that if any body sends the email to virtual email account 
[EMAIL PROTECTED] will be automatically forwarded to the real email account 
[EMAIL PROTECTED] Is it achievable using PHP ? Please throw some light as this 
becoming a major requirement of my client.

Thanks in adance,
Binay


in the server configuration software (eg PLESK or cPAnel) you can create 
email address that just redirect as soon as an email is sent to them, so 
Im not sure where PHP ties in, but this could be what you are looking for?


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



RE: [PHP] absolute vs relative path?

2006-01-25 Thread Jim Moseby
 Hello,
 
 I Have a web site on one server and a test site on another. 
 How can I build 
 the hyperlinks so that they work on both servers without modification.
 
 For example build this link dynamically:
 http://www.domain.com/www/test.php
 
 In test server the same should be:
 http://internalserver/www/test.php
 

Well, for hyperlinks to local pages, you can leave off the domain part all
together.  So in the above example you would just use /www/test.php.  Any
hyperlinks to remote servers would be the same in test as they are in
production.

JM

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



RE: [PHP] PHP / Apache + Error 500

2006-01-25 Thread Thomas
Hi Jochem,

PHP5.0.4, on both systems. I suspect that either of the PEAE modules cause
some server id10t error (if indeed the issue is on my side).

Thomas

-Original Message-
From: Jochem Maas [mailto:[EMAIL PROTECTED] 
Sent: 25 January 2006 03:00 PM
To: Thomas
Cc: php-general@lists.php.net
Subject: Re: [PHP] PHP / Apache + Error 500

Thomas wrote:
 Hi there!
 
 I am sitting with something of a mystery and was wondering if there is
 someone out that might have dealt with this before:
 
 I have developed a site that runs well and fine on my machine
 (XP/Apache2/PHP5/MySQL5). I am using PEAR::HTML_Template_Flexy as well as

php5.WHAT?

 Cache_Lite.

it's not completely impossible that HTML_Template_Flexy or Cache_Lite run
on either php5.1 and above OR on php5.0.4 and below but not both.

 
 The site has been put up on the live server and works (mostly) fine there
 too, with the exception of Internal Server errors 500, ever so often. It's
 pretty random and can happen to any of the scripts (they all run through a
 single index.php script that instantiates objects that then spit out the
 resulting html).
 
 I had a look at the Apache log file I got from the SP ... no clue. All I
 know is that they use Apache 1.x/PHP5/Linux/MySQL(v4?).

php5.WHAT?

I would suggest getting both systems to run the same version of the software
packages you mention. it might cut out a few unknowns.

 
 They say that it is not their server but my scripts, however, if that was
 the case I would get these errors on my machine too. Also, the randomness
of
 this also indicates that it can't really be my php scripts, otherwise it
 would happen all the time.
 
 Does anybody have any suggestion as to how I can solve this issue? I know
 this is pretty vague information, but it's all I have (hence the
confusion).
 
 Thanks,
 Thomas
 
 
 SPIRAL EYE STUDIOS 
 P.O. Box 37907, Faerie Glen, 0043
 
 Tel: +27 12 362 3486
 Fax: +27 12 362 3493 
 Mobile: +27 82 442 9228
 Email: [EMAIL PROTECTED]
 Web: www.spiraleye.co.za 
 

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



Re: [PHP] Google using PHP @ http://www.google-store.com

2006-01-25 Thread tedd
Looks like google are using PHP and oscommerce for their web store: 
http://www.google-store.com


Nice to see :)

James


It would be nice to see them being w3c compliant, but they aren't.

tedd

--

http://sperling.com/

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



Re: [PHP] absolute vs relative path?

2006-01-25 Thread Geoff
On 25 Jan 2006 at 15:19, William Stokes wrote:

 Hello,
 
 I Have a web site on one server and a test site on another. How can I build 
 the hyperlinks so that they work on both servers without modification.
 
 For example build this link dynamically:
 http://www.domain.com/www/test.php
 
 In test server the same should be:
 http://internalserver/www/test.php

Non-php solution:

Use relative links. Instead of referring to a page as 
http://www.domain.com/www/test.php;, rather just use 
/www/test.php or even just /test.php, if the script containing 
that link is already in /www. Thus your links will look the same on 
both versions.

php-based solution:

If you must have absolute URLs (maybe to do redirects or SSL) use:
$_SERVER[SERVER_NAME]
it will return either www.domain.com or internalserver. So you 
can build your links as:

?php
$url = 'http://' . $_SERVER[SERVER_NAME] . '/www/test.php';
?

Geoff.

 
 Thanks
 -Will 
 
 -- 
 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] absolute vs relative path?

2006-01-25 Thread Barry

Geoff wrote:

On 25 Jan 2006 at 15:19, William Stokes wrote:



Hello,

I Have a web site on one server and a test site on another. How can I build 
the hyperlinks so that they work on both servers without modification.


For example build this link dynamically:
http://www.domain.com/www/test.php

In test server the same should be:
http://internalserver/www/test.php



Non-php solution:

Use relative links. Instead of referring to a page as 
http://www.domain.com/www/test.php;, rather just use 
/www/test.php or even just /test.php, if the script containing 
that link is already in /www. Thus your links will look the same on 
both versions.


/test.php would refer to root.
so it would be www.domain.com/test.php
not www.domain.com/www/test.php (!)

probably a small typo ;)

Barry

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



Re: [PHP] absolute vs relative path?

2006-01-25 Thread Geoff


On 25 Jan 2006 at 15:22, Barry wrote:

 Geoff wrote:
  On 25 Jan 2006 at 15:19, William Stokes wrote:
  
  
 Hello,
 
 I Have a web site on one server and a test site on another. How can I build 
 the hyperlinks so that they work on both servers without modification.
 
 For example build this link dynamically:
 http://www.domain.com/www/test.php
 
 In test server the same should be:
 http://internalserver/www/test.php
  
  
  Non-php solution:
  
  Use relative links. Instead of referring to a page as 
  http://www.domain.com/www/test.php;, rather just use 
  /www/test.php or even just /test.php, if the script containing 
  that link is already in /www. Thus your links will look the same on 
  both versions.
 
 /test.php would refer to root.
 so it would be www.domain.com/test.php
 not www.domain.com/www/test.php (!)
 
 probably a small typo ;)

Oops, twas indeed. Well spotted :-

 
 Barry
 
 -- 
 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] forwarding from virtual email account to real email account

2006-01-25 Thread Binay\(Local\)

Hi

I think i've been misunderstood here. I meant whether this is achievable
using PHP or not? I  know and can be done very easily on server with either
control panel or manual intervene but its integration with PHP is my main
concern. I hope you understand what i mean.


Thanks,
Binay
- Original Message - 
From: Jochem Maas [EMAIL PROTECTED]

To: Binay [EMAIL PROTECTED]
Cc: php-general@lists.php.net
Sent: Wednesday, January 25, 2006 6:48 PM
Subject: Re: [PHP] forwarding from virtual email account to real email 
account




Binay wrote:

Hi All,


Is it possible that we create a virtual email account(no physical 
existence) e.g [EMAIL PROTECTED] which will be associated with a real email 
account e.g. [EMAIL PROTECTED] so that if any body sends the email to 
virtual email account [EMAIL PROTECTED] will be automatically forwarded to 
the real email account [EMAIL PROTECTED] Is it achievable using PHP ? 
Please throw some light as this becoming a major requirement of my 
client.


how is it possible that you can list the following solutions/skills on
your website and not know what an email alias is???

Web Application Development
Website Design  Development
Web Hosting
Search Engine Ranking Services
Content Management Solution
e-Commerce Solutions
B2B  B2C Portal Development
Intranet  Extranet Solutions
Document Management System
e-CRM Solutions
Supply Chain Management
Sales Force Automation
Workflow Management Solutions



Thanks in adance,
Binay





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



Re: [PHP] forwarding from virtual email account to real email account

2006-01-25 Thread Duncan Hill
On Wednesday 25 January 2006 15:04, Binay(Local) wrote:
 Hi

 I think i've been misunderstood here. I meant whether this is achievable
 using PHP or not? I  know and can be done very easily on server with either
 control panel or manual intervene but its integration with PHP is my main
 concern. I hope you understand what i mean.

It's probably do-able in B - all you're doing is feeding a data stream from 
the MTA to a program.

If, however, you're doing it without involving and MTA, you may have problems.

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



RE: [PHP] forwarding from virtual email account to real email account

2006-01-25 Thread Albert
Binay wrote:
 Is it possible that we create a virtual email account(no physical 
 existence) e.g [EMAIL PROTECTED] which will be associated with a real email
 account e.g. [EMAIL PROTECTED] so that if any body sends the email to virtual
 email account [EMAIL PROTECTED] will be automatically forwarded to the real
 email account [EMAIL PROTECTED] Is it achievable using PHP ? Please throw 
 some light as this becoming a major requirement of my client.

What you described here is called MAIL FORWARDING or often MAIL ALIASSING.

It is a functionality of your mail server.

Contact your ISP for assistance on setting this up. If you run your own mail
server look at the docs.

If you want to use PHP for this (not recommended because the mail server can
do it already) you need to write a script which check email on one account
and then email it to the other accounts.

Albert

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.375 / Virus Database: 267.14.22/239 - Release Date: 2006/01/24
 

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



Re: [PHP] forwarding from virtual email account to real email account

2006-01-25 Thread John Nichel

Binay wrote:

Hi All,


Is it possible that we create a virtual email account(no physical existence) 
e.g [EMAIL PROTECTED] which will be associated with a real email account e.g. 
[EMAIL PROTECTED] so that if any body sends the email to virtual email account 
[EMAIL PROTECTED] will be automatically forwarded to the real email account 
[EMAIL PROTECTED] Is it achievable using PHP ? Please throw some light as this 
becoming a major requirement of my client.


Asking if this task is possible in php doesn't make this a php 
question, or even remotely php related.  This is basic mail server 
functionality.


Hey, I want to change the oil in my car, is this possible in PHP?

--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

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



[PHP] function preg_match()

2006-01-25 Thread Denyl Meneses Guillén
When I try to use preg_match(), I get this...

Fatal error: Call to undefined function preg_match() in
/usr/home/www/library/defines.php on line 25

I have php5.0.4 ,web server Apache (Linux)  . 

as I can solve it?

Thanks,
Denyl.






-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

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



Re: [PHP] forwarding from virtual email account to real email account

2006-01-25 Thread Jochem Maas

John Nichel wrote:

Binay wrote:


Hi All,


Is it possible that we create a virtual email account(no physical 
existence) e.g [EMAIL PROTECTED] which will be associated with a real 
email account e.g. [EMAIL PROTECTED] so that if any body sends the email 
to virtual email account [EMAIL PROTECTED] will be automatically 
forwarded to the real email account [EMAIL PROTECTED] Is it achievable 
using PHP ? Please throw some light as this becoming a major 
requirement of my client.



Asking if this task is possible in php doesn't make this a php 
question, or even remotely php related.  This is basic mail server 
functionality.


Hey, I want to change the oil in my car, is this possible in PHP?


trust bloomin' John to come up with a sensible example ...

humor class=barely skip=if you are flammable
John I need world peace and all the women to bow to my command, throw some light
on this - it's urgent. oh and I want it to have a pear-like cmdline interface
like so:

 peargirl install ajolie-submissive
humor

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



Re: [PHP] function preg_match()

2006-01-25 Thread Denyl Meneses Guillén
sorry , what is PCRE ?
I looking my configuration with phpinfo() and not exist PCRE or similar .

I'm using PHPmailer and and inside it calls to function preg_match , but  i
want to run a simple example

...:: denyl.php

?php
$subject = abcdef;
$pattern = '/^def/';
preg_match($pattern, $subject, $matches, PREG_OFFSET_CAPTURE, 3);
print_r($matches);
?

and I get this :

Fatal error: Call to undefined function preg_match() in
/usr/local/apache133/htdocs/denyl.php on line 4

my phpinfo() is :
http://www.olvacourier.com/php.php

Thanks,
Denyl.


- Original Message - 
From: Melanie Maddix [EMAIL PROTECTED]
To: Denyl Meneses Guillén [EMAIL PROTECTED];
php-general@lists.php.net
Sent: Wednesday, January 25, 2006 7:56 AM
Subject: RE: [PHP] function preg_match()


[snip]
When I try to use preg_match(), I get this...

Fatal error: Call to undefined function preg_match() in
/usr/home/www/library/defines.php on line 25
[/snip]

Do you get the error with all PCRE functions?

Take a look at your PCRE settings using phpinfo().



-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.


-- 
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.375 / Virus Database: 267.14.22/238 - Release Date: 23/01/2006



-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

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



Re: [PHP] forwarding from virtual email account to real email account

2006-01-25 Thread Jochem Maas

Binay(Local) wrote:

Hi

I think i've been misunderstood here. I meant whether this is achievable 
using PHP or not? I  know and can be done very easily on server with 
either control panel or manual intervene but its integration with PHP is 
my main concern. I hope you understand what i mean.


you want someone else to check the manual for you to see if there is a
function called
create_fully_functional_email_alias_for_addr_regardless_of_whether_you_control_either_domain($alias,
 $email) ?




Your meaning to lazily ask very vague questions (in a manner unbefitting
the subject matter, using made-up terminology, while professing to be a
professional) in the hope that some is going to spoonfeed you a complete
solution which you can then roll out to your customer (probably my
customer until he got the braindead idea to outsource) in five minutes flat;
if I understand you correctly.

I dare you to ask a real php question, with sample code and stuff.




Thanks,
Binay


- Original Message - From: Jochem Maas [EMAIL PROTECTED]
To: Binay [EMAIL PROTECTED]
Cc: php-general@lists.php.net
Sent: Wednesday, January 25, 2006 6:48 PM
Subject: Re: [PHP] forwarding from virtual email account to real email 
account




Binay wrote:


Hi All,


Is it possible that we create a virtual email account(no physical 
existence) e.g [EMAIL PROTECTED] which will be associated with a real 
email account e.g. [EMAIL PROTECTED] so that if any body sends the email 
to virtual email account [EMAIL PROTECTED] will be automatically 
forwarded to the real email account [EMAIL PROTECTED] Is it achievable 
using PHP ? Please throw some light as this becoming a major 
requirement of my client.



how is it possible that you can list the following solutions/skills on
your website and not know what an email alias is???

Web Application Development
Website Design  Development
Web Hosting
Search Engine Ranking Services
Content Management Solution
e-Commerce Solutions
B2B  B2C Portal Development
Intranet  Extranet Solutions
Document Management System
e-CRM Solutions
Supply Chain Management
Sales Force Automation
Workflow Management Solutions



Thanks in adance,
Binay








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



RE: [PHP] forwarding from virtual email account to real email acc ount

2006-01-25 Thread Jim Moseby

 
 Hey, I want to change the oil in my car, is this possible in PHP?

if($accumulated_miles3000){
  keep_driving;
}else{
  purchase_supplies('oil', 'filter');
  drain_crankcase;
  replace_filter;
  oil_fill(15);
  $accumulated_miles=0;
}

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



Re: [PHP] function preg_match()

2006-01-25 Thread David Grant
Denyl,

You need to call the person responsible for maintaining your box.

Denyl Meneses Guillén wrote:
 sorry , what is PCRE ?

Regular Expression Functions (Perl-Compatible)

 I looking my configuration with phpinfo() and not exist PCRE or similar .

That's because someone disabled it in the ./configure step
(--disable-all).  Try using the following in the ./configure step:

--with-pcre-regex=DIR (where DIR is where PCRE's include and library
files are located)

David
-- 
David Grant
http://www.grant.org.uk/

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



Re: [PHP] Google using PHP @ http://www.google-store.com

2006-01-25 Thread ben johnson
They are using oscommerce specifically. An open source PHP shopping cart.

I have also come accross php errrors when accessing googles suggest feature,
some strange reaction with greesemonkey.

On 1/25/06, tedd [EMAIL PROTECTED] wrote:

 Looks like google are using PHP and oscommerce for their web store:
 http://www.google-store.com
 
 Nice to see :)
 
 James

 It would be nice to see them being w3c compliant, but they aren't.

 tedd

 --

 
 http://sperling.com/

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




Re: [PHP] forwarding from virtual email account to real email account

2006-01-25 Thread David Grant
Binay,

I guess you could set up PHP to listen on port 25 and rewrite the
headers of mail messages containing aliases, but that seems like a lot
of work for what could easily be handled by a (much quicker) MTA.

David
-- 
David Grant
http://www.grant.org.uk/

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



Re: [PHP] function preg_match()

2006-01-25 Thread John Nichel

Denyl Meneses Guillén wrote:

sorry , what is PCRE ?
I looking my configuration with phpinfo() and not exist PCRE or similar .


http://us2.php.net/pcre


I'm using PHPmailer and and inside it calls to function preg_match , but  i
want to run a simple example

...:: denyl.php

?php
$subject = abcdef;
$pattern = '/^def/';
preg_match($pattern, $subject, $matches, PREG_OFFSET_CAPTURE, 3);
print_r($matches);
?

and I get this :

Fatal error: Call to undefined function preg_match() in
/usr/local/apache133/htdocs/denyl.php on line 4

my phpinfo() is :
http://www.olvacourier.com/php.php

Thanks,
Denyl.


- Original Message - 
From: Melanie Maddix [EMAIL PROTECTED]

To: Denyl Meneses Guillén [EMAIL PROTECTED];
php-general@lists.php.net
Sent: Wednesday, January 25, 2006 7:56 AM
Subject: RE: [PHP] function preg_match()


[snip]
When I try to use preg_match(), I get this...

Fatal error: Call to undefined function preg_match() in
/usr/home/www/library/defines.php on line 25
[/snip]

Do you get the error with all PCRE functions?

Take a look at your PCRE settings using phpinfo().






--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

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



Re: [PHP] Google using PHP @ Google Store

2006-01-25 Thread Chris Shiflett

Dan Lowe wrote:

It's implied right on the front page it's not directly run by Google.


I'm not sure why it matters, but the real Google store appears to use ASP:

http://www.googlestore.com/home.asp

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] wrapping anchor tags around a URL

2006-01-25 Thread Ahmed Saad
On 1/23/06, Richard K Miller [EMAIL PROTECTED] wrote:

 function link_the_links($s) {
 return preg_replace('@(http://[^\s]+)@sm', 'a href=$1$1/a', $s);
 }

 I've got to somehow ignore the trailing period if it is present.

if ($s[strlen($s)-1] == '.'){
  $s = substr($s, 0, -1);
}

-ahmed


Re: [PHP] wrapping anchor tags around a URL

2006-01-25 Thread Ahmed Saad
On 1/25/06, Ahmed Saad [EMAIL PROTECTED] wrote:
 On 1/23/06, Richard K Miller [EMAIL PROTECTED] wrote:

  function link_the_links($s) {
  return preg_replace('@(http://[^\s]+)@sm', 'a href=$1$1/a', 
  $s);
  }

 if ($s[strlen($s)-1] == '.'){
   $s = substr($s, 0, -1);
 }

oops! sorry i thought $s had only one link (per time) no all of them


-ahmed


Re: [PHP] Google using PHP @ Google Store

2006-01-25 Thread Chris Shiflett

I'm not sure why it matters, but the real Google store appears to use ASP:

http://www.googlestore.com/home.asp


My mistake. Apparently there are different sites for different countries.

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] wrapping anchor tags around a URL

2006-01-25 Thread Ahmed Saad
On 1/25/06, Ahmed Saad [EMAIL PROTECTED] wrote:
 On 1/25/06, Ahmed Saad [EMAIL PROTECTED] wrote:
  On 1/23/06, Richard K Miller [EMAIL PROTECTED] wrote:
 
   function link_the_links($s) {
   return preg_replace('@(http://[^\s]+)@sm', 'a href=$1$1/a', 
   $s);
   }

try looking ahead in the first regex
http://www.regular-expressions.info/lookaround.html


-ahmed


Re: [PHP] function preg_match()

2006-01-25 Thread Richard Correia
Hey Denyl,

Simple workaround ...

you can use ereg_replace insted of preg_replace

http://www.weberdev.com/get_example.php3?Function=ereg-replace

You can sort out your PCRE installation/configuration later.

Thanks,
Richard

On 1/26/06, Denyl Meneses Guillén [EMAIL PROTECTED] wrote:

 When I try to use preg_match(), I get this...

 Fatal error: Call to undefined function preg_match() in
 /usr/home/www/library/defines.php on line 25

 I have php5.0.4 ,web server Apache (Linux)  .

 as I can solve it?

 Thanks,
 Denyl.










Re: [PHP] forwarding from virtual email account to real email account

2006-01-25 Thread Richard Correia
Are you looking for something like this?

SMTP using PHP?

http://www.weberdev.com/get_example-4295.html

Thanks
Richard

On 1/25/06, Binay [EMAIL PROTECTED] wrote:

 Hi All,


 Is it possible that we create a virtual email account(no physical
 existence) e.g [EMAIL PROTECTED] which will be associated with a real email
 account e.g. [EMAIL PROTECTED] so that if any body sends the email to virtual
 email account [EMAIL PROTECTED] will be automatically forwarded to the real
 email account [EMAIL PROTECTED] Is it achievable using PHP ? Please throw
 some light as this becoming a major requirement of my client.

 Thanks in adance,
 Binay



Re: [PHP] absolute vs relative path?

2006-01-25 Thread Richard Correia
I would suggest to keep a simple variable $HOSTNAME in your config file.

Thanks
Richard

On 1/25/06, William Stokes [EMAIL PROTECTED] wrote:

 Hello,

 I Have a web site on one server and a test site on another. How can I
 build
 the hyperlinks so that they work on both servers without modification.

 For example build this link dynamically:
 http://www.domain.com/www/test.php

 In test server the same should be:
 http://internalserver/www/test.php

 Thanks
 -Will



Re: [PHP] function preg_match()

2006-01-25 Thread Denyl Meneses Guillén
now already I can see the light
  thanks for your help,

  Denyl.

- Original Message - 
From: John Nichel [EMAIL PROTECTED]
To: php-general@lists.php.net
Sent: Wednesday, January 25, 2006 8:30 AM
Subject: Re: [PHP] function preg_match()


 Denyl Meneses Guillén wrote:
  sorry , what is PCRE ?
  I looking my configuration with phpinfo() and not exist PCRE or similar
.

 http://us2.php.net/pcre

  I'm using PHPmailer and and inside it calls to function preg_match , but
i
  want to run a simple example
 
  ...:: denyl.php
 
  ?php
  $subject = abcdef;
  $pattern = '/^def/';
  preg_match($pattern, $subject, $matches, PREG_OFFSET_CAPTURE, 3);
  print_r($matches);
  ?
 
  and I get this :
 
  Fatal error: Call to undefined function preg_match() in
  /usr/local/apache133/htdocs/denyl.php on line 4
 
  my phpinfo() is :
  http://www.olvacourier.com/php.php
 
  Thanks,
  Denyl.
 
 
  - Original Message - 
  From: Melanie Maddix [EMAIL PROTECTED]
  To: Denyl Meneses Guillén [EMAIL PROTECTED];
  php-general@lists.php.net
  Sent: Wednesday, January 25, 2006 7:56 AM
  Subject: RE: [PHP] function preg_match()
 
 
  [snip]
  When I try to use preg_match(), I get this...
 
  Fatal error: Call to undefined function preg_match() in
  /usr/home/www/library/defines.php on line 25
  [/snip]
 
  Do you get the error with all PCRE functions?
 
  Take a look at your PCRE settings using phpinfo().
 
 
 


 -- 
 John C. Nichel IV
 Programmer/System Admin (ÜberGeek)
 Dot Com Holdings of Buffalo
 716.856.9675
 [EMAIL PROTECTED]

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


 -- 
 This message has been scanned for viruses and
 dangerous content by MailScanner, and is
 believed to be clean.


 -- 
 No virus found in this incoming message.
 Checked by AVG Free Edition.
 Version: 7.1.375 / Virus Database: 267.14.22/238 - Release Date:
23/01/2006




-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

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



[PHP] Directory permissions

2006-01-25 Thread Sugrue, Sean
Does anyone know if there is a way to change permission on a directory
on a Solaris OS through php? And if there is a way authenticate the
owner of
the directory through an rlogin or su.

Sean 

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



Re: [PHP] Google using PHP @ http://www.google-store.com

2006-01-25 Thread tedd

They are using oscommerce specifically. An open source PHP shopping cart.


ben:

Not that you said or implied otherwise.

soapbox
PHP or not, there's no reason I know of for not complying with w3c -- 
especially if you're high profile like Google. It's clear that they 
are not concerned with disability issues.

/soapbox

tedd



I have also come accross php errrors when accessing googles suggest 
feature, some strange reaction with greesemonkey.


On 1/25/06, tedd mailto:[EMAIL PROTECTED][EMAIL PROTECTED] wrote:

 Looks like google are using PHP and oscommerce for their web store:

http://www.google-store.comhttp://www.google-store.com

Nice to see :)

James


It would be nice to see them being w3c compliant, but they aren't.

tedd

--

http://sperling.com/http://sperling.com/

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



--

http://sperling.com/

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



[PHP] problem with parse_str

2006-01-25 Thread dalini
version: 4.3.2

the example from:
http://de2.php.net/manual/en/function.parse-str.php

$str = first=valuearr[]=foo+bararr[]=baz;
parse_str($str);
echo $first;  // value
echo $arr[0]; // foo bar
echo $arr[1]; // baz

parse_str($str, $output);
echo $output['first'];  // value
echo $output['arr'][0]; // foo bar
echo $output['arr'][1]; // baz


produces:
valuearr[]=foo bararr[]=bazvaluearr[]=foo bararr[]=baz

or slightly modified:
for first: valuearr[]=foo bararr[]=baz
for arr[0]:
for arr[1]:


which isn't the intended behavior :/
any ideas?

greetings
dalini

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



[PHP] Get timestamp?

2006-01-25 Thread Jay Paulson
For some reason my brain isn't working correctly today.

How would I go about getting the timestamp of a day of the week from 7 weeks
ago?

In my case I'm getting the timestamp of last Sunday (no matter what day of
the week it is currently) and I want to get the timestamp of the Sunday that
happened 7 weeks ago.

$lastSunday = strtotime(last Sunday);
$Sunday7Weeks = $lastSunday - ???;

Thanks

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



Re: [PHP] PHP / Apache + Error 500

2006-01-25 Thread Gerry Danen
Interestingly, I installed mod_security the other day and noticed
error 500 show up. As it turns out, mod_security generates those when
they block nasties.

Gerry

On 1/25/06, Thomas [EMAIL PROTECTED] wrote:

 Hi there!

 I am sitting with something of a mystery and was wondering if there is
 someone out that might have dealt with this before:

 I have developed a site that runs well and fine on my machine
 (XP/Apache2/PHP5/MySQL5). I am using PEAR::HTML_Template_Flexy as well as
 Cache_Lite.

 The site has been put up on the live server and works (mostly) fine there
 too, with the exception of Internal Server errors 500, ever so often. It's
 pretty random and can happen to any of the scripts (they all run through a
 single index.php script that instantiates objects that then spit out the
 resulting html).

 I had a look at the Apache log file I got from the SP ... no clue. All I
 know is that they use Apache 1.x/PHP5/Linux/MySQL(v4?).

 They say that it is not their server but my scripts, however, if that was
 the case I would get these errors on my machine too. Also, the randomness of
 this also indicates that it can't really be my php scripts, otherwise it
 would happen all the time.

 Does anybody have any suggestion as to how I can solve this issue? I know
 this is pretty vague information, but it's all I have (hence the confusion).

 Thanks,
 Thomas


 SPIRAL EYE STUDIOS
 P.O. Box 37907, Faerie Glen, 0043

 Tel: +27 12 362 3486
 Fax: +27 12 362 3493
 Mobile: +27 82 442 9228
 Email: [EMAIL PROTECTED]
 Web: www.spiraleye.co.za

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




--
Gerry
http://portal.danen.org/

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



[PHP] Counting files in directory and subdirectory!

2006-01-25 Thread Nicholas Couloute
I want a script where it will count all the amrs in a folder and it's 
sub folders like this setup:

amrs 
50 cent  amrs
nitty  amrs
bob  amrs
How would I do this?
~Nick Couloute
co-owner/Web Designer
Sidekick2Music.Com

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



[PHP] Please Help!

2006-01-25 Thread S Yang

Dear Sir/Madam:

I am trying to split a DSA signature that is generated by openssl_sign() 
function in PHP, which should be made up of 2 numbers: r and s, but I don't 
know how to build the structure of the signature generated by PHP and then 
to split it into two numbers (r,s). Which method might I use to split the 
signature I have built in PHP into (r,s)? How can I know what the signature 
looks like? I appreciate your any helps in advance. I am looking forward to 
hearing from you.



Sincerely
Stephaney Yang
[EMAIL PROTECTED]

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



Re: [PHP] Get timestamp?

2006-01-25 Thread Philip Hallstrom

How would I go about getting the timestamp of a day of the week from 7 weeks
ago?

In my case I'm getting the timestamp of last Sunday (no matter what day of
the week it is currently) and I want to get the timestamp of the Sunday that
happened 7 weeks ago.

$lastSunday = strtotime(last Sunday);
$Sunday7Weeks = $lastSunday - ???;


$Sunday7Weeks = $lastSunday - 86400 * 7 * 7; // 86400 seconds in a day

-philip

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



Re: [PHP] Counting files in directory and subdirectory!

2006-01-25 Thread tomasz abramowicz

start here: http://www.php.net/readdir

check out as well: 'string functions' for finding 'amrs'
and loops to make recursive search...

t.

Nicholas Couloute wrote:
I want a script where it will count all the amrs in a folder and it's 
sub folders like this setup:

amrs 
50 cent  amrs
nitty  amrs
bob  amrs
How would I do this?
~Nick Couloute
co-owner/Web Designer
Sidekick2Music.Com



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



Re: [PHP] Get timestamp?

2006-01-25 Thread Max Schwanekamp

Jay Paulson wrote:
 How would I go about getting the timestamp of a day of the week from 
7 weeks

 ago?
 $lastSunday = strtotime(last Sunday);
 $Sunday7Weeks = $lastSunday - ???;

$lastsunday = strtotime(last Sunday);
$sunday7weeks = $lastsunday - (86400 * 49); // 7 weeks = 49 days

Test:
echo 'Last Sunday\'s date was '.date(m/d/y,$lastsunday);
echo 'br7 Weeks prior to Last Sunday, the date was 
'.date(m/d/y,$sunday7weeks);


--
Max Schwanekamp
http://www.neptunewebworks.com/

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



Re: [PHP] Get timestamp?

2006-01-25 Thread Max Schwanekamp

Max Schwanekamp wrote:


Jay Paulson wrote:
 How would I go about getting the timestamp of a day of the week from 
7 weeks

 ago?

$lastsunday = strtotime(last Sunday);
$sunday7weeks = $lastsunday - (86400 * 49); // 7 weeks = 49 days


Oops, that would be the sunday 7 weeks prior to _last_ Sunday, which 
would really be Sunday 8 weeks ago, so maybe change the 49 to 42...


--
Max Schwanekamp
http://www.neptunewebworks.com/

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



RE: [PHP] Counting files in directory and subdirectory!

2006-01-25 Thread Weber Sites LTD
You can start with looking at some code examples that do similar things :

Directory browser
http://www.weberdev.com/get_example-1539.html 

How to get a dir listing of the current dir of php script in an array 
http://www.weberdev.com/get_example-1855.html

filesystem Show Files Script
http://www.weberdev.com/get_example-4240.html

Sincerely 
 
berber 
 
Visit the Weber Sites Today, 
To see where PHP might take you tomorrow. 
PHP code examples : http://www.weberdev.com 
PHP  MySQL Forums : http://www.weberforums.com
Learn PHP  MySQL Playing Trivia : http://www.webertrivia.com
PHP Web Logs : http://www.weberblogs.com 
Web Development Index http://www.weberindex.com 
Web Templates http://www.webertemplates.com
Search for PHP Code from your browser http://toolbar.weberdev.com 
Free Uptime Monitor : http://uptime.weberdev.com
PHP content for your site : http://content.weber-sites.com


-Original Message-
From: Nicholas Couloute [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, January 25, 2006 9:41 PM
To: php-general@lists.php.net
Subject: [PHP] Counting files in directory and subdirectory!

I want a script where it will count all the amrs in a folder and it's sub
folders like this setup:
amrs 
50 cent  amrs
nitty  amrs
bob  amrs
How would I do this?
~Nick Couloute
co-owner/Web Designer
Sidekick2Music.Com

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

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



Re: [PHP] Re: $_SESSION saves all values but Class -- works on one server butnot another?! [second plead for help]

2006-01-25 Thread James Benson

Daevid Vincent wrote:

Thank you, but again, not the problem.

The same code is on both servers. I'm not transfering from one server to
another. Only from page to page ON THE SAME SERVER. 


This has to be a configuration problem IMHO.


-Original Message-
From: James Benson [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, January 24, 2006 3:45 PM

To: php-general@lists.php.net
Subject: [PHP] Re: $_SESSION saves all values but Class -- 
works on one server butnot another?! [second plead for help]


Take a look at the following functions:-

http://php.net/serialize
http://php.net/unserialize






Im sure if you tried those functions I suggested it will work, it does 
not matter whether you are using a different server or different page, 
with serialize it will rebuild the saved object back into how it was 
origanally and you should be able to retain the object values across 
multiple script requests!





James



-

http://www.ciwcertified.com - Master CIW Designer
http://www.zend.com - Zend Certified Engineer


http://www.jamesbenson.co.uk

-

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



[PHP] Re: forwarding from virtual email account to real email account

2006-01-25 Thread Dan Baker
Binay [EMAIL PROTECTED] wrote:
 Hi All,

 Is it possible that we create a virtual email account(no physical 
 existence) e.g [EMAIL PROTECTED]
 which will be associated with a real email account e.g. [EMAIL PROTECTED] so 
 that if any body sends
 the email to virtual email account [EMAIL PROTECTED] will be automatically 
 forwarded to the real
 email account [EMAIL PROTECTED]
 Is it achievable using PHP ?

Are you trying to process the email between [EMAIL PROTECTED] and 
[EMAIL PROTECTED] ?
And, are you trying to do that processing with PHP?
Something like a PHP file that gets launched everytime an email lands in 
[EMAIL PROTECTED] mailbox, then that PHP file loads the email, processes it, 
and forwards the processed email to [EMAIL PROTECTED]

Sounds like a cool idea.  I don't know how to do it, but sounds cool.

DanB 

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



Re: [PHP] Please Help!

2006-01-25 Thread Michael Crute
On 1/25/06, S Yang [EMAIL PROTECTED] wrote:
 Dear Sir/Madam:

 I am trying to split a DSA signature that is generated by openssl_sign()
 function in PHP, which should be made up of 2 numbers: r and s, but I don't
 know how to build the structure of the signature generated by PHP and then
 to split it into two numbers (r,s). Which method might I use to split the
 signature I have built in PHP into (r,s)? How can I know what the signature
 looks like? I appreciate your any helps in advance. I am looking forward to
 hearing from you.

http://www.catb.org/~esr/faqs/smart-questions.html

*SIGH* How many times must you tell people to use a descriptive
subject line. I swear reading ESR's how to ask questions the smart way
should be a requirement to posting on lists.

-Mike

--

Michael E. Crute
Software Developer
SoftGroup Development Corporation

Linux takes junk and turns it into something useful.
Windows takes something useful and turns it into junk.

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



Re: [PHP] Please Help!

2006-01-25 Thread Steve Clay
Wednesday, January 25, 2006, 2:52:21 PM, S Yang wrote:
  Which method might I use to split the signature I have built in PHP into
 (r,s)? How can I know what the signature looks like?

Run the function http://us2.php.net/openssl_sign and pass it a $signature.
According to the manual, if successful, $signature will be altered.  You
tell /us/ what it looks like and we'll help you split it. ;)

Steve
-- 
http://mrclay.org/

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



Re: [PHP] Counting files in directory and subdirectory!

2006-01-25 Thread Nicholas Couloute
I have used these functions but how would I count them! here is my 
attempt that doesn't work!:

$count = 0;
$dir = /amrs;
$files1 = scandir($dir);
if ($files1 !== '.'  $files1 !== '..') {
foreach ($files1 as $files2){
$dir2 = /amrs/$files2;
$files3 = scandir($dir2);
if ($files3 !== '.'  $files3 !== '..') {
foreach ($files3 as $files4){
$dir3 = /amrs/$files2/$files4;
$files5 = scandir($dir3);
if ($files5 !== '.'  $files5 !== '..') {
foreach ($files5 as $files6){
$count++;
}
}
}
}
}
}
echo $count;

~Nick Couloute
co-owner/Web Designer
Sidekick2Music.Com

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



[PHP] way to write mysqli result set to disk

2006-01-25 Thread jonathan
is there a way to write a mysqli result set to disk via  
file_put_contents or fwrite. it looks like we'd have to convert it to  
an array and then handle the array upon bringing it back in. I'm  
interested in writing a simple caching mechanism where sql results  
would be cached.


thanks,

jonathan

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



[PHP] Does file_exists() 'honour' open_basedir?

2006-01-25 Thread DRYALLS
I have 2 different PHP installs, each are slightly different versions, and 
each have different open_basedir restictions.

I have a PHP script that fails on ONE of the installs but NOT the other.

The line that fails is $foo = file_exists(/proc/loadavg);

What I don't understand is why one script fails, yet the other does not 
because NEITHER have /proc in the open_basedir path.

What could be different about the PHP configs that makes one report a PHP 
warning, yet the other does not? 

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



[PHP] News

2006-01-25 Thread dd
Your archive is attached.


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

[PHP] Use VAR string value AS VAR Name

2006-01-25 Thread Fernando Anchorena

I'm stuck trying to get  work this :

This is an example
page1.php
===
form action=/page2.php?form=yes method=post
$sql_pro =SELECT Sid FROM table;
$res_pro = @mysql_query( $sql_pro);
  while ($campo_pro = @mysql_fetch_array($res_pro)) {
  $sid_pro = $campo_pro[Sid];  //  *sid_pro = 4*
  $sid_pro = 'p'.$sid_pro; // I'm trying to use de value of 
$sid_pro as a VAR name *$sid_pro = p4*
  print td  *input name='$sid_pro' type= 'radio'  
value='SOLVE_ME'/* /td;  // *name=p4 *

   BLA BLA BLA
   }
  SUBMIT FORM
===

page2.php
===
$sqlname = SELECT Sid FROM Table;
$res = mysql_query ($sqlname) ;
while ($campo_pro = mysql_fetch_array($res)) {
   $name1 = $campo_pro[Sid];  // *$name1 = 4*
   $radio = '$'.'p'.$name1 ; // *$radio = $p4
   --
   Now the Problem
   **How can I get the Value SOLVE_ME  from the submited form ?*

   }
==


Thanks in Advance.

   


[PHP] usr VAR value as a VAR Name

2006-01-25 Thread Fernando Anchorena

I'm stuck trying to get  work this :

This is an example
page1.php
===
form action=/page2.php?form=yes method=post
$sql_pro =SELECT Sid FROM table;
$res_pro = @mysql_query( $sql_pro);
 while ($campo_pro = @mysql_fetch_array($res_pro)) {
 $sid_pro = $campo_pro[Sid];  //  *sid_pro = 4*
 $sid_pro = 'p'.$sid_pro; // I'm trying to use de value of 
$sid_pro as a VAR name *$sid_pro = p4*
 print td  *input name='$sid_pro' type= 'radio'  
value='SOLVE_ME'/* /td;  // *name=p4 *

  BLA BLA BLA
  }
 SUBMIT FORM
===

page2.php
===
$sqlname = SELECT Sid FROM Table;
$res = mysql_query ($sqlname) ;
while ($campo_pro = mysql_fetch_array($res)) {
  $name1 = $campo_pro[Sid];  // *$name1 = 4*
  $radio = '$'.'p'.$name1 ; // *$radio = $p4
  --
  Now the Problem
  **How can I get the Value SOLVE_ME  from the submited form ?*

  }
==


Thanks in Advance

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



RE: [PHP] Use VAR string value AS VAR Name

2006-01-25 Thread Mark Steudel
Either try:
$sid_pro = p.$sid_pro;

or try:

input name='.$p{$sid_pro}.' type= 'radio' value='SOLVE_ME'/


-Original Message-
From: Fernando Anchorena [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, January 25, 2006 4:12 PM
To: php-general@lists.php.net
Subject: [PHP] Use VAR string value AS VAR Name

I'm stuck trying to get  work this :

This is an example
page1.php
===
form action=/page2.php?form=yes method=post $sql_pro =SELECT Sid FROM
table; $res_pro = @mysql_query( $sql_pro);
   while ($campo_pro = @mysql_fetch_array($res_pro)) {
   $sid_pro = $campo_pro[Sid];  //  *sid_pro = 4*
   $sid_pro = 'p'.$sid_pro; // I'm trying to use de value of 
$sid_pro as a VAR name *$sid_pro = p4*
   print td  *input name='$sid_pro' type= 'radio'  
value='SOLVE_ME'/* /td;  // *name=p4 *
BLA BLA BLA
}
   SUBMIT FORM
===

page2.php
===
$sqlname = SELECT Sid FROM Table;
$res = mysql_query ($sqlname) ;
while ($campo_pro = mysql_fetch_array($res)) {
$name1 = $campo_pro[Sid];  // *$name1 = 4*
$radio = '$'.'p'.$name1 ; // *$radio = $p4
--
Now the Problem
**How can I get the Value SOLVE_ME  from the submited form ?*

}
==


Thanks in Advance.



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



RE: [PHP] usr VAR value as a VAR Name

2006-01-25 Thread Daevid Vincent
 This is an example
 page1.php
 ===
 form action=/page2.php?form=yes method=post
 $sql_pro =SELECT Sid FROM table;
 $res_pro = @mysql_query( $sql_pro);
   while ($campo_pro = @mysql_fetch_array($res_pro)) {
   $sid_pro = $campo_pro[Sid];  //  *sid_pro = 4*
   $sid_pro = 'p'.$sid_pro; // I'm trying to use de value of 
 $sid_pro as a VAR name *$sid_pro = p4*
   print td  *input name='$sid_pro' type= 'radio'  
 value='SOLVE_ME'/* /td;  // *name=p4 *
BLA BLA BLA
}

Change to: print td  *input name='.$sid_pro.' type

And this will give your input radio button a name of whatever $sid_pro is.

Let's say that is 'myradio'

Then your form will render like 
td  *input name='myradio' type

Whent the form is submitted, you would check $_POST['myradio']  (or
$_GET['myradio'])

I think there is a flaw with your logic though, as RADIO buttons must ALL be
named the same thing in a group of them and you would use the VALUE portion
instead. (only one radio button may be selected)

You could use a CHECKBOX if each one is to have a different $sid_pro name
however.

 page2.php
 ===
 $sqlname = SELECT Sid FROM Table;
 $res = mysql_query ($sqlname) ;
 while ($campo_pro = mysql_fetch_array($res)) {
$name1 = $campo_pro[Sid];  // *$name1 = 4*
$radio = '$'.'p'.$name1 ; // *$radio = $p4
--
Now the Problem
**How can I get the Value SOLVE_ME  from the submited form ?*
}

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



RE: [PHP] Use VAR string value AS VAR Name

2006-01-25 Thread Mark Steudel
Sorry I totally didn't read the question fully  

-Original Message-
From: Mark Steudel [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, January 25, 2006 4:28 PM
To: php-general@lists.php.net
Subject: RE: [PHP] Use VAR string value AS VAR Name

Either try:
$sid_pro = p.$sid_pro;

or try:

input name='.$p{$sid_pro}.' type= 'radio' value='SOLVE_ME'/


-Original Message-
From: Fernando Anchorena [mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 25, 2006 4:12 PM
To: php-general@lists.php.net
Subject: [PHP] Use VAR string value AS VAR Name

I'm stuck trying to get  work this :

This is an example
page1.php
===
form action=/page2.php?form=yes method=post $sql_pro =SELECT Sid FROM
table; $res_pro = @mysql_query( $sql_pro);
   while ($campo_pro = @mysql_fetch_array($res_pro)) {
   $sid_pro = $campo_pro[Sid];  //  *sid_pro = 4*
   $sid_pro = 'p'.$sid_pro; // I'm trying to use de value of 
$sid_pro as a VAR name *$sid_pro = p4*
   print td  *input name='$sid_pro' type= 'radio'  
value='SOLVE_ME'/* /td;  // *name=p4 *
BLA BLA BLA
}
   SUBMIT FORM
===

page2.php
===
$sqlname = SELECT Sid FROM Table;
$res = mysql_query ($sqlname) ;
while ($campo_pro = mysql_fetch_array($res)) {
$name1 = $campo_pro[Sid];  // *$name1 = 4*
$radio = '$'.'p'.$name1 ; // *$radio = $p4
--
Now the Problem
**How can I get the Value SOLVE_ME  from the submited form ?*

}
==


Thanks in Advance.



--
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] way to write mysqli result set to disk

2006-01-25 Thread Curt Zirzow
On Wed, Jan 25, 2006 at 03:39:38PM -0800, jonathan wrote:
 is there a way to write a mysqli result set to disk via  
 file_put_contents or fwrite. it looks like we'd have to convert it to  
 an array and then handle the array upon bringing it back in. I'm  
 interested in writing a simple caching mechanism where sql results  
 would be cached.

Mysql can do all this for you.. see:

  http://mysql.com/sql_cache

Curt.
-- 
cat .signature: No such file or directory

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



Re: [PHP] way to write mysqli result set to disk

2006-01-25 Thread jonathan
hmm is this a mysql 5 feature. could be interesting but haven't  
heard much about it.


-j
On Jan 25, 2006, at 5:24 PM, Curt Zirzow wrote:


On Wed, Jan 25, 2006 at 03:39:38PM -0800, jonathan wrote:

is there a way to write a mysqli result set to disk via
file_put_contents or fwrite. it looks like we'd have to convert it to
an array and then handle the array upon bringing it back in. I'm
interested in writing a simple caching mechanism where sql results
would be cached.


Mysql can do all this for you.. see:

  http://mysql.com/sql_cache

Curt.
--
cat .signature: No such file or directory

--
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: usr VAR value as a VAR Name

2006-01-25 Thread James Benson




if(isset($_POST['NAME_OF_FORM_VALUE'])) {
  // radio button was selected
}




Fernando Anchorena wrote:

I'm stuck trying to get  work this :

This is an example
page1.php
===
form action=/page2.php?form=yes method=post
$sql_pro =SELECT Sid FROM table;
$res_pro = @mysql_query( $sql_pro);
 while ($campo_pro = @mysql_fetch_array($res_pro)) {
 $sid_pro = $campo_pro[Sid];  //  *sid_pro = 4*
 $sid_pro = 'p'.$sid_pro; // I'm trying to use de value of 
$sid_pro as a VAR name *$sid_pro = p4*
 print td  *input name='$sid_pro' type= 'radio'  
value='SOLVE_ME'/* /td;  // *name=p4 *

  BLA BLA BLA
  }
 SUBMIT FORM
===

page2.php
===
$sqlname = SELECT Sid FROM Table;
$res = mysql_query ($sqlname) ;
while ($campo_pro = mysql_fetch_array($res)) {
  $name1 = $campo_pro[Sid];  // *$name1 = 4*
  $radio = '$'.'p'.$name1 ; // *$radio = $p4
  --
  Now the Problem
  **How can I get the Value SOLVE_ME  from the submited form ?*

  }
==


Thanks in Advance


--



-

http://www.ciwcertified.com - Master CIW Designer
http://www.zend.com - Zend Certified Engineer


http://www.jamesbenson.co.uk

-

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



Re: [PHP] way to write mysqli result set to disk

2006-01-25 Thread James Benson

jonathan wrote:
hmm is this a mysql 5 feature. could be interesting but haven't 
heard much about it.






You cannot see the mysql 5 plastered all over the page?


I can see at least 5 different sections that say MySQL 5

James

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



Re: [PHP] way to write mysqli result set to disk

2006-01-25 Thread David Hall

James Benson wrote:

jonathan wrote:
hmm is this a mysql 5 feature. could be interesting but haven't 
heard much about it.






You cannot see the mysql 5 plastered all over the page?


I can see at least 5 different sections that say MySQL 5



you obviously don't use the mysql website enough to know that just cause 
you're looking in the mysql 5 manual, its a mysql 5 feature. 
http://dev.mysql.com/doc/refman/4.1/en/query-cache-in-select.html
That's proof it was before mysql 5, because mysql 5 isn't plastered 
everywhere . . .


Your reply was rude and unintelligent

(Oh noes . . . http://dev.mysql.com/doc/refman/5.1/en/select.html Select 
statements are a mysql 5.1 only feature.  We're gonna die . . .)



David Hall

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



[PHP] php -w causes a parse error

2006-01-25 Thread Bom Demais
I wanted to run php -w on my include files on the live server to reduce
overhead.  But php -w causes parse errors in the include files.  Here's an
example of what happens:

tanner /php_files
% php -l misc.inc
No syntax errors detected in misc.inc
tanner /php_files
% php -w misc.inc  misc.stripped.inc
tanner /php_files
% php -l misc.stripped.inc
PHP Parse error:  parse error, unexpected '', expecting ']' in
misc.stripped.inc on line 2

Parse error: parse error, unexpected '', expecting ']' in misc.stripped.inc
on line 2
Errors parsing misc.stripped.inc


Of course i try to look at line 2 to see what the error is, but now the
whole file is on line 2, so there's no way to know what's breaking!

please let me know if you have any suggestions.

Thanks!

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



Re: [PHP] way to write mysqli result set to disk

2006-01-25 Thread PHP Superman
couldn't you serialize the data and store it?

On 1/25/06, David Hall [EMAIL PROTECTED] wrote:

 James Benson wrote:
  jonathan wrote:
  hmm is this a mysql 5 feature. could be interesting but haven't
  heard much about it.
 
 
 
 
  You cannot see the mysql 5 plastered all over the page?
 
 
  I can see at least 5 different sections that say MySQL 5
 

 you obviously don't use the mysql website enough to know that just cause
 you're looking in the mysql 5 manual, its a mysql 5 feature.
 http://dev.mysql.com/doc/refman/4.1/en/query-cache-in-select.html
 That's proof it was before mysql 5, because mysql 5 isn't plastered
 everywhere . . .

 Your reply was rude and unintelligent

 (Oh noes . . . http://dev.mysql.com/doc/refman/5.1/en/select.html Select
 statements are a mysql 5.1 only feature.  We're gonna die . . .)


 David Hall

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




--
Hi Everyone, I am running PHP 5 on Windosws XP SP2 with MySQL5, Bye Now!


Re: [PHP] Counting files in directory and subdirectory!

2006-01-25 Thread Nicholas Couloute
here is what I tried but it doesn't work! any advice suggestions or 
something?


$count = 0;
$dir = /amrs;
$files1 = scandir($dir);
if ($files1 !== '.'  $files1 !== '..') {
foreach ($files1 as $files2){
$dir2 = /amrs/$files2;
$files3 = scandir($dir2);
if ($files3 !== '.'  $files3 !== '..') {
foreach ($files3 as $files4){
$dir3 = /amrs/$files2/$files4;
$files5 = scandir($dir3);
if ($files5 !== '.'  $files5 !== '..') {
foreach ($files5 as $files6){
$count++;
}
}
}
}
}
}
echo $count;
~Nick Couloute
co-owner/Web Designer
Sidekick2Music.Com

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



[PHP] Re: php -w causes a parse error

2006-01-25 Thread Greg Beaver
Bom Demais wrote:
 I wanted to run php -w on my include files on the live server to reduce
 overhead.  But php -w causes parse errors in the include files.  Here's an
 example of what happens:
 
 tanner /php_files
 % php -l misc.inc
 No syntax errors detected in misc.inc
 tanner /php_files
 % php -w misc.inc  misc.stripped.inc
 tanner /php_files
 % php -l misc.stripped.inc
 PHP Parse error:  parse error, unexpected '', expecting ']' in
 misc.stripped.inc on line 2
 
 Parse error: parse error, unexpected '', expecting ']' in misc.stripped.inc
 on line 2
 Errors parsing misc.stripped.inc
 
 
 Of course i try to look at line 2 to see what the error is, but now the
 whole file is on line 2, so there's no way to know what's breaking!
 
 please let me know if you have any suggestions.

My suggestion: don't try to reduce overhead by eliminating whitespace.
Take two approaches instead:

1) try to optimize by simplifying how your website does things (don't
use 30 objects and a 4000-line script just to display a template)
2) try to optimize database use (only use it where necessary, and
optimize queries) and optimize page generation by using a cache if necessary
3) ask your host provider to install a bytecode cache like Zend
Optimizer or APC.

If they have installed one already, your best efforts with php -w will
result in identical running times, and as you noted, make it impossible
to debug any problems.

Best of luck,
Greg

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



Re: [PHP] way to write mysqli result set to disk

2006-01-25 Thread Russell Jones
It may be better to go ahead and convert it to an array, or something that
can be handled more quickly when the cache is pulled than interpreting the
result again and again and again... Really dont know, just a thought.

On 1/25/06, jonathan [EMAIL PROTECTED] wrote:

 is there a way to write a mysqli result set to disk via
 file_put_contents or fwrite. it looks like we'd have to convert it to
 an array and then handle the array upon bringing it back in. I'm
 interested in writing a simple caching mechanism where sql results
 would be cached.

 thanks,

 jonathan

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




Re: [PHP] wrapping anchor tags around a URL

2006-01-25 Thread Richard K Miller


On Jan 25, 2006, at 10:01 AM, Ahmed Saad wrote:


On 1/25/06, Ahmed Saad [EMAIL PROTECTED] wrote:

On 1/25/06, Ahmed Saad [EMAIL PROTECTED] wrote:

On 1/23/06, Richard K Miller [EMAIL PROTECTED] wrote:


function link_the_links($s) {
return preg_replace('@(http://[^\s]+)@sm', 'a href=$1 
$1/a', $s);

}


try looking ahead in the first regex
http://www.regular-expressions.info/lookaround.html



Wow, I was really glad you found that.  I had never heard of this  
before, but it looks like the solution.


However, my real life example still isn't working, even after adding  
what I think was the right look-ahead expression:


@(http://\S+)(?!\.)@   -- this still captures everything

@(http://\S+?)(?!\.)@-- this captures too little

Any ideas?  In any case, thanks for the article -- that was informative.

Richard

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



Re: [PHP] Counting files in directory and subdirectory!

2006-01-25 Thread David Tulloh
That is some nasty code...
Anything that has repitition like that needs a substantial rewrite, but
I'm guessing that you know that, hence the e-mail.

I just knocked up the following function, powered by the magic of
recursion.  It should be close to what you were trying to do.


function count_files($path) {
$number_of_files = 0;
foreach(scandir($path) as $dir) {
if($dir{0} == '.') continue; # Ignore hidden files
if(is_dir($path.'/'.$dir))
$number_of_files += count_files($path.'/'.$dir);
else
$number_of_files++;
}
return $number_of_files;
}

echo count_files(amrs);



David

Nicholas Couloute wrote:
 here is what I tried but it doesn't work! any advice suggestions or
 something?
 
 $count = 0;
 $dir = /amrs;
 $files1 = scandir($dir);
 if ($files1 !== '.'  $files1 !== '..') {
 foreach ($files1 as $files2){
 $dir2 = /amrs/$files2;
 $files3 = scandir($dir2);
 if ($files3 !== '.'  $files3 !== '..') {
 foreach ($files3 as $files4){
 $dir3 = /amrs/$files2/$files4;
 $files5 = scandir($dir3);
 if ($files5 !== '.'  $files5 !== '..') {
 foreach ($files5 as $files6){
 $count++;
 }
 }
 }
 }
 }
 }
 echo $count;
 ~Nick Couloute
 co-owner/Web Designer
 Sidekick2Music.Com
 

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



Re: [PHP] way to write mysqli result set to disk

2006-01-25 Thread Curt Zirzow
On Wed, Jan 25, 2006 at 09:51:15PM -0500, PHP Superman wrote:
 couldn't you serialize the data and store it?

you could, but the purpose of my reply to the OT is that there are
other solutions to caching instead of inventing your own

Caching things isn't the simplest of things, consider how much
trouble a browser goes through just to keep a file in its cache,
and how it knows to update the cache. Considering Hitting on
Firefox:

  Refresh button: uses cache files it knows it should cache
  Refresh with Ctrl: requests new versions of files if now new
  version exists, use the cache version
  Refresh with Ctrl-Shft: screw the cache, i want to get 
  everything no matter what.
  
You have to be aware of things like:
  What do i cache:
  - how do i keep track of that
  - where do i store it at
  - what unique filename can i store it in.

  is the data i have stored ok to use
  - when does this data expire
  - how do I know when it expires
  - if I know how when it expires i need to record that somewhere

  I'm using outdated data
  - is the data i have been updated
  - how do I know if there has been a data update
  - how do I keep track of what time i got this data
  - how do I know if there is a change
  - how do you check if it should be updated

  Has the structure changed
  - how do i know a structure has changed
  - ditto everything in expire and outdated sections

Of course there are probaly even more issues that could be
mentioned but, at this point i'm wondering why the query results
are so slow that a self cache system is even needed.

If you can use the databases built in cache method it can save a
lot of headache trying to hack together some code that checks for
data changes against your version, table structure changes against
your version. Not to mention indexing.


Curt.
-- 
cat .signature: No such file or directory

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



Re: [PHP] way to write mysqli result set to disk

2006-01-25 Thread Curt Zirzow
On Thu, Jan 26, 2006 at 02:11:02AM +, James Benson wrote:
 jonathan wrote:
 hmm is this a mysql 5 feature. could be interesting but haven't 
 heard much about it.
 
 
 
 
 You cannot see the mysql 5 plastered all over the page?

The link i gave is designed to give information about the latest
recommended version of mysql.

I guess i could have went and hunted down the exact version that
mysql started supporting sql_cache, perhaps i'm just lazy.

Curt.
-- 
cat .signature: No such file or directory

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



Re: [PHP] way to write mysqli result set to disk

2006-01-25 Thread Curt Zirzow
On Wed, Jan 25, 2006 at 05:22:35PM -0800, jonathan wrote:
 hmm is this a mysql 5 feature. could be interesting but haven't  
 heard much about it.

No, the link i gave just does a redirect to the current stable
release documentation, mysql has docs for the major releases and
what each one supports.

I know for sure that 4.1 supports sql_cache, 4.0 mabey.  

In summary suppose you have a query:

  select SQL_CACHE * from table where name like '%foo%'

And considering the first query will take about .50 seconds to
execute, the next query that matches that takes about .0001
seconds.

The Query Cache can get complicated be sure to read all the docs on
it.

Curt.
-- 
cat .signature: No such file or directory

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