[PHP] maintaining session information

2007-08-16 Thread Vic Agnews
is there a way we can maintain session information across two sub-domains
(on two different servers though)  ... kinda like how google does it?
- vic


Re: [PHP] maintaining session information

2007-08-16 Thread Vic Agnews
Thanks for the suggestions guys  I appreciate the help! I guess I'll
look into creating a custom session handler. Any good references?
How my current setup works is, there's session information for
sub-domain1.domain.com stored in a cookie and I want
sub-domain2.domain.com(which currently does not have
authentication/sessions) to be able to read
that cookie and find out who the user is. I read somewhere that you could do
this either by using an apache module or .htaccess files or configuring
php.ini ...

- Vic


On 8/16/07, Chris [EMAIL PROTECTED] wrote:

 Vic Agnews wrote:
  is there a way we can maintain session information across two
 sub-domains
  (on two different servers though)  ... kinda like how google does it?

 Might have to use a 3rd party cookie  possibly a custom session handler.

 A cookie created on 'domain.com' cannot be read by any subdomains
 (including 'www.domain.com').

 A 3rd party cookie (on 'www.domain2.com') can be used in both cases and
 it's independent so shouldn't have a problem being read.

 --
 Postgresql  php tutorials
 http://www.designmagick.com/



Re: [PHP] maintaining session information

2007-08-16 Thread Vic Agnews
Thanks again for the reply ... i will look into session_set_save_handler. I
also did some research on SSO and OpenID (phpMyID) ... sounds like an
interesting concept!

- Vic

On 8/16/07, Chris [EMAIL PROTECTED] wrote:

 Vic Agnews wrote:
  Thanks for the suggestions guys  I appreciate the help! I guess I'll
  look into creating a custom session handler. Any good references?

 http://php.net/session_set_save_handler shows an example.

  How my current setup works is, there's session information for
  sub-domain1.domain.com http://sub-domain1.domain.com stored in a
  cookie and I want sub-domain2.domain.com http://sub-domain2.domain.com
  (which currently does not have authentication/sessions) to be able to
  read that cookie and find out who the user is. I read somewhere that you
  could do this either by using an apache module or .htaccess files or
  configuring php.ini ...

 AFAIK that's completely wrong. Your browser holds the cookie and it
 works out the security of which domain can read which cookie.

 --
 Postgresql  php tutorials
 http://www.designmagick.com/



RE: [PHP] ftp_problem - ... php_network_getaddresses: getaddrinfo failed: ...

2002-10-25 Thread vic
Ok, found problem, script ok, but a $_POST['...']; needed to be added to
the secure script as it was taking the pass from a form.

- Victor | www.argilent.com  

-Original Message-
From: victor [mailto:victor;argilent.com] 
Sent: Saturday, October 26, 2002 12:34 AM
To: [EMAIL PROTECTED]
Subject: [PHP] ftp_problem - ... php_network_getaddresses: getaddrinfo
failed: ...

Any tips on trouble shooting this problem?

Warning: php_network_getaddresses: getaddrinfo failed: Name or
service not known in /xxx/xxx/xxx/xxx/new_user.php on line 121
Could not establish FTP connection.

This is the code the error refers to:

# set up basic connection
$conn_id = ftp_connect($ftp_server)
or die ('Could not establish FTP connection.');

The config file is somewhere else on the server - outside the public dir
for sec. reasons.

The info is correct. - I cannot divulge it, but it is correct (or let's
assume it is), so where to now???

- Victor | www.argilent.com  


__ 
Post your free ad now! http://personals.yahoo.ca

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

__ 
Post your free ad now! http://personals.yahoo.ca

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




[PHP] ftp_problem - ... php_network_getaddresses: getaddrinfo failed: ...

2002-10-25 Thread vic
Never mind, problem NOT solved, I made an error in an earlier script and
that error interrupted this one so I thought it cleared, but alas, it
did not, so help still needed, if available, thanks.

- Victor | www.argilent.com  

-Original Message-
From: vic [mailto:siliconhype;yahoo.ca] 
Sent: Saturday, October 26, 2002 12:48 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: [PHP] ftp_problem - ... php_network_getaddresses:
getaddrinfo failed: ...

Ok, found problem, script ok, but a $_POST['...']; needed to be added to
the secure script as it was taking the pass from a form.

- Victor | www.argilent.com  

-Original Message-
From: victor [mailto:victor;argilent.com] 
Sent: Saturday, October 26, 2002 12:34 AM
To: [EMAIL PROTECTED]
Subject: [PHP] ftp_problem - ... php_network_getaddresses: getaddrinfo
failed: ...

Any tips on trouble shooting this problem?

Warning: php_network_getaddresses: getaddrinfo failed: Name or
service not known in /xxx/xxx/xxx/xxx/new_user.php on line 121
Could not establish FTP connection.

This is the code the error refers to:

# set up basic connection
$conn_id = ftp_connect($ftp_server)
or die ('Could not establish FTP connection.');

The config file is somewhere else on the server - outside the public dir
for sec. reasons.

The info is correct. - I cannot divulge it, but it is correct (or let's
assume it is), so where to now???

- Victor | www.argilent.com  


__ 
Post your free ad now! http://personals.yahoo.ca

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

__ 
Post your free ad now! http://personals.yahoo.ca

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

__ 
Post your free ad now! http://personals.yahoo.ca

__ 
Post your free ad now! http://personals.yahoo.ca

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




RE: [PHP] ftp_problem - ... php_network_getaddresses: getaddrinfo failed: ...

2002-10-25 Thread vic
Could this be the problem?

From the pho.net documentation on ftp_connect():



I think what some other posts were trying to say which may need
clarification is that in PHP 4.2.3, ftp_connect(myhost.com) was
failing most of the time, except it would work like every few minutes.

The fix is that ftp_connect seems to have a bug resolving addresses. If
you do:

$hostip = gethostbyname($host);
$conn_id = ftp_connect($hostip);

