Re: [PHP] popen() in 4.3.2

2003-06-08 Thread Jeff Harris
Wow. 6 minutes for a response. Of course, I thought my error was in the
popen(), not fread(), so I didn't even check there. I've just fixed the
code, and it works! Thanks, Philip.


On Jun 8, 2003, "Philip Olson" claimed that:

|
|PHP 4.3.0-1 has a bug that made your previous code "work",
|have a look at the fread() docs for why, here's a quote:
|
|  "Note:  When reading from network streams or pipes, such
|   as those returned when reading remote files or from
|   popen() and proc_open(), reading will stop after a packet
|   is available.  This means that you should collect the data
|   together in chunks as shown in the example below."
|
|It goes on to show that you must loop threw it to get
|fread() to do what you want in the below code.  Although,
|the example it eludes to is wrong (a correct example will
|show when the manual next builds), you get the point... :)
|
|Regards,
|Philip
|
|
|On Sat, 7 Jun 2003, Jeff Harris wrote:
|
|> My webhost just upgraded to php 4.3.2, and now I have a problem with
|> popen. I'm opening an output buffer then piping it through htmltidy to
|> make nice looking output.
|>
|>  ob_start();
|> // Other unimportant coding goes here
|>
|>  $str=addslashes(ob_get_contents());
|>  $fp=popen("echo \"" . $str . "\" | /bin/tidy - config /my/home/htmlrc", "r");
|>  @$newstr=fread($fp, 99);
|>  ob_end_clean();
|>  header("Last-Modified: " . $gmt_modtime);
|>  header( "Content-length: " . strlen( $newstr ) );
|>  echo stripslashes($newstr);
|> ?>
|>
|>
|> This code worked perfectly before the upgrade, now "strlen( $newstr )" is
|> only getting back 4096 bytes. Is anybody else having this issue, and how
|> can I fix this? I don't see any configuration setting that looks like it
|> fits to this situation. It is running under redhat with Apache/1.3.27
|>
|> Thanks, Jeff
|> --

-- 
Registered Linux user #304026.
"lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import"
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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



Re: [PHP] Newman's Problem with Images.

2003-06-08 Thread Don Read

On 05-Jun-2003 Philip J. Newman wrote:
> My problem is this:
> 
> I have a site that has 3 levels of access.
> 
> 1,2,3  
> 
> when i upload files to say $unixtimestamp/image1.jpg anyone can list the
> images in this directory $unixtimestamp/.  I would like to hide the
> images out side the doc root ... is this possable .. so i can load
> something like /image/image.php?no=1 and it loads
> $unixtimestamp/image1.jpg if the access level is right .. else it would
> load nothing  
> 
> Any Ideas where to start?
> 
> 

http://marc.theaimsgroup.com/?l=php-general

search on Subject: 'Images out side the wwwroot'

Regards,
-- 
Don Read   [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to 
   steal the neighbor's newspaper, that's the time to do it.

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



[PHP] FILE UPLOAD Q

2003-06-08 Thread nabil
Please help me , I want to make any user on my website to submit his CV , or
any file to a temp folder, the following script create a "fupload" file ,
and I don't want to dump the original in it, I want to upload the file as it
is, with its extension...

by example




Listing 9.14 A file upload script

http://localhost/temps\uploads";;

foreach( $HTTP_POST_FILES as $file_name => $file_array ) {
 print "path: ".$file_array['tmp_name']."\n";
 print "name: ".$file_array['name']."\n";
 print "type: ".$file_array['type']."\n";
 print "size: ".$file_array['size']."\n";

 if ( is_uploaded_file( $file_array['tmp_name'] )
  && $file_array['type'] == "text/plain" ) {
  move_uploaded_file( $file_array['tmp_name'], "$file_dir/$file_name")
   or die ("Couldn't copy");
  print "\n\n";
 }
}

?>










/



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



Re: [PHP] FILE UPLOAD Q

2003-06-08 Thread Philip Olson

That article is pretty old, and the code sucks.  
Read this instead:

  http://www.php.net/features.file-upload

It will explain everything.

Regards,
Philip


On Sun, 8 Jun 2003, nabil wrote:

> Please help me , I want to make any user on my website to submit his CV , or
> any file to a temp folder, the following script create a "fupload" file ,
> and I don't want to dump the original in it, I want to upload the file as it
> is, with its extension...
> 
> by example
> 
> 
> 
> 
> Listing 9.14 A file upload script
> 
>  
> $file_dir = "C:\\Inetpub\\wwwroot\\temps\\uploads";
> $file_url = "http://localhost/temps\uploads";;
> 
> foreach( $HTTP_POST_FILES as $file_name => $file_array ) {
>  print "path: ".$file_array['tmp_name']."\n";
>  print "name: ".$file_array['name']."\n";
>  print "type: ".$file_array['type']."\n";
>  print "size: ".$file_array['size']."\n";
> 
>  if ( is_uploaded_file( $file_array['tmp_name'] )
>   && $file_array['type'] == "text/plain" ) {
>   move_uploaded_file( $file_array['tmp_name'], "$file_dir/$file_name")
>or die ("Couldn't copy");
>   print "\n\n";
>  }
> }
> 
> ?>
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> /
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


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



[PHP] remote file moddatetime

2003-06-08 Thread Warren Vail
I am trying to upload a file using php's ftp functions between two RedHat
7.3 systems.  I'd like to make sure the destination file has the same
modification date as the source file, so that I can later compare to see if
it has been modified on the remote machine, but not sure how to approach
this.  I tried to use the SITE command to pass a touch command, but that
didn't work.
Other than the obvious places, where do I go from here?

thanks in advance,

Warren Vail
[EMAIL PROTECTED]


[PHP] Newman Asks, Changeing to CAPS?

2003-06-08 Thread Philip J. Newman
Is there a way of changing only the 1st letter of a string to caps and the rest to 
lower?

eg: foo bar 
  to
  Foo Bar

??

/ Phil
PhilipNZ.com
[EMAIL PROTECTED]

[PHP] Re: Newman Isn't trying very hard

2003-06-08 Thread Jean-Christian Imbeault
Philip J. Newman wrote:
Is there a way of changing only the 1st letter of a string to caps and the rest to lower?

eg: foo bar 
  to
  Foo Bar
Newman, search the PHP documentation before posting will you?

What you want is the function called ucwords()

http://jp.php.net/manual/en/function.ucwords.php

Jc

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


Re: [PHP] Re: Using register_globals

2003-06-08 Thread Don Read

On 08-Jun-2003 Philip Olson wrote:
> [snip]
>> 
>> 
>> register_globals=off won't make good code any better --it's just 
>> a safety net for the sloppy coders.
> [snip]
> 
> In some sense, register_globals = off makes both bad and
> good code better, because it means less pollution.   So
> many unused variables get defined with register_globals
> on and this means wasted memory/resources.  Pollution 
> makes any environment worse!  Granted this isn't what you
> meant, but still... ;)
> 

Also true. 

On namespace pollution  --based on some of the replies I've seen on the
list, there's a sizable number of neophyte (and too many veteran) coders
that are starting scripts with:

http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Checking for Valid Charactors.

2003-06-08 Thread Philip J. Newman
I would liek to check for 0-9 and . charactors i'm using ...

$email = "60.00";

if eregi("^[0-9.])?$",$email) {

echo"valid";

} else {

echo"not valid";

}

Its not working well. umm ... help ...

Re: [PHP] Re: Using register_globals

2003-06-08 Thread Philip Olson
> On 08-Jun-2003 Philip Olson wrote:
> > [snip]
> >> 
> >> 
> >> register_globals=off won't make good code any better --it's just 
> >> a safety net for the sloppy coders.
> > [snip]
> > 
> > In some sense, register_globals = off makes both bad and
> > good code better, because it means less pollution.   So
> > many unused variables get defined with register_globals
> > on and this means wasted memory/resources.  Pollution 
> > makes any environment worse!  Granted this isn't what you
> > meant, but still... ;)
> > 
> 
> Also true. 
> 
> On namespace pollution  --based on some of the replies I've seen on the
> list, there's a sizable number of neophyte (and too many veteran) coders
> that are starting scripts with:
> 
>  extract($_GET); extract($_POST); extract($_COOKIE);
> ...
> 
> And so far, I don't recall anybody mention that you need to
> unset($admin, $internal_var, $nukenewyork, ...) afterwards.
> 
> So nothing's really changed. 
> Bad code will mysteriously go tits-up (or worse) and good code will 
> keep on cranking.
> 
> No matter what register_globals= is set to.

Anyone that would suggest using extract() like that would
only do so to quickly make a register_globals dependent
script work (using .htaccess would be preferred there). I
doubt people actually do that for new code, well, at least 
anyone with half a brain.

Regards,
Philip


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



[PHP] SESSION ISSUES

2003-06-08 Thread Dale
HELP? I AM ABOUT TO PULL MY HAIR OUT?

I have already spent time reading over the online php manual and I still
can't figure a way around this issue. I notice that when I start a session
and I create session variables, those variables are attached to the specific
domain. For example:

both of the urls point to the same place:

http://www.test.com/start.php

http://ww2.test.com/start.php

I have noticed however that if you create a session variable in the
following file http://www.test.com/start.php
and try to access from a file http://www2.test.com/access.php the variable
will not exist.

The reason I am asking all these questions is that in my code I need the
ability to do a re-direct to a secure site such as https://secure.test.com
but still maintain all of the session variables and keep the same session
open.

Any ideas?

Thanks,
Dale



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



Re: [PHP] Checking for Valid Charactors.

