|
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