It seems to solve the problem.
(Other users referred to an ftpbuf() error... not sure what that is, but
this should fix it.)



- Victor | www.argilent.com  

-Original Message-
From: John Nichel [mailto:jnichel;by-tor.com] 
Sent: Saturday, October 26, 2002 1:07 AM
To: vic
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] ftp_problem - ... php_network_getaddresses:
getaddrinfo failed: ...

Can you ftp to the site from the box that the script is running on (via 
command line or GUI client)?

vic wrote:
 Never mind, problem NOT solved, I made an error in an earlier script
and
 that error interrupted this one so I thought it cleared, but alas, it
 did not, so help still needed, if available, thanks.
 
 - Victor | www.argilent.com  
 
 -Original Message-
 From: vic [mailto:siliconhype;yahoo.ca] 
 Sent: Saturday, October 26, 2002 12:48 AM
 To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Subject: RE: [PHP] ftp_problem - ... php_network_getaddresses:
 getaddrinfo failed: ...
 
 Ok, found problem, script ok, but a $_POST['...']; needed to be added
to
 the secure script as it was taking the pass from a form.
 
 - Victor | www.argilent.com  
 
 -Original Message-
 From: victor [mailto:victor;argilent.com] 
 Sent: Saturday, October 26, 2002 12:34 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] ftp_problem - ... php_network_getaddresses: getaddrinfo
 failed: ...
 
 Any tips on trouble shooting this problem?
 
   Warning: php_network_getaddresses: getaddrinfo failed: Name or
 service   not known in /xxx/xxx/xxx/xxx/new_user.php on line 121
   Could not establish FTP connection.
 
 This is the code the error refers to:
 
   # set up basic connection
   $conn_id = ftp_connect($ftp_server)
   or die ('Could not establish FTP connection.');
 
 The config file is somewhere else on the server - outside the public
dir
 for sec. reasons.
 
 The info is correct. - I cannot divulge it, but it is correct (or
let's
 assume it is), so where to now???
 
 - Victor | www.argilent.com  
 
 
 __

 Post your free ad now! http://personals.yahoo.ca
 



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

__ 
Post your free ad now! http://personals.yahoo.ca

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




RE: [PHP] ftp_problem - ... php_network_getaddresses: getaddrinfo failed: ...

2002-10-25 Thread vic
So I tried this and I still get the setup id error. And to
answer your question I have to get SSL going but there is too much work
for that tonight, and my server doesn't allow telneting without SSL (and
good for them).

# set up basic connection
$hostip = gethostbyname($ftp_server)
or die ('Could not get FRP server IP');

echo ($hostip); 
# this apparently only adds ftp. before $ftp_server

$conn_id = ftp_connect($hostip)
or die ('Could not establish FTP connection.');

- Victor | www.argilent.com  

-Original Message-
From: vic [mailto:siliconhype;yahoo.ca] 
Sent: Saturday, October 26, 2002 1:30 AM
To: 'John Nichel'
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] ftp_problem - ... php_network_getaddresses:
getaddrinfo failed: ...

Could this be the problem?

From the pho.net documentation on ftp_connect():



I think what some other posts were trying to say which may need
clarification is that in PHP 4.2.3, ftp_connect(myhost.com) was
failing most of the time, except it would work like every few minutes.

The fix is that ftp_connect seems to have a bug resolving addresses. If
you do:

$hostip = gethostbyname($host);
$conn_id = ftp_connect($hostip);

It seems to solve the problem.
(Other users referred to an ftpbuf() error... not sure what that is, but
this should fix it.)



- Victor | www.argilent.com  

-Original Message-
From: John Nichel [mailto:jnichel;by-tor.com] 
Sent: Saturday, October 26, 2002 1:07 AM
To: vic
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] ftp_problem - ... php_network_getaddresses:
getaddrinfo failed: ...

Can you ftp to the site from the box that the script is running on (via 
command line or GUI client)?

vic wrote:
 Never mind, problem NOT solved, I made an error in an earlier script
and
 that error interrupted this one so I thought it cleared, but alas, it
 did not, so help still needed, if available, thanks.
 
 - Victor | www.argilent.com  
 
 -Original Message-
 From: vic [mailto:siliconhype;yahoo.ca] 
 Sent: Saturday, October 26, 2002 12:48 AM
 To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Subject: RE: [PHP] ftp_problem - ... php_network_getaddresses:
 getaddrinfo failed: ...
 
 Ok, found problem, script ok, but a $_POST['...']; needed to be added
to
 the secure script as it was taking the pass from a form.
 
 - Victor | www.argilent.com  
 
 -Original Message-
 From: victor [mailto:victor;argilent.com] 
 Sent: Saturday, October 26, 2002 12:34 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] ftp_problem - ... php_network_getaddresses: getaddrinfo
 failed: ...
 
 Any tips on trouble shooting this problem?
 
   Warning: php_network_getaddresses: getaddrinfo failed: Name or
 service   not known in /xxx/xxx/xxx/xxx/new_user.php on line 121
   Could not establish FTP connection.
 
 This is the code the error refers to:
 
   # set up basic connection
   $conn_id = ftp_connect($ftp_server)
   or die ('Could not establish FTP connection.');
 
 The config file is somewhere else on the server - outside the public
dir
 for sec. reasons.
 
 The info is correct. - I cannot divulge it, but it is correct (or
let's
 assume it is), so where to now???
 
 - Victor | www.argilent.com  
 
 
 __

 Post your free ad now! http://personals.yahoo.ca
 



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

__ 
Post your free ad now! http://personals.yahoo.ca

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

__ 
Post your ad for free now! http://personals.yahoo.ca

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




RE: [PHP] ftp_problem - ... php_network_getaddresses: getaddrinfo failed: ...

2002-10-25 Thread vic
By: ...ll get the setup id error. And to answ... I meant ... stupid


- Victor | www.argilent.com  