2003-06-08 Thread Jason Wong
On Sunday 08 June 2003 16:22, Philip J. Newman wrote:
> I would liek to check for 0-9 and . charactors i'm using ...
>
> $email = "60.00";
>
> if eregi("^[0-9.])?$",$email) {
>
> echo"valid";
>
> } else {
>
> echo"not valid";
>
> }
>
> Its not working well. umm ... help ...

  eregi("^([0-9.])*$", $string)

will match:
  an empty string
  a string containing only 0-9 and periods

It is better for you to learn the preg_*() functions instead of the ereg*() 
ones.

-- 
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
--
/*
This fortune is false.
*/


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



Re: [PHP] SESSION ISSUES

2003-06-08 Thread Jason k Larson
http://us2.php.net/manual/en/function.session-set-cookie-params.php

set the domain strictly to "test.com" not "subdomain.test.com" etc etc

--
Jason k Larson


Dale wrote:

HELP? I AM ABOUT TO PULL MY HAIR OUT?

I have already spent time reading over the online php manual and I still
can't figure a way around this issue. I notice that when I start a session
and I create session variables, those variables are attached to the specific
domain. For example:
both of the urls point to the same place:

http://www.test.com/start.php

http://ww2.test.com/start.php

I have noticed however that if you create a session variable in the
following file http://www.test.com/start.php
and try to access from a file http://www2.test.com/access.php the variable
will not exist.
The reason I am asking all these questions is that in my code I need the
ability to do a re-direct to a secure site such as https://secure.test.com
but still maintain all of the session variables and keep the same session
open.
Any ideas?

Thanks,
Dale




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


Re: [PHP] Checking for Valid Charactors.

2003-06-08 Thread Philip J. Newman
thanks

- Original Message -
From: "Jason Wong" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, June 08, 2003 8:57 PM
Subject: Re: [PHP] Checking for Valid Charactors.


> On Sunday 08 June 2003 16:22, Philip J. Newman wrote:
> > I would liek to check for 0-9 and . charactors i'm using ...
> >
> > $email = "60.00";
> >
> > if eregi("^[0-9.])?$",$email) {
> >
> > echo"valid";
> >
> > } else {
> >
> > echo"not valid";
> >
> > }
> >
> > Its not working well. umm ... help ...
>
>   eregi("^([0-9.])*$", $string)
>
> will match:
>   an empty string
>   a string containing only 0-9 and periods
>
> It is better for you to learn the preg_*() functions instead of the
ereg*()
> ones.
>
> --
> 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
> --
> /*
> This fortune is false.
> */
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



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



[PHP] A Question with heredoc

2003-06-08 Thread Simon Coggins
Hi
I'm writing a wrapper for some mailman archives and i'm trying to put
them message into a variable as in:

$body = <<   
  
   

Error:
Warning: Unexpected character in input: '' (ASCII=12) state=5 in
test.html on line 6

Is there any way I can stop it complaining about it. Or is there
another way I can put the the text into the string (it's done via a
template file and a string substitution). The contents could be
anything so I thougth heredoc would work..

Thanks in advance.. I'm not on the list so please reply to me directly.

Regards
Simon

-- 
Simon Coggins (SAGE-AU Member)Email: [EMAIL PROTECTED]
Network and System Management Officer Phone: +61-2-4221-3775
Information Technology Systems (ITS)  Mobile: 0408 115861
University of Wollongong, 2522, Australia Fax:   +61-2-4229-1985


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



[PHP] project users manual howto

2003-06-08 Thread daniel
hi there i have nearly completed a project in php and need to find
different approaches in creating user manuals , is there any tutorials or
howtos out there and i am not talkin about phpdoc this is code doc level i
need to find a good approach at creating the users level documentation let
me know thanks.



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



[PHP] HELP PLEASE

2003-06-08 Thread nabil
AGES AND TRYING TO FIND A GOOD RSS CREATOR , PLEASE HELP, NOTE THAT I TRIED
http://www.phpclasses.org  . PHP Classes Repository

  BUT I DIDN'T MANAGE

  PLEASE HELP ME



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



[PHP] Re: PATH_TRANSLATED

2003-06-08 Thread Øystein Håland

"Dvdmandt" <[EMAIL PROTECTED]> skrev i meddelandet
news:[EMAIL PROTECTED]
> Are you sure it doesn't work? I thought it didn't at first, that variable
> doesn't exist unless you call the script with a index.php/dir/file.txt if
> you get what I mean... This was my case, pretty long ago so maybe things
> have changed...

I'm sure and I'm sure it works on the Linux box where my pages is placed.
This is not a question of writing a fuctional code, but writing correct
code! In my perspective that means platform independent!
(btw: the problem occure i my update script:
 if (date("M",filemtime($_SERVER['PATH_TRANSLATED']))=="Jan") {..}
)

> "ØYstein HåLand" <[EMAIL PROTECTED]> skrev i meddelandet
> news:[EMAIL PROTECTED]
> > Is there some way to retrieve the phpvariable PATH_TRANSLATED on my
local
> > win2k+Apache2+php4.3.2 box?
> > Using phpinfo() does not show PATH_TRANSLATED
> >
> >
>
>



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



Re: [PHP] project users manual howto

2003-06-08 Thread Armand Turpel
With phpdoc you can also make user level docs. Read the manual.



- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, June 08, 2003 11:38 AM
Subject: [PHP] project users manual howto


> hi there i have nearly completed a project in php and need to find
> different approaches in creating user manuals , is there any tutorials or
> howtos out there and i am not talkin about phpdoc this is code doc level i
> need to find a good approach at creating the users level documentation let
> me know thanks.
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>



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



Re: [PHP] Re: use print

2003-06-08 Thread مضر
thanks to replay
I wont to print to paper printer 


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



[PHP] Linux question with mysql

2003-06-08 Thread AzFLSite
I just installed the rpm for mysql 4 on Redhat 7.1.
Now the service is running, but I cannot go to a
command line and type in mysql to get to the mysql
command prompt. Did I install it wrong? Do I need to
add a path like you would in windows (Enviroment
Paths)?

Thanks
Silly

__
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

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



Re: [PHP] Re: use print

2003-06-08 Thread Jean-Christian Imbeault
مضë wrote:
thanks to replay
I wont to print to paper printer 
If you mean to have the user print to a paper printer what he sees in 
his web browser then that has nothing to do with PHP.

Printing from a web browser is controlled by the web browser. PHP cannot 
affect the way a web browser prints.

Did I understand you question correctly?

Jean-Christian Imbeault

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


[PHP] Re: Linux question with mysql

2003-06-08 Thread Jean-Christian Imbeault
Azflsite wrote:

You just high jacked someone else's thread. Please don't do that.

I just installed the rpm for mysql 4 on Redhat 7.1.
Now the service is running, but I cannot go to a
command line and type in mysql to get to the mysql
command prompt. Did I install it wrong? Do I need to
add a path like you would in windows (Enviroment
Paths)?
Furthermore this is a PHP list ... for MySQL support you would be much 
better off posting to a MySQL list no? ;)

Unless of course there *was* something related to PHP in your question 
that I somehow missed?

Jean-Christian Imbeault

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


Re: [PHP] Sorry, I cannot run apxs

2003-06-08 Thread Pentothal
"Philip Olson" wrote:

> What do these commands output?
>
> # /usr/sbin/httpd -v

Server version: Apache/2.0.46
Server built:   Jun  8 2003 02:59:44

> # /usr/sbin/apxs -q SBINDIR

apxs -q SBINDIR
/usr/sbin
apxs:Error: /usr/bin/apr-config not found!.

> # /usr/sbin/apxs -q TARGET

/usr/sbin/apxs -q TARGET
httpd
apxs:Error: /usr/bin/apr-config not found!.

It looks like my apxr relies on apr-config.
I've extracted an apxs from a previous rpm and it looks like
configure is working now.


Thanks a lot.



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



RE: [PHP] Checking for Valid Charactors.

