Re: [PHP] ending a session

2002-09-05 Thread Erwin

Victor wrote:
> Why not unregistered the session variables first, destroy the session
> second and redirect the user with a header location to a plain html
> page that includes a one line JavaScript in the body tag like
> onload+thiswindow cloase or something like that, and a message that
> "please closes this window for complete logout. That's what I do and
> it works, in mozilla the script closes the window, in i.e. it asks
> that the user verify if they want to close the window, if they say
> no, then the user sees the message that "please close this window to
> logout" and that would pretty much take care of everything as far as
> I know.

So, you first destroy the session, and then open a popup window? Why? If you
destroyed the session, the user is already logged-out. Or do you destroy the
session also in a popup window? In that case you have another two usergroups
which can be a pain-in-the-ass:
a) users that don't have JavaScript activated
b) users (like me) that have a Popup killer

Maybe, with all these solutions together, we can create the perfect logout
script ;-))

Grtz Erwin



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




Re: [PHP] ending a session

2002-09-05 Thread Erwin

Raphael Hamzagic wrote:
> Thanks,
>
> But, if the client don't accept cookies?
> And if the user open  a new browser window with the same url, the new
> window will use the same opened session.

If the user opens a new window, without closing the old one first, then it
will use the same session.

If the client don't accept cookies, you'll have to turn transparant_session
on. The problem with that is, that the user will not(probably, I'm not sure
about this)  get a new session, because the server doesn't know that the
browser window is actually closed, like Rasmus told you.

One reasen the user don't accept cookies, can be the following:
http://www.w3.org/P3P/
Some users/browsers/company only accept cookies from websites which have a
P3P statement. Other users just don't accept cookies. You'll have to live
with that, use transparant_sessions and accept the negative sides of that
(if it has any).

HTH
Erwin



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




[PHP] Re: [PHP-DEV] problem in starting apache in win2k with mcrypt and mhash module

2002-09-05 Thread Terence Lee

hi Markus

thanks for your reply. what is the compatible version of mcrypt lib and php in
win32? also for linux?

terence

Markus Fischer wrote:

> You're mixing an older library with a newer php version (or
> the other way around). Please clean up your system first.
>
> Please ask on [EMAIL PROTECTED] next time.
> (Reply-To set).
>
> - Markus
>
> On Fri, Sep 06, 2002 at 09:56:59AM +0800, Terence Lee wrote :
> > Hello
> >
> > i've uncommended the mcrypt and mhash line in c:\winnt\php.ini. then i
> > try to start the apache but encounter the following error msg
> >
> > "The procedure entry point _ecalloc could not be located in the dynamic
> > link library php4ts.dll"
> >
> > "Unable to load dynamic library 'c:\php\extensions\php_mcrypt.dll" - The
> > specified procedure could not be found."
> >
> > "mhash: Unable to initialize module
> > Module compiled with module API=20010901, debug=0, thread-safety=1
> > PHP compiled with module API=20020429, debug=0, thread-safety=1
> > There options need to match"
> >
> > i m sure that the "php_mcrypt.dll" is already in that location. i've
> > also tried to change the "extension_dir" in c:\winnt\php.ini to
> > c:\php
> > c:\php\extensions\
> > c:\winnt
> > c:\winnt\system32
> >
> > and copied all the required dll to corresponding directories. same error
> > was encountered when i start the apache. can you advice how can i solve
> > it? i would like to use the mhash and mcrypt functions.
> >
> > Terence
> >
> >
> >
> >
> > --
> > PHP Development Mailing List 
> > To unsubscribe, visit: http://www.php.net/unsub.php
>
> --
> GnuPG Key: http://guru.josefine.at/~mfischer/C2272BD0.asc
> "In short, the window belongs to me.
>  The document belongs to the web site designer."
> - Poster on opera.wishlist


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




[PHP] Re: [PHP-DEV] problem in starting apache in win2k with mcrypt and mhash module

2002-09-05 Thread Markus Fischer

You're mixing an older library with a newer php version (or
the other way around). Please clean up your system first.

Please ask on [EMAIL PROTECTED] next time.
(Reply-To set).

- Markus

On Fri, Sep 06, 2002 at 09:56:59AM +0800, Terence Lee wrote : 
> Hello
> 
> i've uncommended the mcrypt and mhash line in c:\winnt\php.ini. then i
> try to start the apache but encounter the following error msg
> 
> "The procedure entry point _ecalloc could not be located in the dynamic
> link library php4ts.dll"
> 
> "Unable to load dynamic library 'c:\php\extensions\php_mcrypt.dll" - The
> specified procedure could not be found."
> 
> "mhash: Unable to initialize module
> Module compiled with module API=20010901, debug=0, thread-safety=1
> PHP compiled with module API=20020429, debug=0, thread-safety=1
> There options need to match"
> 
> i m sure that the "php_mcrypt.dll" is already in that location. i've
> also tried to change the "extension_dir" in c:\winnt\php.ini to
> c:\php
> c:\php\extensions\
> c:\winnt
> c:\winnt\system32
> 
> and copied all the required dll to corresponding directories. same error
> was encountered when i start the apache. can you advice how can i solve
> it? i would like to use the mhash and mcrypt functions.
> 
> Terence
> 
> 
> 
> 
> -- 
> PHP Development Mailing List 
> To unsubscribe, visit: http://www.php.net/unsub.php

-- 
GnuPG Key: http://guru.josefine.at/~mfischer/C2272BD0.asc
"In short, the window belongs to me.
 The document belongs to the web site designer."
- Poster on opera.wishlist

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




Re: [PHP] defining vars within functions as global

2002-09-05 Thread Gurhan Ozen

You can either use global keyword or put the variable into $GLOBALS[]
array..
See: http://www.php.net/manual/en/language.variables.scope.php

Gurhan


On Thu, 2002-09-05 at 23:52, Justin French wrote:
> Hi,
> 
> I'd like to be able to define multiple variables within a function, and have
> it available outside the function from the point the function is called...
> eg:
> 
>  function foo()
> {
> $foo = "aaa";
> $bar = "bbb";
> }
> 
> foo();
> 
> echo $foo;
> echo $bar;
> 
> ?>
> 
> How to I specify that $foo and $bar (defined in the func) are to be set
> globally (ie, outside the function)?
> 
> I'm aware I could return as array of values, but I'm interested to see if
> there's another option
> 
> 
> Justin
> 
> 
> -- 
> 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] defining vars within functions as global

2002-09-05 Thread Joe Conway

Justin French wrote:
>  function foo()
> {
> $foo = "aaa";
> $bar = "bbb";
> }
> 
> foo();
> 
> echo $foo;
> echo $bar;
> 
> ?>
> 
> How to I specify that $foo and $bar (defined in the func) are to be set
> globally (ie, outside the function)?

Why not use an include instead of a function?

Joe


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




[PHP] defining vars within functions as global

2002-09-05 Thread Justin French

Hi,

I'd like to be able to define multiple variables within a function, and have
it available outside the function from the point the function is called...
eg:



How to I specify that $foo and $bar (defined in the func) are to be set
globally (ie, outside the function)?

I'm aware I could return as array of values, but I'm interested to see if
there's another option


Justin


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




[PHP] Re: progress bar for a server side process

2002-09-05 Thread electroteque

i've soughted out a solution with flash :)

http://electroteque.dyndns.org:1023/demo/uploader/

except it adds the html output above the html do most browsers support this
?

"Richard Lynch" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> >hi there i have created a script to regenerate thumbnails for a photo
> >gallery , i have changed my code to use gd true color although it takes
> >forever now , i have it generating 20 at a time then doing the rest but
> >still takes forever , i know its impossible to generate a true progress
bar
> >for image uploads via a browser but how about server side processes ?
>
> You can do something like this:
>
>for ($i = 0; $i < 20; $i++){
> # Generate next TrueColor image:
> echo ".";
> flush();
>   }
> ?>
>
> And the user *should* see a single '.' appear as each image is completed.
>
> NOTES:
> You need the flush() because Apache/HTTP buffers output until enough
content
> is there to make it worth sending.  flush() forces the data out the door.
>
> You'd probably really be better off just telling them that the thumbnails
> will be finished in about 5 minutes (or however long it takes) and letting
> them get on with life.  Who wants to sit there watching the dots go by?
You
> can set up a scheduled task to re-generate the thumbnails requested, and
use
> a database table to track requests.
>
> --
> Like Music?  http://l-i-e.com/artists.htm
>



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




RE: [PHP] Re: ftp_put

2002-09-05 Thread victor

Ok, I'm having the same problem, see I use a form to upload but I guess
that it puts the file in temporary file, so with copy or something it
figures automatically where to take th file from how do I get the $
source and ft_put to figure out where to take this file from, or can I
get it to take it directly from the users computer through form?


- Victor > www.argilent.com

-Original Message-
From: Richard Lynch [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, September 05, 2002 9:34 PM
To: Jason Romero
Cc: [EMAIL PROTECTED]
Subject: [PHP] Re: ftp_put

>I am having problems getting the ftp_put command to upload a file to an
>apache server
>i get this error
>Warning: error opening
C:\\WINDOWS\\Desktop\\Jason\\jjmckay\\testaudio.mp3
>in /home/virtual/site31/fst/var/www/html/clientadmin/mp3upload.php on
line
>32
>
>here is the code
>
>$dest = "/var/www/html/public/$user/";
>$upload = ftp_put($FTP, $dest, $source_file, FTP_BINARY);
>
>if ($upload) echo "it worked";
>else echo "it didnt work";
>
>
>the $source_file is pulled from a form on the previous page

Need more source code to tell you exactly where, but it looks like
you're
trying to have PHP suck in the original file name rather than the
uploaded
file.

You can't do that.

If you could, PHP could be used to steal *ANY* arbitrary file off of
*ANY*
computer.  Major security problem.

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


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

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

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




[PHP] Re: PHP 4.2.2 install problem

2002-09-05 Thread Richard Lynch

>I am new to Linux and is trying to install PHP/MySQL/SSL.
>
>I used the instruction found on this link:
>http://www.brtnet.org/linux/lampssl.htm
>
>Everything seemed to install OK; on the last step, open httpd.conf and
>uncomment the lines:
>
>AddType application/x-httdp-php .php
>AddType application/x-httdp-php-source .phps
>
>I couldn't find the lines in the file.  If these lines are not there did I
>do something wrong, or can I just add them.  If I can just add them, where
>to I add them.

Just add them.

Ideally, you'd add them right after all the other AddType lines in the file.

Be sure they are not enclosed by some sort of  directive that
only applies in a situation that doesn't affect your server, though...

If all else fails, try adding them at the very bottom of the file or right
before the VirtualHost sections.

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


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




[PHP] Re: creating mail on submitting a form.

2002-09-05 Thread Richard Lynch

>hi,
>
>In a form i have several text area.when i submit the form, I need to
>send a email at a particular id which contains the text entered in the text
>area.
>Can someone gimme a script which gives me and idea about how to do that...or
>some link where i can find that.

http://php.net/mail


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


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




[PHP] Re: mod_php4 / apache config question

2002-09-05 Thread Richard Lynch

>I have tried things like this:
>php_value WSERVER red2.office.com

I think this is only going to "work" for stuff that's pre-defined in
php.ini...

But I could be very very wrong...

>and this:
>SetEnv WSERVER red2.office.com

I think this is supposed to work.
Are you sure you are doing it *inside* the various  parts of
httpd.conf that affect your server?  Or in the "global" scope outside of any
 directives?

>with and without quotes.  mod_env is loaded.  I can't find the
>variable WSERVER n $GLOBALS or $_ENV of $_GET.

Instead of looking in those varibles, look at the output from:



It might be there, but not where you expected...

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


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




[PHP] Re: Please, help with Sourceforge's PHP command-line not working at all

2002-09-05 Thread Richard Lynch

>I think that it has started recently, when SF upgraded all their system.
>There is an error code that says that it cannot load module 'mm' at line 
>0, or something like that.

'mm' is a memory-mapping library that needs to be compiled into a module for
the OS and/or PHP to use...

I'm not smart enough to tell you if it's a Un*x module missing or a PHP
module missing, though.

If it was a Un*x module, you would need to have SourceForge:
Download mm source.
Compile and install it.
Do 'ldconfig' to make the OS re-load its modules (or whatever their OS uses)
Re-start Apache (I think.)

If it's a PHP Module, they'd need to:
Do all of the above, *and*:
Re-do the ./configure for PHP, using --with-mm or whatever the
--with/--enable bit is as well as all the other stuff they used last time
(see config.nice).
Re-install PHP
Re-start Apache (for sure.)

*OR*
if they are smarter than I am (okay, it's SourceForge, so we *know* they are
smarter than I am...) they *might* be able to:

Do a ./configure of PHP using *just*:
./configure --with-mm=shared
Take the resulting mm.so from the PHP /lib directory and put it in the
extensions directory set in php.ini and then add
mm.so
in the extensions section
and re-start Apache without re-compiling all of PHP.

If you get the idea that I only vaguely understand all this crap, you are
correct :-)

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


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




