|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
php-general-digest-help_at_lists.php.net
Date: Thu Jan 23 2003 - 13:35:48 CST
php-general Digest 23 Jan 2003 19:35:48 -0000 Issue 1840
Topics (messages 132759 through 132887):
Re: chown()
132759 by: Urb LeJeune
query caching & caching in general
132760 by: Justin French
132761 by: Jean-Christian Imbeault
132763 by: Peter Janett
132764 by: Clarkson, Nick
Re: htpasswd
132762 by: Peter Janett
PHP and xemacs
132765 by: Hans Jacob Simonsen
132766 by: Faisal Abdullah
132772 by: Hans Jacob Simonsen
132790 by: Chris Hewitt
Uploading and storing large files
132767 by: peter a
132816 by: Marek Kilimajer
Disable pic copy/save?
132768 by: Anthony Rodriguez
132770 by: Jason Wong
132771 by: Clarkson, Nick
132775 by: af.ax-im.com
132776 by: Foong
132777 by: Martin Hudec
132779 by: Negrea Mihai
132784 by: MH
compiling php-4.3.0 error message : BrowserMatch regex could not be compiled.
132769 by: info.t-host.com
setcookie function
132773 by: Sukrit
Re: Regex pattern matching
132774 by: Nasko Vassilev
132792 by: af.ax-im.com
132804 by: Nasko Vassilev
132814 by: 1LT John W. Holmes
132848 by: Nasko Vassilev
File upload security
132778 by: Marco Alting
132781 by: peter a
Sessions & Security
132780 by: Clarkson, Nick
132842 by: Chris Shiflett
132845 by: Clarkson, Nick
PHP and Oracle
132782 by: Christophe Valentin
132818 by: Larry E. Ullman
get current username from the windows system
132783 by: Thomas Franz
132786 by: Justin French
132787 by: James Lobley
132793 by: 1LT John W. Holmes
Page doesn't load..
132785 by: Borut Kovacec
132805 by: Marek Kilimajer
132841 by: Marek Kilimajer
handling files error
132788 by: Gilberto Garcia Jr.
132806 by: Marek Kilimajer
132811 by: Gilberto Garcia Jr.
session domain
132789 by: Stain
132807 by: Marek Kilimajer
132812 by: Stain
nested queries/loops
132791 by: Justin French
132796 by: Tim Ward
132803 by: Marek Kilimajer
132815 by: Justin French
Re: PHP SOFTWARE ENGINEER (Cape Town, South Africa)
132794 by: Mark Henderson
Extending PHP
132795 by: MH
132844 by: J Smith
Re: textarea new line
132797 by: Neil M
132798 by: Neil M
132802 by: Ernest E Vogelsinger
132843 by: David T-G
Re: Removing the #!/usr... from cgi output?
132799 by: Neil M
132800 by: Neil M
Re: File upload problem
132801 by: Neil M
A rather strange problem.
132808 by: Denis L. Menezes
132809 by: Jon Haworth
132813 by: Marek Kilimajer
132861 by: Tom Rogers
Re: Reading Directory in reverse
132810 by: Marek Kilimajer
PHP Image Gallery
132817 by: 1LT John W. Holmes
132835 by: David T-G
Upload file
132819 by: Tyler Durdin
132820 by: 1LT John W. Holmes
132880 by: Jason Wong
Re: Custom Error pages in IIS
132821 by: Didier McGillis
textarea problem
132822 by: Denis L. Menezes
132823 by: Ernest E Vogelsinger
132825 by: Marek Kilimajer
Help!!!
132824 by: Brian McGarvie
132827 by: Brian McGarvie
chown() despiration
132826 by: Urb LeJeune
132863 by: Peter Clarke
132878 by: Jason Wong
Thanks Marek, Jon, Ernest
132828 by: Denis L. Menezes
Executing Shell Commands.
132829 by: scott
132832 by: Bryan Brannigan
132836 by: Chris Hewitt
132866 by: 1LT John W. Holmes
mysql_fetch_row problem
132830 by: Bryan Brannigan
132837 by: Matt Schroebel
132838 by: Rick Emery
Re: changing a key in an array
132831 by: David T-G
132850 by: Brent Baisley
132873 by: Jason k Larson
132879 by: David T-G
132881 by: David T-G
132885 by: David T-G
132886 by: Chris Boget
Mail Function Parameters
132833 by: Adam Voigt
132834 by: Petre Agenbag
Re: Solved [PHP] mysql_fetch_row problem
132839 by: Bryan Brannigan
looking for PHP, MYSQL & IMAGEMAGIK hosting
132840 by: Vahan Yerkanian
132846 by: David T-G
editing textfile
132847 by: Patrick
A way to detach the existing session data while making a new one???
132849 by: Scott Fletcher
132867 by: 1LT John W. Holmes
132868 by: Scott Fletcher
132870 by: Adam Voigt
132871 by: Scott Fletcher
Possible Bug in 4.3.0
132851 by: Bob Horton
Size of images (in bytes)
132852 by: Oliver Witt
132854 by: 1LT John W. Holmes
132856 by: Oliver Witt
132864 by: Marek Kilimajer
132865 by: Oliver Witt
132869 by: Leif K-Brooks
Cycle through multiple servers....
132853 by: Christopher Ditty
132874 by: Jason Wong
Word Count
132855 by: Craig
132857 by: Chris Boget
132858 by: Adam Voigt
132877 by: Steve Edberg
$_GET space in index changed to underscore
132859 by: Per
132860 by: Jon Haworth
132862 by: 1LT John W. Holmes
PHP vs. Perl/Mason
132872 by: Ray Hunter
Re: Why PHP doesn't work with Apache2?
132875 by: Tim Thorburn
Re: ? in URLS.
132876 by: Marek Kilimajer
Re: Browser language problem
132882 by: Marek Kilimajer
Re: Something difference betwen php-4.0.3 and php-4.2.3
132883 by: Marek Kilimajer
Re: total file size
132884 by: Jim Lucas
Re: Rather complex regular expression for the preg_match_all function
132887 by: Greg Beaver
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscribe
lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscribe
lists.php.net
To post to the list, e-mail:
php-general
lists.php.net
----------------------------------------------------------------------
attached mail follows:
>what does posix_getlogin() return? perhaps you aren't really running the
>script as root...
posix_getlogin() return a empty string. However, the script is
definitely
running as root. The same script is creating directories in another user's
account using mkdir()
If the script UID is changed from root to the local user, the
mkdir fail
with a permission error. The script is also doing a copy() into another user's
file system which also fails if the UID is not room. Everything works except
chown() and as I said in the original post, the same back ticked
`chown abc data`; that works in a perl script in the same directory does not
work in a PHP script. I have also tried
system("chown egovdemo:nobody /fullpath/htdocs");
Urb
attached mail follows:
anyone got any links to decent tutorials on sql caching, and caching in
general?
they don't have to be mysql/php specific, but that would of course help :)
general theory tutorials are fine too :)
Justin
attached mail follows:
Justin French wrote:
>
> anyone got any links to decent tutorials on sql caching, and caching in
> general?
A few questions:
At what level do you want the caching?
Are you talking about stored procedures?
Do you mean storing functions in the DB? (some DB's, like PostgreSQL can
compile functions once and reuse the compiled function).
Let me know where you want the caching to be and maybe I have a link or two.
Jc
attached mail follows:
Query caching is something that seems to exist in Cold Fusion, but not PHP.
What I'm referring to is that in Cold Fusion you can specify that query
results be cached in memory, and how long to cache those results. So, if
you have a page that runs the same query each time it's loaded, and you
cache a query on that page, then the results of that query are in memory, so
the call to the database is not run, instead the results from memory are
used, which can represent a HUGE speed increase.
To be totally repetitive, I'm not talking about a database cacheing results
of a query, but PHP caching the results of the query, instead of querying
the database.
I don't think it's possible to do anything like this in PHP, because of the
multiple database support, different function calls for different databases,
etc.
I've looked around, and found some PHP code that saves results sets in tmp
files, but I'm guessing that having the results cached in memory would be
faster than in files.
I think maybe the file caching was part of a database abstraction layer.
HTH,
Peter Janett
New Media One Web Services
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
New Upgrades Are Now Live!!!
Windows 2000 accounts - Cold Fusion 5.0 and Imail 7.1
Sun Solaris (UNIX) accounts - PHP 4.1.2, mod_perl/1.25,
Stronghold/3.0 (Apache/1.3.22), MySQL 3.23.43
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PostgreSQL coming soon!
http://www.newmediaone.net
webmaster
newmediaone.net
(303)828-9882
----- Original Message -----
From: "Jean-Christian Imbeault" <jc
mega-bucks.co.jp>
To: <php-general
lists.php.net>
Sent: Thursday, January 23, 2003 1:20 AM
Subject: [PHP] Re: query caching & caching in general
> Justin French wrote:
> >
> > anyone got any links to decent tutorials on sql caching, and caching in
> > general?
>
> A few questions:
>
> At what level do you want the caching?
> Are you talking about stored procedures?
> Do you mean storing functions in the DB? (some DB's, like PostgreSQL can
> compile functions once and reuse the compiled function).
>
> Let me know where you want the caching to be and maybe I have a link or
two.
>
> Jc
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
I found this on Zend - SQL Query Caching -
http://www.zend.com/zend/tut/tutorial-staub2.php;
"The basics to caching is using the serialize() and unserialize() PHP
functions......."
I don't know if this will help.
Nick
-----Original Message-----
From: Peter Janett [mailto:phplist
newmediaone.com]
Sent: 23 January 2003 08:41
To: php-general
lists.php.net
Subject: Re: [PHP] Re: query caching & caching in general
Query caching is something that seems to exist in Cold Fusion, but not PHP.
What I'm referring to is that in Cold Fusion you can specify that query
results be cached in memory, and how long to cache those results. So, if
you have a page that runs the same query each time it's loaded, and you
cache a query on that page, then the results of that query are in memory, so
the call to the database is not run, instead the results from memory are
used, which can represent a HUGE speed increase.
To be totally repetitive, I'm not talking about a database cacheing results
of a query, but PHP caching the results of the query, instead of querying
the database.
I don't think it's possible to do anything like this in PHP, because of the
multiple database support, different function calls for different databases,
etc.
I've looked around, and found some PHP code that saves results sets in tmp
files, but I'm guessing that having the results cached in memory would be
faster than in files.
I think maybe the file caching was part of a database abstraction layer.
HTH,
Peter Janett
New Media One Web Services
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
New Upgrades Are Now Live!!!
Windows 2000 accounts - Cold Fusion 5.0 and Imail 7.1
Sun Solaris (UNIX) accounts - PHP 4.1.2, mod_perl/1.25,
Stronghold/3.0 (Apache/1.3.22), MySQL 3.23.43
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PostgreSQL coming soon!
http://www.newmediaone.net
webmaster
newmediaone.net
(303)828-9882
----- Original Message -----
From: "Jean-Christian Imbeault" <jc
mega-bucks.co.jp>
To: <php-general
lists.php.net>
Sent: Thursday, January 23, 2003 1:20 AM
Subject: [PHP] Re: query caching & caching in general
> Justin French wrote:
> >
> > anyone got any links to decent tutorials on sql caching, and caching in
> > general?
>
> A few questions:
>
> At what level do you want the caching?
> Are you talking about stored procedures?
> Do you mean storing functions in the DB? (some DB's, like PostgreSQL can
> compile functions once and reuse the compiled function).
>
> Let me know where you want the caching to be and maybe I have a link or
two.
>
> Jc
>
>
> --
> 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.phpThis private and confidential e-mail has been sent to you by Egg. The Egg group of companies includes Egg Banking plc (registered no. 2999842), Egg Financial Products Ltd (registered no. 3319027) and Egg Investments Ltd (registered no. 3403963) which carries out investment business on behalf of Egg and is regulated by the Financial Services Authority. Registered in England and Wales. Registered offices: 1 Waterhouse Square, 138-142 Holborn, London EC1N 2NA. If you are not the intended recipient of this e-mail and have received it in error, please notify the sender by replying with 'received in error' as the subject and then delete it from your mailbox.
attached mail follows:
Don't run the htpasswd program at all, just write the .htpasswd file with PHP. The format is very simple, it's just username:crypted_password
So, you can just write those lines to the file, using the crypt function to create the crypted password.
Of course the same file permission issues exist that Evan pointed out (unless you're not in a shred environment, or are running PHP as cgi with Apache SuExe.), but those issues are for anything you do in PHP.
HTH,
Peter Janett
New Media One Web Services ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ New Upgrades Are Now Live!!! Windows 2000 accounts - Cold Fusion 5.0 and Imail 7.1 Sun Solaris (UNIX) accounts - PHP 4.1.2, mod_perl/1.25, Stronghold/3.0 (Apache/1.3.22), MySQL 3.23.43 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PostgreSQL coming soon!
http://www.newmediaone.net
webmaster
newmediaone.net
(303)828-9882
----- Original Message -----
From: "Evan Nemerson" <evan
coeus-group.com>
To: "Kris" <kreid2
bigpond.net.au>
Cc: <php-general
lists.php.net>
Sent: Thursday, January 23, 2003 12:37 AM
Subject: Re: [PHP] htpasswd
> Don't chmod .htpasswd- _huge_ security risk... Will your server allow you to > have suid scripts??? If so, you can just write a little wrapper and make it > suid. If you do that, I'd also reccomend using an extension other than PHP, > and/or placing it outside your web root. Wouldn't want people adding > themselves... > > I'd reccomend not using .htaccess at all, and just whip up a system using a > real database, wth the real work done in PHP. htaccess just isn't designed to > be dynamic. > > > > On Wednesday 22 January 2003 06:56 pm, Kris wrote: > > Hi > > > > I've built a secure site. After the user has chosen a valid username and > > password I want my script to run htpasswd on the .htpasswd file in the > > directory. The script can run htpasswd as it doesn't have permission. > > What is the safest way to do this? > > Should I chmod htpasswd or is there a better option for this whole thing?? > > > > Thanks > > > > Kris > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
Hi
I have just started using xemacs as editor to my php scripts I think that the indentation in emacs stinks! xemacs has imorted a php package for med, but it does not make indentation on my html codes. <table> <tr> <td> </td> </tr> </table>
i would prefer looking like: <table> <tr> <td> </td> and so fourth.
Is there a way I can do this automatically? Now I do it by pressing space a lot of times. I hope there is a package I can import. Maybe there is some shortcut I can press where I want my tabbing to be, something like:
<table> [press short-cut here] [here I only need to press TAB to get the right indent]
Are there other nice editors for Linux RedHat?
Please help me. I really need it.
Jacob
attached mail follows:
I use Kate. Love it for the following features:
1. Wonderful customizable syntax highlighting not only for PHP, but other languages/scripts as well.
2. Splittable screen
3. Line numbering
4. A handy terminal emulator
5. Indent tracking, and brace tracking
6. Remembers recently opened files. I'll know what I've been working on.
7. Configurable tab spaces (I use 4 spaces)
Faisal
On Thu, 2003-01-23 at 16:47, Hans Jacob Simonsen wrote: > Hi > > I have just started using xemacs as editor to my php scripts > I think that the indentation in emacs stinks! xemacs has imorted a php > package for med, but it does not make indentation on my html codes. > <table> > <tr> > <td> > </td> > </tr> > </table> > > i would prefer looking like: > <table> > <tr> > <td> > </td> > and so fourth. > > Is there a way I can do this automatically? Now I do it by pressing space > a lot of times. I hope there is a package I can import. Maybe there is > some shortcut I can press where I want my tabbing to be, something like: > > <table> > [press short-cut here] > [here I only need to press TAB to get the right indent] > > Are there other nice editors for Linux RedHat? > > Please help me. I really need it. > > Jacob > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Faisal Abdullah faisalmagnifix.com.my Systems Developer Magnifix Sdn. Bhd.
Tel : 603-4142 1775 Fax : 603-4142 1550
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ "Isn't it time you browse through a different window?"
______________________________________
attached mail follows:
On 23 Jan 2003, Faisal Abdullah wrote:
> I use Kate. Love it for the following features: > > 1. Wonderful customizable syntax highlighting not only for PHP, but > other languages/scripts as well. > > 2. Splittable screen > > 3. Line numbering > > 4. A handy terminal emulator > > 5. Indent tracking, and brace tracking > > 6. Remembers recently opened files. I'll know what I've been working on. > > 7. Configurable tab spaces (I use 4 spaces) > > > Faisal > > Sorry I forgot to tell you. I am using GNOME, and I'm on a company computer so I can't change to KDE.
Jacob
attached mail follows:
Hans Jacob Simonsen wrote:
>Sorry I forgot to tell you. I am using GNOME, and I'm on a company >computer so I can't change to KDE. > I'm using gnome and kate works by just typing its name at a shell prompt.
HTH Chris
attached mail follows:
Hi.
I am currently working on a projekt that will involve uploading files with filesizes up to about 10mb, and all sorts of different filetypes and I havet o Questsions concerning that.
1 ) How should the upload be done? I don't feel all that comfortable posting 10mb-files via a simple html-form, wouldn't that take a while if the connections is slow, and even if it was fast, it would take a minute or two. I was drawing out a upload functions with the built in ftp-functions, but then it occured to me, doesn't a <form> always posts it's content to the server anyway? How do I post large files without worrying about broken uploads, timeouts and all that?
2 ) How should I store the files? I suppose I have to optiones. Database ( I have mySQL installed ) or in folders ( in RedHat8.0 ) Should I build up a folder-structure to hold the files or just put it all in the database? A mySQL table in RedHat can hold 4gb, which is a lot, but my content may exceed that, how coud I check the size of the tables, and dynamically create new databases and when running a member Query, select content from them all? Would a file structure be better, with a folder strucuture for member a-b store in this folder c-d to in this and so on... Would it be stupid to store a 10000 10mb mpegs in one database?
Any suggestions?
/peter a
attached mail follows:
peter a wrote:
>Hi. > >I am currently working on a projekt that will involve uploading files with filesizes up to about 10mb, and all sorts of different filetypes and I havet o Questsions concerning that. > >1 ) How should the upload be done? I don't feel all that comfortable posting 10mb-files via a simple html-form, wouldn't that take a while if the connections is slow, and even if it was fast, it would take a minute or two. I was drawing out a upload functions with the built in ftp-functions, but then it occured to me, doesn't a <form> always posts it's content to the server anyway? How do I post large files without worrying about broken uploads, timeouts and all that? > Unless you want to give the users anonymous ftp write access (plain wrong), you have to go with post uploads. You don't need to worry about timeouts.
> >2 ) How should I store the files? I suppose I have to optiones. Database ( I have mySQL installed ) or in folders ( in RedHat8.0 ) Should I build up a folder-structure to hold the files or just put it all in the database? A mySQL table in RedHat can hold 4gb, which is a lot, but my content may exceed that, how coud I check the size of the tables, and dynamically create new databases and when running a member Query, select content from them all? >Would a file structure be better, with a folder strucuture for member a-b store in this folder c-d to in this and so on... Would it be stupid to store a 10000 10mb mpegs in one database? > For files this big and so many, you definately want to go with filesystem.
> >Any suggestions? > > > > /peter a > > > > > > >
attached mail follows:
Hi!
A client wants to test market two versions of an advertising but wants to disable the users' ability to copy/save the ads (right click, copy/save).
How can this be done in PHP?
Thanks!
Anthony F. Rodriguez
(afrodriguez
att.net)
attached mail follows:
On Thursday 23 January 2003 17:52, Anthony Rodriguez wrote: > Hi! > > A client wants to test market two versions of an advertising but wants to > disable the users' ability to copy/save the ads (right click, copy/save). > > How can this be done in PHP?
It can't be done, period. You need to get the data to the browser for it to be displayed. Once it's on the user's browser a determined user will be able to save whatever it is that's being displayed.
-- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development */* It is wrong always, everywhere and for everyone to believe anything upon insufficient evidence. - W. K. Clifford, British philosopher, circa 1876 */
attached mail follows:
This cannt be done in PHP. You would have to use something like Flash or Java - which is a lot of effort. The best you can do is disable right click using javascript, but that's easy to circumvent. Because everything's displayed client side, then a user could go into their Temporary Internet Files folder and find it in their anyway. Even using Flash or Java, if someone was determined to grab the individual images, then screenshots and an app to rebuild gifs would be easy to do. Unless of course they are full blown Flash ads, which would be harder to 'rip'. Why would a user want to save an advert anyway ? I don't believe I've ever saved an advert graphic - in fact I quite often resort to banner blocking, because some sites in particular go OTT on their use.
Nick
-----Original Message-----
From: Anthony Rodriguez [mailto:sbwi
bellatlantic.net]
Sent: 23 January 2003 09:52
To: php-general
lists.php.net
Subject: [PHP] Disable pic copy/save?
Hi!
A client wants to test market two versions of an advertising but wants to disable the users' ability to copy/save the ads (right click, copy/save).
How can this be done in PHP?
Thanks!
Anthony F. Rodriguez
(afrodriguez
att.net)
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.phpThis private and confidential e-mail has been sent to you by Egg. The Egg group of companies includes Egg Banking plc (registered no. 2999842), Egg Financial Products Ltd (registered no. 3319027) and Egg Investments Ltd (registered no. 3403963) which carries out investment business on behalf of Egg and is regulated by the Financial Services Authority. Registered in England and Wales. Registered offices: 1 Waterhouse Square, 138-142 Holborn, London EC1N 2NA. If you are not the intended recipient of this e-mail and have received it in error, please notify the sender by replying with 'received in error' as the subject and then delete it from your mailbox.
attached mail follows:
Not true -- you can use JavaScript to catch right-click events and do something creative with them, or disable them entirely.
But that, of course, is a client-side scripting issue, which has nothing to do with server-side languages such as PHP.
Cheers, Alex
> On Thursday 23 January 2003 17:52, Anthony Rodriguez wrote:
> > Hi! > > > > A client wants to test market two versions of an advertising but wants to > > disable the users' ability to copy/save the ads (right click, copy/save). > > > > How can this be done in PHP? > > It can't be done, period. You need to get the data to the browser for it to be > displayed. Once it's on the user's browser a determined user will be able to > save whatever it is that's being displayed. > > -- > Jason Wong -> Gremlins Associates -> www.gremlins.biz > Open Source Software Systems Integrators > * Web Design & Hosting * Internet & Intranet Applications Development * > > /* > It is wrong always, everywhere and for everyone to believe anything upon > insufficient evidence. > - W. K. Clifford, British philosopher, circa 1876 > */
attached mail follows:
try this article http://www.devarticles.com/art/1/265
However it is not perfect.
Foong
"Anthony Rodriguez" <sbwi
bellatlantic.net> wrote in message
news:5.1.1.6.0.20030123044654.03233c30
mailbox.bellatlantic.net...
> Hi!
>
> A client wants to test market two versions of an advertising but wants to
> disable the users' ability to copy/save the ads (right click, copy/save).
>
> How can this be done in PHP?
>
> Thanks!
>
> Anthony F. Rodriguez
> (afrodriguez
att.net)
>
>
>
attached mail follows:
Hmmmm it might be done by checking which mouse button is pressed using javascript :) but i think this works only in Iexplore ;)...i used such code on my webpage....it shows only copyright etc....anyway user does not need to rightclik and save if he knows where is his browser cache located.....
Martin
On Thursday 23 January 2003 10:57 am, Jason Wong wrote: > On Thursday 23 January 2003 17:52, Anthony Rodriguez wrote: > > Hi! > > > > A client wants to test market two versions of an advertising but wants to > > disable the users' ability to copy/save the ads (right click, copy/save). > > > > How can this be done in PHP? > > It can't be done, period. You need to get the data to the browser for it to > be displayed. Once it's on the user's browser a determined user will be > able to save whatever it is that's being displayed.
attached mail follows:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
There is no client side solution. The only one I see is serverside: to put a text on the image, a bit transparent so that it does not affect very much the image but it can't be used.
- -- Negrea Mihai http://www.negrea.net
On Thursday 23 January 2003 12:17, Martin Hudec wrote: > Hmmmm it might be done by checking which mouse button is pressed using > javascript :) but i think this works only in Iexplore ;)...i used such code > on my webpage....it shows only copyright etc....anyway user does not need > to rightclik and save if he knows where is his browser cache located..... > > Martin > > On Thursday 23 January 2003 10:57 am, Jason Wong wrote: > > On Thursday 23 January 2003 17:52, Anthony Rodriguez wrote: > > > Hi! > > > > > > A client wants to test market two versions of an advertising but wants > > > to disable the users' ability to copy/save the ads (right click, > > > copy/save). > > > > > > How can this be done in PHP? > > > > It can't be done, period. You need to get the data to the browser for it > > to be displayed. Once it's on the user's browser a determined user will > > be able to save whatever it is that's being displayed. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux)
iD8DBQE+L8M98hhhNOp8KlQRAgZ8AJsFU+rVYUep9IB/EDzG6XpSyyrsCwCgvE+Z S4pfbI10n0sqjf8buSZ3p9Y= =ADeG -----END PGP SIGNATURE-----
attached mail follows:
If someone wants your pic, he will take it, even if Alt+Print Screen is the last resort. The best way is to watermark it with text to make it unusable, but even with some patients this can be edited out if they want it badly enough.
Mh
"Jason Wong" <php-general
gremlins.biz> wrote in message
news:200301231757.27899.php-general
gremlins.biz...
> On Thursday 23 January 2003 17:52, Anthony Rodriguez wrote:
> > Hi!
> >
> > A client wants to test market two versions of an advertising but wants
to
> > disable the users' ability to copy/save the ads (right click,
copy/save).
> >
> > How can this be done in PHP?
>
> It can't be done, period. You need to get the data to the browser for it
to be
> displayed. Once it's on the user's browser a determined user will be able
to
> save whatever it is that's being displayed.
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
>
> /*
> It is wrong always, everywhere and for everyone to believe anything upon
> insufficient evidence.
> - W. K. Clifford, British philosopher, circa 1876
> */
>
attached mail follows:
Hello,
I compiled php-4.3.0 succesful --with-apxs="...path-to-apxs" after make and make install on a RedHat8.0 box.
I started my apache-1.3.27 and got the follwing error message: " Syntax error on line 956 of /usr/local/apache/conf/httpd.conf: BrowserMatch regex could not be compiled. "
Any hints? Any proposals? .... would be great
Oliver Etzel
attached mail follows:
Hi listers,
I have some webspace on a Unix server running apache. Things look like this there:
Path to dir with files - /home/username/public_html/ URL - www.somesite.net/~username
setcookie("id",$randval,time()+3600,"Q1","Q2",0);
What do I plug into Q1 and Q2? I want to set cookie for only my part of the site and not the whole site.
regards sukrit
attached mail follows:
I have an ASCII file which has multiple blocks of text I want to clear. The scheme is as follows:
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- line 1 Everything between the separators, line 2 including the separators line 3 I want to clear from the text file line 4 -----------------------------------------------------
This text I want to keep
There are infinite number of blocks surrounded by exactly the same separators. So, I guess I need to clear everything between the starting "=" and the ending "-".
Can anyone suggest a regex pattern string that would help me accomplish that?
Thank you all guys in advance!
Nasko
attached mail follows:
Hmmm... I was about to reply with a simple solution, but there's a problem with it that I can't explain. Assuming the text is in $str...
I can't get preg_replace to match a newline at the end of a pattern. If I use...
$str = preg_replace('/\n=.+--\n/sU', '', $str);
...it matches nothing, but if I put a tag character at the end of the dashes, e.g.
--------------------------------x
...then use... $str = preg_replace('/\n=.+--x/sU', '', $str);
...it works perfectly. I'm not sure why the pattern doesn't care about the first newline, but it chokes on the second one. Any thoughts?
Thanks, Alex
> I have an ASCII file which has multiple blocks of text I want to clear. The > scheme is as follows: > > =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- > line 1 Everything between the separators, > line 2 including the separators > line 3 I want to clear from the text file > line 4 > ----------------------------------------------------- > > This text I want to keep > > There are infinite number of blocks surrounded by exactly the same > separators. > So, I guess I need to clear everything between the starting "=" and the > ending "-". > > Can anyone suggest a regex pattern string that would help me accomplish > that? > > Thank you all guys in advance! > > Nasko
attached mail follows:
Hmm... i'm not that advanced... May be first I replace any string containing "---" with "---x", then use your solution?
<af
ax-im.com> wrote in message
news:r01050400-1023-F7D646F52EC711D78B79003065B83B6C
[208.37.41.173]...
> Hmmm... I was about to reply with a simple solution, but there's a problem
with it that I can't explain. Assuming the text is in $str...
>
> I can't get preg_replace to match a newline at the end of a pattern. If I
use...
>
> $str = preg_replace('/\n=.+--\n/sU', '', $str);
>
> ...it matches nothing, but if I put a tag character at the end of the
dashes, e.g.
>
> --------------------------------x
>
> ...then use...
>
> $str = preg_replace('/\n=.+--x/sU', '', $str);
>
> ...it works perfectly. I'm not sure why the pattern doesn't care about
the first newline, but it chokes on the second one. Any thoughts?
>
> Thanks,
> Alex
>
>
>
> > I have an ASCII file which has multiple blocks of text I want to clear.
The
> > scheme is as follows:
> >
> > =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> > line 1 Everything between the separators,
> > line 2 including the separators
> > line 3 I want to clear from the text file
> > line 4
> > -----------------------------------------------------
> >
> > This text I want to keep
> >
> > There are infinite number of blocks surrounded by exactly the same
> > separators.
> > So, I guess I need to clear everything between the starting "=" and the
> > ending "-".
> >
> > Can anyone suggest a regex pattern string that would help me accomplish
> > that?
> >
> > Thank you all guys in advance!
> >
> > Nasko
attached mail follows:
If the separators are always the same length, then you can use the following:
$new_str = preg_replace("/(=-){5}(.*)-{10}/sU","",$str);
Where 5 is how many times the =- pattern repeats, and 10 is how many times the - character repeats.
Hope that helps.
---John Holmes...
----- Original Message -----
From: <af
ax-im.com>
To: <php-general
lists.php.net>
Sent: Thursday, January 23, 2003 6:44 AM
Subject: Re: [PHP] HELP: Regex pattern matching
> Hmmm... I was about to reply with a simple solution, but there's a problem with it that I can't explain. Assuming the text is in $str... > > I can't get preg_replace to match a newline at the end of a pattern. If I use... > > $str = preg_replace('/\n=.+--\n/sU', '', $str); > > ...it matches nothing, but if I put a tag character at the end of the dashes, e.g. > > --------------------------------x > > ...then use... > > $str = preg_replace('/\n=.+--x/sU', '', $str); > > ...it works perfectly. I'm not sure why the pattern doesn't care about the first newline, but it chokes on the second one. Any thoughts? > > Thanks, > Alex > > > > > I have an ASCII file which has multiple blocks of text I want to clear. The > > scheme is as follows: > > > > =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- > > line 1 Everything between the separators, > > line 2 including the separators > > line 3 I want to clear from the text file > > line 4 > > ----------------------------------------------------- > > > > This text I want to keep > > > > There are infinite number of blocks surrounded by exactly the same > > separators. > > So, I guess I need to clear everything between the starting "=" and the > > ending "-". > > > > Can anyone suggest a regex pattern string that would help me accomplish > > that? > > > > Thank you all guys in advance! > > > > Nasko > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
Thanks indeed! This pattern worked just perfect.
Nasko
"1lt John W. Holmes" <holmes072000
charter.net> wrote in message
news:00e601c2c2e0$0c204720$a629089b
TBHHCCDR...
> If the separators are always the same length, then you can use the
> following:
>
> $new_str = preg_replace("/(=-){5}(.*)-{10}/sU","",$str);
>
> Where 5 is how many times the =- pattern repeats, and 10 is how many times
> the - character repeats.
>
> Hope that helps.
>
> ---John Holmes...
>
attached mail follows:
Hi, I have a php script which uploads file to a webserver. The idea is that anyone can upload files, but only another php script can read the files. At this moment I think someone is deleting file from my upload folder. What CHMOD settings do I need to secure this?
attached mail follows:
Files in web folders should usually be 755 /peter a
At 2003-01-23 11:15, Marco Alting wrote: >Hi, I have a php script which uploads file to a webserver. The idea is that >anyone can upload files, but only another php script can read the files. At >this moment I think someone is deleting file from my upload folder. What >CHMOD settings do I need to secure this? > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Hi,
I am trying to find the best method for implementing sessions in PHP to track/limit users. However, the more I read, the more I am concerned about security. Can anyone give me a definitive answer as to the best method of tracking users with security in mind ?
Thanks,
Nick
This private and confidential e-mail has been sent to you by Egg. The Egg group of companies includes Egg Banking plc (registered no. 2999842), Egg Financial Products Ltd (registered no. 3319027) and Egg Investments Ltd (registered no. 3403963) which carries out investment business on behalf of Egg and is regulated by the Financial Services Authority. Registered in England and Wales. Registered offices: 1 Waterhouse Square, 138-142 Holborn, London EC1N 2NA. If you are not the intended recipient of this e-mail and have received it in error, please notify the sender by replying with 'received in error' as the subject and then delete it from your mailbox.
attached mail follows:
--- "Clarkson, Nick" <Nick.Clarkson
egg.com> wrote:
> I am trying to find the best method for implementing
> sessions in PHP to track/limit users. However, the
> more I read, the more I am concerned about security.
> Can anyone give me a definitive answer as to the best
> method of tracking users with security in mind?
I have spoken on this topic several times in the past. Here are a few recent ones:
http://groups.google.com/groups?selm=20030115215804.74315.qmail%40web14307.mail.yahoo.com http://groups.google.com/groups?selm=20030102155526.52596.qmail%40web14302.mail.yahoo.com http://groups.google.com/groups?selm=3DC35A8C.6030208%40php.net http://groups.google.com/groups?selm=3DBC8190.9080007%40shiflett.org http://groups.google.com/groups?selm=3D7BBDD2.7090803%40php.net
Hopefully that will give you a good start.
Chris
attached mail follows:
Thanks - I've only just joined the list so must have missed your previous msgs. I'll give them a read later.
Thanks again.
Nick
-----Original Message-----
From: Chris Shiflett [mailto:shiflett
php.net]
Sent: 23 January 2003 15:28
To: Clarkson, Nick; php-general
lists.php.net
Subject: Re: [PHP] Sessions & Security
--- "Clarkson, Nick" <Nick.Clarkson
egg.com> wrote:
> I am trying to find the best method for implementing
> sessions in PHP to track/limit users. However, the
> more I read, the more I am concerned about security.
> Can anyone give me a definitive answer as to the best
> method of tracking users with security in mind?
I have spoken on this topic several times in the past. Here are a few recent ones:
http://groups.google.com/groups?selm=20030115215804.74315.qmail%40web14307.m ail.yahoo.com http://groups.google.com/groups?selm=20030102155526.52596.qmail%40web14302.m ail.yahoo.com http://groups.google.com/groups?selm=3DC35A8C.6030208%40php.net http://groups.google.com/groups?selm=3DBC8190.9080007%40shiflett.org http://groups.google.com/groups?selm=3D7BBDD2.7090803%40php.net
Hopefully that will give you a good start.
Chris
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.phpThis private and confidential e-mail has been sent to you by Egg. The Egg group of companies includes Egg Banking plc (registered no. 2999842), Egg Financial Products Ltd (registered no. 3319027) and Egg Investments Ltd (registered no. 3403963) which carries out investment business on behalf of Egg and is regulated by the Financial Services Authority. Registered in England and Wales. Registered offices: 1 Waterhouse Square, 138-142 Holborn, London EC1N 2NA. If you are not the intended recipient of this e-mail and have received it in error, please notify the sender by replying with 'received in error' as the subject and then delete it from your mailbox.
attached mail follows:
Hello,
Does someone had a speed trouble when using PHP and Oracle with OCI ?? The trouble i have is that the php pages are slower and slower during the day. It looks that if I make an apache restart things restart in a good way. I don't understand where the trouble come from.
Help !
Christophe
attached mail follows:
> Does someone had a speed trouble when using PHP and Oracle with OCI ?? > The trouble i have is that the php pages are slower and slower during > the > day. > It looks that if I make an apache restart things restart in a good way. > I don't understand where the trouble come from.
I've seen this once before and the cause was lots of phantom Oracle connections left open. So it wasn't PHP or Apache but connecting to the database which slowed things down. That may not be your problem but it's worth looking into...
Larry
attached mail follows:
Hi.
is their a possibilty to get the windows username of the current logged on user with php.
I want this to make a logon dialog more comfortable.
Thanks for an answer and a little example if it's possible.
Thomas
attached mail follows:
So, you want the server (PHP) to probe the client (user's) remote machine to find out the windows username?
Can't be done. First thing to remember is that PHP is server side. SOME LIMITED information is sent to the server by the browser, but I doubt this would ever be considered -- or even secure.
Second thing to remember is that not every user will be on a windows machine.
Some things can be achieved by client side scripts like javascript, but I honestly doubt you could do this, not would it be secure for the user.
Justin
on 23/01/03 9:43 PM, Thomas Franz (thomas.franz
esv-siershahn.de) wrote:
> Hi. > > is their a possibilty to get the windows username of the current logged on > user with php. > > I want this to make a logon dialog more comfortable. > > Thanks for an answer and a little example if it's possible. > > Thomas > > >
attached mail follows:
Hi Thomas,
The following code should help you... Note that you have to turn off anonymous access in IIS, so that the user authenticates to a domain.
<? $ip = getenv("REMOTE_ADDR"); echo("IP address is $ip<BR>");
$user_chunks = explode("\\",strtoupper(getenv("REMOTE_USER"))); $user_domain = $user_chunks[0]; $user_name = $user_chunks[1];
echo("User domain is $user_domain<BR>"); echo("User name is $user_name<BR>"); ?>
James
-----Original Message-----
From: Thomas Franz [mailto:thomas.franz
esv-siershahn.de]
Sent: 23 January 2003 10:44
To: php-general
lists.php.net
Subject: [PHP] get current username from the windows system
Hi.
is their a possibilty to get the windows username of the current logged on user with php.
I want this to make a logon dialog more comfortable.
Thanks for an answer and a little example if it's possible.
Thomas
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.phpThis email is only intended for the person(s) to whom it is addressed and may contain confidential information. Unless stated to the contrary, any opinions or comments are personal to the writer and do not represent the official view of the company. If you have received this e-mail in error, please notify us immediately by reply e-mail and then delete this message from your system. Please do not copy it or use if for any purposes, or disclose its contents to any other person.
We make every effort to keep our network free from viruses. You should independently check this e-mail and any attachments for viruses, as we can take no responsibility for any computer viruses that might be transferred by way of this e-mail.
attached mail follows:
$_SERVER['LOGON_USER'] also works.
---John Holmes...
----- Original Message -----
From: "James Lobley" <james
westcoast.co.uk>
To: "'Thomas Franz'" <thomas.franz
esv-siershahn.de>;
<php-general
lists.php.net>
Sent: Thursday, January 23, 2003 6:05 AM
Subject: RE: [PHP] get current username from the windows system
> Hi Thomas,
>
> The following code should help you...
> Note that you have to turn off anonymous access in IIS, so that the user
> authenticates to a domain.
>
> <?
> $ip = getenv("REMOTE_ADDR");
> echo("IP address is $ip<BR>");
>
> $user_chunks = explode("\\",strtoupper(getenv("REMOTE_USER")));
> $user_domain = $user_chunks[0];
> $user_name = $user_chunks[1];
>
> echo("User domain is $user_domain<BR>");
> echo("User name is $user_name<BR>");
> ?>
>
>
> James
>
>
> -----Original Message-----
> From: Thomas Franz [mailto:thomas.franz
esv-siershahn.de]
> Sent: 23 January 2003 10:44
> To: php-general
lists.php.net
> Subject: [PHP] get current username from the windows system
>
>
> Hi.
>
> is their a possibilty to get the windows username of the current logged on
> user with php.
>
> I want this to make a logon dialog more comfortable.
>
> Thanks for an answer and a little example if it's possible.
>
> Thomas
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
> This email is only intended for the person(s) to whom it is addressed and
> may contain confidential information. Unless stated to the contrary, any
> opinions or comments are personal to the writer and do not represent the
> official view of the company. If you have received this e-mail in error,
> please notify us immediately by reply e-mail and then delete this message
> from your system. Please do not copy it or use if for any purposes, or
> disclose its contents to any other person.
>
> We make every effort to keep our network free from viruses. You should
> independently check this e-mail and any attachments for viruses, as we
> can take no responsibility for any computer viruses that might be
> transferred by way of this e-mail.
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
Hello ..
I don't know if this is the right question for this mailing list .. but I'm having some problems with loading some php pages, localy on my computer (win XP, apache 1.3,Mysql) ..
The prioblem is that certain page doesnt load ... I get "The page doesn't exist" message .. but it's there... And then if I press refresh button couple of times, then sometimes it works .. but if I hit refresh aggain it doesn't work aggain...
Would anybody maybe have an idea of what could be wrong?
Thanx in advance B.
attached mail follows:
Do you get the message from apache? If so, check apache logs. If it is the exploder's default error page, turn user friendly messages off (in IE), or try another browser
Borut Kovacec wrote:
>Hello .. > >I don't know if this is the right question for this mailing list .. but I'm having some problems with loading some php pages, localy on my computer (win XP, apache 1.3,Mysql) .. > >The prioblem is that certain page doesnt load ... I get "The page doesn't exist" message .. but it's there... >And then if I press refresh button couple of times, then sometimes it works .. but if I hit refresh aggain it doesn't work aggain... > >Would anybody maybe have an idea of what could be wrong? > >Thanx in advance >B. > > >
attached mail follows:
Yes, it is strange. Something that might help you debug this out: - check server logs - turn off any output buffers - call flush() in your while loop - use another browser, IE is hiding stuff from users, but you are a developer, you need to know what is going on - check your loop if it is not endless - post some code
Borut Kovacec wrote:
>I get the default browser message .. "The page cannot be displayed" and I'm
>using IE6 .. But I figured out that if I put this line in comment:
>//while ($row = mysql_fetch_array($result)) ....
>
>which cycles through mysql result query .. and then outputs smo html tables
>and if I replace it with:
>
>for (int $i=0;i<5;$++)
>$row = mysql_fetch_array($result)
>
>then it works!? .. but if I change i<5 to i<20 or so .. it doesnt work
>anymore aggain .. so it's about how much data I get from databese or what?
>
>really strange...
>
>
>---- Original Message -----
>From: "Marek Kilimajer" <kilimajer
webglobe.sk>
>To: "Borut Kovacec" <borut
ra-gazela.si>
>Cc: "PHP Mailing List" <php-general
lists.php.net>
>Sent: Thursday, January 23, 2003 1:31 PM
>Subject: Re: [PHP] Page doesn't load..
>
>
>
>
>>Do you get the message from apache? If so, check apache logs. If it is
>>the exploder's default error page, turn user friendly messages off (in
>>IE), or try another browser
>>
>>Borut Kovacec wrote:
>>
>>
>>
>>>Hello ..
>>>
>>>I don't know if this is the right question for this mailing list .. but
>>>
>>>
>I'm having some problems with loading some php pages, localy on my computer
>(win XP, apache 1.3,Mysql) ..
>
>
>>>The prioblem is that certain page doesnt load ... I get "The page doesn't
>>>
>>>
>exist" message .. but it's there...
>
>
>>>And then if I press refresh button couple of times, then sometimes it
>>>
>>>
>works .. but if I hit refresh aggain it doesn't work aggain...
>
>
>>>Would anybody maybe have an idea of what could be wrong?
>>>
>>>Thanx in advance
>>>B.
>>>
>>>
>>>
>>>
>>>
>>--
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>>
>
>
>
attached mail follows:
Hey guys,
I have a red hat 7.3 server running apache and php4. It all seems working fine, but when I try to upload a file through a form I got nothing. I mean, I can ouput the temp name of the file, the final name, size and other stuff. but some functions don´t work.
Like
If (!is_executable($userfile_temp)) -> this don´t block executables files.
if I change to If (!is_executable($userfile_name)) -> it´s point me that all files is executable.
and when i try to move the file from /tmp directory to another directory with move_upload_file function. This func. doesn´t do anything, and doesn´t move the file to the specified directory
any help are welcome
[]´s Iced Sun
attached mail follows:
None of the uploaded files is executable, even if it is some .exe or shell script, simply it does not have the permission to execute. $userfile_name is only the name of the file as it was on the client's machine, there is no such file on your filesystem (unless you create it)
Gilberto Garcia Jr. wrote:
>Hey guys, > >I have a red hat 7.3 server running apache and php4. It all seems working fine, but when I try to upload a file through a form I got nothing. I mean, I can ouput the temp name of the file, the final name, size and other stuff. but some functions don´t work. > >Like > >If (!is_executable($userfile_temp)) -> this don´t block executables files. > >if I change to If (!is_executable($userfile_name)) -> it´s point me that all files is executable. > >and when i try to move the file from /tmp directory to another directory with move_upload_file function. This func. doesn´t do anything, and doesn´t move the file to the specified directory > >any help are welcome > >[]´s >Iced Sun > > >
attached mail follows:
Thanks, but just a little part of the problem was solved.
the other part is: why php doesn´t move the upload file to the specified
directory, with move_uploaded_file?
----- Original Message -----
From: "Marek Kilimajer" <kilimajer
webglobe.sk>
To: "Gilberto Garcia Jr." <garcia
ensino.net>
Cc: "PHP" <php-general
lists.php.net>
Sent: Thursday, January 23, 2003 10:36 AM
Subject: Re: [PHP] handling files error
> None of the uploaded files is executable, even if it is some .exe or > shell script, simply it does not have the permission to execute. > $userfile_name is only the name of the file as it was on the client's > machine, there is no such file on your filesystem (unless you create it) > > Gilberto Garcia Jr. wrote: > > >Hey guys, > > > >I have a red hat 7.3 server running apache and php4. It all seems working fine, but when I try to upload a file through a form I got nothing. I mean, I can ouput the temp name of the file, the final name, size and other stuff. but some functions don´t work. > > > >Like > > > >If (!is_executable($userfile_temp)) -> this don´t block executables files. > > > >if I change to If (!is_executable($userfile_name)) -> it´s point me that all files is executable. > > > >and when i try to move the file from /tmp directory to another directory with move_upload_file function. This func. doesn´t do anything, and doesn´t move the file to the specified directory > > > >any help are welcome > > > >[]´s > >Iced Sun > > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
attached mail follows:
i would use sessions in multiple hosts of my domain. say my domain is example.com, i'd use sessions in several hosts such as: www1.example.com www2.example.com www3.example.com
this could be easily configured in php.ini by putting: session.cookie_domain = example.com
but how can i do if i would EXCLUDE some hosts of my domain? someting like giving the exact list of hosts the cookie should be sent by user clients to the server: session.cookie_domain = www1.exclude.com,www2.example.com,www3.example.com (i tried, but it doesn't works!)
such thing is useful when you have some hosts in which you're sure you manage them, while some others you're not so sure. for istance, someone on an hosted site of the same domain could catch all sessions clients sent to his site and re-use those sessions faking someone other authentication...
some hints?
tell me if it's not clear...
bye, stain.
-- "If there is any, error is human"
attached mail follows:
It is cookie restriction, you can - set several cookies, but it won't work if user has third party cookies disabled (many have) - pass session id in url if the url is cross domain
Stain wrote:
>i would use sessions in multiple hosts of my domain. say my domain is >example.com, i'd use sessions in several hosts such as: >www1.example.com >www2.example.com >www3.example.com > >this could be easily configured in php.ini by putting: >session.cookie_domain = example.com > >but how can i do if i would EXCLUDE some hosts of my domain? someting like >giving the exact list of hosts the cookie should be sent by user clients to >the server: >session.cookie_domain = www1.exclude.com,www2.example.com,www3.example.com >(i tried, but it doesn't works!) > >such thing is useful when you have some hosts in which you're sure you manage >them, while some others you're not so sure. for istance, someone on an hosted >site of the same domain could catch all sessions clients sent to his site and >re-use those sessions faking someone other authentication... > >some hints? > >tell me if it's not clear... > >bye, stain. > > >
attached mail follows:
i thought this about cookies... but i would cookies to be sent by clients only on some hosts of the same domain, just this.
bye, stain.
Il 13:40, giovedì 23 gennaio 2003, Marek Kilimajer ha scritto: > It is cookie restriction, you can > - set several cookies, but it won't work if user has third party cookies > disabled (many have) > - pass session id in url if the url is cross domain > > Stain wrote: > >i would use sessions in multiple hosts of my domain. say my domain is > >example.com, i'd use sessions in several hosts such as: > >www1.example.com > >www2.example.com > >www3.example.com > > > >this could be easily configured in php.ini by putting: > >session.cookie_domain = example.com > > > >but how can i do if i would EXCLUDE some hosts of my domain? someting like > >giving the exact list of hosts the cookie should be sent by user clients > > to the server: > >session.cookie_domain = www1.exclude.com,www2.example.com,www3.example.com > >(i tried, but it doesn't works!) > > > >such thing is useful when you have some hosts in which you're sure you > > manage them, while some others you're not so sure. for istance, someone > > on an hosted site of the same domain could catch all sessions clients > > sent to his site and re-use those sessions faking someone other > > authentication... > > > >some hints? > > > >tell me if it's not clear... > > > >bye, stain.
-- "If there is any, error is human"
attached mail follows:
Hi all,
I'm aware that this post is borderline MySQL, but the solution may be more PHP-oriented, so I'm asking here first.
I have 4 related tables:
partner (id,name,url,desc) category (id,name) service (id,categoryid,name) pid_to_sid (pid,sid)
To point out the obvious, a partner provides one or more services, and a service belongs to a category.
However, the above table structure may not be the best solution, because I'm find that I need to perform MANY queries to get the information I need.
For example, to retrieve all 20 partners, with a list of the services they perform, broken into the 5 categories, requires heaps of queries:
while(partners loop of 20+ partners) { while(category loop of 5+ categories) { list services that match this cat and partner } }
Or, if I want to show tick boxes for all the services (broken by category) for a particular partner (say on an admin form):
while(category loop of 5) { while(all services loop of 30) { query DB to see if service is true for this partner } }
So, what I'm looking for is some missing snippet of code or information, or some little theory or tutorial that shows me the light on how I might reduce the number of queries, perform smarter, more complex queries, or something like that.
Otherwise, I can see myself writing some really sluggish code :)
Or perhaps my problem is back at the database level, with too many tables, or whatever.
Justin French
attached mail follows:
// pseudo code (mostly) if (mysql_query("SELECT * FROM partner, category, service WHERE partner.id = service.id AND service.categoryid = category.id")) { while ($array = mysql_fetcharray($result)) { $partners[$array["id"][]= $array; } }
// then do ... foreach($partners as $services) { ... foreach($services as $service) { ... } }
this may not be quite what you need but you get the general idea. looks like services as effectively a many to many link table, nothing wrong with that as far as I can see
Tim Ward
http://www.chessish.com
mailto:timward
chessish.com
----- Original Message -----
From: Justin French <justin
indent.com.au>
To: php <php-general
lists.php.net>
Sent: Thursday, January 23, 2003 11:26 AM
Subject: [PHP] nested queries/loops
> Hi all, > > I'm aware that this post is borderline MySQL, but the solution may be more > PHP-oriented, so I'm asking here first. > > I have 4 related tables: > > partner (id,name,url,desc) > category (id,name) > service (id,categoryid,name) > pid_to_sid (pid,sid) > > To point out the obvious, a partner provides one or more services, and a > service belongs to a category. > > However, the above table structure may not be the best solution, because I'm > find that I need to perform MANY queries to get the information I need. > > For example, to retrieve all 20 partners, with a list of the services they > perform, broken into the 5 categories, requires heaps of queries: > > while(partners loop of 20+ partners) > { > while(category loop of 5+ categories) > { > list services that match this cat and partner > } > } > > Or, if I want to show tick boxes for all the services (broken by category) > for a particular partner (say on an admin form): > > while(category loop of 5) > { > while(all services loop of 30) > { > query DB to see if service is true for this partner > } > } > > > So, what I'm looking for is some missing snippet of code or information, or > some little theory or tutorial that shows me the light on how I might reduce > the number of queries, perform smarter, more complex queries, or something > like that. > > Otherwise, I can see myself writing some really sluggish code :) > > > Or perhaps my problem is back at the database level, with too many tables, > or whatever. > > > Justin French > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
attached mail follows:
For me it seems it can be done with one mysql query: SELECT * FROM partner p LEFT JOIN pid_to_sid p2s ON p.id=p2s.pid LEFT JOIN service s ON p2s.sid=s.id LEFT JOIN category c ON s.categoryid=c.id WHERE $your_conditions ORDER BY p.name, c.name, s.name
The important part is ORDER BY clause, so when you retrieve the rows, by checking p.id and c.id to its previous ids, you find out you encountered next partner or category, respectively (if p.id has changed, c.id has changed too). LEFT JOINs are used so you get also partners not providing any service. You also use same column names in several tables, so instead of asterix use p.name AS partner_name and so on.
Hope this helps
Justin French wrote:
>Hi all, > >I'm aware that this post is borderline MySQL, but the solution may be more >PHP-oriented, so I'm asking here first. > >I have 4 related tables: > >partner (id,name,url,desc) >category (id,name) >service (id,categoryid,name) >pid_to_sid (pid,sid) > >To point out the obvious, a partner provides one or more services, and a >service belongs to a category. > >However, the above table structure may not be the best solution, because I'm >find that I need to perform MANY queries to get the information I need. > >For example, to retrieve all 20 partners, with a list of the services they >perform, broken into the 5 categories, requires heaps of queries: > >while(partners loop of 20+ partners) > { > while(category loop of 5+ categories) > { > list services that match this cat and partner > } > } > >Or, if I want to show tick boxes for all the services (broken by category) >for a particular partner (say on an admin form): > >while(category loop of 5) > { > while(all services loop of 30) > { > query DB to see if service is true for this partner > } > } > > >So, what I'm looking for is some missing snippet of code or information, or >some little theory or tutorial that shows me the light on how I might reduce >the number of queries, perform smarter, more complex queries, or something >like that. > >Otherwise, I can see myself writing some really sluggish code :) > > >Or perhaps my problem is back at the database level, with too many tables, >or whatever. > > >Justin French > > > >
attached mail follows:
Thanks Marek, That put me right on track :)
Justin
on 23/01/03 11:24 PM, Marek Kilimajer (kilimajer
webglobe.sk) wrote:
> SELECT * FROM partner p LEFT JOIN pid_to_sid p2s ON p.id=p2s.pid LEFT > JOIN service s ON p2s.sid=s.id LEFT JOIN category c ON s.categoryid=c.id > WHERE $your_conditions ORDER BY p.name, c.name, s.name
attached mail follows:
JOB: PHP SOFTWARE ENGINEER
DESCRIPTION Small, fast-paced, software company seeks PHP Software Engineer. Our Software Engineers are responsible for all aspects of technical development, including architecture, design, implementation, and performance tuning. They play a key role in helping the organization think through its processes and become more efficient. This is an ideal opportunity for someone interested in joining a small team, taking on significant responsibility, and seeing the impact of their work.
RESPONSIBILITIES * Work with business users during design process * Implement high-quality applications * Troubleshoot and stabilize existing code * Scalability planning
REQUIREMENTS This role requires at least 2-3 years experience building complex, data-driven web systems. The successful candidate will demonstrate: * Significant skill in PHP scripting language (a must!) * Proficiency in Object Oriented design and development * Proficiency with SQL and relational database design * Positive, can-do attitude * Ability to work directly with business users
PREFERRED * Proficiency in Ruby, Python or similar OO scripting languages * Working knowledge of Linux, Apache, and MySQL * BS in Computer Science or equivalent background in data structures and algorithms * Basic familiarity with networking and system administration
ABOUT KALUMA Kaluma Development (Pty) Ltd is an "Open Source" friendly software development firm based in Cape Town, South Africa.
Please send your resume to careers
kaluma.com. We encourage a
(very brief) cover letter citing an example of an interesting
and/or complex project you've undertaken.
Principals only. Recruiters, please don't contact us. Please email. No phone calls about this job.
attached mail follows:
I am looking for 3d party extensions of PHP like PHPTurbine. Anything will do, I am just curious whats available. Anyone know of any sites dedicated to PHP extensions that I can look at?
Thanks Mh
attached mail follows:
Look at PEAR's PECL project:
http://cvs.php.net/cvs.php/pear/PECL
J
Mh wrote:
> I am looking for 3d party extensions of PHP like PHPTurbine. Anything > will > do, I am just curious whats available. Anyone know of any sites dedicated > to PHP extensions that I can look at? > > Thanks > Mh
attached mail follows:
Adi wrote: > i want to add in textarea a string with new line tag in it. how to do that? > > my try: > $string="-line1n\ -line2 n\-line3"; > echo "<br><textarea name='aria' cols='50' rows='2'>$string</textarea>"; > > but i see a single line instead of: > -line1 > -line2 > -line3 > > tx in advance for any help >
Hello
For a new line in a text area you cant use html <br>'s
You need to use either \n OR \r\n
Thanks
Neil
attached mail follows:
Adi wrote: > i want to add in textarea a string with new line tag in it. how to do that? > > my try: > $string="-line1n\ -line2 n\-line3"; > echo "<br><textarea name='aria' cols='50' rows='2'>$string</textarea>"; > > but i see a single line instead of: > -line1 > -line2 > -line3 > > tx in advance for any help >
Hello
For a new line in a text area you cant use html <br>'s
You need to use either \n OR \r\n
Thanks
Neil
attached mail follows:
At 12:55 23.01.2003, Neil M said: --------------------[snip]-------------------- >Adi wrote: >> i want to add in textarea a string with new line tag in it. how to do that? >> >> my try: >> $string="-line1n\ -line2 n\-line3"; >> echo "<br><textarea name='aria' cols='50' rows='2'>$string</textarea>"; >> >> but i see a single line instead of: >> -line1 >> -line2 >> -line3 --------------------[snip]--------------------
Use nl2br(), something like:
echo '<textarea>', nl2br(htmlentities($string)), '</textarea>';
This should give you the results you need.
--
>O Ernest E. Vogelsinger
(\) ICQ #13394035
^ http://www.vogelsinger.at/
attached mail follows:
Adi, et al --
I somehow missed the original message. Odd...
...and then Neil M said... % % Adi wrote: % >i want to add in textarea a string with new line tag in it. how to do that? % > % >my try: % >$string="-line1n\ -line2 n\-line3"; % >echo "<br><textarea name='aria' cols='50' rows='2'>$string</textarea>";
Did you type this from memory or paste it in? You have n\ instead of the backslash before the n. I think that
$string="-line1\n-line2\n-line3" ;
would give you the line breaks you want.
HTH & HAND
:-D
-- David T-G * There is too much animal courage in (play) davidtgjustpickone.org * society and not sufficient moral courage. (work) davidtgwork
justpickone.org -- Mary Baker Eddy, "Science and Health" http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg!
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (FreeBSD)
iD8DBQE+MAr6Gb7uCXufRwARAsKfAJ9OYw7G9mlygQCr3jC528fxGFtaMwCfaNhj CsMp2H36gquDaJtB1dR7lkw= =J0uK -----END PGP SIGNATURE-----
attached mail follows:
Colin McDonald wrote: > Did you try it without that line at all? > > I'm pretty sure you can setup apache (you are using apache right?) to > use /usr/.../bin/php for all files with the extension .php > > colin > > David Brannlund wrote: > >> Example: >> >> #!/usr/local/bin/php >> <?php >> print "foo"; >> ?> >> >> becomes >> >> #!/usr/local/bin/php >> foo > >
Hi there
yes , the shebang ( the #!/usr/local/bin/php ) is not needed for use with dynamic webpages wether they be perl , php or whatever
Shebangs are used only with shell based scripts. Your webserver should be configured to know what to do with the file by extension, e.g. .php files should be processed by php in apache
This link describes how to configure a webserver to do this
http://www.php.net/manual/en/install.unix.php ( a unix server , but its nearly the same for windows )
Thanks
Neil
attached mail follows:
Colin McDonald wrote: > Did you try it without that line at all? > > I'm pretty sure you can setup apache (you are using apache right?) to > use /usr/.../bin/php for all files with the extension .php > > colin > > David Brannlund wrote: > >> Example: >> >> #!/usr/local/bin/php >> <?php >> print "foo"; >> ?> >> >> becomes >> >> #!/usr/local/bin/php >> foo > >
Hi there
yes , the shebang ( the #!/usr/local/bin/php ) is not needed for use with dynamic webpages wether they be perl , php or whatever
Shebangs are used only with shell based scripts. Your webserver should be configured to know what to do with the file by extension, e.g. .php files should be processed by php in apache
This link describes how to configure a webserver to do this
http://www.php.net/manual/en/install.unix.php ( a unix server , but its nearly the same for windows )
Thanks
Neil
attached mail follows:
John M wrote: > Hello, > > I have the code below. It's a simple file upload. But it doesn't work. > Before the line if(isset( $Submit )) is an echo which can I read. But after > choosing a file and press a submit nothing happens. Why is if(isset( > $Submit )) always false? Maybe my apache or php config is wrong? > > I use WinXp Prof, Apache 2.0.43, PHP 4.2.3, safe_mode is on , upload_tmp_dir > is "c:\tmp\" and upload_max_filesize is 2M in PHP config file. >
try a double \\ in windows paths
> Thanks! > > > <html> > <head> > <title>Untitled Document</title> > <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> > </head> > <body> > > <form name="form1" method="post" action="" enctype="multipart/form-data">
you will need to put a form action url in above line , like action="http://www.domain-name.com/script.php"
> <input type="file" name="imagefile"> > <input type="submit" name="Submit" value="Submit"> > > <? > echo "Before submit <br>\n"; > if(isset( $Submit )) > { > echo "After submit <br>\n"; > > if ($_FILES['imagefile']['type'] == "image/gif"){ > copy ($_FILES['imagefile']['tmp_name'], > "files/".$_FILES['imagefile']['name']) > or die ("Could not copy"); > echo "Name: ".$_FILES['imagefile']['name'].""; > } > else { > echo ""; > echo "Could Not Copy, Wrong Filetype > (".$_FILES['imagefile']['name'].")"; > } > } > ?> > </form> > > </body> > </html> > >
Thanks
Neil
attached mail follows:
hello friends,
I run some queries and output the database fields in a form with text boxes for the purpose of editing by the administrator. My problem is that if my field value is of 2 words or more, my output text box shows only the first work. e.g. if the field is "Jane Enterprises", the textbox shows only "jane". My code is below. Can someone please tell me what it is I am doing wrong?
Quote :
<?php
while($row=mysql_fetch_array($result)){ print " <form name=\"form1\" method=\"post\" action=\"update.php\">"; print " <input name=\"OrgName\" type=\"text\" id=\"OrgName\" size=\"30\" value=$row[OrgName]>"; print " </form>"; } ?>
Unquote
Thanks denis
attached mail follows:
Hi Denis,
> if the field is "Jane Enterprises", the textbox shows only "jane".
At the moment, if you view the HTML, you'll see:
<input value=Jane Enterprises>
Your browser sees this as an input with a value of "jane" and an attribute called "enterprises", which it doesn't recognise (and therefore ignores completely).
What you need to do is stick quotes round this, so it'll become:
<input value="Jane Enterprises">
HTH Jon
attached mail follows:
And also use htmlspecialchars()
print ' <input name="OrgName" type="text" id="OrgName" size="30" value="'.htmlspecialchars($row['OrgName']).'">';
Jon Haworth wrote:
>Hi Denis, > > > >>if the field is "Jane Enterprises", the textbox shows only "jane". >> >> > >At the moment, if you view the HTML, you'll see: > > <input value=Jane Enterprises> > >Your browser sees this as an input with a value of "jane" and an attribute >called "enterprises", which it doesn't recognise (and therefore ignores >completely). > >What you need to do is stick quotes round this, so it'll become: > > <input value="Jane Enterprises"> > > >HTH >Jon > > > >
attached mail follows:
Hi,
Thursday, January 23, 2003, 10:47:56 PM, you wrote: DLM> hello friends,
DLM> I run some queries and output the database fields in a form with text boxes for the purpose of editing by the administrator. My problem is that if my field value is of 2 words or more, my output DLM> text box shows only the first work. e.g. if the field is "Jane Enterprises", the textbox shows only "jane". My code is below. Can someone please tell me what it is I am doing wrong?
DLM> Quote :
DLM> <?php
DLM> while($row=mysql_fetch_array($result)){ DLM> print " <form name=\"form1\" method=\"post\" action=\"update.php\">"; DLM> print " <input name=\"OrgName\" type=\"text\" id=\"OrgName\" size=\"30\" value=$row[OrgName]>"; DLM> print " </form>"; DLM> } DLM> ?>
DLM> Unquote
DLM> Thanks DLM> denis
put the value in quotes
value=\"$row[OrgName]\">
-- regards, Tom
attached mail follows:
It does not read it in reverse alphabetical order, but in the order it is listed on the filesystem, which happens to be in reverse alphabetical order. If you need it ordered, use
$files=array(); if (!($dp = opendir($default_dir))) die("cannot open $default_dir"); while($file = readdir($dp)) if($file != '.' && $file != '..') $files[]=$file; closedir($dp);
sort($files); foreach($files as $file) { echo"<a href='opendir.php?opendir=$file'>$file</a><BR>"; }
Bob Irwin wrote:
>Hi Guys, > >Does anyone happen to know why the below code reads the directory in reverse >alphabetical order? Not a major problem - easy enough to whack it in an >array and sort it, but annoying nonetheless. > > >$default_dir = "../screenshots"; > >if (!($dp = opendir($default_dir))) die("cannot open $default_dir"); >while($file = readdir($dp)) > if($file != '.' && $file != '..') echo"<a >href='opendir.php?opendir=$file'>$file</a><BR>"; >closedir($dp); > >Best Regards >Bob Irwin >Server Admin & Web Programmer >Planet Netcom > > > >
attached mail follows:
I know there are a ton of these out there and I've used a few of them, but I'm looking for a specific feature, of course. :)
Does anyone know of a Gallery system where I can, once it's installed, just drop a folder full of images into the "gallery_root" and the program automatically makes it into a new "gallery" on the web site. In other words, I don't want to go through and Browse... for each and every file.
Any advice is greatly appreciated. Again, I already know what gallery program you use (I'm psychic ;) and I agree with you that it's the best program out there, but does it have the above feature?
---John Holmes...
attached mail follows:
John --
...and then 1LT John W. Holmes said... % % I know there are a ton of these out there and I've used a few of them, but % I'm looking for a specific feature, of course. :)
Of course!
% % Does anyone know of a Gallery system where I can, once it's installed, just
Yep.
% drop a folder full of images into the "gallery_root" and the program
We typically mkdir and put via ftp, but a browser interface isn't by any means impossible. You throw your pix on the server in any dir layout you want and then browse to the page and, voila!, the 'nails are made and the pages laid out and you can add comments and whatnot.
Care for a demo account to try it out? :-)
% automatically makes it into a new "gallery" on the web site. In other words, % I don't want to go through and Browse... for each and every file.
Fair enough.
% % Any advice is greatly appreciated. Again, I already know what gallery % program you use (I'm psychic ;) and I agree with you that it's the best % program out there, but does it have the above feature?
It sure does :-)
% % ---John Holmes...
HTH & HAND
:-D
-- David T-G * There is too much animal courage in (play) davidtgjustpickone.org * society and not sufficient moral courage. (work) davidtgwork
justpickone.org -- Mary Baker Eddy, "Science and Health" http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg!
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (FreeBSD)
iD8DBQE+L/reGb7uCXufRwARAt/9AJ4s8JtwOIoJETgm9alZG+ti1w8HPACeNO2x fRlf+KiKmVnn378azxc5LPk= =nfdk -----END PGP SIGNATURE-----
attached mail follows:
I am using PHP 4.2.1 and have noticed that I can only upload files with a php script when I have the php.ini file set with register globals on. Is there a way to use the file upload scripts without having to turn the register globals on? How about newer versions of PHP?
_________________________________________________________________ The new MSN 8: advanced junk mail protection and 2 months FREE* http://join.msn.com/?page=features/junkmail
attached mail follows:
> I am using PHP 4.2.1 and have noticed that I can only upload files with a > php script when I have the php.ini file set with register globals on. Is > there a way to use the file upload scripts without having to turn the > register globals on? How about newer versions of PHP?
Yes, you'll use the $_FILES array to get to the uploaded file data.
---John Holmes...
attached mail follows:
On Thursday 23 January 2003 21:20, Tyler Durdin wrote: > I am using PHP 4.2.1 and have noticed that I can only upload files with a > php script when I have the php.ini file set with register globals on. Is > there a way to use the file upload scripts without having to turn the > register globals on? How about newer versions of PHP?
Whether or not you can upload files is determined by the setting of 'file_uploads'. 'register_globals' has nothing to do with it.
-- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development */* Si jeunesse savait, si vieillesse pouvait. [If youth but knew, if old age but could.] -- Henri Estienne */
attached mail follows:
Yes I always do that when I go there. Sorry ..
>From: "John W. Holmes" <holmes072000
charter.net>
>Reply-To: <holmes072000
charter.net>
>To: <php-general
lists.php.net>
>Subject: RE: [PHP] Custom Error pages in IIS
>Date: Wed, 22 Jan 2003 19:28:03 -0500
>
>No biggie, but you forgot an 's' on the address:
>
>http://www.iis-resources.com, in case anyone was having trouble getting
>there.
>
>Thank you for the link, though.
>
>---John W. Holmes...
>
>PHP Architect - A monthly magazine for PHP Professionals. Get your copy
>today. http://www.phparch.com/
>
> > -----Original Message-----
> > From: Didier McGillis [mailto:codesmoker
hotmail.com]
> > Sent: Wednesday, January 22, 2003 4:42 PM
> > To: holmes072000
charter.net; php-general
lists.php.net
> > Subject: Re: [PHP] Custom Error pages in IIS
> >
> > Have you tried http://www.iis-resource.com, they have some good
>resources.
> >
> >
> >
> >
> >
> >
> > >From: "1LT John W. Holmes" <holmes072000
charter.net>
> > >Reply-To: "1LT John W. Holmes" <holmes072000
charter.net>
> > >To: <php-general
lists.php.net>
> > >Subject: [PHP] Custom Error pages in IIS
> > >Date: Wed, 22 Jan 2003 15:08:58 -0500
> > >
> > >Is anyone using PHP to create custom error pages in IIS. I want to
>modify
> > >the 403 error page to do a redirect to HTTPS if it was requested with
> > HTTP.
> > >I had someone try it, but they said it didn't work. I'm at work now
>and
> > >don't have a box to try it on until I get home. Does anyone have this
> > >working out there, so I know whether or not to spend my time on it??
>Any
> > >pointers? Thanks for any info.
> > >
> > >---John Holmes...
> > >
> > >
> > >--
> > >PHP General Mailing List (http://www.php.net/)
> > >To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> > _________________________________________________________________
> > Add photos to your e-mail with MSN 8. Get 2 months FREE*.
> > http://join.msn.com/?page=features/featuredemail
> >
> >
> > --
> > 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
_________________________________________________________________ MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. http://join.msn.com/?page=features/virus
attached mail follows:
Thanks Marek.
Could you help me with this piece of code?
<?php Print '<textarea name="OrgAddress" cols="44" rows="5" id="textarea" value="'.htmlspecialchars($row['OrgName']).'"></textarea>'; ?>
Thanks denis
attached mail follows:
At 14:34 23.01.2003, Denis L. Menezes said: --------------------[snip]-------------------- ><?php > Print '<textarea name="OrgAddress" cols="44" rows="5" id="textarea" >value="'.htmlspecialchars($row['OrgName']).'"></textarea>'; > ?> --------------------[snip]--------------------
This won't work. <textarea> needs its value outside the tag, without an attribute, just plain:
Print '<textarea name="OrgAddress" cols="44" rows="5" id="textarea">', htmlspecialchars($row['OrgName']), '</textarea>';
--
>O Ernest E. Vogelsinger
(\) ICQ #13394035
^ http://www.vogelsinger.at/
attached mail follows:
Yes - textarea does not have value attribute, put the value between <textarea ... > and </textarea>
Print '<textarea name="OrgAddress" cols="44" rows="5" id="textarea">'.htmlspecialchars($row['OrgName']).'</textarea>';
Denis L. Menezes wrote:
>Thanks Marek. > >Could you help me with this piece of code? > ><?php > Print '<textarea name="OrgAddress" cols="44" rows="5" id="textarea" >value="'.htmlspecialchars($row['OrgName']).'"></textarea>'; > ?> > >Thanks >denis > > >
attached mail follows:
I have just got use of a new dedicated webserver...
Now the 1st time a piece of code is ran it doesnt work but then the 2nd it does...
i.e.
index.php
// stuff... $visitDBID = referrerVisit($rid,$rgid,$visitIP,$visitFromURL); // stuff...
//end index.php
function referrerVisit($rid,$rgid,$visitIP,$visitFromURL) { $db = dbConnect(); $sql = " insert into referral (RID, RGID, VisitorIP, VisitorDate, VisitorFromURL) values($rid,$rgid,'$visitIP',NOW(),'$visitFromURL') "; echo $sql; $result=mysql_query($sql); if(mysql_error()) { echo "inserted not"; $errormessage = ""; $errormessage .= "SQL: $sql<br>"; $errormessage .= "Error Code: ".mysql_errno().": ".mysql_error(); echo " Sorry, an error has occured. It has been recorded and reported to the Website Administrator.<br><br> Error:<br> $errormessage "; return null; } else { echo "inserted"; return mysql_insert_id($db); } }
When it's ran initilly: the sql that i generated looks like:
insert into referral (RID, RGID, VisitorIP, VisitorDate, VisitorFromURL) values( insert into referral (RID, RGID, VisitorIP, VisitorDate, VisitorFromURL) values(Resource id #4,Resource id #4,'Resource id #4',NOW(),'Resource id #4') , insert into referral (RID, RGID, VisitorIP, VisitorDate, VisitorFromURL) values(Resource id #4,Resource id #4,'Resource id #4',NOW(),'Resource id #4') ,'
and gives the error:
Error: SQL: Error Code: 1065: Query was empty
However if i refresh the page: it executes correctly...
Any ideas?
--- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.438 / Virus Database: 246 - Release Date: 07/01/03
attached mail follows:
ok i think i see the problem but how do i fix?
Before call to procedure:
VARS: 1,1,213.123.253.117,
inside procedure: VARS: ,,,
Causing: connectin: insert into referral (RID, RGID, VisitorIP, VisitorDate, VisitorFromURL) values(Resource id #4,Resource id #4,'Resource id #4',NOW(),'Resource id #4') inserted not Sorry, an error has occured. It has been recorded and reported to the Website Administrator.
Error: SQL: Error Code: 1065: Query was empty
"Brian McGarvie" <brian.mcgarvie
anypurposeloans.co.uk> wrote in message
news:20030123134546.15347.qmail
pb1.pair.com...
> I have just got use of a new dedicated webserver...
>
> Now the 1st time a piece of code is ran it doesnt work but then the 2nd it
> does...
>
> i.e.
>
> index.php
>
> // stuff...
> $visitDBID = referrerVisit($rid,$rgid,$visitIP,$visitFromURL);
> // stuff...
>
> //end index.php
>
> function referrerVisit($rid,$rgid,$visitIP,$visitFromURL) {
> $db = dbConnect();
> $sql = "
> insert into referral
> (RID, RGID, VisitorIP, VisitorDate, VisitorFromURL)
> values($rid,$rgid,'$visitIP',NOW(),'$visitFromURL')
> ";
> echo $sql;
> $result=mysql_query($sql);
> if(mysql_error()) {
> echo "inserted not";
> $errormessage = "";
> $errormessage .= "SQL: $sql<br>";
> $errormessage .= "Error Code: ".mysql_errno().": ".mysql_error();
> echo "
> Sorry, an error has occured. It has been recorded and reported
> to the Website Administrator.<br><br>
> Error:<br>
> $errormessage
> ";
> return null;
> } else {
> echo "inserted";
> return mysql_insert_id($db);
> }
> }
>
> When it's ran initilly: the sql that i generated looks like:
>
> insert into referral (RID, RGID, VisitorIP, VisitorDate, VisitorFromURL)
> values( insert into referral (RID, RGID, VisitorIP, VisitorDate,
> VisitorFromURL) values(Resource id #4,Resource id #4,'Resource id
> #4',NOW(),'Resource id #4') , insert into referral (RID, RGID, VisitorIP,
> VisitorDate, VisitorFromURL) values(Resource id #4,Resource id
#4,'Resource
> id #4',NOW(),'Resource id #4') ,'
>
> and gives the error:
>
> Error:
> SQL:
> Error Code: 1065: Query was empty
>
> However if i refresh the page: it executes correctly...
>
> Any ideas?
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.438 / Virus Database: 246 - Release Date: 07/01/03
>
>
--- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.438 / Virus Database: 246 - Release Date: 07/01/03
attached mail follows:
I could do this in perl but I'm being stubborn :-)
When I run the following code as a regular user, everything fails. When I run it as root the directory is created and the chmod works. However, chown reports:
chown failed: Operation not permitted
Here is the code.
$Directory2Create = "/home/e-govdemo/htdocs"; mkdir($Directory2Create,0777); chown($Directory2Create,"egovdemo"); chmod($Directory2Create,0777);
"egovdemo" is a legal user name as can be seen from this partial directory listin.
egovdemo nobody 4096 Sep 6 11:29 Logs
also tried chown($Directory2Create,"egovdemo:nobody"); chown($Directory2Create,"637"); chown($Directory2Create,"637:99");
To help save my few reamining hairs and could someone with root privilege try it and see if it's me or PHP?
Thanks
Urb
attached mail follows:
Urb Lejeune wrote: > I could do this in perl but I'm being stubborn :-) > > When I run the following code as a regular user, everything fails. > When I run it as root the directory is created and the chmod > works. However, chown reports: > > chown failed: Operation not permitted > > Here is the code. > > $Directory2Create = "/home/e-govdemo/htdocs"; > mkdir($Directory2Create,0777); > chown($Directory2Create,"egovdemo"); > chmod($Directory2Create,0777); > > "egovdemo" is a legal user name as can be seen from this partial > directory listin. > > egovdemo nobody 4096 Sep 6 11:29 Logs > > also tried > chown($Directory2Create,"egovdemo:nobody"); > chown($Directory2Create,"637"); > chown($Directory2Create,"637:99"); > > To help save my few reamining hairs and could someone with > root privilege try it and see if it's me or PHP? > > Thanks > > Urb > >
It works fine with PHP 4.2.2 from the command line run as root on my Linux system (using a user on my system) produced:
drwxrwxrwx 2 leagas root 4096 Jan 23 16:43 test
Peter
attached mail follows:
On Thursday 23 January 2003 21:49, Urb LeJeune wrote: > I could do this in perl but I'm being stubborn :-) > > When I run the following code as a regular user, everything fails. > When I run it as root the directory is created and the chmod > works. However, chown reports:
[snip]
> To help save my few reamining hairs and could someone with > root privilege try it and see if it's me or PHP?
Running following as root using 4.3.0 CLI:
<?php
$Directory2Create = "/tmp/htdocs"; mkdir($Directory2Create,0777); chown($Directory2Create,"jason"); chmod($Directory2Create,0777);
?>
#ls -al /tmp
drwxrwxrwx 2 jason root 4096 Jan 24 02:15 htdocs
> also tried > chown($Directory2Create,"egovdemo:nobody");
chown() can only change user, use chgrp() to change the group!
> chown($Directory2Create,"637");
Try it without quotes. It works for me.
> chown($Directory2Create,"637:99");
See comment above.
-- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development */* Age and treachery will always overcome youth and skill. */
attached mail follows:
Thanks Marek, Jon, Ernest.
Denis
attached mail follows:
Hello,
Does anybody know how to execute a shell command from PHP on a Linux system?
Thanks, Scott
attached mail follows:
I believe something like this would do it:
system('ls -l');
> -----Original Message-----
> From: scott [mailto:ScottLinux
mn.rr.com]
> Sent: Thursday, January 23, 2003 9:06 AM
> To: php-general
lists.php.net
> Subject: [PHP] Executing Shell Commands.
>
>
> Hello,
>
> Does anybody know how to execute a shell command from PHP on a Linux
> system?
>
> Thanks,
> Scott
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
scott wrote:
>Hello, > >Does anybody know how to execute a shell command from PHP on a Linux >system? > exec() and friends.
HTH Chris
attached mail follows:
> Does anybody know how to execute a shell command from PHP on a Linux > system?
Yes.
---John Holmes...
PS: http://homepages.tesco.net/~J.deBoynePollard/FGA/questions-with-yes-or-n o-answers.html
PSS: http://www.php.net/manual/en/ref.exec.php
attached mail follows:
Can someone tell me what I'm doing wrong with the following code. What I am trying to do with this is insert some data from a form into a database. Then I am querying another database to retrieve the email addresses related to $location. This is the error I get:
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in D:\inetpub\webroot\usrmgr\upd.php on line 15
This is the problematic code:
$db = mysql_connect("localhost", "webapp"); mysql_select_db("usermgr",$db); $sql = "INSERT INTO usernames (name,location,position,email,home,citrix,timberline,sawmill,counter,insides upport,am,receiving,shipping,purchasing,management,approval,uniqueid) VALUES ('$Name','$Location','$Position','$Emailaccess','$workathome','$citrix','$ti mberline','$sawmill','$countersales','$insidesales','$accountmanager','$rece iving','$shipping','$purchasing','$management','Waiting','$uniqueid')"; $result = mysql_query($sql); mysql_close($db);
$db = mysql_connect("localhost", "webapp"); mysql_select_db("helpdesk",$db); $result = mysql_query("SELECT contactemail FROM loc WHERE location=$Location",$db); while($row = mysql_fetch_row($result)){ $contactemail = $row[0]; }
Thanks in advance, Bryan
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"90% of being smart is knowing what you're dumb at."
Bryan Brannigan
Hancock Lumber
System Administrator
Information Technology
(v)207.627.7694
(f)207.627.7041
bbrannigan
hancocklumber.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
attached mail follows:
> -----Original Message-----
> From: Bryan Brannigan [mailto:bbrannigan
HancockLumber.com]
> Sent: Thursday, January 23, 2003 9:03 AM
> Subject: [PHP] mysql_fetch_row problem
> $db = mysql_connect("localhost", "webapp"); > mysql_select_db("helpdesk",$db); > $result = mysql_query("SELECT contactemail FROM loc WHERE ...
Try putting the sql into a var, using that in the mysql_query, and adding:
if (!$result) { echo "Sql was: $sql<br>\n"; echo mysql_error(); }
attached mail follows:
I'm gong to bet that $Location is alpha, not numeric. Therefore:
$result = mysql_query("SELECT contactemail FROM loc WHERE location=\"$Location\"",$db);
----- Original Message -----
From: "Bryan Brannigan" <bbrannigan
HancockLumber.com>
To: "Php List (E-mail)" <php-general
lists.php.net>
Sent: Thursday, January 23, 2003 8:03 AM
Subject: [PHP] mysql_fetch_row problem
Can someone tell me what I'm doing wrong with the following code. What I am trying to do with this is insert some data from a form into a database. Then I am querying another database to retrieve the email addresses related to $location. This is the error I get:
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in D:\inetpub\webroot\usrmgr\upd.php on line 15
This is the problematic code:
$db = mysql_connect("localhost", "webapp"); mysql_select_db("usermgr",$db); $sql = "INSERT INTO usernames (name,location,position,email,home,citrix,timberline,sawmill,counter,insides upport,am,receiving,shipping,purchasing,management,approval,uniqueid) VALUES ('$Name','$Location','$Position','$Emailaccess','$workathome','$citrix','$ti mberline','$sawmill','$countersales','$insidesales','$accountmanager','$rece iving','$shipping','$purchasing','$management','Waiting','$uniqueid')"; $result = mysql_query($sql); mysql_close($db);
$db = mysql_connect("localhost", "webapp"); mysql_select_db("helpdesk",$db); $result = mysql_query("SELECT contactemail FROM loc WHERE location=$Location",$db); while($row = mysql_fetch_row($result)){ $contactemail = $row[0]; }
Thanks in advance, Bryan
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"90% of being smart is knowing what you're dumb at."
Bryan Brannigan
Hancock Lumber
System Administrator
Information Technology
(v)207.627.7694
(f)207.627.7041
bbrannigan
hancocklumber.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Brent, et al --
...and then Brent Baisley said... % % I'm not sure how you are creating your array, but your resulting array
Well, here's some code with some commentary to perhaps help:
- first we define a name for a picture basket; the default is 'default' (we might later get a new name from the user or replace an existing basket and save the collection)
- we base64_encode the basket name (if it isn't already done) so that we can safely store it and use it as a key in the basket list
- so we're ready to populate $pixbasket, an array of values (path to picture) and keys (base64_encoded version of the value, in fact, for the same sorts of reasons); we're given a base64_encoded path as the picture to put in the basket:
if ( $fn == "add" || $fn == "rm" ) # are we adding or removing a pic? { ... $p = base64_decode($basketpic); # get the pic path ... case add: $pixbasket[$basketpic] = $p; break ; # add to basket ... }
- when it's time to save the basket, we put the whole array (as a value) onto the basket list array:
if ( $fn == "manage" ) # still? { ... if ( $basketsave && ( $newname || $target ) ) # what to do and how to do it? { if ( $newname ) { $basketname = base64_encode($newname) ; } # use this if we have it ... else { $basketname = $target ; } # ... or else use 'target' (already encoded) $basketlist[$basketname] = $pixbasket ; # put it in the array ... }
- then we write the whole basket list array to a file and get it back some other day
% would look something like this: % % Array % ( % [name1]=>namevalue1 % [a1]=>Array % ( % [k1]=>value1 % [k2]=>value2 % ) % [name2]=>namevalue2 % [a2]=>Array % (...
Hmmm...
% % You end up with a two dimensional array (avoiding the columns term) that % contains a name value and a values array for each entry.
OK. I was able to construct this directly, but I don't see how to use it; if I ask for array_keys() for the outer array I'll get both types of keys and that would be a mess.
I suppose I could have another array like
$names = array ('name1', 'name2', 'name3') ;
where I maintain the order (renaming 'name2' is as simple as
$names[1] = 'newname' ;
once I determine that I'm working with position 1) and then have my array of baskets, now simply by ID instead of like a hash, so
$baskets = array (array(...),array(...),...) ;
would work) and then wrap both of those into the single array for writing (like
$basketlist = array($names,$baskets) ;
or so), but that seems even more of a kludge :-)
Given the array you present above, how would you extract a basket by name? The closest I can come is to go and find the name and then increment the ID by 1 and then get out that basket, which sounds like a *huge* mess...
Thanks again & HAND
:-D
-- David T-G * There is too much animal courage in (play) davidtgjustpickone.org * society and not sufficient moral courage. (work) davidtgwork
justpickone.org -- Mary Baker Eddy, "Science and Health" http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg!
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (FreeBSD)
iD8DBQE+L/axGb7uCXufRwARAvlMAKCoPvWApccc7OVJLkWrHKvEIOttNwCcC+1q VDrR0LoCEKAdUWQupdNnl10= =YbXr -----END PGP SIGNATURE-----
attached mail follows:
Unless the user has a lot of baskets, I would assume you would just list all the baskets the user has as links on the web page or as a pop up menu. The value passed by the links or pop up would be the element number of the array item containing the desired basket. To extract a basket by name I would say you could use array_search, but in looking into that function it appears to have changed through recent versions of PHP. In PHP 4.1 it doesn't search multi-dimensional arrays, I'm not sure about in 4.2.
But it's easy enough to create your own function to search the array. And you are right, the setup I recommended can get a bit kludgy. But if you "denormalize" the array structure it can get easy again. Just make the first element for each basket the name of basket. $baskets[] = array("basketname1","item1","item2"); $baskets[] = array("basketname2","item1","item2","item3"); $baskets[] = array("basketname3","item1","item2",...);
You can use sort() to sort the array.
Hope that helps and sorry about steering you down the difficult path first.
On Thursday, January 23, 2003, at 09:05 AM, David T-G wrote:
> Given the array you present above, how would you extract a basket by > name? The closest I can come is to go and find the name and then > increment the ID by 1 and then get out that basket, which sounds like a > *huge* mess... >
-- Brent Baisley Systems Architect Landover Associates, Inc. Search & Advisory Services for Advanced Technology Environments p: 212.759.6400/800.759.0577
attached mail follows:
If you are looking for something as simple as an index or key rename function it can be done and without making any copies of the array or object etc by:
$array['new_key_name'] =& $array['old_key_name']; unset($array['old_key_name'];
The first line creates a reference to the array. The second line removes the first reference without removing the second.
See this for more info: http://www.php.net/manual/en/language.references.unset.php
Regards, Jason k Larson
David T-G wrote: > Brent, et al -- > > ...and then Brent Baisley said... > % > % I had to do something like this not to long ago. Luckily it hit me that > % I shouldn't be changing keys, you don't do it in a database, so you > % really shouldn't do it in an array. > > Hmmm... Good point. > > > % I ended up adding a "column" to my array that contained the name. Then I > % didn't need to change keys and it worked just as well, and easier. > > Can you show me how? Currently I have > > Array > ( > [a1] => Array > ( > [k1] => value1 > [k2] => value2 > ) > [a2] => Array > ( > [k1] => value1 > [k2] => value2 > ) > ) > > and now I'll want to add a 'name' thingie (I daren't call it a column :-) > so that I can change it at will ... but where and how do I add it? > > > Thanks & TIA & HAND > > :-D
attached mail follows:
Brent --
...and then Brent Baisley said... % % Unless the user has a lot of baskets, I would assume you would just list % all the baskets the user has as links on the web page or as a pop up
One never knows, but I currently list as many as he has anyway.
% menu. The value passed by the links or pop up would be the element % number of the array item containing the desired basket.
OK... Then, of course, I'd have to do name->number mapping so that I can present the surfer with the name that he chose rather than just a number, but that could be done, too.
% To extract a basket by name I would say you could use array_search, but % in looking into that function it appears to have changed through recent % versions of PHP. In PHP 4.1 it doesn't search multi-dimensional arrays, % I'm not sure about in 4.2.
Makes it trickier :-)
% % But it's easy enough to create your own function to search the array.
Right.
% And you are right, the setup I recommended can get a bit kludgy. But if % you "denormalize" the array structure it can get easy again. Just make % the first element for each basket the name of basket. % $baskets[] = array("basketname1","item1","item2"); % $baskets[] = array("basketname2","item1","item2","item3"); % $baskets[] = array("basketname3","item1","item2",...);
Hmmm... I tried something like this and it got ugly. I could try again, except now it looks like I won't have to.
% % You can use sort() to sort the array.
Right.
% % Hope that helps and sorry about steering you down the difficult path % first.
It's quite informative, and I still need a lot of that, and the tough path is no problem :-) Thanks for all of the input!
HAND
:-D
-- David T-G * There is too much animal courage in (play) davidtgjustpickone.org * society and not sufficient moral courage. (work) davidtgwork
justpickone.org -- Mary Baker Eddy, "Science and Health" http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg!
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (FreeBSD)
iD8DBQE+MDPFGb7uCXufRwARAs/5AKCBOq0pzEg07RbMC+yx0+aExNkLawCfSq6n hzBuPIdBX5DHt9mGzn8UUNo= =m/vo -----END PGP SIGNATURE-----
attached mail follows:
Jason, et al --
...and then Jason k Larson said... % % If you are looking for something as simple as an index or key rename
Yep.
% function it can be done and without making any copies of the array or % object etc by:
Cool!
% % $array['new_key_name'] =& $array['old_key_name']; % unset($array['old_key_name'];
*blink* Oh, cool. I didn't know why I didn't think of that! I'm quite used to dereferencing in perl, and this is the same concept.
% % The first line creates a reference to the array. % The second line removes the first reference without removing the second.
Of course. Perfect!
Now to go and try it ;-)
% % See this for more info: % http://www.php.net/manual/en/language.references.unset.php
Thanks; I sure will.
% % Regards, % Jason k Larson
Thanks & HAND
:-D
-- David T-G * There is too much animal courage in (play) davidtgjustpickone.org * society and not sufficient moral courage. (work) davidtgwork
justpickone.org -- Mary Baker Eddy, "Science and Health" http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg!
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (FreeBSD)
iD8DBQE+MDXRGb7uCXufRwARAlgNAJ9vVQFlxOn14eyrUCq/nFJounTttQCgyKVj /B6/f0Ji7fs0MiVBMkzYDco= =K8Lc -----END PGP SIGNATURE-----
attached mail follows:
Jason, et al --
...and then David T-G said... % % ...and then Jason k Larson said... % % % % If you are looking for something as simple as an index or key rename
That was it, indeed, but
$t = array("t1" => "temp1", "t2" => "temp2" ) ; $f = array("f1" => "foo1", "f2" => "foo2" ) ; $a['t'] = $t ; $a['f'] = $f ; $a['n'] =& $a['t'] ; unset($a['t']) ; print_r($a) ;
yields
Array ( [f] => Array ( [f1] => foo1 [f2] => foo2 ) [n] => Array ( [t1] => temp1 [t2] => temp2 ) )
instead of having 'n' before 'f' (in the old 't' spot) as desired.
So I'm back to the beginning and to funky array wrappers again... I think these surfers will just see their baskets in different order after a rename :-)
Thanks to all & HAND
:-D
-- David T-G * There is too much animal courage in (play) davidtgjustpickone.org * society and not sufficient moral courage. (work) davidtgwork
justpickone.org -- Mary Baker Eddy, "Science and Health" http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg!
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (FreeBSD)
iD8DBQE+MD+TGb7uCXufRwARAv5EAJ9n2Tgzb/zp89ku3kge0AhHEzjptwCfcf2C ugaynJjugY/eU1CAf7QE3Gg= =ej8f -----END PGP SIGNATURE-----
attached mail follows:
> So I'm back to the beginning and to funky array wrappers again... I > think these surfers will just see their baskets in different order after > a rename :-)
Of course, if you display the baskets in alpha order by name, it won't be too much of a shock to them when they are displayed in a different order after rename. :p Just a through.
Chris
attached mail follows:
I have a site with a PHP auto-mailer where the owner of the site gets a
report
generated from the DB, it all works fine, except his server has spam
filtering enabled
so the FROM header in my PHP-Generated email, which says
"apache
hostname"
doesn't work because what the hostname is set to, isn't resolveable
outside our network.
Now I know I can just set the servers hostname to a valid DNS name, but
this brings
up another problem, even though I'm manually setting the "From" and
"Reply-to" headers
in the PHP mail command (the last parameter), when the email's are
listed in his box, it works,
if you open the headers in the email near the very top it still says
"From: apache
hostname" and a little ways below it says the From and
Reply-to I set.
So, is there anyway to override the top From which says apache
hostname?
Maybe
setting additional parameters on my sendmail command line in the
php.ini? Any ideas?
I appreciate it.
-- Adam Voigt (adamcryptocomm.com) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux)
iD8DBQA+L/hJF9k9BmZXCWYRAnx4AJwLZJ21ga51iB3YXRyxhzsAvlA1SwCgkYME iaB5kNPrFWLUq9ng3s60dAg=lNdj -----END PGP SIGNATURE-----
attached mail follows:
You have to use sendmail with the -f flag. I have written a small test util to do this:
<?php
$address = "recipient
address";
$message = "Subject: Test\n";
$message.= "\n message";
$result = `echo -e "$message" | /usr/sbin/sendmail -f your
address
$address`;
$result.= `$message`;
echo $result;
?>
On Thu, 2003-01-23 at 16:12, Adam Voigt wrote:
> I have a site with a PHP auto-mailer where the owner of the site gets a
> report
> generated from the DB, it all works fine, except his server has spam
> filtering enabled
> so the FROM header in my PHP-Generated email, which says
> "apache
hostname"
> doesn't work because what the hostname is set to, isn't resolveable
> outside our network.
> Now I know I can just set the servers hostname to a valid DNS name, but
> this brings
> up another problem, even though I'm manually setting the "From" and
> "Reply-to" headers
> in the PHP mail command (the last parameter), when the email's are
> listed in his box, it works,
> if you open the headers in the email near the very top it still says
> "From: apache
hostname" and a little ways below it says the From and
> Reply-to I set.
>
> So, is there anyway to override the top From which says apache
hostname?
> Maybe
> setting additional parameters on my sendmail command line in the
> php.ini? Any ideas?
> I appreciate it.
>
> --
> Adam Voigt (adam
cryptocomm.com)
> The Cryptocomm Group
> My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc
attached mail follows:
Thanks all for the responses.. the solution was to add single quotes around the $Location variable.
> -----Original Message-----
> From: Rick Emery [mailto:remery
emeryloftus.com]
> Sent: Thursday, January 23, 2003 10:10 AM
> To: Bryan Brannigan; Php List (E-mail)
> Subject: Re: [PHP] mysql_fetch_row problem
>
>
> I'm gong to bet that $Location is alpha, not numeric. Therefore:
> $result = mysql_query("SELECT contactemail FROM loc WHERE
> location=\"$Location\"",$db);
> ----- Original Message -----
> From: "Bryan Brannigan" <bbrannigan
HancockLumber.com>
> To: "Php List (E-mail)" <php-general
lists.php.net>
> Sent: Thursday, January 23, 2003 8:03 AM
> Subject: [PHP] mysql_fetch_row problem
>
>
> Can someone tell me what I'm doing wrong with the following
> code. What I am
> trying to do with this is insert some data from a form into a
> database.
> Then I am querying another database to retrieve the email
> addresses related
> to $location. This is the error I get:
>
> Warning: mysql_fetch_row(): supplied argument is not a valid
> MySQL result
> resource in D:\inetpub\webroot\usrmgr\upd.php on line 15
>
> This is the problematic code:
>
>
> $db = mysql_connect("localhost", "webapp");
> mysql_select_db("usermgr",$db);
> $sql = "INSERT INTO usernames
> (name,location,position,email,home,citrix,timberline,sawmill,c
> ounter,insides
> upport,am,receiving,shipping,purchasing,management,approval,un
> iqueid) VALUES
> ('$Name','$Location','$Position','$Emailaccess','$workathome',
> '$citrix','$ti
> mberline','$sawmill','$countersales','$insidesales','$accountm
> anager','$rece
> iving','$shipping','$purchasing','$management','Waiting','$uni
> queid')";
> $result = mysql_query($sql);
> mysql_close($db);
>
>
> $db = mysql_connect("localhost", "webapp");
> mysql_select_db("helpdesk",$db);
> $result = mysql_query("SELECT contactemail FROM loc WHERE
> location=$Location",$db);
> while($row = mysql_fetch_row($result)){
> $contactemail = $row[0];
> }
>
>
> Thanks in advance,
> Bryan
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> "90% of being smart is knowing what you're dumb at."
> Bryan Brannigan
> Hancock Lumber
> System Administrator
> Information Technology
> (v)207.627.7694
> (f)207.627.7041
> bbrannigan
hancocklumber.com
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
attached mail follows:
I know I'll start another flamewar, but I'm desperate for a quality hosting provider supporting php/mysql/imagemagik
anyone has good experience with any company?
regards, Vahan
attached mail follows:
Vahan, et al --
...and then Vahan Yerkanian said... % % I know I'll start another flamewar, but I'm desperate for % a quality hosting provider supporting php/mysql/imagemagik % % anyone has good experience with any company?
I promise that I'm not just here to keep beating my own drum, but you've described us to a tee (well, you left out perl :-) What do you need? Drop me a note off-list (since I doubt anyone else wants to hear much about it) for more info..
% % regards, % Vahan
HTH & HAND
:-D
-- David T-G * There is too much animal courage in (play) davidtgjustpickone.org * society and not sufficient moral courage. (work) davidtgwork
justpickone.org -- Mary Baker Eddy, "Science and Health" http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg!
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (FreeBSD)
iD8DBQE+MAxcGb7uCXufRwARAj89AJ9jZPaMNHc1Iq8wHqOq5YbKX+0U6wCgx9LL f51+gE1Zirkomej4ZhUwbeI= =vpew -----END PGP SIGNATURE-----
attached mail follows:
Hi,
i got a textfile and i want to edit one post in it. here is what i use to read the file
$fp = fopen($servername, "r") or die("error"); $wuser = file($servername); $num = -1; for ($i=0; $i < count($wuser); $i++) { $wtemp = explode(";;", $wuser[$i]); if ($ausername == $wtemp[0]) { $wserver = explode(";;", $wuser[$i]); } } fclose($fp);
then the user will do some inputs on a form and submit em back, and i want to save em back to the database, how do i alter/delete just one post in a textfile?
regards patrick
attached mail follows:
Hi!
I'm wondering is, is there a way to lose the existing session and existing session data while making a new session id??? I can't use session_destroy() function because it affected IE users, it doesn't affect the non-IE user at all. I got so tired of problems with IE and having it to work properly with the session id, so I decided not to use session_destory().
So, a case situation here is when an IE user closed the browser without logging out. Then later on, fire-up the browser and log in. Problem with this is when I create a new session_id(), it should work but for some reason, a couple of IE users are being affected because the original user did not log out in the first place. So, I decided not to use session_destroy() because of some strange relation between many IEs and the PHP session_id. So, is there a way to detach any existing session data then creating a new session id when logging in???
Thanks!!!
attached mail follows:
> I'm wondering is, is there a way to lose the existing session and > existing session data while making a new session id??? I can't use > session_destroy() function because it affected IE users, it doesn't affect > the non-IE user at all. I got so tired of problems with IE and having it > to > work properly with the session id, so I decided not to use > session_destory().
Unset($_SESSION) will get rid of the data in the session... > So, a case situation here is when an IE user closed the browser > without > logging out. Then later on, fire-up the browser and log in. Problem with > this is when I create a new session_id(), it should work but for some > reason, a couple of IE users are being affected because the original user > did not log out in the first place. So, I decided not to use > session_destroy() because of some strange relation between many IEs and > the > PHP session_id. So, is there a way to detach any existing session data > then > creating a new session id when logging in???
Sounds like you have a problem in your code logic, not in how PHP handles sessions. Whether someone logs off or not shouldn't affect other people.
---John Holmes...
attached mail follows:
Can't do the unset either.. For some reason, the session file aren't doing what it is suppose to do..... When one IE browser closed, it lose it's link to this session file in /tmp. If I remove this unused file or something, it affected other session files where other IE browsers had already established hte link to ....
This is what I don't get.... There's nothinig wrong with the PHP code I use.....
"John W. Holmes" <holmes072000
charter.net> wrote in message
news:001101c2c303$c8e193a0$7c02a8c0
coconut...
> > I'm wondering is, is there a way to lose the existing session and
> > existing session data while making a new session id??? I can't use
> > session_destroy() function because it affected IE users, it doesn't
> affect
> > the non-IE user at all. I got so tired of problems with IE and having
> it
> > to
> > work properly with the session id, so I decided not to use
> > session_destory().
>
> Unset($_SESSION) will get rid of the data in the session...
>
> > So, a case situation here is when an IE user closed the browser
> > without
> > logging out. Then later on, fire-up the browser and log in. Problem
> with
> > this is when I create a new session_id(), it should work but for some
> > reason, a couple of IE users are being affected because the original
> user
> > did not log out in the first place. So, I decided not to use
> > session_destroy() because of some strange relation between many IEs
> and
> > the
> > PHP session_id. So, is there a way to detach any existing session
> data
> > then
> > creating a new session id when logging in???
>
> Sounds like you have a problem in your code logic, not in how PHP
> handles sessions. Whether someone logs off or not shouldn't affect other
> people.
>
> ---John Holmes...
>
>
attached mail follows:
When a session is closed, even though the file in /tmp may still exist, it is simply waiting for garbage collection to clean it up. New sessions in no-way cross link themselves with old ones, I promise you, you can have 1000 concurrent sessions and no one's data will overlap unless bad programming is involved, and even then setting a value to $_SESSION only sets it for the person who view's the particular page that session code is on.
On Thu, 2003-01-23 at 12:33, Scott Fletcher wrote:
Can't do the unset either.. For some reason, the session file
aren't doing
what it is suppose to do..... When one IE browser closed, it lose
it's link
to this session file in /tmp. If I remove this unused file or
something, it
affected other session files where other IE browsers had already
established
hte link to ....
This is what I don't get.... There's nothinig wrong with the PHP
code I
use.....
"John W. Holmes" <holmes072000
charter.net> wrote in message
news:001101c2c303$c8e193a0$7c02a8c0
coconut...
> > I'm wondering is, is there a way to lose the existing
session and
> > existing session data while making a new session id??? I can't
use
> > session_destroy() function because it affected IE users, it
doesn't
> affect
> > the non-IE user at all. I got so tired of problems with IE and
having
> it
> > to
> > work properly with the session id, so I decided not to use
> > session_destory().
>
> Unset($_SESSION) will get rid of the data in the session...
>
> > So, a case situation here is when an IE user closed the
browser
> > without
> > logging out. Then later on, fire-up the browser and log in.
Problem
> with
> > this is when I create a new session_id(), it should work but for
some
> > reason, a couple of IE users are being affected because the
original
> user
> > did not log out in the first place. So, I decided not to use
> > session_destroy() because of some strange relation between many
IEs
> and
> > the
> > PHP session_id. So, is there a way to detach any existing
session
> data
> > then
> > creating a new session id when logging in???
>
> Sounds like you have a problem in your code logic, not in how PHP
> handles sessions. Whether someone logs off or not shouldn't affect
other
> people.
>
> ---John Holmes...
>
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
-- Adam Voigt (adamcryptocomm.com) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux)
iD8DBQA+MCcMF9k9BmZXCWYRAiPyAJ4i/4bGdo92o5AB5Tm82ZMFA1u3zwCfdfaW 4EiLu4MOM+lH98Nqg4tz1y0 4m -----END PGP SIGNATURE-----
attached mail follows:
Look like this is something I'll stick to from now on. Just create a new session when a login is being attempt. No destruction or anything of that sort. I have been trouble free for a couple of days now... It seem that destruction of hte session data and files aren't being done correctly. I didn't have that problem before until a newer version of IE come into play. I'm not worried about cleaning up the garbage collection because I wrote a bash script to take care of that at each rebooting since apache would be offline. The overnight rebooting is done twice a week. Cheer!!!
"Adam Voigt" <adam
cryptocomm.com> wrote in message news:1043343117.1664.19.camel
beowulf.cryptocomm.com...
When a session is closed, even though the file in /tmp may still exist, it is simply
waiting for garbage collection to clean it up. New sessions in no-way cross link
themselves with old ones, I promise you, you can have 1000 concurrent sessions
and no one's data will overlap unless bad programming is involved, and even then
setting a value to $_SESSION only sets it for the person who view's the particular page
that session code is on.
On Thu, 2003-01-23 at 12:33, Scott Fletcher wrote: Can't do the unset either.. For some reason, the session file aren't doing what it is suppose to do..... When one IE browser closed, it lose it's link to this session file in /tmp. If I remove this unused file or something, it affected other session files where other IE browsers had already established hte link to ....
This is what I don't get.... There's nothinig wrong with the PHP code I use.....
"John W. Holmes" <holmes072000
charter.net> wrote in message
news:001101c2c303$c8e193a0$7c02a8c0
coconut...
> > I'm wondering is, is there a way to lose the existing session and
> > existing session data while making a new session id??? I can't use
> > session_destroy() function because it affected IE users, it doesn't
> affect
> > the non-IE user at all. I got so tired of problems with IE and having
> it
> > to
> > work properly with the session id, so I decided not to use
> > session_destory().
>
> Unset($_SESSION) will get rid of the data in the session...
>
> > So, a case situation here is when an IE user closed the browser
> > without
> > logging out. Then later on, fire-up the browser and log in. Problem
> with
> > this is when I create a new session_id(), it should work but for some
> > reason, a couple of IE users are being affected because the original
> user
> > did not log out in the first place. So, I decided not to use
> > session_destroy() because of some strange relation between many IEs
> and
> > the
> > PHP session_id. So, is there a way to detach any existing session
> data
> > then
> > creating a new session id when logging in???
>
> Sounds like you have a problem in your code logic, not in how PHP
> handles sessions. Whether someone logs off or not shouldn't affect other
> people.
>
> ---John Holmes...
>
>
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
-- Adam Voigt (adamcryptocomm.com) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc
attached mail follows:
I've got a site running PHP w/ MySQL & DBF extensions on Apache with mod_ssl/openssl.
Yesterday, following upgrading to 4.3.0 (and upgrading mod_ssl/apache as well) the site stopped working. I quickly figured out there was a change in session processing and that I needed to no longer use global variables to transfer information from my $_POST array into $_SESSION but that I needed to transfer the information directly.
After making this change I was able to get rid of the warning messages and things started looking like they were working correctly but the results of the queries didn't respond consistently. In fact, if I run the same query 10 times I'm likely to get 3 different kinds of results. No records found (which is false), a "Page Not Found" error (also false), and about 15% of the time I'll get the correct results.
I've tried setting the PHP.INI settings for the compatibility and warning in all 4 different combinations and I've even turned register_globals back on to see if that would solve it ...
This was a live e-commerce site until I upgraded and now my client, his customers and my rep are going down the tubes ...
Help please someone!
Bob.
P.S. Please respond directly to my e-mail as well as the list as I get the digest and wont see responses for a while otherwise. Thanks.
Bob Horton
PSD Services Inc.
Web Hosting & Development
Phone: (306) 522-4638 (522-INET)
bhorton
psdservices.com
attached mail follows:
Hi, After calling to the function ImageCreateFromJPEG() and before outputing the image with ImageJPEG, is there a way to determine the images size in bytes? I want to reduce the quality more and more until it has reached a certain level. Thanks, Olli
attached mail follows:
> After calling to the function ImageCreateFromJPEG() and before outputing > the image with ImageJPEG, is there a way to determine the images size in > bytes? > I want to reduce the quality more and more until it has reached a > certain level. > Thanks, > Olli
You have the image data in a string, right? Could you relate the length of that string to the resulting size of the file, somehow?
---John Holmes...
attached mail follows:
"1lt John W. Holmes" schrieb:
> > After calling to the function ImageCreateFromJPEG() and before outputing > > the image with ImageJPEG, is there a way to determine the images size in > > bytes? > > I want to reduce the quality more and more until it has reached a > > certain level. > > Thanks, > > Olli > > You have the image data in a string, right? Could you relate the length of > that string to the resulting size of the file, somehow? > > ---John Holmes...
After calling the funtion ImageCreateFromJPEG like this: $im = ImageCreateFromJPEG(pic.jpg); then $im is not a string but a resource. I don't know how to get it into a string.... Olli
attached mail follows:
Use output buffer: ob_start(); ImageJPEG($im); $imagestring=ob_get_contents(); ob_end_clean();
Oliver Witt wrote:
>"1lt John W. Holmes" schrieb: > > > >>>After calling to the function ImageCreateFromJPEG() and before outputing >>>the image with ImageJPEG, is there a way to determine the images size in >>>bytes? >>>I want to reduce the quality more and more until it has reached a >>>certain level. >>>Thanks, >>>Olli >>> >>> >>You have the image data in a string, right? Could you relate the length of >>that string to the resulting size of the file, somehow? >> >>---John Holmes... >> >> > >After calling the funtion ImageCreateFromJPEG like this: >$im = ImageCreateFromJPEG(pic.jpg); >then $im is not a string but a resource. I don't know how to get it into a >string.... >Olli > > > > >
attached mail follows:
Marek Kilimajer schrieb:
> Use output buffer: > ob_start(); > ImageJPEG($im); > $imagestring=ob_get_contents(); > ob_end_clean(); > >
Thanks for the answer. But if I do it like that, the picture has been sent to the browser. That's what I don't want. I need to know the size of the picture before it is sent to the browser. Olli
attached mail follows:
No, it's not sent to the browser. Your output buffer catches it, and the output buffer is then erased with ob_end_clean().
Oliver Witt wrote:
>Marek Kilimajer schrieb: > > > >>Use output buffer: >>ob_start(); >>ImageJPEG($im); >>$imagestring=ob_get_contents(); >>ob_end_clean(); >> >> >> >> > >Thanks for the answer. But if I do it like that, the picture has been sent to >the browser. That's what I don't want. I need to know the size of the picture >before it is sent to the browser. >Olli > > > > > > >
-- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.
attached mail follows:
Hello all. I have a few servers that I need to check during a login process. If the first server fails to connect, then I need to do server #2 and so on. Below is the code that I am using, but I am unable to get it to work like it should. Can anyone offer some advice on how this should be accomplushed?
Thanks
CDitty
function sConnect($serverID){ $ds = ldap_connect($serverID); return $ds; }
$i = 0; do{ ldapConnect($config['ldapServer'][$i]); $i++; }while(!$ds && ($i < (count($config['ldapServer']) + 1)));
attached mail follows:
On Friday 24 January 2003 00:24, Christopher Ditty wrote: > Hello all. I have a few servers that I need to check during a login > process. If the first server fails to connect, then I need to do server #2 > and so on. Below is the code that I am using, but I am unable to get it to > work like it should. Can anyone offer some advice on how this should be > accomplushed? > > Thanks > > CDitty > > > function sConnect($serverID){ > $ds = ldap_connect($serverID); > return $ds; > }
Is that above function relevant? You've defined it but it's not being used in the code below?
> $i = 0; > do{ > ldapConnect($config['ldapServer'][$i]); > $i++; > }while(!$ds && ($i < (count($config['ldapServer']) + 1)));
Anyway you can try something like:
foreach ($config['ldapServer'] as $key => $value) { if (ldapConnect($value)) { // if successfully connected $server = $value; break; } } echo "Connected to server $server";
-- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development */* I have that old biological urge, I have that old irresistible surge, I'm hungry. */
attached mail follows:
Is there a way to count the number of words in a string?
attached mail follows:
> Is there a way to count the number of words in a string?
Untested, but this should work.
$string = "Is there a way to count the number of words in a string?"
$numOfWords = count( explode( " ", $string ));
Chris
attached mail follows:
Umm, how about:
$string = "hi my name is bob"; $count = (substr_count($string," ")+1);
On Thu, 2003-01-23 at 11:35, Craig wrote:
Is there a way to count the number of words in a string? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
-- Adam Voigt (adamcryptocomm.com) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux)
iD8DBQA+MBtOF9k9BmZXCWYRAsfuAKCUqXVBwmROwO1wxFVZ7z+gQpUHjgCgmwdr 6smwZmFAv8SAvK55S4sXKos=v71o -----END PGP SIGNATURE-----
attached mail follows:
To be somewhat more rigorous, you could do:
$numOfWords = count(preg_split('/\s+/', trim($string)));
(also untested); this ignores leading/trailing whitespace, and deals with multiple spaces/tabs between words. There is an example in the docs (below) called 'Get the parts of a search string' that shows how to add other characters that you might consider valid word delimiters - eg, a comma.
See http://php.he.net/manual/en/function.preg-split.php
-steve
At 10:41 AM -0600 1/23/03, "Chris Boget" <chris
wild.net> wrote:
> > Is there a way to count the number of words in a string?
>
>Untested, but this should work.
>
>$string = "Is there a way to count the number of words in a string?"
>
>$numOfWords = count( explode( " ", $string ));
>
>Chris
>
-- +------------------------------------------------------------------------+ | Steve Edberg sbedbergucdavis.edu | | University of California, Davis (530)754-9127 | | Programming/Database/SysAdmin http://pgfsun.ucdavis.edu/ | +------------------------------------------------------------------------+ | SETI
Home: 1001 Work units on 23 oct 2002 | | 3.152 years CPU time, 3.142 years SETI user... and STILL no aliens... | +------------------------------------------------------------------------+
attached mail follows:
Hi
Anyone who knows why get variables whit spaces in looking like this in the URL blah.php?aa+bb=1 is changed to aa_bb in $_GET resulting in $_GET['aa_bb'] instead of $_GET['aa bb']?
/P
attached mail follows:
Hi Per,
> Anyone who knows why get variables whit spaces in looking like this in > the URL blah.php?aa+bb=1 is changed to aa_bb in $_GET resulting in > $_GET['aa_bb'] instead of $_GET['aa bb']?
I don't think spaces are legal in variable names - PHP's probably just trying to recover from the dodgy data it's getting.
Cheers Jon
attached mail follows:
> Anyone who knows why get variables whit spaces in looking like this in > the URL blah.php?aa+bb=1 is changed to aa_bb in $_GET resulting in > $_GET['aa_bb'] instead of $_GET['aa bb']?
That's just what PHP does. It'll also convert any periods in a form element name to an underscore.
Otherwise, if you have register globals on, it would try to create a variable of "$aa bb" which doesn't make sense, or "$aa.bb" which doesn't make sense, either, because the dot is a concatinator.
---John Holmes...
attached mail follows:
Everyone,
I was wondering if there are any perl/php programmers that have used mason.
I am trying to get the advantages/disadvantages of each?
I am pro PHP, but my does is pro perl. What does everyone think about the benefits of one over the other?
Thanks,
Ray
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org
iD8DBQA+MCyT20qIaNvMno8RAtdcAJ4vtfw3fQKAy/xFUNakePG7ejeiBQCfY6BV q1VaxT52Ck8VQokNSSn9RRA= =gi+3 -----END PGP SIGNATURE-----
attached mail follows:
Just to add a little fuel to the fire, the only way I've seen or been able to get PHP and Apache 2 working together is by installing each from my Red Hat 8.0 CD's. When I tried to compile each together, I got many an error.
When I start doing some actually web work on my testing server, I imagine I'll uninstall Apache 2, and go with some version of 1.3
attached mail follows:
use urlencode()
Simon Angell wrote:
>Hi All. >I am currently playing with sripts, and have come across a problem, that i >can't slove. (i am a novice - lol). >The script requires a URL to grab data from. The URL has a ? in it, and >testing the script it grabs the base data of the URL, but not the essential >data i need, which is only brought up with what comes after the ? in the >URL. now i figure it has something to do with the ? in the URL but i can't >seem to fix it myself. > >Thanks > >-- > >Cheers >--------------------------------- >Simon Angell >Canberra, ACT >www.canberra-wx.com >--------------------------------------------- >Proud member of the >Australian Severe Weather Association. >www.severeweather.asn.au >-------------------------------------------------------------- > > > > >
attached mail follows:
use $_SERVER['HTTP_ACCEPT_LANGUAGE']
John M wrote:
>Hello, > >I have the code below, but it doesn't work. I see the message "It is an >array" but nothing else. What can be the problem? >How can I get the actual browser language? > >I use WinXp Prof, Apache 2.0.43, PHP 4.2.3, safe_mode is on. > >Thanks! > ><?php > global $HTTP_ACCEPT_LANGUAGE; > $arr_lang = preg_split('/(\s*,\s*)/', $HTTP_ACCEPT_LANGUAGE); > if (is_array($arr_lang)) { > echo "It is an array"; > $lang_first = strtolower((trim(strval($arr_lang[0])))); > echo $lang_first; > $lang_first = substr($lang_first, 0, 2); > $lang = $lang_first; > echo $lang; > } >?> > > > > >
attached mail follows:
As you noted, there really should be while ( $j < $i ) because $i is incremented after last element to $selectTab is added. But it still should not die quietly. Do you have display_errors off?
andre.lagadec
education.gouv.fr wrote:
>Hi
>
>There is no error or notice message on the screen and in the log of the web server.
>The PHP program stop and don't generate all the HTML code of the page.
>
>Marek Kilimajer a écrit :
>
>
>
>>I have never heard of "out of range" error, but is it really an error
>>or just a notice? If it is a notice, adjust error reporting to not
>>display notices
>>
>>andre.lagadec
education.gouv.fr wrote:
>>
>>
>>
>>>Hello,
>>>
>>>I try to move an Web application in Php-4.0.3 to php-4.2.3, and some
>>>programs
>>>don't work well on some pages. I make search in the code, and after
>>>tests, I find that
>>>the following code doesn't work in php-4.2.3, but works in php-4.0.3pl1
>>>------------------------------------------------------------------------------------
>>>
>>><html>
>>><body>
>>><form>
>>><?
>>>$i = 0;
>>>while ($i<=3) {
>>> $selected = "";
>>> $selectTab[$i] = "<option value='".$i."' ".$selected."> bla bla
>>></option>\n";
>>> $i++;
>>> }
>>>printf("<select name='filiere' multiple size='%d' class='textNoir'>\n",
>>>($i-1) );
>>>$j = 0;
>>>while ( $j <= $i ) {
>>> printf($selectTab[$j]);
>>> $j++;
>>> }
>>>printf("</select>");
>>>?>
>>></body>
>>></html>
>>>------------------------------------------------------------------------------------
>>>
>>>It's because there is an error in the code : this instruction is wrong
>>>while ( $j <= $i ),
>>>there is an "out of range" in the array selectTab[] when $j=$i=4
>>>the good instruction is while ( $j < $i )
>>>
>>>Is there something changed in the gestion of the error "out of range" in
>>>an array
>>>betwen php-4.0.3pl1 and php-4.2.4 ?
>>>
>>>Thanks for your help ?
>>>
>>>AL
>>>
>>>
>>>
>>>
>>>
>>>
>
>
>
attached mail follows:
yes, it is possible, but not with php.
Jim
----- Original Message -----
From: "Victor" <victor
argilent.com>
To: <php-general
lists.php.net>
Sent: Wednesday, January 22, 2003 8:10 PM
Subject: [PHP] total file size
> Is there a way to find out total upload file size from a file uploaded > though an html form? I figure if I know the total size, then I can just > consistently poke at the file being uploaded and math a progress bar for > the file being uploaded, of course, this all hangs upon the ability of > getting the total file size BEFORE it is uploaded. It IS possible I have > seen it done with JSP; anybody can help me with this? Thanks > > - Vic > > ______________________________________________________________________ > 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 > >
attached mail follows:
Hi,
it would be MUCH faster and easier to debug if you wrote a parser. See the example parsers in phpDocumentor, download available at http://www.phpdoc.org
Greg
"Andreas Sheriff" <mailinglist
asheriff.com> wrote in message
news:000701c2c272$6b13b870$0f01a8c0
iion.com...
> Hi,
>
> I'm trying to construct a regular expression to find HTML open tags
without
> closing tags up to another of the same HTML open tag or a closing tag of a
> different type that's no enclosed in the implied closing tag optional HTML
> tag (for example <p> doesn't require a closing tag. The closing tag is
> implied and so is its body).
>
> For example, the HTML snippet:
>
> <html><head><title>Test HTML</title></head>
> <body>
> <p><font>This tag is ok<br></font></p>
> <font><p>I want to find this p tag<br>
> and up to the next opening p tag<br>
> <b>test<br></b></font>
> <p>I want to find this one too
> </body>
>
> I don't want to find <p> tags with a complete structure.
> ex: <p>This is a <p> tag with a complete structure</p>
>
> Instead, I want to find the <p> tag with no closing tag, up to the next
<p>
> tag or a closing tag of any type that doesn't have an opening tag after
the
> initial <p> found (not including this orphaned closing tag)
>
> Andreas Sheriff
>
>
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]