2003-06-08 Thread John W. Holmes
> From: Jason Wong [mailto:[EMAIL PROTECTED]
> > On Sunday 08 June 2003 16:22, Philip J. Newman wrote:
> > I would liek to check for 0-9 and . charactors i'm using ...
> >
> > $email = "60.00";
> >
> > if eregi("^[0-9.])?$",$email) {
> >
> > echo"valid";
> >
> > } else {
> >
> > echo"not valid";
> >
> > }
> >
> > Its not working well. umm ... help ...
> 
>   eregi("^([0-9.])*$", $string)
> 
> will match:
>   an empty string
>   a string containing only 0-9 and periods
> 
> It is better for you to learn the preg_*() functions instead of the
> ereg*()
> ones.

FYI, that code will also allow a string such as "99.4.3223...04..."

If that's not desirable, you could look into using the is_float() or
is_numeric() functions, or a regex such as:

if(preg_match('/^[0-9]*\.?[0-9]+$/',$string))
{ echo "good"; }
else
{ echo "bad"; }

That will allow text/numbers with or without a period. 

---John W. Holmes...

Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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



RE: [PHP] SESSION ISSUES

2003-06-08 Thread John W. Holmes
> HELP? I AM ABOUT TO PULL MY HAIR OUT?

I can't tell from here... move closer to the monitor. 
 
> I have already spent time reading over the online php manual and I
still
> can't figure a way around this issue. I notice that when I start a
session
> and I create session variables, those variables are attached to the
> specific
> domain. For example:
> 
> both of the urls point to the same place:
> 
> http://www.test.com/start.php
> 
> http://ww2.test.com/start.php
> 
> I have noticed however that if you create a session variable in the
> following file http://www.test.com/start.php
> and try to access from a file http://www2.test.com/access.php the
variable
> will not exist.
> 
> The reason I am asking all these questions is that in my code I need
the
> ability to do a re-direct to a secure site such as
https://secure.test.com
> but still maintain all of the session variables and keep the same
session
> open.

Session IDs are passed in cookies. Cookies are, by default, set to the
current domain. So a cookie set on 'www.test.com' will not be available
to 'ww2.test.com'. 

You can try to adjust the cookie domain property to 'test.com' like
someone else mentioned, or pass the session ID in the URL when linking
to the other domain. This will only work if both domains use the same
directory for storing session files, though. 

---John W. Holmes...

Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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



Re: [PHP] How to determine if output buffering is on?

2003-06-08 Thread Shawn McKenzie
Thanks Leif.  I hoping to get something for vers of PHP < 4.2.  From my
earlier post:

The following never echos STARTING!!!

ob_end_flush();
if(ob_get_contents() == FALSE) {
echo "STARTING!!!";
ob_start();
}

also tried:  if(ob_get_contents() === FALSE)
and: if(!ob_get_contents())
and:  if(ob_get_contents() == "")

But I do get the following notice at the ob_end_flush(); line which tells me
that output buffering is not on:

Notice: ob_end_flush() [ref.outcontrol]: failed to delete buffer default
output handler.

Thanks!
Shawn

"Leif K-Brooks" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Yay, a hack!  The correct answer is ob_get_level().
>
> Jim Lucas wrote:
>
> >output some html and then try and do an header() redirect.
> >
> >if it works, then some sort of buffering is turned on.
> >
> >if it fails and tells you that output has already been sent to the
browser,
> >then it isn't turned on.
> >
> >Jim Lucas
> >- Original Message -
> >From: "Shawn McKenzie" <[EMAIL PROTECTED]>
> >To: <[EMAIL PROTECTED]>
> >Sent: Saturday, June 07, 2003 7:39 AM
> >Subject: [PHP] How to determine if output buffering is on?
> >
> >
> >
> >
> >>O.K.  so how can I determine if output buffering has been started???
> >>
> >>Thanks!
> >>Shawn
> >>
> >>
> >>
> >>--
> >>PHP General Mailing List (http://www.php.net/)
> >>To unsubscribe, visit: http://www.php.net/unsub.php
> >>
> >>
> >>
> >>
> >
> >
> >
> >
>
> -- 
> The above message is encrypted with double rot13 encoding.  Any
unauthorized attempt to decrypt it will be prosecuted to the full extent of
the law.
>
>




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



php-general Digest 8 Jun 2003 16:02:27 -0000 Issue 2105

2003-06-08 Thread php-general-digest-help

php-general Digest 8 Jun 2003 16:02:27 - Issue 2105

Topics (messages 150628 through 150672):

thumbnail program
150628 by: Artoo
150630 by: Philip Olson
150631 by: John W. Holmes
150634 by: Artoo
150637 by: Philip Olson

Re: fsockopen and SSL
150629 by: Philip Olson

Re: file upload script
150632 by: Philip Olson

XML Parser Problem
150633 by: Dustin Pate
150635 by: Philip Olson
150639 by: Dustin Pate

help with php_pdf?
150636 by: Pawl Rachet

Re: Using register_globals
150638 by: Don Read
150640 by: Philip Olson
150653 by: Don Read
150655 by: Philip Olson

HARDWARE ID WITH PHP
150641 by: nabil

popen() in 4.3.2
150642 by: Jeff Harris
150643 by: Philip Olson
150645 by: Jeff Harris

Re: TIMESTAMP -> Y-m-d
150644 by: Don Read

Re: Newman's Problem with Images.
150646 by: Don Read

FILE UPLOAD Q
150647 by: nabil
150648 by: Philip Olson

remote file moddatetime
150649 by: Warren Vail

Newman Asks, Changeing to CAPS?
150650 by: Philip J. Newman

Re: Newman Isn't trying very hard
150651 by: Jean-Christian Imbeault
150652 by: Jean-Christian Imbeault

Checking for Valid Charactors.
150654 by: Philip J. Newman
150657 by: Jason Wong
150659 by: Philip J. Newman
150670 by: John W. Holmes

SESSION ISSUES
150656 by: Dale
150658 by: Jason k Larson
150671 by: John W. Holmes

A Question with heredoc
150660 by: Simon Coggins

project users manual howto
150661 by: daniel.electroteque.org
150664 by: Armand Turpel

HELP PLEASE
150662 by: nabil

Re: PATH_TRANSLATED
150663 by: Øystein Håland

Re: use print
150665 by: ãÖÑ
150667 by: Jean-Christian Imbeault

Linux question with mysql
150666 by: AzFLSite
150668 by: Jean-Christian Imbeault

Re: Sorry, I cannot run apxs
150669 by: Pentothal

Re: How to determine if output buffering is on?
150672 by: Shawn McKenzie

Administrivia:

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

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

To post to the list, e-mail:
[EMAIL PROTECTED]


--
--- Begin Message ---
Anyone know of a good free thumbnail program that can be called from a PHP
script using the exec() call or something similar?

Thanks


--- End Message ---
--- Begin Message ---

On Sat, 7 Jun 2003, Artoo wrote:

> Anyone know of a good free thumbnail program that can be called from a PHP
> script using the exec() call or something similar?

By far, the most popular are the tools offered by 
ImageMagick, such as mogrify:

  http://www.imagemagick.org/www/mogrify.html

Regards,
Philip

--- End Message ---
--- Begin Message ---
> Anyone know of a good free thumbnail program that can be called from a
PHP
> script using the exec() call or something similar?

Netpbm is used by Gallery. Works very well. 

---John W. Holmes...

Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/


--- End Message ---
--- Begin Message ---
thanks.  I'll give that a try.  Happen to know where to get sample code that
uses this program?

"Philip Olson" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> On Sat, 7 Jun 2003, Artoo wrote:
>
> > Anyone know of a good free thumbnail program that can be called from a
PHP
> > script using the exec() call or something similar?
>
> By far, the most popular are the tools offered by
> ImageMagick, such as mogrify:
>
>   http://www.imagemagick.org/www/mogrify.html
>
> Regards,
> Philip
>


--- End Message ---
--- Begin Message ---
On Sun, 8 Jun 2003, Artoo wrote:

> thanks.  I'll give that a try.  Happen to know where to get sample code that
> uses this program?

After doing a google search for the terms mogrify php:

  http://www.google.com/search?q=mogrify+php

The first result was this article, it appears to touch
on the subject:
  
  Resizing Images with PHP and Mogrify
  http://www.phpbuilder.com/columns/michael20020712.php3

I'm sure there are many more examples around, and
including PHP in the search field of google is very 
much optional.  But, I guess this all depends on your
knowledge of PHP...  Maybe thumbnail is another good
search term to throw into the mix.

Regards,
Philip

> "Philip Olson" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> >
> > On Sat, 7 Jun 2003, Artoo wrote:
> >
> > > Anyone know of a good free thumbnail program that can be called from a
> PHP
> > > script using the exec() call or something similar?
> >
> > By far, the most popular are the tools offered by
> > ImageMagick, such as mogrify:
> >
> >   http://www.imagemagick.org/www/mogrify.

Re: [PHP] A Question with heredoc

2003-06-08 Thread Richard Baskett
Im not sure if this is your problem, but it was mine awhile ago :)

Make sure there are no spaces after closing off heredoc.. so on your line:

EOF;

Make sure there is nothing except a hard return, no spaces, no characters..
nothing!

Cheers!

Rick

"By three methods we may learn wisdom: First, by reflection which is
noblest; second, by imitation, which is the easiest; and third, by
experience, which is the bitterest." - Confucius

> From: Simon Coggins <[EMAIL PROTECTED]>
> Reply-To: [EMAIL PROTECTED]
> Date: Sun, 8 Jun 2003 19:10:06 +1000
> To: [EMAIL PROTECTED]
> Subject: [PHP] A Question with heredoc
> 
> Hi
> I'm writing a wrapper for some mailman archives and i'm trying to put
> them message into a variable as in:
> 
> $body = << text here.
> EOF;
> 
> But I'm getting an error because of some charactors. ^L to be
> specific. If the text contains a control char I get:
> 
> Code:
> 
>  $test = << line 1  
> ^L  
> line 2  
> EOF;
> echo $test;  
> ?>   
>
> 
> Error:
> Warning: Unexpected character in input: '' (ASCII=12) state=5 in
> test.html on line 6
> 
> Is there any way I can stop it complaining about it. Or is there
> another way I can put the the text into the string (it's done via a
> template file and a string substitution). The contents could be
> anything so I thougth heredoc would work..
> 
> Thanks in advance.. I'm not on the list so please reply to me directly.
> 
> Regards
> Simon
> 
> -- 
> Simon Coggins (SAGE-AU Member)Email: [EMAIL PROTECTED]
> Network and System Management Officer Phone: +61-2-4221-3775
> Information Technology Systems (ITS)  Mobile: 0408 115861
> University of Wollongong, 2522, Australia Fax:   +61-2-4229-1985
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


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



[PHP] can't call htpasswd using PHP

2003-06-08 Thread Billy
Dear all,

i can't call the "htpasswd" command after i used RedHat 8  ( which i can do
so in Red Hat 7.2)

do u have any idea/ suggestion?

thx a lot
HPS



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



Re: [PHP] HARDWARE ID WITH PHP

2003-06-08 Thread Marek Kilimajer
You need to execute an external program (hdparm in linux) and catch its 
output.

nabil wrote:
Can anyone tell me if i can get the Hardisk serial number, by  php code?





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


[PHP] Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in f:\.....\none.php on line 286

2003-06-08 Thread Marcelo Luiz de Laia
What this message means?

What it is the error?

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result
resource in f:\.\none.php on line 286


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.488 / Virus Database: 287 - Release Date: 5/6/2003


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