[PHP] Re: ftp_put

2002-09-05 Thread Richard Lynch

>I am having problems getting the ftp_put command to upload a file to an
>apache server
>i get this error
>Warning: error opening C:\\WINDOWS\\Desktop\\Jason\\jjmckay\\testaudio.mp3
>in /home/virtual/site31/fst/var/www/html/clientadmin/mp3upload.php on line
>32
>
>here is the code
>
>$dest = "/var/www/html/public/$user/";
>$upload = ftp_put($FTP, $dest, $source_file, FTP_BINARY);
>
>if ($upload) echo "it worked";
>else echo "it didnt work";
>
>
>the $source_file is pulled from a form on the previous page

Need more source code to tell you exactly where, but it looks like you're
trying to have PHP suck in the original file name rather than the uploaded
file.

You can't do that.

If you could, PHP could be used to steal *ANY* arbitrary file off of *ANY*
computer.  Major security problem.

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


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




[PHP] Re: FORUM CODE

2002-09-05 Thread Richard Lynch

>Hi, im wondering how in popular forum software, those 'BB codes' are done in
>PHP, like, [B] and stuff. I just cant figure it out.

http://php.net/str_replace
http://php.net/ereg_replace

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


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




[PHP] Re: Help with inserting Flash into MySQL database

2002-09-05 Thread Richard Lynch

>I'm using this script to insert picture into database:
>  $data = addslashes( fread( fopen( $arrayUploadedSomething['tmp_name'],
>"r"), filesize($arrayUploadedSomething['tmp_name'] ) ) );
>
>And then i use ordinary mysql_query to insert it into database (BLOB field).
>When i print image on screen, I use this code:
>
> header("Content-type: " . $arraySomething['something_type']);
> header("Content-Disposition: inline; filename=" .
>$arraySomething['something_name'] );
> print $arraySomething['something_data'];
>
>And it works very well...:D
>
>BUT, if i insert Flash animation (or something else made in Flash) it goes
>into database well, but when I print it out  :D
>It wants to download (ignoring the contex-dispositon header) , and if i
>click open or save, it show error 

Did you also store the type and file name in the database, or are you trying
to use the variables $arraySomething which are no longer valid?

>I know that I must use HTML like this:
>--
>codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.ca
>b#version=6,0,29,0" align="middle">
> 
> 
> pluginspage="http://www.macromedia.com/go/getflashplayer"; align="middle"
>type="application/x-shockwave-flash">
>  
>--

But here you have:

arraySomething['bid'] which does not provide either
arraySomething['something_name'] nor _type nor _data...

Oh.

No.

You can't do that.

Your URL is looking like this:

something/show.php?bid=Array

Look at "View Source" in your browser.

You'll need to provide each variable separately:

...value="something/show.php?" quality=high


>It prints out Flash but the size is not correct, and it si blank (white)...
>Anyone knows where the problem could be ?

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


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




[PHP] Re: Any netscape users out there?

2002-09-05 Thread Richard Lynch

>Post data makes Netscape REFUSE to show the underlying source code!  It's 
>virtually impossible to design form handling stuff when I can't see the 
>code that's generated when i send post data.  Is this a bug and how do you fix it??

That's just Netscape being stupid.

You can't fix it.

PHP isn't even involved in this issue.

Use another browser to debug FORM data.

Actually, you *MIGHT* be able to convince Netscape to *CACHE* the FORM for
awhile...

http://php.net/header

Of course, then you'll need to figure out how to get the browser to go get
the *new* FORM once you have debugged it...

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


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




[PHP] Re: Info into Class

2002-09-05 Thread Richard Lynch

>Are there any rules as to how information from outside a class can be 
>moved into it.
>What Ive been doing so far is
>1.  Through the constructor
>2.  defining a constant
>3.  Create a method whose sole purpose is to move data from the outside 
>into the class.
> i.e.
>class foo ()
>{
>..

You could also do:

>function outside_data($bar)
>{

global $foo;


But that kinda defeats the whole purpose of having Class objects in the
first place...


But there are probably times when an experienced programmer will do that, if
the variable in question should have been a constant in the first place,
or...

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


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




[PHP] Re: greeting based on time

2002-09-05 Thread Richard Lynch

>really simple one -
>
>does someone have a bit of code that will variously display 'good morning', 
>'good afternoon', 'good evening' based on the current time?
>
>good morning from london,

My time or your time?

If you want it to be "server" time, use this:

\n";
?>

If you want it based on *THEIR* time, you have to use JavaScript to send
yourself the time set on their computer's clock on the previous page, and
then greet them...  Which means they'll have already seen some kind of page,
or at least a "flash" as the first page reloaded...

Something like this:







There are a zillion things that can go wrong with this second choice:
1. User didn't set their clock properly
2. User has JavaScript "off" or broken
3. My JavaScript is almost for sure wrong (sorry)
.
.
.

You could also have "User Profiles" and one of the endless questions you ask
them to fill in could be time zone, and then you could calculate their local
time when they come back to visit, based on the server time and their time
zone.

Of course, if they travel, you're just going to confuse them, since they'll
know it's not 'evening' where your server is, nor where they are now...

Bottom Line:
Since it's the WORLD wide web, maybe trying to be 'smart' and say the right
thing to them based on time of day isn't such a Good Idea in the first
place.

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


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




[PHP] Re: progress bar for a server side process

2002-09-05 Thread Richard Lynch

>hi there i have created a script to regenerate thumbnails for a photo
>gallery , i have changed my code to use gd true color although it takes
>forever now , i have it generating 20 at a time then doing the rest but
>still takes forever , i know its impossible to generate a true progress bar
>for image uploads via a browser but how about server side processes ?

You can do something like this:



And the user *should* see a single '.' appear as each image is completed.

NOTES:
You need the flush() because Apache/HTTP buffers output until enough content
is there to make it worth sending.  flush() forces the data out the door.

You'd probably really be better off just telling them that the thumbnails
will be finished in about 5 minutes (or however long it takes) and letting
them get on with life.  Who wants to sit there watching the dots go by?  You
can set up a scheduled task to re-generate the thumbnails requested, and use
a database table to track requests.

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


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




[PHP] Re: threads in Apache 1.3

2002-09-05 Thread Richard Lynch

>I would like to know how many PHP page apache generates in one thread at the
>same time.
>
>For example, two clients share the same thread of the apache web server.
>they request at the same time a php page. Does apache process them one by
>one?

As I understand it:

Each child processes one (1) HTTP request at a time and then goes back in
the "pool" ready to do another.

If you count a "page" strictly as the HTML, then it's just one thread, one
page.

If you are counting all the images and stuff, you never know which thread
gets which HTTP request (each image is another request) for a "page
including images".

>I use persistant database connections and I wonder, if one connection is
>always in use by one page or by more?

Each thread will end up having a connection.

Actually, it will have a connection for *each* username/password combination
used to connect, if you have multiple MySQL users in mysql_pconnect(...)

You want to be sure my.cnf has a few "extra" connections available over the
number of Apache children.  Otherwise you can find yourself "locked out" of
using 'mysql' in the command line to do administration duties.

Imagine you have a shared host, with web-sites, both very busy, both using a
different (one each) MySQL username/password.

If your httpd.conf limits the maximum number of children to 50, you'd need:

2 X 50 + ~4 ===> ~104 connections as the limit in my.cnf

More Apache children ==> More connections
More MySQL username/passwords ==> More connections

I assume a very large ISP with hundreds of customers has to:

A) Give them all a common/shared username/password, *OR*
B) Throw in a *LOT* of RAM to handle all the connections

I don't know this for a fact, though.

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


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




[PHP] Re: limit in a loop function to prevent server load

2002-09-05 Thread Richard Lynch

>hi there i was wondering if there was a way to limit the ammount of items in
>a loop to execute sleep then execute the rest of the items to prevent server
>load ?

http://php.net/sleep

Note that "sleep" time doesn't count, but that if your program uses up *TOO*
much time, it will be killed by PHP.

The default setting is 30 seconds.

You can alter it in php.ini or using http://php.net/set_time_limit

If you want to sleep 10 seconds every 50 items it would be like this:

$count = 0;
while (...){
  $count++;
  if (($count % 50) == 0){
sleep(10);
  }
}

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


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




[PHP] Re: help, array values echoed as Array on loop!

2002-09-05 Thread Richard Lynch

>$ID_arr[] = explode(',', $pictures); # make db data into array
>
>This is the string:
>
>15,16,17,18,19
>
>why does it echo as Array?

Because you have a "two-dimensional" array:

ID_arr = array(
array(15, 16, 17, 18, 19)
 );

The reason you have a 2-D array is that you have [] in the assignment:

$ID_arr[] =  function that builds an array >>>;

So the right-hand-side of = turns into an Array, and *then* you use [] to
force ID_arr to be an Array, and you stuff the one Array into the first open
position in the ID_arr Array.

Get rid of the [] and everything will be beautiful.

Any time you try to print something and get Array, it's because whatever you
have done has caused that thing to be an Array itself.  If you didn't want
it to be an Array, figure out where/how you got an "extra" layer of
Array-ness in your code.

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


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




[PHP] Re: problems with cookies

2002-09-05 Thread Richard Lynch

>setcookie("cookiename1","$domin","timeset()+1800"); 

You're being "quote" "happy" and using "way" too "many" "quotes" "" ""  :-)

$domin is a variable.  You don't need to use "$domin"
It won't "hurt" anything, since you're just forcing PHP to build *another*
string with the same exact content in it.  But it's "silly"

"timeset()+1800", however, is a big problem.  You're *supposed* to be giving
the setcookie() function a NUMBER that represents the time that has passed. 
You're giving it a string.  That's wrong.

