[PHP] Graphing Webstats using MRTG/PHP/MYSQL?

2004-07-29 Thread Louie Miranda
has anyone know any tools related to this?

Graphing Webstats using MRTG/PHP/MYSQL?

-- 
Louie Miranda
http://www.axishift.com

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



Re: [PHP] Java Script or PHP

2004-07-29 Thread Skippy
Quoting Curt Zirzow [EMAIL PROTECTED]:
  What is the correct way to open the page from the print link to a new
  page?
 
 @media print {
   .css {
 its: all here;
   }
 }

Yeah, but sometimes you want the print version to be more nifty, like
have all the pages in an article instead of just the current page.
That calls for some server-side work AND a specific print-only CSS.

-- 
Romanian Web Developers - http://ROWD.ORG

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



Re: [PHP] Browser reload problem

2004-07-29 Thread Skippy
Quoting Ashley M. Kirchner [EMAIL PROTECTED]:
 PayPal passes a ton of data back to us when someone's done 
 purchasing something.  I use some of that information and shove it all 
 into a database.  Problem is, if someone hits reload on their browser, I 
 get the same data re-inserted again.  Reload the page four times, and I 
 will get four records with the same data inserted.  How can I avoid 
 this?  I'd like to silently either discard the information after it's 
 been inserted, or silently prevent it from being re-inserted again.

1. Receive PayPal data in your script.
2. Process it (stick into database).
3. Redirect to another script and forward any data you want displayed.
4. Have the 2nd script show whatever confirmation message you want.

The user can now reload all he wants, he gets just the 2nd script
which doesn't do anything but display the same message over and over.

ATTENTION: if you receive the PayPal data by POST be sure to redirect
using 303 See Other, which will deactivate the POST and force the
redirect to use GET. Of course, forwarding any data to the 2nd script
should be done as GET parameters.

Or, even better, just forward the 2nd script the database ID of the
data you just recorded and if it needs to display anything it can get
it from there.

-- 
Romanian Web Developers - http://ROWD.ORG

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



Re: [PHP] Graphing Webstats using MRTG/PHP/MYSQL?

2004-07-29 Thread Skippy
Quoting Louie Miranda [EMAIL PROTECTED]:
 has anyone know any tools related to this?
 Graphing Webstats using MRTG/PHP/MYSQL?

Why MRTG _and_ PHP? AFAIK MRTG produces its own HTML and images.
You can either use MRTG with whatever data (webstats) you collected
or you can use PHP+MySQL for that and generate graphs from PHP.

There must be PHP solutions to generating graphs out there, or you
can write your own.

-- 
Romanian Web Developers - http://ROWD.ORG

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



Re: [PHP] php.net bug tracking tool?

2004-07-29 Thread Andreas Goetz
Curt, thank you. I like Mantis, too but wanted to check the php thing. I was
confused there is no reference to it anywhere, as it's used by e.g. MySQL,
too.

Thanks,
Andreas


Curt Zirzow [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 * Thus wrote Andreas Goetz:
  Which bug tracking tool is php.net using? I know it sounds stupid, but
even
  as I can look at the source on php.net, I can't find any documentation-
is
  this package available for download somewhere?


 you can checkout the code from cvs:
   cvs -d :pserver:[EMAIL PROTECTED]:/repository checkout php-bugs-web

 see:
   http://cvs.php.net/php-bugs-web
   http://www.php.net/anoncvs.php

 you might be better off finding a more generic bug tracking system.

 Curt
 -- 
 First, let me assure you that this is not one of those shady pyramid
schemes
 you've been hearing about.  No, sir.  Our model is the trapezoid!

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



[PHP] apache1 + php or apache2 + php

2004-07-29 Thread Ni Shurong
Hi, 

I am a newer of this list, nice to meet every body here:)

I am wandering about using apache1 or apache2 with php, and i hope i can
get some advics here ;)

I use ./configure --help and it says:
--with-apxs2[=FILE] EXPERIMENTAL: Build shared Apache 2.0 module.
FILE is the optional
  pathname to the Apache apxs tool; defaults to apxs.


and I read these from php manual:
http://www.php.net/manual/en/install.apache2.php
it says:
Warning 
Do not use Apache 2.0 and PHP in a production environment neither on Unix nor on 
Windows. 
 
I don't konw which version of apache works with php better:)


Ni Shurong [EMAIL PROTECTED]

MAIL : [EMAIL PROTECTED]
QQ   : 412844
MSN  : [EMAIL PROTECTED]
BLOG : http://blog.njmars.com/myhan/

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



Re: [PHP] Graphing Webstats using MRTG/PHP/MYSQL?

2004-07-29 Thread Louie Miranda
i was thingking more of php+mysql, then mrtg will get all the data
from the sql or the php. something like that

On Thu, 29 Jul 2004 10:50:09 +0300, Skippy [EMAIL PROTECTED] wrote:
 Quoting Louie Miranda [EMAIL PROTECTED]:
  has anyone know any tools related to this?
  Graphing Webstats using MRTG/PHP/MYSQL?
 
 Why MRTG _and_ PHP? AFAIK MRTG produces its own HTML and images.
 You can either use MRTG with whatever data (webstats) you collected
 or you can use PHP+MySQL for that and generate graphs from PHP.
 
 There must be PHP solutions to generating graphs out there, or you
 can write your own.
 
 --
 Romanian Web Developers - http://ROWD.ORG
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 


-- 
Louie Miranda
http://www.axishift.com

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



[PHP] VB--PHP

2004-07-29 Thread Jay
Hi!
Can someone pelase help me to convert the following Vbscript code to 
PHP, i am really sucky at Regular Expression:
-CODE VBSCRIPT-
Function IsValid(strData,blIncludeAlpha,blIncludeNumeric)
Dim regEx, retVal,strPtrn
Set regEx = New RegExp
If blIncludeAlpha Then
strPtrn=a-zA-Z
End If
If blIncludeNumeric Then
strPtrn=0-9
End If
if blIncludeAlpha and blIncludeNumeric Then
strPtrn=a-zA-Z0-9
End if
regEx.Pattern = ^[  strPtrn  ]+$
IsValid= regEx.Test(strData)
End Function

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


Re: [PHP] VB--PHP

2004-07-29 Thread Jason Wong
On Thursday 29 July 2004 17:00, Jay wrote:

 Can someone pelase help me to convert the following Vbscript code to
 PHP, i am really sucky at Regular Expression:

Why don't you state your problem in English so that even those people not 
familiar with VB will understand and thus may be able to help?

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Fat Liberation: because a waist is a terrible thing to mind.
*/

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



Re: [PHP] VB--PHP

2004-07-29 Thread Ni Shurong
I did not test it:)

function isValid($strData, $bIncludeAlpha=false, $bIncludeNumber=false)
{
switch(true) {
case $bIncludeAlpha  !$bIncludeNumber:
$ptr = /^[a-zA-Z]+/;
break;
case !$bIncludeAlpha  $bIncludeNumber:
$ptr = /^[0-9]+/;
break;
case $bIncludeAlpha  $bIncludeNumber:
$ptr = /^[a-zA-Z0-9]+/;
break;
}
return preg_match($ptr, $strData);
}




Ni Shurong [EMAIL PROTECTED]

MAIL : [EMAIL PROTECTED]
QQ   : 412844
MSN  : [EMAIL PROTECTED]
BLOG : http://blog.njmars.com/myhan/

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



[PHP] Paul Kain

2004-07-29 Thread Shahed, Raja
Paul Kain wrote:
Start it from webmonkey.com . They have tutorial for very beginner , that of Tim 
Zoegler (?). And also db tutorial of 
Graeme Morel (php and mysql db- Wunderschöne Tutorial). 
I am sure You learn the basic---
Good luck and welcome to PHP
Best regards 
Raja shahed





-Ursprüngliche Nachricht-
Von: Bruno Santos [mailto:[EMAIL PROTECTED] 
Gesendet: Dienstag, 27. Juli 2004 10:47
An: Paul Kain
Cc: [EMAIL PROTECTED]
Betreff: Re: [PHP] totally new to PHP


Paul Kain wrote:

I have never programmed anything

I know html and really want to know php

where is the best place to go for some really basic tutorials 
to start with ?

Thank in advance

  

Hello.

There are a lots of tutorials around the net.

www.phpbuilder.com --- Very nice site for developers
www.php.net --- PHP official site. Look in the manual, every function 
(or almost any) has a description and comments from people around the 
globe with improvements and tips.

Since you never programmed before, i recomend you to buy some PHP 
beginner books, cause always cover programing from the 
begining. but, if 
you can affort it, buy some programing books, with no relation to any 
programing language. It would be best for you to understande 
the basics 
without knowing any programing language... almost of them 
starts with C 
language, witch is very nice to start !

by the way, its nice for you to start programming with PHP. you will 
love it !!


-- 
[EMAIL PROTECTED]
--
Divisao de Informatica
[EMAIL PROTECTED]
Tel: +351 272 000 155
Fax: +351 272 000 257

--
Hospital Amato Lusitano
Av. Pedro Alvares Cabral
6000-085 Castelo Branco
[EMAIL PROTECTED]
Tel: +351 272 000 272
Fax: +351 272 000 257

-- 
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] VB--PHP

2004-07-29 Thread Ford, Mike [LSS]
On 29 July 2004 10:00, Jay wrote:

 Hi!
 
 Can someone pelase help me to convert the following Vbscript code to
 PHP, i am really sucky at Regular Expression:
 -CODE VBSCRIPT-
 Function IsValid(strData,blIncludeAlpha,blIncludeNumeric)
 Dim regEx, retVal,strPtrn
 Set regEx = New RegExp
 If blIncludeAlpha Then
 strPtrn=a-zA-Z
 End If
 If blIncludeNumeric Then
 strPtrn=0-9
 End If
 if blIncludeAlpha and blIncludeNumeric Then
 strPtrn=a-zA-Z0-9
 End if
 regEx.Pattern = ^[  strPtrn  ]+$
 IsValid= regEx.Test(strData)
 End Function