Re: [PHP] Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in f:\.....\none.php on line 286

2003-06-08 Thread Marcelo Luiz de Laia
What this message means?

What it is the error?

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result
resource in f:\.\none.php on line 42

This is the code.

Thanks very much.

Marcelo


";
$content .=" Últimos 10 Concursos";
$content .= "";

\\ line 42
while (list($categoria, $nombre, $datafim, $counter) =
mysql_fetch_row($result, $dbi)) {

$content .= " $categoria
 $nombre ";

}

$content .= "";

?>


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.488 / Virus Database: 287 - Release Date: 5/6/2003


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



Re: [PHP] Warning: mysql_fetch_row(): supplied argument is not avalid MySQL result resource in f:\.....\none.php on line 286

2003-06-08 Thread Thomas Seifert
why are you using "sql_query" through your code?
its
mysql_query for mysql!
and the result, needed for mysql_fetch_row is returned from that function.
read the docs again.


Thomas

On Sun, 8 Jun 2003 16:37:59 -0300 [EMAIL PROTECTED] (Marcelo Luiz De Laia) wrote:

> $result = "SELECT categoria, nombre, datafim FROM ".$prefix."_anuncios ORDER
> BY datafim LIMIT 0,30";
> sql_query($result, $dbi);


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



Re: [PHP] file upload script

2003-06-08 Thread Rodney Green
Thanks Philip. I'm now using the code below to upload. What I'm seeing is
that the file is uploaded and placed into the /tmp directory but is not
being moved to the /PIVOT directory. It just disappears after a few seconds
and can't be found in either directory. Any ideas why?

Thanks again,
Rod


- Original Message - 
From: "Philip Olson" <[EMAIL PROTECTED]>
To: "Rodney Green" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Sunday, June 08, 2003 1:21 AM
Subject: Re: [PHP] file upload script


>
> By no errors, do you mean you have a PHP version greater
> than PHP 4.2.0 and checked the ['error'] code, and it
> has a value of 0?  Are you sure you want the filename
> to be $file_name?  I doubt you do.
>
> Regards,
> Philip
>
> ref: http://www.php.net/features.file-upload
>
> On Sat, 7 Jun 2003, Rodney Green wrote:
>
> > Hello. I'm attempting to upload a file using the script below and I'm
not
> > having any success. The temp directory I'm using does exist and is
> > writeable. When I browse for the file then hit the send button it
appears to
> > be working then displays the form again with no errors. I look for the
file
> > on the server and it isn't there. Any advice on how to get this working?
> >
> > Thanks!
> > Rod
> >
> >
> > ---
> >
> > 
> > 
> > Listing 9.14 A file upload script
> > 
> >  > $file_dir = "/home/corrdev/htdocs/php24/scrap/uploads";
> > $file_url = "http://corros.colo.hosteurope.com/dev/php24/scrap/uploads";;
> >
> > foreach( $HTTP_POST_FILES as $file_name => $file_array ) {
> >  print "path: ".$file_array['tmp_name']."\n";
> >  print "name: ".$file_array['name']."\n";
> >  print "type: ".$file_array['type']."\n";
> >  print "size: ".$file_array['size']."\n";
> >
> >  if ( is_uploaded_file( $file_array['tmp_name'] )
> >   && $file_array['type'] == "image/gif" ) {
> >   move_uploaded_file( $file_array['tmp_name'], "$file_dir/$file_name")
> >or die ("Couldn't copy");
> >   print "\n\n";
> >  }
> > }
> >
> > ?>
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> >
> >
> >
> > -- 
> > 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] file upload script

2003-06-08 Thread Rodney Green
Sorry, here's the code:






";
echo "Name: ".$_FILES['imagefile']['name']."";
echo "Size: ".$_FILES['imagefile']['size']."";
echo "Type: ".$_FILES['imagefile']['type']."";
echo "Copy Done";
}


else
{
echo "";
echo "Could Not Copy, Wrong Filetype
(".$_FILES['imagefile']['name'].")";
}
}


?>




- Original Message - 
From: "Philip Olson" <[EMAIL PROTECTED]>
To: "Rodney Green" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Sunday, June 08, 2003 1:21 AM
Subject: Re: [PHP] file upload script


>
> By no errors, do you mean you have a PHP version greater
> than PHP 4.2.0 and checked the ['error'] code, and it
> has a value of 0?  Are you sure you want the filename
> to be $file_name?  I doubt you do.
>
> Regards,
> Philip
>
> ref: http://www.php.net/features.file-upload
>
> On Sat, 7 Jun 2003, Rodney Green wrote:
>
> > Hello. I'm attempting to upload a file using the script below and I'm
not
> > having any success. The temp directory I'm using does exist and is
> > writeable. When I browse for the file then hit the send button it
appears to
> > be working then displays the form again with no errors. I look for the
file
> > on the server and it isn't there. Any advice on how to get this working?
> >
> > Thanks!
> > Rod
> >
> >
> > ---
> >
> > 
> > 
> > Listing 9.14 A file upload script
> > 
> >  > $file_dir = "/home/corrdev/htdocs/php24/scrap/uploads";
> > $file_url = "http://corros.colo.hosteurope.com/dev/php24/scrap/uploads";;
> >
> > foreach( $HTTP_POST_FILES as $file_name => $file_array ) {
> >  print "path: ".$file_array['tmp_name']."\n";
> >  print "name: ".$file_array['name']."\n";
> >  print "type: ".$file_array['type']."\n";
> >  print "size: ".$file_array['size']."\n";
> >
> >  if ( is_uploaded_file( $file_array['tmp_name'] )
> >   && $file_array['type'] == "image/gif" ) {
> >   move_uploaded_file( $file_array['tmp_name'], "$file_dir/$file_name")
> >or die ("Couldn't copy");
> >   print "\n\n";
> >  }
> > }
> >
> > ?>
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> >
> >
> >
> > -- 
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>



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



[PHP] callback function via preg_replace_callback

2003-06-08 Thread Henry H. Tan-Tenn
Hi,

I have Function A containing a preg_replace_callback calling Function B.
The code works quite nicely.

Now, is there a way for the callback function (B) to receive *additional*
arguments
(from A), so that, for example, it may optionally perform additional tasks?
If not, is there a way for B to otherwise access arguments passed to A, for
the same purpose?

Thanks.

--H. Tan-Tenn








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



Re: [PHP] Re: Linux vs. Windows

2003-06-08 Thread AzFLSite
Ok the results are in heh :) With W2k the times were
faster than on .NET but varied a lot. Ranging as low
as .9 to as high as 2 full seconds. Ouch! So I got
Mandrake 9 back up and with php 4.2.3 and mysql 4 I am
back to the faster times. Heck even getting .007 on a
regular bases. I still need to install Zend or ZPC.
Anyone have any input on which is better to install?
Zend or APC that is.

Thanks
Silly


--- DvDmanDT <[EMAIL PROTECTED]> wrote:
> Thanks, this sorta draws my intrest now... Also, I'm
> a bit outdated on the
> microsoft front... Has windows gone opensource?
> 
> 
> "Azflsite" <[EMAIL PROTECTED]> skrev i meddelandet
>
news:[EMAIL PROTECTED]
> > Thanks everyone for your replies.
> >
> > I did test on the same server. I had .NET
> installed
> > and tested. Then installed Linux on same box. The
> box
> > is a p4 1.7 gig with 512 ddr with a 30 gig 7200rpm
> hdd
> >
> > Im going to drop to win2k and see the results. I
> will
> > post results here if anyone cares.
> >
> > Silly
> > --- DvDmanDT <[EMAIL PROTECTED]> wrote:
> > > It's quite suprising how fast my PHP (and Perl)
> is
> > > under WinME/Apache
> > > 1.3.27/PHP 4.3.2... It's unstable as F though so
> not
> > > way to recommended...
> > >
> > > I was intrested in your server specs? How much
> RAM?
> > > And so on... And was the
> > > tests on the same server or did I missunderstand
> > > something?
> > > "Azflsite" <[EMAIL PROTECTED]> skrev i
> meddelandet
> > >
> >
>
news:[EMAIL PROTECTED]
> > > > Thought I throw in my post from the forums
> into
> > > this
> > > > mailing list:
> > > >
> > > > Just wanted to give my results on this test I
> did.
> > > > First the story. I will be hosting sites on my
> > > server
> > > > and decided to go with .NET/Win2003, with IIS.
> > > Well
> > > > most sites are php based or perl with mysql
> > > backend.
> > > > After configuring everything I gave it a test
> from
> > > > another system externally. i did that and
> noticed
> > > it
> > > > was slow. Slower compared to the linux box I
> > > currently
> > > > have the site on for testing purposes on
> another
> > > > provider. Heck even while statements without
> > > hitting
> > > > the DB were giving delays that were over 10
> > > seconds!
> > > >
> > > > Wooa I couldnt believe it. So I decided to add
> a
> > > code
> > > > snippet to get the seconds of script
> execution. I
> > > did
> > > > this off a query with 12 results that echoed
> out
> > > into
> > > > html. Now with Linux I came up with numbers
> like:
> > > >
> > > > 0.0163360
> > > >
> > > >
> > > > The above number was pretty consistent. Now
> onto
> > > > Windows 2003 .NET. On the same page with the
> same
> > > > output:
> > > >
> > > > 2.6936080
> > > > 0.9500151
> > > > 4.9112860
> > > > 0.6226690
> > > > 0.6032619
> > > >
> > > > Wooa!! But this cant be true. I have had Win2k
> > > host
> > > > php sites before and it seemed faster then
> .NET.
> > > But
> > > > these are the results so far. So with this my
> > > thoughts
> > > > of cause are:
> > > >
> > > > a) Windows just plain sucks with open source
> > > > b) .NET doesnt seem to allow cgi, only ISAPI.
> > > Perhaps
> > > > ISAPI is slowing it down
> > > > c) In Linux Im using Apache, where in Windows
> Im
> > > using
> > > > IIS
> > > > d) The .NET OS is a beta and that could be the
> > > issue
> > > > e) My code just sucks. But why would it be
> faster
> > > on
> > > > Linux then?
> > > >
> > > > Any thoughts on the possibilities I have shown
> > > here?
> > > >
> > > > The Chaos
> > > >
> > > > __
> > > > Do you Yahoo!?
> > > > Yahoo! Calendar - Free online calendar with
> sync
> > > to Outlook(TM).
> > > > http://calendar.yahoo.com
> > >
> > >
> > >
> > > -- 
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit:
> http://www.php.net/unsub.php
> > >
> >
> >
> > __
> > Do you Yahoo!?
> > Yahoo! Calendar - Free online calendar with sync
> to Outlook(TM).
> > http://calendar.yahoo.com
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