Also, some stupid broken IE browsers won't let you provide a time without a
path.  It's wrong, but it's Microsoft.  So add '/' as your path argument:

setcookie("cookiename1", $domin, time()+1800, '/');

>$cookiename1=$domin;
>echo $cookiename1; // here it works

Yes and no.  You're not really seeing a Cookie "work"  You're just seeing
the same value you just assigned.

>?>
>--- HTML code ---
>function one(){
>?>
>--- HTML code ---
>
>--- HTML code ---
>}
>
>function two(){
>$othervar=$_COOKIE['cookiename1'];
>echo $othervar; // here it doesn't work

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


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




[PHP] Re: Printing ASCII on Linux Server

2002-09-05 Thread Richard Lynch

>Printing works fine, however 2 problems:
>
>1. linefeed ("\n") doesn't work
>
>2. escape sequences to print BOLD, ITALIC, UNDERLINE,
>NARROW don't work

Probably the same problem, really.

>$lp = popen("lpr -Plp1", "w");

I'm guessing that popen uses the shell or something, and it's "eating" your
control characters.

Try things like:

$print_string = "\"$print_string\"";
>$bytes_written = fwrite($lp, $print_string);

$print_string = str_replace("\n", "\\n", $print_string);
>$bytes_written = fwrite($lp, $print_string);


I suspect that something along those lines of convincing the shell to leave
your data alone will fix your problems.



It may also be a Good Idea to add:

if ($bytes_written != ($strlen = strlen($print_string)){
  die("Only wrote $bytes_written of $strlen characters");
}


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

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




[PHP] Re: mailing a cookiecontent

2002-09-05 Thread Richard Lynch

>if ($REQUEST_METHOD=='POST') {
>  $name = escapeshellcmd($name);
>  $group = escapeshellcmd($group);
>  $to = "[EMAIL PROTECTED]";
>  $from = "FROM: $name, $group";
>  $subject = "The subject of this mail\n\n";
>  $body = "Name: $name\t";
>  $body .= "Group: $group\n";
>  $body .= "\n\n$comments\n\n";
>
>  mail($to,$subject,$body,$from);
>  exit;
>}
>
>Well, I recieve a mail, but the mailcontent is empty.
>The cookie string is written to a hidden field like this:
>
> document.write('VALUE=\"'+cookiestr+'\">');

Get rid of the JavaScript, and just do something like this:

$body .= implode("\r\n", $_COOKIE);


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


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




[PHP] Re: empty php.ini

2002-09-05 Thread Richard Lynch

>Hi,
>
>
>I am new to PHP. I am running the module version 4.2.2 from Marc 
>Lyanage (entropy.ch) on OS X 10.1 and noticed that my 
>/usr/local/lib/php.ini is empty!?
>
>Is there a way

Just copy the php.ini-dist from the PHP source tarball or wherever you can
find it into there.

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


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




[PHP] Re: SNMP Support Problem

2002-09-05 Thread Richard Lynch

>" Fatal error: Call to undefined function: snmpwalk() ..."  ... and this 
>for all snmp functions.

This means that the --with-snmp part of ./configure didn't really work.

Go back and do the ./configure again, only like this:

./configure --with-snmp ... 2>&1 > configure.output &

You can use:

tail -f configure.output

to watch the messages go by (control-c to exit)

But you'll have a permanent record of what happened, and you can use vi or
joe or pico to look at it and search for 'snmp' and/or 'SNMP' to see what
happened.

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


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




[PHP] Re: Escape characters won't go away

2002-09-05 Thread Richard Lynch

>I'm getting multiple backslashes in data I get out of a mysql database.

That's crazy...

You'd have to be adding an awful lot of backslashes *before* you put it in
there.

MySQL "eats" up one (1) set of \s when it "reads" data.

>1. $string  = stripslashes($string);   - Doesn't do anything

Sure it does!

$string = "insert into names(name) values('Conan O\\'Brien')";
print("Before: $string\n");
$string  = stripslashes($string);
print("After: $string\n");

>2. $string = ereg_replace("\\", "", $string); - Doesn't do anything

Try it with  maybe.

>3. $string = ereg_replace("\\", "", $string); - Gives the following error
>message:
>Warning: REG_EESCAPE in script.php on line 1684

Here's why:

PHP turns "\\" into "\"
Regex sees "\" and is looking for the *next* character after that to
'escape' it.
There ain't no next character, and that's just wrong.

"" would work like this:

PHP turns that into:  "\\"  (Each "pair" of \ in "" turns into one \)
Regex then sees "\\" and turns that into: "\\"

Or, let's assume that the '.' character is "special" in Regex.

You'd need "\\." in PHP to get a non-special '.' in Regex.

Here's why:

PHP turns "\\." into "\."
Regex sees "\." and knows that you want an actual '.', not the special
character '.' that is a wild-card.

>None of these have worked.  Any thoughts on how to get rid of them? I'm
>going batty.

My first guess is you have Magic Quotes "on" in php.ini *AND* you are using
addslashes() before you insert the data.

Another possibility is that your FORMs are passing the strings along as you
go...

Here's the deal:

The whole point of MagicQuotes and addslashes is to *prepare* data to be
inserted into a database.

If you choose *not* to insert that data, and spew it out to the browser
either in a TEXTBOX or in an INPUT TYPE=HIDDEN, then you need to use
stripslashes() at that point.

Otherwise, you've failed to remove the 'extra' slashes that were added in
anticipation of you using that data in a database query.

Use "View Source" in your browser as you work on this.

HTML *also* uses \ in some situations as an escape character, and you can
confuse yourself very easily by looking at browser output, instead of what's
really there.

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


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




[PHP] Re: regex help

2002-09-05 Thread Richard Lynch

>
>$str = 'hi my friend!  this message uses html entities href="http://www.trini0.org";>test!';
>$str = preg_replace('/(.*<\/a>)/', 
>htmlspecialchars("$1"), $str);

Maybe I'm missing something here, but can't you just do:

$str = htmlspecialchars($str);

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


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




[PHP] Re: Safe_Mode problem....

2002-09-05 Thread Richard Lynch

>PHP will not allow me to do this because safe_mode is on. I've been trying for 
>the past two weeks to turn it off. Nothing I do changes it. I've changed, 

You'll have to re-compile without safe mode in the ./configure


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


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




[PHP] largest value of 2nd parameter in fgets functions

2002-09-05 Thread Terence Lee

hello

i've tried to read a line from a text file by  fgets($fp,8192). it work
fine. however, there is a line over 8192 char and i tried to increase
the 2nd parameter (e.g. 8193, 16384, 88192) still only 8192 char are
read to my string variables.

is it a limit of fgets or length of a string? any way to achieve getting
more than 8192 char from a line in a text file?

pls advice.

terence



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




Re: [PHP] Re: Hardware Address

2002-09-05 Thread Tyler Longren

using exec() or system() will only be able to execute commands on the
machine php is installed on.  I sometimes wonder how universities and
broadband isp's do this.  I'd be interested in seeing how it works.

Sorry, I'm not much help anymore.

tyler

On Fri, 6 Sep 2002 01:24:07 +0200
<[EMAIL PROTECTED]> wrote:

> Hi,
> 
> The best way I think is to use exec() or system() to ask that to the
> system. May be someone knows something better too.
> 
> --
> 
> Nicos - CHAILLAN Nicolas
> [EMAIL PROTECTED]
> www.WorldAKT.com - Hébergement de sites Internet
> 
> "Chris Cook" <[EMAIL PROTECTED]> a écrit dans le message de news:
> [EMAIL PROTECTED]
> > Hello all,
> >
> > I am working on a LAN application and am interested in obtaining the
> user's
> > network card address to limit usage of the program. Is there a way
> > to do this in PHP?
> >
> > I am on a network that uses DHCP so using the IP address probably
> > wont
> work
> > and I am also worried about IP spoofing.
> >
> > Thanks for any help you can provide,
> > Chris
> >
> >
> > _
> > Send and receive Hotmail on your mobile device:
> > http://mobile.msn.com
> >
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

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




RE: [PHP] ending a session

2002-09-05 Thread victor

Why not unregistered the session variables first, destroy the session
second and redirect the user with a header location to a plain html page
that includes a one line JavaScript in the body tag like
onload+thiswindow cloase or something like that, and a message that
"please closes this window for complete logout. That's what I do and it
works, in mozilla the script closes the window, in i.e. it asks that the
user verify if they want to close the window, if they say no, then the
user sees the message that "please close this window to logout" and that
would pretty much take care of everything as far as I know.

- Victor > www.argilent.com

-Original Message-
From: Raphael Hamzagic [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, September 05, 2002 5:32 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] ending a session

Of course Gurhan,

I have read all the php manual.
How can I send a message when the user closes the browser to destroy
the
session?

Thanks in advance

Raphael

"Gurhan Ozen" <[EMAIL PROTECTED]> wrote in message
1031261344.5091.266.camel@LOCALHOST">news:1031261344.5091.266.camel@LOCALHOST...
> You can end the session by using function session_destroy().
> See:
>
> http://www.php.net/manual/en/function.session-destroy.php
>
> For general information on how PHP handles sessions see:
>
> http://www.php.net/manual/en/ref.session.php
>
> Hope this helps.
> Gurhan
>
> On Thu, 2002-09-05 at 17:17, Raphael Hamzagic wrote:
> > Hi,
> >
> > I'm just wanna know why the session doesn't end when the user closes
the
> > browser window and how can i make it.
> >
> > Thanks
> >
> > Raphael
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
>
>



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

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

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




[PHP] Anyone use DB_DataObject

2002-09-05 Thread Peter J. Schoenster

Hi,

I'm trying to use Pear stuff but don't know if I should post to that list as just a 
user.

I'm lost when it comes to "Auto Building". It has an example of that and I tried 
to do it on a local linux box where I'm root but it failed 

> all to undefined function:  getstaticproperty

and I found something via Google that did not help at all.

It *SEEMS* I have to create a config file for each table. Personally, I admit it, I 
generate that stuff automatically in other languages, I did do the config file to 
represent a database schema but change happens so much that I just did not 
want to bother updating the config file all the time so I just generated it 
dynamically from then on.

Anyhow, I think I know where to put those config files, where I put the path for:

schema_location

but now do I put one file with all the tables defined by the example given in the 
docs?

Or do I create a file for each table?

What do I name these files? I'm lost. I got as far as this:

dataobjects_users Object
(
[__table] => user_config
[_DB_DataObject_version] => 1.0
[N] => 0
[_database_dsn] => 
[_database_dsn_md5] => 
[_database] => 
[_condition] => 
[_group_by] => 
[_order_by] => 
[_limit] => 
[_data_select] => *
[_link_loaded] => 
[_lastError] => 
)

Peter


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




Re: [PHP] Problem with inserting values into database through php

2002-09-05 Thread Olli Sinerma


I´m quite a newbie in making php, but I managed to run the test you
suggested,
but nothin happened. This time it was propably the code I did:
first I added the "or die("Invalid query: $sql");" part and ran the form,
but everything happened just like when refreshing a page.

Then I did this:
  $result = mysql_query($sql)
or die("Invalid query: $sql");

  echo $sql;

but the database was silentit just refreshed the page and cleared out
the form.

-Olli



"Brad Bonkoski" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> The best way IMHO, to debug problems like this is to echo out your
> insert query to the screen and not actually run the query, or run it and
> make sure you use:
> $sql = "INSERT INTO employees (first,last,address,position) VALUES
> ('$first','$last','$address','$position')";
> $result = mysql_query($sql)
> or die("Invalid query: $sql");
>
> (This is always good practice anyways, especially if the page depends
> upon that query's execution)
>
> Anyhow, echo out the query: $sql to the screen and then run it against
> your actual MySQL database and see how it responds?  Chances are there
> is some error there, and you'll get more meaningful feedback from the
> database backend.
>
> HTH
> -Brad
>
> Olli Sinerma wrote:
> > Hi,
> > I´m having a weird problem with getting my forms work within
> > php. I have a running MySQL server, php installed on a apache server
> > and I can make SQL queries through php, but I´m unable to insert
> > any data into it through forms.
> >
> > This is an example file that I´m using
> > (it´s from
> >
http://hotwired.lycos.com/webmonkey/99/21/index3a_page4.html?tw=programming
> > )
> >
> > __
> >
> > 
> >
> > 
> >
> >
> >
> >  >
> >
> >
> > if ($submit) {
> >
> >   // process form
> >
> >   $db = mysql_connect("localhost", "root", "mypassword");
> >
> >   mysql_select_db("mydb",$db);
> >
> >   $sql = "INSERT INTO employees (first,last,address,position) VALUES
> > ('$first','$last','$address','$position')";
> >
> >   $result = mysql_query($sql);
> >
> >   echo "Thank you! Information entered.\n";
> >
> > } else{
> >
> >
> >
> >   // display form
> >
> >
> >
> >   ?>
> >
> >
> >
> >   
> >
> >   First name:
> >
> >   Last name:
> >
> >   Address:
> >
> >   Position:
> >
> >   
> >
> >   
> >
> >
> >
> >>
> >
> >
> > } // end if
> >
> >
> >
> > ?>
> >
> >
> >
> > 
> > 
> > 
> >
> > I have set the database in working order according to the manual, but
after
> > I enter some writing into the
> > text fields and press submit: It refreshes the page and doesn't add any
> > information into the db.
> >
> > I recon that the problem might be within the $php_self command, for I
got
> > all the previous php/mySQL tutorials
> > working, but when this command appeared...problems started...or more
> > accurate word would be: nothing
> > happened.
> >
> > I have phpMyAdmin 2.3.0 running on my apache server and it can
send/receive
> > data from the db normally, so the problem shouldn't
> > be in the db server or in the php, so it´s in me or in the code :) I
have
> > read through all the FAQ:s and manuals that I have found and I still
> > can´t understand what is the problem in this one!
> >
> > -Olli
> >
> >
> >
> >
> >
>
>



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




Re: [PHP] Problem with inserting values into database through php

2002-09-05 Thread Brad Bonkoski

The best way IMHO, to debug problems like this is to echo out your 
insert query to the screen and not actually run the query, or run it and 
make sure you use:
$sql = "INSERT INTO employees (first,last,address,position) VALUES
('$first','$last','$address','$position')";
$result = mysql_query($sql)
or die("Invalid query: $sql");

(This is always good practice anyways, especially if the page depends 
upon that query's execution)

Anyhow, echo out the query: $sql to the screen and then run it against 
your actual MySQL database and see how it responds?  Chances are there 
is some error there, and you'll get more meaningful feedback from the 
database backend.

HTH
-Brad

Olli Sinerma wrote:
> Hi,
> I´m having a weird problem with getting my forms work within
> php. I have a running MySQL server, php installed on a apache server
> and I can make SQL queries through php, but I´m unable to insert
> any data into it through forms.
> 
> This is an example file that I´m using
> (it´s from
> http://hotwired.lycos.com/webmonkey/99/21/index3a_page4.html?tw=programming 
> )
> 
> __
> 
> 
> 
> 
> 
> 
> 
>  
> 
> 
> if ($submit) {
> 
>   // process form
> 
>   $db = mysql_connect("localhost", "root", "mypassword");
> 
>   mysql_select_db("mydb",$db);
> 
>   $sql = "INSERT INTO employees (first,last,address,position) VALUES
> ('$first','$last','$address','$position')";
> 
>   $result = mysql_query($sql);
> 
>   echo "Thank you! Information entered.\n";
> 
> } else{
> 
> 
> 
>   // display form
> 
> 
> 
>   ?>
> 
> 
> 
>   
> 
>   First name:
> 
>   Last name:
> 
>   Address:
> 
>   Position:
> 
>   
> 
>   
> 
> 
> 
>
> 
> 
> } // end if
> 
> 
> 
> ?>
> 
> 
> 
> 
> 
> 
> 
> I have set the database in working order according to the manual, but after
> I enter some writing into the
> text fields and press submit: It refreshes the page and doesn't add any
> information into the db.
> 
> I recon that the problem might be within the $php_self command, for I got
> all the previous php/mySQL tutorials
> working, but when this command appeared...problems started...or more
> accurate word would be: nothing
> happened.
> 
> I have phpMyAdmin 2.3.0 running on my apache server and it can send/receive
> data from the db normally, so the problem shouldn't
> be in the db server or in the php, so it´s in me or in the code :) I have
> read through all the FAQ:s and manuals that I have found and I still
> can´t understand what is the problem in this one!
> 
> -Olli
> 
> 
> 
> 
> 



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




[PHP] Problem with inserting values into database through php

2002-09-05 Thread Olli Sinerma

Hi,
I´m having a weird problem with getting my forms work within
php. I have a running MySQL server, php installed on a apache server
and I can make SQL queries through php, but I´m unable to insert
any data into it through forms.

This is an example file that I´m using
(it´s from
http://hotwired.lycos.com/webmonkey/99/21/index3a_page4.html?tw=programming 
)

__











  

  First name:

  Last name:

  Address:

  Position:

  

  



  







I have set the database in working order according to the manual, but after
I enter some writing into the
text fields and press submit: It refreshes the page and doesn't add any
information into the db.

I recon that the problem might be within the $php_self command, for I got
all the previous php/mySQL tutorials
working, but when this command appeared...problems started...or more
accurate word would be: nothing
happened.

I have phpMyAdmin 2.3.0 running on my apache server and it can send/receive
data from the db normally, so the problem shouldn't
be in the db server or in the php, so it´s in me or in the code :) I have
read through all the FAQ:s and manuals that I have found and I still
can´t understand what is the problem in this one!

-Olli





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




[PHP] Re: Hardware Address

2002-09-05 Thread nicos

Hi,

The best way I think is to use exec() or system() to ask that to the system.
May be someone knows something better too.

--

Nicos - CHAILLAN Nicolas
[EMAIL PROTECTED]
www.WorldAKT.com - Hébergement de sites Internet

"Chris Cook" <[EMAIL PROTECTED]> a écrit dans le message de news:
[EMAIL PROTECTED]
> Hello all,
>
> I am working on a LAN application and am interested in obtaining the
user's
> network card address to limit usage of the program. Is there a way to do
> this in PHP?
>
> I am on a network that uses DHCP so using the IP address probably wont
work
> and I am also worried about IP spoofing.
>
> Thanks for any help you can provide,
> Chris
>
>
> _
> Send and receive Hotmail on your mobile device: http://mobile.msn.com
>



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




[PHP] Hardware Address

2002-09-05 Thread Chris Cook

Hello all,

I am working on a LAN application and am interested in obtaining the user's 
network card address to limit usage of the program. Is there a way to do 
this in PHP?

I am on a network that uses DHCP so using the IP address probably wont work 
and I am also worried about IP spoofing.

Thanks for any help you can provide,
Chris


_
Send and receive Hotmail on your mobile device: http://mobile.msn.com


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




Re: [PHP] Good free PHP web stats package?

2002-09-05 Thread Liam MacKenzie

Agreed,
This is quite a good engine.
I don't have very big log files as I just rolled them over a couple of weeks
ago, but you gan view sample live stats here:
http://www.nudenurd.com/stats/

Cheers,
Liam


- Original Message -
From: "olinux" <[EMAIL PROTECTED]>
To: "tomba" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, September 05, 2002 4:21 PM
Subject: Re: [PHP] Good free PHP web stats package?


Webalizer is a fairly popular package, even used by a
few fortune 500's if I remember correctly. Not PHP but
fast and free.

http://www.webalizer.com/

olinux


--- tomba <[EMAIL PROTECTED]> wrote:
> I have a client that is hosted with a company that
> has a rather lame web
> stats package. I am looking for a PHP based stats
> package and have waded
> through the sites that have apps shown under PHP at
> hotscripts.com and
> wasn't drawn to the dozen or so that I looked at.
>
> So if you have recommendations, send them along.
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


__
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes
http://finance.yahoo.com

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







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




Re: [PHP] ending a session

2002-09-05 Thread Gurhan Ozen

A little addition/clarification, 
I mean in the main page, have the javascript open up a new window with
logout.php file when the user closes the browser.
Gurhan


On Thu, 2002-09-05 at 18:04, Gurhan Ozen wrote:
> Ohhh, I see what you are looking for..
> You have to play around with some javascript to do it. 
> Have a logout.php file, and destroy session in that file ...
> And in the main page, have the javascript to open up a new window with
> logout.php page.
> Makes sense?
> I hope this helps.
> Gurhan
> 
> On Thu, 2002-09-05 at 17:32, Raphael Hamzagic wrote:
> > Of course Gurhan,
> > 
> > I have read all the php manual.
> > How can I send a message when the user closes the browser to destroy  the
> > session?
> > 
> > Thanks in advance
> > 
> > Raphael
> > 
> > "Gurhan Ozen" <[EMAIL PROTECTED]> wrote in message
> > 1031261344.5091.266.camel@LOCALHOST">news:1031261344.5091.266.camel@LOCALHOST...
> > > You can end the session by using function session_destroy().
> > > See:
> > >
> > > http://www.php.net/manual/en/function.session-destroy.php
> > >
> > > For general information on how PHP handles sessions see:
> > >
> > > http://www.php.net/manual/en/ref.session.php
> > >
> > > Hope this helps.
> > > Gurhan
> > >
> > > On Thu, 2002-09-05 at 17:17, Raphael Hamzagic wrote:
> > > > Hi,
> > > >
> > > > I'm just wanna know why the session doesn't end when the user closes the
> > > > browser window and how can i make it.
> > > >
> > > > Thanks
> > > >
> > > > Raphael
> > > >
> > > >
> > > >
> > > > --
> > > > 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




Re: [PHP] ending a session

2002-09-05 Thread Gurhan Ozen

Ohhh, I see what you are looking for..
You have to play around with some javascript to do it. 
Have a logout.php file, and destroy session in that file ...
And in the main page, have the javascript to open up a new window with
logout.php page.
Makes sense?
I hope this helps.
Gurhan

On Thu, 2002-09-05 at 17:32, Raphael Hamzagic wrote:
> Of course Gurhan,
> 
> I have read all the php manual.
> How can I send a message when the user closes the browser to destroy  the
> session?
> 
> Thanks in advance
> 
> Raphael
> 
> "Gurhan Ozen" <[EMAIL PROTECTED]> wrote in message
> 1031261344.5091.266.camel@LOCALHOST">news:1031261344.5091.266.camel@LOCALHOST...
> > You can end the session by using function session_destroy().
> > See:
> >
> > http://www.php.net/manual/en/function.session-destroy.php
> >
> > For general information on how PHP handles sessions see:
> >
> > http://www.php.net/manual/en/ref.session.php
> >
> > Hope this helps.
> > Gurhan
> >
> > On Thu, 2002-09-05 at 17:17, Raphael Hamzagic wrote:
> > > Hi,
> > >
> > > I'm just wanna know why the session doesn't end when the user closes the
> > > browser window and how can i make it.
> > >
> > > Thanks
> > >
> > > Raphael
> > >
> > >
> > >
> > > --
> > > 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




Re: [PHP] ending a session

2002-09-05 Thread Raphael Hamzagic

Of course Gurhan,

I have read all the php manual.
How can I send a message when the user closes the browser to destroy  the
session?

Thanks in advance

Raphael

"Gurhan Ozen" <[EMAIL PROTECTED]> wrote in message
1031261344.5091.266.camel@LOCALHOST">news:1031261344.5091.266.camel@LOCALHOST...
> You can end the session by using function session_destroy().
> See:
>
> http://www.php.net/manual/en/function.session-destroy.php
>
> For general information on how PHP handles sessions see:
>
> http://www.php.net/manual/en/ref.session.php
>
> Hope this helps.
> Gurhan
>
> On Thu, 2002-09-05 at 17:17, Raphael Hamzagic wrote:
> > Hi,
> >
> > I'm just wanna know why the session doesn't end when the user closes the
> > browser window and how can i make it.
> >
> > Thanks
> >
> > Raphael
> >
> >
> >
> > --
> > 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] ending a session