-Original Message-
From: vic [mailto:siliconhype;yahoo.ca] 
Sent: Saturday, October 26, 2002 1:36 AM
To: 'vic'; 'John Nichel'
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] ftp_problem - ... php_network_getaddresses:
getaddrinfo failed: ...

So I tried this and I still get the setup id error. And to
answer your question I have to get SSL going but there is too much work
for that tonight, and my server doesn't allow telneting without SSL (and
good for them).

# set up basic connection
$hostip = gethostbyname($ftp_server)
or die ('Could not get FRP server IP');

echo ($hostip); 
# this apparently only adds ftp. before $ftp_server

$conn_id = ftp_connect($hostip)
or die ('Could not establish FTP connection.');

- Victor | www.argilent.com  

-Original Message-
From: vic [mailto:siliconhype;yahoo.ca] 
Sent: Saturday, October 26, 2002 1:30 AM
To: 'John Nichel'
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] ftp_problem - ... php_network_getaddresses:
getaddrinfo failed: ...

Could this be the problem?

From the pho.net documentation on ftp_connect():



I think what some other posts were trying to say which may need
clarification is that in PHP 4.2.3, ftp_connect(myhost.com) was
failing most of the time, except it would work like every few minutes.

The fix is that ftp_connect seems to have a bug resolving addresses. If
you do:

$hostip = gethostbyname($host);
$conn_id = ftp_connect($hostip);

It seems to solve the problem.
(Other users referred to an ftpbuf() error... not sure what that is, but
this should fix it.)



- Victor | www.argilent.com  

-Original Message-
From: John Nichel [mailto:jnichel;by-tor.com] 
Sent: Saturday, October 26, 2002 1:07 AM
To: vic
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] ftp_problem - ... php_network_getaddresses:
getaddrinfo failed: ...

Can you ftp to the site from the box that the script is running on (via 
command line or GUI client)?

vic wrote:
 Never mind, problem NOT solved, I made an error in an earlier script
and
 that error interrupted this one so I thought it cleared, but alas, it
 did not, so help still needed, if available, thanks.
 
 - Victor | www.argilent.com  
 
 -Original Message-
 From: vic [mailto:siliconhype;yahoo.ca] 
 Sent: Saturday, October 26, 2002 12:48 AM
 To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Subject: RE: [PHP] ftp_problem - ... php_network_getaddresses:
 getaddrinfo failed: ...
 
 Ok, found problem, script ok, but a $_POST['...']; needed to be added
to
 the secure script as it was taking the pass from a form.
 
 - Victor | www.argilent.com  
 
 -Original Message-
 From: victor [mailto:victor;argilent.com] 
 Sent: Saturday, October 26, 2002 12:34 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] ftp_problem - ... php_network_getaddresses: getaddrinfo
 failed: ...
 
 Any tips on trouble shooting this problem?
 
   Warning: php_network_getaddresses: getaddrinfo failed: Name or
 service   not known in /xxx/xxx/xxx/xxx/new_user.php on line 121
   Could not establish FTP connection.
 
 This is the code the error refers to:
 
   # set up basic connection
   $conn_id = ftp_connect($ftp_server)
   or die ('Could not establish FTP connection.');
 
 The config file is somewhere else on the server - outside the public
dir
 for sec. reasons.
 
 The info is correct. - I cannot divulge it, but it is correct (or
let's
 assume it is), so where to now???
 
 - Victor | www.argilent.com  
 
 
 __

 Post your free ad now! http://personals.yahoo.ca
 



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

__ 
Post your free ad now! http://personals.yahoo.ca

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

__ 
Post your ad for free now! http://personals.yahoo.ca

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

__ 
Post your free ad now! http://personals.yahoo.ca

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




RE: [PHP] Re: php on apache on win2k

2002-09-28 Thread Vic

Thanks, I got the zip file that I needed. No it works fine, thanks.

- Victor - www.argilent.com  

-Original Message-
From: Brian McGarvie [mailto:[EMAIL PROTECTED]] 
Sent: Friday, September 27, 2002 3:01 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: php on apache on win2k

on www.php.net you need to download the zip file for php, this will
include
the missing files...

Vic [EMAIL PROTECTED] wrote in message
01c265e6$c3a2b920$a3a96518@jumpy">news:01c265e6$c3a2b920$a3a96518@jumpy...
 I used to have php 4.2.3 on iis on 200 and xp and it worked fine, but