Something like:

function isValid($strData, $blIncludeAlpha, $blIncludeNumeric)
{
$strPattern = /^[;
if ($blIncludeAlpha):
$strPattern .= a-zA-Z;
endif;
if ($blIncludeNumeric):
$strPattern .= 0-9;
endif;
$strPattern .= ]$/;

return preg_match($strPattern, $strData);
}

Cheers!

Mike

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

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



RE: [PHP] strpos mystery

2004-07-29 Thread Ford, Mike [LSS]
On 29 July 2004 01:50, Jon Drukman wrote:

 with this code fragment:
 
 ?
 
 $string='/mobile/phone.html';
 if (strpos($string,'/mobile/')!==false) { print one: yes\n; }
 if (strpos($string,'/mobile/')===true) { print two: yes\n; }
 
  
 
 
 only the first if statement prints anything.  why is !==
 false not the
 same as === true ?

Because strpos returns the integer offset of the found substring, or FALSE
if not found; it *never* returns TRUE.  (You need the !== test because
strpos() can return an offset of zero, which would be ==FALSE but not
===FALSE.)

Cheers!

Mike

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

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



RE: [PHP] unset($_COOKIE['foo']) and $_COOKIE['foo'] = '' both do n't do anything.

2004-07-29 Thread Ford, Mike [LSS]
On 28 July 2004 20:17, Daevid Vincent wrote:

 No. I'm trying to delete it from PHP memory, but keep the cookie on
 their client in the cookie.txt file or wherever it's stored.

Where are you doing the test for it -- in the same script, or in a
subsequent one?  If the former, then I'm confused; if the latter, then this
is expected behaviour (explanation on request ;).

Cheers!

Mike

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

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



Re: [PHP] VB--PHP

2004-07-29 Thread Jay
Jason Wong wrote:
On Thursday 29 July 2004 17:00, Jay wrote:

Can someone pelase help me to convert the following Vbscript code to
PHP, i am really sucky at Regular Expression:

Why don't you state your problem in English so that even those people not 
familiar with VB will understand and thus may be able to help?

What?!
I thought i wrote in English!
ahayou mean, i need a function that will validate input data.
I thought it was pretty obvious what i was trying to do.
Regards,
J
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] VB--PHP

2004-07-29 Thread Jay
Ni Shurong wrote:
I did not test it:)
function isValid($strData, $bIncludeAlpha=false, $bIncludeNumber=false)
{
switch(true) {
case $bIncludeAlpha  !$bIncludeNumber:
$ptr = /^[a-zA-Z]+/;
break;
case !$bIncludeAlpha  $bIncludeNumber:
$ptr = /^[0-9]+/;
break;
case $bIncludeAlpha  $bIncludeNumber:
$ptr = /^[a-zA-Z0-9]+/;
break;
}
return preg_match($ptr, $strData);
}


Ni Shurong [EMAIL PROTECTED]
MAIL : [EMAIL PROTECTED]
QQ   : 412844
MSN  : [EMAIL PROTECTED]
BLOG : http://blog.njmars.com/myhan/
Thanx, seems to work just fine.
Some questions:
Why true in the switch()?
Why preg_match instead of ereg?
Regards,
J
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] VB--PHP

2004-07-29 Thread Ni Shurong
I am familiar with pcre more then php's POSIX extension :)

and it is said that preg_match() is faster than ereg(), see php manual
for more info :)

function isValid($strData, $bIncludeAlpha=false, $bIncludeNumber=false)
{
 switch(true) {
 case $bIncludeAlpha  !$bIncludeNumber:
 $ptr = /^[a-zA-Z]+/;
 break;
 case !$bIncludeAlpha  $bIncludeNumber:
 $ptr = /^[0-9]+/;
 break;
 case $bIncludeAlpha  $bIncludeNumber:
 $ptr = /^[a-zA-Z0-9]+/;
 break;
 default:
 return false;
 }
 return preg_match($ptr, $strData);
}


please add default statement:)


Ni Shurong [EMAIL PROTECTED]

MAIL : [EMAIL PROTECTED]
QQ   : 412844
MSN  : [EMAIL PROTECTED]
BLOG : http://blog.njmars.com/myhan/

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



[PHP] [HAB] Virtual Host

2004-07-29 Thread EE
Dears,

How can I make a virtual host. I usually type 127.0.0.1 in my browser to
test my site but I need to work on another site in a different
directory? 

I am running Apache, PHP4, Mandrake 10. I am not sure which appache  I
am running but when I do 'apachectl graceful' it says Reloading httpd2

I hope that I am not running apache2 as it is not recommended to use
apache2 and php in production.

Best Regards

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



[PHP] Problems with is_dir()

2004-07-29 Thread Jay
Hi!
I am trying to list all files and dirs in a directory. But i encountered 
some problems with is_dir() function. is_dir tells med that it all is 
files when i know for a fact that there is one dir in the directory 
(dir1). Can someone tell me why this don´t work?:

?php
if ($handle = opendir($_SERVER[DOCUMENT_ROOT]./img)) {
while (false !== ($file = readdir($handle))) {
if ($file != .  $file != ..) {
if (is_dir($file)){
echo Dir: .$file;
}
else
{
echo File: .$file;
}
echo br /;
}
}
closedir($handle);
clearstatcache();
}
?
Thanx in advance
J
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Problems with is_dir()

2004-07-29 Thread Ni Shurong
you must do it like this:

?php
if ($handle = opendir($_SERVER[DOCUMENT_ROOT]./img)) {
while (false !== ($file = readdir($handle))) {
if ($file != .  $file != ..) {
+   $path = $_SERVER[DOCUMENT_ROOT]./img . / . $file;
!   if (is_dir($path)){
echo Dir: .$file;
}
else
{
echo File: .$file;
}
echo br /;
}
}
closedir($handle);
clearstatcache();
}
?



Ni Shurong [EMAIL PROTECTED]

MAIL : [EMAIL PROTECTED]
QQ   : 412844
MSN  : [EMAIL PROTECTED]
BLOG : http://blog.njmars.com/myhan/

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



Re: [PHP] Problems with is_dir()

2004-07-29 Thread Jay
Ni Shurong wrote:
you must do it like this:
?php
if ($handle = opendir($_SERVER[DOCUMENT_ROOT]./img)) {
while (false !== ($file = readdir($handle))) {
if ($file != .  $file != ..) {
+   $path = $_SERVER[DOCUMENT_ROOT]./img . / . $file;
!   if (is_dir($path)){
echo Dir: .$file;
}
else
{
echo File: .$file;
}
echo br /;
}
}
closedir($handle);
clearstatcache();
}
?

Ni Shurong [EMAIL PROTECTED]
MAIL : [EMAIL PROTECTED]
QQ   : 412844
MSN  : [EMAIL PROTECTED]
BLOG : http://blog.njmars.com/myhan/
You again!
Thanx : )
Please stay in here i might need some more help ; )
Regards,
J
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: apache1 + php or apache2 + php

2004-07-29 Thread Jay
Ni Shurong wrote:
Hi, 

I am a newer of this list, nice to meet every body here:)
I am wandering about using apache1 or apache2 with php, and i hope i can
get some advics here ;)
I use ./configure --help and it says:
--with-apxs2[=FILE] EXPERIMENTAL: Build shared Apache 2.0 module.
FILE is the optional
  pathname to the Apache apxs tool; defaults to apxs.
and I read these from php manual:
http://www.php.net/manual/en/install.apache2.php
it says:
Warning 
Do not use Apache 2.0 and PHP in a production environment neither on Unix nor on Windows. 
 
I don't konw which version of apache works with php better:)


Ni Shurong [EMAIL PROTECTED]
MAIL : [EMAIL PROTECTED]
QQ   : 412844
MSN  : [EMAIL PROTECTED]
BLOG : http://blog.njmars.com/myhan/
I thought i try to help you when you been so kind and helped me with my 
questions : )

I just can say that i run Apache 2 with ISAPI module loaded on XP and it 
performs just fine!

Haven´t tried Apache 2 under Linux, but apache 1.
So my adviceApache2.
Regards,
J
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: apache1 + php or apache2 + php

2004-07-29 Thread Ni Shurong
Thank you! ;)

I have build apache1+php5, apache2+php5
but I don't know how to test which one is better :)
They all works fine.

I works under linux, and I need imap extension support ;)

Mayby I will take apache1+php, for contented, aha .. ;)




Ni Shurong [EMAIL PROTECTED]

MAIL : [EMAIL PROTECTED]
QQ   : 412844
MSN  : [EMAIL PROTECTED]
BLOG : http://blog.njmars.com/myhan/

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



[PHP] Charset Problem

2004-07-29 Thread Gerske, Sebastian
Dear list,

im running mysql 4.1 and php 4.3.8 and have the following problem with
charset. If i select a row from a table like
SELECT *
FROM ip
WHERE ip
LIKE '127.0.0.1'
LIMIT 0 , 30



i get the error:



 #1267 - Illegal mix of collations (ascii_general_ci,IMPLICIT) and
(latin1_swedish_ci,COERCIBLE) for operation 'like'

the database is completly configured as ascii charset so i need to know how
to i change the charset from swedish (latin1) to ascii in php ?

btw i configured php as --with-mysql/usr/local/mysql



thanks for answers



s gerske

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