2002-09-05 Thread Raphael Hamzagic

Thanks,

But, if the client don't accept cookies?
And if the user open  a new browser window with the same url, the new window
will use the same opened session.

I'm having trouble with this

Thanks,

Raphael

"Rasmus Lerdorf" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Because there is absolutely no way for PHP to know that the user has
> closed the browser window.  Nothing is sent from the browser to the server
> on a window close.  By using session cookies (cookies without a specified
> expiry time) the session is effectively ended since the cookie is gone
> once the browser has been completely shut down (not just a window).  When
> that user comes back to the site after starting their browser again they
> will get a new session.
>
> -Rasmus
>
> On Thu, 5 Sep 2002, Raphael Hamzagic wrote:
>
> > Hi,
> >
> > I'm just wanna know why the session doesn't end when the user closes the
> > browser window and how can i make it.
> >
> > Thanks
> >
> > Raphael
> >
> >
> >
> > --
> > 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] ending a session

2002-09-05 Thread Gurhan Ozen

You can end the session by using function session_destroy().
See:

http://www.php.net/manual/en/function.session-destroy.php

For general information on how PHP handles sessions see:

http://www.php.net/manual/en/ref.session.php

Hope this helps.
Gurhan

On Thu, 2002-09-05 at 17:17, Raphael Hamzagic wrote:
> Hi,
> 
> I'm just wanna know why the session doesn't end when the user closes the
> browser window and how can i make it.
> 
> Thanks
> 
> Raphael
> 
> 
> 
> -- 
> 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] ending a session