__
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

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



Re: [PHP] file upload script

2003-06-08 Thread Philip Olson

What PHP version?  You should rewrite your code to more
reflect what's being used in the manual.

  a) use move_uploaded_file() and not copy()
  b) check what ['error'] has to say
  c) set action in the form
  d) print_r($_FILES) is great for debugging
  e) only show the form is it's not yet submitted,
 or at least print something only if the form
 hasn't yet submitted so you know... debug. As
 for all know, $Submit may never be set.

Regards,
Philip



On Sun, 8 Jun 2003, Rodney Green wrote:

> Sorry, here's the code:
> 
> 
> 
> 
> 
> 
>  $filesdir = "/PIVOT";
> 
> echo $_FILES['imagefile']['name'];
> echo $_FILES['imagefile']['tmp_name'];
> 
> if(isset( $Submit )) {
> 
> 
> 
> if ($_FILES['imagefile']['type'] == "image/gif") {
> 
> copy ($_FILES['imagefile']['tmp_name'],
> "$filesdir/".$_FILES['imagefile']['name'])
> or die ("Could not copy");
> 
> 
> echo "";
> echo "Name: ".$_FILES['imagefile']['name']."";
> echo "Size: ".$_FILES['imagefile']['size']."";
> echo "Type: ".$_FILES['imagefile']['type']."";
> echo "Copy Done";
> }
> 
> 
> else
> {
> echo "";
> echo "Could Not Copy, Wrong Filetype
> (".$_FILES['imagefile']['name'].")";
> }
> }
> 
> 
> ?>
> 
> 
> 
> 
> - Original Message - 
> From: "Philip Olson" <[EMAIL PROTECTED]>
> To: "Rodney Green" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Sunday, June 08, 2003 1:21 AM
> Subject: Re: [PHP] file upload script
> 
> 
> >
> > By no errors, do you mean you have a PHP version greater
> > than PHP 4.2.0 and checked the ['error'] code, and it
> > has a value of 0?  Are you sure you want the filename
> > to be $file_name?  I doubt you do.
> >
> > Regards,
> > Philip
> >
> > ref: http://www.php.net/features.file-upload
> >
> > On Sat, 7 Jun 2003, Rodney Green wrote:
> >
> > > Hello. I'm attempting to upload a file using the script below and I'm
> not
> > > having any success. The temp directory I'm using does exist and is
> > > writeable. When I browse for the file then hit the send button it
> appears to
> > > be working then displays the form again with no errors. I look for the
> file
> > > on the server and it isn't there. Any advice on how to get this working?
> > >
> > > Thanks!
> > > Rod
> > >
> > >
> > > ---
> > >
> > > 
> > > 
> > > Listing 9.14 A file upload script
> > > 
> > >  > > $file_dir = "/home/corrdev/htdocs/php24/scrap/uploads";
> > > $file_url = "http://corros.colo.hosteurope.com/dev/php24/scrap/uploads";;
> > >
> > > foreach( $HTTP_POST_FILES as $file_name => $file_array ) {
> > >  print "path: ".$file_array['tmp_name']."\n";
> > >  print "name: ".$file_array['name']."\n";
> > >  print "type: ".$file_array['type']."\n";
> > >  print "size: ".$file_array['size']."\n";
> > >
> > >  if ( is_uploaded_file( $file_array['tmp_name'] )
> > >   && $file_array['type'] == "image/gif" ) {
> > >   move_uploaded_file( $file_array['tmp_name'], "$file_dir/$file_name")
> > >or die ("Couldn't copy");
> > >   print "\n\n";
> > >  }
> > > }
> > >
> > > ?>
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > >
> > >
> > >
> > > -- 
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> >
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


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



[PHP] filter out with date?