[PHP] Classes, instances and NULL

2004-07-29 Thread Oliver Hitz
Hi all,

I have stumbled across something odd related to classes, instances and
NULL in PHP 4. Apparently, an instance of a class that doesn't contain
any variables is always equal to NULL.

  class MyClass {
function anyFunction() {
  ...
}
  }

  $c = new MyClass();
  if ($c == null) {
print is \$c really null?;
  }

`is_null($c)' however, returns `false', as one would expect.

As soon as the class contains a variable, the `$c == null' comparison
returns false.

Is there any logical reason why the comparison with the `==' operator
returns `true'? I don't know about the internals of PHP, but I think
this might be related to implementation details (e.g. instances of
classes being associative arrays). However, from an OOP point of view
this behaviour seems rather weird.

I may not be the first to notice this. I couldn't find anything in the
mailing list, if there has already been a discussion about this, just
point me to the right direction.

Thanks
Oliver


pgpCMvNTB17si.pgp
Description: PGP signature


Re: [PHP] [HAB] Virtual Host

2004-07-29 Thread Jason Wong
On Thursday 29 July 2004 19:16, EE wrote:

This question is OT ...

 How can I make a virtual host. I usually type 127.0.0.1 in my browser to
 test my site but I need to work on another site in a different
 directory?

... check out http://httpd.apache.org/docs/

Also you need to set up some DNS entries so that entering (for example):

  http://www.mytestite.com/

will point to your local webserver. The easiest way to do this is to add 
entries in /etc/hosts.

 I am running Apache, PHP4, Mandrake 10. I am not sure which appache  I
 am running but when I do 'apachectl graceful' it says Reloading httpd2

 I hope that I am not running apache2 as it is not recommended to use
 apache2 and php in production.

httpd2 usually signifies Apache 2.X.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Absence makes the heart forget.
*/

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



Re: [PHP] reading txt file - certain lines

2004-07-29 Thread Miroslav Hudak (php/ml)
Everything is possible :)
And in this case, it seems, that lines are delimited by br ... i'm not quite 
sure, whether br can be used in explode as a delimiter, if so, you have no 
problem and you just read all the file into variable, $lines = explode('br', 
$variable) and you have lines in $lines... if br can not be explode's 
parameter, i would use str_replace to replace it with ie. #13 and then explode 
it... or use some regular expressions... it depends on how fast you need it... :)

hope this was what you needed... :)
regards,
m.
Dustin Krysak wrote:
Hi there.. .I am displaying info (on music) from a text file with the 
following code...

?php
//open the file handler
$fp02=fopen(assets/lib/php/itunes/recent.txt,r);
//Read the track info
$recent=fgets($fp02);
//close the file.
echo $recent;
fclose($fp02);
?

Now the contents of said text file would read something like the following:
bLiar/bbrby ibSex Pistols/bibriNever Mind The 
Bollocks/ibrPlayed: 2004/07/28, 1:48:29 
PMbr--brbLet's Rave On/bbrby ibThe 
Raveonettes/bibriChain Gang Of Love/ibrPlayed: 2004/07/28, 
1:46:37 PMbr--brbNo Remorse/bbrby 
ibMetallica/bibriKill 'Em All/ibrPlayed: 2004/07/28, 
1:40:17 PMbr--brbThis Is Our Emergency/bbrby 
ibPretty Girls Make Graves/bibriThe New 
Romance/ibrPlayed: 2004/07/28, 1:36:37 
PMbr--brbFreestylin'/bbrby 
ibGreyboy/bibriFreestylin'/ibrPlayed: 2004/07/28, 
1:30:25 PMbr--brbIn My Head/bbrby ibNaked 
Raygun/bibriRaygun...Naked Raygun (Reissue)/ibrPlayed: 
2004/07/28, 1:26:37 PMbr--brbLust To Love/bbrby 
ibThe Go-Go's/bibriReturn To The Valley Of The 
Go-Go's/ibrPlayed: 2004/07/28, 1:23:13 PMbr--brbKim 
You Bore Me To Death/bbrby ibGrandaddy/bibriConcrete 
Dunes/ibrPlayed: 2004/07/28, 1:18:37 
PMbr--brbSonderkommando/bbrby 
ibGwar/bibriThis Toilet Earth/ibrPlayed: 2004/07/28, 
1:13:49 PMbr--br

Now what I want to do is read this file, but only say read 5 songs 
worth, then I would place the PHP code in (another table) and display 
the next 5 songs and so on This just allows for a more flexible 
layout in the final presentation. the way I am having the text files 
written, there is no way to get it to produce seperate text files - 
otherwise this would be easy to do

Is this possible?
Thanks in advance!
Dustin
--
Miroslav Hudak
developer  designer
http://hudak.info
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Automatically run a php page once a day

2004-07-29 Thread PHPDiscuss - PHP Newsgroups and mailing lists
Hello everybody,
Can someone help me saying how i can run a php script automatically once
in a day.

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



RE: [PHP] Automatically run a php page once a day

2004-07-29 Thread Jay Blanchard
[snip]
Hello everybody,
Can someone help me saying how i can run a php script automatically once
in a day.
[/snip]

You don't say what your OS is, but CRON will do it

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



[PHP] Re: Classes, instances and NULL

2004-07-29 Thread Mehdi Achour
Hi Oliver, you should test with === instead of ==
  http://php.net/manual/en/language.operators.comparison.php
didou
Oliver Hitz wrote:
Hi all,
I have stumbled across something odd related to classes, instances and
NULL in PHP 4. Apparently, an instance of a class that doesn't contain
any variables is always equal to NULL.
  class MyClass {
function anyFunction() {
  ...
}
  }
  $c = new MyClass();
  if ($c == null) {
print is \$c really null?;
  }
`is_null($c)' however, returns `false', as one would expect.
As soon as the class contains a variable, the `$c == null' comparison
returns false.
Is there any logical reason why the comparison with the `==' operator
returns `true'? I don't know about the internals of PHP, but I think
this might be related to implementation details (e.g. instances of
classes being associative arrays). However, from an OOP point of view
this behaviour seems rather weird.
I may not be the first to notice this. I couldn't find anything in the
mailing list, if there has already been a discussion about this, just
point me to the right direction.
Thanks
Oliver
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Automatically run a php page once a day

2004-07-29 Thread John Nichel
PHPDiscuss - PHP Newsgroups and mailing lists wrote:
Hello everybody,
Can someone help me saying how i can run a php script automatically once
in a day.
man cron
Or if yer one of dem Windows users, there's that task scheduler thingy.
--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: Classes, instances and NULL

2004-07-29 Thread Oliver Hitz
On 29 Jul 2004, Mehdi Achour wrote:
 Hi Oliver, you should test with === instead of ==
   http://php.net/manual/en/language.operators.comparison.php

Thank you. I know there is a `===' operator, but to me this doesn't make
sense either.

  class A { }
  class B { var $x; }