2002-09-05 Thread Rasmus Lerdorf

Because there is absolutely no way for PHP to know that the user has
closed the browser window.  Nothing is sent from the browser to the server
on a window close.  By using session cookies (cookies without a specified
expiry time) the session is effectively ended since the cookie is gone
once the browser has been completely shut down (not just a window).  When
that user comes back to the site after starting their browser again they
will get a new session.

-Rasmus

On Thu, 5 Sep 2002, Raphael Hamzagic wrote:

> Hi,
>
> I'm just wanna know why the session doesn't end when the user closes the
> browser window and how can i make it.
>
> Thanks
>
> Raphael
>
>
>
> --
> 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] ending a session

2002-09-05 Thread Raphael Hamzagic

Hi,

I'm just wanna know why the session doesn't end when the user closes the
browser window and how can i make it.

Thanks

Raphael



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




Re: [PHP] multiple keywords in search boxes

2002-09-05 Thread timo stamm

Hi Jason,


have a look at Richard Lynchs reply posted at Sat, 31. Aug. 
2002  03:08:39 Europe/Berlin with subject "[PHP] Re: performing 
searches with random entries"


Timo


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




Re: [PHP] Help with inserting Flash into MySQL database

2002-09-05 Thread timo stamm

Hi Mitja,


If I understand this right, the SWF file has to be a SWF file.

To make it work like you want, you need a script that
- writes the SWF from the db to a SWF file on the server,
- returns HTML with object/embed tags and the path to the SWF file.


Timo


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




Re: [PHP] XSLT - Sablotron

2002-09-05 Thread Chris Wesley

On Thu, 5 Sep 2002, Devin Atencio wrote:

> I am trying to find out a way I can pass a variable that is basically
> an XML document to xslt_process and make it all work. My script

$xmldata = "";
$xsltArgs = array( '/_xml' => $xmlStr );
$xp = xslt_create();
$result = xslt_process( $xp, 'arg:/_xml', 'file.xsl', NULL, $xsltArgs );

Don't waste the code/resources on putting the xml into a file.

g.luck,
~Chris


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




[PHP] precision using pow()

2002-09-05 Thread David Rice

Hi:
I am attempting to calculate a mortgage payment using the following code.



which produces: 630.40515566726

What I am looking for is 632.65 (rounded to 2 places).

(I am not looking for a rounding mechanism, just a more accurate result)
The manual states that the pow function attempts to return an Integer. 
Is this the source of the inaccurate result?

The manual also says to look at exp but appears to be missing some sort 
of usage example. I have no idea how that works. I tried a few things 
with no success.

I also came across a mention of bcpow() but am unable to use this in the 
build that I am using.

So is it some boneheaded coding error on my part or am I asking for too 
much of pow()?

Thanks

David


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




[PHP] Re: XSLT - Sablotron

2002-09-05 Thread nicos

You should put the content into a file.

--

Nicos - CHAILLAN Nicolas
[EMAIL PROTECTED]
www.WorldAKT.com - Hébergement de sites Internet

"Devin Atencio" <[EMAIL PROTECTED]> a écrit dans le message de news:
067301c25516$ff18c4d0$[EMAIL PROTECTED]
>
> I am trying to find out a way I can pass a variable that is basically
> an XML document to xslt_process and make it all work. My script
> works if I have:
>
>
> $xp = xslt_create();
> $result = xslt_process($xp, 'test.xml', 'test.xsl');
>
> however, if I try to do:
>
>
> $xp = xslt_create();
> $result = xslt_process($xp, $xmldata, 'test.xsl');
>
> it won't work. $xmldata contains an XML document, but for some reason
> it errors out on me, any ideas on how to make this work? I basically
> have
> the XML data generated dynamically from a database and then I want to
> pass it to the XSLT to process the page.
>
> Any help would greatly be appreciated.
>
>



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




[PHP] xml parsing (while loop question)

2002-09-05 Thread Kristopher Yates

Hi,

I have Marc Robards article on XML Parsing with PHP 
(wirelessdevnet.com).. which talks about parsing an XML FILE.  My XML is 
from a remote server (used curl to get it back to PHP as a variable).

How do I change the following while to read from variable instead of 
file without getting these lame "XML error: junk after document element 
at line 1"?

while($data=fread($fp, 4096)){
if(!xml_parse($sml_parser, $data, feof($fp))){
   die.
}
}

What I tried was $data being the variable containing xml from remote 
host.. so I say
while($data){
}
which works but when it gets to the end it dies with:
XML error: junk after document element at line 1

Can anybody help me?  Can anybody see?  Sundays on the phone with 
monday.. sorry beatles flashback.  I am not the walrus but I'm not a 
newbie either.. so very sorry for this newbie-esque question.

Kris


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




[PHP] XSLT - Sablotron

2002-09-05 Thread Devin Atencio

 
I am trying to find out a way I can pass a variable that is basically
an XML document to xslt_process and make it all work. My script
works if I have:
 
 
$xp = xslt_create();
$result = xslt_process($xp, 'test.xml', 'test.xsl');
 
however, if I try to do:
 
 
$xp = xslt_create();
$result = xslt_process($xp, $xmldata, 'test.xsl');
 
it won't work. $xmldata contains an XML document, but for some reason
it errors out on me, any ideas on how to make this work? I basically
have
the XML data generated dynamically from a database and then I want to 
pass it to the XSLT to process the page.
 
Any help would greatly be appreciated.
 



Re: [PHP] finding next and previous db entries

2002-09-05 Thread Gurhan Ozen

You have to use recursive functions for this. You can write one..

function linkchecker($id)
{
$query="SELECT COUNT(*) AS mycount FROM tablename WHERE id=".$id."";
$result=mysql_query($query);
$row=mysql_fetch_array($result);

$nextid = $id + 1;
if (($row["mycount"]) > 0 )
{

echo " link ";
}
else
{
linkchecker($nextid);
}
}


Modify this to your needs..
I hope this helps..

Gurhan



On Thu, 2002-09-05 at 17:20, tux wrote:
> 
> hey all,
> 
> if im displaying pages with data from a database eg 
> 
> www.domain.com/file.php?id=40
> 
> on that page i would like to have a previous and next link that would
> take it to id 41 and 39 respectively, the only problem being what if 39
> or 41 was empty? then i would want the link to be id=42 or id=38.. is
> the best way to do this just loop through the id's until it finds a
> entry that isnt empty? or is there any functions for this?
> 
> jo
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 




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




[PHP] Re: file upload problem

2002-09-05 Thread nicos

Take a look at
http://www.php.net/manual/sv/printwn/features.file-upload.php, your pages
should be named .php and not .php3 if you support PHP4.

--

Nicos - CHAILLAN Nicolas
[EMAIL PROTECTED]
www.WorldAKT.com - Hébergement de sites Internet

"Ram K" <[EMAIL PROTECTED]> a écrit dans le message de news:
[EMAIL PROTECTED]
> Hey
>
> I have a prob with my php file upload. i am using windows
>
> my html file looks like
> 
> 
> 
> 
>  ENCTYPE="multipart/form-data">
> Upload the datafile here
> 
> 
> 
> 
> 
> 
> 
> my php file looks like
> 
>  $endresult = "File Was Uploaded";
>
> $newfile = "C:\\upload\\".$file_name;
>
> echo $newfile."";
> echo $file."";
>
> @copy($file, $newfile) or $endresult = "Couldn't Copy File To
> Server";
>
> echo $endresult;
> ?>
>
> 
> when i run i get an error
> \\php2
> c:\upload\a.gif
> cannot upload file
>
> any ideas why?? also i am not clear as to where the \\php2 comes
>  from
>
> thanks in advance
>
> regards
> ram
>
> __
> Give your Company an email address like
> ravi @ ravi-exports.com.  Sign up for Rediffmail Pro today!
> Know more. http://www.rediffmailpro.com/signup/
>



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




[PHP] file upload problem

2002-09-05 Thread Ram K

Hey

I have a prob with my php file upload. i am using windows

my html file looks like





Upload the datafile here







my php file looks like

";
echo $file."";

@copy($file, $newfile) or $endresult = "Couldn't Copy File To 
Server";

echo $endresult;
?>


when i run i get an error
\\php2
c:\upload\a.gif
cannot upload file