I
 decided o now go with apache for open source's sake and the sake of my
 sanity.

 Well right now my sanity is in question, php tells me that I have to
 manually config the apache conf file - no prob here done this many
 times; but it tells me to add theis line here:

 LoadModule php4_module c:/php/sapi/php4apache.dll

 Now I don't see php4apache.dll anywhere in sight.

 What I do see is: php4ts.dll; and I wonder if the documentation is
 outdated. - (or if I am a complete fool)

 Either way I get this error when running the apache test:

 Cannot load blah blah module blah blah LoadModule php4_module
 c:/php/sapi/php4apache.dll

 Not only that, but I see no sapi anywhere in c:/php/

 Ok, cool, now what? Any help?

 - Victor - www.argilent.com


 ---
 Outgoing mail is certified Virus Free.
 Checked by AVG anti-virus system (http://www.grisoft.com).
 Version: 6.0.391 / Virus Database: 222 - Release Date: 9/19/2002


 __
 Post your ad for free now! http://personals.yahoo.ca



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

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.391 / Virus Database: 222 - Release Date: 9/19/2002
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.391 / Virus Database: 222 - Release Date: 9/19/2002
 

__ 
Post your ad for free now! http://personals.yahoo.ca

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




[PHP] php on apache on win2k

2002-09-26 Thread Vic

I used to have php 4.2.3 on iis on 200 and xp and it worked fine, but I
decided o now go with apache for open source's sake and the sake of my
sanity.

Well right now my sanity is in question, php tells me that I have to
manually config the apache conf file - no prob here done this many
times; but it tells me to add theis line here:

LoadModule php4_module c:/php/sapi/php4apache.dll

Now I don't see php4apache.dll anywhere in sight.

What I do see is: php4ts.dll; and I wonder if the documentation is
outdated. - (or if I am a complete fool)

Either way I get this error when running the apache test:

Cannot load blah blah module blah blah LoadModule php4_module
c:/php/sapi/php4apache.dll

Not only that, but I see no sapi anywhere in c:/php/

Ok, cool, now what? Any help?

- Victor - www.argilent.com  


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.391 / Virus Database: 222 - Release Date: 9/19/2002
 

__ 
Post your ad for free now! http://personals.yahoo.ca

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




RE: [PHP] preg_match help?

2002-08-17 Thread vic

Ok, since I've been trying to get this working forever, how wold you get
something like this working I need, to get everything between these 2
tags:

div class=Section1 and /div

Someone gave me this code:

preg_match('!div class=Section1[^]+(.*)/div!Uis',$str,$regs);

with the ! in front, and !Uis at the end, what does that mean? 

And when i try it with your script:

preg_match('/.*div class=Section1[^]+(.*)/div.*/',$str,$regs);
$good = $regs[1];
echo $good;


I get:

Warning: Unknown modifier 'd' in
/home/victor/argilent-www/sites/malibu_place_2/main.php on line 197

197 is the preg_match code line.

- Vic


-Original Message-
From: Bas Jobsen [mailto:[EMAIL PROTECTED]] 
Sent: Saturday, August 17, 2002 6:49 PM
To: Jason Soza; PHP-General
Subject: Re: [PHP] preg_match help?

preg_match(/.*b[^]+(.*)font face=\Verdana\ size=\3\.*/, 
$contents,$story);
echo $story[1];

preg_match always return a array. The first element ($array[0])contains
your 
complete regexp. The next ($array[1])one the first match between () etc.
Don't use ! but /




Op zondag 18 augustus 2002 01:27, schreef Jason Soza:
 I seriously need some help trying to make a match here. Obligatory
 disclaimer: yes, I've searched google.com, I've read the PHP manual
section
 on preg_match(), and I've sat here for 3 hours trying to resolve this
on my
 own. :) Any help would be great:

 I need to match everything between:

 b$headline

 Where $headline is a variable that will be filled out of a foreach()
loop.
 The pattern should return everything until it hits:

 font face=Verdana size=3

 The text file this is taken out of looks like:

 font face=Verdana size=3bHeadline here/b/fontp

 News story, blah, blah, blah...

 font face=Verdana size=3bAnother headline/b/fontp

 More news, blah, blah...

 ...

 The contents of the text file echo correctly before the preg_match,
but the
 preg_match I've tried:

 preg_match(!b[^]+(.*)font face=\Verdana\ size=\3\!,
$contents,
 $story);

 Returns array(), so no matches are made. Any suggestions?

 TIA,

 Jason Soza

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

__ 
Post your ad for free now! http://personals.yahoo.ca

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




RE: [PHP] preg_match help?

2002-08-17 Thread vic

 Actually I made a mistake, I get nothing, which might mean that I am
looking for the wrong thing in ereg preg match, or I don't know ,much
about reg exp and that space is throwing it off 

I dunno.. 

- Vic


-Original Message-
From: vic [mailto:[EMAIL PROTECTED]] 
Sent: Saturday, August 17, 2002 8:30 PM
To: [EMAIL PROTECTED]; 'Jason Soza'; 'PHP-General'
Subject: RE: [PHP] preg_match help?

Ok, since I've been trying to get this working forever, how wold you get
something like this working I need, to get everything between these 2
tags:

div class=Section1 and /div

Someone gave me this code:

preg_match('!div class=Section1[^]+(.*)/div!Uis',$str,$regs);

with the ! in front, and !Uis at the end, what does that mean? 

And when i try it with your script:

preg_match('/.*div class=Section1[^]+(.*)/div.*/',$str,$regs);
$good = $regs[1];
echo $good;


I get:

Warning: Unknown modifier 'd' in
/home/victor/argilent-www/sites/malibu_place_2/main.php on line 197

197 is the preg_match code line.

- Vic


-Original Message-
From: Bas Jobsen [mailto:[EMAIL PROTECTED]] 
Sent: Saturday, August 17, 2002 6:49 PM
To: Jason Soza; PHP-General
Subject: Re: [PHP] preg_match help?

preg_match(/.*b[^]+(.*)font face=\Verdana\ size=\3\.*/, 
$contents,$story);
echo $story[1];

preg_match always return a array. The first element ($array[0])contains
your 
complete regexp. The next ($array[1])one the first match between () etc.
Don't use ! but /




Op zondag 18 augustus 2002 01:27, schreef Jason Soza:
 I seriously need some help trying to make a match here. Obligatory
 disclaimer: yes, I've searched google.com, I've read the PHP manual
section
 on preg_match(), and I've sat here for 3 hours trying to resolve this
on my
 own. :) Any help would be great:

 I need to match everything between:

 b$headline

 Where $headline is a variable that will be filled out of a foreach()
loop.
 The pattern should return everything until it hits:

 font face=Verdana size=3

 The text file this is taken out of looks like:

 font face=Verdana size=3bHeadline here/b/fontp

 News story, blah, blah, blah...

 font face=Verdana size=3bAnother headline/b/fontp

 More news, blah, blah...

 ...

 The contents of the text file echo correctly before the preg_match,
but the
 preg_match I've tried:

 preg_match(!b[^]+(.*)font face=\Verdana\ size=\3\!,
$contents,
 $story);

 Returns array(), so no matches are made. Any suggestions?

 TIA,

 Jason Soza

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

__ 
Post your ad for free now! http://personals.yahoo.ca

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

__ 
Post your ad for free now! http://personals.yahoo.ca

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




RE: [PHP] so nobody knows how do get rid of everything outside or certain tags?