It is logical that an instance of `A' is not identical to null. However,
why is an instance of `A' equal (`==' operator) to null, an instance of
`B' not? Do objects automatically evaluate to their associative array
representation? Is this intended behaviour?

Thanks
Oliver


pgpA5YT2eDqch.pgp
Description: PGP signature


[PHP] Re: Retrieving Stored Values for Dropdown Menu

2004-07-29 Thread rush
Harlequin [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi all.

 I'm trying to retrieve values from a previously selected dropdown menu.
For
 text I simply use value=$Whatever

here is small example on dynamically cretaing listboxes, and selecting the
items.

http://www.templatetamer.org/index.php?SimpleListboxExample

rush
--
http://www.templatetamer.com/

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



[PHP] image field in MSSQL db

2004-07-29 Thread Edward Peloke
I have never kept my images in the database but instead used the db to hold
the path to the image.  I now have to connect to a third party SQL Server db
which holds images with an image data type in the table.  How can I pull
this out so it can be diplayed?  I simply can't echo out the contents as it
shows the code, not the image.

Thanks,
Eddie

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



[PHP] Need to maintain the integrity of the checkbox

2004-07-29 Thread Andrew Reilly
New to the list, thanks in advance.

 

I have created a form that lists the possible sponsorships of various
events.  I need to keep the names of the checkbox to identify the specific
event, but the value is a dollar amount that needs to pass thru to the
checkout area function.  Without creating an array that would loose the
events names (some events have the same dollar amount), how can I capture
the dollar value(s) checked an pass them to the checkout form?

 

Regards,

 

Techmaniac



RE: [PHP] Re: Classes, instances and NULL

2004-07-29 Thread Michael Sims
Oliver Hitz wrote:
 Thank you. I know there is a `===' operator, but to me this doesn't
 make sense either.

   class A { }
   class B { var $x; }

 It is logical that an instance of `A' is not identical to null.
 However, why is an instance of `A' equal (`==' operator) to null, an
 instance of `B' not? Do objects automatically evaluate to their
 associative array representation? Is this intended behaviour?

There are four different types that PHP could be casting the object and null to that
would result in them being equal, namely boolean, integer, float, and array.  It's
definitely not casting them to string or object.  My guess is the behavior is not
intentional since the documentation for the NULL type says that a variable is
equal to null only if it has had the null constant assigned to it, it has not had
a value assigned to it at all, or it has been unset().  You'd probably get more
definitive answers on the internals list.  Personally I consider the behavior a bug,
so I'd probably file a bug report on it, although I wouldn't expect it to be given a
high priority. :)


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



Re: [PHP] image field in MSSQL db

2004-07-29 Thread raditha dissanayake
Edward Peloke wrote:
I have never kept my images in the database but instead used the db to hold
the path to the image.  

indeed that  is the right way to do it.
I now have to connect to a third party SQL Server db
which holds images with an image data type in the table.  How can I pull
this out so it can be diplayed?  

not an expert on MSSQL but
I simply can't echo out the contents as it
shows the code, not the image.
 

could be something as simple had not sending the correct header.

--
Raditha Dissanayake.

http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 128 KB | with progress bar.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Need to maintain the integrity of the checkbox

2004-07-29 Thread Jay Blanchard
[snip]
I have created a form that lists the possible sponsorships of various
events.  I need to keep the names of the checkbox to identify the
specific
event, but the value is a dollar amount that needs to pass thru to the
checkout area function.  Without creating an array that would loose the
events names (some events have the same dollar amount), how can I
capture
the dollar value(s) checked an pass them to the checkout form?
[/snip]

I don't think you explained this well, but I'll take a shot

input type=checkbox name=EventFoo value=

When this is passed to processing via a POST event it becomes

$_POST['EventFoo'] (that contains the value entered in the form, like 5
bucks)

So for each event name you will have a like POST array item containing
the value.

Does this help?

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



RE: [PHP] Need to maintain the integrity of the checkbox

2004-07-29 Thread Jay Blanchard
[snip]
Your right, I didn't explain fully.  If I have two events where the
value=$5, then after I have looped thru the array I know they want to
pay
the $5, but not which event that goes to because multiple events are
that
value.  What I'm thinking I'll do is make one array and give each event
a #,
then after checking for the selected checkbox, validate which number and
pass thru the event and corresponding dollar amount.  Sound like the
best
solution?  If not, I hope I have explained a little more precise.
[/snip]

A. Always reply back to the list in case the responder is no longer
available which may leave you hanging.

2. Even though multiple events have the same value ($5) they are listed
in the POST array according to the name the event input was given in the
form. You do not need to do the above unless you have a badly done form.
Why don't you send the code from the portion of the form we are talking
about and we can help better.

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



Re: [PHP] Need to maintain the integrity of the checkbox

2004-07-29 Thread Jason Wong
On Thursday 29 July 2004 22:04, Andrew Reilly wrote:

 I have created a form that lists the possible sponsorships of various
 events.  I need to keep the names of the checkbox to identify the specific
 event, but the value is a dollar amount that needs to pass thru to the
 checkout area function.  Without creating an array that would loose the
 events names (some events have the same dollar amount), how can I capture
 the dollar value(s) checked an pass them to the checkout form?

Not exactly sure what you're trying to do. However you seem to be wanting to 
pass around monetary values via forms. In general this is a VERY BAD idea. 
Data submmitted from forms should not be trusted. Instead you should only 
link the events to their monetary values (using a back-end lookup table or 
whatever) AFTER the form is submitted.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
An infallible method of conciliating a tiger is to allow oneself to be
devoured.
-- Konrad Adenauer
*/

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



RE: [PHP] Need to maintain the integrity of the checkbox

2004-07-29 Thread Andrew Reilly
Example of form:
td height=52 align=left valign=middleinput type=checkbox
name=wbc_Money value=$5000
  Power of Money Series ($5000) img src=images/sold_Out.gif
border=0Power 
  of Politics ($3500)br input type=checkbox name=wbc_Wine
value=$1000
  Power of Wine nbsp;nbsp; input type=checkbox name=wbc_Golffall
value=$3500
  Power of Golf (Fall) Series ($3500)br input type=checkbox
name=wbc_Golfspring value=$3500
  Power of Golf (Spring) Series ($3500)/td

So the dollar amounts are the same for three of the four events, but this is
just a snippet of about 20 items.  If I take out the dollar amounts, and
just populate an array with what are now the descriptive names, I can assign
dollar amounts in the checkout script.  Am I on the right track?


-Original Message-

Subject: RE: [PHP] Need to maintain the integrity of the checkbox

[snip]
Your right, I didn't explain fully.  If I have two events where the
value=$5, then after I have looped thru the array I know they want to
pay
the $5, but not which event that goes to because multiple events are
that
value.  What I'm thinking I'll do is make one array and give each event
a #,
then after checking for the selected checkbox, validate which number and
pass thru the event and corresponding dollar amount.  Sound like the
best
solution?  If not, I hope I have explained a little more precise.
[/snip]

A. Always reply back to the list in case the responder is no longer
available which may leave you hanging.

2. Even though multiple events have the same value ($5) they are listed
in the POST array according to the name the event input was given in the
form. You do not need to do the above unless you have a badly done form.
Why don't you send the code from the portion of the form we are talking
about and we can help better.

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



RE: [PHP] Need to maintain the integrity of the checkbox

2004-07-29 Thread Jay Blanchard
[snip]
Example of form:
input type=checkbox name=wbc_Money value=$5000
input type=checkbox name=wbc_Wine value=$1000
input type=checkbox name=wbc_Golffall value=$3500
input type=checkbox name=wbc_Golfspring value=$3500

So the dollar amounts are the same for three of the four events, but
this is
just a snippet of about 20 items.  If I take out the dollar amounts, and
just populate an array with what are now the descriptive names, I can
assign
dollar amounts in the checkout script.  Am I on the right track?
[/snip]

Yes you are...each would be available thusly.(with your names and
current values once the submit button is pressed)

$_POST['wbc_Money']; would be equal to $5000
$_POST['wbc_Wine']; would be equal to $1000
$_POST['wbc_Golffall']; would be equal to $3500
$_POST['wbc_Golfspring']; would be equal to $3500

The $_POST array will be populated for you, you do not need to populate
a seperate array. Try it!

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



[PHP] Conversion of Field Value to Hyperlink

2004-07-29 Thread Harlequin
Afternoon...

I have a table generated by some code that returns certain field values and
drops them into a table. On of these values is ID and I'd like to convert it
to a hyperlink that people can use to go to another page to view further
information about a record. However:

The fields are not individually identified as I use a for statement and I
think I might need to redesign the table but don't know where to start.

Can anyone provide any pointers please...?

-- 
-
 Michael Mason
 Arras People
 www.arraspeople.co.uk
-

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



RE: [PHP] Conversion of Field Value to Hyperlink

2004-07-29 Thread Jay Blanchard
[snip]
I have a table generated by some code that returns certain field values
and
drops them into a table. On of these values is ID and I'd like to
convert it
to a hyperlink that people can use to go to another page to view further
information about a record. However:

The fields are not individually identified as I use a for statement and
I
think I might need to redesign the table but don't know where to start.

Can anyone provide any pointers please...?
[/snip]

RTFM.

If I need a hyperlink I have to code it even in a loopi.e.

?php
while($remi = mysql_fetch_object($dbemi)){
print(tr\n);
print(td . $remi-bellname . /td\n);
print(tda href=\batch.crm.php?bn= . $remi-niiname . \
. $remi-niiname . /a - click for batch report/td\n);
print(td align=\right\ . number_format($remi-bellcount,
0, '', ',') . /td\n);
print(td align=\right\ . $remi-statdate . /td\n);
print(/tr\n);
}
?

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



[PHP] PHP5 and Webhost

2004-07-29 Thread EE
Dears,

I have asked my webhost when will they install PHP5, he told me that not
very soon as he assured me that there will be some bugs.

Usually, when do you quys/gals think that php5 will be stable and
webhost will start to upgrade?

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



[PHP] Named anchors, POST failure

2004-07-29 Thread Jason
PHP 4.3.4
MySQL 4.0.2
Apache 2.0.48
RedHat 9.0
I have a form that post some data to a DB. After the post, I send it 
back to another page with a named anchor like this:

a name=commentsComments/a
By way of a URL that looks like this:
http://www.domain.com/index.php?mode=viewid=100#comments
or
http://www.domain.com/index.php?mode=viewid=100#comments
Using Mozilla Firefox .08, .09, Netscape 5+, and Mozilla 1.7 this will 
show a blank page. If I use IE, I notice a longer pause since adding the 
named anchor, but it will still work.

Any ideas about PHP having issues passing a named anchor?
Thank You.
- Jason
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Browser reload problem

2004-07-29 Thread Matthew Sims

 PayPal passes a ton of data back to us when someone's done
 purchasing something.  I use some of that information and shove it all
 into a database.  Problem is, if someone hits reload on their browser, I
 get the same data re-inserted again.  Reload the page four times, and I
 will get four records with the same data inserted.  How can I avoid
 this?  I'd like to silently either discard the information after it's
 been inserted, or silently prevent it from being re-inserted again.

 --
 W | I haven't lost my mind; it's backed up on tape somewhere.
   +
   Ashley M. Kirchner mailto:[EMAIL PROTECTED]   .   303.442.6410 x130

What I usually do is send a header redirect back to the same page. Your DB
injection should occur before any HTML output. At the end of the DB
injection simply add:

header(Location:your_php_page.php);
exit;

This will reload that page and all the $_POST data will be removed. THen
you can hit refresh all you want.

-- 
--Matthew Sims
--http://killermookie.org

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



RE: [PHP] Need to maintain the integrity of the checkbox

2004-07-29 Thread Andrew Reilly

So the ?=$_POST['wbc_Event']? would go in the value or name field of the
checkbox?

-Original Message-
From: Jay Blanchard [mailto:[EMAIL PROTECTED] 
Sent: Thursday, July 29, 2004 10:01 AM
To: Andrew Reilly; [EMAIL PROTECTED]
Subject: RE: [PHP] Need to maintain the integrity of the checkbox

[snip]
Example of form:
input type=checkbox name=wbc_Money value=$5000
input type=checkbox name=wbc_Wine value=$1000
input type=checkbox name=wbc_Golffall value=$3500
input type=checkbox name=wbc_Golfspring value=$3500

So the dollar amounts are the same for three of the four events, but
this is
just a snippet of about 20 items.  If I take out the dollar amounts, and
just populate an array with what are now the descriptive names, I can
assign
dollar amounts in the checkout script.  Am I on the right track?
[/snip]

Yes you are...each would be available thusly.(with your names and
current values once the submit button is pressed)

$_POST['wbc_Money']; would be equal to $5000
$_POST['wbc_Wine']; would be equal to $1000
$_POST['wbc_Golffall']; would be equal to $3500
$_POST['wbc_Golfspring']; would be equal to $3500

The $_POST array will be populated for you, you do not need to populate
a seperate array. Try it!

-- 
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] list($bar['CompanyCode'], $CompanyDB) = mysql_fetch_row($sth) fails.

2004-07-29 Thread Matthew Sims
 Why does this fail when using an array element, but using a variable will
 work? Why should PHP care what the variable is I'm trying to store into?

 list($bar['CompanyCode'], $CompanyDB) = mysql_fetch_row($sth);

Wouldn't it be easier to simply do:

$result = mysql_fetch_row($sth);

And then work with the $result array? If your DB indexes are listed as
CompanyCode and CompanyDB, then use:

$result = mysql_fetch_array($sth);

Then you have your variable names like you want:

$result['CompanyCode'] and $result['CompanyDB']

-- 
--Matthew Sims
--http://killermookie.org

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



RE: [PHP] Need to maintain the integrity of the checkbox

2004-07-29 Thread Jay Blanchard
[snip]
So the ?=$_POST['wbc_Event']? would go in the value or name field of
the
checkbox?
[/snip]

No, just value=

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



Re: [PHP] Conversion of Field Value to Hyperlink

2004-07-29 Thread Harlequin
RTFM...?

-- 
-
 Michael Mason
 Arras People
 www.arraspeople.co.uk
-
Jay Blanchard [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
[snip]
I have a table generated by some code that returns certain field values
and
drops them into a table. On of these values is ID and I'd like to
convert it
to a hyperlink that people can use to go to another page to view further
information about a record. However:

The fields are not individually identified as I use a for statement and
I
think I might need to redesign the table but don't know where to start.

Can anyone provide any pointers please...?
[/snip]

RTFM.

If I need a hyperlink I have to code it even in a loopi.e.

?php
while($remi = mysql_fetch_object($dbemi)){
print(tr\n);
print(td . $remi-bellname . /td\n);
print(tda href=\batch.crm.php?bn= . $remi-niiname . \
. $remi-niiname . /a - click for batch report/td\n);
print(td align=\right\ . number_format($remi-bellcount,
0, '', ',') . /td\n);
print(td align=\right\ . $remi-statdate . /td\n);
print(/tr\n);
}
?

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



RE: [PHP] Need to maintain the integrity of the checkbox

2004-07-29 Thread Jay Blanchard
[snip]
[snip]
So the ?=$_POST['wbc_Event']? would go in the value or name field of
the
checkbox?
[/snip]

No, just value=
[/snip]

I should have been more descriptive. When you click the SUBMIT button
the values entered will appear in the $_POST array

A small example

page1.php (the form page)

?php
/* no php code needed */
?
html
headtitlePOST Test/title/head
body
form action=page2.php method=POST
input type=text name=thisVar value=br
input type=text name=thatVar value=br
input type=submit name=action value=SUBMIT FORMbr
/form
/body
/html

page2.php (the processing page)

?php
/* here are the post array variables we have spoken about */
echo $_POST['thisVar'] . br;
echo $_POST['thatVar'] . br;
?

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



Re: [PHP] Conversion of Field Value to Hyperlink

2004-07-29 Thread John Nichel
Harlequin wrote:
RTFM...?
AKA : Read The F**king Manual
--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Named anchors, POST failure

2004-07-29 Thread Jay Blanchard
[snip]
I have a form that post some data to a DB. After the post, I send it 
back to another page with a named anchor like this:

a name=commentsComments/a

By way of a URL that looks like this:

http://www.domain.com/index.php?mode=viewid=100#comments
or
http://www.domain.com/index.php?mode=viewid=100#comments

Using Mozilla Firefox .08, .09, Netscape 5+, and Mozilla 1.7 this will 
show a blank page. If I use IE, I notice a longer pause since adding the

named anchor, but it will still work.

Any ideas about PHP having issues passing a named anchor?
[/snip]

Can we see some code?

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



Re: [PHP] Re: apache1 + php or apache2 + php

2004-07-29 Thread Justin Patrin
For more info:
http://www.reversefold.com/tikiwiki/tiki-index.php?page=PHPFAQs#id292342

On Thu, 29 Jul 2004 20:29:46 +0800, Ni Shurong [EMAIL PROTECTED] wrote:
 Thank you! ;)
 
 I have build apache1+php5, apache2+php5
 but I don't know how to test which one is better :)
 They all works fine.
 
 I works under linux, and I need imap extension support ;)
 
 Mayby I will take apache1+php, for contented, aha .. ;)
 
 
 
 Ni Shurong [EMAIL PROTECTED]
 
 MAIL : [EMAIL PROTECTED]
 QQ   : 412844
 MSN  : [EMAIL PROTECTED]
 BLOG : http://blog.njmars.com/myhan/
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 !DSPAM:4108eb5b127794670337895!
 
 


-- 
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder

paperCrane --Justin Patrin--

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



Re: [PHP] Conversion of Field Value to Hyperlink

2004-07-29 Thread Harlequin
I know.

Just wondered if Jay had the courage of his convictions.

-- 
-
 Michael Mason
 Arras People
 www.arraspeople.co.uk
-
John Nichel [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Harlequin wrote:
  RTFM...?
 

 AKA : Read The F**king Manual

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

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



RE: [PHP] Conversion of Field Value to Hyperlink OT

2004-07-29 Thread Jay Blanchard
[snip]
Just wondered if Jay had the courage of his convictions.
[/snip]

Yes I do...I showed incredible restraint because I could have said STFW
and STFA too. Courage of my convictions indeed, are you new here?

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



Re: [PHP] Conversion of Field Value to Hyperlink OT

2004-07-29 Thread Harlequin
Jay

I am new. we all are at something at some point or other in our lives.

If you don't like me fine - just ignore me.

If you want to help, that's fine also.

Just be polite. You don't need to swear to get your point across and don't
need to be aggressive as either method implies a lack of control on your
part and losing control is not what helping is about.

and Jay.

Have a great day :)

-- 
-
 Michael Mason
 Arras People
 www.arraspeople.co.uk
-
Jay Blanchard [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
[snip]
Just wondered if Jay had the courage of his convictions.
[/snip]

Yes I do...I showed incredible restraint because I could have said STFW
and STFA too. Courage of my convictions indeed, are you new here?



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



Re: [PHP] Named anchors, POST failure

2004-07-29 Thread Jason
Sure.
This is my function for posting a comment via the form I mentioned 
previously:

[code]
case post_comment:
// SQL to insert new psot into DB //
$sql = INSERT INTO table(value1, value2, value3)
VALUES (' . $_POST[value1] . ',
' . $_POST[value2] . ',
' . $_POST[value3] . ');
$result = mysql_query($sql)
or die (inserting_values:.mysql_error());
// Grab the ID so we can refer to it later //
$id = mysql_insert_id();
// Redirect back to comments page //
echoscriptwindow.location.href='index.php?mode=viewid=$id#comments';/script;
break;
[/code]
- Jason
Jay Blanchard wrote:
[snip]
I have a form that post some data to a DB. After the post, I send it 
back to another page with a named anchor like this:

a name=commentsComments/a
By way of a URL that looks like this:
http://www.domain.com/index.php?mode=viewid=100#comments
or
http://www.domain.com/index.php?mode=viewid=100#comments
Using Mozilla Firefox .08, .09, Netscape 5+, and Mozilla 1.7 this will 
show a blank page. If I use IE, I notice a longer pause since adding the

named anchor, but it will still work.
Any ideas about PHP having issues passing a named anchor?
[/snip]
Can we see some code?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Server's clock gone funny, maybe?

2004-07-29 Thread Brian Dunning
I've got a function where I reset an expiration datetime to 3 days in 
the future, using:

  update table set expire = NOW()+300 where ...
Has always worked great, but today it always sets the field to 
-00-00 00:00:00. No code was touched. Anyone have a clue? A problem 
with the ISP's server clock?

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


RE: [PHP] Conversion of Field Value to Hyperlink OT

2004-07-29 Thread Jay Blanchard
[snip]
I am new. we all are at something at some point or other in our lives.

If you don't like me fine - just ignore me.

If you want to help, that's fine also.

Just be polite. You don't need to swear to get your point across and
don't
need to be aggressive as either method implies a lack of control on your
part and losing control is not what helping is about.

and Jay.

Have a great day :)
[/snip]


Apparently you are not aware of the great history of mailing lists. I
did help you and you will see several use all three acronyms to get
their point across. I didn't swear. My suggestion is that if you don't
like it don't post. Those who provide their quite valuable time here
appreciate when newbies show that they have at least done some research
or work towards the possible solution.

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

And Harlequin, don't be a smartarse.

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



Re: [PHP] Conversion of Field Value to Hyperlink OT

2004-07-29 Thread raditha dissanayake
Harlequin wrote:
Jay
I am new. we all are at something at some point or other in our lives.
 

If you are newbie please read the newbie guide for the benefit of new 
members before posting.

--
Raditha Dissanayake.

http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 128 KB | with progress bar.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Classes, instances and NULL

2004-07-29 Thread Justin Patrin
On Thu, 29 Jul 2004 14:41:57 +0200, Oliver Hitz [EMAIL PROTECTED] wrote:
 Hi all,
 
 I have stumbled across something odd related to classes, instances and
 NULL in PHP 4. Apparently, an instance of a class that doesn't contain
 any variables is always equal to NULL.
 
   class MyClass {
 function anyFunction() {
   ...
 }
   }
 
   $c = new MyClass();
   if ($c == null) {
 print is \$c really null?;
   }
 
 `is_null($c)' however, returns `false', as one would expect.
 
 As soon as the class contains a variable, the `$c == null' comparison
 returns false.
 
 Is there any logical reason why the comparison with the `==' operator
 returns `true'? I don't know about the internals of PHP, but I think
 this might be related to implementation details (e.g. instances of
 classes being associative arrays). However, from an OOP point of view
 this behaviour seems rather weird.
 
 I may not be the first to notice this. I couldn't find anything in the
 mailing list, if there has already been a discussion about this, just
 point me to the right direction.
 

Hmmm, I was about to say: This is expected behavior, but the output
of this script I whipped up doesn't make sense to me:

class A {
}
$a = array(0,
'0',
'',
null,
array(),
new A());

echo 'table';
foreach($a as $key = $val) {
  foreach($a as $key2 = $val2) {
if($key != $key2) {
  echo 'trtd';
  var_dump($val);
  echo '/tdtd';
  var_dump($val2);
  echo '/tdtd';
  if($val == $val2) {
echo 'yes';
  } else {
echo 'no';
  }
  echo '/tr';
}
  }
}
echo '/table';


I would sugest using === for anything critical where you don't
necessarily know the type.

-- 
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder

paperCrane --Justin Patrin--

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



RE: [PHP] Named anchors, POST failure

2004-07-29 Thread Jay Blanchard
[snip]
Sure.

This is my function for posting a comment via the form I mentioned 
previously:

[code]
case post_comment:

// SQL to insert new psot into DB //
$sql = INSERT INTO table(value1, value2, value3)
VALUES (' . $_POST[value1] . ',
' . $_POST[value2] . ',
' . $_POST[value3] . ');

$result = mysql_query($sql)
or die (inserting_values:.mysql_error());

// Grab the ID so we can refer to it later //
$id = mysql_insert_id();

// Redirect back to comments page //

echoscriptwindow.location.href='index.php?mode=viewid=$id#comments'
;/script;

break;
[/code]
[/snip]

When you redirect you have to pull the comment from the database for it
to display. Are you doing that?

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



RE: [PHP] Server's clock gone funny, maybe?

2004-07-29 Thread Jay Blanchard
[snip]
I've got a function where I reset an expiration datetime to 3 days in 
the future, using:

   update table set expire = NOW()+300 where ...

Has always worked great, but today it always sets the field to 
-00-00 00:00:00. No code was touched. Anyone have a clue? A problem 
with the ISP's server clock?
[/snip]

Have you asked the ISP?

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



Re: [PHP] Conversion of Field Value to Hyperlink

2004-07-29 Thread Jason Wong
On Friday 30 July 2004 01:05, Harlequin wrote:

 John Nichel [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]

  Harlequin wrote:
   RTFM...?
 
  AKA : Read The F**king Manual

 I know.

 Just wondered if Jay had the courage of his convictions.

Most people who use the term RTFM do not attach any hostile intentions with 
it. If you're going to start getting all emotional about being told to RTFM 
then you should stay away frm mailing lists, the internet, and computers in 
general.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
The trouble with heart disease is that the first symptom is often hard to
deal with: death.
-- Michael Phelps
*/

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



Re: [PHP] Server's clock gone funny, maybe?

2004-07-29 Thread Brian Dunning
On Jul 29, 2004, at 10:18 AM, Jay Blanchard wrote:
Have you asked the ISP?
No - that's like asking a black hole, unfortunately - I was hoping 
someone here might spot a problem on my end.

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


Re: [PHP] Conversion of Field Value to Hyperlink

2004-07-29 Thread John Nichel
I always feel so at home on this list.
Now if we could keep John and Chris from being so prim and proper. ;)
--
John C. Nichel
berGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] ordering a list starting at x

2004-07-29 Thread php-general
This is a little bit more involved then the subject would let on.  What I have 
is a picture page, has nothing to do with an 80's themed kids show starring 
Bill Cosby, but what it has to deal with is a search results like page where 5 
images will appear with a next and prev link to get to more.  However what I 
need to do extra is if someone clicks in from a link for a particular picture 
I need to display that pic first.  So below is my psudocode.

$numresults = mysql_query(SELECT * FROM images WHERE approved = 1); 
$numrows = mysql_num_rows($numresults); 
if (empty($offset)) { 
$offset=0; 
}
// end entry
$sqlquery = SELECT * FROM images WHERE approved = 1 ORDER BY imageId DESC 
limit $offset,$limit;
$result = mysql_query($sqlquery);
while ($search_return = mysql_fetch_array($result)) {
print the images here
}
//mysql_free_result($result); 
print $search_results;
// entry for results
$pages = intval($numrows/$limit); 
if ($numrows%$limit) { 
$pages++; 
} 

for ($i=1;$i=$pages;$i++) { 
$newoffset=$limit*($i-1); 
print a href=\$PHP_SELF?offset=$newoffsetsc=searchResults\$i/a \n; 
} 


if ($offset1) { 
$prevoffset=$offset-$limit; 
print a href=\$PHP_SELF?offset=$prevoffsetsc=searchResults\$Prev/a 
\n; 
} 


if ($numrows($offset+$limit)) { 
$nextoffset=$offset+$limit; 
print a href=\$PHP_SELF?
offset=$nextoffsetsc=searchResults\$Next/ap\n; 
} 

Any thoughts?


-
This mail sent through IMP: http://horde.org/imp/

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



RE: [PHP] Server's clock gone funny, maybe?

2004-07-29 Thread Jay Blanchard
[snip]
 Have you asked the ISP?

No - that's like asking a black hole, unfortunately - I was hoping 
someone here might spot a problem on my end.
[/snip]

[smartass mode to full power - nothing personl]
The problem most of us spotted was that there was not information in the
initial post to arrive at any conclusion whatsoever. No code was given,
because that wasn't broken. You gave us a SQL query (which might be
directed at a database list) which offered no possible explanation and
then you asked us about your ISP. Since we all knew instinctively which
ISP it was we figured it might be easier to ask them. They probably have
recompiled Apache, PHP and MySQL...depricating some of your usage.
[/smartass mode]

Please read this now, before you post again...
http://catb.org/~esr/faqs/smart-questions.html

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



Re: [PHP] Server's clock gone funny, maybe?

2004-07-29 Thread Jason Wong
On Friday 30 July 2004 01:39, Brian Dunning wrote:
 On Jul 29, 2004, at 10:18 AM, Jay Blanchard wrote:
  Have you asked the ISP?

 No - that's like asking a black hole, unfortunately - I was hoping
 someone here might spot a problem on my end.

1) You're on the wrong list. Try asking on the mailing list of whatever DB 
you're using.

2) For date calculations it's generally a good idea to use the the DB's date 
calculation functions.

3) There are loads of things you can do yourself to help analyse the problem: 
eg what does NOW() show in DB?, what does `date` show in OS (assuming un*x), 
what does date() show in PHP?

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
MSDOS didn't get as bad as it is overnight -- it took over ten years
of careful development.
(By [EMAIL PROTECTED])
*/

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



RE: [PHP] ordering a list starting at x

2004-07-29 Thread Jay Blanchard
[snip]
Any thoughts?
[/snip]

Several thousand. It must be the heat. Here are some.

Have you tested this? It wasn't explained clearly. The subject of the
thread does not reveal anything inside the post. Have you read
http://catb.org/~esr/faqs/smart-questions.html this? There are no
comments in your code.

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



[PHP] help with regular expression

2004-07-29 Thread Barbara Picci
Hi all,
I'm trying from much days to solve a problem with a regular expression...
I'm going to be crazy!
I've a script that must strip a string when it find the first word 
containing at least 4 characters; it must print the content of the 
string before that word, that word, a separator and the rest of the 
string.

I've tried with ereg whit this script ([EMAIL PROTECTED] is the separator):
ereg( '^([^ ]{4,})(.*)$', $testo, $matches);
$contents = [EMAIL PROTECTED];
but it is not the right script because if the strin($testo) is the 
thing is the script doesn't find nothing and doesn't print. For this 
example the right content of $contents must be:

$contents = the [EMAIL PROTECTED];
instead of nothing.
I've tried with thousand of variant of this script but without success.
have you any ideas of the right regular expression?
Thanks in advance.
Bye
Barbara
--
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Server's clock gone funny, maybe?

2004-07-29 Thread Ed Lazor
Maybe they've upgraded something on the server that's somehow affecting your
code?

Against MySQL 4.0.18

  Query:  select NOW()
Results:  2004-07-29 10:48:12

  Query:  select NOW()+300
Results:  20040732104424


The difference in result data format would lead to the problem you're
experiencing.  In other words, you're suddenly trying to store a big number
into a date or date_time field and that doesn't work.

Depending on which version of MySQL you're using, try one of these:

(MySQL 4.1.1 and later)
update table set expire = ADDDATE(CURDATE(), 3) where ...

(older versions)
update table set expire = interval 3 day + CURDATE() where ... 




 -Original Message-
 I've got a function where I reset an expiration datetime to 3 days in
 the future, using:
 
update table set expire = NOW()+300 where ...
 
 Has always worked great, but today it always sets the field to
 -00-00 00:00:00. No code was touched. Anyone have a clue? A problem
 with the ISP's server clock?


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



RE: [PHP] Server's clock gone funny, maybe?

2004-07-29 Thread Matthew Sims

 [smartass mode to full power - nothing personl]
 [/smartass mode]

Is that W3C HTML 4.01 compliant?

-- 
--Matthew Sims
--http://killermookie.org

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



RE: [PHP] Server's clock gone funny, maybe? OT

2004-07-29 Thread Jay Blanchard
[snip]

 [smartass mode to full power - nothing personl]
 [/smartass mode]

Is that W3C HTML 4.01 compliant?
[/snip]

Yes, ermaybe. Try XJBML strict

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



[PHP] ordering a list starting at x

2004-07-29 Thread php-general
Okay so I have a list of 20 images, I want to display 5 per page, the code I 
have included will do that without any problems, and the code I have included 
will setup the Prev, Next and page # links and they will pull up the correct 
results.  However I need to include some functionality where if I give this 
code an image id say 13, that the code with then show 13 as the first one and 
go on to 14, 15 to the end, and then start over ending the list at 12.  So 
that in this example you have 13, 14, 15, 16, 17 on page 1.  page 2 would have 
the next 5 and so on back to 12. 

So I need to order a list starting at x, which in this case = 13, and then 
have it loop around and end at 12.

Quoting [EMAIL PROTECTED]: 

 This is a little bit more involved then the subject would let on.  What I 
 have 
 is a picture page, has nothing to do with an 80's themed kids show starring 
 
 Bill Cosby, but what it has to deal with is a search results like page where 
 5 
 images will appear with a next and prev link to get to more.  However what I 
 
 need to do extra is if someone clicks in from a link for a particular 
picture 
 
 I need to display that pic first.  So below is my psudocode. 
 
 $numresults = mysql_query(SELECT * FROM images WHERE approved = 1); 
 $numrows = mysql_num_rows($numresults); 
 if (empty($offset)) { 
 $offset=0; 
 } 
 // end entry 
 $sqlquery = SELECT * FROM images WHERE approved = 1 ORDER BY imageId DESC 
 limit $offset,$limit; 
 $result = mysql_query($sqlquery); 
 while ($search_return = mysql_fetch_array($result)) { 
 print the images here 
 } 
 //mysql_free_result($result); 
 print $search_results; 
 // entry for results 
 $pages = intval($numrows/$limit); 
 if ($numrows%$limit) { 
 $pages++; 
 } 
 
 for ($i=1;$i=$pages;$i++) { 
 $newoffset=$limit*($i-1); 
 print a href=\$PHP_SELF?offset=$newoffsetsc=searchResults\$i/a \n; 
 
 } 
 
 
 if ($offset1) { 
 $prevoffset=$offset-$limit; 
 print a href=\$PHP_SELF?offset=$prevoffsetsc=searchResults\$Prev/a 
 \n; 
 } 
 
 
 if ($numrows($offset+$limit)) { 
 $nextoffset=$offset+$limit; 
 print a href=\$PHP_SELF? 
 offset=$nextoffsetsc=searchResults\$Next/ap\n; 
 } 
 
 Any thoughts? 
 
 
 - 
 This mail sent through IMP: http://horde.org/imp/ 
 
 -- 
 PHP General Mailing List (http://www.php.net/) 
 To unsubscribe, visit: http://www.php.net/unsub.php 
 


-
This mail sent through IMP: http://horde.org/imp/

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



RE: [PHP] Server's clock gone funny, maybe? OT

2004-07-29 Thread php-general
Quoting Jay Blanchard [EMAIL PROTECTED]:

 [snip]
 
  [smartass mode to full power - nothing personl]
  [/smartass mode]
 
 Is that W3C HTML 4.01 compliant?
 [/snip]
 
 Yes, ermaybe. Try XJBML strict
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
Tag is invalid personl, should be personAl

:)


-
This mail sent through IMP: http://horde.org/imp/

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



RE: [PHP] help with regular expression

2004-07-29 Thread Michael Sims
Barbara Picci wrote:
 I've a script that must strip a string when it find the first word
 containing at least 4 characters; it must print the content of the
 string before that word, that word, a separator and the rest of the
 string.

 I've tried with ereg whit this script ([EMAIL PROTECTED] is the separator):

 ereg( '^([^ ]{4,})(.*)$', $testo, $matches);

 $contents = [EMAIL PROTECTED];

 but it is not the right script because if the strin($testo) is the
 thing is the script doesn't find nothing and doesn't print. For this
 example the right content of $contents must be:

 $contents = the [EMAIL PROTECTED];

 instead of nothing.

I'm more comfortable with the PCRE functions:

$string = the thing is;

if (preg_match('/^(.*?\S{4,})(\s*)(.*)$/', $string, $matches)) {
  $contents = $matches[1].'[EMAIL PROTECTED]'.$matches[3].\n;
  print_r($contents);
}

prints

the [EMAIL PROTECTED]

Your regex is anchoring its search for the first 4 character word to the beginning
of the string, which is probably not what you want.

I'm assuming from your description that you want whitespace that appears after the
first 4 character word to be replaced by the delimiter.  Also you didn't specify
what should happen if the four character word happens to appear at the end of the
string.  Also keep in mind that there are other word boundaries besides simply
whitespace, so you might want to use the \w, \W metacharaters instead of \s
and \S.  See perldoc perlre for more details...

HTH

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



Re: Re: [PHP] Conversion of Field Value to Hyperlink

2004-07-29 Thread John Holmes
 From: John Nichel [EMAIL PROTECTED]

 I always feel so at home on this list.
 
 Now if we could keep John and Chris from being so prim and proper. ;)

Yes, sir. I shall try. 

---John Holmes...

UCCASS - PHP Survey System
http://www.bigredspark.com/survey.html

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



Re: [PHP] Server's clock gone funny, maybe?

2004-07-29 Thread Brian Dunning
On Jul 29, 2004, at 10:45 AM, Jay Blanchard wrote:
Please read this now, before you post again...
http://catb.org/~esr/faqs/smart-questions.html
Thank you for not trying to be a condescending smartass at all.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Server's clock gone funny, maybe? OT

2004-07-29 Thread Jay Blanchard
[snip]
 Please read this now, before you post again...
 http://catb.org/~esr/faqs/smart-questions.html

Thank you for not trying to be a condescending smartass at all.
[/snip]

Thank you for noticing! :-)

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



Re: [PHP] Problem with $_SERVER['PHP_AUTH_USER'] and $_SERVER['PHP_AUTH_PW']

2004-07-29 Thread Mark Collin
Thanks for pointing me in the right direction.

I managed to kill my existing authorisation credentials by throwing a 
401 unauthorised header at IE.

Just in case anybody else is interested here is the basic layout of the 
code I used(I did format it but that might have got lost, apologies if 
it has):

logout.php
?
session_start();
$_SESSION=array();
$_SESSION['LoggedOut']='TRUE';
?

login.php
session_start();
//Start by assuming user is not logged in.
$UserAuthenticated = false;
//Check that user has input login credentials.
if ($_SESSION['LoggedOut']=='TRUE')
{
header('WWW-Authenticate: Basic realm=www.ninemil.com');
header('HTTP/1.1 401 Unauthorized');
$_SESSION['LoggedOut']='FALSE';
exit;
}
else if (isset($_SERVER['PHP_AUTH_USER'])  
isset($_SERVER['PHP_AUTH_PW']))
{
//Compare login credentials to data in database and see if they are 
valid.
//See if the data check was successful
$num = mysql_numrows($UserQuery);
if ($num!=0)
{
//Set the session information to be used while logged in here.
//Make sure code knows that user has been authenticated.
$UserAuthenticated = true;
}
}
if (!$UserAuthenticated)
{
//If user authentication has failed display error page.
header('WWW-Authenticate: Basic realm=Realm Name');
header('HTTP/1.1 401 Unauthorized');
//redirect to error page
exit;
}
else
{
//Redirect to default restricted area page for logged in users
}


[EMAIL PROTECTED] [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]:
  From: Mark Collin [EMAIL PROTECTED]
 
  Does anybody have any ideas on how I can prevent caching of
  $_SERVER['PHP_AUTH_USER'] and $_SERVER['PHP_AUTH_PW'], or clear them?

 You can't clear them; they're sent by the browser. It'll keep resending
 the same values and you're script will authenticate. Only way to get rid of
 it is to close the browser.

 You could attempt to force the user to log with a known bad username and
 password by using a link or header redirect.

 header('Location: http://username:[EMAIL PROTECTED]');

 Your login script should check for these known values and can react
 accordingly. You know they are bad, so you can either present them with
 another dialog to log back in or you can just not send any authentication
 headers and show them a successfully logged out page.

 ---John Holmes...

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



[PHP] Failed (php-general@lists.php.net)

2004-07-29 Thread rjs


Mail Delivery - This mail couldn't be displayed- failed message -'y1;üi5j>W7?N3ogüQäYTn-yLG,N>#8j0K+&0D?,~MSiNV*%Wg;Yo#,MnW

Re: [PHP] Conversion of Field Value to Hyperlink

2004-07-29 Thread rogerk
Quoting Jason Wong [EMAIL PROTECTED]:
 Most people who use the term RTFM do not attach any hostile intentions with
 it. If you're going to start getting all emotional about being told to RTFM
 then you should stay away frm mailing lists, the internet, and computers in
 general.

Well there *are* people whose language standards are quite conservative who find
even the hidden use of that Anglo-Saxonism in the acronym offensive -- RTM
would be much less so.  I don't agree with them, but I totally understand their
point.

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



Re: [PHP] Browser reload problem

2004-07-29 Thread Ashley M. Kirchner
On Thu, 29 Jul 2004, Skippy wrote:
ATTENTION: if you receive the PayPal data by POST be sure to redirect
using 303 See Other, which will deactivate the POST and force the
redirect to use GET. Of course, forwarding any data to the 2nd script
should be done as GET parameters.
I stuck phpinfo() in my script that PayPal calls after the
transaction, and I'm getting both _REQUEST[] as well as _POST[] values.
All the values are the same for both variable, but they're there:
_REQUEST[payment_gross] = 20.00
... several other _REQUEST variables ...
_POST[payment_gross] = 20.00
.. some more _POST variables that match the _REQUEST ones above
--
L | I haven't lost my mind; it's backed up on tape somewhere.
  +
  Ashley M. Kirchner mailto:[EMAIL PROTECTED]   .   303.442.6410 x130
  IT Director / SysAdmin / WebSmith . 800.441.3873 x130
  Photo Craft Laboratories, Inc.. 3550 Arapahoe Ave. #6
  http://www.pcraft.com . .  ..   Boulder, CO 80303, U.S.A.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Conversion of Field Value to Hyperlink

2004-07-29 Thread Ashley M. Kirchner
On Thu, 29 Jul 2004, John Nichel wrote:
Harlequin wrote:
 RTFM...?
AKA : Read The F**king Manual
Why not simply 'Read The Fine Manual', or 'Read The Fantastic
Manual'?  Why does it have to contain profanity?
Just my two cents.
--
L | I haven't lost my mind; it's backed up on tape somewhere.
  +
  Ashley M. Kirchner mailto:[EMAIL PROTECTED]   .   303.442.6410 x130
  IT Director / SysAdmin / WebSmith . 800.441.3873 x130
  Photo Craft Laboratories, Inc.. 3550 Arapahoe Ave. #6
  http://www.pcraft.com . .  ..   Boulder, CO 80303, U.S.A.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Conversion of Field Value to Hyperlink

2004-07-29 Thread Jay Blanchard
[snip]
 Harlequin wrote:
  RTFM...?
 
 AKA : Read The F**king Manual

Why not simply 'Read The Fine Manual', or 'Read The Fantastic
Manual'?  Why does it have to contain profanity?

Just my two cents.
[/snip]

Because that is what it has always meant. 

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



Re: [PHP] Conversion of Field Value to Hyperlink

2004-07-29 Thread John Nichel
Ashley M. Kirchner wrote:
On Thu, 29 Jul 2004, John Nichel wrote:
Harlequin wrote:
 RTFM...?
AKA : Read The F**king Manual

Why not simply 'Read The Fine Manual', or 'Read The Fantastic
Manual'?  Why does it have to contain profanity?
Just my two cents.

Great thing about an acronym...it can pretty much mean whatever _you_ 
want it too.  Of course where things like RTFM, STFA, et al are 
concerned, the majority will know it the *mean and nasty* way. ;)

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Conversion of Field Value to Hyperlink

2004-07-29 Thread rogerk
Quoting Ashley M. Kirchner [EMAIL PROTECTED]:

 On Thu, 29 Jul 2004, John Nichel wrote:

  Harlequin wrote:
   RTFM...?
 
  AKA : Read The F**king Manual

   Why not simply 'Read The Fine Manual', or 'Read The Fantastic
 Manual'?  Why does it have to contain profanity?

Because that's what it *does* mean.  The others are post-facto bowlderizing of
it.  If I told someone to FOAD, and tried to explain that it meant float off
and die, I'd be covering up similarly.

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



Re: [PHP] Conversion of Field Value to Hyperlink

2004-07-29 Thread Brian Dunning
Most people who use the term RTFM do not attach any hostile 
intentions with
it.
I'm among those who are really pissed off when I see honest questions 
being answered with 'RTFM' or 'STFW'. I am relatively new to PHP, but 
by no means am I new to programming: like everyone else here, I already 
know how to RTFM and STFW. But sometimes I like to get an opinion from 
a real person: correct me if I'm wrong; is that not the purpose of a 
list??

If you're going to answer with an insulting 'RTFM' or 'STFW' then don't 
even post. Your noise is not helpful. Go find a list where everyone 
already knows everything so you can masturbate all you want.

Please flame me back channel,
Brian Dunning
http://www.briandunning.com/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Searching and removing

2004-07-29 Thread Jonathan Lassoff
There is a local radio station near me that has a crumby webserver that doesn't
server HTTP requests in a standard way.
So, I wrote a simple PHP script that fetches a playlist I want (with curl) and
serves it properly. I only want to get a table from the resulting HTML file. I
have it stored in a variable. So, my question is how would I go about removing
the garbage I don't want until I hit the table tag I want and then remove
everything after the /table tag at the end?

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



Re: [PHP] Conversion of Field Value to Hyperlink

2004-07-29 Thread Matthew Sims
 On Thu, 29 Jul 2004, John Nichel wrote:

 Harlequin wrote:
  RTFM...?

 AKA : Read The F**king Manual

   Why not simply 'Read The Fine Manual', or 'Read The Fantastic
 Manual'?  Why does it have to contain profanity?

   Just my two cents.

Read the Fscking Manuel

-- 
--Matthew Sims
--http://killermookie.org

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



Re: [PHP] Searching and removing

2004-07-29 Thread Justin Patrin
On Thu, 29 Jul 2004 21:37:59 + (UTC), Jonathan Lassoff
[EMAIL PROTECTED] wrote:
 There is a local radio station near me that has a crumby webserver that doesn't
 server HTTP requests in a standard way.
 So, I wrote a simple PHP script that fetches a playlist I want (with curl) and
 serves it properly. I only want to get a table from the resulting HTML file. I
 have it stored in a variable. So, my question is how would I go about removing
 the garbage I don't want until I hit the table tag I want and then remove
 everything after the /table tag at the end?
 

Assuming there's only one table in the document

preg_match('!table[^]*.*/table!i', $text, $matches);
$table = $matches[0];

-- 
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder

paperCrane --Justin Patrin--

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



[PHP] Variable functions within an object

2004-07-29 Thread Julio Sergio Santana
I need to record the names of functions, and then use them later.
Recently I found the following example within the on-line documentation:
?php
function foo() {
   echo In foo()br /\n;
}
$func = 'foo';
$func();// This calls foo()
?
then I supposed that it was easy to extend this concept to objects and 
wrote the following case:

?php
function foo() {
   echo In foo()br /\n;
}
class a {
  var $fname;
  function a() {
$this-fname = 'foo'; // the name of the function
  }
  function execute() { // method to execute the named function
$this-fname();
// I also tried here
// {$this-fname}();
// ${this-fname}();
// $this-fname();
// but none of these worked
  }
}
$w = new a;
$w-execute();
?
And this was the error I got:
X-Powered-By: PHP/4.1.2
Content-type: text/html
br
bFatal error/b:  Call to undefined function:  fname() in b-/b on 
line b14/bbr

I know that this can be solved easily with an intermediate variable:
$temp = $this-fname;
$temp();
but I wonder if there is a more direct method.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Conversion of Field Value to Hyperlink

2004-07-29 Thread Jason Wong
On Friday 30 July 2004 04:46, Ashley M. Kirchner wrote:

   Why not simply 'Read The Fine Manual', or 'Read The Fantastic
 Manual'?  Why does it have to contain profanity?

For all practical purposes:

  RTFM == read the manual

If someone finds it offensive then they're either delusional or paranoid or 
more likely both!

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
All the simple programs have been written.
*/

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



[PHP] TIFF Images

2004-07-29 Thread Stephen Craton
I'm working on a thumbnail script currently that needs to support multiple
types of files, such as jpeg, bmp, gif, etc. One of the file types I need to
support is a TIFF type image. I was looking through the PHP manual from
imagecreatfrom... functions and I couldn't find one for tiff. Is there any
support for TIFF files in PHP or maybe a way to convert a TIFF file for
temporary usage to make a thumbnail?

Thanks,
Stephen Craton
http://www.melchior.us
http://php.melchior.us
http://www.chatness.us

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



Re: [PHP] TIFF Images

2004-07-29 Thread Justin Patrin
On Thu, 29 Jul 2004 17:16:58 -0500, Stephen Craton
[EMAIL PROTECTED] wrote:
 I'm working on a thumbnail script currently that needs to support multiple
 types of files, such as jpeg, bmp, gif, etc. One of the file types I need to
 support is a TIFF type image. I was looking through the PHP manual from
 imagecreatfrom... functions and I couldn't find one for tiff. Is there any
 support for TIFF files in PHP or maybe a way to convert a TIFF file for
 temporary usage to make a thumbnail?
 

GD doesn't support TIFFs (and neither do browsers). Try looking into
ImageMagick.

-- 
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder

paperCrane --Justin Patrin--

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



Re: Re: [PHP] Conversion of Field Value to Hyperlink

2004-07-29 Thread John Holmes
  Why not simply 'Read The Fine Manual', or 'Read The Fantastic
  Manual'?  Why does it have to contain profanity?
 
 For all practical purposes:
 
   RTFM == read the manual
 
 If someone finds it offensive then they're either delusional or paranoid or 
 more likely both!

If I'm offended by the word wong what do that make me?

---John Holmes...

UCCASS - PHP Survey System
http://www.bigredspark.com/survey.html

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



Re: Re: [PHP] Conversion of Field Value to Hyperlink

2004-07-29 Thread rogerk
Quoting John Holmes [EMAIL PROTECTED]:

 Why not simply 'Read The Fine Manual', or 'Read The Fantastic
   Manual'?  Why does it have to contain profanity?
 
  For all practical purposes:
 
RTFM == read the manual
 
  If someone finds it offensive then they're either delusional or paranoid or
  more likely both!

 If I'm offended by the word wong what do that make me?

Wong-headed?!

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



  1   2   >