any ideas why?? also i am not clear as to where the \\php2 comes 
 from

thanks in advance

regards
ram

__
Give your Company an email address like
ravi @ ravi-exports.com.  Sign up for Rediffmail Pro today!
Know more. http://www.rediffmailpro.com/signup/


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




RE: [PHP] PHP & MySQL & Apache on Linux vs. Solaris

2002-09-05 Thread Adam Williams

I haven't had any problems with mysql like you are having.  I would
recommand you recompile the source rpm to the binary rpms and then install
them.

Adam

On Thu, 5 Sep 2002, Boaz Yahav wrote:

> I'm using 3.23.52-log
>
> -Original Message-
> From: Adam Williams [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, September 05, 2002 3:22 PM
> To: Boaz Yahav
> Cc: PHP General (E-mail)
> Subject: Re: [PHP] PHP & MySQL & Apache on Linux vs. Solaris
>
>
> Go to www.mysql.com and make sure you are using the latest version of
> MySQL.
>
>   Adam
>
> On Thu, 5 Sep 2002, Boaz Yahav wrote:
>
> > Hi
> >
> > Since i moved from a Sun / Solaris Machine to a Compaq / Linux machine
>
> > I'm having weird problems with MySQL crashing while running reports
> > written in php.
> >
> > The site is amazingly fast now on the Linux server but running a
> > report that locks the main tables for about 20 seconds raises the load
>
> > and crashes the server.
> >
> > While this makes some sense (maybe) i did not have this while i was on
>
> > Solaris. Why would Solaris know how to hold the queries in the Queue
> > till the tables are freed and Linux does not?
> >
> > Is this PHP, MySQL or maybe Linux to blame?
> >
> > thanks
> >
> > berber
> >
>


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




RE: [PHP] PHP & MySQL & Apache on Linux vs. Solaris

2002-09-05 Thread Boaz Yahav

I'm using 3.23.52-log

-Original Message-
From: Adam Williams [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, September 05, 2002 3:22 PM
To: Boaz Yahav
Cc: PHP General (E-mail)
Subject: Re: [PHP] PHP & MySQL & Apache on Linux vs. Solaris


Go to www.mysql.com and make sure you are using the latest version of
MySQL.

Adam

On Thu, 5 Sep 2002, Boaz Yahav wrote:

> Hi
>
> Since i moved from a Sun / Solaris Machine to a Compaq / Linux machine

> I'm having weird problems with MySQL crashing while running reports 
> written in php.
>
> The site is amazingly fast now on the Linux server but running a 
> report that locks the main tables for about 20 seconds raises the load

> and crashes the server.
>
> While this makes some sense (maybe) i did not have this while i was on

> Solaris. Why would Solaris know how to hold the queries in the Queue 
> till the tables are freed and Linux does not?
>
> Is this PHP, MySQL or maybe Linux to blame?
>
> thanks
>
> berber
>


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




RE: [PHP] formatting a filename

2002-09-05 Thread Mike richardson


Ereg() would be an excellent choice.

To move a step further, although it is a little more complex to become
familiar with, the perl regular expressions are considerably faster and
more efficient for anything with an expression, and str_replace() is
faster yet, if replacing a simple string.

Thus, it would probably be best to use:

$clean_term = str_replace( " ", "_", $term);  // replace spaces with _
$clean_term = preg_replace("@[^a-zA-Z0-9_.]@", "", $term); // remove any
non-alphanumeric chars

There is an excellent article somewhere that gives some benchmark times
for the various methods... Anyone know where this is?  I can't seem to
find it anymore.

However, I remember the basic concept:  on a given string, preg_replace
ran about 1 second, ereg_replace ran about 4 seconds, and str_replace
ran about .2 seconds.

See these docs for info about syntax:
http://www.php.net/manual/en/function.preg-replace.php
http://www.php.net/manual/en/function.str-replace.php
http://www.php.net/manual/en/function.ereg-replace.php

Best wishes

Michael
"phpzen"


-Original Message-
From: Rodolfo Gonzalez [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, September 05, 2002 9:34 AM
To: Javier Montserat
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] formatting a filename


On Thu, 5 Sep 2002, Javier Montserat wrote:

> i want to format the filename of an uploaded file as follows :-
> -- replace blankspace with "_"
> -- remove any illegal characters.
> Which string functions should I use to do this?

http://www.php.net/manual/en/function.ereg.php
http://www.php.net/manual/en/function.ereg.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




Re: [PHP] Problems with PHP post and get

2002-09-05 Thread Dion

Thanks.  As you can prolbably tell, I am quite the beginner.  Thanks for the
help!!!

--
Dion Munk
[EMAIL PROTECTED]
"Jay Blanchard" <[EMAIL PROTECTED]> wrote in message
003701c254f2$f3e5aed0$8102a8c0@000347D72515">news:003701c254f2$f3e5aed0$8102a8c0@000347D72515...
> [snip]
> I'm running Apache 1.3.26 and PHP 4.2.2 on a windows NT system.  I've been
> having problems with some scripts I got from a friend off the net.  The
> script runs an initial setup process and asks for a username and password
> and e-mail address.. you submit the info and it will set up an admin
account
> then you refresh the page and it will ask you to login with the username
and
> junk that you just set up.. But, when I try to submit the information, it
> simply reloads the page.  Can anyone tell me if there is something in my
> PHP.INI file i need to change or anything else?  If anyone wants to try
the
> script out, it is newsPHP from http://www.nphp.net/.  Please, someone
help!
> [/snip]
>
> My SWAG is that you need to set register_globals = On in your php.ini.
> Either that or you need the rtfm() function.
>
> HTH!
>
> Jay
>
>



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




Re: [PHP] formatting a filename

2002-09-05 Thread Rodolfo Gonzalez

On Thu, 5 Sep 2002, Javier Montserat wrote:

> i want to format the filename of an uploaded file as follows :-
> -- replace blankspace with "_"
> -- remove any illegal characters.
> Which string functions should I use to do this?

http://www.php.net/manual/en/function.ereg.php
http://www.php.net/manual/en/function.ereg.php




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




[PHP] PEAR Documentation

2002-09-05 Thread Mauricio Cuenca

Hello,

I just started to use some PEAR classes, by now, I'm dealing with PEAR::DB
that has a lot of examples and documentation but I can't find anything
similar for PEAR::HTML_QuickForm.

Where can I find documentation about this class ? I'm trying to learn it
just by trial and error but a list of functions, methods and properties
would be very nice.

Thanks,

_
Mauricio Cuenca



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




Re: [PHP] passing error code vars

2002-09-05 Thread bbonkosk

If the variable is within a form you could do:


This would pass to the next page, otherwise the ?name_of_var=$err_code mau be 
the way to go?

-Brad

> hi there i am trying to pass error code vars within a page say i post to a
> query string like ?action=upload i would like to be able to send an error
> code if any back to the page and then it can bring it up the only way i can
> think of it when i redirect back to the previous page is adding a
> ?errorcode=1 etc
> 
> 
> 
> -- 
> 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] dynamic screencapture using gd

2002-09-05 Thread Marek Kilimajer

Shouldn't be possible, as it would be a security risk.

electroteque wrote:

>yeh i was getting too deep into automation scripts on windoze but became
>system intensive thanks
>
>"Justin French" <[EMAIL PROTECTED]> wrote in message
>[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>  
>
>>I seriously doubt it, because really, what you want to capture is how the
>>*browser* renders the HTML code... GC is not a browser, nor a parser of
>>
>>
>HTML
>  
>
>>code.
>>
>>This topic has been discussed a few times in various shapes and forms in
>>
>>
>the
>  
>
>>archive... it'd be worth doing a search for screen grab and screen capture
>>to see if anything got resolved.
>>
>>You could probably automate a large amount of it with Applescript (Mac, or
>>equiv. PC scripting) and Photoshop's actions (macros)... but someone has
>>prolly got a better solution that they've thought thru :)
>>
>>
>>Justin
>>
>>
>>
>>
>>on 06/09/02 1:07 AM, electroteque ([EMAIL PROTECTED]) wrote:
>>
>>
>>
>>>is there a way to do a dynamic screen capture of a website using gd ?
>>>
>>>
>>>  
>>>
>
>
>
>  
>


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




Re: [PHP] PHP e GD big files

2002-09-05 Thread Marek Kilimajer

The answer is compression - the image with text is more complicated, so 
the compression ration is lower

Rodrigo Peres wrote:

>Hi,
>
>I'm using GD to put a dinamic text in some buttons. The problem is that the
>original image that I use has 8k and after i put a black text it jumps to
>20K. What I'm doing wrong? there's a way to compact this?
>
>Thank's
>  
>


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




Re: [PHP] dynamic screencapture using gd

2002-09-05 Thread electroteque

yeh i was getting too deep into automation scripts on windoze but became
system intensive thanks

"Justin French" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I seriously doubt it, because really, what you want to capture is how the
> *browser* renders the HTML code... GC is not a browser, nor a parser of
HTML
> code.
>
> This topic has been discussed a few times in various shapes and forms in
the
> archive... it'd be worth doing a search for screen grab and screen capture
> to see if anything got resolved.
>
> You could probably automate a large amount of it with Applescript (Mac, or
> equiv. PC scripting) and Photoshop's actions (macros)... but someone has
> prolly got a better solution that they've thought thru :)
>
>
> Justin
>
>
>
>
> on 06/09/02 1:07 AM, electroteque ([EMAIL PROTECTED]) wrote:
>
> > is there a way to do a dynamic screen capture of a website using gd ?
> >
> >
>



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




RE: [PHP] Problems with PHP post and get

2002-09-05 Thread Jay Blanchard

[snip]
I'm running Apache 1.3.26 and PHP 4.2.2 on a windows NT system.  I've been
having problems with some scripts I got from a friend off the net.  The
script runs an initial setup process and asks for a username and password
and e-mail address.. you submit the info and it will set up an admin account
then you refresh the page and it will ask you to login with the username and
junk that you just set up.. But, when I try to submit the information, it
simply reloads the page.  Can anyone tell me if there is something in my
PHP.INI file i need to change or anything else?  If anyone wants to try the
script out, it is newsPHP from http://www.nphp.net/.  Please, someone help!
[/snip]

My SWAG is that you need to set register_globals = On in your php.ini.
Either that or you need the rtfm() function.

HTH!

Jay



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




[PHP] Problems with PHP post and get

2002-09-05 Thread Dion

I'm running Apache 1.3.26 and PHP 4.2.2 on a windows NT system.  I've been
having problems with some scripts I got from a friend off the net.  The
script runs an initial setup process and asks for a username and password
and e-mail address.. you submit the info and it will set up an admin account
then you refresh the page and it will ask you to login with the username and
junk that you just set up.. But, when I try to submit the information, it
simply reloads the page.  Can anyone tell me if there is something in my
PHP.INI file i need to change or anything else?  If anyone wants to try the
script out, it is newsPHP from http://www.nphp.net/.  Please, someone help!

--
Dion Munk
[EMAIL PROTECTED]



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




Re: [PHP] dynamic screencapture using gd

2002-09-05 Thread Justin French

I seriously doubt it, because really, what you want to capture is how the
*browser* renders the HTML code... GC is not a browser, nor a parser of HTML
code.

This topic has been discussed a few times in various shapes and forms in the
archive... it'd be worth doing a search for screen grab and screen capture
to see if anything got resolved.

You could probably automate a large amount of it with Applescript (Mac, or
equiv. PC scripting) and Photoshop's actions (macros)... but someone has
prolly got a better solution that they've thought thru :)


Justin




on 06/09/02 1:07 AM, electroteque ([EMAIL PROTECTED]) wrote:

> is there a way to do a dynamic screen capture of a website using gd ?
> 
> 


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




Re: [PHP] PHP e GD big files

2002-09-05 Thread Justin French

Attach the two GIFs (pre and post text) in an email to me...

Justin



on 06/09/02 1:26 AM, Rodrigo Peres ([EMAIL PROTECTED]) wrote:

> Hi,
> 
> I'm using GD to put a dinamic text in some buttons. The problem is that the
> original image that I use has 8k and after i put a black text it jumps to
> 20K. What I'm doing wrong? there's a way to compact this?
> 
> Thank's


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




Re: [PHP] sort dinamic generated table

2002-09-05 Thread Geoff Hankerson

Rodrigo Peres wrote:

>Hi,
>
>I have a resume system that put a rank in it resume at runtime. example: If
>you do a serach for each match that it finds it atribute 1 point, now I need
>to sort the generated list based in this rank, how can i do this, since this
>rank is dinamic and isn't in database??
>
>Thank's
>
>  
>
Did you try putting it all in into an array and sorting the array?



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




RE: [PHP] sort dinamic generated table

2002-09-05 Thread David Buerer

stick the values in an array and use asort() to sort it.

-Original Message-
From: Rodrigo Peres [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 05, 2002 8:30 AM
To: PHP
Subject: [PHP] sort dinamic generated table


Hi,

I have a resume system that put a rank in it resume at runtime. example: If
you do a serach for each match that it finds it atribute 1 point, now I need
to sort the generated list based in this rank, how can i do this, since this
rank is dinamic and isn't in database??

Thank's


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




[PHP] sort dinamic generated table

2002-09-05 Thread Rodrigo Peres

Hi,

I have a resume system that put a rank in it resume at runtime. example: If
you do a serach for each match that it finds it atribute 1 point, now I need
to sort the generated list based in this rank, how can i do this, since this
rank is dinamic and isn't in database??

Thank's


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




[PHP] PHP e GD big files

2002-09-05 Thread Rodrigo Peres

Hi,

I'm using GD to put a dinamic text in some buttons. The problem is that the
original image that I use has 8k and after i put a black text it jumps to
20K. What I'm doing wrong? there's a way to compact this?

Thank's
-- 



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




[PHP] file download/open and ie bug

2002-09-05 Thread David Buerer

I'm using version 6 of IE and Netscape

I'm allowing the user to open/dowload a file from a secure locaiton on our
server.  Under Netscape it works great!  Under IE, it doesn't work at all.
IE complains about not being able to read from the server.

Anyone know of any workarounds?

here's the command I send:

header("Content-type: {$mimetype[PDF]} \n");
header("Content-transfer-encoding: binary\n"); 
header("Content-length: " . filesize($fname) . "\n");
readfile($fname);



[PHP] dynamic screencapture using gd

2002-09-05 Thread electroteque

is there a way to do a dynamic screen capture of a website using gd ?



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




[PHP] Re: formatting a filename

2002-09-05 Thread Javier Montserat

$filename = strtolower (eregi_replace ("[^A-Za-z0-9_.]", "_", $filename));

seems to be what I want.

thanks to everyone for the help

Javier


_
Send and receive Hotmail on your mobile device: http://mobile.msn.com


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




[PHP] GD with PHP on win2000

2002-09-05 Thread Benali Adnane



Hello,

I am looking for usefull pointers on how to install GD graphing libraries with PHP 4.0 
on a windows 2000 system.

Thanks,
Adnane.

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




[PHP] passing error code vars

2002-09-05 Thread electroteque

hi there i am trying to pass error code vars within a page say i post to a
query string like ?action=upload i would like to be able to send an error
code if any back to the page and then it can bring it up the only way i can
think of it when i redirect back to the previous page is adding a
?errorcode=1 etc



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




Re: [PHP] Currency Exchange and Weather

2002-09-05 Thread electroteque

oanda www.oanda.com had a service where you could socket into it , that is
now not free but they still have a free email service which i parse the
information out of the email and add it to a currency table in the database
which is run via a daily cron job

"Justin French" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
This appears to do what you want... or at least provide some inspiration:

http://www.phpclasses.org/browse.html/file/1220.html

I'm sure there are hundreds of web services based on currency conversion and
weather... usually they send XML data which you parse... google will help :)


Justin French


on 05/09/02 3:30 PM, César Aracena ([EMAIL PROTECTED]) wrote:

> Hi all.
>
> I need to find FREE world wide weather reports and also a FREE currency
> converter from US Dollars to other currencies that can serve PHP
> requests 24 hours a day, so I can customize the look and feel of these
> results in my site(s). Does anyone knows where to get all this? Has
> anyone out there fulfilled this kind of requirements in the past?
>
> Thanks in advance,
>
> Cesar Aracena 
> On Dial-Up
> CE / MCSE+I
> Neuquen, Argentina
> +54.299.6356688
> +54.299.4466621
>
>




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




RE: [PHP] dropdown Newbie question

2002-09-05 Thread Jay Blanchard

[snip]
> Did you put a closing form tag? 
you are right, the closeing tag was missing, well, it still doesnt
work/stays emty ;/
[/snip]

Does this form refer to itself, or another page? Also, like Justin said,
echo the variable before writing to a directory to see what is getting
written, if anything.

Jay



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




RE: [PHP] dropdown Newbie question

2002-09-05 Thread Mario Ohnewald

> From: Jay Blanchard [mailto:[EMAIL PROTECTED]]
>
>
> Did you put a closing form tag? 
you are right, the closeing tag was missing, well, it still doesnt
work/stays emty ;/


// Theme
echo '

  ';
for($i=0;$i".$theme_name[$i]."\n";
}
echo '  ';

echo ''; //i tried it here

$var_from_dropdown = $_POST['theme'];
exec("echo $var_from_dropdown > /tmp/varfromdropdown");

//echo ''; //and here, to be sure. Of course never toghether!

Mario

>
> Jay
>
>
>


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




Re: [PHP] RE : include interpreted php file

2002-09-05 Thread you

hi,

thanks for your help again.

i've noticed that file function have two different behaviors.
i tested file function with the url and it seems that the file is
interpreted. But i tried the code u give me and without the
"http://myurl.com/"; at the beginning, a warning is raised :

Warning: file("test.php?foo=test") - Invalid argument in c:\program
files\easyphp\www\un.php on line 10

otherwise, without the http string, it reads the file as text file and print
exactly his content.

You

"Timo Stamm" <[EMAIL PROTECTED]> a écrit dans le message de news:
[EMAIL PROTECTED]
> @all:
>
> I just noticed that I was not replying to the list, but to the
> posting email adresses. I just switched to another email client
> and was not aware of this. My apologies :-(
>
>
> ---
>
>
> You,
>
> could it be that you want to do the following?:
>
> // primary php
>
>$foo = $_REQUEST["foo"]
>// I guess you want to do something with $foo here.
>$outputfromsecondaryphp = file("secondary.php?foo=".$foo)
>echo implode('', $outputfromsecondaryphp);
> ?>
>
>
> Am Dienstag den, 3. September 2002, um 00:15, schrieb you:
> > Thanks for ur help and i'm sorry to have a so bad english
>
> I guess my french is worse than your english :-)
>
>
> Timo
>



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




Re: [PHP] dropdown Newbie question

2002-09-05 Thread Justin French

Why don't you take the guesswork out of it a bit, and NOT write to a file
just yet... instead, just echo the var to the screen.  IF that works, then
we know it's not your form that is the problem, it's the exec().

Justin




on 06/09/02 12:08 AM, Mario Ohnewald ([EMAIL PROTECTED]) wrote:

> Well, this is my original Code:
> 
> --
> 
> 
> // Theme
> echo '
>  METHOD="POST">
>   ';
> for($i=0;$i {
> echo "".$theme_name[$i]."\n";
> }
> 
> echo '  ';
> 
> $var_from_dropdown = $_POST['theme'];
> exec("echo $var_from_dropdown > /tmp/varfromdropdown");
> 
> 
> The file /tmp/varfromdropdown is still emty. (the dropdown field is NOT emty
> by
> the time i press the select button)
> 
> Any other ideas?
> 
> 
> 
>> From: Jay Blanchard [mailto:[EMAIL PROTECTED]]
>> 
>> 
>> [snip]
>> // Theme
>> echo '
>> 
>>   ';
>> for($i=0;$i> {
>> echo "".$theme_name[$i]."\n";
>> }
>> 
>> echo '  > METHOD=POST>';
>> // or:
>> echo '  > METHOD="POST">';
>> 
>> $var_from_dropdown = $_POST['theme'];
>> exec("echo $var_from_dropdown > /tmp/varfromdropdown");
>> 
>> the exec line seems to works since it created the file. But
>> it stays emty.
>> [/snip]
>> 
>> You need to place METHOD=POST in the original form tag and
>> remove it from
>> the submit tag. Try that
>> 
>> HTH!
>> 
>> Jay
> 


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




Re: [PHP] formatting a filename

2002-09-05 Thread Marek Kilimajer

I use this, it includes also national characters
$name=strtr( $name,
"`O}ao~¾YYµAÁÂAÄAAÇEÉEËIÍÎI?NOÓÔOÖOUÚUÜÝßaáâaäaaçeéeëiíîi?noóôoöouúuüýy 
*!@#$%^&()+=",
"SOZsozlYYuAAACDNOOYsaaaconooyy_");

Javier Montserat wrote:

> i want to format the filename of an uploaded file as follows :-
>
> -- replace blankspace with "_"
>
> -- remove any illegal characters.
>
> Which string functions should I use to do this?
>
> Thanks,
>
> Javier
>
>
>
> _
> Join the worlds largest e-mail service with MSN Hotmail. 
> http://www.hotmail.com
>
>


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




RE: [PHP] dropdown Newbie question

2002-09-05 Thread Jay Blanchard

[snip]
Well, this is my original Code:
// Theme
echo '

  ';
for($i=0;$i".$theme_name[$i]."\n";
}

echo '  ';

$var_from_dropdown = $_POST['theme'];
exec("echo $var_from_dropdown > /tmp/varfromdropdown");

The file /tmp/varfromdropdown is still emty. (the dropdown field is NOT emty
by
the time i press the select button)

Any other ideas?
[/snip]

Did you put a closing form tag? 

Jay



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




RE: [PHP] dropdown Newbie question

2002-09-05 Thread Mario Ohnewald

Well, this is my original Code:

--


// Theme
echo '

  ';
for($i=0;$i".$theme_name[$i]."\n";
}

echo '  ';

$var_from_dropdown = $_POST['theme'];
exec("echo $var_from_dropdown > /tmp/varfromdropdown");


The file /tmp/varfromdropdown is still emty. (the dropdown field is NOT emty
by
the time i press the select button)

Any other ideas?



> From: Jay Blanchard [mailto:[EMAIL PROTECTED]]
>
>
> [snip]
> // Theme
> echo '
> 
>   ';
> for($i=0;$i {
> echo "".$theme_name[$i]."\n";
> }
>
> echo '   METHOD=POST>';
> // or:
> echo '   METHOD="POST">';
>
> $var_from_dropdown = $_POST['theme'];
> exec("echo $var_from_dropdown > /tmp/varfromdropdown");
>
> the exec line seems to works since it created the file. But
> it stays emty.
> [/snip]
>
> You need to place METHOD=POST in the original form tag and
> remove it from
> the submit tag. Try that
>
> HTH!
>
> Jay


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




[PHP] Re: formatting a filename

2002-09-05 Thread nicos

You shouldn't use str_replace as he said, but preg_replace() or
ereg_replace(), ereg are easier to use. take a look at
www.php.net/ereg_replace .

--

Nicos - CHAILLAN Nicolas
[EMAIL PROTECTED]
www.WorldAKT.com - Hébergement de sites Internet

"Javier Montserat" <[EMAIL PROTECTED]> a écrit dans le message de news:
[EMAIL PROTECTED]
> i want to format the filename of an uploaded file as follows :-
>
> -- replace blankspace with "_"
>
> -- remove any illegal characters.
>
> Which string functions should I use to do this?
>
> Thanks,
>
> Javier
>
>
>
> _
> Join the world's largest e-mail service with MSN Hotmail.
> http://www.hotmail.com
>



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




RE: [PHP] formatting a filename

2002-09-05 Thread Jay Blanchard

[snip]
i want to format the filename of an uploaded file as follows :-

-- replace blankspace with "_"

-- remove any illegal characters.

Which string functions should I use to do this?
[/snip]

http://www.php.net/manual/en/function.eregi-replace.php

HTH!

Jay




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




[PHP] RE: Jay-> [PHP] cURL,libPNG,libJPG download

2002-09-05 Thread Jay Blanchard

[snip]
Hey,
Thanks for your help dude,
even appreciate the sarcasm :-)
[/snip]

I am glad, as many others are, that you do appreciate the sarcasm. The crap
of that deal is that none of should have to be sarcastic. I am on the list
to help and be helped as the case calls for. And I was a newbie at some
point too, asked dumb questions, learned to STFW, RTFM, and STFA. But today
it just seems unconcienable to me that someone would not know to do
something (on a list this specific) like STFW or RTFM.

I do not desire to be regarded as a cranky cumrudgeon, that is why I put
something useful in with the other not-so-useful stuff. And to keep
bandwidth usage down, I snip.

Today is a day I should go home and go back to bed :^[

> HTH!
>
> Jay
>
> 
> * Ask smart questions: *
> * http://www.tuxedo.org/~esr/faqs/smart-questions.html *
> * Top Questions on php-general;*
> * (Answers can be found by RTFM, STFW, or STFA,*
> * save for #3 and #6 which can probably be found   *
> * the same way, since they are usually one of the  *
> * other questions on this list.)   *
> * 1. How can I make file uploads work? *
> * 2. How come my form will not pass variables? *
> * 3. HELP! HELP! Please HELP!  *
> * 4. Register_Globals ?!?  *
> * 5. Is there a function to ... [insert thought here]? *
> * 6. Anyone see the error in this code?*
> 



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




Re: [PHP] formatting a filename

2002-09-05 Thread Justin French

check out preg replace in the manual... particularly example 3 of this page:

http://www.php.net/manual/en/function.preg-replace.php

personally, i'd replace anything other than a-zA-z0-9 with _

Justin


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




Re: [PHP] formatting a filename

2002-09-05 Thread mhe

Here is a function that is used in the My_eGallery modules for PHP nuke.

function find_nom_dif($nom)
{
$nom=stripslashes($nom);
$nom=str_replace("'","",$nom);
$nom=str_replace("\"","",$nom);
$nom=str_replace("\"","",$nom);
$nom=str_replace("&","",$nom);
$nom=str_replace(",","",$nom);
$nom=str_replace(";","",$nom);
$nom=str_replace("/","",$nom);
$nom=str_replace("\\","",$nom);
$nom=str_replace("`","",$nom);
$nom=str_replace("<","",$nom);
$nom=str_replace(">","",$nom);
$nom=str_replace(" ","_",$nom);
$nom=str_replace(":","",$nom);
$nom=str_replace("*","",$nom);
$nom=str_replace("|","",$nom);
$nom=str_replace("?","",$nom);
$nom=str_replace("é","e",$nom);
$nom=str_replace("è","e",$nom);
$nom=str_replace("ç","c",$nom);
$nom=str_replace("@","",$nom);
$nom=str_replace("â","a",$nom);
$nom=str_replace("ê","e",$nom);
$nom=str_replace("î","i",$nom);
$nom=str_replace("ô","o",$nom);
$nom=str_replace("û","u",$nom);
$nom=str_replace("ù","u",$nom);
$nom=str_replace("à","a",$nom);
$nom=str_replace("!","",$nom);
$nom=str_replace("§","",$nom);
$nom=str_replace("+","",$nom);
$nom=str_replace("^","",$nom);
$nom=str_replace("(","",$nom);
$nom=str_replace(")","",$nom);
$nom=str_replace("#","",$nom);
$nom=str_replace("=","",$nom);
$nom=str_replace("$","",$nom);  
$nom=str_replace("%","",$nom);
$nom=str_replace("ä","ae",$nom);
$nom=str_replace("Ä","Ae",$nom);
$nom=str_replace("ö","oe",$nom);
$nom=str_replace("Ö","Oe",$nom);
$nom=str_replace("ü","ue",$nom);
$nom=str_replace("Ü","Ue",$nom);
$nom=str_replace("ß","ss",$nom);

return $nom;
 }

/Martin

Citat Javier Montserat <[EMAIL PROTECTED]>:

> i want to format the filename of an uploaded file as follows :-
> 
> -- replace blankspace with "_"
> 
> -- remove any illegal characters.
> 
> Which string functions should I use to do this?
> 
> Thanks,
> 
> Javier
> 
> 
> 
> _
> Join the world’s largest e-mail service with MSN Hotmail. 
> http://www.hotmail.com
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 



mvh

Martin Hjort Eriksen
Studenterrådet, Roskilde Universitetscenter

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




[PHP] Re: Sorting a text string

2002-09-05 Thread Alan Morey

$date = '04.09.2002';
$date = preg_replace('/(\d{2}).(\d{2}).(\d{4})/', '\\3.\\2.\\1', $date);
echo $date;

Output:
2002.09.04

Read up for more info.
http://www.php.net/manual/en/ref.pcre.php

regards
alan

Bård tommy nilsen wrote:
> I want to sort text strings, but how could i do this ?
> 
> Example:
> 
> 04.09.2002
> 05.09.2002
> 19.03.1999
> 
> 
> Is there a way to "change" the string to something like this ...
> 
> 2002.09.04
> 2002.09.05
> 1999.03.19
> 
> Or is there a better way to solve this ??
> 
> 
> Bård Tommy Nilsen


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




[PHP] formatting a filename

2002-09-05 Thread Javier Montserat

i want to format the filename of an uploaded file as follows :-

-- replace blankspace with "_"

-- remove any illegal characters.

Which string functions should I use to do this?

Thanks,

Javier



_
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com


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




[PHP] Jay-> [PHP] cURL,libPNG,libJPG download

2002-09-05 Thread Ryan A

Hey,
Thanks for your help dude,
even appreciate the sarcasm :-)
Cheers,
-Ryan.


- Original Message - 
From: "Jay Blanchard" <[EMAIL PROTECTED]>
To: "'Ryan A'" <[EMAIL PROTECTED]>; <:[EMAIL PROTECTED]>
Sent: Thursday, September 05, 2002 3:10 PM
Subject: RE: [PHP] cURL,libPNG,libJPG download


> [snip]
> RA>I want to add cURL,
> http://www.google.com/search?hl=en&lr=&ie=UTF-8&oe=UTF-8&q=cURL
> RA>libJPG
> http://www.google.com/search?hl=en&lr=&ie=UTF-8&oe=UTF-8&q=libJPG
> RA>and libPNG
> http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=libPNG
> 
> RA>what version?
> The latest one, of course.
> [/snip]
> 
> I refer you to;
> 
> http://www.ietf.org/rfc/rfc2795.txt?number=2795
> 
> I am having the thought of writing a similar IETF informational RFC about
> Google Searches and monkeys who cannot be bothered with same.
> 
> HTH!
> 
> Jay
> 
> 
> * Ask smart questions: *
> * http://www.tuxedo.org/~esr/faqs/smart-questions.html *
> * Top Questions on php-general;*
> * (Answers can be found by RTFM, STFW, or STFA,*
> * save for #3 and #6 which can probably be found   *
> * the same way, since they are usually one of the  *
> * other questions on this list.)   *
> * 1. How can I make file uploads work? *
> * 2. How come my form will not pass variables? *
> * 3. HELP! HELP! Please HELP!  *
> * 4. Register_Globals ?!?  *
> * 5. Is there a function to ... [insert thought here]? *
> * 6. Anyone see the error in this code?*
> 
> 
> 


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




Re: [PHP] PHP & MySQL & Apache on Linux vs. Solaris

2002-09-05 Thread Adam Williams

Go to www.mysql.com and make sure you are using the latest version of
MySQL.

Adam

On Thu, 5 Sep 2002, Boaz Yahav wrote:

> Hi
>
> Since i moved from a Sun / Solaris Machine to a Compaq / Linux machine
> I'm having weird problems with MySQL crashing while running reports written
> in php.
>
> The site is amazingly fast now on the Linux server but running a report
> that locks the main tables for about 20 seconds raises the load and crashes
> the server.
>
> While this makes some sense (maybe) i did not have this while i was on Solaris.
> Why would Solaris know how to hold the queries in the Queue till the tables are freed
> and Linux does not?
>
> Is this PHP, MySQL or maybe Linux to blame?
>
> thanks
>
> berber
>


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




RE: [PHP] cURL,libPNG,libJPG download

2002-09-05 Thread Jay Blanchard

[snip]
RA>I want to add cURL,
http://www.google.com/search?hl=en&lr=&ie=UTF-8&oe=UTF-8&q=cURL
RA>libJPG
http://www.google.com/search?hl=en&lr=&ie=UTF-8&oe=UTF-8&q=libJPG
RA>and libPNG
http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=libPNG

RA>what version?
The latest one, of course.
[/snip]

I refer you to;

http://www.ietf.org/rfc/rfc2795.txt?number=2795

I am having the thought of writing a similar IETF informational RFC about
Google Searches and monkeys who cannot be bothered with same.

HTH!

Jay


* Ask smart questions: *
* http://www.tuxedo.org/~esr/faqs/smart-questions.html *
* Top Questions on php-general;*
* (Answers can be found by RTFM, STFW, or STFA,*
* save for #3 and #6 which can probably be found   *
* the same way, since they are usually one of the  *
* other questions on this list.)   *
* 1. How can I make file uploads work? *
* 2. How come my form will not pass variables? *
* 3. HELP! HELP! Please HELP!  *
* 4. Register_Globals ?!?  *
* 5. Is there a function to ... [insert thought here]? *
* 6. Anyone see the error in this code?*




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




[PHP] cURL,libPNG,libJPG download

2002-09-05 Thread Ryan A

Hi,
guys,
Just a short question,
I want to add cURL,libJPG and libPNG for my site and my hostscan you tell me where 
you downloaded it if you used it and what version?
Thanks,
-Ryan.



  1   2   >