2002-08-15 Thread vic

Thanks, I tried this code first, and I wrote my script like this:

?php 

$file_name = $page_name.$ext
or die ('Error 2');

$file = file($path.$file_name)
or die ('Error 3');

$str = implode(' ', $file)
or die ('Error 4');

// Original first tag
//div class=Section1
// Original last tag
///div

preg_match('!div class=Section1[^]+(.*)/div!Uis',$str,$regs);
$everything_between_divs=$regs[1];

$good = implode(' ', $everything_between_divs)
or die ('Error 5');

$clean = ereg_replace(o:p/o:p,   , $regs[1]);

echo $clean;

?


ok, I forgot to finish my message,..

now I get this error:


Notice: Undefined offset: 1 in
/home/victor/argilent-www/sites/malibu_place_2/index.php on line 104

Warning: Bad arguments to implode() in
/home/victor/argilent-www/sites/malibu_place_2/index.php on line 106
Error 5

- Vic


-Original Message-
From: Joseph W. Goff [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, August 15, 2002 12:54 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP] so nobody knows how do get rid of everything outside
or certain tags?

preg_match('!div[^]+(.*)/div!Uis',$info,$regs);
$everything_between_divs=$regs[1];

- Original Message -
From: Jay Blanchard [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Thursday, August 15, 2002 11:44 AM
Subject: RE: [PHP] so nobody knows how do get rid of everything outside
or
certain tags?


 [snip]
 I asked this question a while ago, and I am still seeking
clarification,
 I fooled with ereg_replace and they only do a piece of what I want, I
 would like to know how to keep only a chunk of text defined between 2
 tags let's say, div and /div and ignore everything else, I also
have
 to search and replace certain tags between, but I know how to do that
 with ereg_replace. So can anyone help me echo only what is between the
 div tags? Please?
 [/snip]

 Why not take the the beginning div, everything in the middle, and
the
end
 /div tag and explode() them into an array and then get what you want
and
 write it out? I didn't see your originl post and don't know if there
was
 more detail available, but I hope this helps.

 Jay

 I'm not tense.just terribly, terribly alert

 ***
 * Texas PHP Developers Conf  Spring 2003  *
 * T Bar M Resort  Conference Center  *
 * New Braunfels, Texas*
 * San Antonio Area PHP Developers Group   *
 * Interested? Contact [EMAIL PROTECTED] *
 ***



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


__ 
Post your ad for free now! http://personals.yahoo.ca

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

__ 
Post your ad for free now! http://personals.yahoo.ca

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




RE: [PHP] Undefined variable: PHP_SELF

2002-08-15 Thread vic

How about this:

form method=post action='?php echo $PHP_SELF; ?'

- Vic


-Original Message-
From: Manuel Ochoa [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, August 15, 2002 7:20 PM
To: PHP General
Subject: [PHP] Undefined variable: PHP_SELF


I keep getting Undefined variable: PHP_SELF when using the following:

form method=post action='$PHP_SELF'

Global variables are off... What am I doing wrong?

__ 
Post your ad for free now! http://personals.yahoo.ca

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




RE: [PHP] mysql statement (still a semi newbie)

2002-08-14 Thread vic

U must write:

mysql_query(INSERT INTO cast SET Rick='$Rick', Blaine='$Blaine',
Humphrey='$Humphrey', Bogart='$Bogart', male='$male');

The stuff with the $ before them are variable that contain the info u
want to put into the word that don't have the $ those words are the
cells in your database.

I don't know about the DEFAULT thing or the VALUES thing.

- Vic


-Original Message-
From: Alexander Ross [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, August 14, 2002 4:50 PM
To: [EMAIL PROTECTED]
Subject: [PHP] mysql statement (still a semi newbie)

What is wrong with the statement below?  Am I using DEFAULT incorrectly?
That first column is an auto_incrementing column so i don't want any
data to
get inserted there.  Thanks for you help.

INSERT INTO cast VALUES(DEFAULT, 'Rick', 'Blaine', 'Humphrey', 'Bogart',
'male');

Thanks!
Alex



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

__ 
Post your ad for free now! http://personals.yahoo.ca

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




RE: [PHP] Re: html parsing from html file through php

2002-08-14 Thread vic

Thanks, I will try to adapt this to my needs.

- Vic


-Original Message-
From: JJ Harrison [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, August 14, 2002 5:44 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: html parsing from html file through php


 Hello, I am making an app that read from an html file outputted by MS
 word (ya its for those people that need to make webpages but don't
know
 how o write html) anyway, using MS word is a requirement; After the
user
 saves their .doc file as a web page (now and htm file) the php will
take
 that html file from a dir on the server, open it, read it, and ignore
 anything that is from the beginning of the file up to and right after
 the body tag ends, then it must ignore anything at the end of the page
 up and including the body tags and the closing html tag. So basically
 after its done doing its thing I would have all the content of the
page
 ready to be echoed inside another page that would be a sort of shell
or
 template.

 I am loocking right now at regular expressions and file_open etc, but
 just to give you an idea and to see if anybody has any helpful
pointers,
 this (yes, can u believe it?) is the beginning of the word2html
 translation that MS word does: (BAH!) (i have to get rid of this
 remember?)


Here is an example regular expression that someone on this group gave
me. It
gives everything between the body tags.
?php
$html_text = '
html
head
titleUntitled/title
/head
body
Blah Blah Blah Blah
/body
/html
';
preg_match(/body(.*)\/body/i,$html_text,$matches);
echo $html_text;
?

Here is a class that removes un-needed word 2000 HTML tags:
http://www.phpclasses.org/browse.html/package/277.html

If you need the styling you will need to do an extra regular expression
to
get out of the head and perhaps put it into a file.
If you don't need styling I would recomment parsing the document itself
and
removing all the class= and style= attributes


--
JJ Harrison
[EMAIL PROTECTED]
www.tececo.com

--
Please reply on the list/newsgroup unless the reply it OT.



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

__ 
Post your ad for free now! http://personals.yahoo.ca

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




RE: [PHP] P.S. html parsing from html file through php

2002-08-14 Thread vic

Why is this giving me no results? (blank page with this source: 

!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN
HTMLHEAD
META http-equiv=Content-Type content=text/html;
charset=windows-1252/HEAD
BODY/BODY/HTML

this is the code ---

?php 

$path = '../html_pages/';
$file_name = 'contact.htm';

$dirty_html = file ($path.$file_name);
$dirty_html = implode('', file ($path.$file_name));
//echo $dirty_html;

preg_match(/div
class=Section1(.*)\/div/i,$dirty_html,$clean_html);
$clean_html = implode('', $clean_html);
echo $clean_html;

//$html_text = $dirty_html; 
//preg_match(/div class=Section1(.*)\/body/i,$html_text,$matches);
//$matches = implode('', $matches);
//echo $matches;
?
---
- Vic


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, August 14, 2002 5:48 PM
To: [EMAIL PROTECTED]
Subject: [PHP] P.S. html parsing from html file through php

Actually I think there is even less work to be done, the paragraph
spacing problem I talked about earlier can be avoided if I leave all
that foobar tags and erase only:

html xmlns:o=urn:schemas-microsoft-com:office:office
xmlns:w=urn:schemas-microsoft-com:office:word
xmlns:st1=urn:schemas-microsoft-com:office:smarttags
xmlns=http://www.w3.org/TR/REC-html40;

head
meta http-equiv=Content-Type content=text/html; charset=windows-1252
meta name=ProgId content=Word.Document
meta name=Generator content=Microsoft Word 10
meta name=Originator content=Microsoft Word 10
link rel=File-List href=community_files/filelist.xml
titleCommunity/title
o:SmartTagType
namespaceuri=urn:schemas-microsoft-com:office:smarttags
 name=City/
o:SmartTagType
namespaceuri=urn:schemas-microsoft-com:office:smarttags
 name=place/

--[Need everything here]- - in there, not the
following tags ;)

/head

body lang=EN-US style='tab-interval:.5in'

---[Need everything in here]-- - in there,
not the following tags ;)

/body

/html

Thanks, maybe if someone can tell me how to learn to work with some
search and replace function that would be neat0

- Vic


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, August 14, 2002 5:10 PM
To: '[EMAIL PROTECTED]'
Subject: html parsing from html file through php

Hello, I am making an app that read from an html file outputted by MS
word (ya its for those people that need to make webpages but don't know
how o write html) anyway, using MS word is a requirement; After the user
saves their .doc file as a web page (now and htm file) the php will take
that html file from a dir on the server, open it, read it, and ignore
anything that is from the beginning of the file up to and right after
the body tag ends, then it must ignore anything at the end of the page
up and including the body tags and the closing html tag. So basically
after its done doing its thing I would have all the content of the page
ready to be echoed inside another page that would be a sort of shell or
template.

I am loocking right now at regular expressions and file_open etc, but
just to give you an idea and to see if anybody has any helpful pointers,
this (yes, can u believe it?) is the beginning of the word2html
translation that MS word does: (BAH!) (i have to get rid of this
remember?)

--

html xmlns:o=urn:schemas-microsoft-com:office:office
xmlns:w=urn:schemas-microsoft-com:office:word
xmlns:st1=urn:schemas-microsoft-com:office:smarttags
xmlns=http://www.w3.org/TR/REC-html40;

head
meta http-equiv=Content-Type content=text/html; charset=windows-1252
meta name=ProgId content=Word.Document
meta name=Generator content=Microsoft Word 10
meta name=Originator content=Microsoft Word 10
link rel=File-List href=community_files/filelist.xml
titleCommunity/title
o:SmartTagType
namespaceuri=urn:schemas-microsoft-com:office:smarttags
 name=City/
o:SmartTagType
namespaceuri=urn:schemas-microsoft-com:office:smarttags
 name=place/
!--[if gte mso 9]xml
 o:DocumentProperties
  o:AuthorJim Weathers/o:Author
  o:LastAuthorvic/o:LastAuthor
  o:Revision2/o:Revision
  o:TotalTime1/o:TotalTime
  o:Created2002-08-14T19:54:00Z/o:Created
  o:LastSaved2002-08-14T19:54:00Z/o:LastSaved
  o:Pages1/o:Pages
  o:Words79/o:Words
  o:Characters451/o:Characters
  o:Companyx-core/o:Company
  o:Lines3/o:Lines
  o:Paragraphs1/o:Paragraphs
  o:CharactersWithSpaces529/o:CharactersWithSpaces
  o:Version10.2625/o:Version
 /o:DocumentProperties
/xml![endif]--!--[if gte mso 9]xml
 w:WordDocument
  w:SpellingStateClean/w:SpellingState
  w:GrammarStateClean/w:GrammarState
 
w:DisplayHorizontalDrawingGridEvery0/w:DisplayHorizontalDrawingGridEv
ery
 
w:DisplayVerticalDrawingGridEvery0/w:DisplayVerticalDrawingGridEvery
  w:UseMarginsForDrawingGridOrigin/
  w:Compatibility
   w:FootnoteLayoutLikeWW8/
   w:ShapeLayoutLikeWW8/
   w:AlignTablesRowByRow

RE: [PHP] frames and variables

2002-08-14 Thread vic

You gotta be kidding me!

- Vic


-Original Message-
From: Justin French [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, August 15, 2002 12:49 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP] frames and variables

The only way to talk to multiple frames is with javascript.  yuk.

Justin French


on 15/08/02 2:37 PM, [EMAIL PROTECTED] ([EMAIL PROTECTED]) wrote:

 Has anyone here designed php sites that use a combination of php pages
 and html pages? 
 
 What I want to know is how to pass a variable from nav_frame.php (at
the
 top) to itself, AND to the data.php frame (lower frame, main body)
 
 I can pass variables to itself, (with the ?page_name=content.htm
 thingie attached to links, but I don't know how to make this
accessible
 to both frames at the same time.
 Help appreciated, yes, I'm asking a lot of questions since this is a
 project for college and my due data is in 2 ... ooops 1 DAY! WhooHOO!
 
 - Vic
 
 
 
 __
 Post your ad for free now! http://personals.yahoo.ca


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

__ 
Post your ad for free now! http://personals.yahoo.ca

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




RE: [PHP] count link clicks

2002-08-13 Thread vic

Really? That sounds more complicated than I think I need it to be, can't
I use something like:

'a href='.$PHP_SELF.'?add_form='.$value.''

and somehow (this is what I need to know) get $value to increase in
value as the user clicks on the link again and again...

What I want to do in the final product is to display a text imput form
onece and if the user clicks on the link the form (same) will be
displayed again under the first one.

- Vic


-Original Message-
From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, August 13, 2002 2:49 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] count link clicks

Write a link wrapper that you would use like this:

  a href=wrap.php/www.domain.com/path/file.html

Then in wrap.php:

 ?php
$link = substr($PATH_INFO,1);
... increment counter in database for $link ...
header('Location: $link');
 ?

-Rasmus

On Tue, 13 Aug 2002 [EMAIL PROTECTED] wrote:

 How do I count how many times a user clicks on a certain link? (and
put
 it into and array or variable I guess).

 I want to be able to repeat a certain action on the same page as many
 times as the user clicks on the link($PHP_SELF).

 Thanks,

 - Vic



 __
 Post your ad for free now! http://personals.yahoo.ca

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

__ 
Post your ad for free now! http://personals.yahoo.ca

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




RE: [PHP] count link clicks

2002-08-13 Thread vic

I have no database, this has to be done in PHP

- Vic


-Original Message-
From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, August 13, 2002 3:05 PM
To: vic
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: [PHP] count link clicks

 Really? That sounds more complicated than I think I need it to be,
can't
 I use something like:

 'a href='.$PHP_SELF.'?add_form='.$value.''

 and somehow (this is what I need to know) get $value to increase in
 value as the user clicks on the link again and again...

Nope, you would be fighting race conditions forever with an approach
like
that.  You need an atomic way to increment a counter.  The best way to
do
that is to use the builtin atomicity of a database engine.

-Rasmus

__ 
Post your ad for free now! http://personals.yahoo.ca

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




RE: [PHP] count link clicks

2002-08-13 Thread vic

Can someone tell me how I can make an array increase its index? (ie a
script that pushes values into an array)

I figured if in the link:

a href='.$PHP_SELF.'?add_form='.$value.'

instead of $value (or if value was an array) I could do something like:

for ($i=0; $icount($myarray); i++) {

}

or something like:

foreach($array as $num) {

}

I really wish I knew how to make something like:

If isset blah blah increase the values in this array and then echo this
variable as many times as array has values;

- Vic


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, August 13, 2002 3:23 PM
To: 'Rasmus Lerdorf'; 'vic'
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] count link clicks

I think I'm on the right track with:

?php

$i = $value++;

// Show first link
echo 'a href='.$PHP_SELF.'?add_form='.$value.'
New paragraph
/a
/font';

// Isert form html into $data_fields variable
$data_fields = 'html html blah blah
a href='.$PHP_SELF.'?add_form='.$value.'
New paragraph
/a';

while ($i = $value) {
echo $data_fields;
}

?

The only problem is that it runs for an infinite number of times, I want
it to run for as many times as the http://domain.com?add_form=1 (IE: 1
in this case) defines.

- Vic

__ 
Post your ad for free now! http://personals.yahoo.ca

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

__ 
Post your ad for free now! http://personals.yahoo.ca

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




RE: [PHP] Need a Web Host for php/mySQl

2002-08-13 Thread vic

Look into http://linuxwebhost.com

The price is higher, features lower, but it works, and that is more
important isn't it?

The only reason I am endorsing them is because I use them and they are
very good. Just don't pay for them with anything besides a credit card
;) (Like 10 years LATER) hehe.
- Vic


