|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
Subject: php3 Digest 15 Mar 2000 06:00:01 -0000 Issue 1538
From: php3-digest-help
lists.php.netDate: Wed Mar 15 2000 - 00:00:01 CST
- Next message: php3-digest-help
lists.php.net: "php3 Digest 15 Mar 2000 18:00:01 -0000 Issue 1539"
- Previous message: php3-digest-help
lists.php.net: "php3 Digest 14 Mar 2000 18:00:05 -0000 Issue 1537"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
php3 Digest 15 Mar 2000 06:00:01 -0000 Issue 1538
Topics (messages 81202 through 81281):
Spam/bounced mail update, as of noon
81202 by: Sascha Schumann <sascha
schumann.cx>
81279 by: "Manuel Lemos" <mlemos
acm.org>
Array sort
81203 by: Bojan Gajic <bojan
inet.co.yu>
81220 by: <artwells
inetarena.com>
Cookie question (and it's not "How do I set a cookie?")
81204 by: chris
tourneyland.com
SQL - how to start?
81205 by: Alexandre Maneu i Victòria <nexus.mansoft
ctv.es>
sorry for my duplicates
81206 by: Alexandre Maneu i Victòria <nexus.mansoft
ctv.es>
passing an array
81207 by: Victor Simon Lee <victor
inf.ufsc.br>
81210 by: "Jay Hirsch" <jhirsch
scilearn.com>
snmp
81208 by: "Steven Glogger" <list
glogger.ch>
81217 by: "Rossi Designs" <webmaster
rossidesigns.net>
getting php to run as cgi
81209 by: "Mark Maggelet" <maggelet
mminternet.com>
Serving All Content Via php in Apache
81211 by: wmphp
getlost.com.au (Warren)
escape charactor help
81212 by: "Mako Joe" <eyeofthestorm2
DELETETHIShotmail.com>
NNTP Gateway to this List
81213 by: Martin McWhorter <m_mcwhorter
prairiegroup.com>
PHP and LDAP URL
81214 by: Martin McWhorter <m_mcwhorter
prairiegroup.com>
phpMyAdmin and php4
81215 by: Dave Guerin <dave
guerin.demon.co.uk>
81222 by: "Jerry" <php_list
lucard.to>
81225 by: Dave Guerin <dave
guerin.demon.co.uk>
81227 by: rasmus
php.net
81244 by: Dave Guerin <dave
guerin.demon.co.uk>
GD Library, .GIF and .PNG
81216 by: "Jason Cox" <jasonc
webpipe.net>
81237 by: Thomas Merlin <thomas.merlin
mixad.com>
Cookies and require()
81218 by: "Pierre-Alain Joye" <pajoye
des.ch>
81221 by: Lars Torben Wilson <torben
pinc.com>
81226 by: "Pierre-Alain Joye" <pajoye
des.ch>
cookies and require func
81219 by: "Pierre-Alain Joye" <pierre-alain.joye
vtx-ch>
Help with FTP
81223 by: "Knowledge Based" <phpnovice
hotmail.com>
Sydney PHP Meeting
81224 by: rasmus
php.net
How to stop displaying... Content-Type: text/html in a browser
81228 by: "Arthur Granowski" <a.granowski
globalspirit.net>
Running 2 Apache's / 2 PHP's (1 as root)
81229 by: "Brian T. Allen" <brian
purenetfx.com>
81232 by: "Dave" <dave
calinet.com>
81234 by: "Brian Leyton" <bleyton
cpe-usalco.com>
Email Attachment Not Running Right
81230 by: "James R. Edgar" <edgar
webt.com>
problems with php4/oci8
81231 by: "Manish Mandelia" <mmandelia
naviant.com>
81235 by: David Nagel <nagel
ursu.uregina.ca>
[SLUG] Re: [PHP3] Sydney PHP Meeting
81233 by: michaelf
mafnet.com
A security question (was: Re: [PHP3] PGP From PHP Difficulties)
81236 by: "Lic. Rodolfo Gonzalez Gonzalez" <rodolfo
equinoxe.g-networks.net>
Using GD to resize an image.
81238 by: "Jason G." <razm
assassination.org>
81239 by: Rasmus Lerdorf <rasmus
php.net>
81250 by: "Hans H. Anderson" <hans
hansanderson.com>
81253 by: Paul Haddon <paullist
mail.hartingdale.com.au>
API between PHP application
81240 by: Rasmus Lerdorf <rasmus
php.net>
81247 by: mocha_php <mocha_php
yahoo.com>
81251 by: Rasmus Lerdorf <rasmus
php.net>
81258 by: mocha_php <mocha_php
yahoo.com>
81278 by: "Manuel Lemos" <mlemos
acm.org>
databases independend project
81241 by: "Manuel Lemos" <mlemos
acm.org>
81261 by: "Mark Nold" <MarkN
awi.com.au>
Send e-mail with an external program
81242 by: "Manuel Lemos" <mlemos
acm.org>
small prob with PHP3+MySQL
81243 by: George Kearns <georgek
wtrt.net>
81246 by: "Brian T. Allen" <brian
purenetfx.com>
Strange output within for(;;)
81245 by: <vojtech
servac.edit.cz>
exec does the zombie?
81248 by: "Keith Ford" <keith
MagicClicks.com>
how to take a BLOB from the database
81249 by: "Arpad Tamas" <lsts
neves.pmmf.hu>
Is php4 ready for production use?
81252 by: "Marc Ryan Ray" <marcray
visto.com>
81254 by: "Mitch Vincent" <mitch
venux.net>
81280 by: "Manuel Lemos" <mlemos
acm.org>
PostgreSQL comments needed!
81255 by: "Mitch Vincent" <mitch
venux.net>
Windows NT , php4 and PDFLib
81256 by: "David Johnson" <djj9
cornell.edu>
shipping class
81257 by: "T.R. Henigson" <ted
3bits.com>
81263 by: "Mike Sheldon" <msheldon
desertraven.com>
81281 by: "Manuel Lemos" <mlemos
acm.org>
Date calculation problem
81259 by: "Alexis Antonakis" <alexisantonakis
csi.com>
81264 by: Kevin Keeler <insanity
uwns.underworld.net>
Cookies/Mac+Netscape
81260 by: Brian Clark <brianj
ais.ais-gwd.com>
php4.0-b4pl with oci not work.
81262 by: "chen" <x
ctiwx.com.cn>
variable variables and explode
81265 by: Joe Kerns <joe
joltinjoe.com>
PostgreSQL Driven Search Engine
81266 by: "Mitch Vincent" <mitch
venux.net>
81268 by: "Opec Kemp" <okemp
ozemail.com.au>
$HTTP_POST_VARS
81267 by: hana <hana
mlcc.com.my>
array_pad
81269 by: "Josh G" <josh
isa.net.au>
Testing
81270 by: David VanHorn <dvanhorn
cedar.net>
Looks like a bug in mktime function
81271 by: "Paul Meagher" <paul
datavore.com>
New to SQL+PHP
81272 by: "jveillon" <jveillo
bellsouth.net>
bounced messages on php mailing list
81273 by: "Stephen Cope" <kimihia
maxnet.co.nz>
getting rid from too many connections
81274 by: idban secandri <idban
satunet.com>
server side within php3 script
81275 by: roberto lopez <roberto
linux.com>
Max connections with OCIPlogon?
81276 by: "Josh G" <josh
isa.net.au>
what do you think about http://www.linuxcare.com.au/projects/natsort/
81277 by: thies
digicol.de
Administrivia:
To subscribe to the digest, e-mail:
php3-digest-subscribe
lists.php.net
To unsubscribe from the digest, e-mail:
php3-digest-unsubscribe
lists.php.net
To post to the list, e-mail:
php3
lists.php.net
----------------------------------------------------------------------
attached mail follows:
On Tue, Mar 14, 2000 at 12:51:56PM -0800, David VanHorn wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> EMAIL SPAM FAQ, as of Noon
> New bits at the bottom, corrections in the body as needed
>
> The short version: It seems to have stopped, but some user's
I've killed some subscriptions. If you encounter more of this,
please forward the complete bounces to me.
- Sascha
attached mail follows:
Hello Sascha,
On 14-Mar-00 16:00:57, you wrote:
>> EMAIL SPAM FAQ, as of Noon
>> New bits at the bottom, corrections in the body as needed
>>
>> The short version: It seems to have stopped, but some user's
>I've killed some subscriptions. If you encounter more of this,
>please forward the complete bounces to me.
Wouldn't it be better for us that post on the list if the list was
configured so that the replies only go back to the list and not also
to the poster?
I was particularly affected by this spam flood as I got literally hundreds
of messages, as much as those that I have posted to the list since October.
Since the list is allowing all this spam to get back to the poster, more
and more I find myself restraining to reply to messages from PHP lists
because there are always people now and then that have their mailboxes full
or some misconfiguration and it is not fair for posters to pay for those
troubles.
AFAIK, the list is managed by software that handles bounces properly, but
the way it is configured it is not preventing posters to be spammed back
for their contributions. Please do something, configure the list to set
replies only to the list and not the poster. All of use that have been
spammed back will appreciate.
Regards,
Manuel Lemos
Web Programming Components using PHP Classes.
Look at: acm.org">http://phpclasses.UpperDesign.com/?user=mlemos
acm.org
-- E-mail: mlemosacm.org URL: http://www.mlemos.e-na.net/ PGP key: http://www.mlemos.e-na.net/ManuelLemos.pgp --
attached mail follows:
"There is no one function that sorts in reverse order by key. To achive this, just use ksort() followed on the next line by arsort()"
Professional PHP programming ( J.C., H.R., C.C., C.S., D.V.)
ksort() sorts by key, while arsort() does reverse sorting, preserving keys.
-- Bojan Gajic <bojaninet.co.yu>
Jeppe Sohn Jensen wrote:
> Hi. > Im trying to sort an array. > i have tried the functions listed in the "quick reference" at php.net but > none of them seems to fullfill my needs. > > the array is generated like this (in a loop). > > $ar_values[$j] = array('name' => $row[1], 'hits' => $hits); > > What i want is to sort the array by the value of key "hits" so that the > highest value of key "hits" will be the first and so on. > > Is it possible to do so??? > > -- > > Med venlig hilsen > > Jeppe Sohn, Internet/Multimedia > Boje & Mobeck as > > E-mail: jeppe
boje-mobeck.dk > Web-site www.boje-mobeck.dk > Direkte tlf: 70 23 09 10 - 37 > Omstilling 70 22 09 10 > Fax nr. 38 10 16 24 > > -- > PHP 3 Mailing List <http://www.php.net/> > To unsubscribe, send an empty message to php3-unsubscribe
lists.php.net > To subscribe to the digest, e-mail: php3-digest-subscribe
lists.php.net > To search the mailing list archive, go to: http://www.php.net/mailsearch.php3 > To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
On Tue, 14 Mar 2000, Jeppe Sohn Jensen wrote:
> > Hi. > Im trying to sort an array. > i have tried the functions listed in the "quick reference" at php.net but > none of them seems to fullfill my needs. > > the array is generated like this (in a loop). > > $ar_values[$j] = array('name' => $row[1], 'hits' => $hits); > > What i want is to sort the array by the value of key "hits" so that the > highest value of key "hits" will be the first and so on. > > Is it possible to do so???
Yes. You can use usort. First you must define a sorting function. Something like:
function ar_sort($a,$b){ if ($a['hits']==$b['hits']){ return 0; } else{ return ($a['hits'] < $b['hits']) ? 1: -1; } }
//Then you need to call it with usort.
usort($ar_values,ar_sort);
At least I think this should work.
me
artwells.com
http://www.artwells.com/
That which indicates nothing
introduces everything.
attached mail follows:
Hi all,
I have a bunch of pages that I'm password protecting. Security doesn't need to be great, so my scheme is for each page to check for a "isUserLoggedIn" cookie. If the cookie is there, the page continues normally. If it's not there, it does a redirect to my login form page (login.php3). Also, when a page redirects to the login form it passes its own URL (using $PATH_INFO) to the login.php3 in the querystring. Then, the form passes the URL to the to the form's backend script (loginAction.php3) in a hidden variable. Finally, loginAction.php3, after seting the cookie on a successful login, redirects to that URL it was passed, which is the page the user tried to go to in the first place.so you end up at the page you wanted go to in the first place (instead of some generic "Welcome!" screen).
There's one problem: when loginAction.php3 sets the cookie, and redirects to the desired URL, it looks like the cookie isn't quite set yet, because I get the login screen again! If I log in a second time doing exactly the same thing, everything's fine.
My guessy diagnosis is this: because cookies are defined on the browser, the server only hears about them from the browser. So the flow is like this:
Browser Server ------- ------ Try and go to a page Check to see if the login cookie exists (let's assume it doesn't) Redirect to the login form (passing it the page theuser tried to go to)
Submit login form Check password (let's assume it's okay) Set the cookie Redirect to the page the user tried to go to in the first place
NOW - on the final redirect, the desired page is loaded by a request from the server, not the browser. That may not be 100% technically accurate, but my point is when the server processes the page it's been redirected to, it's not going to see the cookie since the request didn't come from the browser. So it will fail the "is logged in" test and put up the login form again. When the user submits THIS form, it sends the cookie over, so all is well.
I figured most of this out as I wrote it just now. So my questions are 1) am I right, and 2) are there well known workarounds, blah blah blah.
Thanks, Chris
attached mail follows:
Thank you to everybody for your answers :-)
attached mail follows:
I thought they had bounced.
attached mail follows:
Hi, how can I pass an array to another page??
I am using php4..
thank's
attached mail follows:
I don't use php4 yet, but in php3 using forms you can pass an array by naming the input in question with brackets after the name (eg. name[]). example <form action=wherever method=post> <select name=array[] multiple> <option>one <option>two <option>three </select> </form>
Whatever the user selects will be passed as an array. I haven't tried it but I bet <input type=hidden name=array[] value=$array> would work too.
-----Original Message-----
From: Victor Simon Lee [mailto:victor
inf.ufsc.br]
Sent: Tuesday, March 14, 2000 10:55 AM
To: php3
lists.php.net
Subject: [PHP3] passing an array
Hi, how can I pass an array to another page??
I am using php4..
thank's
-- PHP 3 Mailing List <http://www.php.net/> To unsubscribe, send an empty message to php3-unsubscribelists.php.net To subscribe to the digest, e-mail: php3-digest-subscribe
lists.php.net To search the mailing list archive, go to: http://www.php.net/mailsearch.php3 To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
does anyone has a working snmp example? mine isnt working...
<? echo "<pre>SNMP-TEST\n"; $bla=snmpwalk("193.73.xxx.xxx","public",""); for ($i;$i<count($a);$i++) { echo $a[$i]; echo "<br>"; }
?>
attached mail follows:
I'm not sure about snmp but in your example you set $bla and then look at $a and $i is not initialized
<? echo "<pre>SNMP-TEST\n"; $bla=snmpwalk("193.73.xxx.xxx","public",""); for ($i=0;$i<count($bla);$i++) { echo $bla[$i]; echo "<br>"; }
?>
Rossi Designs
(904) 226-8979
P.O. Box 1084, Holly Hill, Florida 32125-1084
http://rossidesigns.net
----- Original Message -----
From: Steven Glogger <list
glogger.ch>
To: <php3
lists.php.net>
Sent: Tuesday, March 14, 2000 1:54 PM
Subject: [PHP3] snmp
| does anyone has a working snmp example?
| mine isnt working...
|
| <?
| echo "<pre>SNMP-TEST\n";
| $bla=snmpwalk("193.73.xxx.xxx","public","");
| for ($i;$i<count($a);$i++) {
| echo $a[$i];
| echo "<br>";
| }
|
| ?>
|
| --
| PHP 3 Mailing List <http://www.php.net/>
| To unsubscribe, send an empty message to php3-unsubscribe
lists.php.net
| To subscribe to the digest, e-mail: php3-digest-subscribe
lists.php.net
| To search the mailing list archive, go to:
http://www.php.net/mailsearch.php3
| To contact the list administrators, e-mail: php-list-admin
lists.php.net
|
|
attached mail follows:
My ISP seems to have dropped the ball on their config, so I'm trying to fix it in .htaccess
php works fine from the command line, but I get a 404 from the browser.
here's what .htaccess looks like: AddHandler application/x-httpd-php3 .php3 Action application/x-httpd-php3 /home/www/cgi-bin/php
AllowOverride is set to 'All' anyone have any ideas?
thanks, - Mark
attached mail follows:
On 13 Mar 2000 16:57:32 -0800, Grant.Walters
walters.co.nz ("Grant
Walters") wrote:
>Hi, > >Have an installation with apache 1.3.12/mod_perl/mod_php/mod_ssl. > >I was wondering how to server all pages through php as this seems to return >standard HTML files etc.. in tact.
Not sure quite what u mean? Something like this?
Server Root | |----- PHP Script Libraries | | | |----- *.php3 | |----- Document Root | | | |----- .htaccess + sets include path to Libraries directory above | | + sets prepend file | | + sets ErrorDocument 404 /index.php3 | | | |----- index.php3 (simply contains one include function on a file name contained in | | a variable set by the prepend script) | |
The directives in .htaccess can be alternatively placed in httpd.conf or whatever. The prepend file parses the request URI and decides what content to deliver. If a request is recognised, we set a 200 header and send the appropriate content and if not we set a 404 header and send a nice page with an error message.
In this scheme it is also necessary to have "index.php3" included in a DirectoryIndex directive somewhere (srm.conf?).
Is that the sort of scheme u had in mind?
Warren
> >There must be some trickery in the httpd.conf file to do this? > >Regards >GRANT WALTERS >Walters & Associates, P O Box 13-043, Johnsonville, WELLINGTON, New Zealand >Telephone: 025488265 Cellular, Fax/Voice: +64(0)4-4765175
attached mail follows:
Use the urlencode() function before you pass it, and urldecode() after you receive it. Check the documenation on these functions for more info http://www.php.net/manual/function.urlencode.php3 http://www.php.net/manual/function.urldecode.php3
----- Original Message -----
From: James Bowen <jsbowen
2crew.com>
Newsgroups: php3.general
Sent: Thursday, March 09, 2000 4:52 PM
Subject: [PHP3] escape charactor help
> I am passing the string 'Test#1' from one php3 page to another php3
> page. Somewhare along the way, PHP drops off the '#1'. what escape
> charactors are necessary for me to avoid this?
>
> Test'#'1
> Test/#1
>
> none of these above work, and i don't know php well enough to know what
> charactors i need to use to ensure that the # stays in the string.
>
> Thanks,
>
> James
>
>
> --
> PHP 3 Mailing List <http://www.php.net/>
> To unsubscribe, send an empty message to php3-unsubscribe
lists.php.net
> To subscribe to the digest, e-mail: php3-digest-subscribe
lists.php.net
> To search the mailing list archive, go to:
http://www.php.net/mailsearch.php3
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
attached mail follows:
I am writing to let whom ever it conserns that the NNTP gateway is not working anymore.
Thanks You.
attached mail follows:
Hello,
I am looking to a way to search using ldap url. The reason is that some attribute values contain url's.
Like the attribute memberurl, it is a group attribute to contain a URL to all the users in that group.
memberurl: ldap:///o=mycompany??sub?(&(objectclass=inetorgperson)(ou=Department))
So I would be able to grab the memberurl: value, then find all the people for that group.
Is this possible in PHP?
Martin
attached mail follows:
In message <200003131815.AA1698562272
webpipe.net>, Jason Cox
<jasonc
webpipe.net> writes
>Has anyone had any issues with using phpMyAdmin and php4? I upgraded to php4
>and it quit working.
Same problem here :-(
I'm running NT4 SP5 with Apache 1.39 and PHP Version 4.0b4pl1 and MySQL 3.22.30-shareware and phpMyAdmin 2.05 doesn't now work in IE5, or IE4. I can load the page left.php3?server=1 on it's own but
<frame src="left.php3?server=1" name="nav">
from the framset displays nothing. I don't even get an 'unable to load page' message from IE5.
phpMyAdmin DOES work (sort of) when accessed by a WFWG 3.11 machine using IE3, and it DOES work when accessed by a WebTV emulator from the NT machine, and it does work via Lynx on the NT machine.
Also it doesn't seem to work in any version of NN from either the NT machine or the WFWG one.
> Just wondering if anyone else has had any problems and if >anyone has a possible solution. >
Each page produced by PHP4 has
X-Powered-By: PHP/4.0b4pl1 Content-Type: text/html
before the <HTML> tag. If I save the source of the index.php3 page as index.html and then edit it to remove the lines before the <HTML> tag then the two frames load OK, but of course the include doesn't happen.
Think I saw another Email on the list (or might have been a bug report) that mentioned the X-Powered-By: PHP/4.0b4pl1 Content-Type: text/html bit on every page but the solution given seemed to be altering the http headers that Apache sends but as Apache was fine with PHP3 I think the problem lies with PHP4. Maybe the next beta will sort it.
Dave
PS this is my first posting to a list so hopefully I haven't made any breaches of netiquette.
-- d a v e g u e r i n http://www.guerin.demon.co.uk/ mailto:daveguerin.demon.co.uk http://www.monitorcity.co.uk/ http://www.monitorengineer.co.uk/
attached mail follows:
----- Original Message -----
From: "Dave Guerin" <dave
guerin.demon.co.uk>
To: <jasonc
webpipe.net>
Cc: <php3
lists.php.net>
Sent: Tuesday, March 14, 2000 8:31 PM
Subject: [PHP3] Re: phpMyAdmin and php4
> In message <200003131815.AA1698562272
webpipe.net>, Jason Cox
> <jasonc
webpipe.net> writes
> >Has anyone had any issues with using phpMyAdmin and php4? I upgraded to
php4
> >and it quit working.
>
> Same problem here :-(
>
> I'm running NT4 SP5 with Apache 1.39 and PHP Version 4.0b4pl1 and MySQL
> 3.22.30-shareware and phpMyAdmin 2.05 doesn't now work in IE5, or IE4. I
> can load the page left.php3?server=1 on it's own but
>
> <frame src="left.php3?server=1" name="nav">
>
> from the framset displays nothing. I don't even get an 'unable to load
> page' message from IE5.
>
> phpMyAdmin DOES work (sort of) when accessed by a WFWG 3.11 machine
> using IE3, and it DOES work when accessed by a WebTV emulator from the
> NT machine, and it does work via Lynx on the NT machine.
>
> Also it doesn't seem to work in any version of NN from either the NT
> machine or the WFWG one.
>
> > Just wondering if anyone else has had any problems and if
> >anyone has a possible solution.
> >
>
>
> Each page produced by PHP4 has
>
> X-Powered-By: PHP/4.0b4pl1
> Content-Type: text/html
>
>
> before the <HTML> tag. If I save the source of the index.php3 page as
> index.html and then edit it to remove the lines before the <HTML> tag
> then the two frames load OK, but of course the include doesn't happen.
>
> Think I saw another Email on the list (or might have been a bug report)
> that mentioned the X-Powered-By: PHP/4.0b4pl1 Content-Type: text/html
> bit on every page but the solution given seemed to be altering the http
> headers that Apache sends but as Apache was fine with PHP3 I think the
> problem lies with PHP4. Maybe the next beta will sort it.
Maybe u could add this line in your php.ini file
expose_php = On
it will stop PHP from exposing that it is used to generate the pages, and maybe it will prevent this error too..... Haven't tested it thou.... Not using PHP4 myself..... Just a theory. :)
Jerry
attached mail follows:
In message <014501bf8df3$8980c430$0201a8c0
ping>, Jerry
<php_list
lucard.to> writes
<snipped a load of stuff about phpMyAdmin and PHP4>
>> Each page produced by PHP4 has >> >> X-Powered-By: PHP/4.0b4pl1 >> Content-Type: text/html >> >> >> before the <HTML> tag. If I save the source of the index.php3 page as >> index.html and then edit it to remove the lines before the <HTML> tag >> then the two frames load OK, but of course the include doesn't happen. >> >> Think I saw another Email on the list (or might have been a bug report) >> that mentioned the X-Powered-By: PHP/4.0b4pl1 Content-Type: text/html >> bit on every page but the solution given seemed to be altering the http >> headers that Apache sends but as Apache was fine with PHP3 I think the >> problem lies with PHP4. Maybe the next beta will sort it. > >Maybe u could add this line in your php.ini file > >expose_php = On
Thanks for the suggestion but I'd already tried both options of expose_php
With expose_php = On I get
X-Powered-By: PHP/4.0b4pl1 Content-Type: text/html
<HTML> and then the rest of the page
and with expose_php = Off I get
Content-Type: text/html
<HTML> and then the rest of the page
In both cases there are two line breaks after the text/html bit, before the <HTML> tag. The <HTML> tag is the very first line of the .php file.
> >it will stop PHP from exposing that it is used to generate the pages, and >maybe it will prevent this error too..... >Haven't tested it thou.... Not using PHP4 myself..... Just a theory. :)
Maybe I'll have to revert back to PHP3, it's just my hosting provider is using PHP4 on their web server and I don't want to do a load of coding and then find it don't work when I upload it to the web.
Thanks again,
Dave
-- d a v e g u e r i n http://www.guerin.demon.co.uk/ mailto:daveguerin.demon.co.uk http://www.monitorcity.co.uk/ http://www.monitorengineer.co.uk/
attached mail follows:
You have a mis-configuration of some sort. CGI scripts *have* to spew out a Content-type line. The fact that yours is showing up in the content of your page means you misconfigured your web server and it is running the php cgi in a strange manner. You could of course run php -q to turn off the content-type, but the real fix is to fix your web server config.
On Tue, 14 Mar 2000, Dave Guerin wrote:
> In message <014501bf8df3$8980c430$0201a8c0
ping>, Jerry
> <php_list
lucard.to> writes
>
> <snipped a load of stuff about phpMyAdmin and PHP4>
>
> >> Each page produced by PHP4 has
> >>
> >> X-Powered-By: PHP/4.0b4pl1
> >> Content-Type: text/html
> >>
> >>
> >> before the <HTML> tag. If I save the source of the index.php3 page as
> >> index.html and then edit it to remove the lines before the <HTML> tag
> >> then the two frames load OK, but of course the include doesn't happen.
> >>
> >> Think I saw another Email on the list (or might have been a bug report)
> >> that mentioned the X-Powered-By: PHP/4.0b4pl1 Content-Type: text/html
> >> bit on every page but the solution given seemed to be altering the http
> >> headers that Apache sends but as Apache was fine with PHP3 I think the
> >> problem lies with PHP4. Maybe the next beta will sort it.
> >
> >Maybe u could add this line in your php.ini file
> >
> >expose_php = On
>
> Thanks for the suggestion but I'd already tried both options of
> expose_php
>
> With expose_php = On I get
>
> X-Powered-By: PHP/4.0b4pl1
> Content-Type: text/html
>
> <HTML> and then the rest of the page
>
>
> and with expose_php = Off I get
>
> Content-Type: text/html
>
> <HTML> and then the rest of the page
>
> In both cases there are two line breaks after the text/html bit, before
> the <HTML> tag. The <HTML> tag is the very first line of the .php file.
>
> >
> >it will stop PHP from exposing that it is used to generate the pages, and
> >maybe it will prevent this error too.....
> >Haven't tested it thou.... Not using PHP4 myself..... Just a theory. :)
>
> Maybe I'll have to revert back to PHP3, it's just my hosting provider is
> using PHP4 on their web server and I don't want to do a load of coding
> and then find it don't work when I upload it to the web.
>
> Thanks again,
>
> Dave
> --
> d a v e g u e r i n
> http://www.guerin.demon.co.uk/ mailto:dave
guerin.demon.co.uk
> http://www.monitorcity.co.uk/ http://www.monitorengineer.co.uk/
>
>
> --
> PHP 3 Mailing List <http://www.php.net/>
> To unsubscribe, send an empty message to php3-unsubscribe
lists.php.net
> To subscribe to the digest, e-mail: php3-digest-subscribe
lists.php.net
> To search the mailing list archive, go to: http://www.php.net/mailsearch.php3
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
attached mail follows:
In message <Pine.WNT.4.21.0003150821010.-469877
vaio.php.net>,
rasmus
php.net writes
>You have a mis-configuration of some sort. CGI scripts *have* to spew out
>a Content-type line. The fact that yours is showing up in the content of
>your page means you misconfigured your web server and it is running the
>php cgi in a strange manner. You could of course run php -q to turn off
>the content-type, but the real fix is to fix your web server config.
>
Ran php -q test.php from the command line and the Content-type line was missing. So I edited the Apache httpd.conf as follows
Action application/x-httpd-php "/php/php.exe -q"
But the test.php couldn't be displayed from the browser, so I edited the line back to
Action application/x-httpd-php "/php/php.exe"
And now it works! No Context-type line displayed in the browser. No idea why it works, as far as I can see the line in the httpd.conf is exactly the same as when the Context-type line was being displayed, but it does work now.
So my server configuration WAS incorrect.
Many thanks,
Dave
>On Tue, 14 Mar 2000, Dave Guerin wrote:
>
>> In message <014501bf8df3$8980c430$0201a8c0
ping>, Jerry
>> <php_list
lucard.to> writes
>>
>> <snipped a load of stuff about phpMyAdmin and PHP4>
>>
>> >> Each page produced by PHP4 has
>> >>
>> >> X-Powered-By: PHP/4.0b4pl1
>> >> Content-Type: text/html
>> >>
>> >>
>> >> before the <HTML> tag. If I save the source of the index.php3 page as
>> >> index.html and then edit it to remove the lines before the <HTML> tag
>> >> then the two frames load OK, but of course the include doesn't happen.
>> >>
>> >> Think I saw another Email on the list (or might have been a bug report)
>> >> that mentioned the X-Powered-By: PHP/4.0b4pl1 Content-Type: text/html
>> >> bit on every page but the solution given seemed to be altering the http
>> >> headers that Apache sends but as Apache was fine with PHP3 I think the
>> >> problem lies with PHP4. Maybe the next beta will sort it.
>> >
>> >Maybe u could add this line in your php.ini file
>> >
>> >expose_php = On
>>
>> Thanks for the suggestion but I'd already tried both options of
>> expose_php
>>
>> With expose_php = On I get
>>
>> X-Powered-By: PHP/4.0b4pl1
>> Content-Type: text/html
>>
>> <HTML> and then the rest of the page
>>
>>
>> and with expose_php = Off I get
>>
>> Content-Type: text/html
>>
>> <HTML> and then the rest of the page
>>
>> In both cases there are two line breaks after the text/html bit, before
>> the <HTML> tag. The <HTML> tag is the very first line of the .php file.
>>
>> >
>> >it will stop PHP from exposing that it is used to generate the pages, and
>> >maybe it will prevent this error too.....
>> >Haven't tested it thou.... Not using PHP4 myself..... Just a theory. :)
>>
>> Maybe I'll have to revert back to PHP3, it's just my hosting provider is
>> using PHP4 on their web server and I don't want to do a load of coding
>> and then find it don't work when I upload it to the web.
>>
>> Thanks again,
>>
-- d a v e g u e r i n http://www.guerin.demon.co.uk/ mailto:daveguerin.demon.co.uk http://www.monitorcity.co.uk/ http://www.monitorengineer.co.uk/
attached mail follows:
I just finished writing a program using GD with .gif creation. I then changed it to .png images by changing the header and imagegif() to imagepng() and everything worked great. Check your header and try it. If that doesn't work there must be something else wrong.
Jason
> -----Original Message-----
> From: Omer BARLAS [mailto:obarlas
barlas.com.tr]
> Sent: Tuesday, March 14, 2000 7:52 AM
> To: php3
lists.php.net
> Subject: [PHP3] GD Library, .GIF and .PNG
>
>
> I have a problem with the gd library of php v3.0.15 for win32. As
> much as I
> can get from the help files what I need to do is replace imagegif($image)
> with imagepng($image), but it does not work. Am I wrong at somewhere?
>
> --
> Omer BARLAS
> obarlas
barlas.com.tr
> obarlas
artemis.efes.net
> ICQ # : 4588951
>
>
>
> --
> PHP 3 Mailing List <http://www.php.net/>
> To unsubscribe, send an empty message to php3-unsubscribe
lists.php.net
> To subscribe to the digest, e-mail: php3-digest-subscribe
lists.php.net
> To search the mailing list archive, go to:
http://www.php.net/mailsearch.php3
To contact the list administrators, e-mail: php-list-admin
lists.php.net
_______________________________________________________ Site Design, Hosting, and E-Commerce at www.webpipe.net
attached mail follows:
Hi,
I don't think PNG is included in the Win32 GD yet. I might be wrong though...
Thomas.
At 12:46 14/03/00 -0700, you wrote:
>I just finished writing a program using GD with .gif creation. I then
>changed it to .png images by changing the header and imagegif() to
>imagepng() and everything worked great. Check your header and try it. If
>that doesn't work there must be something else wrong.
>
>Jason
>
> > -----Original Message-----
> > From: Omer BARLAS [mailto:obarlas
barlas.com.tr]
> > Sent: Tuesday, March 14, 2000 7:52 AM
> > To: php3
lists.php.net
> > Subject: [PHP3] GD Library, .GIF and .PNG
> >
> >
> > I have a problem with the gd library of php v3.0.15 for win32. As
> > much as I
> > can get from the help files what I need to do is replace imagegif($image)
> > with imagepng($image), but it does not work. Am I wrong at somewhere?
> >
> > --
> > Omer BARLAS
> > obarlas
barlas.com.tr
> > obarlas
artemis.efes.net
> > ICQ # : 4588951
> >
> >
> >
> > --
> > PHP 3 Mailing List <http://www.php.net/>
> > To unsubscribe, send an empty message to php3-unsubscribe
lists.php.net
> > To subscribe to the digest, e-mail: php3-digest-subscribe
lists.php.net
> > To search the mailing list archive, go to:
>http://www.php.net/mailsearch.php3
>To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
>
>_______________________________________________________
>Site Design, Hosting, and E-Commerce at www.webpipe.net
>
>--
>PHP 3 Mailing List <http://www.php.net/>
>To unsubscribe, send an empty message to php3-unsubscribe
lists.php.net
>To subscribe to the digest, e-mail: php3-digest-subscribe
lists.php.net
>To search the mailing list archive, go to: http://www.php.net/mailsearch.php3
>To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
Hello,
Using php3.0.11, client browser IE5. As usual, I inserted my require function in the beginning, and just after (before everything else in my page), I make a "setcookie", I got an error coz the cookies was sent too late. I remove the require and insert the files directly in my page and everything works good. Have I missed something when I say "require" dont send anything to the client ? or something else ?
TIA
Pierre-Alain Joye
attached mail follows:
Pierre-Alain Joye writes: > Hello, > > Using php3.0.11, client browser IE5. > As usual, I inserted my require function in the beginning, and just after > (before everything else in my page), I make a "setcookie", I got an error > coz the cookies was sent too late. I remove the require and insert the files > directly in my page and everything works good. Have I missed something when > I say "require" dont send anything to the client ? or something else ? > > TIA > > Pierre-Alain Joye
Check the beginning and ending of the require()d file to ensure that there are no blank lines before or after the <?php and ?>. Also check the rest of the file to make sure nothing is being printed out. For instance, if the original file is something like:
===main.html==================================== <?php require( "file.inc" ); setcookie( . . . ); . . .etc. . . ?> ================================================
And the required file is: ===file.inc===================================== <--- Blank line here could screw it up. <?php /* This is the require()d file */ $something = "somevalue"; /* do whatever, as long as it doesn't output anything */ ?> <--- Blank line here could mess it up too. ================================================
In theory, output before the setcookie() is the only thing that would cause the error you're finding.
Cheers,
Torben
-- +----------------------------------------------------------------+ |Torben Wilson <torbenphp.net> Netmill iTech| |http://www.coastnet.com/~torben http://www.netmill.fi| |Ph: 1 250 383-9735 torben
netmill.fi| +----------------------------------------------------------------+
attached mail follows:
Hello,
It works. Gasp, sometimes something invisible makes everything wrong ;-) Thanks a lot.
Pierre-Alain
attached mail follows:
Hello,
Using php3.0.11, client browser IE5. As usual, I inserted my require function in the beginning, and just after (before everything else in my page), I make a "setcookie", I got an error coz the cookies was sent too late. I remove the require and insert the files directly in my page and everything works good. Have I missed something when I say "require" dont send anything to the client ? or something else ?
TIA
Pierre-Alain Joye
attached mail follows:
Hi all, I have trouble with ftp_nlist function, seems like when this executes perfectly returns '1' instead of the supposedly an array of files. When try and print out the count of the array its still gives me count of 1. Help me.
Thanks ______________________________________________________ Get Your Private, Free Email at http://www.hotmail.com
attached mail follows:
> This is just a quick email to let you know that the > first Sydney PHP Users group meeting is on tommorrow > night (Wed,15 March) at 7pm. Here are all the details > you need to know. > > 308 Penshurst Road > Willoughby NSW > > We are above LiquorLand, next to the BP service station. > Enter near the bus stop. > > If you know all about PHP then we'd love to see you > there, if you know nothing about it, come along and > learn :)
I am going to try to get there tonight for this meeting.
-Rasmus
attached mail follows:
Hi I am new to PHP. Just installed PHP4beta4Level1, mysql3.22 and Apache1.39.12 on a Windows98 box at home - all from binaries And it works GREAT: kudos to all of you for ironing the install problems out on Windows. There is one small thing though:
the browser keeps displaying a message - "Content-Type: text/html" followed by the usual expected html content. Don't seem to be able to get rid of the "Content-Type: text/html" Any of your comments will be greatly appreciated.
[I have gone through the php.ini, then Apache's httpd.conf, looked through FAQ, and the online php.net e-mail archives, but am still missing something obvious?].
Tried this first: <html>
<?php echo ("So here comes my text"); ?>
</html>
The browser displays: Content-Type: text/html So here comes my text
attached mail follows:
Hi Ya'll,
I am currently doing some things as root with a PHP CGI running as root. I know, I know, pretty good security issue.
(BTW, I would love to get some input on holes I should plug with that, but I have beat it up pretty good and haven't been able to compromise security myself, know how the scripts work and all of the variable names)
My question:
Is there a way to run one apache that has normal ownership, with PHP, AND run another apache that has PHP and runs as root? Or would it need to be on a different port? (I would prefer to avoid that) I would like to have one parse all .html files, and another parse all .htm files. Files that need to be run as root would have the .htm extension.
Thoughts? Suggestions? Warnings? Flames? :)
Thanks,
Brian Allen
brian
purenetfx.com
attached mail follows:
Of course,
Have two copys of your httpd.conf and fire up httpd with the command -f and point to an alternate httpd.conf file...
-Dave
: Hi Ya'll,
:
: I am currently doing some things as root with a PHP CGI running as root.
I
: know, I know, pretty good security issue.
:
: (BTW, I would love to get some input on holes I should plug with that, but
I
: have beat it up pretty good and haven't been able to compromise security
: myself, know how the scripts work and all of the variable names)
:
: My question:
:
: Is there a way to run one apache that has normal ownership, with PHP, AND
: run another apache that has PHP and runs as root? Or would it need to be
on
: a different port? (I would prefer to avoid that) I would like to have one
: parse all .html files, and another parse all .htm files. Files that need
to
: be run as root would have the .htm extension.
:
: Thoughts? Suggestions? Warnings? Flames? :)
:
: Thanks,
: Brian Allen
: brian
purenetfx.com
:
:
: --
: PHP 3 Mailing List <http://www.php.net/>
: To unsubscribe, send an empty message to php3-unsubscribe
lists.php.net
: To subscribe to the digest, e-mail: php3-digest-subscribe
lists.php.net
: To search the mailing list archive, go to:
http://www.php.net/mailsearch.php3
: To contact the list administrators, e-mail: php-list-admin
lists.php.net
:
:
attached mail follows:
But to answer one of the original questions, you do have to run them on different ports. If you have a firewall, you could probably configure it so that one external IP address maps to the daemon running on port 80, and another IP (port 80) maps to the 2nd daemon running on port 8000 (or whatever).
Alternatively, if you have 2 separate network adapters on the machine with 2 separate IPs, you could bind one Apache to one IP, and the other Apache to the other IP (using port 80 for both).
I suppose you could force the scripts to be handled by one or the other server by having it do a redirect for all of the scripts that that particular server doesn't handle.
My gut feeling though is that you're better off figuring out a better way to do what you're trying to do. Consider that once you have an Apache daemon running as root, you're exposed to security issues. Limiting what files get processed by this server probably won't improve the security issues by much if at all, and it just complicates the overall site configuration.
Brian
> -----Original Message-----
> From: Dave [mailto:dave
calinet.com]
> Sent: Tuesday, March 14, 2000 2:11 PM
> To: Brian T. Allen; php3
lists.php.net
> Subject: Re: [PHP3] Running 2 Apache's / 2 PHP's (1 as root)
>
>
> Of course,
>
> Have two copys of your httpd.conf and fire up httpd with the
> command -f and
> point to an alternate httpd.conf file...
>
> -Dave
>
>
>
>
> : Hi Ya'll,
> :
> : I am currently doing some things as root with a PHP CGI running as root.
> I
> : know, I know, pretty good security issue.
> :
> : (BTW, I would love to get some input on holes I should plug
> with that, but
> I
> : have beat it up pretty good and haven't been able to compromise security
> : myself, know how the scripts work and all of the variable names)
> :
> : My question:
> :
> : Is there a way to run one apache that has normal ownership,
> with PHP, AND
> : run another apache that has PHP and runs as root? Or would it
> need to be
> on
> : a different port? (I would prefer to avoid that) I would like
> to have one
> : parse all .html files, and another parse all .htm files. Files
> that need
> to
> : be run as root would have the .htm extension.
> :
> : Thoughts? Suggestions? Warnings? Flames? :)
> :
> : Thanks,
> : Brian Allen
> : brian
purenetfx.com
> :
> :
> : --
> : PHP 3 Mailing List <http://www.php.net/>
> : To unsubscribe, send an empty message to php3-unsubscribe
lists.php.net
> : To subscribe to the digest, e-mail: php3-digest-subscribe
lists.php.net
> : To search the mailing list archive, go to:
> http://www.php.net/mailsearch.php3
> : To contact the list administrators, e-mail: php-list-admin
lists.php.net
> :
> :
>
>
> --
> PHP 3 Mailing List <http://www.php.net/>
> To unsubscribe, send an empty message to php3-unsubscribe
lists.php.net
> To subscribe to the digest, e-mail: php3-digest-subscribe
lists.php.net
> To search the mailing list archive, go to:
http://www.php.net/mailsearch.php3
To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
I am having a problem. When I send my form through w/ an attachment of a text file or word document. It copies the file but hangs and does'nt do anything. But if I send a pdf file it works with no problem. If anyone can help me I would greatly appreciate it.
Thanks in advance, Edgar
<?
set_time_limit(0);
$attfile = stripslashes($attfile);
if (!copy($attfile, $attfile_name)) {
print("failed to copy $attfile...<br>\n");
}
echo($attfile);
/*
* Class mime_mail
* Original implementation by Sascha Schumann <sascha
schumann.cx>
* Modified by Tobias Ratschiller <tobias
dnet.it>:
* - General code clean-up
* - separate body- and from-property
* - killed some mostly un-necessary stuff
*/
class mime_mail { var $parts; var $to; var $from; var $headers; var $subject; var $body;
/* * void mime_mail() * class constructor */ function mime_mail() { $this->parts = array(); $this->to = ""; $this->from = ""; $this->subject = ""; $this->body = ""; $this->headers = ""; }
/* * void add_attachment(string message, [string name], [string ctype]) * Add an attachment to the mail object */ function add_attachment($message, $name = "", $ctype = "application/octet-stream") { $this->parts[] = array ( "ctype" => $ctype, "message" => $message, "encode" => $encode, "name" => $name ); }
/* * void build_message(array part= * Build message parts of an multipart mail */ function build_message($part) { $message = $part["message"]; $message = chunk_split(base64_encode($message)); $encoding = "base64"; return "Content-Type: ".$part["ctype"]. ($part["name"]?"; name = \"".$part["name"]."\"" : ""). "\nContent-Transfer-Encoding: $encoding\n\n$message\n"; }
/* * void build_multipart() * Build a multipart mail */ function build_multipart() { $boundary = "b".md5(uniqid(time())); $multipart = "Content-Type: multipart/mixed; boundary = $boundary\n\nThis is a MIME encoded message.\n\n--$boundary";
for($i = sizeof($this->parts)-1; $i >= 0; $i--) { $multipart .= "\n".$this->build_message($this->parts[$i])."--$boundary"; } return $multipart.= "--\n"; }
/* * void send() * Send the mail (last class-function to be called) */ function send() { $mime = ""; if (!empty($this->from)) $mime .= "From: ".$this->from."\n"; if (!empty($this->headers)) $mime .= $this->headers."\n";
if (!empty($this->body)) $this->add_attachment($this->body, "", "text/plain"); $mime .= "MIME-Version: 1.0\n".$this->build_multipart(); mail($this->to, $this->subject, "", $mime); } }; // end of class
/* * Example usage * */
$attachment = fread(fopen("$attfile_name", "r"), filesize("$attfile_name"));
$mail = new mime_mail();
$mail->from = "edgar
webt.com";
$mail->headers = "Errors-To: edgar
webt.com";
$mail->to = "edgar
webt.com";
$mail->subject = "Testing...";
$mail->body = "This is just a test.";
$mail->add_attachment("$attachment", "$attfile_name", "$attfile_type");
$mail->send();
if (!unlink($attfile_name)) { print("Could not delete file!!"); }
print("File On Server: $thefile<br>"); print("Temp Name: $attfile<br>"); print("File Size: $attfile_size<br>"); print("File Name: $attfile_name<br>"); print("File Type: $attfile_type<br>"); ?>
attached mail follows:
I am trying to run an application that was running successfully with php3, under php4. I re-installed the apache_1.3.6 web server, and used your instructions to configure/install php4. Using the phpinfo() function tells me that the apache web server and php4 engine were successfully installed and are running.
My application fails (actually never returns, I fear) from the OCILOGON function. the tnsnames.ora has the service name I pass here -- the tnsping returns from the server.
What could be the problem. I have come to a dead end, please help.
Manish Mandelia Senior Systems Engineer Naviant
email: mmandelia
naviant.com
attached mail follows:
On Tue, 14 Mar 2000, you wrote: > I am trying to run an application that was running successfully with php3, > under php4. > I re-installed the apache_1.3.6 web server, and used your instructions to > configure/install php4. > Using the phpinfo() function tells me that the apache web server and php4 > engine were successfully installed and are running. >
Check phpinfo() again and make sure that it contains someting like:
Oracle-OCI8
Oracle version: Compile-time ORACLE_HOME: Libraries used:
> My application fails (actually never returns, I fear) from the OCILOGON > function.
try:
putenv("ORACLE_SID=PROD");
putenv("ORACLE_HOME=/usr/local/oracle/8i/u01/app/oracle/product/8.1.5");
// or whatever your $ORACLE_HOME is
$conn =
OCILogon($user_id,$password,$remote_db) or die
(OCIError($conn));
That should give a little bit more info as to why a connection failed.
> the tnsnames.ora has the service name I pass here -- the tnsping returns > from the server.
Can the box with php4 / webserver make a connection to the Oracle database server using sqlplus? If it can't then your problem is in your sqlnet.ora or tnsnames.ora files.
> What could be the problem. I have come to a dead end, please
help. >
> Manish Mandelia
> Senior Systems Engineer
> Naviant
>
> email: mmandelia
naviant.com
>
Hope this helps - Dave
-- -------------------------------------------------- David Nagel - University of Regina Students' Union Director of Communications & Information Services Regina, Sk., Canada, S4S-0A2, (306) - 586 - 8811 --------------------------------------------------
attached mail follows:
I would have loved to come, but I will be unable to make it. Sorry all. Maybe next time. Damn, and I love php, it is such funky code.
Cheers Michael
Quoting rasmus
php.net:
> > This is just a quick email to let you know that the
> > first Sydney PHP Users group meeting is on tommorrow
> > night (Wed,15 March) at 7pm. Here are all the details
> > you need to know.
> >
> > 308 Penshurst Road
> > Willoughby NSW
> >
> > We are above LiquorLand, next to the BP service station.
> > Enter near the bus stop.
> >
> > If you know all about PHP then we'd love to see you
> > there, if you know nothing about it, come along and
> > learn :)
>
> I am going to try to get there tonight for this meeting.
>
> -Rasmus
>
> --
> SLUG - Sydney Linux Users Group Mailing List - http://www.slug.org.au
> To unsubscribe send email to slug-request
slug.org.au with
> unsubscribe in the text
>
attached mail follows:
Hello,
just being curious :) , which are the security implications of doing this? (read below):
> On Mon, 13 Mar 2000, Basil Hussain wrote: > I can't really see what could be different between running it as myself and > as 'nobody' - I think I've covered all the bases. I'd made a copy of my own > .pgp directory and placed it in /home/httpd/pgp (this is what PGPPATH is set > to). I've chown-ed all the files within to 'nobody' so that they can be > read. Also, and this is strange, every time I run it unsuccessfully a blank > file gets created in the same directory as my PHP script with a name like > pgptemp.$xx (where xx is a number that increments per attempt).
attached mail follows:
Is it possible using PHP to resize an image?
What I have currently is a program where you can upload images into a database, but I'd like all the images to be the same size.
Tnx in advance
attached mail follows:
> Is it possible using PHP to resize an image? > > What I have currently is a program where you can upload images into a database, but I'd like all the images to be the same size.
I use pnmscale through a system call for that.
-Rasmus
attached mail follows:
Jason,
Rasmus says 'pnmscale', and he's the man. But, I had never heard of it before (even though 'which' determined it was on my system, in /usr/bin). So, just in case you can't use it, you might try 'convert', which comes with some X11 stuff (so I'm assuming you'll have to get it off a machine with X). Mines in /usr/X11R6/bin. Here's a little code on how I used it:
$file = "/some/path/to/write/file/to.jpg"; $URL = "http://www.website.com/some/image.jpg";
exec("lynx -source $URL > $file"); // trying to get it via php would give // me an invalid image... don't know // why, something I did wrong, but this // was easier, anyway, and the script // isn't used very often
$size = GetImageSize("$file"); if($size[1] > 200) { // $size[1] is the y (vertical) $newy = 200; $ratio = ( 1 - ( ( $size[1] - 200 ) / $size[1] ) ); // keep the perspective $newx = round( $size[0] * $ratio );
$convert = "/usr/X11/bin/convert -quality 50 -geometry $newx" . "X$newy $file $newfile"; exec($convert); }
You might want to change the quality from 50. There are literal dozens of options (blur, flip, etc).
Hope that helps,
Hans
On Tue, 14 Mar 2000, Jason G. wrote:
> Is it possible using PHP to resize an image? > > What I have currently is a program where you can upload images into a database, but I'd like all the images to be the same size. > > Tnx in advance > >
Hans Anderson ~ me
hansanderson.com
PO Box 426, Missoula, MT 59806 | PHP, Search Engines,
(800)397-9116 / (406)549-6524 | SQL databases. Al Gore
http://www.hansanderson.com | lied. *I* invented the
http://www.goofiness.com | Internet. And breathing.
attached mail follows:
On Tue, Mar 14, 2000 at 04:37:22PM -0700, Hans H. Anderson wrote:
> Rasmus says 'pnmscale', and he's the man. But, I had never heard of it > before (even though 'which' determined it was on my system, in /usr/bin). > So, just in case you can't use it, you might try 'convert', which comes > with some X11 stuff (so I'm assuming you'll have to get it off a machine > with X). Mines in /usr/X11R6/bin. Here's a little code on how I used it:
For those that don't have 'convert' on their system, it comes as part of the ImageMagick suite of tools. http://www.imagemagick.org/
Cheers
Paul Haddon Technical Services Manager Hartingdale Internet
attached mail follows:
> 1. they each have their own login system > 2. they each have their own session management > 3. some use specific DB backend and don't allow users definable > table/column names for DB > 4. php doesn't have a Class hiarchy repository like Perl > 5. there is no standard naming conventions for php classes or include > function files
PEAR addresses 2-5.
-Rasmus
attached mail follows:
Yellow or Green Pear? j/k. What/Where is PEAR?
At 07:06 AM 3/14/00 -0800, Rasmus Lerdorf wrote: > > 1. they each have their own login system > > 2. they each have their own session management > > 3. some use specific DB backend and don't allow users definable > > table/column names for DB > > 4. php doesn't have a Class hiarchy repository like Perl > > 5. there is no standard naming conventions for php classes or > include > > function files > >PEAR addresses 2-5. > >-Rasmus
attached mail follows:
> Yellow or Green Pear? j/k. What/Where is PEAR?
It is a new centralized package system being introduced along with PHP 4.
-Rasmus
attached mail follows:
oh wow! perfect!!!!!! maybe i should dl PHP4 and check it out. thanks!
At 07:40 AM 3/14/00 -0800, Rasmus Lerdorf wrote: > > Yellow or Green Pear? j/k. What/Where is PEAR? > >It is a new centralized package system being introduced along with PHP 4. > >-Rasmus
attached mail follows:
Hello,
On 14-Mar-00 14:42:54, you wrote:
>Some of the problem I've faced with in integrating various PHP applications >out there are: > 1. they each have their own login system
This is not public yet, but it has been a while since I started working on a general purpose login/subscription API precisely for application integration. It features user management, user group management, arbitrary resource access permissions management, etc..
I've been working on this on my own, but I have had plenty of requests from other PHP users willing to use a similar system as I have in this site, except that what I am doing now is much more advanced and complete.
http://phpclasses.UpperDesign.com/browse.html?login=1
> 2. they each have their own session management
The session management in the system I have developed allows for the usual login/logout procedures. It won't be as powerful that the support that comes with PHP 4 but it will work under PHP 3 which maybe important if you can't control which PHP version is available on the server.
> 3. some use specific DB backend and don't allow users definable >table/column names for DB
I use a powerful database abstraction layer named Metabase that not only completely abastracts the access but also is able to install database schemas (tables, fields, indexes and sequences) from independent schema description files defined in dedicated XML format.
In a upcoming release Metabase will feature something that is important to minimize table name collision and table definition reuse. It will let you define table bases from which you may define your database tables. Tables bases are sets of fields and index definitions.
You may tell in your database schema definition that you want to define a table based on one or more given table bases. You may specify additional prefixes that are added to the table base field names for the based tables you want to create. Your table may have other table fields defined by yourself besides the fields that were defined in the table bases that were used.
This provides a sort of multiple inheritance for table definitions while it lets you avoid potential name collisions between table base fields and your additional fields. This flexibility may be seen as a way of providing some object orientation features to relational database programming.
Look here for the currently available version of Metabase:
http://phpclasses.UpperDesign.com/browse.html/package/20
> 4. php doesn't have a Class hiarchy repository like Perl
That you know... look here:
http://phpclasses.UpperDesign.com/
> 5. there is no standard naming conventions for php classes or include >function files
Yes, I use my own naming conventions and stay consistent, but everybody has their own.
>What I would like to see is a "Black Box" API for user login and session >management. That way, an application can use either PHPLIB, or what ever >custom login and session management the user may choose when installing the >application you code. Said "Black Box" provides for better code re-use, >ease integration of your application into an existing setup, and saves time >from having to rip your code apart just to customize it for the existing >setup.
Right.
>PHPLIB provides a good "Black Box" for DB back end access. I wished more >people would use it. You don't have to use the entire PHPLIB package, just
Not to take the deserved merits of PHPLIB, but one reason I would not rely on it to provide truely database independent access is that there seems to be no support for datatype consistency and this is bad for application portability.
Think for instance of date field representation. Each database vendor ships their DBMS with default date field representation format. If you try an application of yours based on PHPLIB and switch the database driver, chances are that when you need to process date fields it will break because you are not guaranteed that dates come out from the database with the same day, month, year order and field separation.
This is one of many sensitive issues that are handled transparently in Metabase. In the case, all dates come out in the ISO 9601 format (YYYY-MM-DD) and you may always rely on that.
>use the sql package. Making customizable table and column name is as easy >as assign a variable. Most web hosting company will give you one db space >to work with. There fore if you have multiple sites on that space, your >table names would have to be site1_table1, site1_table2, site2_table1, etc. >If two applications had the same table name, the user would have to go >through your codes and make changes to all your table names. This is time >consuming, even with search and replace ;-)
Right. This is one of the cases where the table bases of Metabase will come in handy.
>I've seen and do like berber's site with class and code snippet >respository. There are others like it. Seems like a duplication of efforts >to me. How about a decisive central location for php class and codes? If
Hey, guess what: that place exists for over 8 months ago in the address I pointed you above. It provides what you are suggesting and much more. It is very popular among those that know it (over 5.000 subscribers by now).
The issue of duplication of efforts have been repeatdly discussed and the conclusion is that there is little intention to merge stuff into only one repository because people don't seem to agree on how it should be provided. So, PHP core developers decided to start their own named PEAR. It is under development and it will be based on PHP 4.
>not on php.net then have one place we all go to. This makes searching much >easier. If not on php.net, have a visable link on php.net to direct the
Yes, putting a link in php.net to PHP Classes repository would be a good idea but so far there was no initiative to do so. I think it would be in the best interest of PHP community to have the link listed there as they for other sites. But it takes good will on the PHP core developers to do so.
>user to where they need to go. In addition, perhaps we should also have a >standard way to organize classes within the local system, like Perl. That >way, if the application requires a specific class, and the user doesn't >have it, php can go fetch it for them automatically and deposit into the >local filesystem.
Yes, I think there are plans for that in PEAR but I suppose it requires some PHP 4 features to have it done automatically.
>The PHP manual should define a naming convention for classes and function >include files. Do so would give us an easy way to look at a file and say, >that's a class, or that's an include file. Further more, it would make it >easier to organize the class repository with some kind of hiarchy.
Yes. I use similar conventions in my personal projects.
>My biggest concern right now is number one and two listed above. I would >like to hear your inputs regarding how to design and implement said "Black >Box" for login and session management.
If you mail me privately I may show you a sample of what is already implemented online.
Regards, Manuel Lemos
Web Programming Components using PHP Classes.
Look at: acm.org">http://phpclasses.UpperDesign.com/?user=mlemos
acm.org
-- E-mail: mlemosacm.org URL: http://www.mlemos.e-na.net/ PGP key: http://www.mlemos.e-na.net/ManuelLemos.pgp --
attached mail follows:
Hello my,
On 14-Mar-00 07:48:51, you wrote:
>Hey,
>Did you ever have to write a database independent project? If one >custumer wants mysql, other oracle, etc.?
>How would you do it? Would you put all database related sentences in >functions like that: (or do you have any better idea)?
The typical approach is based on drivers of polymorphic classes of objects that handle the access to each type of DBMS. So, instead of having functions with big switch/case constructs for the all supported DBMS, you would classes for each type of database that implement their own version of the database access functions you need.
Maybe you would like to try this package named Metabase that provides both DBMS independent access and management of databases. With it, besides developing database independent applications, you can easily install and maintain database schemas (tables, fields, indexes, sequences) using a custom based XML format to define your application database schemas.
http://phpclasses.UpperDesign.com/browse.html/package/20
Regards, Manuel Lemos
Web Programming Components using PHP Classes.
Look at: acm.org">http://phpclasses.UpperDesign.com/?user=mlemos
acm.org
-- E-mail: mlemosacm.org URL: http://www.mlemos.e-na.net/ PGP key: http://www.mlemos.e-na.net/ManuelLemos.pgp --
attached mail follows:
Matjaz,
In my experience use PHPLib or at least look at it. Its excelent. They impliment DB connections as a class that is quite nice. I used PHPLib on an earlier project, but since then we have rolled our own DB Abstraction layer and its really not that hard. The only limitation we found with PHPlib was the fact that you could only connect to one database system at a time (ie: per page), and we plan to use several (but it wasnt as big an issue as we thought becasue we still havent come acros that requirement).
mn
Mark Nold
markn
alverstone.com.au
Systems Consultant
>>> "kesl (my mailing lists)" <kesl-lists
softhome.net> 03/14 5:48 pm >>>
Hey,
Did you ever have to write a database independent project? If one custumer wants mysql, other oracle, etc.?
How would you do it? Would you put all database related sentences in functions like that: (or do you have any better idea)?
global dbtype
function opendatabase { case dbtype = "oracle" oracle.dbopen case dbtype = "mysql" mysql.dbopen }
function fetchrow { case dbtype = "oracle" x = oracle.fetchrow case dbtype = "mysql" x = mysql.fetchrow . return x }
Matjaz
attached mail follows:
Hello David,
On 14-Mar-00 07:23:12, you wrote:
>How I can send an e-mail with PHP using an external program like Qmail >under Windows NT ???
If you mean a remote SMTP server, you can configure its address in the php3.ini file. If you are having trouble with that, maybe you would like to try these classes of ready to use objects that let you send messages through any SMTP server using only PHP code.
http://phpclasses.UpperDesign.com/browse.html/package/14
http://phpclasses.UpperDesign.com/browse.html/package/9
Regards, Manuel Lemos
Web Programming Components using PHP Classes.
Look at: acm.org">http://phpclasses.UpperDesign.com/?user=mlemos
acm.org
-- E-mail: mlemosacm.org URL: http://www.mlemos.e-na.net/ PGP key: http://www.mlemos.e-na.net/ManuelLemos.pgp --
attached mail follows:
Greetings,
I need a smidge of help. My OS is FreeBSD 3.3, MySQL is version 3.22.27 (installed from the FreeBSD Packages collection), Apache is 1.3.12, PHP3 is 3.0.15 (both installed by hand from source).
What I want to do is have a bit of code that will create a new MySQL database, create an appropriate table, then fill the table with data.
Here's a bit of my code:
<?php mysql_connect("<my hostname>","root"); $stamp = date("U"); mysql_create_db("dc_".$stamp); $mydb = mysql_select_db("dc_".$stamp); $createresult = mysql_query("create table test (name char(20), fname char(20), id int)"); $inresult = mysql_query("insert into test (name,fname,id) values ('1000', 'March', 25)"); $outresult = mysql_query("select * from test"); echo mysql_result($outresult,0,'id'); mysql_close($mydb); ?>
The Database is created successfully. The TABLE is never created. I get NO warnings or errors on the line that SHOULD create the table. The only warning I get is on the echo command, because the $outresult contains no data.
I can run mysql from the command line and duplicate the create string to the letter and it works fine. Also, I have tested inserting into and selecting from existing tables with no problems whatsoever.
I have looked at my grant tables, and root
localhost as well as root
<my
hostname here> have CREATE privileges granted.
What's going on? Any help would again be greatly appreciated. :)
George Kearns
georgek
wtrt.net
attached mail follows:
Try:
echo mysql_error();
and see what you get. You can have an error in the SQL without having an error in the page, so you won't see any error in the page, but mysql_errror() will output it.
Hope that helps,
Brian
brian
purenetfx.com
> Greetings,
>
> I need a smidge of help. My OS is FreeBSD 3.3, MySQL is version 3.22.27
> (installed from the FreeBSD Packages collection), Apache is 1.3.12, PHP3
is
> 3.0.15 (both installed by hand from source).
>
> What I want to do is have a bit of code that will create a new MySQL
> database, create an appropriate table, then fill the table with data.
>
> Here's a bit of my code:
>
> <?php
> mysql_connect("<my hostname>","root");
> $stamp = date("U");
> mysql_create_db("dc_".$stamp);
> $mydb = mysql_select_db("dc_".$stamp);
> $createresult = mysql_query("create table test (name char(20), fname
> char(20), id int)");
> $inresult = mysql_query("insert into test (name,fname,id) values ('1000',
> 'March', 25)");
> $outresult = mysql_query("select * from test");
> echo mysql_result($outresult,0,'id');
> mysql_close($mydb);
> ?>
>
> The Database is created successfully. The TABLE is never created. I get NO
> warnings or errors on the line that SHOULD create the table. The only
> warning I get is on the echo command, because the $outresult contains no
data.
>
> I can run mysql from the command line and duplicate the create string to
> the letter and it works fine. Also, I have tested inserting into and
> selecting from existing tables with no problems whatsoever.
>
> I have looked at my grant tables, and root
localhost as well as root
<my
> hostname here> have CREATE privileges granted.
>
> What's going on? Any help would again be greatly appreciated. :)
>
> George Kearns
> georgek
wtrt.net
>
> --
> PHP 3 Mailing List <http://www.php.net/>
> To unsubscribe, send an empty message to php3-unsubscribe
lists.php.net
> To subscribe to the digest, e-mail: php3-digest-subscribe
lists.php.net
> To search the mailing list archive, go to:
http://www.php.net/mailsearch.php3
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
Hello all,
I found a strange thing on this script:
for($c = 'A'; $c <= 'Z'; $c++) echo "<b>$c</b><br>\n";
It will print the letters from 'A' to 'Z'(that is I want to do), but(!) also 'AA' to 'AZ, 'BA' to 'BZ and so on ending by 'ZZ';
If I change the for(;;) condition to $c < 'Z' the output is correct(without the letter 'Z', of course).
Can someone explain me this.
Thanks Vojtech Novacek
attached mail follows:
When my PHP does this:
exec("perl /usr/tmp/mc2294daa.pl &");
This appears in my process list:
nobody 23416 3.0 0.0 0 0 ? Z 17:24 0:00 (sh <zombie>) nobody 23417 3.0 1.7 1608 808 ? S 17:24 0:00 perl /usr/tmp/mc22994daa.pl
The zombie goes away, but the real problem is that php waits for the perl script to complete instead of pushing it into the background per the "&". Help????
_________________________ Keith Ford, ICQ#15705088 WebFire, 256.533.1895 x2468, www.webfire.com Micro Magic, 256.971.9711, www.MagicClicks.com
attached mail follows:
----- Original Message -----
From: "Armando" <info
ota-s.si>
To: <php3
lists.php.net>
Sent: Tuesday, March 14, 2000 4:56 PM
Subject: [PHP3] how to take a BLOB from the database
> I have a table in MYSQL that has a BLOB in it .. (a picture .. actualy
> picture of a flag)
> how can I take that picture out ??
>
> Armando
>
>
>
>
> --
> PHP 3 Mailing List <http://www.php.net/>
> To unsubscribe, send an empty message to php3-unsubscribe
lists.php.net
> To subscribe to the digest, e-mail: php3-digest-subscribe
lists.php.net
> To search the mailing list archive, go to:
http://www.php.net/mailsearch.php3
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
Currently I use php4 on some light projects for internal use only within my organization. If something goes wrong because of php or anything it is not a big problem. But is php4 ready for production use on websites that i only write the programs for and do not maintain? I guess what i am trying to ask is do you (the general population reading this list) use php4 or php3. Some of the features of 4 are nice and justify its use, but can i count on php4. I understand that it is beta, but does that mean anything these days when companies are releasing products before they are ready anyway. So far i have had only good experiences with php. Thanks for any help.
Marc Ray
marcray
visto.com
marc
holographic.com
______________________________________________________________________
Get Visto.com! Private groups, event calendars, email, and much more.
Visto.com. Life on the Dot.
Check it out
http://www.visto.com/info
attached mail follows:
Though some might say yes, I would certainly wait for a stable release. PHP4 *is* still beta.
- Mitch
----- Original Message -----
From: Marc Ryan Ray <marcray
visto.com>
To: <php3
lists.php.net>
Sent: Tuesday, March 14, 2000 6:43 PM
Subject: [PHP3] Is php4 ready for production use?
Currently I use php4 on some light projects for internal use only within my organization. If something goes wrong because of php or anything it is not a big problem. But is php4 ready for production use on websites that i only write the programs for and do not maintain? I guess what i am trying to ask is do you (the general population reading this list) use php4 or php3. Some of the features of 4 are nice and justify its use, but can i count on php4. I understand that it is beta, but does that mean anything these days when companies are releasing products before they are ready anyway. So far i have had only good experiences with php. Thanks for any help.
Marc Ray
marcray
visto.com
marc
holographic.com
______________________________________________________________________
Get Visto.com! Private groups, event calendars, email, and much more.
Visto.com. Life on the Dot.
Check it out
http://www.visto.com/info
-- PHP 3 Mailing List <http://www.php.net/> To unsubscribe, send an empty message to php3-unsubscribelists.php.net To subscribe to the digest, e-mail: php3-digest-subscribe
lists.php.net To search the mailing list archive, go to: http://www.php.net/mailsearch.php3 To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
Hello Marc,
On 14-Mar-00 21:43:15, you wrote:
>Currently I use php4 on some light projects for internal >use only within my organization. If something goes wrong >because of php or anything it is not a big problem. But is >php4 ready for production use on websites that i only write >the programs for and do not maintain? I guess what i am
The question should have been, are your PHP applications ready for PHP 4? The greatest problem is with incompatibilities. Some incompatibilities are listed but others aren't. One fact is certain is that those incompatibilities are meant to be and if you want to move to PHP 4, first make sure your PHP programs are not affected by the incompatibilities.
Another issue is the the current state of PHP 4 is beta. That means that there are incomplete features and bugs to be solved. I am not moving a production site to PHP 4 until it is officially released as not beta. Even then I will wait a while until some overlooked bugs are fixed.
>trying to ask is do you (the general population reading >this list) use php4 or php3. Some of the features of 4 are >nice and justify its use, but can i count on php4. I >understand that it is beta, but does that mean anything >these days when companies are releasing products before >they are ready anyway. So far i have had only good >experiences with php. Thanks for any help.
Right. Personally I wouldn't take the risk of the temptation to move to PHP 4 because I don't want to put up the pain to downgrade because of some bugs that I was not aware that were there. Some people give on the temptation to move, but it's their risk. Just be a little patient if you have a critical sites online. While you wait, nothing stops you from try PHP 4 offline and see how it goes. From my experiences I can tell you it goes pretty fast.
Regards, Manuel Lemos
Web Programming Components using PHP Classes.
Look at: acm.org">http://phpclasses.UpperDesign.com/?user=mlemos
acm.org
-- E-mail: mlemosacm.org URL: http://www.mlemos.e-na.net/ PGP key: http://www.mlemos.e-na.net/ManuelLemos.pgp --
attached mail follows:
I would like to speak with anyone using PostgreSQL with persistent connections, please!
We tried to implement this a few revisions of Postgres and releases of PHP3 back with no success -- I'd like to give it another shot but only want to if I know other people have this working :-)
Thanks!!!
- Mitch
attached mail follows:
Hello, I have been trying to install php4 with the pdflib on my pc box. However, I am unsure how to compile the pdflib for use with php. I am using the binary of php4 because i had trouble compiling that also. Any suggestions? -Dave Johnson
attached mail follows:
I just got word on an interesting class that interfaces with http://www.intershipper.net to get accurate shipping information from a number of carriers. It's offered under GNU LGPL.
http://www.desertraven.com/intershipper.php
Ted
attached mail follows:
Yeah, and the guy who wrote it reads the list, too!
Sorry I hadn't gotten around to announcing it yet...
:P
Michael J. Sheldon Internet Applications Developer Phone: 480.699.1084 http://www.desertraven.com/ PGP Key Available on Request
-----Original Message-----
From: T.R. Henigson [mailto:ted
3bits.com]
Sent: Tuesday, March 14, 2000 17:04
To: php3
lists.php.net
Subject: [PHP3] shipping class
I just got word on an interesting class that interfaces with http://www.intershipper.net to get accurate shipping information from a number of carriers. It's offered under GNU LGPL.
http://www.desertraven.com/intershipper.php
Ted
-- PHP 3 Mailing List <http://www.php.net/> To unsubscribe, send an empty message to php3-unsubscribelists.php.net To subscribe to the digest, e-mail: php3-digest-subscribe
lists.php.net To search the mailing list archive, go to: http://www.php.net/mailsearch.php3 To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
Hello Mike,
On 14-Mar-00 23:54:58, you wrote:
>Yeah, and the guy who wrote it reads the list, too!
>Sorry I hadn't gotten around to announcing it yet...
If you post it here it will be personally announced by email to over 5.000 PHP users that are very interested on new PHP classes (no spam, purely solicited mail).
http://phpclasses.UpperDesign.com/
Regards, Manuel Lemos
Web Programming Components using PHP Classes.
Look at: acm.org">http://phpclasses.UpperDesign.com/?user=mlemos
acm.org
-- E-mail: mlemosacm.org URL: http://www.mlemos.e-na.net/ PGP key: http://www.mlemos.e-na.net/ManuelLemos.pgp --
attached mail follows:
Hi,
I am designing a site where a user has 1 month's free membership, but has to subscribe after that.
I am having great problems in trying to work out how to calculate the remaining number of days their free membership has, SIMPLY, and not by breaking the dates down into their separate components (Year, Month, Day).
I can work out what the current date is, and can get the initial joining date, both in the same format, but how do I subtract one from the other?
FYI the format both dates are in is: YYYYMMDD so I just get: Currentdate: 20000315 Joiningdate: 20000218 which of course makes 97 when the latter is taken away from the former.
The joining date is taken from a Timestamp field set to a length of 8.
I have had a look through the manuals, but there is no mention of date calculations that I can find, and I have had no luck with the archives either.
Also I have a question regarding the Current date...Is this the date taken from the user's computer, or from elsewhere, and if elsewhere, then where? I am just worried that someone could turn back their computer's date and get extended free usage of the site.
I would appreciate any advice that can be offered, but could you please reply direct to me, as I am set on Digest mode.
Many thanks Alexis
attached mail follows:
this may help; i wanted to do a similar thing just recently to generate some statistics. i assume you're using mySQL? if so the the command to_days() should work. it converts a date to the # of days since year 0, which then allows you to subtract. if not mysql it at least gives you an idea of the type of thig to look for. not necessarily the best way, i'm sure..but workable.
heres a query: $days_left = mysql_query("select ((to_days(Joiningdate()) - (to_days(Currentdate))) from database");
--kevin
there may be an extra set of parentheses in there; they help me read things. On Wed, 15 Mar 2000, Alexis Antonakis wrote:
> Hi,
>
> I am designing a site where a user has 1 month's free membership, but has to
> subscribe after that.
>
> I am having great problems in trying to work out how to calculate the
> remaining number of days their free membership has, SIMPLY, and not by
> breaking the dates down into their separate components (Year, Month, Day).
>
> I can work out what the current date is, and can get the initial joining
> date, both in the same format, but how do I subtract one from the other?
>
> FYI the format both dates are in is:
> YYYYMMDD
> so I just get:
> Currentdate: 20000315
> Joiningdate: 20000218
> which of course makes 97 when the latter is taken away from the former.
>
> The joining date is taken from a Timestamp field set to a length of 8.
>
> I have had a look through the manuals, but there is no mention of date
> calculations that I can find, and I have had no luck with the archives
> either.
>
> Also I have a question regarding the Current date...Is this the date taken
> from the user's computer, or from elsewhere, and if elsewhere, then where?
> I am just worried that someone could turn back their computer's date and get
> extended free usage of the site.
>
> I would appreciate any advice that can be offered, but could you please
> reply direct to me, as I am set on Digest mode.
>
> Many thanks
> Alexis
>
>
> --
> PHP 3 Mailing List <http://www.php.net/>
> To unsubscribe, send an empty message to php3-unsubscribe
lists.php.net
> To subscribe to the digest, e-mail: php3-digest-subscribe
lists.php.net
> To search the mailing list archive, go to: http://www.php.net/mailsearch.php3
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
attached mail follows:
Would any of you happen to know if there are any issues regarding cookies and Netscape on the Mac? (Or maybe the way PHP handles cookies?)
With Netscape 4.x on an iMac, it seems like sometimes my cookies aren't getting set.
This is what I'm basically using:
<? if(!$b) { setcookie( "a", "Cookie%20Set", time()+999999999, "/", ".server.com" ); } print($a ? $a : "Reload"); ?>
Brian
attached mail follows:
Hi, Fatal error: Call to undefined function: ocilogon() in /home/test/ftp.php on line 17 I have downloaded php4.0-b4pl and apache 1.3.9. My OS is RedHat Linux 6.0. And I have installed Mysql and Oracle 8i in it. I want to install apache and php4 with the two rdbms.I compile under the indication of php README file. But I can't use any oci functions. The mysql funcitons worked well. What's my mistake? Please Help! Thank you at first!
attached mail follows:
Hi,
I am trying to explode() the contents of a variable variable into a different variable variable with the following:
${$varexploded} = explode("-","${$var}");
I know that ${$var} has a value (eg 999-99999), but when I print ${$varexploded} it says Array, which I think is cool, but when I try to print ${$varexploded}[0] I get Array[0].
********** Got it working by changing the explode() to write to a "constant" variable ($varexplode) then made the variable variable (${$varexploded}) = $varexplode[0] **********
If there is a way to not involve this intermediate stop, please let me know, prolly my syntax is nubbed up and I don't see it.
Thanks,
Joe
PS I get the digest, so personal replies are nice.
attached mail follows:
I've developed an application that uses PHP and PostgreSQL to implement a very extensive search engine.. In the beginning there was a need for this search engine to search flat files as well as the database (And qualify the results between the two), at the time I chose to use grep and temporary database tables (it was a feature addition 2 days before the final release date)..
This was all well and good --- until the database grew to over 20,000 records (and about 18,000 flat files).
So, now my method of having grep search the files, return the filename (the files are named by the ID of the record), insert those IDs into a temporary table and make the SQL query qualify all other search results with the temporary table is crazy slow (as one could imagine).. The bottleneck is a combination of grep opening and closing each of the 18,000 files, then adding several thousand records into a database. Multiply this by the number of simultaneous users ( 50-60 ) and you'll see an idea of the mess I created!.
So I'm stuck and I'm emailing for ideas, thoughts and opinions on what the best solution to this problem might be..
I need something that's fast, the fastest solution I can think of would be to
#1 Use an indexing search engine for the files, something like glimpse.
#2 Don't use temporary database tables.
Big problem combining the two searches in a fast way...
I've got lots of ideas -- I'm not going into them because I would love some new input.
Thanks!!!!
- Mitch
attached mail follows:
Hi, Not sure what type of "flat-file" are you talking about. Are they ASCII type file (ie HTML, plain text etc) ? There is an OpenSource search engines that you can use it supports number of RDBMs like PostGres and MySQL and has its own robot to "crawl" the site. The problem is that in order for the robot to index these files, they need to be referenced in the URL ie <a href=""> maybe you can use the robot other way I dunno. The site is:
Thier site seems to be down at the moment (well for me anyway :))
Or you could try htdig
Hope this hopes
> I've developed an application that uses PHP and PostgreSQL to implement a > very extensive search engine.. In the beginning there was a need for this > search engine to search flat files as well as the database (And > qualify the > results between the two), at the time I chose to use grep and temporary > database tables (it was a feature addition 2 days before the final release > date).. > > This was all well and good --- until the database grew to over 20,000 > records (and about 18,000 flat files). > > So, now my method of having grep search the files, return the > filename (the > files are named by the ID of the record), insert those IDs into a > temporary > table and make the SQL query qualify all other search results with the > temporary table is crazy slow (as one could imagine).. The bottleneck is a > combination of grep opening and closing each of the 18,000 files, then > adding several thousand records into a database. Multiply this by > the number > of simultaneous users ( 50-60 ) and you'll see an idea of the mess I > created!. > > So I'm stuck and I'm emailing for ideas, thoughts and opinions on what the > best solution to this problem might be.. > > I need something that's fast, the fastest solution I can think of would be > to > > #1 Use an indexing search engine for the files, something like glimpse. > > #2 Don't use temporary database tables. > > Big problem combining the two searches in a fast way...
attached mail follows:
Hi..
I'm just wondering why is that my PHP4 didn't display a value of input type file in the $HTTP_POST_VARS?
Everything else is working ok..
Regards
attached mail follows:
Why doesn't array_pad() work??? I get undefined function.
Cheers, -Josh
--------------------------------------------------------------------------- I gotta go coz I got me a drop-top and If I hit the switch, I can make that ass drop
attached mail follows:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Testing the message problem
-----BEGIN PGP SIGNATURE----- Version: PGPfreeware 6.5.2 for non-commercial use <http://www.pgp.com>
iQA/AwUBOM820IFlGDz1l6VWEQIS+QCgt1UQ28IwFea7DwQM7Ta9aT2bNAUAnRrR U56yFLIHJvcP1Tw6nmPklFY8 =pEbj -----END PGP SIGNATURE-----
attached mail follows:
Looks like there is a bug in the mktime function for PHP 3.12.
Here is a routine that demonstrates the problem.
The routine prints out 3 dates per line.
Let FDM = First Day of Month
The routine prints out the dates corresponding to:
FDM - 2, FDM - 1, FDM
In the output below, you can see that the mktime function starts acting wonky around the end of march.
<? $year = "2000"; for ($i=1; $i <= 12; $i++) { $ts1 = mktime(0,0,0,$i,-1,$year); $ts2 = mktime(0,0,0,$i,0,$year); $ts3 = mktime(0,0,0,$i,1,$year); echo date("Y-m-d",$ts1); echo " "; echo date("Y-m-d",$ts2); echo " "; echo date("Y-m-d",$ts3); echo "<br>"; } ?>
1999-12-30 1999-12-31 2000-01-01 2000-01-30 2000-01-31 2000-02-01 2000-02-27 2000-02-28 2000-03-01 2000-03-29 2000-03-30 2000-04-01 2000-04-28 2000-04-29 2000-05-01 2000-05-29 2000-05-30 2000-06-01 2000-06-28 2000-06-29 2000-07-01 2000-07-29 2000-07-30 2000-08-01 2000-08-29 2000-08-30 2000-09-01 2000-09-28 2000-09-29 2000-10-01 2000-10-29 2000-10-30 2000-11-01 2000-11-28 2000-11-29 2000-12-01
I will submit this as a bug report if I don't hear any feedback telling me I missed something. The errata have a comment on this problem but doesn't look like it has been submitted as a bug report.
Regards, Paul Meagher, Content Engineer http://www.datavore.com
attached mail follows:
Try this tutorial at webmonkey: http://hotwired.lycos.com/webmonkey/programming/php/
----- Original Message -----
From: Alexandre Maneu i Victòria <nexus.mansoft
ctv.es>
To: <php3
lists.php.net>
Sent: Tuesday, March 14, 2000 8:53 AM
Subject: [PHP3] New to SQL+PHP
> I'm really new to SQL and PHP, and would like to know if there is any
> "tutorial" for that situation... In PHP3's manual there are only the
> explanations of the functions, but obviously I think I'll need somewhat
> more.
>
> Thank you very much
>
>
>
> --
> PHP 3 Mailing List <http://www.php.net/>
> To unsubscribe, send an empty message to php3-unsubscribe
lists.php.net
> To subscribe to the digest, e-mail: php3-digest-subscribe
lists.php.net
> To search the mailing list archive, go to:
http://www.php.net/mailsearch.php3
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
attached mail follows:
Regarding those messages that you were receiving:
I was receiving those messages too. It is due to the way that ezmlm, which runs the PHP mailing list, works.
<antelio
yahoo.com> has obviously requested the mailing list archives for
the PHP list, but has underestimated the size of them.
When the 3MB limit on his Yahoo! mail account was hit, the mail started bouncing.
As ezmlm has been only relaying your messages, the Yahoo! mail daemon thought the message was coming from you, which that particular message was originally.
The thing to do is wait until antelio
yahoo has deleted enough messages out
of their account that they will be able to receive messages before you start
emailling them abuse.
If you want to know more, then just drop me a bell.
Other warning messages, unsolicited vacation auto-responses, etc, are due to ezmlm relaying your message on to thousands of subscribers to the PHP list. Some of those subscribers need to receive the boot IMHO until they stop their autoresponders or empty their accounts.
BTW, those naughty bounced messages don't pass through the php mailing list usually, so ezmlm will be unable to know it is happening.
---- Stephen D C -- Auckland, New Zealand ---- kimihia*writeme.com // http://surf.to/stephenc ===-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=== Because of lamb tariffs the Unabomber will be sending nuclear warheads from Oklahoma to Iraq
attached mail follows:
guys, any of you have trick to get rid off from too many conections ( in mysql)
any tricks are welcome
TIA
-- idban secandri idbansatunet.com my boss said, "only the paranoid will survive"
attached mail follows:
hi there, I'm trying to make a server side include to work within an php3 script specifically with Phorum but it won't work any idea on this?
I'm running NT (my customer really), IIS 4 and php 3.0.15
the idea is to have a line like : <!--#exec cgi="/cgi/chk_.cgi"--> within a php3 script or to include an .shtml file
bests roberto
--
attached mail follows:
Hi, How many connections can I have to Oracle. I assume that when using OCIPlogon if to users simlutaneously use a page, and there's no free connections in the pool, then a new one is allocated, am I right? Well, how many connections can we have before Oracle shits? I remember seeing this in the list, I just don't remember what it was.
Cheers, -Josh
--------------------------------------------------------------------------- I gotta go coz I got me a drop-top and If I hit the switch, I can make that ass drop
attached mail follows:
i think it's kinda cool (and slow to implement in php-scipts) - we would have to check the license
what do you think?
--Thies C. Arntzen "One Big-Mac, Small Fries and a Coke!" Digital Collections Phone +49 40 235350 Fax +49 40 23535180 Hammerbrookstr. 93 20097 Hamburg / Germany
- Next message: php3-digest-help
lists.php.net: "php3 Digest 15 Mar 2000 18:00:01 -0000 Issue 1539"
- Previous message: php3-digest-help
lists.php.net: "php3 Digest 14 Mar 2000 18:00:05 -0000 Issue 1537"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]