|
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 7 Jun 2004 18:22:19 -0000 Issue 2808
php-general-digest-help
lists.php.net
Date: Mon Jun 07 2004 - 13:22:19 CDT
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
php-general Digest 7 Jun 2004 18:22:19 -0000 Issue 2808
Topics (messages 187770 through 187822):
PHP5-Perl extension
187770 by: Umesh Deshmukh
PHP + Multiple MySQL-4.0.20
187771 by: Minuk Choi
187774 by: Curt Zirzow
Re: mkdir after mkdir
187772 by: Uttam
GD error on 4.3.7: fatal libpng error
187773 by: Alex
187775 by: Curt Zirzow
Re: ini_get
187776 by: Ford, Mike [LSS]
187808 by: Ben Ramsey
187809 by: Marek Kilimajer
187810 by: John Nichel
187811 by: Ben Ramsey
187812 by: Richard Davey
187813 by: Ben Ramsey
187814 by: John Nichel
187815 by: Richard Davey
187816 by: John Nichel
187817 by: Ben Ramsey
187818 by: Ben Ramsey
187819 by: John Nichel
187820 by: Richard Davey
187821 by: Dennis Gearon
Best solution for creating variables from mysql statements
187777 by: Nunners
testing ip filtering
187778 by: Merlin
187779 by: Marek Kilimajer
Re: Intalling PHP 4.3.7 with PGSQL support and Heimdal
187780 by: Robert Fitzpatrick
Newbie question about isset and binary conditionals
187781 by: Al
187782 by: Al
187783 by: Ford, Mike [LSS]
187787 by: Al
Re: asp.net vs. php
187784 by: Jay Blanchard
source code display
187785 by: Nguyen, Long P (Mission Systems)
187786 by: Matt Matijevich
187788 by: John Nichel
187790 by: Nguyen, Long P (Mission Systems)
187803 by: John Nichel
187805 by: Ben Ramsey
187807 by: Ben Ramsey
Re: Dynamic Function Call
187789 by: Tom Rogers
Javascript Question
187791 by: GodFoca
187793 by: Gabino Travassos
Coding productivity benchmarks?
187792 by: Derrick fogle
187794 by: Richard Davey
187796 by: Brent Baisley
187806 by: Tyler Replogle
Dynamic Tables
187795 by: Christopher J. Crane
I'm Completely Confused
187797 by: GodFoca
187800 by: GodFoca
other browsers
187798 by: Bob Lockie
187799 by: Oliver Hankeln
187804 by: Ben Ramsey
Doh!
187801 by: GodFoca
Re: if/elseif/else v. switch
187802 by: Chris W. Parker
Re: image resize looks horrible..
187822 by: Edward Peloke
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:
Hi,
We are using PHP5 on linux, basically we are interested in working with
PHP5-perl extension.
We are using Movable Type library for blog. We have problem in using object
of Movable Type (perl library) in PHP.
Can anybody guide me on how to use Perl Object in PHP5.
Thanking in anticipation.
Regards,
Umesh.
attached mail follows:
I have a RedHat9 machine.
I needed to have multiple MySQL installations, so I removed the RPM
installation and did a binary installation of MySQL-4.0.20. As it stands, I
have the following installations
/usr/local/mysql-4.0.20-webpage
/usr/local/mysql-4.0.20-exp
/usr/local/mysql-4.0.20-def
These are all the same BINARY installations of MySQL-4.0.20, I just need to
have 3 distinct set of mysql databases(along with their specific custom
database/tables). It seems to have worked, as I can get the mysql instances
up and running.
BUT, I can't seem to make PHP access these databases. More specifically,
phpMyAdmin-2.5.6 says
cannot load MySQL extension,
please check PHP Configuration.
Documentation
I haven't a clue as to how to resolve this. My guess is, like the MySQL
RPM, uninstall it and do a non-RPM install...
If I get the source and run configure... it seems like the --with-mysql=
field only takes 1 mysql path. What should I do in my case, where there are
3 paths, 3 sockets, and 3 ports on which mysql resides?
Thanks in advance,
-Minuk
attached mail follows:
* Thus wrote Minuk Choi (Choi.Minuk
verizon.net):
> I have a RedHat9 machine.
>
> I needed to have multiple MySQL installations, so I removed the RPM
> installation and did a binary installation of MySQL-4.0.20. As it stands, I
> have the following installations
>
> /usr/local/mysql-4.0.20-webpage
> /usr/local/mysql-4.0.20-exp
> /usr/local/mysql-4.0.20-def
This seems a little odd. You should be able to use the same
binaries with different startup scripts. But if its working no need
to step backward and redo you're mysql installation.
>
> BUT, I can't seem to make PHP access these databases. More specifically,
> phpMyAdmin-2.5.6 says
To get more detailed information as what is happening try this:
php -d display_errors=On \
-d display_startup_errors=On \
-d error_reporting=E_ALL \
-r mysql_connect()
>
> cannot load MySQL extension,
> please check PHP Configuration.
> Documentation
>
solution 1 (recommended):
remove the php rpm and install from source. this can be a nightmare
since most *-dev rpm's wont be installed.
solution 2:
you're going to need to rebuild the mysql.so that it is looking at
the right mysqlclient. And change you're php.ini settings to the
appropriate port/socket
In theory you can do something like this:
- download exact version of php's source used with redhat.
- extract and issue the following commands:
cd php-4.x.x/ext/mysql
phpize
./configure --with-mysql=shared,/usr/local/mysql-4.x.x-webpage
make
su
make install
This will make the mysql.so and should place it in the right place,
see the /etc/php.ini:extension_dir setting for the right place.
As for you mysql port settings see:
php.ini:
mysql.default_port = ;set to mysql-webpage mysql port
mysql.default_socket = ;set to mysql-webpage mysql socket
Curt
--
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about. No, sir. Our model is the trapezoid!
attached mail follows:
guess it has something to do with default directory rights for newly created
directories??
the directory 'x' gives your script permission to create directory under it.
so you are able to create directory 'y' inside 'x'. but the newly created
directory 'y' does not gives your script permission to create subdirectory.
Regards,
-----Original Message-----
From: Gerben [mailto:gerbendekeijzer
12move.nl]
Sent: Sunday, June 06, 2004 23:39
To: php-general
lists.php.net
Subject: Re: [PHP] mkdir after mkdir
Unfortunately my server has no ftp (but SSH).
It makes much sence what you said, but how can PHP (with uid=48) make a
directory with uid=1042.
both folder are (to be) made the same script, but only one is (with
uid=1042).
This is what makes it very peculiar.
I think I have skip the idea of creating 2 nested folders.
Thanks anyway
"Marek Kilimajer" <lists
kilimajer.net> wrote in message
news:40C355D8.4090803
kilimajer.net...
> Gerben wrote:
> > Hello,
> >
> > I have a problem with the mkdir function.
> > I'm trying to make a seperate folder every photoalbum. inside I want to
> > create another folder ('.../thumbnails/') for, you can guess, the
> > thumbnails.
> >
> > At first it didn't work at all:
> >
> >
> >>Warning: mkdir() failed (Permission denied) in
> >
> > /home/virtual/site43/fst/var/www/html/beheer/albums/index.php on line 42
> >
> > When I changed the rights of the folder I wanted to create the new
folder in
> > to chmod 0777, the first MKDIR did work, but the second did not.
> >
> >
> >>SAFE MODE Restriction in effect. The script whose uid is 1042 is not
> >
> > allowed to access
> > /home/virtual/site43/fst/var/www/html/uploaded/images/albums/album_0
owned
> > by uid 48 in
/home/virtual/site43/fst/var/www/html/beheer/albums/index.php
> > on line 43
> >
> > this is very strange because the folders are both made in the same
script.
> > Another strange thing is that I user mkdir($dir, 0777), but when I look
at
> > the created folder it is 0755 and I can not change it.
> >
> > That's pritty much my problem. Your help would be very much appreciated.
> >
>
> The first directory your script creates is owned by the uid apache runs
> under (48 in your case). Safe mode allows access only to files and
> directories owned by the uid of the executing script (1042 in your case).
>
> The workaround is to use ftp functions to create the directories. Simply
> use your ftp username and password to login to localhost and create
> the directories.
>
> HTH
attached mail follows:
Hi!
I'm not sure if this is the right place to post this, or if this is a bug or
something I'm doing wrong.
My host recently upgraded to 4.3.7, and since then, GD support for PNG's has
been broken. Accessing GD PNG images directly shows the following error
message:
Fatal error: imagepng(): gd-png: fatal libpng error: Incompatible libpng
version in application and library in
/home/cookiebe/public_html/manager/media/graphing/panachart.php on line 469
This occurs on a Linux server runnign PHP as an Apache module, with the
following compile flags set:
'./configure' '--with-apxs=/usr/local/apache/bin/apxs' '--with-xml'
'--enable-bcmath' '--enable-calendar' '--with-curl' '--with-dom'
'--with-dom-xslt' '--with-dom-exslt' '--enable-exif'
'--with-swf=/usr/local/flash' '--enable-ftp' '--with-gd'
'--with-jpeg-dir=/usr/local' '--with-png-dir=/usr'
'--with-xpm-dir=/usr/X11R6' '--with-gettext' '--with-imap' '--with-imap-ssl'
'--with-kerberos' '--enable-mbstring' '--enable-mbstr-enc-trans'
'--enable-mbregex' '--with-mcrypt' '--with-mhash' '--enable-magic-quotes'
'--with-mysql' '--with-openssl' '--enable-discard-path' '--with-pear'
'--enable-sockets' '--enable-track-vars' '--with-ttf'
'--with-freetype-dir=/usr' '--enable-gd-native-ttf' '--enable-versioning'
'--with-xmlrpc' '--with-zlib'
On my Windows server at home, also running PH 4.3.7, it works fine.
Have I done something wrong or have I found a bug (which I then need to
report in the bug tracker)?
Thanks,
Alex
attached mail follows:
* Thus wrote Alex (the.boss
cookiebean.com):
> Hi!
>
> I'm not sure if this is the right place to post this, or if this is a bug or
> something I'm doing wrong.
>
> My host recently upgraded to 4.3.7, and since then, GD support for PNG's has
> been broken. Accessing GD PNG images directly shows the following error
> message:
>
> Fatal error: imagepng(): gd-png: fatal libpng error: Incompatible libpng
> version in application and library in
> /home/cookiebe/public_html/manager/media/graphing/panachart.php on line 469
My first inclination is that the hosting company didn't install
php-4.3.7 correctly.
Curt
--
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about. No, sir. Our model is the trapezoid!
attached mail follows:
On 06 June 2004 22:43, Dennis Gearon wrote:
> CC me please.
>
> Does anyone know if ini_get returns the values BEFORE or AFTER the
> .htaccess modifies them? i.e., does it return the server or
> local version?
It gets the value the script is currently running with. This will be the
local version, unless it has been further modified by an ini_set in the
script.
Cheers!
Mike
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Headingley Campus, LEEDS, LS6 3QS, United Kingdom
Email: m.ford
leedsmet.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
attached mail follows:
DG> Does anyone know if ini_get returns the values BEFORE or AFTER the
DG> .htaccess modifies them? i.e., does it return the server or local
DG> version?
Please clarify what you mean by .htaccess modifying the values of your
php.ini file.
Perhaps you're misunderstanding what ini_get() does? ini_get() only
retrieves values from the php.ini file. I don't think you can modify
those values from an .htaccess file. Likewise, ini_set() will
set/change the values of the php.ini configuration from the application
level (but it will not permanently change the values in php.ini).
Please see http://www.php.net/ini_get and http://www.php.net/ini_set for
more information.
--
Regards,
Ben Ramsey
http://benramsey.com
---------------------------------------------------
http://www.phpcommunity.org/
Open Source, Open Community
Visit for more information or to join the movement.
---------------------------------------------------
attached mail follows:
Ben Ramsey wrote:
> DG> Does anyone know if ini_get returns the values BEFORE or AFTER the
> DG> .htaccess modifies them? i.e., does it return the server or local
> DG> version?
>
> Please clarify what you mean by .htaccess modifying the values of your
> php.ini file.
>
> Perhaps you're misunderstanding what ini_get() does? ini_get() only
> retrieves values from the php.ini file. I don't think you can modify
> those values from an .htaccess file. Likewise, ini_set() will
> set/change the values of the php.ini configuration from the application
> level (but it will not permanently change the values in php.ini).
I'm pretty sure this is what OP meant. He did not mention php.ini being
modified.
attached mail follows:
Ben Ramsey wrote:
> DG> Does anyone know if ini_get returns the values BEFORE or AFTER the
> DG> .htaccess modifies them? i.e., does it return the server or local
> DG> version?
It will return the local value.
> Perhaps you're misunderstanding what ini_get() does? ini_get() only
> retrieves values from the php.ini file. I don't think you can modify
> those values from an .htaccess file. Likewise, ini_set() will
> set/change the values of the php.ini configuration from the application
> level (but it will not permanently change the values in php.ini).
ini_get() will return the current value for the ini_setting...doesn't
matter if it's from the php.ini, ini_set() or a .htaccess file.
--
John C. Nichel
KegWorks.com
716.856.9675
john
kegworks.com
attached mail follows:
MK> I'm pretty sure this is what OP meant. He did not mention php.ini
MK> being modified.
Huh? Who's OP? And what is it that you're pretty sure he meant?
--
Regards,
Ben Ramsey
http://benramsey.com
---------------------------------------------------
http://www.phpcommunity.org/
Open Source, Open Community
Visit for more information or to join the movement.
---------------------------------------------------
attached mail follows:
Hello Ben,
Monday, June 7, 2004, 6:12:26 PM, you wrote:
MK>> I'm pretty sure this is what OP meant. He did not mention php.ini
MK>> being modified.
BR> Huh? Who's OP? And what is it that you're pretty sure he meant?
OP = Original Poster (i.e. not you :)
Best regards,
Richard Davey
--
http://www.launchcode.co.uk - PHP Development Services
"I am not young enough to know everything." - Oscar Wilde
attached mail follows:
JN> ini_get() will return the current value for the ini_setting...
JN> doesn't matter if it's from the php.ini, ini_set() or a
JN> .htaccess file.
All right. Clue me in here. How can an .htaccess file set/modify the
values of php.ini? I wasn't aware that you could do that.
--
Regards,
Ben Ramsey
http://benramsey.com
---------------------------------------------------
http://www.phpcommunity.org/
Open Source, Open Community
Visit for more information or to join the movement.
---------------------------------------------------
attached mail follows:
Ben Ramsey wrote:
> MK> I'm pretty sure this is what OP meant. He did not mention php.ini
> MK> being modified.
>
> Huh? Who's OP? And what is it that you're pretty sure he meant?
>
OP = original poster
I'm pretty sure that the previous poster means that the OP wasn't saying
that an .htaccess file would modify the php.ini, but that it can, and
will change the values at runtime for some php.ini settings.
--
John C. Nichel
KegWorks.com
716.856.9675
john
kegworks.com
attached mail follows:
Hello Ben,
Monday, June 7, 2004, 6:15:11 PM, you wrote:
JN>> ini_get() will return the current value for the ini_setting...
JN>> doesn't matter if it's from the php.ini, ini_set() or a
JN>> .htaccess file.
BR> All right. Clue me in here. How can an .htaccess file set/modify the
BR> values of php.ini? I wasn't aware that you could do that.
See Chapter 4 of the PHP Manual - specifically Runtime Configuration
for all the details, but basically you do:
php_value name value
php_flag name on|off
php_admin_value name value
php_admin_flag name on|off
In your htaccess file. Note this only works if PHP is an Apache
module.
Best regards,
Richard Davey
--
http://www.launchcode.co.uk - PHP Development Services
"I am not young enough to know everything." - Oscar Wilde
attached mail follows:
Ben Ramsey wrote:
> JN> ini_get() will return the current value for the ini_setting...
> JN> doesn't matter if it's from the php.ini, ini_set() or a
> JN> .htaccess file.
>
> All right. Clue me in here. How can an .htaccess file set/modify the
> values of php.ini? I wasn't aware that you could do that.
>
Say I want to set my include_path to something else, but don't want to
have to add ini_set to every file in the site. I create an .htaccess
file in the top level directory where I want the change made, with this
line...
php_value include_path ".:/path/to/new/include/directory"
You can also do this in the Apache httpd.conf, the only difference being
that a change to the httpd.conf requires a restart of Apache, and an
.htaccess takes effect right away.
It doesn't physically overwrite the php.ini file, just changes the value
of the setting. You can do this for all settings that you can change
with ini_set()
--
John C. Nichel
KegWorks.com
716.856.9675
john
kegworks.com
attached mail follows:
That's pretty interesting there, and I'll definitely have to try it out.
However, Chapter 4 mentions nothing about being able to set runtime
values in an .htaccess file... unless I missed something:
http://www.php.net/manual/en/configuration.php
Richard Davey wrote:
> Hello Ben,
>
> Monday, June 7, 2004, 6:15:11 PM, you wrote:
>
> JN>> ini_get() will return the current value for the ini_setting...
> JN>> doesn't matter if it's from the php.ini, ini_set() or a
> JN>> .htaccess file.
>
> BR> All right. Clue me in here. How can an .htaccess file set/modify the
> BR> values of php.ini? I wasn't aware that you could do that.
>
> See Chapter 4 of the PHP Manual - specifically Runtime Configuration
> for all the details, but basically you do:
>
> php_value name value
> php_flag name on|off
> php_admin_value name value
> php_admin_flag name on|off
>
> In your htaccess file. Note this only works if PHP is an Apache
> module.
>
> Best regards,
>
> Richard Davey
--
Regards,
Ben Ramsey
http://benramsey.com
---------------------------------------------------
http://www.phpcommunity.org/
Open Source, Open Community
Visit for more information or to join the movement.
---------------------------------------------------
attached mail follows:
Disregard my incompetence... Chapter 4 does mention it on subsequent pages.
Ben Ramsey wrote:
> That's pretty interesting there, and I'll definitely have to try it out.
> However, Chapter 4 mentions nothing about being able to set runtime
> values in an .htaccess file... unless I missed something:
>
> http://www.php.net/manual/en/configuration.php
>
>
> Richard Davey wrote:
>
>> Hello Ben,
>>
>> Monday, June 7, 2004, 6:15:11 PM, you wrote:
>>
>> JN>> ini_get() will return the current value for the ini_setting...
>> JN>> doesn't matter if it's from the php.ini, ini_set() or a
>> JN>> .htaccess file.
>>
>> BR> All right. Clue me in here. How can an .htaccess file set/modify
>> the
>> BR> values of php.ini? I wasn't aware that you could do that.
>>
>> See Chapter 4 of the PHP Manual - specifically Runtime Configuration
>> for all the details, but basically you do:
>>
>> php_value name value
>> php_flag name on|off
>> php_admin_value name value
>> php_admin_flag name on|off
>>
>> In your htaccess file. Note this only works if PHP is an Apache
>> module.
>>
>> Best regards,
>>
>> Richard Davey
>
>
--
Regards,
Ben Ramsey
http://benramsey.com
---------------------------------------------------
http://www.phpcommunity.org/
Open Source, Open Community
Visit for more information or to join the movement.
---------------------------------------------------
attached mail follows:
Ben Ramsey wrote:
> That's pretty interesting there, and I'll definitely have to try it out.
> However, Chapter 4 mentions nothing about being able to set runtime
> values in an .htaccess file... unless I missed something:
>
> http://www.php.net/manual/en/configuration.php
http://www.php.net/manual/en/configuration.changes.php
--
John C. Nichel
KegWorks.com
716.856.9675
john
kegworks.com
attached mail follows:
Hi,
Monday, June 7, 2004, 5:49:30 PM, you wrote:
DG>> Does anyone know if ini_get returns the values BEFORE or AFTER the
DG>> .htaccess modifies them? i.e., does it return the server or local
DG>> version?
BR> Perhaps you're misunderstanding what ini_get() does? ini_get() only
BR> retrieves values from the php.ini file. I don't think you can modify
BR> those values from an .htaccess file.
You can modify any PHP_PERDIR/ALL value from an .htaccess file.
In answer to the original question: if you use an htaccess file to
modify a PHP value, ini_get will use the LOCAL version of that value
(as opposed to the master version). So yes, anything changed via
htaccess would be reflected via ini_get.
Best regards,
Richard Davey
--
http://www.launchcode.co.uk - PHP Development Services
"I am not young enough to know everything." - Oscar Wilde
attached mail follows:
thank you very much.
Richard Davey wrote:
>Hi,
>
>Monday, June 7, 2004, 5:49:30 PM, you wrote:
>
>DG>> Does anyone know if ini_get returns the values BEFORE or AFTER the
>DG>> .htaccess modifies them? i.e., does it return the server or local
>DG>> version?
>
>BR> Perhaps you're misunderstanding what ini_get() does? ini_get() only
>BR> retrieves values from the php.ini file. I don't think you can modify
>BR> those values from an .htaccess file.
>
>You can modify any PHP_PERDIR/ALL value from an .htaccess file.
>
>In answer to the original question: if you use an htaccess file to
>modify a PHP value, ini_get will use the LOCAL version of that value
>(as opposed to the master version). So yes, anything changed via
>htaccess would be reflected via ini_get.
>
>Best regards,
>
>Richard Davey
>
>
attached mail follows:
I'm creating an application which has multiple users, with their own logins
etc etc.
From it, they have a number of links to external websites, to which I need
to pass certain details, e.g.
http://somewebsite.com/index.php?username=bob
<http://somewebsite.com/index.php?username=bob&password=fred> &password=fred
For management purposes, I am wanting to have the overall URL in a MySQL
table, and want to be able to use that to get the appropriate variables from
another table.
So I have:
Table: Websites
ID
Name
Website
1
Somewebsite
http://somewebsite.com/index.php?username=$username
<http://somewebsite.com/index.php?username=$username&password=$password>
&password=$password
2
Anotherwebsite
http://anotherwebsite.net/login.php?agent=$agent
3
Agreatwebsite
http://agreatwebsite.com/index.php?user=$user
<http://agreatwebsite.com/index.php?user=$user&id=$id> &id=$id
Table: User_Website_Details
User
Website_ID
Variable
Value
Bob
1
Username
Bob
Bob
1
Password
Fred
James
2
Agent
03658264
Greg
3
User
Bob_fred
Greg
3
Id
49y5h9-845yf9
How can I get the values from the user's individual details into the
required output?
Cheers
Nunners
attached mail follows:
Hi there,
I am serving certain parts of my page only to specific countries (geotargeted
advertisement). Now I am wondering how I could check how the page looks like
from that country wihout traveling there :-) Is there a way to "fool" the system
that one is in US instead of Germany?
Thanx for any advice,
Merlin
attached mail follows:
Merlin wrote:
> Hi there,
>
> I am serving certain parts of my page only to specific countries
> (geotargeted advertisement). Now I am wondering how I could check how
> the page looks like from that country wihout traveling there :-) Is
> there a way to "fool" the system that one is in US instead of Germany?
>
> Thanx for any advice,
>
> Merlin
>
You need to get around the way you find out the country, for example:
if(DEBUG && isset($_GET['country'])) {
$country = $_GET['country'];
} else {
$country = get_country_from_ip($_SERVER['REMOTE_ADDR']);
}
Hope this code makes it clear ;-)
attached mail follows:
On Sun, 2004-06-06 at 17:48, Marek Kilimajer wrote:
> Robert Fitzpatrick wrote:
> > On Sun, 2004-06-06 at 16:49, Marek Kilimajer wrote:
> >
> >>Robert Fitzpatrick wrote:
> >>
> >>>Trying to portupgrade my PHP 4.3.6 package with PostgreSQL 7.4.2 support and getting this error below. Trying to setup postgresql with Heimdal Kerberos 5 support, believe I have, but not tried anything with it, yet.
> >>>
> >>>/usr/local/lib/libpq.so: undefined reference to `krb5_cc_get_principal'
> >>>/usr/local/lib/libpq.so: undefined reference to `krb5_sname_to_principal'
> >>>/usr/local/lib/libpq.so: undefined reference to `krb5_cc_default'
> >>>/usr/local/lib/libpq.so: undefined reference to `krb5_cc_close'
> >>>/usr/local/lib/libpq.so: undefined reference to `error_message'
> >>>/usr/local/lib/libpq.so: undefined reference to `krb5_free_error'
> >>>/usr/local/lib/libpq.so: undefined reference to `krb5_sendauth'
> >>>/usr/local/lib/libpq.so: undefined reference to `krb5_free_principal'
> >>>/usr/local/lib/libpq.so: undefined reference to `krb5_unparse_name'
> >>>/usr/local/lib/libpq.so: undefined reference to `krb5_free_context'
> >>>/usr/local/lib/libpq.so: undefined reference to `krb5_init_context'
> >>>*** Error code 1
> >>>
> >>>Stop in /usr/ports/lang/php4/work/php-4.3.7.
> >>>
> >>>I've posted this around a few weeks ago on some lists and still no success. I had a suggestion to add lines to the spec file, but not sure which file that is. Seems PHP is having a problem with the PGSQL support and its libraries for krb5. Nonetheless, from the looks of the Makefile for postgresql, everything should be there for it to build with krb5 support. I receive no errors when building or installing posgresql with heimdal support and have tried 'make deinstall' and 'make reinstall'. I have the WITH_HEIMDAL_KRB5, HEIMDAL_HOME is set to /usr/local where it resides with libs and includes. Someone also suggested adding a -lkrb5, but again, I have not been able to figure out where to place this setting in the file. Should I add it to the line that produces the error building PHP above (I think the libtool command) or in the postgresql Makefile.
> >>>
> >>
> >>Add -lkrb5 to LDFLAGS variable in the Makefile.
> >
> >
> > Thanks, I tried and it doesn't seem to help. This is in the Makefile
> > now. I am trying this when building PostgreSQL, do the links shown in my
> > last post to psql show the libs are setup correctly after installation
> > of PostgreSQL? I have WITH_HEIMDAL_KRB5 set to 'yes' and
> > /usr/bin/krb5-config is a symlink to /usr/local/bin/krb5-config which
> > has the correct locations for libs and includes.
> >
> > .if defined(WITH_HEIMDAL_KRB5)
> > KRB5CONF= /usr/bin/krb5-config
> > WITH_KRB5= yes
> > .endif
> >
> > .include <bsd.port.pre.mk>
> > .if defined(WITH_KRB5)
> > CONFIGURE_ARGS+= --with-krb5="`${KRB5CONF} --prefix krb5`"
> > LDFLAGS+= `${KRB5CONF} --libs krb5`
> > CONFIGURE_ENV= LDFLAGS="${LDFLAGS}"
> > .endif
> >
> > That should set things up, but if I add LDFLAGS+=`-lkrb5`, I get an
> > error.
> >
>
>
> Is /usr/local/lib in /etc/ld.so.conf file?
No, there is no such file. But this is not Linux, FreeBSD Unix 5.2.1.
--
Robert
attached mail follows:
I posted this previously; but the subject was misleading.
I could use one additional clarification regarding good practice.
As I understand the php manual the following is acceptable and I assume
good practice.
$foo= TRUE;
if($foo) do.............. ; where $foo is a binary; but not a variable.
isset should be used for variables, such as;
isset($var) for variables and be careful with $var= ' '; etc. because
$var is assigned, i.e., "set".
attached mail follows:
I posted this previously; but the subject was misleading.
I could use one additional clarification regarding good practice.
As I understand the php manual the following is acceptable and I assume
good practice.
$foo= TRUE;
if($foo) do.............. ; where $foo is a binary; but not a variable.
isset should be used for variables, such as;
isset($var) for variables and be careful with $var= ' '; etc. because
$var is assigned, i.e., "set".
attached mail follows:
On 07 June 2004 14:04, Al wrote:
> I posted this previously; but the subject was misleading.
You seem to have several possible misconceptions in your posting -- this may
just be me misreading you, but anyway...
> I could use one additional clarification regarding good practice.
>
> As I understand the php manual the following is acceptable
> and I assume
> good practice.
>
> $foo= TRUE;
Not only acceptable but encouraged.
>
> if($foo) do.............. ; where $foo is a binary; but not
> a variable.
$foo is always a variable -- it can contain values of several types, one of
which is Boolean (not binary -- that's just a way of representing integers)
TRUE/FALSE.
> isset should be used for variables, such as;
>
> isset($var) for variables and be careful with $var= ' ';
> etc. because
> $var is assigned, i.e., "set".
To work out which test you need to use, it's crucial to understand what
evaluates to FALSE in a Boolean context (which the test of an if() statement
is. This is covered in precise detail in the PHP manual at
http://www.php.net/manual/en/language.types.boolean.php#language.types.boole
an.casting, but to summarize:
the following are considered FALSE: Boolean FALSE, numeric zero (0 or
0.0), the strings "" and "0", an empty array or object, and NULL; all other
values are TRUE. In addition to this, an unset variable will be evaluated
as NULL, and hence considered FALSE, but PHP will also issue an undefined
variable warning in this case (which may or may not be suppressed by your
PHP configuration!).
On the other hand, isset($var) will return TRUE if $var has been set to any
value except NULL, and FALSE otherwise -- so an isset() test on all the
other values listed above (including FALSE!) will be TRUE.
Other tests you may want to look into are empty() http://www.php.net/empty
and is_null() http://www.php.net/is-null; there are also some handy tables
at http://uk.php.net/manual/en/types.comparisons.php to help you see what
the various tests return.
Cheers!
Mike
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Headingley Campus, LEEDS, LS6 3QS, United Kingdom
Email: m.ford
leedsmet.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
attached mail follows:
That's a big help Mike.
My server has the error level set such that my incorrect use of if($var)
did not show undefined variables. Though everything seemed to work OK.
I'm going my code and using if( TRUE or FALSE) isset() and empty() as
appropriate.
Al..........
Mike Ford wrote:
>On 07 June 2004 14:04, Al wrote:
>
>
>
>>I posted this previously; but the subject was misleading.
>>
>>
>
>You seem to have several possible misconceptions in your posting -- this may
>just be me misreading you, but anyway...
>
>
>
>>I could use one additional clarification regarding good practice.
>>
>>As I understand the php manual the following is acceptable
>>and I assume
>>good practice.
>>
>>$foo= TRUE;
>>
>>
>
>Not only acceptable but encouraged.
>
>
>
>>if($foo) do.............. ; where $foo is a binary; but not
>>a variable.
>>
>>
>
>$foo is always a variable -- it can contain values of several types, one of
>which is Boolean (not binary -- that's just a way of representing integers)
>TRUE/FALSE.
>
>
>
>>isset should be used for variables, such as;
>>
>> isset($var) for variables and be careful with $var= ' ';
>>etc. because
>>$var is assigned, i.e., "set".
>>
>>
>
>To work out which test you need to use, it's crucial to understand what
>evaluates to FALSE in a Boolean context (which the test of an if() statement
>is. This is covered in precise detail in the PHP manual at
>http://www.php.net/manual/en/language.types.boolean.php#language.types.boole
>an.casting, but to summarize:
>
> the following are considered FALSE: Boolean FALSE, numeric zero (0 or
>0.0), the strings "" and "0", an empty array or object, and NULL; all other
>values are TRUE. In addition to this, an unset variable will be evaluated
>as NULL, and hence considered FALSE, but PHP will also issue an undefined
>variable warning in this case (which may or may not be suppressed by your
>PHP configuration!).
>
>On the other hand, isset($var) will return TRUE if $var has been set to any
>value except NULL, and FALSE otherwise -- so an isset() test on all the
>other values listed above (including FALSE!) will be TRUE.
>
>Other tests you may want to look into are empty() http://www.php.net/empty
>and is_null() http://www.php.net/is-null; there are also some handy tables
>at http://uk.php.net/manual/en/types.comparisons.php to help you see what
>the various tests return.
>
>Cheers!
>
>Mike
>
>---------------------------------------------------------------------
>Mike Ford, Electronic Information Services Adviser,
>Learning Support Services, Learning & Information Services,
>JG125, James Graham Building, Leeds Metropolitan University,
>Headingley Campus, LEEDS, LS6 3QS, United Kingdom
>Email: m.ford
leedsmet.ac.uk
>Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
>
>
attached mail follows:
[snip]
..stuff..
[/snip]
There is no comparison....
PHP is a language - asp.net is a set of methodologies applicable to
several languages
attached mail follows:
Hi -
When I try to bring up an "index.php3" file on a browser, what display are source codes.
And when I tried to bring up the same "index.php" file, I get the following:
<http://158.114.148.90/<? echo $sys_graphics .> " alt="Keystone 2" />
_____
setCols(2); $loginBox->addRow('Username'); $loginBox->addRow(''); $loginBox->addRow("Password"); $loginBox->addRow(''); $loginBox->setSpan(2); $loginBox->setAlignment('center'); $loginBox->addRow(''); echo $loginBox->dump(); echo "
"; echo "\n"; #----------------------------------------------------------------- # Contact login box... /* echo " "; echo "
"; $contactBox = new Box("Contact login"); $contactBox->setCols(2); $contactBox->addRow('Username','50%'); $contactBox->addRow('','50%'); $contactBox->addRow("Password",'50%'); $contactBox->addRow('','50%'); $contactBox->setSpan(2); $contactBox->setAlignment('center'); $contactBox->addRow(''); echo $contactBox->dump(); echo "
"; echo "\n"; */ #----------------------------------------------------------------- # Go to a specific slip... echo ' '; echo '
'."\n"; echo ''."\n"; $slipBox = new Box("View / Create a slip"); $slipBox->setCols(3); $slipBox->addRow('Slip number','30%'); $slipBox->addRow('','30%'); $slipBox->addRow('','30%'); $slipBox->setAlignment('center'); $slipBox->setSpan(3); $slipBox->addRow('
'); echo $slipBox->dump(); echo "
"; echo "\n"; ?>
setCols(2); $browseBox->addRow("Slips whose status is","50%"); $statcodes = new fetchStatus(); $values = $statcodes->getResult(); $t = ''."\n"; $t .= " Any"; while (list($key,$val) = each($values)) { $t .= " $val"; } $t .= ""; $browseBox->addRow($t,"50%"); $browseBox->addRow("Relating to","50%"); $quickslips = new fetchQuickSlips(); $values = $quickslips->getResult(); $t = ''."\n"; if (isset($values)) { while (list($key,$val) = each($values)) { $t .= " $val"; } } // Prevent an error on the index page if there are no slips yet. $t .= ""; $browseBox->addRow($t,"50%"); $browseBox->setSpan(2); $browseBox->setAlignment('center'); $browseBox->addRow('','50%'); echo $browseBox->dump(); /* ?>
setAlignment("center"); $newBox->addRow('dump(); */?>
_____
Keystone2 is © 1998-2004 Stonekeep Consulting, Inc
http://www.stonekeep.com/ <http://www.stonekeep.com/>
<mailto:php-general
lists.php.net>
attached mail follows:
[snip]
When I try to bring up an "index.php3" file on a browser, what display
are source codes.
[/snip]
I dont see <? or <?php anywhere. Do you have that somewhere in your
code?
If you do, are you sure php is installed on the server?
attached mail follows:
Nguyen, Long P (Mission Systems) wrote:
> Hi -
>
> When I try to bring up an "index.php3" file on a browser, what display are source codes.
>
> And when I tried to bring up the same "index.php" file, I get the following:
Is your web server parsing *.php3 files as php?
Apache:
AddType application/x-httpd-php .php .php3
--
John C. Nichel
KegWorks.com
716.856.9675
john
kegworks.com
attached mail follows:
Yes.
AddType application/x-httpd-php php php3
-----Original Message-----
From: John Nichel [mailto:john
kegworks.com]
Sent: Monday, June 07, 2004 9:49 AM
To: php-general
lists.php.net
Subject: Re: [PHP] source code display
Nguyen, Long P (Mission Systems) wrote:
> Hi -
>
> When I try to bring up an "index.php3" file on a browser, what display are source codes.
>
> And when I tried to bring up the same "index.php" file, I get the following:
Is your web server parsing *.php3 files as php?
Apache:
AddType application/x-httpd-php .php .php3
--
John C. Nichel
KegWorks.com
716.856.9675
john
kegworks.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Nguyen, Long P (Mission Systems) wrote:
> Yes.
>
> AddType application/x-httpd-php php php3
Don't know if it matters or not, but all the 'examples' I've seen have
the dot before the extension, ie
AddType application/x-httpd-php .php .php3
--
John C. Nichel
KegWorks.com
716.856.9675
john
kegworks.com
attached mail follows:
JN> Don't know if it matters or not, but all the 'examples' I've seen
JN> have the dot before the extension, ie
JN>
JN> AddType application/x-httpd-php .php .php3
I've never used the dot (.) before the extension in Apache, and all
works well.
--
Regards,
Ben Ramsey
http://benramsey.com
---------------------------------------------------
http://www.phpcommunity.org/
Open Source, Open Community
Visit for more information or to join the movement.
---------------------------------------------------
attached mail follows:
Oh, I also meant to mention this:
Are you sure that Apache is loading in the correct PHP module? The
following lines are in my httpd.conf file:
LoadModule php4_module modules/libphp4.so
AddType application/x-httpd-php php
Assuming you're using PHP 3 instead of PHP 4, I guess you would load
php3_module with the filename of libphp3.so. Then again, maybe you're
just trying to parse .php3 files with PHP 4, so leave it the way you see
it above, but you may also want to put the php3 extension on a separate
line and see if that helps:
AddType application/x-httpd-php php
AddType application/x-httpd-php php3
AddType application/x-httpd-php php4
And so on...
Ben Ramsey wrote:
> JN> Don't know if it matters or not, but all the 'examples' I've seen
> JN> have the dot before the extension, ie
> JN>
> JN> AddType application/x-httpd-php .php .php3
>
> I've never used the dot (.) before the extension in Apache, and all
> works well.
>
--
Regards,
Ben Ramsey
http://benramsey.com
---------------------------------------------------
http://www.phpcommunity.org/
Open Source, Open Community
Visit for more information or to join the movement.
---------------------------------------------------
attached mail follows:
Hi,
Monday, June 7, 2004, 11:47:00 AM, you wrote:
> Hello everyone!
> I'm trying to call a class method dynamically, but keep getting a SYNTAX
> ERROR. Can anyone shed some light on this? Is this impossible?
> ==The Code
> function &modCall($_class){
> $this->LoadClass($_class); //LoadClass includes the class file, but
> //does not initialize it.
> //if the class has the method, then call it.
> if(in_array('sayHello',get_class_methods($_class)){
> $_class::sayHello();
> // this line reports a syntax error with $_class::sayHello()
> // but (assuming the value of $_class was 'myClass')
> // myClass::sayHello() works!
> }
> //I've also tried the following:
> // ${_class)::sayHello();
> // {$_class}::sayHello();
> // $_class.'::sayHello()';
> }
> Any suggestions!
> =P e p i e D e s i g n s
> www.pepiedesigns.com
> Providing Solutions That Increase Productivity
> Web Developement. Database. Hosting. Multimedia.
You could try eval()
--
regards,
Tom
attached mail follows:
Hey! Sorry for the OT, but since there seems to be no js newsgroup in gmane,
I thought maybe someone in here could answer this simple question.
I am trying to use javascript's "print()" to print a frame FROM ANOTHER
frame.
This is the layout:
<frameset rows="*,40" frameborder="NO" border="0" framespacing="0">
<frame src="..." name="pritableText">
<frame src="..." name="printButton" scrolling="NO" noresize>
</frameset>
In printButton I have a simple anchor:
<a href="#" onClick="parent.printableText.focus();
parent.printableText.print();">
Yet nothing happens. What's wrong?
Thanks in advance,
Nicolas Sanguinetti
attached mail follows:
I would do two things.
1. Test your print() function on the same frame. Create a div called
"printableText" and see if you can print it. If that works, then your
print() function is okay.
2. Test your targeting. Use a different function, such as trying to change
the text or rollover an img in another frame. Then use the document.path
that worked.
BTW, I don't think "parent" is high enough.
And if anyone knows of a Javascript newsgroup this discussion should be on,
I would join it too.
----- Original Message -----
From: "GodFoca" <n.sanguinetti
adinet.com.uy>
To: <php-general
lists.php.net>
Sent: Monday, June 07, 2004 8:47 AM
Subject: [PHP] Javascript Question
> Hey! Sorry for the OT, but since there seems to be no js newsgroup in
gmane,
> I thought maybe someone in here could answer this simple question.
>
> I am trying to use javascript's "print()" to print a frame FROM ANOTHER
> frame.
>
> This is the layout:
>
> <frameset rows="*,40" frameborder="NO" border="0" framespacing="0">
> <frame src="..." name="pritableText">
> <frame src="..." name="printButton" scrolling="NO" noresize>
> </frameset>
>
> In printButton I have a simple anchor:
>
> <a href="#" onClick="parent.printableText.focus();
> parent.printableText.print();">
>
> Yet nothing happens. What's wrong?
>
> Thanks in advance,
> Nicolas Sanguinetti
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
I've been searching around for productivity benchmarks for PHP
programming. The only references I can find for it are in for-pay
publications.
I've ended up becoming a PHP developer more out of happenstance than
anything. I've been doing it for a couple of years now, but... I don't
really know how 'good' I am at it. The place I work has always had
extremely unreasonable expectations for worker productivity, and I'm
trying to fight that.
I've recently been called into another job interview, and part of the
interview is a coding assignment. Some of the documentation suggests
that this assignment should take about 40 minutes. A rough overview of
the 'assignment' - a simple Document Management System - is:
* new user registration and existing user login
* admin-level user management
* document upload and download
* review and suggestion
* a conditional matrix of 5 document conditions vs 3 user levels
* 6 input forms
* 2 listing layouts with fix sorting
* conditional access to changing document conditions based on user
levels
It took me about 4 hours to completely satisfy and debug the assignment
specs with an OK interface. This was with plenty of code
copy/modification from other web apps I've done before, or other online
resources. I ended up spending nearly 4 more hours futzing around with
the interface to get something really nice.
So, am I just a pretender? Are there people out there that can really
bust out a basic DMS in 40 minutes?
If anyone does have some basic PHP programmer productivity benchmarks,
or knows where I can get ahold of them, I'd sure appreciate it. This
issue of productivity expectations has really gotten under my skin, and
I need to know whether or not I should be doing this for a living.
Thanks,
-Derrick
attached mail follows:
Hello Derrick,
Monday, June 7, 2004, 3:51:20 PM, you wrote:
Df> So, am I just a pretender? Are there people out there that can really
Df> bust out a basic DMS in 40 minutes?
I would say that there probably are - but you'd have to question how
robust and well designed their system would be after those 40 minutes
are up. Assuming you weren't allowed to use any external help by way
of PEAR/Smarty/ADOdb/etc then I would have said that building a
friendly system that met all of those criteria in 4 hours is nothing
to be ashamed of.
I'm sorry I don't have any benchmarks for you, but I'd love to know
how anyone could ever create an accurate benchmark for something as
subjective as this anyway. Having worked with PHP for years and
interviewed many people, I would have to say what you were required to
do was quite un-usual and ill thought-out. If they had given you 40
mins to write a document telling how you would approach the system -
that would have been more like it.
This reminded me of an incident where a company local to me was
holding interviews and getting the applicants to actually work on
sites they needed finishing off (basic html stuff) as part of the
interview! Never gave them the job of course, just got them to finish
the projects. Needless to say, they aren't trading any longer :)
Best regards,
Richard Davey
--
http://www.launchcode.co.uk - PHP Development Services
"I am not young enough to know everything." - Oscar Wilde
attached mail follows:
Nothing in the specs you listed mentioned anything about a pretty,
intuitive GUI interface. Drop a nice interface requirement and that
cuts your time considerably. Forget trying to design an "event driven"
interface and drop back on the old mainframe menu driven interface with
one option per screen. Then you just need to design some generic code
that spits out some fields with labels and a continue/save or cancel
button.
"Tests" like these are usually looking more for coding talent and
technique (i.e. code reuse, object orientation, readability, MVC, etc.)
rather than interface design talent. They're most likely trying to
separate the web front end people from the back end people.
On Jun 7, 2004, at 10:51 AM, Derrick fogle wrote:
> I've been searching around for productivity benchmarks for PHP
> programming. The only references I can find for it are in for-pay
> publications.
>
> I've ended up becoming a PHP developer more out of happenstance than
> anything. I've been doing it for a couple of years now, but... I don't
> really know how 'good' I am at it. The place I work has always had
> extremely unreasonable expectations for worker productivity, and I'm
> trying to fight that.
>
> I've recently been called into another job interview, and part of the
> interview is a coding assignment. Some of the documentation suggests
> that this assignment should take about 40 minutes. A rough overview
> of the 'assignment' - a simple Document Management System - is:
> * new user registration and existing user login
> * admin-level user management
> * document upload and download
> * review and suggestion
> * a conditional matrix of 5 document conditions vs 3 user levels
> * 6 input forms
> * 2 listing layouts with fix sorting
> * conditional access to changing document conditions based on user
> levels
>
> It took me about 4 hours to completely satisfy and debug the
> assignment specs with an OK interface. This was with plenty of code
> copy/modification from other web apps I've done before, or other
> online resources. I ended up spending nearly 4 more hours futzing
> around with the interface to get something really nice.
>
> So, am I just a pretender? Are there people out there that can really
> bust out a basic DMS in 40 minutes?
>
> If anyone does have some basic PHP programmer productivity benchmarks,
> or knows where I can get ahold of them, I'd sure appreciate it. This
> issue of productivity expectations has really gotten under my skin,
> and I need to know whether or not I should be doing this for a living.
>
> Thanks,
>
> -Derrick
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search & Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577
attached mail follows:
hey,
I just did all of that and it took me 1 hour and 35 mins, but I edited the
code that i had already made from site before. It didn't take my anywhere
near 4 hours, but there is no way i could do it in 40 mins.
>From: Derrick fogle <derrick
foundationcomputing.com>
>To: <php-general
lists.php.net> <php-general
lists.php.net>
><php-general
lists.php.net>
>Subject: [PHP] Coding productivity benchmarks?
>Date: Mon, 7 Jun 2004 09:51:20 -0500
>
>I've been searching around for productivity benchmarks for PHP programming.
>The only references I can find for it are in for-pay publications.
>
>I've ended up becoming a PHP developer more out of happenstance than
>anything. I've been doing it for a couple of years now, but... I don't
>really know how 'good' I am at it. The place I work has always had
>extremely unreasonable expectations for worker productivity, and I'm trying
>to fight that.
>
>I've recently been called into another job interview, and part of the
>interview is a coding assignment. Some of the documentation suggests that
>this assignment should take about 40 minutes. A rough overview of the
>'assignment' - a simple Document Management System - is:
> * new user registration and existing user login
> * admin-level user management
> * document upload and download
> * review and suggestion
> * a conditional matrix of 5 document conditions vs 3 user levels
> * 6 input forms
> * 2 listing layouts with fix sorting
> * conditional access to changing document conditions based on user levels
>
>It took me about 4 hours to completely satisfy and debug the assignment
>specs with an OK interface. This was with plenty of code copy/modification
>from other web apps I've done before, or other online resources. I ended up
>spending nearly 4 more hours futzing around with the interface to get
>something really nice.
>
>So, am I just a pretender? Are there people out there that can really bust
>out a basic DMS in 40 minutes?
>
>If anyone does have some basic PHP programmer productivity benchmarks, or
>knows where I can get ahold of them, I'd sure appreciate it. This issue of
>productivity expectations has really gotten under my skin, and I need to
>know whether or not I should be doing this for a living.
>
>Thanks,
>
>-Derrick
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>
_________________________________________________________________
MSN Toolbar provides one-click access to Hotmail from any Web page – FREE
download! http://toolbar.msn.click-url.com/go/onm00200413ave/direct/01/
attached mail follows:
What is the best way to produce a report listing the fieldname and then the
data in that field. It is a report containing only one row from a table, but
I don't want to hard code the fields since they change often.
I can get the field names dynamically like this:
$fields = mysql_list_fields("Network", "Subnets");
$num_columns = mysql_num_fields($fields);
for($ i = 0; $i < $num_columns; $i++) { echo mysql_field_name($fields,
$i); }
now is where I get confused....what I would like to happen is do a query on
a single row and put the results into mysql_fetch_assoc and during the prior
loop put the column name into the loop of the data. Something like:
$fields = mysql_list_fields("Network", "Subnets");
$num_columns = mysql_num_fields($fields);
$result = mysql_query("SELECT * FROM table1 WHERE ID = '$ID';
$field = mysql_fetch_assoc($result)
for($ i = 0; $i < $num_columns; $i++) {
echo "<b>" . mysql_field_name($fields, $i) . ": </b>" .
$field[mysql_field_name($fields, $i)] . "<br>\n";
attached mail follows:
Ok, googling I found:
http://www.codelifter.com/main/javascript/printframe.shtml
The example in there works ok, so I copied the code into my docs and it
didn't work. I'm confused.... (BTW, "parent" is all is needed apparently)
Could this be happening because I'm using the extension .php instead of .htm
or .html?
Nicolas
attached mail follows:
Sorry for the new post, this should have been a reply to "Javascript
Question" (ca1v6v$j04$1
sea.gmane.org)
Greeting,
Nicolas
attached mail follows:
I've got this psuedo code that works in the Mozilla browser but does not
work in IE or Opera or Konqueror.
The input type isn't passing a request name or value and I have a few
buttons and I use the name passed to determine with button was pressed.
The PHP related thing
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<form method="get" action="main.php" name="domain" target="_parent">
<INPUT name="edit_ip" value="edit_ip" TYPE="image"
SRC="images/editsmall.gif" HEIGHT="16" WIDTH="51" BORDER="0" ALT="edit
IP addresses">
Mozilla passes:
Request variables:
$_REQUEST[edit_ip_x] = 33
$_REQUEST[edit_ip_y] = 10
$_REQUEST[edit_ip] = edit_ip
$_REQUEST[PHPSESSID] = 5d156dbcb943a96f1c894223c59e471f
Konqueror passes:
Request variables:
$_REQUEST[edit_ip_x] = 30
$_REQUEST[edit_ip_y] = 6
Even assuming I'm not doing the session stuff right, shouldn't
$_REQUEST[edit_ip] be passed reliably?
attached mail follows:
Bob Lockie wrote:
> I've got this psuedo code that works in the Mozilla browser but does not
> work in IE or Opera or Konqueror.
> The input type isn't passing a request name or value and I have a few
> buttons and I use the name passed to determine with button was pressed.
>
> The PHP related thing
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
>
> <form method="get" action="main.php" name="domain" target="_parent">
>
> <INPUT name="edit_ip" value="edit_ip" TYPE="image"
> SRC="images/editsmall.gif" HEIGHT="16" WIDTH="51" BORDER="0" ALT="edit
> IP addresses">
>
>
> Mozilla passes:
> Request variables:
> $_REQUEST[edit_ip_x] = 33
> $_REQUEST[edit_ip_y] = 10
> $_REQUEST[edit_ip] = edit_ip
> $_REQUEST[PHPSESSID] = 5d156dbcb943a96f1c894223c59e471f
>
> Konqueror passes:
> Request variables:
> $_REQUEST[edit_ip_x] = 30
> $_REQUEST[edit_ip_y] = 6
>
> Even assuming I'm not doing the session stuff right, shouldn't
> $_REQUEST[edit_ip] be passed reliably?
First I think your session stuff may be correct. If the browser accepts
cookies it won't have PHPSESSID attached to the forms (IIRC)
Second: Nope. edit_id is not passed reliably. I ran into that problem
a few weeks ago. But It's easy to check nevertheless. edit_ip_x and
edit_ip_y are passed reliably. So just do
if(is_set($_REQUEST["edit_ip_x"]))
//Do stuff
HTH,
Oliver
>
attached mail follows:
OH> a few weeks ago. But It's easy to check nevertheless. edit_ip_x and
OH> edit_ip_y are passed reliably. So just do
OH> if(is_set($_REQUEST["edit_ip_x"]))
OH> //Do stuff
Rather, do:
if(isset($_REQUEST["edit_ip_x"]))
Don't use is_set(). You'll get:
Fatal error: Call to undefined function: is_set()
The value of "edit_ip_x" will not be set unless the image is clicked on,
so you can be sure that this is reliable, as Oliver mentioned.
--
Regards,
Ben Ramsey
http://benramsey.com
---------------------------------------------------
http://www.phpcommunity.org/
Open Source, Open Community
Visit for more information or to join the movement.
---------------------------------------------------
attached mail follows:
Well, I found out why it wasn't working....
The frameset had the frame named "pritableFrame" instead of "printableFrame"
.... so the reference was erroneous.
The following works ok:
<script>
function printFrame(f) {
parent.f.focus();
parent.f.print();
}
</script>
...
<a href="javascript: printFrame('printableFrame');">Print the Other
Frame</a>
Greetings and thanks,
Nicolas
attached mail follows:
Aidan Lister <mailto:aidan
php.net>
on Saturday, June 05, 2004 6:19 AM said:
> You'll note I did not criticise the poster, merely his seemingly
> stupid question.
oh right and that makes everything better. you're a fantastic person!
> I suggest you practice what you preach. If you have a comment on my
> reply to a users post, feel free to contact me personally -
> aidan
php.net
you should be able to handle a little public humiliation/chastisement
since you so easily dish it out.
c.
attached mail follows:
Any ideas as to how I can fix this function???
-----Original Message-----
From: Edward Peloke [mailto:epeloke
echoman.com]
Sent: Thursday, June 03, 2004 4:18 PM
To: Php-General
Subject: [PHP] image resize looks horrible..
I am using the below function which does seem to resize the image yet the
colors in the resized image look horrible. How can I resize the image yet
keep the colors in tact?
Thanks,
Eddie
Justin-I tried your code but it didn't seem to do anything...I will just use
this function if the color will work.
function createthumb($name,$filename,$new_w,$new_h){
global $gd2;
$system=explode(".",$name);
$src_img=imagecreatefromjpeg($name);
$old_x=imageSX($src_img);
$old_y=imageSY($src_img);
if ($old_x > $old_y) {
$thumb_w=$new_w;
$thumb_h=$old_y*($new_h/$old_x);
}
if ($old_x < $old_y) {
$thumb_w=$old_x*($new_w/$old_y);
$thumb_h=$new_h;
}
if ($old_x == $old_y) {
$thumb_w=$new_w;
$thumb_h=$new_h;
}
if ($gd2==""){
$dst_img=ImageCreate($thumb_w,$thumb_h);
imagecopyresized($dst_img,$src_img,0,0,0,0,$thumb_w,$thumb_h,$old_x,$old_y);
}else{
$dst_img=ImageCreateTrueColor($thumb_w,$thumb_h);
imagecopyresampled($dst_img,$src_img,0,0,0,0,$thumb_w,$thumb_h,$old_x,$old_y
);
}
if (preg_match("/png/",$system[1])){
imagepng($dst_img,$filename);
} else {
imagejpeg($dst_img,$filename);
}
imagedestroy($dst_img);
imagedestroy($src_img);
}
WARNING: The information contained in this message and any attachments is
intended only for the use of the individual or entity to which it is
addressed. This message may contain information that is privileged,
confidential and exempt from disclosure under applicable law. It may also
contain trade secrets and other proprietary information for which you and
your employer may be held liable for disclosing. You are hereby notified
that any unauthorized dissemination, distribution or copying of this
communication is strictly prohibited. If you have received this
communication in error, please notify HIPAA
echoman.com by E-Mail and then
destroy this communication in a manner appropriate for privileged
information.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]