-Original Message-
From: Thomas Edison Jr. [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, August 13, 2002 4:09 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Need a Web Host for php/mySQl

Glory,

I'm looking for a new Web Hosting company, to host my
sites. I had been with Aletia, but i'm experiencing
some technical flaws with them, so i need a new one. 
Aletia is very economical, with $7.95 a month for 200
MB, 10 GB Bandwidth, sub-domains, dbs, and a hell a
lot of goodies. so i would prefer someone like them or
better then them. I'd really appreciate if someone can
find me a better Host.

Thanks,
T. Edison Jr.



__
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com

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

__ 
Post your ad for free now! http://personals.yahoo.ca

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




RE: [PHP] Re: including a php file in an html doc

2002-08-12 Thread vic

You must have a space between ? And your code EX: ? Blah blah ? you
can also write ?php blah blah ? which might be easier to follow. And
you have to include ALL your php code between these tags (you may use as
many pairs as you wish in your page). And don't forget to name you file
.php not .htm or .html

- Vic


-Original Message-
From: Alexander Ross [mailto:[EMAIL PROTECTED]] 
Sent: Monday, August 12, 2002 9:50 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: including a php file in an html doc

I still seem to be missing something.  I guess the easiest thing for me
to
do is just show you my code.  All I want is to be able to reference the
$hotspots array from any .html page oon my site.  I thought I could
include
hotspot.php and then reference the array using ?= ? syntax.  What
should I
do?  The one requirement is that I cannot make all my pages PHP. They
must
be html.

HTML PAGE (test.html):
html
head
titleUntitled Document/title
? include(hotspot.php); ?
meta http-equiv=Content-Type content=text/html; charset=iso-8859-1
/head

body
?=$hotspots['kitten']?
/body
/html

PHP PAGE (hotspot.php):
?
include_once(../board/db_fns.php);

echo hotspot = .$hotspots;

if (!isset $hotspots){
  $connect = connect_to_db();
  $query = SELECT * FROM hotspots;
  $result = mysql_query($query);
  $count = mysql_numrows($result);

  $hotspots = array();
  for($i=0;$i$count;$i++)
  {
$hotspot = mysql_fetch_assoc($result);
 $hotspots[$hotspot['hotspot']]=$hotspot['val'];
  }
  print_r($hotspots);
}
?


Bogdan Stancescu [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi Alexander!

 You're missing the distinction between a server-side script (PHP) and
a
 client-side script (JavaScript, VB etc). When you use the syntax you
 used, the browser attempts to download the src and execute it - and it
 can't do that, because in the best case the php code runs on the
server
 and returns test (your echo()) and then it tries to run that as
php
 code, which again it doesn't know how. It does work for JavaScript
 however, because it downloads the JavaScript file (which is plain
text)
 and then executes the code (because it knows how to execute
JavaScript).

 What you should do would be write
 ? include(hotspot.php); ?
 instead of script language... etc.

 Bogdan

 Alexander Ross wrote:
  I have a .php file whose purpose, ultimately, is to set one
variable;
  $hotspot.  Now I want to include that var in a bunch of places in my
html
  page (it must remain html).  So this was my thought.  In the head
include
  the following:
 
  script language=php src=hotspot.php/script
 
  and then anywhere in the html doc I want to print the value of
$hotspot
I
  type:
 
  ?=$hotspot?
 
  but it doesn't work.  I have a feeling I cant include a php script
that
way
  because in trying to debug the problem I made the first line of
hotspot.php
  = echo test; and the word test never shows.  What am I missing?
 
  Thnks
  Alex
 
 
 
 




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

__ 
Post your ad for free now! http://personals.yahoo.ca

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




RE: [PHP] exec / mkdir question

2002-08-12 Thread vic

// Create user directory
/* $user-id is a variable that contains the use name from a form field,
that's how I name my new directories, u can use whateve u want*/
mkdir ( /path/to/dir/$user_id, 0755 )
or die ( Could not create custom user directory. );

- Vic


-Original Message-
From: Simon Ritchie [mailto:[EMAIL PROTECTED]] 
Sent: Monday, August 12, 2002 2:50 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] exec / mkdir question

  i'm using the following code to create a directory :-
 
  $temp = exec(mkdir $path);
 
  it doesn't work...
 
  i've validated the $path var which is correct.  i suspect it is a
  permissions issue.
 
  what should i look for to resolve this?


 Try using the mkdir function:


That is good practice, but if the problem is with the  permissions, the
program will just be better written when it fails.

A note of the error message and some information about the host
environment
would help.  However ...

The user running the PHP script needs to be able to create the file.  If
this is a UNIX system and the web server is run by the user nobody, then
that user needs write access to the directory which will contain the
file.
To grant that access, your user (the one you, er, use to connect to the
server) must own the directory

The worst case is when your user and the web server user are not in the
same
group.  In that case, you will need to grant write access to all users.
This introduces potential security risks - any user can also remove or
rename files in that directory.

Simon Ritchie

Download my introduction to PHP for $25:
http://merrowinternet.com/downloads?source=ml


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

__ 
Post your ad for free now! http://personals.yahoo.ca

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




RE: [PHP] Web services and PHP

2002-08-12 Thread vic

.Net? BLASPHEMY!

- Vic


-Original Message-
From: Aung [mailto:[EMAIL PROTECTED]] 
Sent: Monday, August 12, 2002 11:16 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Web services and PHP

I have some web services developed with .NET and I would like to consume
these web services from PHP.  Can someone provide me with example code?

Thanks in advance.
Aung



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

__ 
Post your ad for free now! http://personals.yahoo.ca

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




[PHP] HTTP authentication - de authentication

2002-08-10 Thread vic

How does one logout from such an authentication? I know that through a
HTTP status code, but how exactly? Everything I tried allows the browser
to view the page info after logout if the user hits the back button.
The only way I found it works if the user closes the browser window, but
I can't make sure they do, so *how do I make sure they do?*

Is there a script to better de-autheticate from such an authentication
method, or to make the browser close the window?

// ___ AUTHENTICATION SCRIPT _

$auth = false; 

if (isset($PHP_AUTH_USER)  isset($PHP_AUTH_PW)) { 

// Connect to MySQL 
mysql_connect( 'xxx', 'xxx', 'xxx' ) 
or die ( 'Unable to connect to server.' ); 

// Select database on MySQL server 
mysql_select_db( 'xxx' ) 
or die ( 'Unable to select database.' ); 

// Formulate the query 
$sql = SELECT * FROM xxx 
WHERE user_id = '$PHP_AUTH_USER' 
AND password = PASSWORD('$PHP_AUTH_PW'); 

// Execute the query and put results in $result 
$result = mysql_query( $sql ) 
or die ( 'Unable to execute query.' ); 

// Get number of rows in $result. 
$num = mysql_numrows( $result ); 

// A matching row was found - the user is authenticated. 
if ( $num != 0 ) { 

$auth = true;

// End do the check
}

//STOP AUTHETICATION SCRIPT EXAMPLE __


//_ LOGOUT SCRIP EXAMPLE 

// the logout link would look like: 
//a href=?php echo($PHP_SELF);??logout=1Logout/a

if (isset($logout)) { 
header('status: 401 Unauthorized'); 
header('WWW-Authenticate: Basic realm=Private'); 
header('HTTP/1.0 403 Forbidden'); 
echo ('You have successfully logged out.');
?
script language=JavaScript type=text/JavaScript
!--
function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i(args.length-1); i+=2)
eval(args[i]+.location='+args[i+1]+');
}
//--
/script
?php
exit();
}

- Vic



__ 
Post your ad for free now! http://personals.yahoo.ca

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