|
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: Fri Jul 26 2002 - 20:30:11 CDT
php-general Digest 27 Jul 2002 01:30:11 -0000 Issue 1488
Topics (messages 109719 through 109908):
Re: Possible to have optional values in function?
109719 by: Jason Wong
109720 by: Martin Clifford
109727 by: Jason Wong
109759 by: Tech Support
109767 by: Jason Wong
109769 by: Justin French
109903 by: JJ Harrison
Re: [CROSS POST] PHP Meetup & Texas PHP Users
109721 by: Manuel Lemos
Using cookies with PHP
109722 by: DonPro
109728 by: Jason Wong
Re: [PHP-DB] Re: [CROSS POST] PHP Meetup & Texas PHP Users
109723 by: Pierre-Alain Joye
Re: PHP 4.2.2 and Apache LoadModule issue
109724 by: Frank S. Kicenko
109780 by: Bob Lockie
phpinfo()
109725 by: Hafiz Malik
including just created file
109726 by: Marek Kilimajer
Netscape 4.7 with php gd, very slow
109729 by: Harry Yu
109731 by: Jay Blanchard
109777 by: Bob Lockie
109779 by: Harry Yu
109782 by: Bob Lockie
109831 by: Harry Yu
109834 by: Bob Lockie
109835 by: Harry Yu
Re: Help invoking a regexp
109730 by: Analysis & Solutions
PHP / Apache 2.0.39 issues
109732 by: Frank S. Kicenko
109738 by: Aaron Gould
109742 by: Frank S. Kicenko
109766 by: Tech Support
109775 by: Bob Lockie
cannot find output from lex - Installing PHP 4.2.2 - Take two
109733 by: Daniel Guerrier
109737 by: René Moonen
phpMyAdmin and apqache 2.0.39 cache problems
109734 by: electroteque
109736 by: Julio Nobrega
Re: Paying Job...
109735 by: Paul Dionne
109745 by: eat pasta type fasta
109792 by: Gerard Samuel
109828 by: Matt
How reliable is pcntl support?
109739 by: Darren Gamble
109741 by: Jay Blanchard
109747 by: Darren Gamble
Changing a variable's value when a link is clicked
109740 by: DonPro
109743 by: Jay Blanchard
invalid use of group function (mysql)
109744 by: Alexander Ross
109773 by: Johan Holst Nielsen
php redirect
109746 by: Tyler Durdin
109748 by: Jay Blanchard
109749 by: Brian McGarvie
109751 by: Tyler Durdin
109752 by: Jome
109753 by: David Buerer
109754 by: Jay Blanchard
109755 by: Martin Clifford
109760 by: Jay Blanchard
109761 by: David Buerer
109765 by: Martin Clifford
109770 by: Jay Blanchard
109772 by: David Buerer
109774 by: Justin French
109781 by: Justin French
109783 by: Bob Lockie
109788 by: Tech Support
Re: header function
109750 by: Tech Support
109784 by: Matt
109786 by: Bob Lockie
109791 by: Tech Support
109842 by: k a m e s h
109850 by: Tech Support
php 4.2.2 on redhat 7.3
109756 by: Fifield, Mike
exec() not working in one script...
109757 by: Jay Blanchard
109764 by: Johan Holst Nielsen
Closing file pointer
109758 by: V_Suresh
109829 by: Marek Kilimajer
Re: How to check if a field is auto increment
109762 by: Justin French
(newbie) questions abot vars and args
109763 by: Alexander Ross
109768 by: Martin Clifford
109778 by: Justin French
109790 by: Mitja Stepan
time question.
109771 by: Steve Bradwell
109785 by: Tech Support
109787 by: Rénald CASAGRAUDE
109789 by: 1LT John W. Holmes
109827 by: Steve Bradwell
[Getting OT] Re: [PHP] php redirect
109776 by: Chris Garaffa
PostgreSQL
109793 by: Hadi
Sorry for another newbie PHP and Apache 2.0.39 question..
109794 by: Frank S. Kicenko
109833 by: Bob Lockie
Re: Authentication session problem (php/server implementation?)
109795 by: Richard Lynch
Re: MySQL Backup and Restore
109796 by: Richard Lynch
Re: Spambot Defense Code
109797 by: Richard Lynch
Re: probelm : delete files using PHP
109798 by: Richard Lynch
Re: File upload memory usage.
109799 by: Richard Lynch
109869 by: Reid Sutherland
109871 by: Bob Lockie
Re: ldap_connect()
109800 by: Richard Lynch
Re: When to destroy sessions that iterate
109801 by: Richard Lynch
Re: PHP-GD and JPEG+PNG - Which versions is required?
109802 by: Richard Lynch
Re: Cookies
109803 by: Richard Lynch
Re: Help with msql_fetch_array()
109804 by: Richard Lynch
Re: Hitting return in a textarea box...
109805 by: Richard Lynch
Re: Windows installation help.
109806 by: Richard Lynch
Re: socket_set_block(); - question
109807 by: Richard Lynch
Re: Php and Apache
109808 by: Richard Lynch
Re: datetime field - still a newbie
109809 by: Richard Lynch
Re: Grab value of mail headers
109810 by: Richard Lynch
Re: mail() function
109811 by: Richard Lynch
Re: Facing some problem with mySQL Installation
109812 by: Richard Lynch
Re: The page before for newman.
109813 by: Richard Lynch
Re: preview an html file.
109814 by: Richard Lynch
Re: include() limits
109815 by: Richard Lynch
Re: timing header("Location: " )
109816 by: Richard Lynch
Re: PHP Meetup, how many of you have signed up?
109817 by: Richard Lynch
109845 by: Monty
Re: Sessions, how they exist and die
109818 by: Richard Lynch
Re: pulling records from mysql
109819 by: Richard Lynch
Re: 'Previous' 1, 2, 3, 4, etc. 'Next'
109820 by: Richard Lynch
Re: New way to make select boxes auto select
109821 by: Richard Lynch
109872 by: Nathan Cook
Re: mySQL Queries using PHP's SESSION variables
109822 by: Richard Lynch
Re: Implement PHP within a string
109823 by: Richard Lynch
Re: Help! mysql problem
109824 by: Richard Lynch
Re: conditional image generation problem
109825 by: Richard Lynch
Re: unset array here?
109826 by: Richard Lynch
109836 by: Andrey Hristov
sessions
109830 by: Tyler Durdin
109837 by: Tech Support
109838 by: Tyler Durdin
109839 by: Monty
109840 by: Tyler Durdin
109841 by: Andrey Hristov
109843 by: Tyler Durdin
109844 by: Monty
109846 by: Matthew K. Gold
109847 by: Tyler Durdin
109848 by: Pushkar Pradhan
109849 by: Tyler Durdin
109851 by: Tech Support
109852 by: Andrey Hristov
109854 by: Tyler Durdin
109856 by: Andrey Hristov
what do you wish you knew then now?
109832 by: Peter J. Schoenster
Logging: Best archive method
109853 by: Julio Nobrega
Close A Databse Connection
109855 by: Jay Blanchard
109859 by: Andrew Hill
109861 by: Andrey Hristov
109862 by: Glenn Sieb
109884 by: Peter J. Schoenster
still on sessions
109857 by: Tyler Durdin
109858 by: Andrey Hristov
109860 by: Martin Clifford
109863 by: Tyler Durdin
109868 by: Monty
109878 by: Tech Support
109900 by: 1LT John W. Holmes
Re: pg_pconnect() question
109864 by: Varsha Agarwal
filling an array
109865 by: Steve Buehler
109866 by: Andrey Hristov
109867 by: Matt
109873 by: Martin Clifford
109881 by: Steve Buehler
How can I get my session variable to pass to another page?
109870 by: DonPro
109874 by: Martin Clifford
How to UPDATE two MySQL Tables
109875 by: Monty
109877 by: Jay Blanchard
mysql question
109876 by: Christian Calloway
109879 by: Julio Nobrega
109880 by: Tech Support
109885 by: Lowell Allen
imagettftext, GD2, and Freetype
109882 by: Sean Coates
filling an array(2)
109883 by: Steve Buehler
109887 by: Tech Support
109888 by: Steve Buehler
Re: Newman Asks, Do i have to use session_name('sid') every ...
109886 by: Wm
PHP UPGRADE on LINUX
109889 by: karthikeyan
109890 by: Tech Support
Table formatting
109891 by: César Aracena
109894 by: Tech Support
Red Hat 7.2 enabling MySQL on preinstalled PHP
109892 by: Joel Lopez
Installed PHP on home Win98se, now how can I get browser to see it?
109893 by: Marcus Unlimited
109896 by: Tech Support
109898 by: oscarfm.cantv.net
109899 by: Jadiel Flores
109902 by: JJ Harrison
High Resolution Images
109895 by: oscarfm.cantv.net
109897 by: Tech Support
109907 by: Justin French
adding Databases
109901 by: Joel Lopez
109904 by: Gurhan Ozen
calling user-defined php functions from <a href> tag
109905 by: Michael
109908 by: 1LT John W. Holmes
Calling a function without variable params
109906 by: Mathieu Dumoulin
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:
On Friday 26 July 2002 21:24, JJ Harrison wrote:
> I *did* rtfm(or searched it at least).
>
> That is why I asked the group.
So you've read the chapter on functions, and did it answer your question?
-- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development */* When does summertime come to Minnesota, you ask? Well, last year, I think it was a Tuesday. */
attached mail follows:
Obviously it did NOT answer his question, otherwise he wouldn't be asking the list. Try using some common sense.
Martin
>>> php-general
gremlins.com.hk 07/26/02 09:32AM >>>
On Friday 26 July 2002 21:24, JJ Harrison wrote:
> I *did* rtfm(or searched it at least).
>
> That is why I asked the group.
So you've read the chapter on functions, and did it answer your question?
-- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development */* When does summertime come to Minnesota, you ask? Well, last year, I think it was a Tuesday. */
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
On Friday 26 July 2002 21:34, Martin Clifford wrote: > Obviously it did NOT answer his question, otherwise he wouldn't be asking > the list.
How do you know? He hasn't said whether he _had_ read that chapter yet.
> Try using some common sense.
I wish more people did.
-- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development */* To save a single life is better than to build a seven story pagoda. */
attached mail follows:
Don't waist everyone's time with this b.s. ...either you can help or you cannot.
Use "rtfm" sparingly. Treat it as a last resort; a secret weapon. Reserve it for people who ask really dumb questions like "how do I use sessions", or "how do I use mysql", or something general like that, when you know damn well they have not even tried to find out anything on their own.
Jim Grill Support Web-1 Hosting http://www.web-1hosting.net
> On Friday 26 July 2002 21:24, JJ Harrison wrote: > > I *did* rtfm(or searched it at least). > > > > That is why I asked the group. > > So you've read the chapter on functions, and did it answer your question? > > -- > Jason Wong -> Gremlins Associates -> www.gremlins.com.hk > Open Source Software Systems Integrators > * Web Design & Hosting * Internet & Intranet Applications Development * > > /* > When does summertime come to Minnesota, you ask? Well, last year, I > think it was a Tuesday. > */ > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > >
attached mail follows:
On Friday 26 July 2002 23:33, Tech Support wrote: > Don't waist everyone's time with this b.s. ...either you can help or you > cannot.
Jeez. How do you like your help to be given to to?
By saying 'rftm' that is not helping? It's blindingly obvious from the question that the section of the manual to look up would be the chapter on functions.
So to be helpful I should go and copy-paste bits of the manual in my reply?
> Use "rtfm" sparingly. Treat it as a last resort; a secret weapon. Reserve > it for people who ask really dumb questions like "how do I use sessions", > or "how do I use mysql", or something general like that, when you know damn > well they have not even tried to find out anything on their own.
A substantial number of questions to this list can/should be answered with 'rtfm'. Only recently someone said "why read the manual when it's quicker to ask the list and have some sucker do my homework for me" (or words to that effect).
-- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development */* Banectomy, n.: The removal of bruises on a banana. -- Rich Hall, "Sniglets" */
attached mail follows:
I'm with Jason on this one... it's reasonably easy to figure out by looking in the manual, reading the section/chapter on functions. it took me about 15 seconds to find the relevant paragraphs and examples:
http://www.php.net/manual/en/functions.arguments.php
JJ Harrison, look under "default argument values" heading on the above page, and you'll see your answer.
Justin French
on 26/07/02 11:34 PM, Martin Clifford (MLC1
nrc.gov) wrote:
> Obviously it did NOT answer his question, otherwise he wouldn't be asking the
> list. Try using some common sense.
>
> Martin
>
>>>> php-general
gremlins.com.hk 07/26/02 09:32AM >>>
> On Friday 26 July 2002 21:24, JJ Harrison wrote:
>> I *did* rtfm(or searched it at least).
>>
>> That is why I asked the group.
>
> So you've read the chapter on functions, and did it answer your question?
attached mail follows:
I just realised why my search returned nothing.
I was searching the function list instead of the whole site :}
Sorry :(
-- JJ Harrison webmastertececo.com www.tececo.com
"Jason Wong" <php-general
gremlins.com.hk> wrote in message news:200207262344.45841.php-general
gremlins.com.hk... > On Friday 26 July 2002 23:33, Tech Support wrote: > > Don't waist everyone's time with this b.s. ...either you can help or you > > cannot. > > Jeez. How do you like your help to be given to to? > > By saying 'rftm' that is not helping? It's blindingly obvious from the > question that the section of the manual to look up would be the chapter on > functions. > > So to be helpful I should go and copy-paste bits of the manual in my reply? > > > Use "rtfm" sparingly. Treat it as a last resort; a secret weapon. Reserve > > it for people who ask really dumb questions like "how do I use sessions", > > or "how do I use mysql", or something general like that, when you know damn > > well they have not even tried to find out anything on their own. > > A substantial number of questions to this list can/should be answered with > 'rtfm'. Only recently someone said "why read the manual when it's quicker to > ask the list and have some sucker do my homework for me" (or words to that > effect). > > -- > Jason Wong -> Gremlins Associates -> www.gremlins.com.hk > Open Source Software Systems Integrators > * Web Design & Hosting * Internet & Intranet Applications Development * > > /* > Banectomy, n.: > The removal of bruises on a banana. > -- Rich Hall, "Sniglets" > */ >
attached mail follows:
Hello,
On 07/26/2002 09:25 AM, Jay Blanchard wrote: > I look forward to your responses...
I am afraid this is going to be a major fiasco. The idea is good but the meetup site is very badly implemented. It is very confusing. It is very hard to find how to choose a different city from those that are suggested.
When you finally realize that the closest city is too far away from where you live, you have an hard time to discover how to suggest a different city. When you think you have found to how to suggest a new city and do it, it seems that you're suggestion is being ignored.
Is there really anybody behind this site? It seems that it was something that somebody did but is not really maintaining it.
Another point is the choice of the day of the week is not very fortunate either because most people that work can't attend during weekdays. Even Friday night would have been a better idea.
Anyway, it shows that for the small numbers of users that subscribed to the various sites are just a reflex of how badly organized the initiative is. It is a pity. Maybe it should be better to organize something independent of the Meetup site which is only forcing inconvenient constraints of place and day of the week.
--Regards, Manuel Lemos
attached mail follows:
Hi,
Does anyone have examples on how to use cookies with PHP? I'm just getting into this and would like to know the difference between stored cookies and non-stored per session cookies. Does PHP support both?
Any helpful URL's would be appreciated.
Thanks, Don
attached mail follows:
On Friday 26 July 2002 21:48, DonPro wrote:
> Does anyone have examples on how to use cookies with PHP?
They're in the manual.
> I'm just getting > into this and would like to know the difference between stored cookies and > non-stored per session cookies.
Cookies are stored on the client. Sessions are stored on the server and expires (at the latest) when browser is closed.
> Does PHP support both?
A look at the manual would tell you yes.
> Any helpful URL's would be appreciated.
www.php.net ?
-- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development */* It's NO USE ... I've gone to "CLUB MED"!! */
attached mail follows:
Something better for this need currently works good in France: http://www.communautephp.com/
For all of us who read french.
The way of decide where and when are given to the users via a forum. This system works pretty well here.
pa
attached mail follows:
Okay.. thanks.. I have another compile problem, I'm wondering if someone can help me. I've built and installed Apache 2.0.39 and am recompiling PHP4.2.2. Below are the details..
./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-zlib=/usr --with-oci8=`dbhome`
Compiling... Entering director '/php-4.2.2/sapi/apache2filter' /bin/sh /php-4.2.2/libtool --silent --mode=compile gcc -I. -I/php4.2.2/sapi/apache2filter -I/php4.2.2/main -I/php-4.2.2 -I/usr/local/apache2/include -I/php-4.2.2/Zend -I/php-4.2.2/ext/mysql/libmysql -I/export/home/oracleuser/OraHome1/rdbms/public -I/export/home/oracleuser/OraHome1/rdbms/demo -I/php-4.2.2/ext/xml/expat -D_POSIX_PTHREAD_SEMANTICS -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT -I/php-4.2.2/TSRM -DTHREAD=1 -g -O2 -pthreads -DZTS -prefer-pic -c php_functions.c php_functions.c:93:27: missing binary operator before '('
This is the error...
Thanks all.
-----Original Message-----
From: Peter [mailto:php
vfsa.com.au]
Sent: Thursday, July 25, 2002 10:44 PM
To: Frank S. Kicenko; php-general
lists.php.net
Subject: RE: [PHP] PHP 4.2.2 and Apache LoadModule issue
> -----Original Message-----
> From: Bob Lockie [mailto:bjlockie
lockie.ca]
> Sent: Friday, 26 July 2002 1:32 PM
> To: Frank S. Kicenko; php-general
lists.php.net
> Subject: Re: [PHP] PHP 4.2.2 and Apache LoadModule issue
>
>
> On Thu, 25 Jul 2002 22:23:21 -0500, Frank S. Kicenko wrote:
>
> >Hi All.
> >
> >I am having a weird problem... my PHP is outputting a "libphp4.a" and
> >"libphp4.la" modules and I can't get Apache to recognize this type of
> >file. Is there a way to tell PHP to generate a ".so" module? Or how
can
> >I get Apache to use the .a and .la modules?
> >
> >Thanks.
yeah i had to do
./configure --activate-module=src/modules/php4/libmodphp4.a
attached mail follows:
>Okay.. thanks.. I have another compile problem, I'm wondering if someone
>can help me. I've built and installed Apache 2.0.39 and am recompiling
>PHP4.2.2. Below are the details..
>
>./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-zlib=/usr
>--with-oci8=`dbhome`
>
>Compiling...
>Entering director '/php-4.2.2/sapi/apache2filter'
>/bin/sh /php-4.2.2/libtool --silent --mode=compile gcc -I.
>-I/php4.2.2/sapi/apache2filter -I/php4.2.2/main -I/php-4.2.2
>-I/usr/local/apache2/include -I/php-4.2.2/Zend
>-I/php-4.2.2/ext/mysql/libmysql
>-I/export/home/oracleuser/OraHome1/rdbms/public
>-I/export/home/oracleuser/OraHome1/rdbms/demo -I/php-4.2.2/ext/xml/expat
>-D_POSIX_PTHREAD_SEMANTICS -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT
>-I/php-4.2.2/TSRM -DTHREAD=1 -g -O2 -pthreads -DZTS -prefer-pic -c
>php_functions.c
>php_functions.c:93:27: missing binary operator before '('
>
>This is the error...
>
>Thanks all.
>
>-----Original Message-----
>From: Peter [mailto:php
vfsa.com.au]
>Sent: Thursday, July 25, 2002 10:44 PM
>To: Frank S. Kicenko; php-general
lists.php.net
>Subject: RE: [PHP] PHP 4.2.2 and Apache LoadModule issue
>
>
>
>
>> -----Original Message-----
>> From: Bob Lockie [mailto:bjlockie
lockie.ca]
>> Sent: Friday, 26 July 2002 1:32 PM
>> To: Frank S. Kicenko; php-general
lists.php.net
>> Subject: Re: [PHP] PHP 4.2.2 and Apache LoadModule issue
>>
>>
>> On Thu, 25 Jul 2002 22:23:21 -0500, Frank S. Kicenko wrote:
>>
>> >Hi All.
>> >
>> >I am having a weird problem... my PHP is outputting a "libphp4.a" and
>> >"libphp4.la" modules and I can't get Apache to recognize this type of
>> >file. Is there a way to tell PHP to generate a ".so" module? Or how
>can
>> >I get Apache to use the .a and .la modules?
>> >
>> >Thanks.
>yeah i had to do
>
>./configure --activate-module=src/modules/php4/libmodphp4.a
That is the Apache directive to compile in the module I think. Using apxs will make a DSO. http://httpd.apache.org/docs-2.0/dso.html
attached mail follows:
hi all!!
below is the display of one of my configuration of php on the first server..
Apache Environment
Variable Value
DOCUMENT_ROOT /usr/system/bmi
HTTP_ACCEPT image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
HTTP_ACCEPT_ENCODING gzip, deflate
HTTP_ACCEPT_LANGUAGE en-us
HTTP_CONNECTION Keep-Alive
HTTP_HOST model1.orenda.com.my
HTTP_USER_AGENT Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
PATH /sbin:/bin:/usr/sbin:/usr/bin
REMOTE_ADDR 10.1.1.218
REMOTE_PORT 1520
SCRIPT_FILENAME /usr/system/bmi/info.php
SERVER_ADDR 10.1.1.2
SERVER_ADMIN admin
orenda.com.my
SERVER_NAME model1.orenda.com.my
SERVER_PORT 80
SERVER_SIGNATURE <ADDRESS>Apache/1.3.24 Server at model1.orenda.com.my Port 80</ADDRESS>
SERVER_SOFTWARE Apache/1.3.24 (Unix) PHP/4.2.1
UNIQUE_ID PUFT1AoBAQIAAACcKdQ
GATEWAY_INTERFACE CGI/1.1
SERVER_PROTOCOL HTTP/1.1
REQUEST_METHOD GET
QUERY_STRING
REQUEST_URI /info.php
SCRIPT_NAME /info.php
HTTP Headers Information HTTP Request Headers HTTP Request GET /info.php HTTP/1.1 Accept image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */* Accept-Encoding gzip, deflate Accept-Language en-us Connection Keep-Alive Host model1.orenda.com.my User-Agent Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) HTTP Response Headers X-Powered-By PHP/4.2.1 Keep-Alive timeout=15, max=100 Connection Keep-Alive Transfer-Encoding chunked Content-Type text/html
Additional Modules
Environment Variable Value HOME / PATH /sbin:/bin:/usr/sbin:/usr/bin
PHP Variables
Variable Value
PHP_SELF /info.php
_SERVER["DOCUMENT_ROOT"] /usr/system/bmi
_SERVER["HTTP_ACCEPT"] image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
_SERVER["HTTP_ACCEPT_ENCODING"] gzip, deflate
_SERVER["HTTP_ACCEPT_LANGUAGE"] en-us
_SERVER["HTTP_CONNECTION"] Keep-Alive
_SERVER["HTTP_HOST"] model1.orenda.com.my
_SERVER["HTTP_USER_AGENT"] Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
_SERVER["PATH"] /sbin:/bin:/usr/sbin:/usr/bin
_SERVER["REMOTE_ADDR"] 10.1.1.218
_SERVER["REMOTE_PORT"] 1520
_SERVER["SCRIPT_FILENAME"] /usr/system/bmi/info.php
_SERVER["SERVER_ADDR"] 10.1.1.2
_SERVER["SERVER_ADMIN"] admin
orenda.com.my
_SERVER["SERVER_NAME"] model1.orenda.com.my
_SERVER["SERVER_PORT"] 80
_SERVER["SERVER_SIGNATURE"] <ADDRESS>Apache/1.3.24 Server at model1.orenda.com.my Port 80</ADDRESS>
_SERVER["SERVER_SOFTWARE"] Apache/1.3.24 (Unix) PHP/4.2.1
_SERVER["UNIQUE_ID"] PUFT1AoBAQIAAACcKdQ
_SERVER["GATEWAY_INTERFACE"] CGI/1.1
_SERVER["SERVER_PROTOCOL"] HTTP/1.1
_SERVER["REQUEST_METHOD"] GET
_SERVER["QUERY_STRING"]
_SERVER["REQUEST_URI"] /info.php
_SERVER["SCRIPT_NAME"] /info.php
_SERVER["PATH_TRANSLATED"] /usr/system/bmi/info.php
_SERVER["PHP_SELF"] /info.php
_SERVER["argv"] Array
(
)
_SERVER["argc"] 0 _ENV["HOME"] / _ENV["PATH"] /sbin:/bin:/usr/sbin:/usr/bin
and these are the other one..
Apache Environment
Variable Value
DOCUMENT_ROOT /usr/system/maju
HTTP_ACCEPT image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
HTTP_ACCEPT_ENCODING gzip, deflate
HTTP_ACCEPT_LANGUAGE en-us
HTTP_CONNECTION Keep-Alive
HTTP_HOST maju.orenda.com.my
HTTP_USER_AGENT Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
PATH /sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/usr/X11R6/bin:/root/bin
REMOTE_ADDR 10.1.1.218
REMOTE_PORT 1521
SCRIPT_FILENAME /usr/system/maju/info.php
SERVER_ADDR 10.1.1.3
SERVER_ADMIN admin
orenda.com.my
SERVER_NAME maju.orenda.com.my
SERVER_PORT 80
SERVER_SIGNATURE <ADDRESS>Apache/1.3.23 Server at maju.orenda.com.my Port 80</ADDRESS>
SERVER_SOFTWARE Apache/1.3.23 (Unix) PHP/4.1.1
UNIQUE_ID PUFURwoBAQMAASyXHZo
GATEWAY_INTERFACE CGI/1.1
SERVER_PROTOCOL HTTP/1.1
REQUEST_METHOD GET
QUERY_STRING
REQUEST_URI /info.php
SCRIPT_NAME /info.php
HTTP Headers Information HTTP Request Headers HTTP Request GET /info.php HTTP/1.1 Accept image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */* Accept-Encoding gzip, deflate Accept-Language en-us Connection Keep-Alive Host maju.orenda.com.my User-Agent Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) HTTP Response Headers X-Powered-By PHP/4.1.1 Keep-Alive timeout=15, max=100 Connection Keep-Alive Transfer-Encoding chunked Content-Type text/html
Additional Modules
Environment Variable Value USER mhafizm SSH_CLIENT 10.1.1.215 1207 22 MACHTYPE i386 MAIL /var/mail/mhafizm VENDOR intel SHLVL 2 HOME /root SSH_TTY /dev/ttyp0 PAGER more GROUP mhafizm LOGNAME mhafizm BLOCKSIZE K TERM xterm PATH /sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/usr/X11R6/bin:/root/bin REMOTEHOST 10.1.1.215 SHELL /bin/csh HOST test.orenda.com.my OSTYPE FreeBSD PWD /usr/local/etc/rc.d FTP_PASSIVE_MODE YES HOSTTYPE FreeBSD EDITOR vi
PHP Variables
Variable Value
PHP_SELF /info.php
_SERVER["DOCUMENT_ROOT"] /usr/system/maju
_SERVER["HTTP_ACCEPT"] image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
_SERVER["HTTP_ACCEPT_ENCODING"] gzip, deflate
_SERVER["HTTP_ACCEPT_LANGUAGE"] en-us
_SERVER["HTTP_CONNECTION"] Keep-Alive
_SERVER["HTTP_HOST"] maju.orenda.com.my
_SERVER["HTTP_USER_AGENT"] Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
_SERVER["PATH"] /sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/usr/X11R6/bin:/root/bin
_SERVER["REMOTE_ADDR"] 10.1.1.218
_SERVER["REMOTE_PORT"] 1521
_SERVER["SCRIPT_FILENAME"] /usr/system/maju/info.php
_SERVER["SERVER_ADDR"] 10.1.1.3
_SERVER["SERVER_ADMIN"] admin
orenda.com.my
_SERVER["SERVER_NAME"] maju.orenda.com.my
_SERVER["SERVER_PORT"] 80
_SERVER["SERVER_SIGNATURE"] <ADDRESS>Apache/1.3.23 Server at maju.orenda.com.my Port 80</ADDRESS>
_SERVER["SERVER_SOFTWARE"] Apache/1.3.23 (Unix) PHP/4.1.1
_SERVER["UNIQUE_ID"] PUFURwoBAQMAASyXHZo
_SERVER["GATEWAY_INTERFACE"] CGI/1.1
_SERVER["SERVER_PROTOCOL"] HTTP/1.1
_SERVER["REQUEST_METHOD"] GET
_SERVER["QUERY_STRING"]
_SERVER["REQUEST_URI"] /info.php
_SERVER["SCRIPT_NAME"] /info.php
_SERVER["PATH_TRANSLATED"] /usr/system/maju/info.php
_SERVER["PHP_SELF"] /info.php
_SERVER["argv"] Array
(
)
_SERVER["argc"] 0 _ENV["USER"] mhafizm _ENV["SSH_CLIENT"] 10.1.1.215 1207 22 _ENV["MACHTYPE"] i386 _ENV["MAIL"] /var/mail/mhafizm _ENV["VENDOR"] intel _ENV["SHLVL"] 2 _ENV["HOME"] /root _ENV["SSH_TTY"] /dev/ttyp0 _ENV["PAGER"] more _ENV["GROUP"] mhafizm _ENV["LOGNAME"] mhafizm _ENV["BLOCKSIZE"] K _ENV["TERM"] xterm _ENV["PATH"] /sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/usr/X11R6/bin:/root/bin _ENV["REMOTEHOST"] 10.1.1.215 _ENV["SHELL"] /bin/csh _ENV["HOST"] test.orenda.com.my _ENV["OSTYPE"] FreeBSD _ENV["PWD"] /usr/local/etc/rc.d _ENV["FTP_PASSIVE_MODE"] YES _ENV["HOSTTYPE"] FreeBSD _ENV["EDITOR"] vi
my question is that possible for me to hide out all the environment variables such as user, hossttype.. editor... term etc.... and how?
attached mail follows:
Hi all,
I just coded a cache mechanism for some slow code that looks like this:
$cache_file_name = "cache/$id/$tid". ($showall ? '_all.php' :
'.php');
$cache_dir_name= "cache/$id";
if(!file_exists($cache_file_name) ||
filectime($cache_file_name) + 30 < time() ) {
if(!is_dir($cache_dir_name)) {
mkdir($cache_dir_name, 0777);
}
$lock=
fopen($cache_file_name . '.lock','w');
if(flock($lock,LOCK_EX)) {
include('modules/rally_live/create_cache.php');
flock($lock,LOCK_UN);
}
fclose($lock);
}
clearstatcache();
for($i=0;!file_exists($cache_file_name);$i++) {
if($i==3) die('<b>Cannot read cache file!</b>');
clearstatcache();
}
include($cache_file_name); // *sometimes includes empty file*
echo "<!-- File $cache_file_name included -->";
The 'create_cache.php' creates a php code, that later needs to be executed. The problem is, the just created cache file seems to be empty *sometimes* when included, however, if I look at it, it does contain code. I do call fflush($cache_file) before closing it, so I don't see why the file is empty. If anyone can help me, I would be really glad.
attached mail follows:
Hi all,
I'm trying to generate dynamic buttons with text from mysql database. Everything is fine except that the images are displaying very slow in Netscape 4.7. Internet Explorer, Netscape 6 and Mozilla are very fast. I'm running Apache 1.3.26, PHP 4.2.2, GD 1.6.2 on Linux. Also, I have the same scripts running in Windows 2000 and I don't have this problem with Netscape. The following are the scripts:
image.php: <? $s = $_GET[s]; $text = $_GET[text]; $fontfile = "bonzai.ttf";
Header("Content-type: image/png"); if(!isset($s)) $s=11; $size = imagettfbbox($s,0,$fontfile,$text); $dx = abs($size[2]-$size[0]); $dy = abs($size[5]-$size[3]); $xpad=5; $ypad=5; $im = imagecreate($dx+$xpad,$dy+$ypad); $white = ImageColorAllocate($im, 255,255,255); $red = ImageColorAllocate($im, 255,0,0); $black = ImageColorAllocate($im, 0,0,0);
ImageTTFText($im, $s, 0, (int)($xpad/2)-1, $dy+(int)($ypad/2)-1, $black, $fontfile, $text); ImagePNG($im); ImageDestroy($im); ?>
button.php: <html> <body topmargin="5" leftmargin="5" marginheight="5" marginwidth="5" bgcolor="#FAFAFA"> <table border="0" bgcolor="#FBE2AA" cellpadding="0" cellspacing="0" width="100%"> <td> <table border="0" cellpadding="2" cellspacing="2" width="100%" bgcolor="#FBE2AA"> <tr bgcolor="#FFFFFF"><td> <table border="0" cellpadding="0" cellspacing="0"> <?php mysql_connect ( "server", "user", "password" ); mysql_select_db ( "table" ); $query = mysql_query ( "select distinct text from images" ); while ( $result = mysql_fetch_array ( $query ) ) { $text = urlencode ( $result[text] ); echo "<tr><td><img src=\"image.php?s=14&text=$text\" border=\"0\"></td>"; } ?> </table> </td></tr> </table> </td> </table> </body> </html>
Has anyone experience this problem before? I'm not sure whether Apache, PHP, or GD is causing this.
Thanks, Harry
attached mail follows:
[snip] I'm trying to generate dynamic buttons with text from mysql database. Everything is fine except that the images are displaying very slow in Netscape 4.7. Internet Explorer, Netscape 6 and Mozilla are very fast. I'm running Apache 1.3.26, PHP 4.2.2, GD 1.6.2 on Linux. Also, I have the same scripts running in Windows 2000 and I don't have this problem with Netscape. The following are the scripts:
Has anyone experience this problem before? I'm not sure whether Apache, PHP, or GD is causing this. [/snip]
I am running various browsers and have never seen this type of behavior. If the same script is good in IE, NS6, and Moz could it be that there is something with NS4.7? I have just tested IE6, NS6, Moz1.0, and NS4.7 accessing the same script on the same server and saw no problems (save for NS4.7 barfing on some of the CSS).
Jay
Of all the things I’ve lost, I miss my mind the most
************************************* * Want to meet other PHP developers * * in your area? Check out: * * http://php.meetup.com/ * * No developer is an island ... * *************************************
attached mail follows:
>[snip] >I'm trying to generate dynamic buttons with text from mysql database. >Everything is fine except that the images are displaying very slow in >Netscape 4.7. Internet Explorer, Netscape 6 and Mozilla are very fast. I'm >running Apache 1.3.26, PHP 4.2.2, GD 1.6.2 on Linux. Also, I have the same >scripts running in Windows 2000 and I don't have this problem with Netscape. >The following are the scripts: > >Has anyone experience this problem before? I'm not sure whether Apache, >PHP, or GD is causing this. >[/snip] > >I am running various browsers and have never seen this type of behavior. If >the same script is good in IE, NS6, and Moz could it be that there is >something with NS4.7? I have just tested IE6, NS6, Moz1.0, and NS4.7 >accessing the same script on the same server and saw no problems (save for >NS4.7 barfing on some of the CSS).
Check the generated HTML. I think later browsers are more forgiving. Are you using tables? I think table rendering in NS4.7 was really slow.
attached mail follows:
I have no problem with Netscape 4.7 when connecting to Windows 2000 running the same script. Also, I don't have any nested tables in the html. Any other ideas?
Thanks, Harry
--- Bob Lockie <bjlockie
lockie.ca> wrote:
>
> >[snip]
> >I'm trying to generate dynamic buttons with text
> from mysql database.
> >Everything is fine except that the images are
> displaying very slow in
> >Netscape 4.7. Internet Explorer, Netscape 6 and
> Mozilla are very fast. I'm
> >running Apache 1.3.26, PHP 4.2.2, GD 1.6.2 on
> Linux. Also, I have the same
> >scripts running in Windows 2000 and I don't have
> this problem with Netscape.
> >The following are the scripts:
> >
> >Has anyone experience this problem before? I'm not
> sure whether Apache,
> >PHP, or GD is causing this.
> >[/snip]
> >
> >I am running various browsers and have never seen
> this type of behavior. If
> >the same script is good in IE, NS6, and Moz could
> it be that there is
> >something with NS4.7? I have just tested IE6, NS6,
> Moz1.0, and NS4.7
> >accessing the same script on the same server and
> saw no problems (save for
> >NS4.7 barfing on some of the CSS).
>
> Check the generated HTML.
> I think later browsers are more forgiving.
> Are you using tables?
> I think table rendering in NS4.7 was really slow.
>
>
>
__________________________________________________ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com
attached mail follows:
>I have no problem with Netscape 4.7 when connecting to
>Windows 2000 running the same script. Also, I don't
>have any nested tables in the html. Any other ideas?
>
>Thanks,
>Harry
>
>--- Bob Lockie <bjlockie
lockie.ca> wrote:
>>
>> >[snip]
>> >I'm trying to generate dynamic buttons with text
>> from mysql database.
>> >Everything is fine except that the images are
>> displaying very slow in
>> >Netscape 4.7. Internet Explorer, Netscape 6 and
>> Mozilla are very fast. I'm
>> >running Apache 1.3.26, PHP 4.2.2, GD 1.6.2 on
>> Linux. Also, I have the same
>> >scripts running in Windows 2000 and I don't have
>> this problem with Netscape.
>> >The following are the scripts:
>> >
>> >Has anyone experience this problem before? I'm not
>> sure whether Apache,
>> >PHP, or GD is causing this.
>> >[/snip]
>> >
>> >I am running various browsers and have never seen
>> this type of behavior. If
>> >the same script is good in IE, NS6, and Moz could
>> it be that there is
>> >something with NS4.7? I have just tested IE6, NS6,
>> Moz1.0, and NS4.7
>> >accessing the same script on the same server and
>> saw no problems (save for
>> >NS4.7 barfing on some of the CSS).
>>
>> Check the generated HTML.
>> I think later browsers are more forgiving.
>> Are you using tables?
>> I think table rendering in NS4.7 was really slow.
What web servers are you using? Maybe they are returning different headers.
attached mail follows:
Both are running Apache. I'm using the Windows machine as a development box. The web server and php configuration are very close.
--- Bob Lockie <bjlockie
lockie.ca> wrote:
>
> >I have no problem with Netscape 4.7 when connecting
> to
> >Windows 2000 running the same script. Also, I
> don't
> >have any nested tables in the html. Any other
> ideas?
> >
> >Thanks,
> >Harry
> >
> >--- Bob Lockie <bjlockie
lockie.ca> wrote:
> >>
> >> >[snip]
> >> >I'm trying to generate dynamic buttons with text
> >> from mysql database.
> >> >Everything is fine except that the images are
> >> displaying very slow in
> >> >Netscape 4.7. Internet Explorer, Netscape 6 and
> >> Mozilla are very fast. I'm
> >> >running Apache 1.3.26, PHP 4.2.2, GD 1.6.2 on
> >> Linux. Also, I have the same
> >> >scripts running in Windows 2000 and I don't have
> >> this problem with Netscape.
> >> >The following are the scripts:
> >> >
> >> >Has anyone experience this problem before? I'm
> not
> >> sure whether Apache,
> >> >PHP, or GD is causing this.
> >> >[/snip]
> >> >
> >> >I am running various browsers and have never
> seen
> >> this type of behavior. If
> >> >the same script is good in IE, NS6, and Moz
> could
> >> it be that there is
> >> >something with NS4.7? I have just tested IE6,
> NS6,
> >> Moz1.0, and NS4.7
> >> >accessing the same script on the same server and
> >> saw no problems (save for
> >> >NS4.7 barfing on some of the CSS).
> >>
> >> Check the generated HTML.
> >> I think later browsers are more forgiving.
> >> Are you using tables?
> >> I think table rendering in NS4.7 was really slow.
>
> What web servers are you using?
> Maybe they are returning different headers.
>
>
>
__________________________________________________ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com
attached mail follows:
On Fri, 26 Jul 2002 10:33:46 -0700 (PDT), Harry Yu wrote:
>Both are running Apache. I'm using the Windows
>machine as a development box. The web server and php
>configuration are very close.
>
>
>--- Bob Lockie <bjlockie
lockie.ca> wrote:
>>
>> >I have no problem with Netscape 4.7 when connecting
>> to
>> >Windows 2000 running the same script. Also, I
>> don't
>> >have any nested tables in the html. Any other
>> ideas?
>> >
>> >Thanks,
>> >Harry
>> >
>> >--- Bob Lockie <bjlockie
lockie.ca> wrote:
>> >>
>> >> >[snip]
>> >> >I'm trying to generate dynamic buttons with text
>> >> from mysql database.
>> >> >Everything is fine except that the images are
>> >> displaying very slow in
>> >> >Netscape 4.7. Internet Explorer, Netscape 6 and
>> >> Mozilla are very fast. I'm
>> >> >running Apache 1.3.26, PHP 4.2.2, GD 1.6.2 on
>> >> Linux. Also, I have the same
>> >> >scripts running in Windows 2000 and I don't have
>> >> this problem with Netscape.
>> >> >The following are the scripts:
>> >> >
>> >> >Has anyone experience this problem before? I'm
>> not
>> >> sure whether Apache,
>> >> >PHP, or GD is causing this.
>> >> >[/snip]
>> >> >
>> >> >I am running various browsers and have never
>> seen
>> >> this type of behavior. If
>> >> >the same script is good in IE, NS6, and Moz
>> could
>> >> it be that there is
>> >> >something with NS4.7? I have just tested IE6,
>> NS6,
>> >> Moz1.0, and NS4.7
>> >> >accessing the same script on the same server and
>> >> saw no problems (save for
>> >> >NS4.7 barfing on some of the CSS).
>> >>
>> >> Check the generated HTML.
>> >> I think later browsers are more forgiving.
>> >> Are you using tables?
>> >> I think table rendering in NS4.7 was really slow.
>>
>> What web servers are you using?
>> Maybe they are returning different headers.
No more ideas. It might be since the Apache code, PHP code, Netscape code is different on Windows. It could also be the network connection from the servers to your browser is different.
attached mail follows:
Thanks anyway
--- Bob Lockie <bjlockie
lockie.ca> wrote:
> On Fri, 26 Jul 2002 10:33:46 -0700 (PDT), Harry Yu
> wrote:
>
> >Both are running Apache. I'm using the Windows
> >machine as a development box. The web server and
> php
> >configuration are very close.
> >
> >
> >--- Bob Lockie <bjlockie
lockie.ca> wrote:
> >>
> >> >I have no problem with Netscape 4.7 when
> connecting
> >> to
> >> >Windows 2000 running the same script. Also, I
> >> don't
> >> >have any nested tables in the html. Any other
> >> ideas?
> >> >
> >> >Thanks,
> >> >Harry
> >> >
> >> >--- Bob Lockie <bjlockie
lockie.ca> wrote:
> >> >>
> >> >> >[snip]
> >> >> >I'm trying to generate dynamic buttons with
> text
> >> >> from mysql database.
> >> >> >Everything is fine except that the images are
> >> >> displaying very slow in
> >> >> >Netscape 4.7. Internet Explorer, Netscape 6
> and
> >> >> Mozilla are very fast. I'm
> >> >> >running Apache 1.3.26, PHP 4.2.2, GD 1.6.2 on
> >> >> Linux. Also, I have the same
> >> >> >scripts running in Windows 2000 and I don't
> have
> >> >> this problem with Netscape.
> >> >> >The following are the scripts:
> >> >> >
> >> >> >Has anyone experience this problem before?
> I'm
> >> not
> >> >> sure whether Apache,
> >> >> >PHP, or GD is causing this.
> >> >> >[/snip]
> >> >> >
> >> >> >I am running various browsers and have never
> >> seen
> >> >> this type of behavior. If
> >> >> >the same script is good in IE, NS6, and Moz
> >> could
> >> >> it be that there is
> >> >> >something with NS4.7? I have just tested IE6,
> >> NS6,
> >> >> Moz1.0, and NS4.7
> >> >> >accessing the same script on the same server
> and
> >> >> saw no problems (save for
> >> >> >NS4.7 barfing on some of the CSS).
> >> >>
> >> >> Check the generated HTML.
> >> >> I think later browsers are more forgiving.
> >> >> Are you using tables?
> >> >> I think table rendering in NS4.7 was really
> slow.
> >>
> >> What web servers are you using?
> >> Maybe they are returning different headers.
>
> No more ideas.
> It might be since the Apache code, PHP code,
> Netscape code is different on Windows.
> It could also be the network connection from the
> servers to your browser is different.
>
>
>
__________________________________________________ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com
attached mail follows:
On Fri, Jul 26, 2002 at 03:19:26PM +0200, Nicklas af Ekenstam wrote: > > Apply above regexp to a string and have it extract all hyperlinks in that string > and return them in an array.
So, look at the manual, www.php.net/ereg. Examine the list of functions. Which of them sound like the one you want? Read the manual about that funciton. Write some code according to what the manual says. Does it work? Yes? Great. No? Hack a bit to figure out how to make it do what you want.
--Dan
--
PHP classes that make web design easier
SQL Solution | Layout Solution | Form Solution
sqlsolution.info | layoutsolution.info | formsolution.info
T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409
attached mail follows:
Hello again..
I have another compile problem, I'm wondering if someone can help me. I've built and installed Apache 2.0.39 and am recompiling PHP4.2.2. Below are the details..
./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-zlib=/usr --with-oci8=`dbhome`
Compiling... Entering director '/php-4.2.2/sapi/apache2filter' /bin/sh /php-4.2.2/libtool --silent --mode=compile gcc -I. -I/php4.2.2/sapi/apache2filter -I/php4.2.2/main -I/php-4.2.2 -I/usr/local/apache2/include -I/php-4.2.2/Zend -I/php-4.2.2/ext/mysql/libmysql -I/export/home/oracleuser/OraHome1/rdbms/public -I/export/home/oracleuser/OraHome1/rdbms/demo -I/php-4.2.2/ext/xml/expat -D_POSIX_PTHREAD_SEMANTICS -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT -I/php-4.2.2/TSRM -DTHREAD=1 -g -O2 -pthreads -DZTS -prefer-pic -c php_functions.c php_functions.c:93:27: missing binary operator before '('
This is the error...
Thanks all.
attached mail follows:
Searching the list archives will reveal the answer. I've answered this exact question several times this past week...
-- Aaron Gould agouldpartscanada.com Web Developer
----- Original Message ----- From: "Frank S. Kicenko" <frank.kicenko
amjack.ca> To: <php-general
lists.php.net> Sent: Friday, July 26, 2002 10:15 AM Subject: [PHP] PHP / Apache 2.0.39 issues
Hello again..
I have another compile problem, I'm wondering if someone can help me. I've built and installed Apache 2.0.39 and am recompiling PHP4.2.2. Below are the details..
./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-zlib=/usr --with-oci8=`dbhome`
Compiling... Entering director '/php-4.2.2/sapi/apache2filter' /bin/sh /php-4.2.2/libtool --silent --mode=compile gcc -I. -I/php4.2.2/sapi/apache2filter -I/php4.2.2/main -I/php-4.2.2 -I/usr/local/apache2/include -I/php-4.2.2/Zend -I/php-4.2.2/ext/mysql/libmysql -I/export/home/oracleuser/OraHome1/rdbms/public -I/export/home/oracleuser/OraHome1/rdbms/demo -I/php-4.2.2/ext/xml/expat -D_POSIX_PTHREAD_SEMANTICS -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT -I/php-4.2.2/TSRM -DTHREAD=1 -g -O2 -pthreads -DZTS -prefer-pic -c php_functions.c php_functions.c:93:27: missing binary operator before '('
This is the error...
Thanks all.
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Yes I found it... thank you!
-----Original Message-----
From: Aaron Gould [mailto:webdevel
partscanada.com]
Sent: Friday, July 26, 2002 9:56 AM
To: Frank S. Kicenko; php-general
lists.php.net
Subject: Re: [PHP] PHP / Apache 2.0.39 issues
Searching the list archives will reveal the answer. I've answered this exact question several times this past week...
-- Aaron Gould agouldpartscanada.com Web Developer
----- Original Message ----- From: "Frank S. Kicenko" <frank.kicenko
amjack.ca> To: <php-general
lists.php.net> Sent: Friday, July 26, 2002 10:15 AM Subject: [PHP] PHP / Apache 2.0.39 issues
Hello again..
I have another compile problem, I'm wondering if someone can help me. I've built and installed Apache 2.0.39 and am recompiling PHP4.2.2. Below are the details..
./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-zlib=/usr --with-oci8=`dbhome`
Compiling... Entering director '/php-4.2.2/sapi/apache2filter' /bin/sh /php-4.2.2/libtool --silent --mode=compile gcc -I. -I/php4.2.2/sapi/apache2filter -I/php4.2.2/main -I/php-4.2.2 -I/usr/local/apache2/include -I/php-4.2.2/Zend -I/php-4.2.2/ext/mysql/libmysql -I/export/home/oracleuser/OraHome1/rdbms/public -I/export/home/oracleuser/OraHome1/rdbms/demo -I/php-4.2.2/ext/xml/expat -D_POSIX_PTHREAD_SEMANTICS -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT -I/php-4.2.2/TSRM -DTHREAD=1 -g -O2 -pthreads -DZTS -prefer-pic -c php_functions.c php_functions.c:93:27: missing binary operator before '('
This is the error...
Thanks all.
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
I think this has been answered a few times in the last few days.
I believe a guy by the name of Aaron searched high and low and found the solution. It will be a popular one so I'll quote him again.
||||||||||||||||||||||||||||||||| This will allow you to compile PHP 4.2.x as a shared object into Apache 2.0.39.
Credits to somebody on Google Groups (I can't recall, but I needed an answer to this too a couple weeks back)...
1. Open up the file php_functions.c in /sapi/apache2filter/ 2. Change MODULE_MAGIC_AT_LEAST to AP_MODULE_MAGIC_AT_LEAST (Note the addition of "AP_") 3. Save the php_functions.c file and try running configure again
Keep in mind this is experimental and thus should not be used on production web sites (even though we've been using Apache 2.0.39+PHP 4.2.1/4.2.2 for a few weeks without issues on two of our servers). ||||||||||||||||||||||||
Thanks to Aaron for the hard work and dedication finding this neat little hack!!! :-)
Jim Grill
Support
Web-1 Hosting
http://www.web-1hosting.net
----- Original Message -----
From: "Frank S. Kicenko" <frank.kicenko
amjack.ca>
To: <php-general
lists.php.net>
Sent: Friday, July 26, 2002 9:15 AM
Subject: [PHP] PHP / Apache 2.0.39 issues
Hello again..
I have another compile problem, I'm wondering if someone can help me. I've built and installed Apache 2.0.39 and am recompiling PHP4.2.2. Below are the details..
./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-zlib=/usr --with-oci8=`dbhome`
Compiling... Entering director '/php-4.2.2/sapi/apache2filter' /bin/sh /php-4.2.2/libtool --silent --mode=compile gcc -I. -I/php4.2.2/sapi/apache2filter -I/php4.2.2/main -I/php-4.2.2 -I/usr/local/apache2/include -I/php-4.2.2/Zend -I/php-4.2.2/ext/mysql/libmysql -I/export/home/oracleuser/OraHome1/rdbms/public -I/export/home/oracleuser/OraHome1/rdbms/demo -I/php-4.2.2/ext/xml/expat -D_POSIX_PTHREAD_SEMANTICS -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT -I/php-4.2.2/TSRM -DTHREAD=1 -g -O2 -pthreads -DZTS -prefer-pic -c php_functions.c php_functions.c:93:27: missing binary operator before '('
This is the error...
Thanks all.
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
>Hello again.. > >I have another compile problem, I'm wondering if someone >can help me. I've built and installed Apache 2.0.39 and am recompiling >PHP4.2.2. Below are the details.. > >./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-zlib=/usr >--with-oci8=`dbhome` > >Compiling... >Entering director '/php-4.2.2/sapi/apache2filter' >/bin/sh /php-4.2.2/libtool --silent --mode=compile gcc -I. >-I/php4.2.2/sapi/apache2filter -I/php4.2.2/main -I/php-4.2.2 >-I/usr/local/apache2/include -I/php-4.2.2/Zend >-I/php-4.2.2/ext/mysql/libmysql >-I/export/home/oracleuser/OraHome1/rdbms/public >-I/export/home/oracleuser/OraHome1/rdbms/demo -I/php-4.2.2/ext/xml/expat >-D_POSIX_PTHREAD_SEMANTICS -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT >-I/php-4.2.2/TSRM -DTHREAD=1 -g -O2 -pthreads -DZTS -prefer-pic -c >php_functions.c >php_functions.c:93:27: missing binary operator before '('
Use Apache 1.3.26 with PHP 4.2.2. Apache 2 support is experimental at this time. If you really want to use Apache2, do a search on google.
attached mail follows:
I'm getting this error when I try to configure php for install on Linux.
"cannot find output from lex giving up"
Where can I download lex. I'm using gcc 3.1
__________________________________________________ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com
attached mail follows:
I'm getting this error when I try to configure php for install. Where can I download lex. I'm using gcc 3.1
__________________________________________________ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com
attached mail follows:
This article help me a lot: http://www.webmasterbase.com/article.php?pid=98&aid=525 Try to locate *flex* not *lex* on your distribution CD's or goto http://www.gnu.org/software/flex/flex.html
Success
René
Daniel Guerrier wrote:
>I'm getting this error when I try to configure php for
>install on Linux.
>
>"cannot find output from lex giving up"
>
>Where can I download lex.
>I'm using gcc 3.1
>
>
>
>__________________________________________________
>Do You Yahoo!?
>Yahoo! Health - Feel better, live better
>http://health.yahoo.com
>
>
> ------------------------------------------------------------------------
>
> Subject:
> cannot find output from lex - Installing PHP 4.2.2
> From:
> Daniel Guerrier <dan_guerrier
yahoo.com>
> Date:
> Fri, 26 Jul 2002 05:44:04 -0700 (PDT)
> To:
> php user group <php-general
lists.php.net>
>
>
>I'm getting this error when I try to configure php for
>install.
>Where can I download lex.
>I'm using gcc 3.1
>
>
>__________________________________________________
>Do You Yahoo!?
>Yahoo! Health - Feel better, live better
>http://health.yahoo.com
>
>
>
attached mail follows:
hi guys i am having major caching issues in phpMyAdmin when i moved to apache 2.0.39 has anyone else expeirence this ? its sending me round the bend , i cant view my mysql tables when i create them , i have to removed temp internet files and hit refresh to get them to view
attached mail follows:
Electroteque em Friday 26 July 2002 11:19 foi agraciado com uma resposta por:
> hi guys i am having major caching issues in phpMyAdmin when i moved to > apache 2.0.39 has anyone else expeirence this ? its sending me round the > bend , i cant view my mysql tables when i create them , i have to removed > temp internet files and hit refresh to get them to view
Yes! But only with the Opera navigator, and while using localhost. With Internet Explorer, doesn't happen.
-- -- http://gnet.inerciasensorial.com.br
attached mail follows:
Well, the original question is actually a good one. I was faced with it when I first tried doing free-lance. I had programming and database experience (MS Access, MSSQL, VB...everyone can barf now), a little html experience but no experience combining the two.
The first people to give me jobs and references were friends. They trusted me and I think that is what helped make the process a success. At first it was very long hours as I studied and learned ASP (barf again), JavaScript, development of graphics and the more advanced HTML options.
I told them that I would charge them about $60/hour and provided estimates of the number of hours it would take to develop something. Truth is that intitally I wound up spending a lot more time on each project than I expected. but kept to my quotes As I learned I was able to shorten the time frame. And I also built a library of code that I was able to apply to other clients. I also developed a list of sites, newsgroups and listserves to get answers or code from when I hit a roadblock.
As for the price, some people balked at that rate. Truth is in Washington DC that was below market. And while some people would say 'well you were only earning xxx when you were at yyy' I explained to them that I had to factor in costs of business that I don't get paid for: invoicing, paying bills, recruiting new clients, software, hardware, my own benefits and so forth.
Overall, while I did not make as much as I hoped, the experience was a tremendous value. Working for one self makes you realize that each hour you are not working you are not making money (um like my spending time to answer this right now <grin>). It really increases your productivity in that way. I also used down time to persue projects that I was simply interested in. There were perks, I got to deduct the cost of my cell phone and DSL as business expenses.
The down side is that I was literally working in my closet. I didn't get out nearly as much as I probably should have. And living where you work is not for everyone. Furthermore, I hated invoicing, paying bills and other administrative matters. When my computer went down (power supply) I had to set up an old computer to use for back up (word to the wise here).
I also had to learn a lot more up and down wind from me. In other words, I had to learn some server administration and even more about hardware specs and configuration. I wound up setting up my home computer as a web server using my DSL connection. I highly recommend this as it will allow you to host your sites until the client approves and you post to their site. It is good to have a working model they can review with you. You will find that they change their minds alot.
If I could do one other thing differently, I would have purchased a laptop going into it. It would have afforded me a lot more flexibility of getting out of the house and working at the coffee shop or somewhere else. I have one now (dual boot with WinXP and Linux-Red-Hat-MYSQL-PHP-Apache), it is worth the extra costs.
Good luck and keep us posted.
Paul
David Buerer wrote:
> And Tyler...rest assured you would never be working for me with an
> attitude
> like that. Nor would I ever recommend that you work for one of my
> clients.
>
> It's not about making as much as you can, it's about making what is fair,
> deserved, and reasonable. Someone else said that what we're providing is
> a service. He's right. First you consult with your clients,then you go sit
> in a dark room and make it happen. I think that most freelancers will
> agree that the job is actually about 30% code writing and 70% consultant.
> Consulting and providing quality service is about relationships, honesty,
> and ultimatly trust. Trying to rape your clients just because you can
> will not do any of the above.
>
> That's just my point of view.....
>
> -----Original Message-----
> From: Tyler Longren [mailto:tyler
captainjack.com]
> Sent: Thursday, July 25, 2002 9:05 AM
> To: Martin Clifford
> Cc: php-general
lists.php.net
> Subject: Re: [PHP] Paying Job...
>
>
> Why even bother charging money if you aren't out to make as much as you
> can? That's just my point of view.
>
> tyler
>
> On Thu, 25 Jul 2002 11:59:28 -0400
> "Martin Clifford" <MLC1
nrc.gov> wrote:
>
>> <<resists the urge to debate ethics>>
>>
>> Why didn't you just say, "Charge by whichever will screw the client
>> the worst."? Jesus.
>>
>> Martin
>>
>> >>> Tyler Longren <tyler
captainjack.com> 07/25/02 11:44AM >>>
>> Charge by which ever will get you the most money.
>>
>> tyler
>>
>> On Thu, 25 Jul 2002 11:46:38 -0400
>> Gerard Samuel <gsam
trini0.org> wrote:
>>
>> > Basically, someone is looking to get a database driven site built,
>> > and Ive never written code for money before. Im looking for advice,
>> > as to how the experienced coders in here charge
>> >
>> > for their work.
>> > Do you charge by the page, script or by the hour (that would be
>> > nice).
>> >
>> > Thanks for any input you may provide...
>> >
>> > --
>> > Gerard Samuel
>> > http://www.trini0.org:81/
>> > http://dev.trini0.org:81/
>> >
>> >
>> >
>> > --
>> > PHP General Mailing List (http://www.php.net/)
>> > To unsubscribe, visit: http://www.php.net/unsub.php
>> >
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>
attached mail follows:
>I also had to learn a lot more up and down wind from me. In other words, I >had to learn some server administration and even more about hardware specs >and configuration. I wound up setting up my home computer as a web server >using my DSL connection. I highly recommend this as it will allow you to >host your sites until the client approves and you post to their site. It >is good to have a working model they can review with you. You will find >that they change their minds alot. > >If I could do one other thing differently, I would have purchased a laptop >going into it. It would have afforded me a lot more flexibility of getting >out of the house and working at the coffee shop or somewhere else. I have >one now (dual boot with WinXP and Linux-Red-Hat-MYSQL-PHP-Apache), it is >worth the extra costs.
Word to those.
________________________--__-______-______________ eat pasta type fasta
attached mail follows:
I would like to thank everyone for their comments on this subject. I quoted an estimate to them and they went for it. Someone posted a link to template contracts yesterday, but I cannot find it in the mailing list archive. If you know of a site, please let me know. Hopefully I dont have any problems coding it. They want the site to accept payments online. Never did that before.
Wish me luck....
Jeff Lewis wrote:
>Make absolute SURE you have a contract and the payment terms are outlined.
>I've been burned on a smaller contract (600 US) but it's quite annoying.
>
>Jeff
>----- Original Message -----
>From: "Gerard Samuel" <gsam
trini0.org>
>To: "php-gen" <php-general
lists.php.net>
>Sent: Thursday, July 25, 2002 11:46 AM
>Subject: [PHP] Paying Job...
>
>
>
>
>>Basically, someone is looking to get a database driven site built,
>>and Ive never written code for money before.
>>Im looking for advice, as to how the experienced coders in here charge
>>for their work.
>>Do you charge by the page, script or by the hour (that would be nice).
>>
>>Thanks for any input you may provide...
>>
>>--
>>Gerard Samuel
>>http://www.trini0.org:81/
>>http://dev.trini0.org:81/
>>
>>
>>
>>--
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>>
>>
>>
>
>
>
>
>
-- Gerard Samuel http://www.trini0.org:81/ http://dev.trini0.org:81/
attached mail follows:
> From: "Gerard Samuel" <gsam
trini0.org>
> Sent: Friday, July 26, 2002 1:07 PM
> Subject: Re: [PHP] Paying Job...
> Someone posted a link to template contracts yesterday, but I cannot find
> it in the mailing list archive.
>> Bret >> Find a contractor or find a contract at Tech-Temp.com ^^^^^^^^^^^^^^^^^^^^^^ I think this is what you were referring to but it's for finding contract work, and not a legal contract.
>> Jay Blanchard had said: >> d. HAVE A CONTRACT!!!! There are many good examples on the web.
That's about it.
attached mail follows:
Good day,
I've recently had a need to write a standalone script that needs to fork off a number of children during its operation, and I'd like to use PHP since I've already written most of the functions in a web application I did in PHP. But, I'm now not so sure if that's feasible.
According to the docco, process control is supplied by the "pcntl" module which isn't compiled into PHP by default (and doesn't appear to be compiled into the 4.1.2 Red Hat RPMs that are on the machine). The documentation also describes it as "experimental", although that could just be old documentation...
The program would be a production system... before I proceed trying to recompile support in, could I get some feedback on just how reliable it is? Should I be trying to do this in another language instead?
Thanks in advance,
============================ Darren Gamble Planner, Regional Services Shaw Cablesystems GP 630 - 3rd Avenue SW Calgary, Alberta, Canada T2P 4L4 (403) 781-4948
attached mail follows:
[snip] I've recently had a need to write a standalone script that needs to fork off a number of children during its operation, and I'd like to use PHP since I've already written most of the functions in a web application I did in PHP. But, I'm now not so sure if that's feasible.
According to the docco, process control is supplied by the "pcntl" module which isn't compiled into PHP by default (and doesn't appear to be compiled into the 4.1.2 Red Hat RPMs that are on the machine). The documentation also describes it as "experimental", although that could just be old documentation...
The program would be a production system... before I proceed trying to recompile support in, could I get some feedback on just how reliable it is? Should I be trying to do this in another language instead? [/snip]
If by children you mean server processes or OS processes you may be able to use exec() or one of it's variations; http://www.php.net/manual/en/function.exec.php Could you more clearly describe what it is you would like to do, such as "run this external script" or "move this file"? This would help...
Jay
Nothing is impossible for the man who doesn’t have to do it himself
************************************* * Want to meet other PHP developers * * in your area? Check out: * * http://php.meetup.com/ * * No developer is an island ... * *************************************
attached mail follows:
Good day,
Thanks for your reply.
> > I've recently had a need to write a standalone script that > > needs to fork off
> a number of children during its operation, > If by children you mean server processes or OS processes you > may be able to > use exec() or one of it's variations;
I had considered trying to use something like exec(), but it would have to be written a lot differently. Perhaps the group could give some suggestions?
I need to write a rrdtool front-end that will query a series of hosts and collect information so that graphs can be created for them. All of the information I need is in LDAP, which I've already written neat little functions to retrieve them and process the hosts and "services" which represents the graphs.
So, the program needs to get the information out of LDAP, collect the data sources for rrdtool for each graph (for those not familiar with it, rrdtool doesn't collect the information for you) and then call rrdtool to update the graphs and create the graph files for new graphs, if necessary.
Now, a single-threaded process wouldn't be able to poll all of the graphs in time (most of the time is spent waiting for all of the SNMP replies), so I'd like to have the main program fork off children to actually perform the work. At least, that's the best way I can think of to do it.
The only way I can think of do this without forking is to start up completely separate processes that do the polling, and somehow have them independently figure out which hosts/graphs in LDAP that it has been "assigned" to poll.
I wrote something similar in Perl for MRTG a couple of years ago that had a MySQL backend, but after using rrdtool I am not going back to MRTG. =) Perl would work nicely for what I want to do, but a lot of it is already done in PHP and it would sure be nice to share includes between the two applications.
There's the program. What would people suggest?
============================ Darren Gamble Planner, Regional Services Shaw Cablesystems GP 630 - 3rd Avenue SW Calgary, Alberta, Canada T2P 4L4 (403) 781-4948
attached mail follows:
Hi,
Is there a way to change the value of a global variable when someon clicks a <a href> URL link on a web page?
attached mail follows:
[snip] Is there a way to change the value of a global variable when someon clicks a <a href> URL link on a web page? [/snip]
If the variable is sent via GET i.e.;
http://something.com/foo.php?bar=stuff
then you could;
$bar = $_GET['bar']; //where $bar is the global to be changed, $bar would now = stuff
HTH!
Jay
Next mood swing…6 minutes
************************************* * Want to meet other PHP developers * * in your area? Check out: * * http://php.meetup.com/ * * No developer is an island ... * *************************************
attached mail follows:
Why am I getting this error? My statement is:
SELECT * FROM shots WHERE shot_num = MAX(shot_num) LIMIT 1;
There is one record in the table "shots". Its shot_num value is 0.
attached mail follows:
Alexander Ross wrote: > Why am I getting this error? My statement is: > > SELECT * FROM shots WHERE shot_num = MAX(shot_num) LIMIT 1; > > > There is one record in the table "shots". Its shot_num value is 0.
SELECT * FROM shots ORDER BY shot_num DESC LIMIT 1
mvh Johan
attached mail follows:
I have a redirect i would like to do using php. It will go something like this if (mysql_db_query ($dbname, $query, $link)) { {redirect would go here} } else { {a different location on this redirect here}
How can i accomplish this? i just do not know php well enough to code the redirect. Please help. Thanks in advance and for all of the past help.
_________________________________________________________________ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx
attached mail follows:
[snip] I have a redirect i would like to do using php. It will go something like this if (mysql_db_query ($dbname, $query, $link)) { {redirect would go here} } else { {a different location on this redirect here}
How can i accomplish this? i just do not know php well enough to code the redirect. Please help. Thanks in advance and for all of the past help. [/snip]
Use the header() function
http://www.php.net/manual/en/function.header.php
HTH!
Jay
My reality check bounced
************************************* * Want to meet other PHP developers * * in your area? Check out: * * http://php.meetup.com/ * * No developer is an island ... * *************************************
attached mail follows:
if( ___ ) { header("Location: http://www.domain.com/itworked.php"); } else { header("Location: http://www.domain.com/error.php"); }
"Tyler Durdin" <linuxgeek23
hotmail.com> wrote in message
news:F69CWO6hm8Ua8d9Ee4z00025777
hotmail.com...
>
> I have a redirect i would like to do using php. It will go something like
> this
> if (mysql_db_query ($dbname, $query, $link)) {
> {redirect would go here}
> } else {
> {a different location on this redirect here}
>
> How can i accomplish this? i just do not know php well enough to code the
> redirect. Please help. Thanks in advance and for all of the past help.
>
> _________________________________________________________________
> MSN Photos is the easiest way to share and print your photos:
> http://photos.msn.com/support/worldwide.aspx
>
attached mail follows:
I already tried that and i got an error that said Cannot add header information - headers already sent by (another snippet of code I have in the page.
>Use the header() function > >http://www.php.net/manual/en/function.header.php > *************************
_________________________________________________________________ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx
attached mail follows:
> I have a redirect i would like to do using php. It will go something like > this > if (mysql_db_query ($dbname, $query, $link)) { > {redirect would go here} > } else { > {a different location on this redirect here} > > How can i accomplish this? i just do not know php well enough to code the > redirect. Please help. Thanks in advance and for all of the past help.
if (mysql_db_query ($dbname, $query, $link)) { header("Location: http://someurl"); } else { header("Location: http://Adifferentlocation");
Look into the header()-function at http://www.php.net/manual/en/function.header.php
First rule of header() is: You cannot send any data before you send a header() (if you don't use the Output buffering-functions).
-Jome
attached mail follows:
This is the only way I've figured out how to do it. It seems to work really well.
if (mysql_db_query ($dbname, $query, $link)) { gotourl("myurl1");} } else { gorourl("myurl2");}
function gotourl(myurl) { echo "<SCRIPT language=javascript>"; echo " window.location=$myurl;"; echo "</SCRIPT>\n"; }
-----Original Message-----
From: Tyler Durdin [mailto:linuxgeek23
hotmail.com]
Sent: Friday, July 26, 2002 8:14 AM
To: php-general
lists.php.net
Subject: [PHP] php redirect
I have a redirect i would like to do using php. It will go something like this if (mysql_db_query ($dbname, $query, $link)) { {redirect would go here} } else { {a different location on this redirect here}
How can i accomplish this? i just do not know php well enough to code the redirect. Please help. Thanks in advance and for all of the past help.
_________________________________________________________________ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
[snip] This is the only way I've figured out how to do it. It seems to work really well.
if (mysql_db_query ($dbname, $query, $link)) { gotourl("myurl1");} } else { gorourl("myurl2");}
function gotourl(myurl) { echo "<SCRIPT language=javascript>"; echo " window.location=$myurl;"; echo "</SCRIPT>\n"; } [/snip]
Isn't this ASP....? ;^]
Jay
My other car is a broom
************************************* * Want to meet other PHP developers * * in your area? Check out: * * http://php.meetup.com/ * * No developer is an island ... * *************************************
attached mail follows:
Learning about HTTP protocol helps a LOT with understanding headers. Basically, the headers are generated by the server to tell the client (browser) what to do. If you send ANYTHING (even a hard return) before the header function is invoked then you will get this error. In essence, if you are going to use the header() function without output buffering, then it should be just like this:
¯--top of text editor---- <?php header("Location: blah.php"); ?> ¯-- End of text editor----
Martin Clifford Homepage: http://www.completesource.net Developer's Forums: http://www.completesource.net/forums/
>>> "Tyler Durdin" <linuxgeek23
hotmail.com> 07/26/02 11:21AM >>>
I already tried that and i got an error that said Cannot add header information - headers already sent by (another snippet of code I have in the page.
>Use the header() function > >http://www.php.net/manual/en/function.header.php > *************************
_________________________________________________________________ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
[snip] Learning about HTTP protocol helps a LOT with understanding headers. Basically, the headers are generated by the server to tell the client (browser) what to do. If you send ANYTHING (even a hard return) before the header function is invoked then you will get this error. In essence, if you are going to use the header() function without output buffering, then it should be just like this: [/snip]
As said before you can use Output Buffering to prevent this;
http://www.php.net/manual/en/function.ob-start.php
HTH!
Jay
p.s. Martin, did you figure out how to do the random quote mail tag? Maybe we should have a contest....
Keep the Earth clean.it's not Uranus!
************************************* * Want to meet other PHP developers * * in your area? Check out: * * http://php.meetup.com/ * * No developer is an island ... * *************************************
attached mail follows:
What's ASP????
I don't know if and haven't learned it so it couldn't be. After all, how many programming languages does one need to know??
-----Original Message-----
From: Jay Blanchard [mailto:jay.blanchard
niicommunications.com]
Sent: Friday, July 26, 2002 8:27 AM
To: 'David Buerer'; php-general
lists.php.net
Subject: RE: [PHP] php redirect
[snip] This is the only way I've figured out how to do it. It seems to work really well.
if (mysql_db_query ($dbname, $query, $link)) { gotourl("myurl1");} } else { gorourl("myurl2");}
function gotourl(myurl) { echo "<SCRIPT language=javascript>"; echo " window.location=$myurl;"; echo "</SCRIPT>\n"; } [/snip]
Isn't this ASP....? ;^]
Jay
My other car is a broom
************************************* * Want to meet other PHP developers * * in your area? Check out: * * http://php.meetup.com/ * * No developer is an island ... * *************************************
attached mail follows:
>>I don't know if and haven't learned it so it couldn't be. After all, how many programming languages does one need to know??<<
Heh heh heh. Jack of all trades, master of some. That's how I look at it. I'd say you need to know a little of everything. I know (X)HTML, CSS-1-2-P, JS, PHP, SQL, etc. The list just goes on. And the thing is, I use ALL of them ALL the time ;o)
-----Original Message-----
From: Jay Blanchard [mailto:jay.blanchard
niicommunications.com]
Sent: Friday, July 26, 2002 8:27 AM
To: 'David Buerer'; php-general
lists.php.net
Subject: RE: [PHP] php redirect
[snip] This is the only way I've figured out how to do it. It seems to work really well.
if (mysql_db_query ($dbname, $query, $link)) { gotourl("myurl1");} } else { gorourl("myurl2");}
function gotourl(myurl) { echo "<SCRIPT language=javascript>"; echo " window.location=$myurl;"; echo "</SCRIPT>\n"; } [/snip]
Isn't this ASP....? ;^]
Jay
My other car is a broom
************************************* * Want to meet other PHP developers * * in your area? Check out: * * http://php.meetup.com/ * * No developer is an island ... * *************************************
Martin Clifford Homepage: http://www.completesource.net Developer's Forums: http://www.completesource.net/forums/
attached mail follows:
[snip] What's ASP????
I don't know if and haven't learned it so it couldn't be. After all, how many programming languages does one need to know?? [/snip]
a. I should have looked closer, you used JavaScript. b. window.location=$myurl is used in ASP (Active Server Pages - M$), more specifically VBScript (because ASP can use 3 or 4 different languages, so M$ says)
Jay
My Karma ran over my Dogma
************************************* * Want to meet other PHP developers * * in your area? Check out: * * http://php.meetup.com/ * * No developer is an island ... * *************************************
attached mail follows:
I here ya' there Martin.
ASP is about next on my list. I'm just trying to get javascript and PHP under my belt a little better first....well ok, I'm waiting for my next paying client. I've found that you do have to use what you know to know whatever you need to do. I couldn't live without Javascript+PHP+SQL when it comes to site design. ASP is next on my list.....
-----Original Message-----
From: Martin Clifford [mailto:MLC1
nrc.gov]
Sent: Friday, July 26, 2002 8:41 AM
To: php-general
lists.php.net; jay.blanchard
niicommunications.com;
david
pladesigns.com
Subject: RE: [PHP] php redirect
>>I don't know if and haven't learned it so it couldn't be. After all, >>how many programming languages does one need to know??<<
Heh heh heh. Jack of all trades, master of some. That's how I look at it. I'd say you need to know a little of everything. I know (X)HTML, CSS-1-2-P, JS, PHP, SQL, etc. The list just goes on. And the thing is, I use ALL of them ALL the time ;o)
-----Original Message-----
From: Jay Blanchard [mailto:jay.blanchard
niicommunications.com]
Sent: Friday, July 26, 2002 8:27 AM
To: 'David Buerer'; php-general
lists.php.net
Subject: RE: [PHP] php redirect
[snip] This is the only way I've figured out how to do it. It seems to work really well.
if (mysql_db_query ($dbname, $query, $link)) { gotourl("myurl1");} } else { gorourl("myurl2");}
function gotourl(myurl) { echo "<SCRIPT language=javascript>"; echo " window.location=$myurl;"; echo "</SCRIPT>\n"; } [/snip]
Isn't this ASP....? ;^]
Jay
My other car is a broom
************************************* * Want to meet other PHP developers * * in your area? Check out: * * http://php.meetup.com/ * * No developer is an island ... * *************************************
Martin Clifford Homepage: http://www.completesource.net Developer's Forums: http://www.completesource.net/forums/
attached mail follows:
You have three common options for a redirect.
if you are redirecting BEFORE any HTML is sent to the brower, then PHP's header('Location: myscript.php'); will suit you. And once yopu've been coding for a while, you'll think up ways of evaluating your code so that you CAN make redirects before the first tag (<HTML> or <!DOCTYPE>) are sent to the browser.
You can also combine output buffering (ob_start(), etc etc) to work around this.
Option 2 is a <META> tag refresh, which may work depending on what your code looks like. I *think* valid HTML pages require the <META> tags to be in the head, although many browsers accept them anywhere.
The third option is Javascript, and I'd steer clear from it as much as you can. You don't want to rely on anything client-side (browser-side) unless you absolutely have to... if they don't have JS, then your site breaks. Very un-good!!!!
:)
Justin
> I have a redirect i would like to do using php. It will go something like > this > if (mysql_db_query ($dbname, $query, $link)) { > {redirect would go here} > } else { > {a different location on this redirect here} > > How can i accomplish this? i just do not know php well enough to code the > redirect. Please help. Thanks in advance and for all of the past help.
attached mail follows:
Well the current web-dev environment here in Melbourne, Australia is VERY Microsoft oriented at the moment. I'm happily freelancing, but have been keeping my eye on the big job websites, just in case that perfect job comes up.
I get emailed about a few jobs every day, and 90% of them are for a M$ environment.
I guess that would be some form of motivational tool for someone to learn ASP -- if there aren't any PHP jobs, then what's the point in knowing PHP?
I'm sure it's just a temporary problem here at the moment, and it'll sort itself out... but if I ever get a week without much work, I'll try and learn a bit of ASP, just so that when a client/employer ask me to use ASP, I can fumble through it, or better still, recommend PHP as an educated alternative.
Justin French
on 27/07/02 1:14 AM, David Buerer (david
pladesigns.com) wrote:
> What's ASP????
>
> I don't know if and haven't learned it so it couldn't be. After all, how
> many programming languages does one need to know??
>
>
> -----Original Message-----
> From: Jay Blanchard [mailto:jay.blanchard
niicommunications.com]
> Sent: Friday, July 26, 2002 8:27 AM
> To: 'David Buerer'; php-general
lists.php.net
> Subject: RE: [PHP] php redirect
>
>
> [snip]
> This is the only way I've figured out how to do it. It seems to work really
> well.
>
> if (mysql_db_query ($dbname, $query, $link)) {
> gotourl("myurl1");}
> } else {
> gorourl("myurl2");}
>
> function gotourl(myurl)
> {
> echo "<SCRIPT language=javascript>";
> echo " window.location=$myurl;";
> echo "</SCRIPT>\n";
> }
> [/snip]
>
> Isn't this ASP....? ;^]
>
> Jay
>
> My other car is a broom
>
> *************************************
> * Want to meet other PHP developers *
> * in your area? Check out: *
> * http://php.meetup.com/ *
> * No developer is an island ... *
> *************************************
>
>
attached mail follows:
>Well the current web-dev environment here in Melbourne, Australia is VERY
>Microsoft oriented at the moment. I'm happily freelancing, but have been
>keeping my eye on the big job websites, just in case that perfect job comes
>up.
>
>I get emailed about a few jobs every day, and 90% of them are for a M$
>environment.
>
>I guess that would be some form of motivational tool for someone to learn
>ASP -- if there aren't any PHP jobs, then what's the point in knowing PHP?
>
>
>I'm sure it's just a temporary problem here at the moment, and it'll sort
>itself out... but if I ever get a week without much work, I'll try and learn
>a bit of ASP, just so that when a client/employer ask me to use ASP, I can
>fumble through it, or better still, recommend PHP as an educated
>alternative.
>
>
>Justin French
>
>
>
>
>on 27/07/02 1:14 AM, David Buerer (david
pladesigns.com) wrote:
>
>> What's ASP????
>>
>> I don't know if and haven't learned it so it couldn't be. After all, how
>> many programming languages does one need to know??
>>
>>
>> -----Original Message-----
>> From: Jay Blanchard [mailto:jay.blanchard
niicommunications.com]
>> Sent: Friday, July 26, 2002 8:27 AM
>> To: 'David Buerer'; php-general
lists.php.net
>> Subject: RE: [PHP] php redirect
>>
>>
>> [snip]
>> This is the only way I've figured out how to do it. It seems to work really
>> well.
>>
>> if (mysql_db_query ($dbname, $query, $link)) {
>> gotourl("myurl1");}
>> } else {
>> gorourl("myurl2");}
>>
>> function gotourl(myurl)
>> {
>> echo "<SCRIPT language=javascript>";
>> echo " window.location=$myurl;";
>> echo "</SCRIPT>\n";
>> }
>> [/snip]
>>
>> Isn't this ASP....? ;^]
>>
>> Jay
>>
>> My other car is a broom
A lot of places in Canada use MS based web servers and I think PHP is mostly Unix-centric. :-) A lot of applications are only for Windows so a lot of places make the choice to go for Windows web servers. They end up buying an MS solution and most everyone who sells MS solutions is pushing ASP. I'm not an integrator but this is the way it seems to me.
attached mail follows:
I know what you mean about everything being M$.
I'm a die hard GNU fan and therefore hate everything M$, but I can think of more than one occasion where that attitude cost me some money. I somehow still believe that if I stick to my beliefs and maybe try to convert some M$ people to host their sites/apps on *nix we will eventually take down the evil Redmond devil and open source software will rule the world. </dream>
"The box read, 'windows 9x or better' so I installed Linux!" hehe
Jim Grill
Support
Web-1 Hosting
http://www.web-1hosting.net
----- Original Message -----
From: "Justin French" <justin
indent.com.au>
To: "David Buerer" <david
pladesigns.com>; "'Jay Blanchard'"
<jay.blanchard
niicommunications.com>; <php-general
lists.php.net>
Sent: Friday, July 26, 2002 11:20 AM
Subject: Re: [PHP] php redirect
> Well the current web-dev environment here in Melbourne, Australia is VERY
> Microsoft oriented at the moment. I'm happily freelancing, but have been
> keeping my eye on the big job websites, just in case that perfect job
comes
> up.
>
> I get emailed about a few jobs every day, and 90% of them are for a M$
> environment.
>
> I guess that would be some form of motivational tool for someone to learn
> ASP -- if there aren't any PHP jobs, then what's the point in knowing PHP?
>
>
> I'm sure it's just a temporary problem here at the moment, and it'll sort
> itself out... but if I ever get a week without much work, I'll try and
learn
> a bit of ASP, just so that when a client/employer ask me to use ASP, I can
> fumble through it, or better still, recommend PHP as an educated
> alternative.
>
>
> Justin French
>
>
>
>
> on 27/07/02 1:14 AM, David Buerer (david
pladesigns.com) wrote:
>
> > What's ASP????
> >
> > I don't know if and haven't learned it so it couldn't be. After all,
how
> > many programming languages does one need to know??
> >
> >
> > -----Original Message-----
> > From: Jay Blanchard [mailto:jay.blanchard
niicommunications.com]
> > Sent: Friday, July 26, 2002 8:27 AM
> > To: 'David Buerer'; php-general
lists.php.net
> > Subject: RE: [PHP] php redirect
> >
> >
> > [snip]
> > This is the only way I've figured out how to do it. It seems to work
really
> > well.
> >
> > if (mysql_db_query ($dbname, $query, $link)) {
> > gotourl("myurl1");}
> > } else {
> > gorourl("myurl2");}
> >
> > function gotourl(myurl)
> > {
> > echo "<SCRIPT language=javascript>";
> > echo " window.location=$myurl;";
> > echo "</SCRIPT>\n";
> > }
> > [/snip]
> >
> > Isn't this ASP....? ;^]
> >
> > Jay
> >
> > My other car is a broom
> >
> > *************************************
> > * Want to meet other PHP developers *
> > * in your area? Check out: *
> > * http://php.meetup.com/ *
> > * No developer is an island ... *
> > *************************************
> >
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
attached mail follows:
Try just header("Location: $PHP_SELF"); or header("Location: $SCRIPT_NAME") ...leave out http:// ...and your quotes are in the wrong place too.
Jim Grill
Support
Web-1 Hosting
http://www.web-1hosting.net
----- Original Message -----
From: "k a m e s h" <kameshn
csa.iisc.ernet.in>
To: <php-general
lists.php.net>
Sent: Friday, July 26, 2002 2:56 AM
Subject: [PHP] Help: header function
> Hi: > > After validating the login, i am using the header function to call the same > page again. The page uses session_start(). But the session variable, > namely the login id is not changed. When i refresh the page manually > session variable is changed. What is the problem? the header function i > use is header(location:"http://PHP_SELF") > > regards > kamesh > > _____________ > s kameshwaran > eEL, Dept of CSA, IISc, Bangalore - 560012 > Homepage: http://www2.csa.iisc.ernet.in/~kameshn > Phone: +91-80-3942368-111 (Lab), +91-80-3942624 (Hostel: U-95) > ____________________________________ > Eternity abides in the present.. NOW > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > >
attached mail follows:
>From: "Tech Support" <jgrill
web-1hosting.net>
> To: "k a m e s h" <kameshn
csa.iisc.ernet.in>; <php-general
lists.php.net>
>Sent: Friday, July 26, 2002 11:20 AM
>Subject: Re: [PHP] Help: header function
> Try just header("Location: $PHP_SELF"); or header("Location: $SCRIPT_NAME") > ...leave out http:// ...and your quotes are in the wrong place too.
I know that works but the spec for http/1.1 says it's supposed to have the absoluteURI including the scheme, and host, see http://www.php-faq.com/httpheaders.php#14.30. Kamesh's trouble was he was refering to something like http://mypage.php -- which was missing the host name. I've coded lots of headers() with relative URIs [i.e. header('Location: mypage.php')] without trouble (at least that I know of). Has anyone run into trouble using only the page name? Is this something to worry about or not?
attached mail follows:
>>From: "Tech Support" <jgrill
web-1hosting.net>
>> To: "k a m e s h" <kameshn
csa.iisc.ernet.in>; <php-general
lists.php.net>
>>Sent: Friday, July 26, 2002 11:20 AM
>>Subject: Re: [PHP] Help: header function
>
>
>> Try just header("Location: $PHP_SELF"); or header("Location:
>$SCRIPT_NAME")
>> ...leave out http:// ...and your quotes are in the wrong place too.
>
>I know that works but the spec for http/1.1 says it's supposed to have the
>absoluteURI including the scheme, and host,
>see http://www.php-faq.com/httpheaders.php#14.30. Kamesh's trouble was he
>was refering to something like http://mypage.php -- which was missing the
>host name. I've coded lots of headers() with relative URIs [i.e.
>header('Location: mypage.php')] without trouble (at least that I know of).
>Has anyone run into trouble using only the page name? Is this something to
>worry about or not?
I think only fully qualified domain names and paths are in the HTTP spec but most/all browsers support relative names in Location (not that they have to).
attached mail follows:
>Kamesh's trouble was he was refering to something like http://mypage.php . I figured it would save time to just get rid of the protocol and go relative.
I'm aware of the spec for header, but I have always used a relative URI and just about all the code I've seen uses relative also. I would be interested to know of any possible problems as well. I suppose it would be good practice to start using it correctly. I mean, even with trans-sid set to "on" session ID's are never sent in header redirects or anything containing a full URI anyway so it's not like it's going to mess anything up... unless you moved your code from one site to another and hard coded your full URI in all your header redirects... yikes!!. That's when a main config file would come in real handy :-)
Jim Grill
Support
Web-1 Hosting
http://www.web-1hosting.net
----- Original Message -----
From: "Matt" <mschroebel
epooch.com>
To: <php-general
lists.php.net>
Cc: <kameshn
csa.iisc.ernet.in>
Sent: Friday, July 26, 2002 11:27 AM
Subject: Re: [PHP] Help: header function
> >From: "Tech Support" <jgrill
web-1hosting.net>
> > To: "k a m e s h" <kameshn
csa.iisc.ernet.in>;
<php-general
lists.php.net>
> >Sent: Friday, July 26, 2002 11:20 AM
> >Subject: Re: [PHP] Help: header function
>
>
> > Try just header("Location: $PHP_SELF"); or header("Location:
> $SCRIPT_NAME")
> > ...leave out http:// ...and your quotes are in the wrong place too.
>
> I know that works but the spec for http/1.1 says it's supposed to have the
> absoluteURI including the scheme, and host,
> see http://www.php-faq.com/httpheaders.php#14.30. Kamesh's trouble was he
> was refering to something like http://mypage.php -- which was missing the
> host name. I've coded lots of headers() with relative URIs [i.e.
> header('Location: mypage.php')] without trouble (at least that I know of).
> Has anyone run into trouble using only the page name? Is this something
to
> worry about or not?
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
attached mail follows:
thanks for the help..
There was no problem with the syntax.. I used the correct syntax in my code: the quotes and both the host name and the script name.. i didnt mention it properly in the mail.. i have also tried it with absolute URL.. as you have mentioned the problem is: session information is not transmitted in redirection.. is there any way of resolving this problem? i wrote a single script that will allow a user to update the db, if he is logged in or it will display the login form if he is not logged .. once he logs in successfully, i call the script again so that he will be able to update the db.. pls help me..
regards kamesh
_____________ s kameshwaran eEL, Dept of CSA, IISc, Bangalore - 560012 Homepage: http://www2.csa.iisc.ernet.in/~kameshn Phone: +91-80-3942368-111 (Lab), +91-80-3942624 (Hostel: U-95) ____________________________________ Eternity abides in the present.. NOW
attached mail follows:
If you have session cookies disabled in your browser then you have to add the session ID to the redirect. If you have your cookies enabled and you are still losing the session then there must be some other problem.
no cookie compatible:
header("Location: http://someplace.com/somepage.php?PHPSESSID=" . session_id() ); exit();
if you have session.use_trans_sid = 1 or you compiled with --enable-trans-sid the session id will be automatically added to relative get or post. Both links that are not a relative URI and header redirects require that you manually append the session id to the query string to keep the session without the need for a session cookie.
Jim Grill
Support
Web-1 Hosting
http://www.web-1hosting.net
----- Original Message -----
From: "k a m e s h" <kameshn
csa.iisc.ernet.in>
To: "Tech Support" <jgrill
web-1hosting.net>
Cc: "Matt" <mschroebel
epooch.com>; <php-general
lists.php.net>
Sent: Friday, July 26, 2002 1:21 PM
Subject: Re: [PHP] Help: header function
> > thanks for the help.. > > There was no problem with the syntax.. I used the correct syntax in my > code: the quotes and both the host name and the script name.. i didnt mention > it properly in the mail.. > i have also tried it with absolute URL.. as you have mentioned the problem > is: session information is not transmitted in redirection.. is there any > way of resolving this problem? > i wrote a single script that will allow a user to update the db, if he is > logged in or it will display the login form if he is not logged .. once he > logs in successfully, i call the script again so that he will be able > to update the db.. pls help me.. > > regards > kamesh > > > _____________ > s kameshwaran > eEL, Dept of CSA, IISc, Bangalore - 560012 > Homepage: http://www2.csa.iisc.ernet.in/~kameshn > Phone: +91-80-3942368-111 (Lab), +91-80-3942624 (Hostel: U-95) > ____________________________________ > Eternity abides in the present.. NOW > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > >
attached mail follows:
I am trying to figure out how to upgrade php from 4.1.2 (which is the default that comes with redhat 7.3), to version 4.2.2. From the small amount of documentation I have been able to find on the subject, it looks like I need to download a rpm. Is this the best way to do it or would it be better to try to use the install files off of php.net, and if the php.net install files are the way to go, how would I go about installing them over the current copy of php. I know this may not be the proper list for this question but I am also sending this email to the redhat list in hopes that someone from one of these two lists can point me in the right direction. Thanks in advance for any help. Mike Fifield Charles Schwab & Co, Inc. WARNING: All e-mail sent to or from this address will be received by the Charles Schwab corporate e-mail system and is subject to archival and review by someone other than the recipient.
attached mail follows:
Frustrating!
I have scripts that do this exact thing, on this exact server, for that matter in this exact set of directories, now it will not work;
$filename = "NIIRTQWCDR." . date("Ymd") . "." . $cycle;
//open new file and write records to it $cdrfile = fopen("/usr/local/www/data.default/rcr/" . $filename, "w+"); while($cdrrow = mysql_fetch_object($dbcdr)){ fputs($cdrfile, $cdrrow->whole_record); } fclose($cdrfile); //move file into outgoing directory exec("mv /usr/local/www/data.default/rcr/$filename /usr/local/www/data.default/rcr/outgoing/$filename");
The file gets created just fine, gets populated just fine, it just will not move. *grrrr*
Jay
My mind not only wanders, sometimes it leaves completely
************************************* * Want to meet other PHP developers * * in your area? Check out: * * http://php.meetup.com/ * * No developer is an island ... * *************************************
attached mail follows:
> //move file into outgoing directory > exec("mv /usr/local/www/data.default/rcr/$filename > /usr/local/www/data.default/rcr/outgoing/$filename"); > > The file gets created just fine, gets populated just fine, it just will not > move. *grrrr*
Try
copy("/usr/local/www/data.default/rcr/".$filename, "/usr/local/www/data.default/rcr/outgoing".$filename); unlink("/usr/local/www/data.default/rcr/".$filename)
OR
$pp = popen('/bin/sh', 'w'); $command = "mv /usr/local/www/data.default/rcr/$filename /usr/local/www/data.default/rcr/outgoing/$filename"; fputs($pp, $command); pclose($fp);
Regards,
Johan
attached mail follows:
Hi All, Suppose I'm opening a socket connection to a server on some port, and I do some transactions, and generate html. But I 'm not closing the file pointer(socket). Only after the user clicks 'logout' or something should I close the file pointer. How do I do this?? I'm not understanding how to keep track of the file pointer, even after generating the html. Help.
--V Suresh --------------------------------- ANTI SPAM: http://india.cauce.org
attached mail follows:
The filepointer is closed after your script finishes executing, you cannot do it.
V_Suresh wrote:
>Hi All, > Suppose I'm opening a socket connection to a server on some >port, and I do some transactions, and generate html. But I 'm not >closing the file pointer(socket). Only after the user clicks 'logout' >or something should I close the file pointer. How do I do this?? >I'm not understanding how to keep track of the file pointer, >even after generating the html. Help. > > > >
attached mail follows:
on 26/07/02 10:50 PM, Mathieu Dumoulin (mdumoulin
groupimage.com) wrote:
> Oh, and also, i need to know how to get the default value... > > Btw, i CAN be done, or else, how does phpMyAdmin does it =P
Well then look at the source code of phpMyAdmin :P
Justin
attached mail follows:
1) Given a variable how can I echo the var's name, not its value?? 2) Is there a way for PHP function to handle a dynamic number of arguments? In other words, I want to write a function that takes any number of arguments (strings) and echos each of them with a <br> appended to each of them.
Thanks for your help everybody
attached mail follows:
1) To echo the variables name instead of it's value, surround it instead by single quotes, not double. echo '$var' OUTPUTS $var echo "$var" OUTPUTS the contents of $var
2) Checkout the func_get_args() function. http://www.php.net/manual/en/function.func-get-args.php
HTH!
Martin Clifford Homepage: http://www.completesource.net Developer's Forums: http://www.completesource.net/forums/
>>> "Alexander Ross" <alexross
bleen.net> 07/26/02 11:40AM >>>
1) Given a variable how can I echo the var's name, not its value??
2) Is there a way for PHP function to handle a dynamic number of arguments?
In other words, I want to write a function that takes any number of
arguments (strings) and echos each of them with a <br> appended to each of
them.
Thanks for your help everybody
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
on 27/07/02 1:40 AM, Alexander Ross (alexross
bleen.net) wrote:
> 1) Given a variable how can I echo the var's name, not its value??
ummm provide an example... i can't think of a time when i know the name of a $var, but can't type it... when would you have a $var but not know about it?
> 2) Is there a way for PHP function to handle a dynamic number of arguments? > In other words, I want to write a function that takes any number of > arguments (strings) and echos each of them with a <br> appended to each of > them.
I'd be doing that with an array:
<? $colors = array('red','blue','green','yellow');
foreach ( $colors as $color ) { echo "Do you like $color?<BR>\n"; }
/* output: Do you like red? Do you like blue? Do you like green? Do you like yellow? */
?>
Or, to wrap it in a function, pass the array colors to a function:
<? // untested
function spitThemOut($array) { $output = ''; foreach ($array as $item) { $output .= "{$item}<BR>"; } return $output; }
$colors = array('red','blue','green','yellow');
echo spitThemOut($colors);
/* should echo red blue green yellow */
?>
The reason I'd start with an array is because you might want to sort it, add to it later, etc etc.
Since you're a newbie, I can highly recommend looking at arrays... after a while, almost EVERYTHIGN seems easier with arrays.
But to answer your question, yes, functions can take unlimited arguments... check out the 1st user-contributed note on this page:
http://www.php.net/manual/en/functions.arguments.php
Failing that, read the chapter on functions, because there are plenty of options.
Justin French
attached mail follows:
1) echo '$variable'; // THE TRICK IS IN SINGLE QUOTES
-- Lp, Mitja "Alexander Ross" <alexrossbleen.net> wrote in message news:20020726154036.89840.qmail
pb1.pair.com... > 1) Given a variable how can I echo the var's name, not its value?? > 2) Is there a way for PHP function to handle a dynamic number of arguments? > In other words, I want to write a function that takes any number of > arguments (strings) and echos each of them with a <br> appended to each of > them. > > Thanks for your help everybody > >
attached mail follows:
Hi,
How do I compare time in php?
Eg. If I have a mysql time field I retrieve stored in $result[0][0] how do I say :
if (($result[0][0] > $result[0][0] plus ten minutes) && ($result[0][0] > '00:00:00')){ .....
}
TIA
-Steve.
attached mail follows:
You can use date() and mktime() to convert, add, subtract, whatever you can imagine, and display time in many different formats. There are some great examples here: http://www.php.net/manual/en/function.mktime.php http://www.php.net/manual/en/function.date.php
Basically you want to do is convert your time(s) into Unix time and then do your math and convert them back into whatever you want.
Jim Grill
Support
Web-1 Hosting
http://www.web-1hosting.net
----- Original Message -----
From: "Steve Bradwell" <SteveB
compxnet.com>
To: <php-general
lists.php.net>
Sent: Friday, July 26, 2002 10:53 AM
Subject: [PHP] time question.
> Hi, > > How do I compare time in php? > > Eg. If I have a mysql time field I retrieve stored in $result[0][0] how do I > say : > > if (($result[0][0] > $result[0][0] plus ten minutes) && ($result[0][0] > > '00:00:00')){ > ..... > > } > > > TIA > > -Steve. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > >
attached mail follows:
On Friday, July 26, 2002, at 05:53 PM, Steve Bradwell wrote:
> Hi,
Hi !
> How do I compare time in php? > > Eg. If I have a mysql time field I retrieve stored in $result[0][0] how > do I > say :
You can compare timesamp :
o MySQL part : use UNIX_TIMESTAMP() function http://www.mysql.com/doc/D/a/Date_and_time_functions.html
o PHP part : use mktime() function http://www.php.net/manual/en/function.mktime.php
> if (($result[0][0] > $result[0][0] plus ten minutes) && ($result[0][0] > > '00:00:00')){ > ..... > > }
Always FALSE !! You can't have $result[0][0] > $result[0][0] plus ten minutes You always have $result[0][0] > '00:00:00' So... TRUE && FALSE = FALSE
R.
attached mail follows:
> How do I compare time in php? > > Eg. If I have a mysql time field I retrieve stored in $result[0][0] how do I > say : > > if (($result[0][0] > $result[0][0] plus ten minutes) && ($result[0][0] > > '00:00:00')){
MySQL and PHP timestamps are in different formats. MySQL uses YYYYMMDDHHMMSS and PHP uses a unix timestamp, the number of seconds since January 1st, 1970.
You can use UNIXTIMESTAMP(your_column) in your query to get a PHP style unix timestamp.
Although, if you explain what you are trying to do a little better, you could probably do the comparisons a lot easier in your query and not involve PHP at all.
SELECT * FROM your_table WHERE your_column > your_column + INTERVAL 10 MINUTE AND your_column != 0
That looks equivilent to what you're trying to do in PHP. You might have to say your_column+0 != 0 to get your_column as an integer and not a string.
---John Holmes...
attached mail follows:
Thanks to all for the reply,
Sorry it wasn't very detailed, What I am doing is writing the time to a time field in mysql when a user is editing an order. Then when another admin user goes to pick the order, if a time greater than 00:00:00 exists, and that time is less than 10 minutes from the time in the database, he/she will not be able to edit the order. If it is greater than 10 minutes I will assume a connection was lost etc and allow the admin to pick the order.
I would like to be able to check that in the query, so if what you recommended will work I'll try that first.
Thanks, Steve.
-----Original Message-----
From: 1LT John W. Holmes [mailto:holmes072000
charter.net]
Sent: Friday, July 26, 2002 12:42 PM
To: Steve Bradwell; php-general
lists.php.net
Subject: Re: [PHP] time question.
> How do I compare time in php? > > Eg. If I have a mysql time field I retrieve stored in $result[0][0] how do I > say : > > if (($result[0][0] > $result[0][0] plus ten minutes) && ($result[0][0] > > '00:00:00')){
MySQL and PHP timestamps are in different formats. MySQL uses YYYYMMDDHHMMSS and PHP uses a unix timestamp, the number of seconds since January 1st, 1970.
You can use UNIXTIMESTAMP(your_column) in your query to get a PHP style unix timestamp.
Although, if you explain what you are trying to do a little better, you could probably do the comparisons a lot easier in your query and not involve PHP at all.
SELECT * FROM your_table WHERE your_column > your_column + INTERVAL 10 MINUTE AND your_column != 0
That looks equivilent to what you're trying to do in PHP. You might have to say your_column+0 != 0 to get your_column as an integer and not a string.
---John Holmes...
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
On Friday, July 26, 2002, at 11:32 AM, David Buerer wrote: > ASP is about next on my list. I'm just trying to get javascript and PHP > under my belt a little better first....well ok, I'm waiting for my next > paying client. I've found that you do have to use what you know to know > whatever you need to do. I couldn't live without Javascript+PHP+SQL > when it > comes to site design. ASP is next on my list.....
Good luck. I had a summer job once (would've been longer if my boss didn't spend all the company money and had to shut the company down) where we used ASP for all our dynamic pages. It's a joke. You go (back) to using dim statements and VBScript! Of course you can use JScript, but that's even more difficult at times. Connecting to a server? There are methods, but error reporting is not ASP's best feature. IMHO, stick with PHP, maybe a bit of Perl, but anything you can do in ASP you can do better in PHP.
c.
attached mail follows:
How can i enable PostgreSQL module? I have installed PHP 4 on IIS5, Windows 2000
attached mail follows:
Ugg.. been compiling and configuring for too many days..everything is just a fog..:-) I appreciate all the help here.. but I'm afraid I need a little more.. :-)
I can't seem to get Apache to recognize PHP... The logs state: [notice] Apache/2.0.39 (Unix) PHP/4.2.2 configured -- resuming normal operations
however I can't get the php's to display.
I have the following in the httpd.conf file;
AddType application/x-httpd-php .php LoadModule php4_module modules/libphp4.so
All other "html" pages view properly...Is there anything special I need in php.ini? There are no extensions stated in the ini..?? and PHP didn't build any other than the zlib stuff. Should I have extensions or are they in the libphp4.so library? I have set all the include paths in the ini properly..(i believe anyway)
Is php suppose to run at all... I do a "ps -ef | grep php" and it is never running...
Thanks alot...
attached mail follows:
On Fri, 26 Jul 2002 12:24:31 -0500, Frank S. Kicenko wrote:
>Ugg.. been compiling and configuring for too many days..everything is >just a fog..:-) I appreciate all the help here.. but I'm afraid I need a >little more.. :-) > >I can't seem to get Apache to recognize PHP... The logs state: >[notice] Apache/2.0.39 (Unix) PHP/4.2.2 configured -- resuming normal >operations > >however I can't get the php's to display. > >I have the following in the httpd.conf file; > >AddType application/x-httpd-php .php >LoadModule php4_module modules/libphp4.so > >All other "html" pages view properly...Is there anything special I need >in php.ini? There are no extensions stated in the ini..?? and PHP didn't >build any other than the zlib stuff. Should I have extensions or are >they in the libphp4.so library? I have set all the include paths in the >ini properly..(i believe anyway) > >Is php suppose to run at all... I do a "ps -ef | grep php" and it is >never running...
http://www.delouw.ch/linux/apache.phtml http://www.delouw.ch/linux/Apache-Compile-HOWTO/html/php.html
uncomment (remove the # at begin of line) the following lines in /usr/local/apache/conf/httpd.conf
Apache 1.3.26 default httpd.conf does lack of this entries. You have to add them instead of uncommenting
AddType application/x-httpd-php .php AddType application/x-httpd-php .phtml AddType application/x-httpd-php .php3 AddType application/x-httpd-php-source .phps
Since PHP Version 4.2.1, »register_globals« are set OFF. This can bring you in problems running PHP-Code not using the $HTTP_GET_VARS methods. To enable register_globals edit the following line in your /usr/local/lib/php.ini:
register_globals = On
attached mail follows:
>I have a user authentication system using sessions >it checks username and password against a database. >if correct it sets a variable in the session cookie (via $_SESSION) and >redirects to the protected page which checks for that variable. >if the user/pass is wrong it redirects to an error page. >if it gets to the protected page and the variable isnt set it redirects back >to the login page. > >it works when uploaded to a server Linux, Apache/1.3.24, PHP 4.1.2. >register_globals=on > >but on my local server Windows NT, Apache/2.0.39, PHP 4.2.1 using a patched >Apache 2.0 Filter, register_globals=on. It seems to redirect back to the >login page.
You CANNOT reliable set a cookie and re-direct in the same script.
Never gonna work across the board on browsers/servers.
Call it a "bug" if you like (though it's not) but it will NOT work reliably on multiple platforms.
Re-design to just send the Cookie, and then include the page they wanted in the first place.
Also, what's to stop me from setting my own Cookie? Are you using an un-guessable value for the Cookie?
-- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk.
attached mail follows:
>Hi, > >Can you tell me the steps of backup and restore the databases in Mysql? > >And can i specific a path for the backup file? > >Futhermore, i have installed the MySQL in Win2000 but i don't know how to >restore the database of MySQL from a Linux server to Win2000 MySQL.
http://mysql.com/ Search for 'mysqldump'
-- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk.
attached mail follows:
>Worked on this a bit tonight, thought it might help someone out there! I
>looked at the bottomw of phpclasses.org at what they'd done to obfuscate
>their e-mail address using JavaScript. While theirs is much more complex, I
>couldn't figure a way to do it their way when you don't know the exact
>user
domain of people in your database. I thought this might do the trick,
>at least to some extent, by separating the user and domain in the source
>code and not put them together until the mailto: link is clicked. Sorry if
>something like this has been posted before - if so, here it is again! :)
I never rely on JavaScript existing, much less working correctly for something as important as an email link actually working. YMMV.
<?php
function spaminator($email, $text = ''){
$url = str_replace('
', '%40', $email);
$text = $text ? str_replace('
', '@', $text) : $url;
return "<A HREF=mailto:$url>$text</A>";
}
?>
I understand that on older versions of AOL, this "doesn't work" but I haven't really gotten a handle on just how old the AOL is, or quite how it breaks...
-- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk.
attached mail follows:
>Hi Gurus, > >I am using PHP 4.1.1, Postgresql 7.2 and Perl 5.6.0 on Linux. > >I want to delete files in a directory,which were created 15 days back. > >I can not do it, with PHP filesystem and directory functions, as PHP runs as >"nobody" user. > >Can anybody pls. help me ?
Well...
There are several options:
1. Make the files be delete-able by "nobody" This, of course, means *ANY* other user on the system can delete them whenever they want to.
2. Use PHP (CGI) running under a cron job to delete the things that are "old" or somehow marked for deletion by the web-page. The cron job can be schedule by a real user, and will have all their powers. This is probably "safest" and "easiest" of all the options.
3. Add another mime-type to httpd.conf and run a *second* PHP as CGI under that mime-type (and filename extension) and then suExec that to run as the owner of the files. Once again, *anybody* who can use the mime-type can then run as that user, so be sure you pin-point the (using httpd.conf <Directory>) this into a directory only *YOU* can put PHP scripts, or you might as well just do 1.
4. Write a sudo shell script that allows *ONLY* the files in question (either restricted by directory or name or something similar) to be deleted by nobody.
There are probably more options...
-- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk.
attached mail follows:
>I'm currently locked in a battle with PHP and file uploads. I've >searched the list to no avail. I actually found a guy with the same >problem who ended up using perl to make this work. I'm trying to avoid >that. > >The problem is, I'm dealing with huge POST uploads (100+ mb). And
Ye Gods!
I don't think HTTP POST upload is going to be reliable for *that* size files, no matter *what* you do...
Give them an FTP account or something.
At least FTP can be "continued" (assuming the server/client are configured properly and current) when they lose their connection after 95MB...
HTTP POST can't be "continued", last I checked... At least not on most systems.
-- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk.
attached mail follows:
> > I don't think HTTP POST upload is going to be reliable for *that* size > files, no matter *what* you do...
Well from the tests I have done it has worked fine. There is no reason why it shouldn't either.
> > Give them an FTP account or something. >
No an option for hundreds of people with massive multi-tier permissions. And considering these people barely understand how to enter their username let alone use an FTP client.
> At least FTP can be "continued" (assuming the server/client are configured > properly and current) when they lose their connection after 95MB... > > HTTP POST can't be "continued", last I checked... At least not on most > systems.
They can't, but that's fine.
-reid
attached mail follows:
On Fri, 26 Jul 2002 16:05:36 -0400, Reid Sutherland wrote:
>> >> I don't think HTTP POST upload is going to be reliable for *that* size >> files, no matter *what* you do... > >Well from the tests I have done it has worked fine. There is no reason >why it shouldn't either.
Newer browser handle file transfer over HTTP well. Older browsers did not.
attached mail follows:
>I am new to using PHP on RedHat 7.3 and am running into a problem with >ldap_connect(). When I attempt to run ldap_connect, I get the error: > >Call to undefined function: ldap_connect()
Even though you said "--with-ldap=shared" it just didn't "work"
You'll have to do ./configure again and figure out why LDAP didn't get in there.
For starters, try losing the 'shared' crap. It's just not that big a deal to have it static -- Not worth pulling hair out anyway.
You can log your ./configure output better than usual using:
./configure ... 2&>1 > configure.output &
Then you can use:
tail -f configure.output
to see it scroll by, (control-C to quit) or even: less configure.output to check it later.
>The system I am working on has the default install of Redhat 7.3 with Apache >version "Apache/1.3.23". It has been suggested to me that I need to >recompile either PHP and/or Apache and am still quite new to this. The PHP >configure command is: > >'./configure' 'i386-redhat-linux' '--prefix=/usr' '--exec-prefix=/usr' >'--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' >'--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' >'--libexecdir=/usr/libexec' '--localstatedir=/var' >'--sharedstatedir=/usr/com' '--mandir=/usr/share/man' >'--infodir=/usr/share/info' '--prefix=/usr' '--with-config-file-path=/etc' >'--enable-force-cgi-redirect' '--disable-debug' '--enable-dbg=shared' >'--with-dbg-profiler' '--enable-pic' '--disable-rpath' >'--enable-inline-optimization' '--with-bz2' '--with-db3' '--with-curl' >'--with-dom=/usr' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' >'--with-png-dir=/usr' '--with-gd' '--enable-gd-native-ttf' '--with-ttf' >'--with-gdbm' '--with-gettext' '--with-ncurses' '--with-gmp' '--with-iconv' >'--with-jpeg-dir=/usr' '--with-mm' '--with-openssl' '--with-png' >'--with-pspell' '--with-regex=system' '--with-xml' '--with-expat-dir=/usr' >'--with-zlib' '--with-layout=GNU' '--enable-bcmath' '--enable-debugger' >'--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-safe-mode' >'--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' >'--enable-discard-path' '--enable-track-vars' '--enable-trans-sid' >'--enable-yp' '--enable-wddx' '--without-oci8' '--with-imap=shared' >'--with-imap-ssl' '--with-kerberos=/usr/kerberos' '--with-ldap=shared' >'--with-mysql=shared,/usr' '--with-pgsql=shared' '--with-snmp=shared,/usr' >'--with-snmp=shared' '--enable-ucd-snmp-hack' '--with-unixODBC=shared' >'--enable-memory-limit' '--enable-bcmath' '--enable-shmop' >'--enable-versioning' '--enable-calendar' '--enable-dbx' '--enable-dio' >'--enable-mcal' '--enable-mbstring' '--enable-mbstr-enc-trans' >'--with-apxs=/usr/sbin/apxs'
-- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk.
attached mail follows:
>Prolly a silly question, but I have a session process that never really >ends as it is supposed to allow the user to carry on submitting etc. > >So I don't know where and when to end the session, and if it is really >nescessary to end a session? > >Obviously a logout button will do the trick, but what about aborting >users that don't bother to logout? I presume a session will have a >timeout value? If so, how does this work? Surely there can't be a >physical time allowed for a session to stay alive? What about if I want >to have an intranet application that could ( and preferably should) be >able to be open indefinately?
It's up to you when to destroy a session.
You can alter the global time out in php.ini, and/or you could update a time stamp on every action in your session data, and if they haven't done anything in a longer time frame than you consider "right", just destroy their session and make them start over.
Keep in mind that for sensitive data, it's all too easy for a user's machine to be used while they are on a coffee-break, so long-lived sessions would not be suitable.
Also, even for public data, users have a nasty habit of forgetting their passwords that you don't make them actually use for a long time, and then you have the joy of pointing them to the "forgot" page to re-issue via email (which is also not suitable for sensitive data) because many will *NOT* think to just try to log in and get re-directed there, much less go looking for it on purpose. Oh no, it's much easier to call you up and ask what their password is, no matter how many times you tell them that it just doesn't work like that, and you don't *know* their password... Sigh.
-- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk.
attached mail follows:
>Hi, > >which version of libpng and libjpeg is needed to use the bundled libgd >in the current php tree. > >I using libpng 1.2.3 and php crashes with a segfault > >and with libjpeg62 (6b Mandrake RPM) in apache logs: > >gd-jpeg: JPEG library reports unrecoverable error: JPEG parameter struct >mismatch: library thinks size is 372, caller expects 376 > >Hmmm, maybe the bundled gd has more bugs as the 'normal' 2.0.1 (Beta) >Version?!
I'm not sure it matters so much *WHICH* version you use for those packages, as it does that the version you tell PHP you are using matches the one actually *IN* your system...
If you tell PHP you have libpng 1.2.3, and that's the headers it uses, but your OS actually has 1.2.4 or 1.2.2, it's going to crash, almost for sure. The farther apart the versions, the more quickly you'll notice the crash. Very "close" versions might have only a couple functions out of sync that will puke when you try to use them.
Uninstall all the damn RPM's, and install the tarballs. Look inside the libpng/jpeg directory and find the header files. Do a "locate" on the ones that seem pretty likely to have always been there for jpeg (eg "jpeg.h") and make sure you don't have any copies of that in your /usr/.../include/ directories. If you do, get rid of all the *.h files that came from the jpeg library, *and* the libjpeg.so files in the parallel /usr/.../lib/ directory. Then install from the tarball so that there is one, and only one, libjpeg on your entire hard-drive. Remember to do ldconfig after every "make install"
-- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk.
attached mail follows:
> >Say it is not so. > >I hear the PHP 4.2.2 will only set the last cookie delivered by a browser >to a variable in the PHP environment. > >Is this true?
Huh?
Do you mean "last cookie of the same NAME" maybe?
Because that's probably quite likely, and within 'spec' for the Cookie Spec.
They will all be in an array $_COOKIE['foo'] rather than as a global $foo by default -- You can change that in php.ini if you don't care about security, which is a Bad Idea, but might be what you have to do until you convert...
-- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk.
attached mail follows:
>I have a couple of scripts that fail with the error of: >Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result >resource in... > >I'm new to both SQL and PHP and I'm wondering if I have some setting >turned off or what. > >Here's the piece of code that is failing (the second line fails): > >$result = mysql_db_query($dbname, "SELECT * FROM tablename ORDER BY id");
if (!$result){ error_log(mysql_error()); }
> $row = mysql_fetch_array($result);
Re-load, and go check your Apache error log.
If you can't find your Apache error_log, just use "print" instead of error_log, but that's not good to have on a public web-site for your internal errors. Exposes too much info to potential abusers.
-- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk.
attached mail follows:
>I'm putting together a message board, and I'm having >problems with hitting the return(enter) key within my >textarea. > >I've looked around for a solution, I tried >wrap="hard", wrap="soft" and wrap="vitual" and none of >them worked (should they? I may have done it wrong?) >and I also tried nohardbreaks and nosoftbreaks, but I >think they may be no longer supported. > >Is this a case for regex? If so, can someone perhaps >point me to an article on how to accomplish this? >Thanks very much for any help.
Use WRAP=VIRTUAL
The other choices for WRAP are morally wrong! :-)
WRAP=VIRTUAL will give you exactly what the user typed -- Not some stupidly-wrapped text that happens to be wrapped at the size of the input box, which is irrelevant to anything resembling reality, much less one that will rip out the line breaks the user *wants* in their text.
Once you've done that, you need to be aware that the *BROWSER* don't give a damn about line breaks. Which is why when you *DISPLAY* the text to the user (not when you store it in the db!) you want to use: http://php.net/nl2br
-- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk.
attached mail follows:
>(This was from an email sent to Gabor, and the site said this address was for help) > >>This is not a definition of the $blah variable. $blah = 1; would be a definition. > > >I've never had any problems using just $blah; before, it never errored on >me once, is there any reason it does this? (by the way the version I use on >Nadrew.com is 4.2.1 and it works fine.)
It does this because you have willfully dis-regarded the warning messages!
You did so by not using error_reporting(E_ALL) at the top of your scripts, or similar setting in your php.ini or .htaccess
As a result, you have some SECURITY HOLES in your scripts.
Until 4.2.x where register_globals was turned off, a malicious user could do:
http://nadrew.com/whatever.php?blah=Hack!
Now, the $blah that your code assumes is blank is *NOT* blank, and I've put stuff into it you've never even considered might be in there... And it might be malicious code.
Now, if you were *REALLY* rigorous about checking values/data/content of *ALL* variables, and not just the ones you *thought* were coming from the user, that would be fine, but since you almost for sure didn't, it's an unacceptable risk.
-- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk.
attached mail follows:
>Hi,
>
>I found the function socket_set_block(); in ext/sockets/sockets.c (the
>function is not documented) and I tried to use it but it seems to
>doesn't take effect...
>Why doesn't this function work ? Am I doing something wrong ?
>
>Here is my code:
>
> function sockRead($length = 1) {
> socket_set_block($this->IcqSocket);
> return
socket_read($this->IcqSocket, $length,
>PHP_BINARY_READ);
> socket_set_nonblock($this->IcqSocket);
> }
Wild Guess: It takes two args: The second one to turn blocking on/off. Without supplying the arg, you're turning it "on", maybe...
-- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk.
attached mail follows:
>Hi, >I have istalled php from the red hat cd at the time i >installed red hat itself. I downloaded apache and >installed it. Can anyone tell me how to configure php >on apache server? I mean what do I do next to run php >scripts? I am totally new to all this. Please help.
You may be able to just edit the "httpd.conf" file in the Apache directory and take out the # signs in front of the lines talking about PHP, and it might just work...
If not, you're probably better off un-installing the RedHat PHP RPM, and installing current PHP from source.
-- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk.
attached mail follows:
>I have a datetime field in one of my mysql tables...when displaying some of >my records I want to display the date in the aforementioned datetime field, >but if the date is today I want to display "today" instead. If the date is >yesterday I want it to display that .... so I how do I compare the date in >my record to todays date? Thanks
There are functions in MySQL like now() and to_days() that you can use to determine how many days are between two dates.
-- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk.
attached mail follows:
>Hi > >Could someone please enlighten me on a good way to grab the value for >a given mail header once I've fetched the entire headers to a string >using php:s imap_fetchheader() function? > >For an example I would like to look for a header called List-Id which >may look like this: > >List-Id: <php-general.lists.php.net> > >And grab the value - <php-general.lists.php.net> - into a variable to >use later on in my script. > >Bonus points if you could tell me a way to parse the entire headers >into something useful like a set of key, value pairs using the header >name as key and the value as value.
Assuming they start as just one big long string, and that it's just like regular email headers:
<?php # Work with stupid servers that don't follow spec wrt \r\n: $headers = str_replace("\r\n", "\n", $headers); $headers = explode("\n", $headers); while (list(,$header) = each($headers)){ $parts = explode(":", $header); $key = $parts[0]; # Allow for : to appear later in this header: unset($parts[0]); $value = implode(":", $parts); $header_array[$key] = $value; } ?>
-- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk.
attached mail follows:
>what has to be configured, and how, on a bsd server to allow the mail() >function to work in php? using sendmail?
php.ini Use the path to sendmail there, with the -t as suggested, and *YES* the quotes *ARE* supposed to be part of it:
sendmail_path = "/path/to/sendmail -t"
You may also need to ease up restrictions in sendmail.conf so that the PHP user is *allowed* to send out email, forge headers, and other fun things that are pretty essential to making mail() useful.
You may also want to create a specific new user, different from the usual "nobody", and use that for User in httpd.conf, so that PHP (all of Apache, really) runs as 'www' or 'httpd' instead of 'nobody'
It will stop a few stupid people trying to abuse the lack of restriction on email sending...
Not *really* much of a barrier, but every little bit helps.
-- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk.
attached mail follows:
>I know I should not ask this question - but as I am not getting prompt >reply from mysql mailing list posting it here too - Just in case anybody >knows about it > >---------------------------------------- >I am trying to install the mySQL on our remote server thr putty (SSH). >Following are the set of commands given by me, > >I have downloaded mysql-3.23 for BSDi. > >1)put into /usr/home/mysql-src directory and given following 2 commands >going into >shell>cd /usr/home/mysql-src >shell>gunzip mysql-xxxx.tar.gz >shell>tar xvf mysql-xxxx.tar > >This is creating the directory mysql-xxxx >2)Config - > >shell>cd /usr/home/mysql-src/mysql-xxxx >shell>./configure -basedir=/usr/home/mysql -with-low-memory > >This command is giving me problem - saying - at the end >shell>Starting mysqld daemon with database from >/usr/home/mysql-src/mysql-xxxx/data >rm /tmp/mysql.sock - Operation not permitted >mysqld end > > >Can anybody help me in this matter - What is the meaning of it ?
There are TWO possibilities: 1. You already *HAVE* MySQL succesfully installed and running and now MySQL is saying, "Excuse me, but this little /tmp/mysql.sock file is telling me that I'm already running!"
2. You managed to crash MySQL so badly that it didn't clean up after itself, and that /tmp/mysql.sock file is a BOGUS version of 1.
You can be *SURE* which is which by doing:
ps auxwww | grep mysql
Either you see some kind of 'mysqld' in there, in which case it's already running, or you don't.
If it's *NOT* running, it's perfectly safe to just destroy the /tmp/mysql.sock file.
If it *IS* running, do *NOT* remove that file -- You will cause yourself major pains if you do.
-- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk.
attached mail follows:
>I'm looking for the global veriable that lists the page before the page that >i just came from. Anyone know what i'm talking about?
<?php phpinfo();?>
will tell you what you want to know.
-- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk.
attached mail follows:
>Hello everybody, >I hope u can help me with this. I'll be very grateful! >This file retrieves a list of files from a folder on the server and then >has to diplay a list of them. When selecting one of them in the list, it >should display a preview (i.e. its contents) in the same file. I think i >should use frames but donno how to do it :(. >Thx a lot
You don't really need a FRAME at all...
What part of this doesn't work?...
You might want a <TABLE> with one (1) row <TR> and two columns <TD> -- One for the links on the left, one for the content on the right.
> > > ><?PHP >$d = dir("/home/mcms/public_html/MCMS/Alia/pageTmp"); >?> > ><html> ><head> ></head> ><body>
<TABLE><TR><TD>
> <form method="POST" action="showTree.php"> > <p><b>Plz select a page template:</b></p> > <p><select size="1" name="pageList" > > ><?PHP > while (false !== ($entry = $d->read())) > { > if ($entry != '.' && $entry != '..') > echo '<option value="'.$entry.'">'.$entry.'</option>.\n'; > } >?> > > </select></p> > <p><input type="submit" value="Create" name="createButton" > > <input type="hidden" >value="/home/mcms/public_html/MCMS/Alia/pageTmp/" name="pageField" /></p>
</FORM> </TD><TD>
><?PHP >/*if (!$file = fopen("/home/mcms/public_html/MCMS/Alia/pageTmp/ >$pageList", "rb")){ > echo("couldnt open the file."); >} else{ > fpassthru($file); >}*/ >?> > ######></form>
</TD></TR></TABLE>
></body> ></html> > ><?PHP >$d->close(); >?> > >
-- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk.
attached mail follows:
>Hello, > >I wonder how much I can include files? > >does it matter if the size sum of the source code included are above 1MB ?
It will work, although 1MB source code files will probably be a bit slow...
Depending on your hard drives, RAM, cache, OS, etc.
-- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk.
attached mail follows:
>Is it possible to make the browser wait say, 5 seconds before redirection by >outputting headers? I know you can do it with meta tags but not how by >outputting headers
The header version pretty much hits the browser long before your HTML, and then the browser will immediately move to the new location, and, in fact, PHP probably won't even bother to send your HTML since, what's the point? now that all the browsers are supporting the re-location header.
In short -- No, you can't do that with headers. If you want that 5-second "flash" of a page, stick with META tags.
-- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk.
attached mail follows:
>Top 10 Locales -- >Washington DC (9 members) >Amsterdam (7 members) >Leeds, UK (7 members) >London, England (7 members) >Atlanta (5 members) >Manhattan (below 42nd St) (5 members) >Melbourne (5 members) >Oakland-Alameda, CA (4 members) >Nashville, TN (4 members) >St. Louis, MO (4 members) > >I am somewhat surprised that there are no more developers in Texas signed >up. In my area it would just be me and one other. I was hoping to get to see >enough to start a users group. There is only a total of 268 signed up >world-wide.
People who are in areas with active PHP User Groups may well have opted to skip meetup...
I signed up, if only to be sure any event was informed of the existing user groups, but I dunno that I really expect a Chicago event to happen when we already meet monthly, no twice monthly now anyway...
But hey, I'm not opposed to a more informal gathering.
Went to the slashdot one last night, and had a nice time, though it was in a much too expensive (Guinness $6 Martini $10) joint, but the bread and oil was free, so with Guinness and bread, who needs to buy a meal? :-)
-- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk.
attached mail follows:
> so with Guinness and bread, who needs to buy a meal? :-)
Ooof. I feel bloated just reading that. :)
Monty
attached mail follows:
>My question is, if I have a user on my web site, and they leave and come >back does their session still exist? the file in the /tmp folder exists >until it is deleted by the OS? If the user comes back will they get >assigned the same session they had before? I know the questions are >pretty newbish but I have had experiences in other languages in the past >where this is the case. The session cookie stayed in the users browser, >so they kept getting the same session and not a new session if they left >and came back a day later.
Depends what you did in php.ini
-- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk.
attached mail follows:
>I have a column in my table named firstname with twenty records in it. How >can i use php to pull out individual records (say for ex. record 16)? Also,
select firstname from blah where id = 16
>how could i pull out all records upto number 15? Thanks in advance.
select firstname from blah where id < 16
or, more likely what you should be using:
select firstname from blah limit 1, 15
-- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk.
attached mail follows:
>// Set the limit per page >$sql_text = $sql_text . " LIMIT $start, $maxresult";
echo $sql_text;
>$result2 = mysql_query($sql_text);
if (!$result2){ echo mysql_error(); }
> >// The navigation between pages
-- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk.
attached mail follows:
>You may already be doing it like this, but I think I found a new way to >make select boxes auto-select (what data they put in) a lot easier. All you >have to do is put a variable in each select tag that is equal to the value >of the select option i.e.: <option value=teacher $teacher> -- then all you >have to do is base the variable on that <select name=interest> $$interest = >"selected"; quick and easy with out having to loop through an if elseif >statement. Let me know if you like that method or have any objections.
Since I'm always looping through choices in my database, and not hard-coded values, it's really no trouble to do:
while ($id = ...){ $selected = $id == $previously_selected_id ? 'SELECTED' : ''; echo "<OPTION VALUE=$id $selected>...</OPTION>\n"; }
If I *really* want hard-coded options, I'll just put them in an array and do the above.
-- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk.
attached mail follows:
> From: "lallous" <phplist
lgwm.org>
> I use javascript for that! :)
I try to steer away from javascript as much as possible (and anything else client-side), unless I know my audience extremely well and they are locked into a certain browser and version, i.e. internal applications. But I like that method very much!
[ Nathan Cook | ncook
pcsedu.com ]
attached mail follows:
>Hello, I am stuck here. In the name of efficiency I want to lower the number >of callls to the database. So I am trying to give the most stringent query >possible. This is the problem: I have stored the surfers shopping cart, >where each item is stored as a session variable.Now on the database I have >ALL inventory items, but I want to only display the details of what the user >has in his cart. >eg. : I want something like this: > >$result = mysql_query("SELECT * from Inventory where ItemNumber is in >$HTTP_SESSION_VARS"); >// I need proper syntax to replace "is in" > >where Inventory has, ItemNumber (unique), Price, ItemName. >So say the surfer has three items in the Session, then I stored the three >unique ItemNumbers. >Then with the above query I can get the rest of the information to represent >to the user. >I am looking down the avenues of a Set datastyp or maybe Enum, but I don't >know if it will help.
create table cart( session_id char(32), item_id int );
Then, if I have item #42, #57, and #314, there will be 3 rows in this table for me:
adsfqweradfzxcvasdfqwer 42 adsfqweradfzxcvasdfqwer 57 adsfqweradfzxcvasdfqwer 314
So you can just:
select item_id from cart where session_id = $PHPSESSID
-- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk.
attached mail follows:
>Is it possible to run PHP that is embedded within a string? I have a file >that is read into a string and returned to the browser, how can I run that >PHP?
-- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk.
attached mail follows:
>Hi there, I've got a quick question concerning PHP and mySQL. I've got a >fresh server with recent versions of Red Hat Linux, mySQL, PHP and apache. >My problem is that when I call mysql_pconnect, my PHP code hangs and >doesn't proceed. I can't check mysql_error because it doesn't go beyond >this point. I know that mysql is running and the PHP code prior to this >statement works just fine. The mysql account is operating correctly from >the prompt and I'm using all of the default values for PHP and mysql >config. Has anybody had this problem before and can somebody please offer >me some suggestions? Thank you!!!
Can you get it to work with just mysql_connect?
-- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk.
attached mail follows:
>I have a problem with conditional image generation. If I generate an >image without any conditional statments, then everything works fine. But >if i introduce conditional statment, then no image is generated in >either case of the condition. > >Has anyone dealt with this dilema before?
There's nothing "wrong" with the conditional idea, but you've just got a mistake somewhere in your code.
Surf to the image generation URL (the stuff you put after SRC= in your IMG tag) and see what error messages you've got.
-- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk.
attached mail follows:
>Hello, > >I have this example code: >function doprint($a){foreach($a as $value)echo $value;} >doprint(array('1','test','hello','and')); > >Question, is the array in memory after the function call? >So, should it be better to use this: > >function doprint($a){foreach($a as $value)echo $value;} >doprint($temp=array('1','test','hello','and')); >unset($temp);
PHP 4 is very aggressive about reclaiming memory.
Don't bother with the unset, unless your array is *HUGE* and you really need it gone immediately... Even then, I suspect you won't find any difference.
-- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk.
attached mail follows:
> >Hello, > > > >I have this example code: > >function doprint($a){foreach($a as $value)echo $value;} > >doprint(array('1','test','hello','and')); > > > >Question, is the array in memory after the function call? > >So, should it be better to use this: > > > >function doprint($a){foreach($a as $value)echo $value;} > >doprint($temp=array('1','test','hello','and')); > >unset($temp);
There are 2 variants. In the first PHP does not free the memory but there is no variable. In the second PHP frees the memory. The former case is the faster. Which variant is used depends on a constant during compilation.
Andrey
attached mail follows:
I used this logout page using sessions a while ago and it used to work great, but now it doesn't work. The only thing i have changed is my version of php. Can someone take a look and see what i have to change?
<? session_start();
$old_user = $valid_user; $result = session_unregister("valid_user"); session_destroy();
?>
then a little further down i have this....
<php? if (!empty($old_user)) { if ($result) { echo "Logged out.<br>"; } else { echo "Could not log you out.<br>"; } } else { echo "You have not logged in; therefore, you cannot logout.<br>"; } ?> It seems to log me out still, but it always gives me the "you have not logged in; therefor, you cannot logout" message. i also checked it with a script to see if my original sessions were actually registering and it seemed that they were. i am stumped. Any ideas would be greatly appreciated. Thanks.
_________________________________________________________________ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx
attached mail follows:
Do you have register globals off?
Jim Grill
Support
Web-1 Hosting
http://www.web-1hosting.net
----- Original Message -----
From: "Tyler Durdin" <linuxgeek23
hotmail.com>
To: <php-general
lists.php.net>
Sent: Friday, July 26, 2002 12:33 PM
Subject: [PHP] sessions
> I used this logout page using sessions a while ago and it used to work > great, but now it doesn't work. The only thing i have changed is my version > of php. Can someone take a look and see what i have to change? > > <? > session_start(); > > $old_user = $valid_user; > $result = session_unregister("valid_user"); > session_destroy(); > > ?> > > then a little further down i have this.... > > <php? > if (!empty($old_user)) { > if ($result) { > echo "Logged out.<br>"; > } else { > echo "Could not log you out.<br>"; > } > } else { > echo "You have not logged in; therefore, you cannot logout.<br>"; > } > ?> > It seems to log me out still, but it always gives me the "you have not > logged in; therefor, you cannot logout" message. i also checked it with a > script to see if my original sessions were actually registering and it > seemed that they were. i am stumped. Any ideas would be greatly appreciated. > Thanks. > > > > _________________________________________________________________ > MSN Photos is the easiest way to share and print your photos: > http://photos.msn.com/support/worldwide.aspx > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > >
attached mail follows:
I don't know. Tell me where I would find it and I'll look : -) Sorry, pretty new to all of this.
>Do you have register globals off?
>
>Jim Grill
>Support
>Web-1 Hosting
>http://www.web-1hosting.net
>----- Original Message -----
>From: "Tyler Durdin" <linuxgeek23
hotmail.com>
>To: <php-general
lists.php.net>
>Sent: Friday, July 26, 2002 12:33 PM
>Subject: [PHP] sessions
>
>
> > I used this logout page using sessions a while ago and it used to work
> > great, but now it doesn't work. The only thing i have changed is my
>version
> > of php. Can someone take a look and see what i have to change?
> >
> > <?
> > session_start();
> >
> > $old_user = $valid_user;
> > $result = session_unregister("valid_user");
> > session_destroy();
> >
> > ?>
> >
> > then a little further down i have this....
> >
> > <php?
> > if (!empty($old_user)) {
> > if ($result) {
> > echo "Logged out.<br>";
> > } else {
> > echo "Could not log you out.<br>";
> > }
> > } else {
> > echo "You have not logged in; therefore, you cannot logout.<br>";
> > }
> > ?>
> > It seems to log me out still, but it always gives me the "you have not
> > logged in; therefor, you cannot logout" message. i also checked it with
>a
> > script to see if my original sessions were actually registering and it
> > seemed that they were. i am stumped. Any ideas would be greatly
>appreciated.
> > Thanks.
> >
> >
> >
> > _________________________________________________________________
> > MSN Photos is the easiest way to share and print your photos:
> > http://photos.msn.com/support/worldwide.aspx
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> >
_________________________________________________________________ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx
attached mail follows:
It's because you are unregistering the valid_user variable, but, the old_user var you defined early on still exists. So, "if (!empty($old_user))" will equal FALSE, giving you the result you are getting. Change it to "if (!empty($valid_user))".
Monty
> From: linuxgeek23
hotmail.com (Tyler Durdin)
> Newsgroups: php.general
> Date: Fri, 26 Jul 2002 17:33:03 +0000
> To: php-general
lists.php.net
> Subject: sessions
>
> I used this logout page using sessions a while ago and it used to work
> great, but now it doesn't work. The only thing i have changed is my version
> of php. Can someone take a look and see what i have to change?
>
> <?
> session_start();
>
> $old_user = $valid_user;
> $result = session_unregister("valid_user");
> session_destroy();
>
> ?>
>
> then a little further down i have this....
>
> <php?
> if (!empty($old_user)) {
> if ($result) {
> echo "Logged out.<br>";
> } else {
> echo "Could not log you out.<br>";
> }
> } else {
> echo "You have not logged in; therefore, you cannot logout.<br>";
> }
> ?>
> It seems to log me out still, but it always gives me the "you have not
> logged in; therefor, you cannot logout" message. i also checked it with a
> script to see if my original sessions were actually registering and it
> seemed that they were. i am stumped. Any ideas would be greatly appreciated.
> Thanks.
>
>
>
> _________________________________________________________________
> MSN Photos is the easiest way to share and print your photos:
> http://photos.msn.com/support/worldwide.aspx
>
attached mail follows:
Still getting the same message. This script used to work perfectly in an older version of php. Could it be a problem with how I am setting the sessions. Has anything changed with how we code sessions?
>It's because you are unregistering the valid_user variable, but, the >old_user var you defined early on still exists. So, "if >(!empty($old_user))" >will equal FALSE, giving you the result you are getting. Change it to "if >(!empty($valid_user))". > >Monty
_________________________________________________________________ Chat with friends online, try MSN Messenger: http://messenger.msn.com
attached mail follows:
Could you trye if (!empty($HTTP_SESSION_VARS['valid_user']) use $HTTP_SESSION_VARS
HTH
Regards, Andrey
----- Original Message -----
From: "Tyler Durdin" <linuxgeek23
hotmail.com>
To: <php-general
lists.php.net>
Sent: Friday, July 26, 2002 9:12 PM
Subject: Re: [PHP] Re: sessions
> Still getting the same message. This script used to work perfectly in an > older version of php. Could it be a problem with how I am setting the > sessions. Has anything changed with how we code sessions? > > > >It's because you are unregistering the valid_user variable, but, the > >old_user var you defined early on still exists. So, "if > >(!empty($old_user))" > >will equal FALSE, giving you the result you are getting. Change it to "if > >(!empty($valid_user))". > > > >Monty > > > > > _________________________________________________________________ > Chat with friends online, try MSN Messenger: http://messenger.msn.com > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
attached mail follows:
Still the same message. It has been actually logging me out all along, but it will not run through that if statement.
>Could you trye >if (!empty($HTTP_SESSION_VARS['valid_user']) >use $HTTP_SESSION_VARS
_________________________________________________________________ Chat with friends online, try MSN Messenger: http://messenger.msn.com
attached mail follows:
Is any of the code you posted actually in a Function? What changed for sessions recently in PHP is the register globals option in the php.ini file. Vars are not automatically global anymore, so, you have to do it manually:
global $old_user, $valid_user; $old_user = ... $valid_user = ...
Maybe this is what's causing the problem.
Monty
> From: linuxgeek23
hotmail.com (Tyler Durdin)
> Newsgroups: php.general
> Date: Fri, 26 Jul 2002 18:12:13 +0000
> To: php-general
lists.php.net
> Subject: Re: [PHP] Re: sessions
>
> Still getting the same message. This script used to work perfectly in an
> older version of php. Could it be a problem with how I am setting the
> sessions. Has anything changed with how we code sessions?
>
>
attached mail follows:
re php info:
put this into a file, put it on your server, and call up the page in a browser:
<?php phpinfo(); ?>
it will show the settings for php on your server. As Jim suggested below, you should check the register_globals setting. If register_globals is on, you'll need to use the _Get function. see more on this by looking up register_globals and _Get in the php manual at php.net
hth
matt
----- Original Message -----
From: Tyler Durdin <linuxgeek23
hotmail.com>
To: <php-general
lists.php.net>
Sent: Friday, July 26, 2002 2:00 PM
Subject: Re: [PHP] sessions
> I don't know. Tell me where I would find it and I'll look : -)
> Sorry, pretty new to all of this.
>
> >Do you have register globals off?
> >
> >Jim Grill
> >Support
> >Web-1 Hosting
> >http://www.web-1hosting.net
> >----- Original Message -----
> >From: "Tyler Durdin" <linuxgeek23
hotmail.com>
> >To: <php-general
lists.php.net>
> >Sent: Friday, July 26, 2002 12:33 PM
> >Subject: [PHP] sessions
> >
> >
> > > I used this logout page using sessions a while ago and it used to work
> > > great, but now it doesn't work. The only thing i have changed is my
> >version
> > > of php. Can someone take a look and see what i have to change?
> > >
> > > <?
> > > session_start();
> > >
> > > $old_user = $valid_user;
> > > $result = session_unregister("valid_user");
> > > session_destroy();
> > >
> > > ?>
> > >
> > > then a little further down i have this....
> > >
> > > <php?
> > > if (!empty($old_user)) {
> > > if ($result) {
> > > echo "Logged out.<br>";
> > > } else {
> > > echo "Could not log you out.<br>";
> > > }
> > > } else {
> > > echo "You have not logged in; therefore, you cannot logout.<br>";
> > > }
> > > ?>
> > > It seems to log me out still, but it always gives me the "you have not
> > > logged in; therefor, you cannot logout" message. i also checked it
with
> >a
> > > script to see if my original sessions were actually registering and it
> > > seemed that they were. i am stumped. Any ideas would be greatly
> >appreciated.
> > > Thanks.
> > >
> > >
> > >
> > > _________________________________________________________________
> > > MSN Photos is the easiest way to share and print your photos:
> > > http://photos.msn.com/support/worldwide.aspx
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> > >
> > >
>
>
>
>
> _________________________________________________________________
> MSN Photos is the easiest way to share and print your photos:
> http://photos.msn.com/support/worldwide.aspx
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Here is the code that starts and registers the session. It is login page that logs in to itself so the form that produces $_POST["username"] is actually on the same page, but nothing happens until the user logs in. It there is something in this code that is not correct or making the other code from the previous mssages not work please let me know. Thanks again for all of the help.
<? session_start(); $username = $_POST["username"]; $password = $_POST["password"];
if ($username && $password) { //user has just tried to login
$db_conn = mysql_connect("server", "user", "pass"); mysql_select_db("DB_name", $db_conn); $query = "SELECT * FROM members WHERE username='$username'and password='$password'"; $result = mysql_query($query, $db_conn); if (mysql_num_rows($result) >0 ) { //if they are in the db register the username $valid_user2 = $username; session_register("valid_user2"); } } ?>
_________________________________________________________________ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx
attached mail follows:
Try removing the quotes in sessio_register ie. (valid_user2) > Here is the code that starts and registers the session. It is login page > that logs in to itself so the form that produces $_POST["username"] is > actually on the same page, but nothing happens until the user logs in. It > there is something in this code that is not correct or making the other code > from the previous mssages not work please let me know. Thanks again for all > of the help. > > > > <? > session_start(); > $username = $_POST["username"]; > $password = $_POST["password"]; > > if ($username && $password) > { > //user has just tried to login > > $db_conn = mysql_connect("server", "user", "pass"); > mysql_select_db("DB_name", $db_conn); > $query = "SELECT * FROM members WHERE username='$username'and > password='$password'"; > $result = mysql_query($query, $db_conn); > if (mysql_num_rows($result) >0 ) > { > //if they are in the db register the username > $valid_user2 = $username; > session_register("valid_user2"); > } > } > ?> > > > > _________________________________________________________________ > MSN Photos is the easiest way to share and print your photos: > http://photos.msn.com/support/worldwide.aspx > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
-Pushkar S. Pradhan
attached mail follows:
yes they are off. I did just recently discover this whole form thing, but i did not know about the session variables. I put the session registration code up in another post, if you would not mind looking at that and recommending changes. in the mean time I'll try and get up to speed on the new stuff. I really appreciate the help.
>If you upgraded to the new version and overwrote your old php.ini file then >they are off. > >If you have access to the php.ini file you can open it and search for >"register_globals" and see if it is set to On or Off. If you do not have >access to the php.ini you can use : > >$reg_glob = get_cfg_var("register_globals"); >print "$reg_glob"; > >I think it will display a 1 for on and a 0 for off. > >If they are off you can either get used to the new, more secure way of >doing >things, or you can turn them back on in the php.ini file or in a .htaccess >file in your directory. If you choose the .htaccess method you only need to >add the following line to your .htaccess file: > >php_flag register_globals on > >If you decide to use the new, more secure method session vars will be in >one >of two new global arrays: > >$_SESSION --OR-- $HTTP_SESSION_VARS > more info about that can be found here: >http://www.php.net/manual/en/ref.session.php > >So, in your case, $valid_user would become $_SESSION['valid_user'] or >$HTTP_SESSION_VARS['valid_user']. > >With register globals set to off you will find that forms will no longer >work the way you think. >example: > >if you had a form with <input name="var" value="testing"> in it and you >submitted it on the next page you would expect that $var would be "testing" >but it is not! Now you must use either $_POST['var'] for form method=post >and for query strings in URL's or method=get forms you would use >$_GET['var'] > >If you have any more questions I'll help you out.
_________________________________________________________________ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx
attached mail follows:
okay... if register_globals is off then your session handling is going to change dramatically.
You can read more on it here: http://www.php.net/manual/en/ref.session.php
Basically, You still use session_start(); at the top of your page, but you never use session_register, session_is_registered, or session_unregister.
To register a variable in a session use: $_SESSION['user'] = $username; or you can use multi-dimensional arrays... recommended to help keep organized. $_SESSION['user']['username'] = $username; $_SESSION['user']['pasword'] = $password;
You can also use $HTTP_SESSION_VARS. I'm not quite sure if there is any major difference in the two except that $_SESSION is new post ver 4.0.6
To end a session simply $_SESSION = array(); session_destroy();
Jim Grill
Support
Web-1 Hosting
http://www.web-1hosting.net
----- Original Message -----
From: "Tyler Durdin" <linuxgeek23
hotmail.com>
To: <php-general
lists.php.net>
Sent: Friday, July 26, 2002 1:35 PM
Subject: Re: [PHP] sessions
> Here is the code that starts and registers the session. It is login page > that logs in to itself so the form that produces $_POST["username"] is > actually on the same page, but nothing happens until the user logs in. It > there is something in this code that is not correct or making the other code > from the previous mssages not work please let me know. Thanks again for all > of the help. > > > > <? > session_start(); > $username = $_POST["username"]; > $password = $_POST["password"]; > > if ($username && $password) > { > //user has just tried to login > > $db_conn = mysql_connect("server", "user", "pass"); > mysql_select_db("DB_name", $db_conn); > $query = "SELECT * FROM members WHERE username='$username'and > password='$password'"; > $result = mysql_query($query, $db_conn); > if (mysql_num_rows($result) >0 ) > { > //if they are in the db register the username > $valid_user2 = $username; > session_register("valid_user2"); > } > } > ?> > > > > _________________________________________________________________ > MSN Photos is the easiest way to share and print your photos: > http://photos.msn.com/support/worldwide.aspx > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > >
attached mail follows:
do the following
function a(){ var_dump('<pre>',$GLOBALS,'</pre>'); } a();
and see what variables you have and whether your variables are set somewhere.
HTH
Andrey
----- Original Message -----
From: "Tyler Durdin" <linuxgeek23
hotmail.com>
To: <php-general
lists.php.net>
Sent: Friday, July 26, 2002 9:28 PM
Subject: Re: [PHP] Re: sessions
> Still the same message. It has been actually logging me out all along, but > it will not run through that if statement. > > >Could you trye > >if (!empty($HTTP_SESSION_VARS['valid_user']) > >use $HTTP_SESSION_VARS > > > > > > _________________________________________________________________ > Chat with friends online, try MSN Messenger: http://messenger.msn.com > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
attached mail follows:
So doing it the new way ($_SESSION['variable']) how do you close or unregister a session?
_________________________________________________________________ Chat with friends online, try MSN Messenger: http://messenger.msn.com
attached mail follows:
unset($_SESSION['variavble']);
Andrey
----- Original Message -----
From: "Tyler Durdin" <linuxgeek23
hotmail.com>
To: <php-general
lists.php.net>
Sent: Friday, July 26, 2002 10:14 PM
Subject: Re: [PHP] Re: sessions
> So doing it the new way ($_SESSION['variable']) how do you close or > unregister a session? > > > > > _________________________________________________________________ > Chat with friends online, try MSN Messenger: http://messenger.msn.com > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
attached mail follows:
Hi,
I'm still learning PHP. Against suggestions from most of this list I took the Brain Bench test and got in the Master category :) but even at RHIC I scored in the expert range on their test. It must be the similarity to Perl.
Anyhow, I was wondering (and I've asked this in a different way before) if some people with "experience" might suggest certain functions or classes etc. that you only encountered after perhaps writing it yourself. This happens a lot in Perl. Many Perl programmers will write a template system only to stumble upon the vast repository at CPAN afterwards. So I always tell new Perl programmers to search CPAN first.
Allow me to show my ignorance. I use the following site to find stuff before writing myself:
But I'm not using Pear for anything and never even look wherever it might be. I hope this is not like a Perl programming ignoring CPAN. Ah, I have it in my bookmarks here:
http://pear.php.net/manual/en/faq.php
I think this is the standard to follow for documenting code:
When I installed PHP on my windows box I saw all the things I could do to the ini file. I much prefer to strict environment. I wrote a LOT of code that was not like it should have been.
I would guess that if I wanted to follow an accepted coding standard this would be the one:
http://pear.php.net/manual/en/standards.php
And that's about it. I name files .inc or .cls or I use .php rather arbitrarily I must admit. Only .php files are returned to a client as that was brought up in a recent thread.
Any tips or suggestions very much appreciated.
PLEASE NOTE. I know that of course I'm free to code however I want. I fully understand that. But having worked on websites where every programmer coded however they wanted ... well, I've become a fan of a standard outside of myself. No point in saying that I can do it however I want, that I know.
Peterhttp://www.coremodules.com/
Web Development and Support at Affordable Prices
901-757-8322 peter
schoenster.com
attached mail follows:
Hi all,
I am serializing every get, post, cookie and server variables to log them. I was using mysql to store this data, but I've generated with 900 pageviews a 5 (five) MB table. Now I am using the bz2 extension to accomplish this, but I am not sure if it's the best method.
Are there any better alternatives? I must log this data for every requested page since it's for a bank application (ever had the Central Bank of your country asking for log files? ;-)
Thanks,
Julio Nobrega http://gnet.inerciasensorial.com.br
attached mail follows:
Well, it's Friday afternoon and the pre-pub run debates have started :^]
The choice of arguement today is born of the fact that I advised a newbie to always use mysql_close() to close the connection to the database. It's good form and will cover any ills where the database connection fails to close for some other reason (say the user stops the page from loading after the connection is made). I know that it is not required, but always being competitive I thought I would turn to the group for a concensus, whether I am right or wrong.
Thoughts?
Jay
attached mail follows:
+1 right.
Best regards, Andrew Hill Director of Technology Evangelism OpenLink Software http://www.openlinksw.com Universal Data Access & Virtuoso Universal Server
-----Original Message-----
From: Jay Blanchard [mailto:jay.blanchard
niicommunications.com]
Sent: Friday, July 26, 2002 2:22 PM
To: php-general
lists.php.net
Subject: [PHP] Close A Databse Connection
Well, it's Friday afternoon and the pre-pub run debates have started :^]
The choice of arguement today is born of the fact that I advised a newbie to always use mysql_close() to close the connection to the database. It's good form and will cover any ills where the database connection fails to close for some other reason (say the user stops the page from loading after the connection is made). I know that it is not required, but always being competitive I thought I would turn to the group for a concensus, whether I am right or wrong.
Thoughts?
Jay
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
----- Original Message -----
From: "Jay Blanchard" <jay.blanchard
niicommunications.com>
To: <php-general
lists.php.net>
Sent: Friday, July 26, 2002 10:22 PM
Subject: [PHP] Close A Databse Connection
> Well, it's Friday afternoon and the pre-pub run debates have started :^] > > The choice of arguement today is born of the fact that I advised a newbie to > always use mysql_close() to close the connection to the database. It's good > form and will cover any ills where the database connection fails to close > for some other reason (say the user stops the page from loading after the > connection is made). I know that it is not required, but always being PHP will close the connection automatically will be closed and all information cleared.
> competitive I thought I would turn to the group for a concensus, whether I > am right or wrong. > > Thoughts? > > Jay > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
attached mail follows:
On 03:32 PM 7/26/2002 -0400, Andrew Hill wrote: >+1 right.
Agreed... you should always "clean up after yourself."
Glenn (adding his +1..)
--- Glenn E. Sieb System Administrator Lumeta Corporation +1 732 357-3514 (V) +1 732 564-0731 (Fax)
attached mail follows:
Hi,
The question was about the use of mysql_close. Use it or not (not when to use it or when not to). So far:
> Agreed... you should always "clean up after yourself."
> PHP will close the connection automatically will be closed and all > information cleared.
> I advised a newbie to > always use mysql_close() to close the connection to the database. It's > good form and will cover any ills where the database connection fails to > close for some other reason (say the user stops the page from loading > after the connection is made).
2 says use it 1 says no.
From my read of docs I'd say not to use it. I use the Perl DBI with Apache::DBI and it simply overrides the DBI disconnect so calling a disconnect is only a waste of minimal time and typing when using it.
So, in PHP there are also 2 types of connections:
mysql-pconnect mysql_connect
Well if you are using mysql-pconnect then you would "rarely" use mysql_close() as the docs say
Using mysql_close() isn't usually necessary, as non-persistent open links are automatically closed at the end of the script's execution. See also freeing resources. __end quote
Okay, so when, when using a persistent connection would I use mysql_close()?
http://www.php.net/manual/en/function.mysql-pconnect.php
says
"Second, the connection to the SQL server will not be closed when the execution of the script ends. Instead, the link will remain open for future use (mysql_close() will not close links established by mysql_pconnect())."
See the above url for information from user comments about cutting down idle connections.
I think it's safe to say one would not use mysql-close() when using mysql-pconnect, although I wonder about the cost of doing that.
http://www.php.net/manual/en/function.mysql-close.php says
> Using mysql_close() isn't usually necessary, as non-persistent open > links are automatically closed at the end of the script's execution.
It seems to me better to err on the side of caution and use mysql_close(). If you are using a persistent connection then the call to mysql_close() should be overridden but I've got no clue if it's done that way. Seems to be related to opening and closing a file. In Perl the file will close when the script exits and that's fine for quick stuff but once a script begins to grow it allows for bugs.
I vote to suggest use of mysql_close().
Peter
attached mail follows:
alrigh I have switched everything over to the $_Session['variable'] style of session. Next question, I have a little script that used to check if the session was registered and if it was not it would redirect to the login page. How do i accomplish this now that i cannot check if the session is registered? Here is what i have.
<? session_start(); if (session_registered("valid_user2')) { echo " you are registered"; } else { header("Location: http://loginpage.com"); } ?>
How do I check if a session is active/registered or whatever it is so i cn still redirect or assign variables?
_________________________________________________________________ Join the world’s largest e-mail service with MSN Hotmail. http://www.hotmail.com
attached mail follows:
if (count($_SESSION)){
}
or if (isset($_SESSION['logged'])){
}
Regards, Andrey
----- Original Message -----
From: "Tyler Durdin" <linuxgeek23
hotmail.com>
To: <php-general
lists.php.net>
Sent: Friday, July 26, 2002 10:28 PM
Subject: [PHP] still on sessions
> alrigh I have switched everything over to the $_Session['variable'] style of > session. Next question, I have a little script that used to check if the > session was registered and if it was not it would redirect to the login > page. How do i accomplish this now that i cannot check if the session is > registered? Here is what i have. > > <? > session_start(); > if (session_registered("valid_user2')) { > echo " you are registered"; > } else { > header("Location: http://loginpage.com"); > } > ?> > > How do I check if a session is active/registered or whatever it is so i cn > still redirect or assign variables? > > > > _________________________________________________________________ > Join the world’s largest e-mail service with MSN Hotmail. > http://www.hotmail.com > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
attached mail follows:
I always just register an extra variable to track logged in users. If the user has logged in, it is set to TRUE, if not, FALSE. Then I just do comparisons on that variable.
<?php session_start() if($loggedin == FALSE) { header("Location: login.php"); } ?>
Something along those lines.
>>> "Tyler Durdin" <linuxgeek23
hotmail.com> 07/26/02 03:28PM >>>
alrigh I have switched everything over to the $_Session['variable'] style of
session. Next question, I have a little script that used to check if the
session was registered and if it was not it would redirect to the login
page. How do i accomplish this now that i cannot check if the session is
registered? Here is what i have.
<? session_start(); if (session_registered("valid_user2')) { echo " you are registered"; } else { header("Location: http://loginpage.com"); } ?>
How do I check if a session is active/registered or whatever it is so i cn still redirect or assign variables?
_________________________________________________________________ Join the world's largest e-mail service with MSN Hotmail. http://www.hotmail.com
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Alright this is my last question. I have closed the session, but can i make sure it is closed? i want to use something like if the session is closed then print a message session closed.
_________________________________________________________________ Send and receive Hotmail on your mobile device: http://mobile.msn.com
attached mail follows:
Just check for existence of any of the session vars. If they don't exist, then you can consider the session closed.
if ( $_SESSION['var'] ) { ...still logged in. } else { ...logged out. }
> From: linuxgeek23
hotmail.com (Tyler Durdin)
> Newsgroups: php.general
> Date: Fri, 26 Jul 2002 19:46:46 +0000
> To: php-general
lists.php.net
> Subject: Re: [PHP] still on sessions
>
> Alright this is my last question. I have closed the session, but can i make
> sure it is closed? i want to use something like if the session is closed
> then print a message session closed.
>
>
>
> _________________________________________________________________
> Send and receive Hotmail on your mobile device: http://mobile.msn.com
>
attached mail follows:
After you call session_destroy() session_id() will return nothing.
so you could do this:
// example only session_start(); print "<br>" . session_id(); // now you see it.... $_SESSION = array(); session_destroy(); print "<br>" . session_id(); // ...now you don't! if (! session_id() ) // test it.... now you can be sure. die("no session");
Jim Grill
Support
Web-1 Hosting
http://www.web-1hosting.net
----- Original Message -----
From: "Tyler Durdin" <linuxgeek23
hotmail.com>
To: <php-general
lists.php.net>
Sent: Friday, July 26, 2002 2:46 PM
Subject: Re: [PHP] still on sessions
> Alright this is my last question. I have closed the session, but can i make > sure it is closed? i want to use something like if the session is closed > then print a message session closed. > > > > _________________________________________________________________ > Send and receive Hotmail on your mobile device: http://mobile.msn.com > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > >
attached mail follows:
> Alright this is my last question. I have closed the session, but can i > make > sure it is closed? i want to use something like if the session is closed > then print a message session closed.
You don't have to close it; it's automatic. Just treat $_SESSION like the regular variable it is. Anything you assign to it will be available on any page you call session_start(). How much easier can it be??
If you really want a message, then on the last line of your file put
echo "Session Closed";
---John Holmes...
attached mail follows:
I changed the user name in pg_pconnect(), also i checked the pg_hba.conf for authentication. The authentication type is trust. But still I am getting the same warning while connecting to the database. Can anyone figure what might be the problem?
--- "Lejanson C. Go" <lejanson
ntsp.nec.co.jp> wrote:
> Varsha,
>
> try creating a new user for postgreSQl and do not
> use
> the "postgres"
>
> try this at command line:
>
> [guest
localhost]$ su
> [root
localhost]$ su - postgres
> [postgres
localhost]$ create user username
>
>
> in ur pg_connect
>
> specify the username.dont use postgres.
>
>
> Varsha Agarwal wrote:
>
> > I am trying to connect to postgre_sql database
> using
> > pg_pconnect(). When I try to run it i get the
> > following error
> > Warning: Unable to connect to PostgreSQL server:
> FATAL
> > 1: IDENT authentication failed for user "postgres"
> in
> > /var/www/html/test.php on line 3
> > connection failed
> >
> > Please tell me what might be the reason.
> > -Varsha
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Yahoo! Health - Feel better, live better
> > http://health.yahoo.com
> >
> >
>
>
>
> --
> Lejanson C. Go, SDE I
>
__________________________________________________ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com
attached mail follows:
Can anyone tell me what I am doing wrong?
I am essentially trying to do this: $divid[1] = $div_id1; $divid[2] = $div_id2; $divid[3] = $div_id3; $divid[4] = $div_id4; $divid[5] = $div_id5;
But I was looking for a tighter way, like the following (which does not work): for($m=1;$m<=5;$m++){ $div_id[$m]=$divid$m; }
Can anybody tell me how to do this in a "for" statement?
Thanks In Advance Steve
-- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. ow3
attached mail follows:
for($m=1;$m<=5;$m++){ $div_id[$m]=${'divid'.$m}; }
Regards, Andrey
----- Original Message -----
From: "Steve Buehler" <steve
vespro.com>
To: "PHP" <php-general
lists.php.net>
Sent: Friday, July 26, 2002 10:48 PM
Subject: [PHP] filling an array
> Can anyone tell me what I am doing wrong? > > I am essentially trying to do this: > $divid[1] = $div_id1; > $divid[2] = $div_id2; > $divid[3] = $div_id3; > $divid[4] = $div_id4; > $divid[5] = $div_id5; > > But I was looking for a tighter way, like the following (which does not work): > for($m=1;$m<=5;$m++){ > $div_id[$m]=$divid$m; > } > > Can anybody tell me how to do this in a "for" statement? > > Thanks In Advance > Steve > > > -- > This message has been scanned for viruses and > dangerous content by MailScanner, and is > believed to be clean. > ow3 > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
attached mail follows:
>From: "Steve Buehler" <steve
vespro.com>
>To: "PHP" <php-general
lists.php.net>
>Sent: Friday, July 26, 2002 3:48 PM
> I am essentially trying to do this:
> $divid[1] = $div_id1;
> $divid[2] = $div_id2;
> $divid[3] = $div_id3;
> $divid[4] = $div_id4;
> $divid[5] = $div_id5;
>
> But I was looking for a tighter way, like the following (which does not
work):
> for($m=1;$m<=5;$m++){
> $div_id[$m]=$divid$m;
> }
This should do it: for($m=1;$m<=5;$m++){ $varName = 'divId' . $m; $div_id[$m]=${$varName} }
attached mail follows:
for($i =0; $i < 5; $i++) { $offset = $m + 1; $divid[$m] = $div_id{$offset}; }
That should work. You'll most often want to start your arrays with zero, since it is the first pointer position, by default. The offset is so that your initial variables to be stored into the array stay numbered starting at one.
If you are doing this from a form with five textboxes though, just put the name of each textbox as "div_id[]" and it will build the array for you. Hope to help!
Martin Clifford Homepage: http://www.completesource.net Developer's Forums: http://www.completesource.net/forums/
>>> Steve Buehler <steve
vespro.com> 07/26/02 03:48PM >>>
Can anyone tell me what I am doing wrong?
I am essentially trying to do this: $divid[1] = $div_id1; $divid[2] = $div_id2; $divid[3] = $div_id3; $divid[4] = $div_id4; $divid[5] = $div_id5;
But I was looking for a tighter way, like the following (which does not work): for($m=1;$m<=5;$m++){ $div_id[$m]=$divid$m; }
Can anybody tell me how to do this in a "for" statement?
Thanks In Advance Steve
-- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. ow3-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Thank You Andrey, Matt and Martin for your answers. To summarize for everyone, here are the answers:
From Andrey (tested, works): for($m=1;$m<=5;$m++){ $div_id[$m]=${'divid'.$m}; }
From Matt: for($m=1;$m<=5;$m++){ $varName = 'divId' . $m; $div_id[$m]=${$varName} }
From Martin: for($i =0; $i < 5; $i++) { $offset = $m + 1; $divid[$m] = $div_id{$offset}; }
At 10:55 PM 7/26/2002 +0300, you wrote:
>----- Original Message -----
>From: "Steve Buehler" <steve
vespro.com>
>To: "PHP" <php-general
lists.php.net>
>Sent: Friday, July 26, 2002 10:48 PM
>Subject: [PHP] filling an array
>
>
> > Can anyone tell me what I am doing wrong?
> >
> > I am essentially trying to do this:
> > $divid[1] = $div_id1;
> > $divid[2] = $div_id2;
> > $divid[3] = $div_id3;
> > $divid[4] = $div_id4;
> > $divid[5] = $div_id5;
> >
> > But I was looking for a tighter way, like the following (which does not
>work):
> > for($m=1;$m<=5;$m++){
> > $div_id[$m]=$divid$m;
> > }
> >
> > Can anybody tell me how to do this in a "for" statement?
> >
> > Thanks In Advance
> > Steve
> >
> >
> > --
> > This message has been scanned for viruses and
> > dangerous content by MailScanner, and is
> > believed to be clean.
> > ow3
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
>
>--
>This message has been scanned for viruses and
>dangerous content by MailScanner, and is
>believed to be clean.
>ow3
-- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. ow3
attached mail follows:
Hi,
I have a form that calls a PHP script which sets a session variable and redirects to anopther URL as such:
session_start(); $HTTP_SESSION_VARS['userid'] = "someidnumber"; Header('Location: ' . 'http://www.mydomain.com/welcome.html');
On welcome.html, I have the following code:
<script language="php"> echo 'userid: ' . $HTTP_SESSION_VARS['userid'] . '<br/>'; </script>
When I run it in my browser, the value of 'userid' is empty. Anyone know why?
attached mail follows:
You have to have session_start() in each page in order to carry over session variables. :o)
Martin Clifford Homepage: http://www.completesource.net Developer's Forums: http://www.completesource.net/forums/
>>> "DonPro" <donpro
lclcan.com> 07/26/02 04:06PM >>>
Hi,
I have a form that calls a PHP script which sets a session variable and redirects to anopther URL as such:
session_start(); $HTTP_SESSION_VARS['userid'] = "someidnumber"; Header('Location: ' . 'http://www.mydomain.com/welcome.html');
On welcome.html, I have the following code:
<script language="php"> echo 'userid: ' . $HTTP_SESSION_VARS['userid'] . '<br/>'; </script>
When I run it in my browser, the value of 'userid' is empty. Anyone know why?
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
I have two tables: member_basic and member_detail. When a member edits their record, they can edit or add data for either table, but, the data stored in member_detail isn't required, so, they can possibly leave these fields blank. By the way, both tables would be linked by a member id.
Here's my dilemma: If they do fill in any fields associated with member_detail, I have to first see whether or not there's an entry in the member_detail table already for that user (based on member id number). If not, I then have to check ALL the form fields associated with this table to see if any data was actually entered so I know whether or not to create a new record for the member in member_detail. If there is already an entry for that member in member_detail, then I can just do a standard UPDATE.
Now maybe this is how it has to be done, but, I was hoping there might be an easier way to do this. It appears it's not possible to UPDATE a JOINed table during a query, which is what I was hoping. I am trying to keep the DB efficient by keeping optional data that may be left empty in another table, but, it's only making my life difficult, so, unless there's an easier way, I may just combine all the fields into one table and be done with it.
Sorry for the long-winded explanation. Any suggestion are greatly appreciated!
Monty
attached mail follows:
[snip] ....Here's my dilemma: If they do fill in any fields associated with member_detail, I have to first see whether or not there's an entry in the member_detail table already for that user (based on member id number). If not, I then have to check ALL the form fields associated with this table to see if any data was actually entered so I know whether or not to create a new record for the member in member_detail. If there is already an entry for that member in member_detail, then I can just do a standard UPDATE.... [/snip]
Monty,
You can do this in an if statement;
if(this set of variables is there){ insert to database } elseif(member exists){ update the database }
HTH!
Jay
attached mail follows:
Sorry this may be a little offtopic, but I am currently moving a site I was developing from coldfusion+MSAccess to PHP+MySQL. I remembered reading somewhere that there is a utility that will convert/transfer (data and structure) a MSAcess database to Mysql, and vice versa. Anyone know? Thanks
Chris
attached mail follows:
Christian Calloway em Friday 26 July 2002 17:30 foi agraciado com uma resposta por:
> Sorry this may be a little offtopic, but I am currently moving a site I > was developing from coldfusion+MSAccess to PHP+MySQL. I remembered reading > somewhere that there is a utility that will convert/transfer (data and > structure) a MSAcess database to Mysql, and vice versa. Anyone know? > Thanks > > Chris
Yes, it's called DBTools. Google for it because it's easy to find.
-- -- http://gnet.inerciasensorial.com.br
attached mail follows:
Congrats! Good choice!
Take a look here: http://www.convert-in.com/acc2sql.htm or here: http://www.google.com/search?hl=en&lr=&ie=ISO-8859-1&q=convert+access+databa se+to+mysql
Jim Grill
Support
Web-1 Hosting
http://www.web-1hosting.net
----- Original Message -----
From: "Christian Calloway" <dcminds
yahoo.com>
To: <php-general
lists.php.net>
Sent: Friday, July 26, 2002 3:30 PM
Subject: [PHP] mysql question
> Sorry this may be a little offtopic, but I am currently moving a site I was > developing from coldfusion+MSAccess to PHP+MySQL. I remembered reading > somewhere that there is a utility that will convert/transfer (data and > structure) a MSAcess database to Mysql, and vice versa. Anyone know? Thanks > > Chris > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > >
attached mail follows:
> From: "Christian Calloway" <dcminds
yahoo.com>
>
> Sorry this may be a little offtopic, but I am currently moving a site I was
> developing from coldfusion+MSAccess to PHP+MySQL. I remembered reading
> somewhere that there is a utility that will convert/transfer (data and
> structure) a MSAcess database to Mysql, and vice versa. Anyone know? Thanks
>
MS Access2MySQL Converter is at <http://www.dmsofttech.com/downloads.html>.
-- Lowell Allen
attached mail follows:
Hello, I'm playing with imagettftext:
http://sean.caedmon.net/ttf_example.php?text=PHP
This works fine with some fonts, and not fine with others:
http://sean.caedmon.net/ttf_example.php?text=PHP&font=a
The (broken) font in question is available at:
http://sean.caedmon.net/new/fonts/TRIACSEV.TTF
I read that this might be because of a non-unicode font..
how can I check this? is there a way to unicode-ify a font? (-:
Thanks, S
attached mail follows:
hmmmm. Ok. Can somebody explain this one? Why won't it work correctly?
for($m=1;$m<=5;$m++){ $div_idd[$m]=${'row->sub' . $m . 'd'}; }
Can it not be done with a 3 parter? The columns in the table that $row gets, are sub1d, sub2d, sub3d, sub4d and sub5d. Or is it the "->" that is messing it up? I have tried escaping them "row\-\>sub", but that didn't work. What would I search for on the PHP site or where are directions located that tells me how to use this type of putting a variable together. It makes it hard to search for it if I don't know what it is called.
Thanks Steve
-- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. ow3
attached mail follows:
var names can only be letters, numbers, and underscores.
Jim Grill
Support
Web-1 Hosting
http://www.web-1hosting.net
----- Original Message -----
From: "Steve Buehler" <steve
vespro.com>
To: "PHP" <php-general
lists.php.net>
Sent: Friday, July 26, 2002 3:53 PM
Subject: [PHP] filling an array(2)
> hmmmm. Ok. Can somebody explain this one? Why won't it work correctly? > > for($m=1;$m<=5;$m++){ > $div_idd[$m]=${'row->sub' . $m . 'd'}; > } > > Can it not be done with a 3 parter? The columns in the table that $row > gets, are sub1d, sub2d, sub3d, sub4d and sub5d. Or is it the "->" that is > messing it up? I have tried escaping them "row\-\>sub", but that didn't work. > What would I search for on the PHP site or where are directions located > that tells me how to use this type of putting a variable together. It > makes it hard to search for it if I don't know what it is called. > > Thanks > Steve > > > -- > This message has been scanned for viruses and > dangerous content by MailScanner, and is > believed to be clean. > ow3 > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > >
attached mail follows:
Ok. That makes since.
Thanks Steve
At 04:20 PM 7/26/2002 -0500, you wrote:
>var names can only be letters, numbers, and underscores.
>
>Jim Grill
>Support
>Web-1 Hosting
>http://www.web-1hosting.net
>----- Original Message -----
>From: "Steve Buehler" <steve
vespro.com>
>To: "PHP" <php-general
lists.php.net>
>Sent: Friday, July 26, 2002 3:53 PM
>Subject: [PHP] filling an array(2)
>
>
> > hmmmm. Ok. Can somebody explain this one? Why won't it work correctly?
> >
> > for($m=1;$m<=5;$m++){
> > $div_idd[$m]=${'row->sub' . $m . 'd'};
> > }
> >
> > Can it not be done with a 3 parter? The columns in the table that $row
> > gets, are sub1d, sub2d, sub3d, sub4d and sub5d. Or is it the "->" that is
> > messing it up? I have tried escaping them "row\-\>sub", but that didn't
>work.
> > What would I search for on the PHP site or where are directions located
> > that tells me how to use this type of putting a variable together. It
> > makes it hard to search for it if I don't know what it is called.
> >
> > Thanks
> > Steve
> >
> >
> > --
> > This message has been scanned for viruses and
> > dangerous content by MailScanner, and is
> > believed to be clean.
> > ow3
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> >
>
>
>
>--
>This message has been scanned for viruses and
>dangerous content by MailScanner, and is
>believed to be clean.
>ow3
-- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. ow3
attached mail follows:
ROTFLMAO!!!
"Tech Support" <jgrill
web-1hosting.net> wrote in message
news:012501c23477$0bcc0db0$6500a8c0
speeddemon...
> if ( eregi('^[php].*newman.*', $subject) && $docs == "unread") > move_mail_to_folder("deleted Items"); > > Jim Grill > Support > Web-1 Hosting > http://www.web-1hosting.net
attached mail follows:
Hi,
We have to upgrade our PHP to the latest stable version on Redhat Linux 7.3. We have lots of user using our PHP so what are all the precautions and steps involved while doing this operations without disturbing their existing program.
All responses are welcome.
karthikeyan. ------------------------------------------------------------------------------------------------------------- Judge not, that ye be not Judged - Abraham Lincoln's favorite quote -------------------------------------------------------------------------------------------------------------
attached mail follows:
It really depends on what version you have now.
I'd say the biggest thing to look out for is the register_globals, which is now defaulted to "Off". This will break lots of sites!!! Turn it on unless you want your phone to ring for days. Users should, however, be urged to get used to coding with it off. It can be turned off on a per directory basis using .htaccess.
I have not actually tried this but one of our users reported a problem with setcookie. He was doing this: setcookie('username', $username, "", $protected_dir); The manual says you must use an integer for the expire argument and cannot escape with an empty string so I'm surprised it ever worked at all, but he says it did work before the upgrade. I had him switch to this: setcookie('username', $username, 0, $protected_dir);
Other than that you might have some Redhat specific problems that I'm unaware of. I don't see why you people put up with that rpm crap. :-)
Jim Grill
Support
Web-1 Hosting
http://www.web-1hosting.net
----- Original Message -----
From: "karthikeyan" <karthikeyan
aspiresys.com>
To: <php-general
lists.php.net>
Sent: Friday, July 26, 2002 3:55 PM
Subject: [PHP] PHP UPGRADE on LINUX
Hi,
We have to upgrade our PHP to the latest stable version on Redhat Linux 7.3. We have lots of user using our PHP so what are all the precautions and steps involved while doing this operations without disturbing their existing program.
All responses are welcome.
karthikeyan. ---------------------------------------------------------------------------- --------------------------------- Judge not, that ye be not Judged - Abraham Lincoln's favorite quote ---------------------------------------------------------------------------- ---------------------------------
attached mail follows:
Hi all.
Last nite I’ve came across a problem I wasn’t able to figure out by my
self. It’s not difficult to make a loop that will make new *TABLE ROWS*
(<tr>) to show several DB objects in a nice way… what I need to do, is
to display 2 or maybe even 3 of this objects stored in a DB per table
row, separated in different *TABLE COLUMS* (<td>)… how can I achieve
this? What I usually do is:
------------------------------
// DB QUERY
$query = “SELECT * FROM table_name”;
$result = mysql_query($query) or die(mysql_error());
$num_rows = mysql_num_rows($result);
// NOW THE LOOP
for ($i=0; $i<$num_rows; $i++)
{
$row = mysql_fetch_array($result);
echo “<tr>”;
echo “<td>”;
echo $row[whatever];
echo “</td>”;
echo “</tr>”;
}
------------------------------
but how can I get 2 or 3 columns displaying different db objects? A loop
inside a loop?
Thanks in advance,
<mailto:webmaster
icaam.com.ar> Cesar Aracena
CE / MCSE+I
Neuquen, Argentina
+54.299.6356688
+54.299.4466621
attached mail follows:
Here is some working sample code that you can build from.
<? $columns = 3;
$pretend_row = array( "test", "test2", "testing", "test4", "testagain", "hello" );
$table = "<table border=\"1\">\n<tr>\n"; $count = 1; foreach ($pretend_row as $row) { $table .= "<td>$row</td>\n"; if ($count % $columns === 0) $table .= "</tr><tr>\n"; $count++; } $table = ereg_replace("<tr>\n$", "\n", $table); $table .= "</table>\n";
print $table; ?>
Jim Grill
Support
Web-1 Hosting
http://www.web-1hosting.net
----- Original Message -----
From: "César Aracena" <icaam
icaam.com.ar>
To: "PHP General List" <php-general
lists.php.net>
Sent: Friday, July 26, 2002 5:05 PM
Subject: [PHP] Table formatting
Hi all.
Last nite I've came across a problem I wasn't able to figure out by my self. It's not difficult to make a loop that will make new *TABLE ROWS* (<tr>) to show several DB objects in a nice way. what I need to do, is to display 2 or maybe even 3 of this objects stored in a DB per table row, separated in different *TABLE COLUMS* (<td>). how can I achieve this? What I usually do is:
------------------------------ // DB QUERY $query = "SELECT * FROM table_name"; $result = mysql_query($query) or die(mysql_error()); $num_rows = mysql_num_rows($result);
// NOW THE LOOP for ($i=0; $i<$num_rows; $i++) { $row = mysql_fetch_array($result); echo "<tr>"; echo "<td>"; echo $row[whatever]; echo "</td>"; echo "</tr>"; } ------------------------------
but how can I get 2 or 3 columns displaying different db objects? A loop inside a loop?
Thanks in advance,
<mailto:webmaster
icaam.com.ar> Cesar Aracena
CE / MCSE+I
Neuquen, Argentina
+54.299.6356688
+54.299.4466621
attached mail follows:
I installed PHP when I installed Red Hat 7.2 without MySQL. I have now added MySQL but I can't figure out how to enable it in PHP. Can anyone help?
thanks, Joel
attached mail follows:
Hello,
I just installed the nice and easy one click PHP install to my Windows 98se machine.
I just want to be able to test and practice My basic PHP /MySQL stuff without up loading.
So now what do I do.
I ran the php info scripts and got bunch of weird messages.
How do I get the PHP to work in my browsers IE, NN just as it does when uploaded to my hosting co's servers?
Thanks, -Marcus
-- ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||Marcus Unlimited http://marcusunlimited.com Multimedia Internet Design and Education ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
----------------------------------- Also visit: - http://www.chromaticus.com - http://ampcast.com/chromaticus
attached mail follows:
You need a web server like M$ IIS or Apache. I would rather chew tin foil than run an IIS server even if it was on a win machine.
You can install the win version of the Apache web server and then just browse to http://localhost/ to view your work.
Jim Grill
Support
Web-1 Hosting
http://www.web-1hosting.net
----- Original Message -----
From: "Marcus Unlimited" <marcus
marcusunlimited.com>
To: <php-general
lists.php.net>
Sent: Friday, July 26, 2002 5:18 PM
Subject: [PHP] Installed PHP on home Win98se, now how can I get browser to
see it?
> Hello, > > I just installed the nice and easy one click PHP install to my Windows > 98se machine. > > I just want to be able to test and practice My basic PHP /MySQL stuff > without up loading. > > So now what do I do. > > I ran the php info scripts and got bunch of weird messages. > > How do I get the PHP to work in my browsers IE, NN just as it does when > uploaded to my hosting co's servers? > > Thanks, > -Marcus > > -- > |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| |||||| > > Marcus Unlimited > http://marcusunlimited.com > Multimedia Internet Design and Education > |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| |||||| > > ----------------------------------- > Also visit: > - http://www.chromaticus.com > - http://ampcast.com/chromaticus > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > >
attached mail follows:
Marcus,
There is a nice bundle for windows, it's perfect to test basic php/mysql stuff. it includes Apache, MySQL and PHP. You can find it at http://www.firepages.com.au/dev4.htm
It's really easy to use, you just have to run phpdev_start.bat, and you have your website running on http://localhost, with php/mysql support. :). to stop it you run phpdev_stop.bat.
Hope this helps.
Oscar.-
attached mail follows:
Obiously you need a WebServer too, you can install Apache or Personal Web Server, and configure php to work with it, next you can browse you own server with the address http://localhost or http://127.0.0.1, maybe you will have to install mysql for windows too if you wanna work with databases too.
Jadiel
At 03:18 PM 7/26/2002 -0700, you wrote: >Hello, > >I just installed the nice and easy one click PHP install to my Windows >98se machine. > >I just want to be able to test and practice My basic PHP /MySQL stuff >without up loading. > >So now what do I do. > >I ran the php info scripts and got bunch of weird messages. > >How do I get the PHP to work in my browsers IE, NN just as it does when >uploaded to my hosting co's servers? > >Thanks, >-Marcus > >-- >|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| > >Marcus Unlimited >http://marcusunlimited.com >Multimedia Internet Design and Education >|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| > >----------------------------------- >Also visit: >- http://www.chromaticus.com >- http://ampcast.com/chromaticus > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php
Jadiel Flores
-------------------------
http://www.abargon.com
jflores
abargon.com
(52-55) 52-29-80-34
attached mail follows:
If you got it installed.
insert a script called php_info.php on the companies webserver.
here is it's contents: <?php phpinfo(); ?>
That will give you lots of info about the configuration of PHP.
do the same thing on your PC.
if they are differant:
Use windows explorer/my computer to browse to C:\WINDOWS\
then find a file in that directory called php.ini.
Check the settings against the ones shown with php info.
change them to the isp/companies config.
-- JJ Harrison webmastertececo.com www.tececo.com
"Marcus Unlimited" <marcus
marcusunlimited.com> wrote in message news:3D41CACE.A098C2CA
marcusunlimited.com... > Hello, > > I just installed the nice and easy one click PHP install to my Windows > 98se machine. > > I just want to be able to test and practice My basic PHP /MySQL stuff > without up loading. > > So now what do I do. > > I ran the php info scripts and got bunch of weird messages. > > How do I get the PHP to work in my browsers IE, NN just as it does when > uploaded to my hosting co's servers? > > Thanks, > -Marcus > > -- > |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| |||||| > > Marcus Unlimited > http://marcusunlimited.com > Multimedia Internet Design and Education > |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| |||||| > > ----------------------------------- > Also visit: > - http://www.chromaticus.com > - http://ampcast.com/chromaticus > >
attached mail follows:
Hello,
I am creating a script that takes an uploaded image, creates a thumbnail from it, and saves both files.
The script works great, but the problem is, the files It will have to handle, are high-resolution files (300dpi, 24 bit-depth).. it works fine on regular files (72 dpi), but when I upload a 300dpi image, it says that the image is not a valid JPEG file.
Warning: imagecreatefromjpeg: '/home/sites/site1/web/uploadedHi-Res/mo_0001.jpg' is not a valid JPEG file in /home/sites/site1/web/site/designers/doSubmit.php on line 6
The image appears to be valid here, it opens on photoshop, and everywhere, however, once uploaded, the image seems to be corrupted somehow, bc if I download it again, it won¨t open anywhere. Has this happened to anyone else on this list?.. if so, please advise!.
Here is the code for the script if it helps:
function createThumbnail($path, $filename) { $src_img=ImageCreateFromJpeg($path); //HERE IT SAYS IMAGE NOT VALID if (imagesx($src_img) > imagesy($src_img)) { $new_w=69; $new_h=40; $t1 = imagesx($src_img); $t2 = imagesy($src_img); } else { $new_w=40; $new_h=69; $t1 = imagesy($src_img); $t2 = imagesx($src_img); } header("Content-type: image/jpeg"); $dst_img=imagecreate($new_w,$new_h); imagecopyresized($dst_img,$src_img,0,0,0,0,$new_w,$new_h,$t1,$t2); ImageJpeg($dst_img, "/home/sites/site1/web/uploadedHi-Res/$filename-thumb.jpg", 50); }
if (($filename_type != "image/jpeg") && ($filename_type != "image/jpg") &&
($filename_type != "image/pjpeg")) {
header("Location:submitError.php"); exit;
} else {
srand((double)microtime()*1000000);
$randomfile = substr(md5(rand(0,9999999)), 0, 6);
$upload = "/home/sites/site1/web/uploadedHi-Res";
$upload_path = "$upload/$filename_name";
if (is_uploaded_file($filename)) {
Exec("cp $filename $upload_path");
$link =
mysql_connect(localhost, 'xxxxx', 'xxxx')
or die("Unable to Connect to Database");
mysql_select_db(xxxx);
$sql = "INSERT INTO xxxx VALUES ('$designer_valid', '$filename_name',
NOW(), 'Pending')";
$result = mysql_query($sql) or die("Query Failed");
createThumbnail($upload_path, $filename_name);
header("Location:designSubmitted.php"); exit;
} else {
header("Location:submitError.php"); exit;
}
}
attached mail follows:
This may sound silly, but you are uploading in binary mode right?
Jim Grill
Support
Web-1 Hosting
http://www.web-1hosting.net
----- Original Message -----
From: <oscarfm
cantv.net>
To: <php-general
lists.php.net>
Sent: Friday, July 26, 2002 5:24 PM
Subject: [PHP] High Resolution Images
> Hello,
>
> I am creating a script that takes an uploaded image, creates a thumbnail
> from it, and saves both files.
>
> The script works great, but the problem is, the files It will have to
> handle, are high-resolution files (300dpi, 24 bit-depth).. it works fine
on
> regular files (72 dpi), but when I upload a 300dpi image, it says that the
> image is not a valid JPEG file.
>
> Warning: imagecreatefromjpeg:
> '/home/sites/site1/web/uploadedHi-Res/mo_0001.jpg' is not a valid JPEG
file
> in /home/sites/site1/web/site/designers/doSubmit.php on line 6
>
> The image appears to be valid here, it opens on photoshop, and everywhere,
> however, once uploaded, the image seems to be corrupted somehow, bc if I
> download it again, it won¨t open anywhere. Has this happened to anyone
else
> on this list?.. if so, please advise!.
>
> Here is the code for the script if it helps:
>
>
> function createThumbnail($path, $filename) {
> $src_img=ImageCreateFromJpeg($path); //HERE IT SAYS IMAGE NOT VALID
> if (imagesx($src_img) > imagesy($src_img)) {
> $new_w=69;
> $new_h=40;
> $t1 = imagesx($src_img);
> $t2 = imagesy($src_img);
> } else {
> $new_w=40;
> $new_h=69;
> $t1 = imagesy($src_img);
> $t2 = imagesx($src_img);
> }
> header("Content-type: image/jpeg");
> $dst_img=imagecreate($new_w,$new_h);
> imagecopyresized($dst_img,$src_img,0,0,0,0,$new_w,$new_h,$t1,$t2);
> ImageJpeg($dst_img,
> "/home/sites/site1/web/uploadedHi-Res/$filename-thumb.jpg", 50);
> }
>
>
> if (($filename_type != "image/jpeg") && ($filename_type != "image/jpg") &&
> ($filename_type != "image/pjpeg")) {
> header("Location:submitError.php"); exit;
> } else {
> srand((double)microtime()*1000000);
> $randomfile = substr(md5(rand(0,9999999)), 0, 6);
> $upload = "/home/sites/site1/web/uploadedHi-Res";
> $upload_path = "$upload/$filename_name";
> if (is_uploaded_file($filename)) {
> Exec("cp $filename $upload_path");
> $link =
mysql_connect(localhost, 'xxxxx', 'xxxx')
> or die("Unable to Connect to Database");
> mysql_select_db(xxxx);
> $sql = "INSERT INTO xxxx VALUES ('$designer_valid', '$filename_name',
> NOW(), 'Pending')";
> $result = mysql_query($sql) or die("Query Failed");
> createThumbnail($upload_path, $filename_name);
> header("Location:designSubmitted.php"); exit;
> } else {
> header("Location:submitError.php"); exit;
> }
> }
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
attached mail follows:
Does the maximum uploaded file size directive in php.ini refuse upload, or cut the file off at the maximum?
If you're uploading via a browser, it *might* be chopping it off, resulting in an invalid file.
Try *JUST* uploading the file and saving it to disk, then try downloading & saving that file to disk... compare file sizes, and try to open the file.
If all this works, then you can rule out a file size issue, and look at other issues, like a potential bug with large files or large resolutions.
Justin French
on 27/07/02 8:31 AM, Tech Support (jgrill
web-1hosting.net) wrote:
> This may sound silly, but you are uploading in binary mode right?
>
> Jim Grill
> Support
> Web-1 Hosting
> http://www.web-1hosting.net
> ----- Original Message -----
> From: <oscarfm
cantv.net>
> To: <php-general
lists.php.net>
> Sent: Friday, July 26, 2002 5:24 PM
> Subject: [PHP] High Resolution Images
>
>
>> Hello,
>>
>> I am creating a script that takes an uploaded image, creates a thumbnail
>> from it, and saves both files.
>>
>> The script works great, but the problem is, the files It will have to
>> handle, are high-resolution files (300dpi, 24 bit-depth).. it works fine
> on
>> regular files (72 dpi), but when I upload a 300dpi image, it says that the
>> image is not a valid JPEG file.
>>
>> Warning: imagecreatefromjpeg:
>> '/home/sites/site1/web/uploadedHi-Res/mo_0001.jpg' is not a valid JPEG
> file
>> in /home/sites/site1/web/site/designers/doSubmit.php on line 6
>>
>> The image appears to be valid here, it opens on photoshop, and everywhere,
>> however, once uploaded, the image seems to be corrupted somehow, bc if I
>> download it again, it won¨t open anywhere. Has this happened to anyone
> else
>> on this list?.. if so, please advise!.
>>
>> Here is the code for the script if it helps:
>>
>>
>> function createThumbnail($path, $filename) {
>> $src_img=ImageCreateFromJpeg($path); //HERE IT SAYS IMAGE NOT VALID
>> if (imagesx($src_img) > imagesy($src_img)) {
>> $new_w=69;
>> $new_h=40;
>> $t1 = imagesx($src_img);
>> $t2 = imagesy($src_img);
>> } else {
>> $new_w=40;
>> $new_h=69;
>> $t1 = imagesy($src_img);
>> $t2 = imagesx($src_img);
>> }
>> header("Content-type: image/jpeg");
>> $dst_img=imagecreate($new_w,$new_h);
>> imagecopyresized($dst_img,$src_img,0,0,0,0,$new_w,$new_h,$t1,$t2);
>> ImageJpeg($dst_img,
>> "/home/sites/site1/web/uploadedHi-Res/$filename-thumb.jpg", 50);
>> }
>>
>>
>> if (($filename_type != "image/jpeg") && ($filename_type != "image/jpg") &&
>> ($filename_type != "image/pjpeg")) {
>> header("Location:submitError.php"); exit;
>> } else {
>> srand((double)microtime()*1000000);
>> $randomfile = substr(md5(rand(0,9999999)), 0, 6);
>> $upload = "/home/sites/site1/web/uploadedHi-Res";
>> $upload_path = "$upload/$filename_name";
>> if (is_uploaded_file($filename)) {
>> Exec("cp $filename $upload_path");
>> $link =
mysql_connect(localhost, 'xxxxx', 'xxxx')
>> or die("Unable to Connect to Database");
>> mysql_select_db(xxxx);
>> $sql = "INSERT INTO xxxx VALUES ('$designer_valid', '$filename_name',
>> NOW(), 'Pending')";
>> $result = mysql_query($sql) or die("Query Failed");
>> createThumbnail($upload_path, $filename_name);
>> header("Location:designSubmitted.php"); exit;
>> } else {
>> header("Location:submitError.php"); exit;
>> }
>> }
>>
>>
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>>
>
>
attached mail follows:
Hi,
Right now my PHP is set up to use Postgresql. I want to use MySQL now. How do I let PHP know that MySQL is now installed?
thanks, Joel
attached mail follows:
You don't let PHP know that it is installed. You just have to make sure that PHP is supporting mysql functions (compiled with mysql support) and start using mysql function.. Check out what phpinfo() prints , whether or not there is mysql related info in its output.. Gurhan
"Joel Lopez" <badassmexican
attbi.com> wrote in message
news:20020726231841.99259.qmail
pb1.pair.com...
> Hi,
>
> Right now my PHP is set up to use Postgresql. I want to use MySQL now.
How
> do I let PHP know that MySQL is now installed?
>
> thanks,
> Joel
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
Hi, everyone.
There MUST be some creative way to call a user-defined PHP function from an <a href> tag. Does anyone have any suggestions?
For example:
====================================================================== <html> <a href="<?php joe(); ?>"> Click here to start "function joe()". </a>
<?php function joe() { $temp1=10; $temp2=20; $result=$temp1+$temp2; echo "The result of this function is: " . $result; } ?>
</html> ======================================================================
So, if the user clicks on the link, he'll see: "The result of this function is: 20"
Any ideas? Any help would be VERY much appreciated. Thanks!
-- Michael
attached mail follows:
> There MUST be some creative way to call a user-defined PHP function from > an <a href> tag. Does anyone have any suggestions?
Yeah, I got one. It's kind of crazy, but how about we assume PHP is server side and anything that happens in the browser is called, well, let's say client side. Let's, for argument's sake, say that server side happens first to create the client side code. After the server side part is done, it's done. It can't affect anything client side unless you request another page or refresh the page.
> <a href="<?php joe(); ?>"> Click here to start "function joe()". </a>
<a href="function.php">click here to run function joe().</a>
Then place the following in function.php file:
> <?php > function joe() { > $temp1=10; > $temp2=20; > $result=$temp1+$temp2; > echo "The result of this function is: " . $result; > } > ?>
> So, if the user clicks on the link, he'll see: "The result of this > function is: 20"
And he will, but it requires a page to be requested...otherwise use JavaScript.
---John Holmes...
attached mail follows:
Ok, here i made a function that can accept an unknown number of params.
In fact, it's a data interface for a mysql database, when i call the object's constructor it is in possibility to pass any number of table names from 1 to x. Now i got this other class called a data interfacer which sends a certain number of tables to the data interface constructor. I tried doing:
$interface = new data_interface($table1, eval("$table2, $table3, $table4")); $interface = eval("new data_interface($table1, $table2, $table3, $table4)");
and various other tries. The thing is i can't know how many tables can be transfered from the data interfacer to the data_interface. So i could make a if..elseif...elseif until i reach something like 10 tables but still, it's not a good practice, i'm sure there is a way to emulate real parameters when they are needed and skip them in the call if you don't have them.
Can anybody help me out?
InsaneCoder
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]