2003-06-08 Thread A. Lyse
I got the array info: on the articles:
Array
(
[0] => ingress Object
(
[artikkelid] => 241
[nettstedid] => 11
[gyldig] => 1
[overskrift] => motorsport formel1
[artikkellink] => art.php?artikkelid=241
[forfatternavn] => Aleksander Lyse
[forfatterlink] => http://www.ikke.no/
[ingress] => Formel1
[publisertLang] => 20030530135301
[publisert] => 2003 30/05
[bilde] =>
[artikkeltypeid] => 38
)

The code I use to feed the articles are:

if($ingresser =
hentIngresser($nettstedid,37,$sprakid,$offsetannet,$antal1ingress))
listIngresser1($ingresser);

How can I only show the articles from eg. 2003 01/06 - 2003 31/6

Regards
A. Lyse



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



[PHP] Rateing script

2003-06-08 Thread Ryan A
Hi,
I am creating a host directory and have decided to add a "rate this host"
kind of option to each of the hosts to make decision time a bit easier,
I have visited hotscripts and the like searching for a good one (ex. like
the one they are using) but unable to find oneany of you guys have any
idea/s?

The closest i got was this from google
http://www.hotscripts.com/Detailed/16425.html but that again gave me a 404
page :-(

What do ya think?

Cheers,
-Ryan


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



[PHP] PHPBB and EZBOARD.COM

2003-06-08 Thread Miranda, Joel Louie M
Hello,

Has anyone got an idea how to migrate the things in ezboard.com to phpbb
forum?

Thanks,
Louie

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



[PHP] Need a safe way to get user supplied data into a varaible.

2003-06-08 Thread Simon Coggins
Hi,
After lots of looking I've worked out I can't use heredoc for what I
want. Does anyone else have any better ideas on how to do this:

I have a template file that is used to generate a html page. in this
template I currently have:

$body = <

Re: [PHP] Need a safe way to get user supplied data into a varaible.

2003-06-08 Thread Lars Torben Wilson
On Sun, 2003-06-08 at 17:15, Simon Coggins wrote:
> Hi,

[snipped for brevity]

> I need some way of putting a block of text into a variable without
> having to read it in from a file. From the template point of view, all
> that happends is a token is replaced with the body of the text. So
> reading that in from a file is hard. 
> 
> Thanks

Single quotes will do this;

http://ca.php.net/manual/en/language.types.string.php#language.types.string.syntax.single

$body = '
Some text here.
';


Hope this helps,

Torben


-- 
 Torben Wilson <[EMAIL PROTECTED]>+1.604.709.0506
 http://www.thebuttlesschaps.com  http://www.inflatableeye.com
 http://www.hybrid17.com  http://www.themainonmain.com
 - Boycott Starbucks!  http://www.haidabuckscafe.com -




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



Re: [PHP] Need a safe way to get user supplied data into a varaible.

2003-06-08 Thread Leif K-Brooks
Why not just use file() and friends?

Simon Coggins wrote:

Hi,
After lots of looking I've worked out I can't use heredoc for what I
want. Does anyone else have any better ideas on how to do this:
I have a template file that is used to generate a html page. in this
template I currently have:
$body = <<
I then do some operations on this text and print out the result.

My problem is that heredoc parses variables, so if the email happends
to contain a string that looks like or is php variables it all goes
wrong. Plus it means someone could intentionaly start echoing variables.
I need some way of putting a block of text into a variable without
having to read it in from a file. From the template point of view, all
that happends is a token is replaced with the body of the text. So
reading that in from a file is hard. 

Thanks

 

--
The above message is encrypted with double rot13 encoding.  Any unauthorized attempt 
to decrypt it will be prosecuted to the full extent of the law.


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


RE: [PHP] IE Pagelength issue

2003-06-08 Thread Larry Brown
Yes, the entire page is visible when selecting view source.  And again, it
does view ok in Mozilla.  I will try breaking the table into smaller tables
and see if that is it.  I won't have access till Tuesday.  If anyone has any
other ideas feel free to throw in.

Larry S. Brown
Dimension Networks, Inc.
(727) 723-8388

-Original Message-
From: John W. Holmes [mailto:[EMAIL PROTECTED]
Sent: Saturday, June 07, 2003 9:37 PM
To: 'Larry Brown'; 'PHP List'
Subject: RE: [PHP] IE Pagelength issue

If you "view source" in IE, do you see the entire page? If so, then it's
an IE display issue.

---John W. Holmes...

Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/

> -Original Message-
> From: Larry Brown [mailto:[EMAIL PROTECTED]
> Sent: Saturday, June 07, 2003 7:30 PM
> To: [EMAIL PROTECTED]; PHP List
> Subject: RE: [PHP] IE Pagelength issue
>
> Example is a page that displays the concerts and bands at each concert
for
> a
> given spectator. Table one gives information on the spectator and has
a
> field that lists the concert events he/she has been to.  Table two
lists
> concerts along with location information and date along with bands and
> then
> another table that lists band information.  There are several loops,
the
> first one is "while $spectator..." and within it a "while $concert..."
and
> within it a "while $band..."  So the resulting page can have user
> information then a list with concert bands, concert bands, concert
bands,
> for each he/she has been to.  The one we are having a problem with has
27
> concerts and IE stops at 25 and Mozilla goes all the way to the 27th.
I
> will try and split each concert into its own table.  Just as a not
each
> concert listed gives the option to edit the concert information and a
way
> to
> edit the band information in addition to removing any one of them.  So
> there
> are various buttons throughout.
>
> Larry S. Brown
> Dimension Networks, Inc.
> (727) 723-8388
>
> -Original Message-
> From: John W. Holmes [mailto:[EMAIL PROTECTED]
> Sent: Saturday, June 07, 2003 6:08 PM
> To: 'Larry Brown'; 'PHP List'
> Subject: RE: [PHP] IE Pagelength issue
>
> > I am running into a strange problem.  I have a script that parses a
> > database
> > for results.  It cycles through the data one record at a time
looking
> for
> > matches to the query.  Up til now I haven't had any problems as the
> > results
> > have been limited in length.  Now I have one that has a significant
> length
> > and the bottom is cut off on IE6.  I haven't tried any earlier
> versions of
> > IE but Mozilla loads the entire page without this problem.  Has
anyone
> run
> > across this?  Is there a way around it?
>
> > Just as an additional note:  the page has one continuous table so
> another
> > potential problem would be a limit to the length of a table?
>
> Probably and IE "feature" of only being able to handle a certain table
> size.
>
> The "way around" it would be to end the table and start another every
so
> many rows... or split your rows up into Prev/Next pages...
>
> Did I read correctly that you're selecting an entire database and then
> using PHP to match criteria? Are you using a WHERE clause to do the
> sorting? Sounds like you may be going about this the wrong way... if
> not, carry on.
>
> ---John W. Holmes...
>
> Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E
>
> PHP Architect - A monthly magazine for PHP Professionals. Get your
copy
> today. http://www.phparch.com/
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>




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



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



[PHP] Session Newbie Question: Cookieless sessions

2003-06-08 Thread [EMAIL PROTECTED]
How can one set up cookie-less sessions?  More specifically, if you store
your sessions in a database, once the user comes back how do you call that
same session back? 

I guess I still don¹t understand how to keep user specific data maintained
for a particular user.  Because when you log off or the cookie expires, then
you have no data for that user.

Any insights are very welcome!
/T  





RE: [PHP] Session Newbie Question: Cookieless sessions

2003-06-08 Thread John W. Holmes
> How can one set up cookie-less sessions?  More specifically, if you
store
> your sessions in a database, once the user comes back how do you call
that
> same session back?
> 
> I guess I still don¹t understand how to keep user specific data
maintained
> for a particular user.  Because when you log off or the cookie
expires,
> then
> you have no data for that user.

Umm... getting rid of cookies isn't going to help you here. That's the
_only_ way you're going to "remember" someone who comes back after they
close their browser or leave your site. You actually need to increase
the session cookie lifetime so it persists after the browser is closed,
like a regular cookie. Where you store your session data is irrelevant. 

---John W. Holmes...

Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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



RE: [PHP] filter out with date?

2003-06-08 Thread John W. Holmes
> I got the array info: on the articles:
> Array
> (
> [0] => ingress Object
> (
> [artikkelid] => 241
> [nettstedid] => 11
> [gyldig] => 1
> [overskrift] => motorsport formel1
> [artikkellink] => art.php?artikkelid=241
> [forfatternavn] => Aleksander Lyse
> [forfatterlink] => http://www.ikke.no/
> [ingress] => Formel1
> [publisertLang] => 20030530135301
> [publisert] => 2003 30/05
> [bilde] =>
> [artikkeltypeid] => 38
> )
> 
> The code I use to feed the articles are:
> 
> if($ingresser =
> hentIngresser($nettstedid,37,$sprakid,$offsetannet,$antal1ingress))
> listIngresser1($ingresser);
> 
> How can I only show the articles from eg. 2003 01/06 - 2003 31/6

Wouldn't it be smarter to only fill this array with items matching the
date you want in the first place??

Anyhow...now you'll have to loop through each "ingress Object" and see
if substr($obj->publisert,-2) matches the month you want. 

---John W. Holmes...

Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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



[PHP] Re: A recommended barcode program

2003-06-08 Thread Manuel Lemos
Hello,

On 06/02/2003 09:30 PM, Todd Cary wrote:
I would like to have a reccommendation for a PHP class that generates a 
barcode.
Have you seen these?

Class: Barcode128 pattern  compute class
http://www.phpclasses.org/barcode128
Class: BarcodeI25
http://www.phpclasses.org/barcode
--

Regards,
Manuel Lemos
Free ready to use OOP components written in PHP
http://www.phpclasses.org/


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


[PHP] Hi I get some problems while using eregi_replace

2003-06-08 Thread winst0n
Hi, so first of all, I'm sorry for my bad english.
I'll try to write as better as I can, but I think it will be readable ;)

So, this is 3 code unsing eregi_replace, but they dont work as well...

If some one can give me a help, it's will be great.

Many thx !

/ code /

/* transform [color=FF]colored text[/color] to colored text */
$message = eregi_replace ("[color=(.*)](.*)[/color]","\\2",$message);

/* transform [url=xxx]link![/url] to link! */
$message = eregi_replace ("[url=(.*)](.*)[/url]","\\2",$message);

/* transform [b]big text[/b] to big text */
$message = eregi_replace (".*([b]).*([/b]).*","\\1\\2\\3",$message);


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



RE: [PHP] PHPBB and EZBOARD.COM

2003-06-08 Thread Miranda, Joel Louie M
Got an idea.

Brb.
Louie

-Original Message-
From: Miranda, Joel Louie M 
Sent: Monday, June 09, 2003 8:04 AM
To: [EMAIL PROTECTED]
Subject: [PHP] PHPBB and EZBOARD.COM


Hello,

Has anyone got an idea how to migrate the things in ezboard.com to phpbb
forum?

Thanks,
Louie

-- 
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] callback function via preg_replace_callback

2003-06-08 Thread David Otton
On Sun, 08 Jun 2003 16:25:19 -0400, you wrote:

>I have Function A containing a preg_replace_callback calling Function B.
>The code works quite nicely.
>
>Now, is there a way for the callback function (B) to receive *additional*
>arguments
>(from A), so that, for example, it may optionally perform additional tasks?
>If not, is there a way for B to otherwise access arguments passed to A, for
>the same purpose?

I'm pretty sure it's not possible, and I've asked similar questions before.

You could try generating the callback function /within/ A, using PHP's
equivalent of lambda functions:

http://www.php.net/manual/en/function.create-function.php


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



[PHP] Execute command which has root privileges

2003-06-08 Thread vijaypatel
Hello,

I am using FreeBSD 4.7 ,PHP 4.2.3 & Apache 1.3

I want to execute shell script which contains few IPFW commands. I have tried with 
system(),exec(),passthru() command to execute script but i can't do that. 
Apache has created "www" user on FreeBSD. I found that "www" user has not privilege 
for IPFW.

How can i execute script which contains IPFW commands with PHP?

I have given 777 permission to script file.

Thanking You.

[PHP] reading a file into variable for using in a javascript

2003-06-08 Thread Charles Kline
Hi all,

I am reading the content of a text file into a variable to be used in a 
javascript. I am reworking some code that was originally done using 
ColdFusion and the jsStringFormat(var) function. What is the PHP 
equivalent string function? Is there one? I have searched the docs, but 
can't figure out which to use.

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


php-general Digest 9 Jun 2003 04:23:54 -0000 Issue 2106

2003-06-08 Thread php-general-digest-help

php-general Digest 9 Jun 2003 04:23:54 - Issue 2106

Topics (messages 150673 through 150699):

Re: A Question with heredoc
150673 by: Richard Baskett

can't call htpasswd using PHP
150674 by: Billy

Re: HARDWARE ID WITH PHP
150675 by: Marek Kilimajer

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in 
f:\.\none.php on line 286
150676 by: Marcelo Luiz de Laia
150677 by: Marcelo Luiz de Laia
150678 by: Thomas Seifert

Re: file upload script
150679 by: Rodney Green
150680 by: Rodney Green
150683 by: Philip Olson

callback function via preg_replace_callback
150681 by: Henry H. Tan-Tenn
150697 by: David Otton

Re: Linux vs. Windows
150682 by: AzFLSite

filter out with date?
150684 by: A. Lyse
150693 by: John W. Holmes

Rateing script
150685 by: Ryan A

PHPBB and EZBOARD.COM
150686 by: Miranda, Joel Louie M
150696 by: Miranda, Joel Louie M

Need a safe way to get user supplied data into a varaible.
150687 by: Simon Coggins
150688 by: Lars Torben Wilson
150689 by: Leif K-Brooks

Re: IE Pagelength issue
150690 by: Larry Brown

Session Newbie Question: Cookieless sessions
150691 by: Info.Best-IT
150692 by: John W. Holmes

Re: A recommended barcode program
150694 by: Manuel Lemos

Hi I get some problems while using eregi_replace
150695 by: winst0n

Execute command which has root privileges
150698 by: vijaypatel

reading a file into variable for using in a javascript
150699 by: Charles Kline

Administrivia:

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

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

To post to the list, e-mail:
[EMAIL PROTECTED]


--
--- Begin Message ---
Im not sure if this is your problem, but it was mine awhile ago :)

Make sure there are no spaces after closing off heredoc.. so on your line:

EOF;

Make sure there is nothing except a hard return, no spaces, no characters..
nothing!

Cheers!

Rick

"By three methods we may learn wisdom: First, by reflection which is
noblest; second, by imitation, which is the easiest; and third, by
experience, which is the bitterest." - Confucius

> From: Simon Coggins <[EMAIL PROTECTED]>
> Reply-To: [EMAIL PROTECTED]
> Date: Sun, 8 Jun 2003 19:10:06 +1000
> To: [EMAIL PROTECTED]
> Subject: [PHP] A Question with heredoc
> 
> Hi
> I'm writing a wrapper for some mailman archives and i'm trying to put
> them message into a variable as in:
> 
> $body = << text here.
> EOF;
> 
> But I'm getting an error because of some charactors. ^L to be
> specific. If the text contains a control char I get:
> 
> Code:
> 
>  $test = << line 1  
> ^L  
> line 2  
> EOF;
> echo $test;  
> ?>   
>
> 
> Error:
> Warning: Unexpected character in input: '' (ASCII=12) state=5 in
> test.html on line 6
> 
> Is there any way I can stop it complaining about it. Or is there
> another way I can put the the text into the string (it's done via a
> template file and a string substitution). The contents could be
> anything so I thougth heredoc would work..
> 
> Thanks in advance.. I'm not on the list so please reply to me directly.
> 
> Regards
> Simon
> 
> -- 
> Simon Coggins (SAGE-AU Member)Email: [EMAIL PROTECTED]
> Network and System Management Officer Phone: +61-2-4221-3775
> Information Technology Systems (ITS)  Mobile: 0408 115861
> University of Wollongong, 2522, Australia Fax:   +61-2-4229-1985
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

--- End Message ---
--- Begin Message ---
Dear all,

i can't call the "htpasswd" command after i used RedHat 8  ( which i can do
so in Red Hat 7.2)

do u have any idea/ suggestion?

thx a lot
HPS


--- End Message ---
--- Begin Message ---
You need to execute an external program (hdparm in linux) and catch its 
output.

nabil wrote:
Can anyone tell me if i can get the Hardisk serial number, by  php code?




--- End Message ---
--- Begin Message ---
What this message means?

What it is the error?

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result
resource in f:\.\none.php on line 286


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.488 / Virus Database: 287 - Release Date: 5/6/2003

--- End Message ---
--- Begin Message ---
What this message means?

What it is the error?

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result
resource in f:\.\none.php on line 42

This is the code.

Thanks very much.

Marcelo


";
$content .=" Últimos 10 Concursos";
$content .= "";

\\ line 42
while (list($categoria, $nombre

[PHP] Re: Execute command which has root privileges

2003-06-08 Thread Dustin Pate
You could use sudo, if your system has that. That's what I do for the rare
occasion I have to call a script with root perms.  But use sudo with care!


"Vijaypatel" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Hello,

I am using FreeBSD 4.7 ,PHP 4.2.3 & Apache 1.3

I want to execute shell script which contains few IPFW commands. I have
tried with system(),exec(),passthru() command to execute script but i can't
do that.
Apache has created "www" user on FreeBSD. I found that "www" user has not
privilege for IPFW.

How can i execute script which contains IPFW commands with PHP?

I have given 777 permission to script file.

Thanking You.



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



[PHP] XSLT not doing anything

2003-06-08 Thread David Feldman
I'm trying to get the XSLT extension working, and all I can get it to 
do is echo the source XML back to me. I'm using sample markup from 
O'Reilly's XSLT book as my XML and XSL files, as follows:

hello.xml:


Hello, world!

hello.xsl:
http://www.w3.org/1999/XSL/Transform";
version="1.0">














My PHP code is in index.php:

$proc = xslt_create();
$result = xslt_process($proc, "hello.xsl", "hello.xml");
xslt_free($proc);
echo $result;

?>

All three files are in the same directory. I'm running on Mac OS X 
using Marc Liyanage's precompiled PHP binary, which includes the XSLT 
extension. It seems to be running, since if I intentionally introduce a 
typo I get Sablotron errors written to the browser window. But 
otherwise the output is simply the original hello.xml's markup, with a 
character encoding added. I'm new to XSLT so I may be overlooking 
something simple. What am I doing wrong?

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


Re: [PHP] HELP PLEASE

2003-06-08 Thread David Otton
On Sun, 8 Jun 2003 13:31:25 +0300, you wrote:

>AGES AND TRYING TO FIND A GOOD RSS CREATOR , PLEASE HELP, NOTE THAT I TRIED
>http://www.phpclasses.org  . PHP Classes Repository
>
>  BUT I DIDN'T MANAGE
>
>  PLEASE HELP ME

A simple RSS document is pretty easy to generate. It's just text... even
using XML classes is overkill.

Output a header like this:

header ("Content-Type: text/xml");

and then a document like this:

 

 
  BBC News Online 
  http://news.bbc.co.uk/ 
  BBC News Online 
  
   BBC News Online

http://news.bbc.co.uk/furniture/syndication/bbc_news_120x60.gif
   http://news.bbc.co.uk/
  
  
   Sharon warns Palestinians on terror

http://news.bbc.co.uk/go/click/rss/1.0/ticker/-/1/hi/world/middle_east/2973816.stm
  
  
   Lull in Mauritania coup violence

http://news.bbc.co.uk/go/click/rss/1.0/ticker/-/1/hi/world/africa/2974006.stm
  
 


There are more tags you can use (see http://backend.userland.com/rss2) but
that's the basic structure.


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



[PHP] regexp for URL

2003-06-08 Thread Mattia
Does anyone have a good regular expression for capturing all http URL in 
a string?
now i'm using ?(http://[a-z0-9-/_;&=+-\.\?:@]+)\b?mi
in one of my programs, that is, all strings beginning with http:// and 
contain chars like a-z0-9 ...

does anione have something better?

thank you

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


Re: [PHP] Hi I get some problems while using eregi_replace

2003-06-08 Thread poetbox
hi,php-general,winst0n

 I'm from china,my English is not very good,too.
 Here's some example,perhaps it will help you a little.

 $post =str_replace("[b]","",$post);
 $post =str_replace("[/b]","",$post);
 $post = eregi_replace("\\[hr=([^\\[]*)\\]","",$post);
 $post=eregi_replace("\\[swf\\](.+\.swf)\\[/swf\\]","http://www.macromedia.com/shockwave/download/indexcgi?P1_Prod_Version=ShockwaveFlash\";
 type=\"application/x-shockwave-flash\"
width=\"580\" height=\"400\">     
左键全屏观赏",$post);


 



poetbox
[EMAIL PROTECTED]
  2003-06-09




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



Re: [PHP] Where to start?

2003-06-08 Thread poetbox
hi, Simon Thurtle!

   " www.php.net " is the best on-line resource on the web.

=== 2003-06-05 13:36:00 you wrote:===

>Hi all,
>I am looking into learning PHP, I have a good understanding of HTML, JS and
>I know a little Perl. Firstly I know PHP is all server side and so a damn
>sight different from the above, but will they help me at all?
>Secondly where do I start? Are there any good on-line resources and or books
>that anyone knows? I am plannig to develop an E-comm solution us Oscommerce,
>does anyone know if this is any good or is naff?
>Any hints, tips or pointers would be greatly appreciated.
>
>Thanks,
>
>Simon
>
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php

= = = = = = = = = = = = = = = = = = = =


   Thanks for any suggestions.


poetbox
[EMAIL PROTECTED]
  2003-06-09





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



Re: [PHP] regexp for URL

2003-06-08 Thread David Otton
On Mon, 09 Jun 2003 07:13:43 +0200, you wrote:

>Does anyone have a good regular expression for capturing all http URL in 
>a string?
>now i'm using ?(http://[a-z0-9-/_;&=+-\.\?:@]+)\b?mi
>in one of my programs, that is, all strings beginning with http:// and 
>contain chars like a-z0-9 ...
>
>does anione have something better?

Hmm. I just glanced at RFC 2396, which offers this regex to validate an URI:

^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?
 123  4  5   6  78 9

the numbers indicate the reference points for each subexpression

1 = http:
2 = http
3 = //www.ics.uci.edu
4 = www.ics.uci.edu
5 = /pub/ietf/uri/
6 = 
7 = 
8 = #Related
9 = Related

http://www.ietf.org/rfc/rfc2396.txt


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



[PHP] stripping newlines from a string

2003-06-08 Thread Charles Kline
Hi all,

How would i go about stripping all newlines from a string?

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


[PHP] status of current online users

2003-06-08 Thread Miranda, Joel Louie M
Hello,

I was wondering how did some people do that they can display current active
users on a webpage? I was hoping to find even simple info about this even on
a first site basis only. Any ideas and howto's/docs will be great.

Thanks,
Louie

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



[PHP] Re: can't call htpasswd using PHP

2003-06-08 Thread HPS
more information
in Red Hat 7.2, i was using PHP 4.1.2
while in Red Hat 8.0, it is PHP 4.2.2

thx a lot~
HPS


"Billy" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Dear all,
>
> i can't call the "htpasswd" command after i used RedHat 8  ( which i can
do
> so in Red Hat 7.2)
>
> do u have any idea/ suggestion?
>
> thx a lot
> HPS
>
>



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



RE: [PHP] status of current online users

2003-06-08 Thread Boaz Yahav
Display Users Online Based On Page Viewing
http://articles.weberdev.com/ViewArticle.php3?ArticleID=254

Sincerely

berber

Visit http://www.weberdev.com/ Today!!!
To see where PHP might take you tomorrow.


-Original Message-
From: Miranda, Joel Louie M [mailto:[EMAIL PROTECTED] 
Sent: Monday, June 09, 2003 7:50 AM
To: [EMAIL PROTECTED]
Subject: [PHP] status of current online users


Hello,

I was wondering how did some people do that they can display current
active users on a webpage? I was hoping to find even simple info about
this even on a first site basis only. Any ideas and howto's/docs will be
great.

Thanks,
Louie

-- 
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] stripping newlines from a string

2003-06-08 Thread Boaz Yahav
How to remove new line / CrLf from a string
http://examples.weberdev.com/get_example.php3?count=3577

Sincerely

berber

Visit http://www.weberdev.com/ Today!!!
To see where PHP might take you tomorrow.


-Original Message-
From: Charles Kline [mailto:[EMAIL PROTECTED] 
Sent: Monday, June 09, 2003 7:44 AM
To: [EMAIL PROTECTED]
Subject: [PHP] stripping newlines from a string


Hi all,

How would i go about stripping all newlines from a string?

Thanks,
Charles


-- 
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] Where to start?

2003-06-08 Thread Boaz Yahav
Try this :

http://www.weberdev.com/index.php3?GoTo=search.php3%3Fcategory%3DEcommer
ce%26searchtype%3Dcategory

Sincerely

berber

Visit http://www.weberdev.com/ Today!!!
To see where PHP might take you tomorrow.


-Original Message-
From: Simon Thurtle [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 05, 2003 2:36 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Where to start?


Hi all,
I am looking into learning PHP, I have a good understanding of HTML, JS
and I know a little Perl. Firstly I know PHP is all server side and so a
damn sight different from the above, but will they help me at all?
Secondly where do I start? Are there any good on-line resources and or
books that anyone knows? I am plannig to develop an E-comm solution us
Oscommerce, does anyone know if this is any good or is naff? Any hints,
tips or pointers would be greatly appreciated.

Thanks,

Simon




-- 
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] Hi I get some problems while using eregi_replace

2003-06-08 Thread Boaz Yahav
Try these :

A function that parses a string and replaces http://whatever with a
link, and email addresses 
with a mailto link. This function was designed for the motd package. But
will work freely on its own. 
http://examples.weberdev.com/get_example.php3?count=1235


How to change all of the links in a string to be HTML links.
http://examples.weberdev.com/get_example.php3?count=1567



Sincerely

berber

Visit http://www.weberdev.com/ Today!!!
To see where PHP might take you tomorrow.




-Original Message-
From: winst0n [mailto:[EMAIL PROTECTED] 
Sent: Monday, June 09, 2003 5:23 AM
To: php
Subject: [PHP] Hi I get some problems while using eregi_replace


Hi, so first of all, I'm sorry for my bad english.
I'll try to write as better as I can, but I think it will be readable ;)

So, this is 3 code unsing eregi_replace, but they dont work as well...

If some one can give me a help, it's will be great.

Many thx !

/ code /

/* transform [color=FF]colored text[/color] to colored text */ $message = eregi_replace
("[color=(.*)](.*)[/color]","\\2",$message);

/* transform [url=xxx]link![/url] to link! */ $message
= eregi_replace ("[url=(.*)](.*)[/url]","\\2",$message);

/* transform [b]big text[/b] to big text */
$message = eregi_replace
(".*([b]).*([/b]).*","\\1\\2\\3",$message);


-- 
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] regexp for URL

2003-06-08 Thread Boaz Yahav
Try this :

How to use regular expressions to get the list of links from an HTML
page
http://examples.weberdev.com/get_example.php3?count=1401

extract_links(); Extract all local links from a URL
http://examples.weberdev.com/get_example.php3?count=

Sincerely

berber

Visit http://www.weberdev.com/ Today!!!
To see where PHP might take you tomorrow.


-Original Message-
From: Mattia [mailto:[EMAIL PROTECTED] 
Sent: Monday, June 09, 2003 7:14 AM
To: [EMAIL PROTECTED]
Subject: [PHP] regexp for URL


Does anyone have a good regular expression for capturing all http URL in

a string?
now i'm using ?(http://[a-z0-9-/_;&=+-\.\?:@]+)\b?mi
in one of my programs, that is, all strings beginning with http:// and 
contain chars like a-z0-9 ...

does anione have something better?

thank you


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


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



Re: [PHP] Re:[PHP] Re: What program do you use to Create PHP Application?

2003-06-08 Thread poetbox
hi, fongming£¡
   What about HTML-KIT?


=== 2003-05-28 00:12:00 you wrote£º===

>Yes, I also use PHPEd to program,
>I've been using it's free  verison until now.
>
>I've been search another better, but PHPEd
>is the best for me after all.
>
>Fongming from Taiwan.
>
>
>>PHPEd is absolutely fantastic
>>
>>It colours everything so you don't forget to close >brackets or quotes and
>>helps you keep an eye on escaped chars.
>>
>>I think you have to pay for it now though.
>>Shame.
>
>"Grant" <[EMAIL PROTECTED]> wrote in message
>news:[EMAIL PROTECTED]
>> What program do you use to Create PHP Application? I am tired of doing
>this
>> in notepad or other editor and Front page.
>>
>>
>>
>
>
>
>-- 
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>---
>Fongming from Taiwan.
>
>
>--
>¡»From: ¦¹«H¬O¥Ñ®ç¤p¹q¤l¶l¥ó1.5ª©©Òµo¥X...
>http://fonn.fongming.idv.tw
>[EMAIL PROTECTED]
>
>-- 
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php

= = = = = = = = = = = = = = = = = = = =



 
 
poetbox
[EMAIL PROTECTED]
2003-06-09





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



Re: [PHP] Re:[PHP] Re: What program do you use to Create PHP Application?

2003-06-08 Thread poetbox
hi, fongming£¡


poetbox,this is the 
test11abcccff


=== 2003-05-28 00:12:00 you wrote£º===

>Yes, I also use PHPEd to program,
>I've been using it's free  verison until now.
>
>I've been search another better, but PHPEd
>is the best for me after all.
>
>Fongming from Taiwan.
>
>
>>PHPEd is absolutely fantastic
>>
>>It colours everything so you don't forget to close >brackets or quotes and
>>helps you keep an eye on escaped chars.
>>
>>I think you have to pay for it now though.
>>Shame.
>
>"Grant" <[EMAIL PROTECTED]> wrote in message
>news:[EMAIL PROTECTED]
>> What program do you use to Create PHP Application? I am tired of doing
>this
>> in notepad or other editor and Front page.
>>
>>
>>
>
>
>
>-- 
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>---
>Fongming from Taiwan.
>
>
>--
>¡»From: ¦¹«H¬O¥Ñ®ç¤p¹q¤l¶l¥ó1.5ª©©Òµo¥X...
>http://fonn.fongming.idv.tw
>[EMAIL PROTECTED]
>
>-- 
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php

= = = = = = = = = = = = = = = = = = = =


¡¡Thanks for any suggestions.
 
 
poetbox
[EMAIL PROTECTED]
2003-06-09





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



[PHP] Checkboxes and put value in db

2003-06-08 Thread Frank Keessen
Hi,

Maybe you can help me with the following: I have a list of visitors that want some 
documentation.. I'm displaying a list with a checkbox so i can check the one's that 
received the documentation. So what is must do; it must update a table called 
prospects and set the value of a field called prbrochverst to 1 .
Only problem it doesn't work; can you have a look?


// includes
include("../../conf/config.php");
include("../../conf/functions.php");

// open database connection
$connection = mysql_connect($host, $user, $pass) or die ("Unable to connect!");

// select database
mysql_select_db($db) or die ("Unable to select database!");

// generate and execute query
$query = "SELECT prospectid, praanhef, prvoorletter, prtussenv, prnaam, pradres, 
prhuisnummer, prpostcode1, prpostcode2, prplaats, premail, printresse, prbrochure, 
prdatumaanv, prbrochverst FROM prospects WHERE prbrochverst = ' ' ORDER BY 
prdatumaanv";
$result = mysql_query($query) or die ("Error in query: $query. " . mysql_error());

$_REQUEST["submit"]=isset($_REQUEST["submit"])?$_REQUEST["submit"]:"";
if($_REQUEST['submit']!="")
{
$idlist=$_POST['idlist'];
$sep=$_POST['sep'];
echo $idlist;
$array_id = explode(",", "$idlist");
foreach($array_id as $id){
if(${"id" . $id} == 1){
$query2 = "UPDATE prospects SET prbrochverst = '1'";
  $result2 = mysql_query($query2) or die ("Error in query: $query. " . mysql_error());
}
}
// close connection
mysql_close($connection);
}
?>
>
 0)
{
 // iterate through resultset
 // print title with links to edit and delete scripts
 while($row = mysql_fetch_object($result))
 {
 ?>
 prdatumaanv); ?>
 
 praanhef . " " . $row->prtussenv . " " . $row->prnaam;  
?>
 pradres . " " . $row->prhuisnummer; ?>
 prpostcode1 . " " . $row->prpostcode2 . "  " . $row->prplaats; 
?>
 premail; ?>
 printresse; ?>
prospectid;
echo "prospectid . "\" value=\"1\">";
$idlist .= $sep . $row->prospectid;
$sep = ",";

 }
}
// if no records present
// display message
else
{
?>
 Geen Prospects aanwezig
";
?>



Thanks,

Frank


Re: [PHP] stripping newlines from a string

2003-06-08 Thread Charles Kline
Yes. Is weird. I thought this would work too, but for some reason it 
was not removing them all. I wonder if re-saving the files with UNIX 
linebreaks (or try DOS) would have any effect. Will report back.

- Charles

On Monday, June 9, 2003, at 02:24 AM, Joe Pemberton wrote:

http://www.php.net/str_replace

$newstr = str_replace("\n", "", $oldstr);

- Original Message -
From: "Charles Kline" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, June 08, 2003 10:44 PM
Subject: [PHP] stripping newlines from a string

Hi all,

How would i go about stripping all newlines from a string?

Thanks,
Charles
--
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