|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
From: php-general-digest-help
lists.php.netDate: Sat Aug 18 2001 - 23:32:49 CDT
php-general Digest 19 Aug 2001 04:32:49 -0000 Issue 824
Topics (messages 63289 through 63350):
Re: accents and postgresql
63289 by: Florian Blaser
Re: [PHP-DB] Help with update...
63290 by: Florian Blaser
IDE
63291 by: Max Mouse
63292 by: Chris Lambert
MySql or flat database using PHP ?
63293 by: David Ovens
63294 by: Emilio Panighetti
63297 by: Tom Carter
63298 by: Hugh Danaher
63299 by: Hugh Danaher
63305 by: Andrew Libby
Slow LDA Queries
63295 by: Emilio Panighetti
63304 by: Andrew Libby
Re: Search for PHP Motivation Studies
63296 by: Ralph Guzman
PHP 4.0.6 Problem with ImageTTFText
63300 by: Richard Morris
security concerns using PHP in shared, name based virtual server setup
63301 by: Dave VanAuken
Ayuda para hace funcionar PHP
63302 by: Edgar Baldiviezo
class variables and methods
63303 by: Joe Sheble \(Wizaerd\)
63312 by: Andrew Libby
Display Image
63306 by: Andonny
63307 by: Seb Frost
63308 by: Chris Schneck
63311 by: Andonny
63313 by: Seb Frost
Help with weird error..
63309 by: PeterOblivion.aol.com
Re: Display Image (correcting myself) :P
63310 by: Chris Schneck
Extract email address from string
63314 by: Gaylen Fraley
63315 by: Seb Frost
63316 by: Andrew Libby
Need Regex Help
63317 by: Craig Westerman
63318 by: Andrew Libby
Protecting include files
63319 by: Sid
63321 by: Rasmus Lerdorf
63322 by: John Meyer
Re: code to see files in directories
63320 by: Sid
Re: Uploading Image to Database
63323 by: Richard Lynch
Re: newbie installation help needed - LinuxPPC
63324 by: Richard Lynch
Re: Putting Include files outside of document root
63325 by: Richard Lynch
Re: cookie expire...
63326 by: Richard Lynch
Re: Help.
63327 by: Richard Lynch
Re: Reload - erase ------------- please help!
63328 by: Richard Lynch
Re: HTTPS w/ header() ?
63329 by: Richard Lynch
Re: Invoking PHP scripts from a redirect location
63330 by: Richard Lynch
Re: mysql_db_name not working
63331 by: Richard Lynch
Re: hacks we should know about
63332 by: Richard Lynch
Re: Weird problems passing variables
63333 by: Richard Lynch
Re: to richard lynch
63334 by: Richard Lynch
Re: Reload a page when a user press the back button
63335 by: Richard Lynch
Re: passing variables from PHP to Perl script
63336 by: Richard Lynch
Re: Problems with cookies....
63337 by: Richard Lynch
Re: PHP and Perl script in same file?
63338 by: Richard Lynch
Re: ISO-8859-2 to Windows-1250
63339 by: Richard Lynch
Re: mysql_db_name not working (followup)
63340 by: Richard Lynch
Re: Auth atalk and samba
63341 by: Richard Lynch
Re: Attempt At Prev/Next Links
63342 by: Richard Lynch
Re: need "Working..." pop up dialog
63343 by: Richard Lynch
Re: Using cURL on windows?
63344 by: Richard Lynch
Re: SESSION question.
63345 by: Richard Lynch
Re: Help with linux / apache / php
63346 by: Richard Lynch
if then else?
63347 by: Glyndower
Accessing an array of objects
63348 by: Athas Nikolakakos
63350 by: Rasmus Lerdorf
Shuffle Cards Function
63349 by: Robert Schultz
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:
Le Samedi, 18 Août 2001 16.45, Martín Marqués a écrit :
> Which locale are you using (I think this has nothing to do with the
> problem, but who knows....).
fr_CH iso-8859-1
> I just checked a database which is been loaded with phpPgAdmin 2.3 and I
> got the acents OK.
I did further testing :
- I set up a server on another machine with the old version (7.0.3) and tried
to load the DB using the SQL output of a 'pg_dump -D' : The problem still
occurs. I then copied the old $PG_DATA directory to the new server and tried.
At first, I always got encoded chars (which at least better to me), then I
restated apache/php and everything went back to normal (ie I got the right
accentuated chars).
A thing that I have to say is that I'm not using the latest version of PHP,
since I'm always trying to keep myself using the stable version of debian.
(postgresql being one of two exceptions, since version 6.5 is quite obsolete
now.)
>psql, as well as pgaccess give me the encoded caracter instead of the
>acentuated vocal, but I don't mind, cuase psql is only for personal use. PHP
>gives me the right caracter.
Well, my problem is that php *sometimes* (~ every 2 connexions) returns the
right characters, while I get an encoded character every other time. If only
it would give the same answer everytime !
> I really don't know where your problem can be. Try to set the environment
> variables correcty to your local locale. It could help.
Well, at least the locale is right...
>
> Saludos... :-)
Thanks a lot for your answer,
Saludos ... :-P
Florian
attached mail follows:
Well, might not be the good answer, since it's been a long time I haven't
used mysql. But, does mysql is case sensitive on table names ? try using
albums instead of ALBUMS in your update query.
Just my .002 cents
Florian
Le Samedi, 18 Août 2001 18.21, vous avez écrit :
> I'm working under the gun here, so please excuse me if this turns out to be
> something really simple, but it's got me stumped... I'm trying to update
> the "cover" field in a table by using the album_id field in the table and
> adding a ".jpg" extention to it...
> For example:
> "Update albums set cover = "1.jpg" where album_id = 1"
attached mail follows:
Can anyone suggest a decent IDE for php? Currently, I'm using phped and I'm
not overly happy with it's performance...
Max
attached mail follows:
Are you using NuSphere's version of PHPEd, or the old free one? So far, the
best Windows IDE I've used has been NuSphere's upgraded PHPEd. Zend's 2.0
IDE also looks promising, though.
/* Chris Lambert, CTO - chris
whitecrown.net
WhiteCrown Networks - More Than White Hats
Web Application Security - www.whitecrown.net
*/
----- Original Message -----
From: Max Mouse <max_mouse
sympatico.ca>
To: <php-general
lists.php.net>
Sent: Saturday, August 18, 2001 6:17 PM
Subject: [PHP] IDE
| Can anyone suggest a decent IDE for php? Currently, I'm using phped and
I'm
| not overly happy with it's performance...
|
| Max
|
|
| --
| PHP General Mailing List (http://www.php.net/)
| To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
| For additional commands, e-mail: php-general-help
lists.php.net
| To contact the list administrators, e-mail: php-list-admin
lists.php.net
|
|
|
attached mail follows:
Before I start creating an Sql table/database, thought I would ask for advice first.
I am creating a directory online, with urls information, links, email addresses etc etc. What do you think is best a MySql database or writing it to a file using fopen/fwrite (flat file) ??? Your thoughts would be very much appreciated.
Thanks
Dave
attached mail follows:
It depends... if you have a handful of records, you might start with a flat
file. but if you think you'll get to hundreds of records, go with a
database.
Even if all you want is a small array of data, go with a database.
If all you want is a simple array, you might consider use DBM files (Look
at, for example, http://www.php.net/manual/en/ref.dbm.php ).
If you really need SQL goodies, also consider PostgreSQL. Both MySQL and
PostgreSQL work great with PHP.
Emilio
----- Original Message -----
"David Ovens" <DOvens
doweb.co.uk> wrote in message
news:001301c12824$8cd3a9a0$24047ad5
tinypc...
Before I start creating an Sql table/database, thought I would ask for
advice first.
I am creating a directory online, with urls information, links, email
addresses etc etc. What do you think is best a MySql database or writing it
to a file using fopen/fwrite (flat file) ??? Your thoughts would be very
much appreciated.
Thanks
Dave
attached mail follows:
Dave,
Unless there is a strong reason for using files (like for example it
interfaces with a different app which uses files) then the case for a proper
RDBMS (eg MySQL) is the better choice.
Databases are much easier (/quicker) to add and delete records from, search
etc
HTH,
Tom
----- Original Message -----
From: "David Ovens" <DOvens
doweb.co.uk>
To: <php-general
lists.php.net>
Sent: Saturday, August 18, 2001 9:29 PM
Subject: [PHP] MySql or flat database using PHP ?
Before I start creating an Sql table/database, thought I would ask for
advice first.
I am creating a directory online, with urls information, links, email
addresses etc etc. What do you think is best a MySql database or writing it
to a file using fopen/fwrite (flat file) ??? Your thoughts would be very
much appreciated.
Thanks
Dave
attached mail follows:
Dear Emilio,
For about 20 years, I've wanted to develop a mineral identification program.
I bought a PHP tutorial book on June 25th, and had the site running by July
14th. if you're planning something similar to
http://www.ironorchid.com/minerals/ , then php with mysql is the way to go.
Oh, and by the way, the only software writing experience I've had, was a
course in BASIC 23 years ago. Good luck.
----- Original Message -----
From: Emilio Panighetti <emiliosic
hotmail.com>
To: <php-general
lists.php.net>
Sent: Saturday, August 18, 2001 2:06 PM
Subject: [PHP] Re: MySql or flat database using PHP ?
> It depends... if you have a handful of records, you might start with a
flat
> file. but if you think you'll get to hundreds of records, go with a
> database.
>
> Even if all you want is a small array of data, go with a database.
> If all you want is a simple array, you might consider use DBM files (Look
> at, for example, http://www.php.net/manual/en/ref.dbm.php ).
>
> If you really need SQL goodies, also consider PostgreSQL. Both MySQL and
> PostgreSQL work great with PHP.
>
> Emilio
>
> ----- Original Message -----
> "David Ovens" <DOvens
doweb.co.uk> wrote in message
> news:001301c12824$8cd3a9a0$24047ad5
tinypc...
> Before I start creating an Sql table/database, thought I would ask for
> advice first.
>
> I am creating a directory online, with urls information, links, email
> addresses etc etc. What do you think is best a MySql database or writing
it
> to a file using fopen/fwrite (flat file) ??? Your thoughts would be very
> much appreciated.
>
>
> Thanks
>
> Dave
>
>
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
attached mail follows:
Sorry Emilio, this should have gone to Dave.
----- Original Message -----
From: Hugh Danaher <hdanaher
earthlink.net>
To: Emilio Panighetti <emiliosic
hotmail.com>
Cc: Php-General <php-general
lists.php.net>
Sent: Saturday, August 18, 2001 5:16 PM
Subject: Re: [PHP] Re: MySql or flat database using PHP ?
> Dear Emilio,
> For about 20 years, I've wanted to develop a mineral identification
program.
> I bought a PHP tutorial book on June 25th, and had the site running by
July
> 14th. if you're planning something similar to
> http://www.ironorchid.com/minerals/ , then php with mysql is the way to
go.
> Oh, and by the way, the only software writing experience I've had, was a
> course in BASIC 23 years ago. Good luck.
> ----- Original Message -----
> From: Emilio Panighetti <emiliosic
hotmail.com>
> To: <php-general
lists.php.net>
> Sent: Saturday, August 18, 2001 2:06 PM
> Subject: [PHP] Re: MySql or flat database using PHP ?
>
>
> > It depends... if you have a handful of records, you might start with a
> flat
> > file. but if you think you'll get to hundreds of records, go with a
> > database.
> >
> > Even if all you want is a small array of data, go with a database.
> > If all you want is a simple array, you might consider use DBM files
(Look
> > at, for example, http://www.php.net/manual/en/ref.dbm.php ).
> >
> > If you really need SQL goodies, also consider PostgreSQL. Both MySQL and
> > PostgreSQL work great with PHP.
> >
> > Emilio
> >
> > ----- Original Message -----
> > "David Ovens" <DOvens
doweb.co.uk> wrote in message
> > news:001301c12824$8cd3a9a0$24047ad5
tinypc...
> > Before I start creating an Sql table/database, thought I would ask for
> > advice first.
> >
> > I am creating a directory online, with urls information, links, email
> > addresses etc etc. What do you think is best a MySql database or
writing
> it
> > to a file using fopen/fwrite (flat file) ??? Your thoughts would be
very
> > much appreciated.
> >
> >
> > Thanks
> >
> > Dave
> >
> >
> >
> >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> > For additional commands, e-mail: php-general-help
lists.php.net
> > To contact the list administrators, e-mail: php-list-admin
lists.php.net
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
attached mail follows:
Dave,
IMHO, a major consideration for Web apps is contention and s
synchronization. If you intend to allow users to update
data on in the app it becomes important to coordinate writes
(with locking) so that no two users can write to the same (region)
of the file at the same time. An RDBMS (MySQL, PostgreSQL) or a directory
(OpenLDAP) takes care of this (as well as many other problems
with data storage and retrieval). I agree with the other statements I've
seen here, but wanted to add this as well. I've done it both ways
and the DBMS, Directory route tends to be a better solution. This is
code reuse of the best kind.
My humble $0.02.
Andy
On Sat, Aug 18, 2001 at 09:29:56PM +0100, David Ovens wrote:
> Before I start creating an Sql table/database, thought I would ask for advice first.
>
> I am creating a directory online, with urls information, links, email addresses etc etc. What do you think is best a MySql database or writing it to a file using fopen/fwrite (flat file) ??? Your thoughts would be very much appreciated.
>
>
> Thanks
>
> Dave
>
>
>
-- -------------------------------------------------- Andrew Libby Director of Technology CommNav, Inc alibbycommnav.com
attached mail follows:
I have OpenLDAP and PHP 4.0.4p1 on a RedHat 7.1 (plain distribution, didn't recompile anything, and I use MOD_LDAP to authenticate users to an intranet site. I want PHP pages to show the real username so I have this function I call when I want to know the username.
the mod_ldap queries and ldap queries from a Perl CGI return very fast. On Perl I don't notice an performance issue (with less than a couple queries/second), but each query using PHP takes about two full seconds (or more). I did a workaround keeping the result on a session variable, but it's still slow every time I call this function. mod_ldap stores the user's dn on the REMOTE_USER environment variable.
Here's the function. I don't know how to make it faster.
Thanks, Emilio Panighetti
<?php // Retrieves user's real name from LDAP function ldapcnsearch() { $s_ldapserver = "localhost"; $s_ldapport = 389; $ds = ldap_connect( "ldap://".$s_ldapserver.":".$s_ldapport ); ldap_set_option( $ds, LDAP_OPT_PROTOCOL_VERSION, 3); $qar[] = "cn"; if ( $ds ) { $r = ldap_bind( $ds ); $sr = ldap_read( $ds, getenv( "REMOTE_USER" ), "cn=*", $qar, 0, 1, 1 ); $info = ldap_get_entries($ds, $sr); $s_RealName = $info[0]["cn"][0]; ldap_close( $ds ); return( $s_RealName ); } } ?>
attached mail follows:
Emilio, Few thoughts:
o Is the call syntax you're using for ldap_read() correct? The online manual page describes the second parameter as being the base dn, you're passing the user's username. ( getenv("REMOTE_USER")). I'm surprised that this code works.
o The comparisons you're making: Are they comparing similar LDAP searches. There are issues that may not involve PHP at all that could be the cause of you're performance issue. For example, you're search could find all entries with a cn attribute at the base dn. This could potentially be a large number of entries. Also, if you search for something and the attributes you reference in your search filter are not indexed performance will degrade linearly as you add more entries to your directory.
o Session Caching. At CommNav, we've had good success with this strategy. We store quite a bit of information in the users session. It's not uncommon for our user sessions to grow to above 100Kb, and I've seen them as big as 300Kb. Retrieving data from the session (i.e. the unserialize() function) is much less expensive then going to LDAP for every hit to the web app.
Since these thoughts are not related to PHP, you can feel free to contact
me off-list to discuss further.
Andy
On Sat, Aug 18, 2001 at 05:07:26PM -0400, Emilio Panighetti wrote:
> I have OpenLDAP and PHP 4.0.4p1 on a RedHat 7.1 (plain distribution, didn't
> recompile anything, and I use MOD_LDAP to authenticate users to an intranet
> site. I want PHP pages to show the real username so I have this function I
> call when I want to know the username.
>
> the mod_ldap queries and ldap queries from a Perl CGI return very fast. On
> Perl I don't notice an performance issue (with less than a couple
> queries/second), but each query using PHP takes about two full seconds (or
> more). I did a workaround keeping the result on a session variable, but it's
> still slow every time I call this function.
> mod_ldap stores the user's dn on the REMOTE_USER environment variable.
>
> Here's the function. I don't know how to make it faster.
>
> Thanks,
> Emilio Panighetti
>
> <?php
> // Retrieves user's real name from LDAP
> function ldapcnsearch()
> {
> $s_ldapserver = "localhost";
> $s_ldapport = 389;
> $ds = ldap_connect( "ldap://".$s_ldapserver.":".$s_ldapport );
> ldap_set_option( $ds, LDAP_OPT_PROTOCOL_VERSION, 3);
> $qar[] = "cn";
> if ( $ds ) {
> $r = ldap_bind( $ds );
> $sr = ldap_read( $ds, getenv( "REMOTE_USER" ), "cn=*", $qar, 0, 1,
> 1 );
> $info = ldap_get_entries($ds, $sr);
> $s_RealName = $info[0]["cn"][0];
> ldap_close( $ds );
> return( $s_RealName );
> }
> }
> ?>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
-- -------------------------------------------------- Andrew Libby Director of Technology CommNav, Inc alibbycommnav.com
attached mail follows:
IN the book "Web Application Development with PHP 4.0" There is an entire chapter towards the end of the book that describes such case studies.
Hope this helps.
-----Original Message-----
From: Björn Schotte [mailto:bjoern
baer.main.de]
Sent: Friday, August 17, 2001 11:36 PM
To: php-general
lists.php.net
Subject: [PHP] Search for PHP Motivation Studies
Hi,
for a well-known PHP advocacy site we are searching for motivation studies of (big) companies who decided to use PHP.
A "PHP motivation study" is not like a normal case study where you tell the reader about the application foobar.com. Instead, you tell 'em about why, when and how you decided to use PHP for foobar.com, i.e. "because PHP is so easy to learn" or sth. like that (also interesting if you had the choice between PHP and [Perl|Java|Python|foo] and why you finally chose PHP).
If you're interested in that, please contact me for further details.
TIA, Björn Schotte.
-- Die Marktumfrage zu PHP Schulungen, Consultingdienstleistungen und frei verfügbaren Artikeln.Mitmachen? http://www.thinkphp.de/survey/survey.php
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
Hello all,
I have just recently found out that there is a bug in the function ImageTTFText regarding the font name. Apparently no matter what you enter, the font is unable to be loaded regardless if you put an absolute path or not to the filename. I read some where that it was fixed in the CSV.
My problem is that I need 4.0.6 as I am doing some work with 24-bit PNG images and 4.0.5 doesn't seem to support the high colours. The images work fine in 4.0.6 but now the font function doesn't work. So I guess I am asking is if I want to get the new version working before the next release, I will need to download the CSV tree and manually compile everything? If this is the case, is there some where that explains what is necessary to compile the PHP, GD, FreeType and ODBC libraries under the Win32 platform? Do when know when the next release will be coming out?
Any help that you can provide would be appreciated. Thanks.
--Richard Morris rmmorris
home.com
attached mail follows:
currently only offer full php, postgres, mysql, et al access with virtual server accounts (chrootd hacks, or jailed environments) these are cumbersome though.
Anyone have input regarding the potential security concerns with allowing users (right now only chrooted ftp users with no permissions) to run PHP files from a shared apache server. Hardening that should take place... obviously want to give users as much freedone to implement customized PHP code as possible wihout comprimising security of other users on these servers.
Looking for comments and pointers to faq's/toaster instructions, etc...
Dave
attached mail follows:
Hola amigos necesito ayuda para hacer funcionar PHP en mi maquina Utilizo Windows 98SE y PWS y no me reconoce las paginas PHP cuando le doy que ejecute el browser me sale el siguiente error
Error 403 de HTTP 403.1 Prohibido: prohibido el acceso de ejecución
Este error puede producirse si intenta ejecutar un programa CGI, ISAPI u otro programa ejecutable desde un directorio que no permite ejecutar programas.
Póngase en contacto con el administrador del servidor Web si el problema persiste.
Baje de Internet la versión 4 de PHP de la dirección www.php.net/downloads baje los siguientes archivos php406-installer.exe php-4.0.6-Win32.zip
Instale el uno y el otro lo descomprimí dentro de la carpeta c:\PHP
Esta parte no entiendo en la sección de pedir ayuda dice los siguiente
si está ejecutando el PHP como CGI o como módulo de servidor, etc.
-------------------------------
Edgar Baldiviezo V.
Est. Ing. Sistemas
-------------------------------
Visita Mi sitio:
http://www.ebaldiviezo.cjb.net
-------------------------------
Ponte en contacto conmigo por el MSN:
mailto:ebaldiviezo
hotmail.com
-------------------------------
Para mensajes sin datos adjuntos:
mailto:ebaldiviezo
cotas.net
attached mail follows:
I've been doing some reading up on OOP in PHP, and looking at some of the classes available on the web, and I've got what is probably a stupid question. I've seen this many many times..
class someclass { var $somevar = "someval";
function set( $key, $val ) { $this->$key = $val; } }
$myClass = new someclass; $myClass->set( "somevar", "someotherval" );
why write a set method when you can just as easily call $myClass->somevar = "someotherval";
Is there a reason for this?
Also, alot of the different table classes (an OOP approach to HTML tables) stores the data in arrays, but at what point is it too much to store into an array? Say you have a forum and the text entered for a single respone could be quite lengthy, much less for 100 replies... wouldn't that be a bit much to store into an array? I know it depends on the system resources, but is there a practical limit that people follow?
attached mail follows:
Joe, There are varying opinions on this issue. The argument for methods is that it hides the internal structure of your class. This is always a good thing. This means that the internals of the class can be changed, but the user interface (the user is the programmer here) does not change. So this alternative implementation of someclass
class someclass { var $data = false;
function set($key,$val) { $this->data[$key] = $val; } }
is no different the the calling code. In general, I tend to have an accessor/mutator method for each 'property' that I would like to provide access to. I'd have a method for each $key that I want to support (this may not apply in your case).
class someclass { var $name = false; var $age = false;
function name() { if(func_num_args()) $this->name = func_get_arg(0); return $this->name; }
function age() { if(func_num_args()) $this->age= func_get_arg(0); return $this->age; } }
Now, this gets a big annoying to code since the lions share of my classes have the name method implementations. I've been hunting for a way to create methods dynamically, but I've only found one. To create class definitions on the fly and eval() them. This works great when you've got a huge number of properties (class/instance vars). I'll construct a static method on the class that processes examines the class vars (get_class_vars()) and defines a class extending my implementation. The sub class has the methods implemented for accessing/mutating the properties I'd like to have methods for. If anyone knows of a means to do this to an existing class (say using create_function() or something), I'd love to hear about it.
Andy
On Sat, Aug 18, 2001 at 07:09:08PM -0700, Joe Sheble (Wizaerd) wrote:
> I've been doing some reading up on OOP in PHP, and looking at some of the
> classes available on the web, and I've got what is probably a stupid
> question. I've seen this many many times..
>
> class someclass {
> var $somevar = "someval";
>
> function set( $key, $val ) {
> $this->$key = $val;
> }
> }
>
> $myClass = new someclass;
> $myClass->set( "somevar", "someotherval" );
>
> why write a set method when you can just as easily call
> $myClass->somevar = "someotherval";
>
> Is there a reason for this?
>
> Also, alot of the different table classes (an OOP approach to HTML tables)
> stores the data in arrays, but at what point is it too much to store into an
> array? Say you have a forum and the text entered for a single respone could
> be quite lengthy, much less for 100 replies... wouldn't that be a bit much
> to store into an array? I know it depends on the system resources, but is
> there a practical limit that people follow?
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
-- -------------------------------------------------- Andrew Libby Director of Technology CommNav, Inc alibbycommnav.com
attached mail follows:
Hi, I tried below to display the picture on the webpage. I have in the pcture column a http address.
echo "<img src=\"$row["picture"]\">" . $row["description"] . "
and I get this:
Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING'
Your help is very much appreciated. Andonny
attached mail follows:
well you've got that unmatched " at the end...
- seb
-----Original Message-----
From: Andonny [mailto:wje
multiline.com.au]
Sent: 19 August 2001 03:28
To: php-general
lists.php.net
Subject: [PHP] Display Image
Hi, I tried below to display the picture on the webpage. I have in the pcture column a http address.
echo "<img src=\"$row["picture"]\">" . $row["description"] . "
and I get this:
Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING'
Your help is very much appreciated. Andonny
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
echo "<img src=\"".$row["picture"]."\">" . $row["description"] . "
----- Original Message -----
From: "Andonny" <wje
multiline.com.au>
To: <php-general
lists.php.net>
Sent: Saturday, August 18, 2001 7:27 PM
Subject: [PHP] Display Image
> Hi,
> I tried below to display the picture on the webpage. I have in the pcture
> column a http address.
>
> echo "<img src=\"$row["picture"]\">" . $row["description"] . "
>
> and I get this:
>
> Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or
> `T_NUM_STRING'
>
> Your help is very much appreciated.
> Andonny
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
attached mail follows:
Thanks for your reply. This is the whole line and I am not sure which one to take out echo "<img src=\$row["picture"]\>" . $row["description"] . "</A></b><BR>";
Andonny
Seb Frost <seb
raceshoot.com> wrote in message
news:BAELJLBLJPDMDLJLPGGMKELFCFAA.seb
raceshoot.com...
> well you've got that unmatched " at the end...
>
> - seb
>
> -----Original Message-----
> From: Andonny [mailto:wje
multiline.com.au]
> Sent: 19 August 2001 03:28
> To: php-general
lists.php.net
> Subject: [PHP] Display Image
>
>
> Hi,
> I tried below to display the picture on the webpage. I have in the pcture
> column a http address.
>
> echo "<img src=\"$row["picture"]\">" . $row["description"] . "
>
> and I get this:
>
> Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or
> `T_NUM_STRING'
>
> Your help is very much appreciated.
> Andonny
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
attached mail follows:
I always split it up if I'm having errors...
echo "<img src=\""; echo $row["picture"]; echo "\">"; echo $row["description"];
- seb
----- Original Message -----
From: "Chris Schneck" <chris
hubcityhosting.com>
To: <php-general
lists.php.net>
Sent: Saturday, August 18, 2001 7:29 PM
Subject: Fw: [PHP] Display Image
> echo "<img src=\"".$row["picture"]."\">" . $row["description"] . "
>
>
> ----- Original Message -----
> From: "Andonny" <wje
multiline.com.au>
> To: <php-general
lists.php.net>
> Sent: Saturday, August 18, 2001 7:27 PM
> Subject: [PHP] Display Image
>
>
> > Hi,
> > I tried below to display the picture on the webpage. I have in the
pcture
> > column a http address.
> >
> > echo "<img src=\"$row["picture"]\">" . $row["description"] . "
> >
> > and I get this:
> >
> > Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or
> > `T_NUM_STRING'
> >
> > Your help is very much appreciated.
> > Andonny
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> > For additional commands, e-mail: php-general-help
lists.php.net
> > To contact the list administrators, e-mail: php-list-admin
lists.php.net
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
Hey guys,
anyone know what Fatal error: input in flex scanner failed in /home/k/kyle/public_html on line
means?
thanks
attached mail follows:
echo "<img src=\"".$row["picture"]."\">" . $row["description"] . "";
----- Original Message -----
From: "Chris Schneck" <chris
hubcityhosting.com>
To: <php-general
lists.php.net>
Sent: Saturday, August 18, 2001 7:29 PM
Subject: Fw: [PHP] Display Image
> echo "<img src=\"".$row["picture"]."\">" . $row["description"] . "
>
>
> ----- Original Message -----
> From: "Andonny" <wje
multiline.com.au>
> To: <php-general
lists.php.net>
> Sent: Saturday, August 18, 2001 7:27 PM
> Subject: [PHP] Display Image
>
>
> > Hi,
> > I tried below to display the picture on the webpage. I have in the
pcture
> > column a http address.
> >
> > echo "<img src=\"$row["picture"]\">" . $row["description"] . "
> >
> > and I get this:
> >
> > Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or
> > `T_NUM_STRING'
> >
> > Your help is very much appreciated.
> > Andonny
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> > For additional commands, e-mail: php-general-help
lists.php.net
> > To contact the list administrators, e-mail: php-list-admin
lists.php.net
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
attached mail follows:
I need to parse a string and extract only the email address. What is the best way to do this?
i.e.
$string = "Please send all email to someone
somewhere.com with a subject
line of Test.";
$email_addr would be equal to someone
somewhere.com .
Thanks.
attached mail follows:
Well you need to search for "
"
then search forwards and backwards till you get to whitespaces
store those positions
then use the substr function.
- seb
-----Original Message-----
From: Gaylen Fraley [mailto:gfraley5
earthlink.net]
Sent: 19 August 2001 03:37
To: php-general
lists.php.net
Subject: [PHP] Extract email address from string
I need to parse a string and extract only the email address. What is the best way to do this?
i.e.
$string = "Please send all email to someone
somewhere.com with a subject
line of Test.";
$email_addr would be equal to someone
somewhere.com .
Thanks.
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
Seb,
Seomthing like
<?PHP
$string = "Please send all email to someone
somewhere.com with a";
ereg('.* (.*
[^ ]* )',$string,$m);
echo $m[1] . "\n"
Might be a start.
Andy
On Sun, Aug 19, 2001 at 03:44:35AM +0100, Seb Frost wrote:
> Well you need to search for "
"
>
> then search forwards and backwards till you get to whitespaces
>
> store those positions
>
> then use the substr function.
>
> - seb
>
> -----Original Message-----
> From: Gaylen Fraley [mailto:gfraley5
earthlink.net]
> Sent: 19 August 2001 03:37
> To: php-general
lists.php.net
> Subject: [PHP] Extract email address from string
>
>
> I need to parse a string and extract only the email address. What is the
> best way to do this?
>
> i.e.
>
> $string = "Please send all email to someone
somewhere.com with a subject
> line of Test.";
>
> $email_addr would be equal to someone
somewhere.com .
>
> Thanks.
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
-- -------------------------------------------------- Andrew Libby Director of Technology CommNav, Inc alibbycommnav.com
attached mail follows:
I'm reading a book and have a little confusion in my mind. Consider the following table. Assume that I grabbed it from another web site using: <? $url = 'http://www.abc123xyz.com'; $lines_array = file($url); $lines_string = implode('', $lines_array); ?>
=======================================
<html><body> <table cellspacing="2" cellpadding="2" border="0"> <tr> <td align=center>banana</td> <td align=left>.46</td> <td align=right>.55</td> </tr> <tr> <td align=center>pear</td> <td align=left>.38</td> <td align=right>.51</td> </tr> <tr> <td align=center>apple</td> <td align=left>.59</td> <td align=right>.33</td> </tr> </table> </body></html>
=======================================
The fruit lables don't change, but prices change daily. How would I parse JUST the two prices to the right of the word pear into a new html table?
How would I parse the word pear AND the two prices to the right into a new
html table?
I think the answers will help me understand better.
Thanks
Craig ><>
westerman
chanuteks.com
attached mail follows:
I'd take the results of file() and then walk through the array looking for the lines for the various fruit you're concerned with. Then I'd grab the next two lines and process them, with something like:
$line = "<td align=left>.46</td>";
ereg('^<td align=(left|right)>([^<]+)</td>',$line,$m);
echo $m[1] . "\n"; echo $m[2] . "\n";
IMHO, it's bad to do this kind of thing because any change in the content means a breakage of your processing code. I think that using something like XML or the DOM may be a better approach. Individuals with knowledge in this area can speak more to this idea.
Good luck.
Andy
On Sat, Aug 18, 2001 at 09:48:11PM -0500, Craig Westerman wrote:
> I'm reading a book and have a little confusion in my mind.
> Consider the following table. Assume that I grabbed it from another web site
> using:
> <?
> $url = 'http://www.abc123xyz.com';
> $lines_array = file($url);
> $lines_string = implode('', $lines_array);
> ?>
>
> =======================================
>
> <html><body>
> <table cellspacing="2" cellpadding="2" border="0">
> <tr>
> <td align=center>banana</td>
> <td align=left>.46</td>
> <td align=right>.55</td>
> </tr>
> <tr>
> <td align=center>pear</td>
> <td align=left>.38</td>
> <td align=right>.51</td>
> </tr>
> <tr>
> <td align=center>apple</td>
> <td align=left>.59</td>
> <td align=right>.33</td>
> </tr>
> </table>
> </body></html>
>
> =======================================
>
> The fruit lables don't change, but prices change daily.
> How would I parse JUST the two prices to the right of the word pear into a
> new html table?
>
> How would I parse the word pear AND the two prices to the right into a new
> html table?
> I think the answers will help me understand better.
> Thanks
> Craig ><>
> westerman
chanuteks.com
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
-- -------------------------------------------------- Andrew Libby Director of Technology CommNav, Inc alibbycommnav.com
attached mail follows:
Hi,
I have a php script which includes .inc files. Is there any way in which I can prevent a normal surferfrom viewing these files. Is there any command that I can add to a .htaccess file.
Thanks
~~~~~~~~~~~~~~~~~~~~~~~~~~~ \\\\\\__________________________________
! SIDDHARTH HEGDE / CHAOSGAMERZ.COM !
! Webmaster \____ For PC Game screeshots, cheat !
! http://www.ChaosGamerz.COM o| o codes, trainers, downloads, !
! webmaster
chaosgamerz.com( |_ game music, FREE e-mail and even !
! ICQ 84475206 |-- FREE FULL VERSION games for that !
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ \___/ 486------------------------------
attached mail follows:
<Files ~ "\.inc$"> Order allow,deny Deny from all </Files>
On Mon, 14 Aug 2000, Sid wrote:
> Hi,
>
> I have a php script which includes .inc files. Is there any way in which I
> can prevent a normal surferfrom viewing these files. Is there any command
> that I can add to a .htaccess file.
>
> Thanks
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~ \\\\\\__________________________________
> ! SIDDHARTH HEGDE / CHAOSGAMERZ.COM !
> ! Webmaster \____ For PC Game screeshots, cheat !
> ! http://www.ChaosGamerz.COM o| o codes, trainers, downloads, !
> ! webmaster
chaosgamerz.com( |_ game music, FREE e-mail and even !
> ! ICQ 84475206 |-- FREE FULL VERSION games for that !
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ \___/ 486------------------------------
>
>
>
attached mail follows:
At 08:26 PM 8/18/01 -0700, Rasmus Lerdorf wrote: ><Files ~ "\.inc$"> > Order allow,deny > Deny from all
BTW, .inc files can include PHP code that is executed, right?
attached mail follows:
Try this -- shorter. I only tested it out in Win(32)though
<?
$handle=opendir('.');
echo "Directory handle: $handle\n";
echo "Files:\n";
while ($file = readdir($handle)) {
echo "$file\n";
}
closedir($handle);
?>
At 03:00 PM 8/8/01 +0200, you wrote:
>kokubo
inf.univali.br (Eduardo Kokubo) wrote:
>
> > I think I saw a code to list the files, subdirectories and the files
> > in the subdirectories of a simple directory in this list some time
> > ago, but I didn't save it. Considering the quantitie of messages in
> > this list, It's quite dificult to find this specific code, so ask the
> > person who did it or someone else to write this code again.
> >
> > I'm using this one:
> >
> > $publico = ftp_nlist ($servidor, "public_html/publico");
> > $cont = 0;
> > while ($publico[$cont]){
> > print "$publico[$cont]<br>";
> > $cont++;}
> >
> > This code doesn't show the files in the subdirectories and it requires
> > ftp connection. Not very efficient.
> >
> > Thanks in advance.
> >
> > Is there a problem if I just write "thanks in advance"??? It's easier
> > then writting back to thanks everybody :)
> >
>
>is this what your looking for?
>
>function getDirContents($slashdir) {
> $dh = opendir($slashdir);
>
> while (($file = readdir ($dh))) {
> if (is_dir($slashdir . $file) && $file != "." && $file != "..") {
> getDirContents ($slashdir . $file . "/");
> } else if ($file != "." && $file != "..") {
> echo $file . "<br>";
> }
> }
> closedir($dh);
>}
>
>getDirContents("/test/");
>
>--
>Henrik Hansen
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
>For additional commands, e-mail: php-general-help
lists.php.net
>To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
> database ... the script seems to be working, in that its not giving errors
You're not asking it to give you error messages :-)
> <?php > > if ($submit) { > > MYSQL_CONNECT("localhost","user","pass");
... or die("Could not connect to database")
> mysql_select_db("binary_date");
... or die("Could not select binary_date");
> > $data = addslashes(fread(fopen($form_data, "r"), filesize($form_data)));
This is pretty scary...
You'll have to tear this apart into several lines to get any useful error messages...
$file = fopen($form_data, 'r') or die("Could not open $form_data"); $size = filesize($form_data) or die("Could not get size of $form_data"); # php.net doesn't say what fread returns in the event of a failure... # Let's assume nobody is uploading an empty file: $rawdata = fread($file, $size) or die("Could not read data from $form_data"); $data = addslashes($rawdata);
> $result=MYSQL_QUERY("INSERT INTO binary_date > (description,bin_data,filename,filesize,filetype) ". > "VALUES > ('$form_description','$data','$form_data_name','$form_data_size','$form_data _type')");
or die("Query Failed");
> > $id= mysql_insert_id(); > print "<p>This file has the following Database ID: <b>$id</b>";
Is this printing a non-zero ID?...
-- WARNING richardzend.com address is an endangered species -- Use ceo
l-i-e.com Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm
attached mail follows:
> I've been playing around a little with php/mysql/apache on my NT box but I > have just set up one of my Macs as a LinuxPPC machine. I have downloaded > PHP-4.0.6 but now I want to install it to work with the apache server > software already installed. > > I'm a complete newbie as far as linux is concerned so can someone give me > simple step by step instructions on how to do this. > > I also need a little help getting started with MySQL. I have somehow managed > to set it up with my username and password (I think) but I don't know how to > get it stated. Any help there?
There's a much lower-volume mailing list specifically for Macintosh Apache/MySQL/PHP called 'AMP' which is hosted at... http://www.dynapolis.com???
Getting MySQL started just once to play with it is probably do-able by opening up a shell, and doing:
cd XXX/mysql ./scripts/safe_mysqld &
You'll have to replace XXX with where-ever MySQL got installed.
Making it start automatically on boot on Mac OS X was a thread on the AMP list whose outcome I forget, but there's a handy URL in the archives for doing it.
Note: I'm subscribed to the AMP list, but don't actually have OS X installed anywhere...
-- WARNING richardzend.com address is an endangered species -- Use ceo
l-i-e.com Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm
attached mail follows:
> If my document root is something like /home/myname/dir/ (as per phpinfo()), > and I put my include files in /home/myname/includes/, is that actually > outside of the document root, or is anything under /home/myname/ actually > the document root?
Yes, that's outside.
If phpinfo() says: /home/myname/dir/
then these are bad:
/home/myname/dir/foo.inc /home/myname/dir/includes/foo.inc /home/myname/dir/as/deep/as/you/want/foo.inc
and these are okay:
/home/myname/includes/foo.inc /home/myname/includes/as/deep/as/you/want/foo.inc /any/other/random/directory/foo.inc
Of course, you now have the challenge of configuring 'include_path' in php.ini to have all the paths you need :-)
-- WARNING richardzend.com address is an endangered species -- Use ceo
l-i-e.com Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm
attached mail follows:
> Could I expire a cookie on a determinate date?? I mean tell the cookie > that will expire on 17/08/2001...
Unless I'm missing something, that's trivial using:
http://php.net/manual/en/function.setcookie.php
-- WARNING richardzend.com address is an endangered species -- Use ceo
l-i-e.com Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm
attached mail follows:
You may be able to use http://php.net/exec
Alas, I'm not sure it works under Windows anymore... Or maybe only thread-safe versions of Windows. Or maybe...
-- WARNING richardzend.com address is an endangered species -- Use ceo
l-i-e.com Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm ----- Original Message ----- From: Rajarajeswari Balasubramanian <sugantham
yahoo.com> Newsgroups: php.general To: <php-general
lists.php.net> Sent: Friday, August 17, 2001 1:39 AM Subject: Help.
> Hi, > > I have created a database with the backend of Mysql > and i am accesing the database using PHP scripts. > > In the database there is one field, which has the > information of the structure of a molecule as a > Coordinate data. > > when i am using the mysql_fetch_array() command to > retrive the data, it's just taking the text part of > the file, which is simply a ASCII characters and > displaying that on the browser screen. > > I have a program whihc will take that coordinate file > as the input and it will convert that file into a 3D > structure, i have the exe file of that program. > > Now my query is > > how do i access this exe file in the php script???, > > Is that Possible in some way??? > > so the data is retrived it has to automatically invoke > the ./xxx file and it will give the 3D rendering of > that data which is in the form of coordinate file. > > Please give me some suggestiosn about this. > > Thanks in advance. > > Raji > > > __________________________________________________ > Do You Yahoo!? > Make international calls for as low as $.04/minute with Yahoo! Messenger > http://phonecard.yahoo.com/
attached mail follows:
> SHORT: how can I erase the content of a page currently displayed in client's > browser? Or other solutions (see LONG)
I don't understand big chunks of this question...
You can't erase what they have.
You can set no-cache and expiration headers.
-- WARNING richardzend.com address is an endangered species -- Use ceo
l-i-e.com Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm
attached mail follows:
> Is there is a way with PHP (most probably headers) to go HTTPS mode? > I don't want to specify https://www.myserver.com/secured_page.php > I just want it normal but in it's header to tell the browser to initiate an > HTTPS mode.
I don't think you can do that...
You could send a header to do:
header("Location: https://www.myserver.com/secured_page.php");
but pretty much the user will then see the https when the page shows up...
What's the big picture here? I've got a feeling you've gone down a wrong path that's making you ask this question...
-- WARNING richardzend.com address is an endangered species -- Use ceo
l-i-e.com Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm
attached mail follows:
> 1) Within Apache's httpd.conf file I have the following set: > DocumentRoot "D:/Program Files/Apache Group/Apache/realdocs" > <Directory "D:/Program Files/Apache Group/Apache/realdocs"> > RedirectMatch permanent ^/$ "P:/Main Projects/Test/index.php" > ScriptAlias /php/ "d:/php/" > AddType application/x-httpd-php .php .phtml > Action application/x-httpd-php "/php/php.exe
I don't think you can have files outside of DocumentRoot be served up...
I suspect RedirectMatch only works to mangle one path within DocumentRoot to another...
Even if Apache was willing to do it, PHP as a CGI is probably compiled to not allow that, *especially* if safe_mode is on, or any of the other security directives. Check those with a phpinfo()
You *COULD* create VirtualHosts with different DocumentRoot, and make P:/whatever be a different hostname...
-- WARNING richardzend.com address is an endangered species -- Use ceo
l-i-e.com Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm
attached mail follows:
> The command "mysql_db_name" is not working in our installation. > We get no error, but no database listing either if we use this command. > ----- > // This is the code which does NOT work: > $dbs = mysql_list_dbs();
... or die(mysql_error());
> $num_dbs = mysql_numrows($dbs); > for($i=0; $i<$num_dbs; $i++) > { > $db = mysql_dbname($dbs, $i);
... or die(mysql_error());
> echo "db=".$db."<br>"; > } > ----- > // And this is adopted code from the manual which DOES work: > $db_list = mysql_list_dbs($conn); > while ($row = mysql_fetch_object($db_list)) { > echo "db=".$row->Database . "<br>"; > } > ----- > > I tried both: mysql_db_name, mysql_dbname. > We need this function to use phpMyAdmin. > Solaris 8, Apache 1.3.20, PHP 4.0.6, MySQL 3.23.40 > > Any ideas why this command does not work? > > > TIA, > Peter
attached mail follows:
> just found this article and the author recommends the following for secure php > scripting. what do the expects think?
This article has been discussed in excruciating detail on
PHP-Dev
lists.php.net and the expert's opinions are archived...
http://php.net/support.php should lead you to this archive.
> **** - Set register_globals off > This option will stop PHP creating global variables for user input. That is, > if a user submits the form variable 'hello' PHP won't set $hello, only > HTTP_GET/POST_VARS['hello']. This is the mother of all other options and is > best single option for PHP security, it will also kill basically every third > party application available and makes programming PHP a whole lot less > convenient.
Expect to see register_globals off as the default setting in PHP 4.1, I *THINK*.
> *** - Set safe_mode on > I'd love to describe exactly what safe_mode does but it isn't documented > completely.
I dunno what more documentation he *WANTS* than what is on the web-site... Not that I claim to *UNDERSTAND* it all :-^
> - Kills file upload completely
I *think* safe_mode can be on and files can be uploaded if the ISP works at it... But they have to want it bad enough to do some configuration. Most ISPs want to just install stuff as-is and not take the time to find out how to really configure it for optimum safety/functionality.
> ** - Set open_basedir > This option prevents any file operations on files outside specified > directories. This can effectively kill a variety of local include() and > remote file attacks.
> Caution is still required in regards to file upload and > session files.
Which is why safe_mode exists.
> ** - Set display_errors off, log_errors on > This prevents PHP error messages being displayed in the returned web page. > This can effectively limit an attackers exploration of the function of the > script they are attacking. It can also make debugging very frustrating.
Not really.
First of all, you *OUGHT* to be developing on a different, non-public box than your live server. Throw PHP on your laptop or desktop and write your new code there, where you have display_errors on. Only on the live site do you need display_errors off, and hopefully your code is mostly debugged by that point.
Even so, you just open up another window and tail -f your error log file if you need to debug something.
For any particularly tricky debugging, you can use something like this: if ($REMOTE_ADDR == 'your.IP.address.here'){ echo "whatever"; }
Only you want to use $HTTP_ENV_VARS['REMOTE_ADDR'] or whatever it is.
> * - Set allow_url_fopen off > This stops remote files functionality. Very few sites really need this > functionality, I absolutely recommend every site set this option.
Well, I use it, but I suppose it's up to you. The things that go wrong with this being on are (I think) the result of stupid code like:
include $foo;
which is already problematic, regardless of whether $foo is hacked to be a remote file or a local one... Anybody else can weigh in on this, go ahead.
I think the *REAL* issues raised here is that far too many PHP scripters, self included, are pushing code out to make it work and not focussing on security enough. It's *POSSIBLE* to write more safe code, and the PHP Dev team is working to make it easier. But for now, the onus is on *YOU* to figure out what's "safe enough" and what's not for *YOUR* application.
-- WARNING richardzend.com address is an endangered species -- Use ceo
l-i-e.com Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm
attached mail follows:
> I've got some strange problems whilst passing variables from forms into my > php-script. When I use IE5 it works like a charm. Using Opera or IE4* the > referred "action" script crashes due to memory restrictions on the server, > in a function I use to get all the dates between two given dates, presumably > due to my while condition never turning false. This lead me to believe that > my variables were being gargled in some way as to make the parsing fail, > this is however not the case as far as I can tell.
Are you printing out the data?...
> This is the function I use to retrieve all the dates inbetween $from and $to > inclusive (yes, it's butt ugly, I know, but I'm in kinda of a hurry, my > deadline is approaching ;) : > > /* > Function geDates(from, to) takes strings containing dates in the form > "YYYY-MM-DD" > and returns an array containing the dates between "from" and "to" > inclusive > */ > > function getDates($from, $to) { > (int) $year=substr($from,0,4)+0; /* Adding the zero is a kluge to force > away leading zeros */ > (int) $month=substr($from,5,2)+0; > > (int) $day=substr($from,8,2)+0; > > $datearray[0]=$from; > $current=$from; > while($current!=$to) { > $day=$day+1; > if(checkdate($month, $day, $year)) { > $current=zeroPadDate($year, $month, $day); > $datearray[]=$current; > } else { > $month=$month+1; > $day=1; > if (checkdate($month, $day, $year)) { > $current=zeroPadDate($year, $month, $day); > $datearray[]=$current; > } else { > $year=$year+1; > $month=1; > $current=zeroPadDate($year, $month, $day); > $datearray[]=$current; > } > } > > } > return $datearray; > }
Uhhh. You're working *WAY* too hard :-)
function getDates($from, $to){ # Change the 1's to 0's to turn off debugging output: if (1){ echo "Computing Dates Between '$from' and '$to'<BR>\n"; } $year = substr($from, 0, 4); $month = substr($from, 5, 2); $day = substr($from, 8, 2); $start = mktime(0, 0, 0, $month, $day, $year); $year = substr($to, 0, 4); $month = substr($to, 5, 2); $day = substr($to, 8, 2); $end = mktime(0, 0, 0, $month, $day, $year); # Change this to <= to get the $end date included: while ($start < $end){ $datearray[] = date('Y-m-d', $start); if (1){ echo $datearray[count($datearray)-1], "<BR>\n"; } $day++; # Let PHP worry about wrapping days and months and leap years $start = mktime(0, 0, 0, $month, $day, $year); } return $datearray; ?>
> /* Accessory function to getDates above. */ > > function zeroPadDate($year, $month, $day) { > if ($month<10) $mstr="0$month"; > if ($day<10) $dstr="0$day"; > return "$year-$mstr-$dstr"; > }
You don't need this function. :-)
> What could it possibly be due to? Are there any differencies in the way
the
> above mentioned browsers pass the form variables?
>
> If you do find it in your heart to help me out with this one, please also
> reply by e-mail to webmaster
palladiumbio.com
>
> Thanks in advance,
>
> Claes Andersson
> Webmaster, www.palladiumbio.com
>
> PS Exchanging "GET" and "POST" in the referring form made no difference in
> the world DS
>
>
>
-- WARNING richardzend.com address is an endangered species -- Use ceo
l-i-e.com Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm
attached mail follows:
Warning to all: I usually ignore a thread once I threw in my 2 cents... Emailing me off-list to continue is always kosher though. :-)
Emailing me off-list with a whole new question is silly, but I try to respond... No promises to continue that practice.
> on response to a question about variable $PATH_INFO , you said me: > > Is Apache configured to pass that variable on? > > Did you compile as CGI -- IE, are you using "Action" in your httpd.conf or > LoadModule/AddModule? > -------- > > but how to configure to pass that variable ?
I dunno. I just know that virutally all of the pre-defined variables such as $PATH_INFO are either sent in by Apache because it was configured to, or not.
If $PATH_INFO is one of those, you'll need to find your httpd.conf file and dig through there to see if it has anything related to something that looks like a setting to pass on path information to Modules.
I asked about the CGI thing because there's a --enable-discard-path that you use for CGI that, umm, I never have understood those CGI-related directives, so it might (or might not) be related to PATH_INFO. Fortunately, there's only two or three of them, so it's only a matter of four or a dozen attempts to ./configure;make to get one that works. Yes, that's how I do it :-)
Actually, I guess you *COULD* have used --enable-discard-path with your Module compilation... Dunno for sure what the effect would be...
Hopefully, you now realize that I have only a vague understanding of all the
install issues, but it's enough to focus you down to only a few things to
look at. Try the php-install
lists.php.net list if you want real experts on
install issues. :-)
> what is action ? > i'm using LoadModule/AddModule for php4
If you were running PHP as a CGI (ie, *not* using LoadModule/AddModule) you would be using Alias/Action *instead* of LoadModule/AddModule in httpd.conf All of these Apache directives are documented far better than I could explain at http://apache.org
-- WARNING richardzend.com address is an endangered species -- Use ceo
l-i-e.com Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm
attached mail follows:
>not show after the user press the reload button. Is there a way that the page reaload >automatically the data from the database without the user pressing the reload button? Thanks
Not really -- You can send no-cache and expiration headers, so they'll *HAVE* to reload to see anything at all, but it won't auto-reload.
Another option:
Have the page POST to itself, and re-generate the new list after the INSERT.
Here's a crude example:
<?php if (isset($newcat)){ $query = "insert into categories(name) values('$newcat')"; mysql_query($query) or die("Could not execute $query"); } $query = "select id, name from categories order by name"; $cats = mysql_query($query) or die("Could not execute $query"); echo "<FORM ACTION=$PHP_SELF METHOD=POST>\n"; echo "<SELECT>\n"; while (list($id, $name) = mysql_fetch_row($cats)){ echo "<OPTION VALUE=$id>$name</OPTION>\n"; } echo "</SELECT><BR>\n"; echo "<INPUT NAME=newcat><BR>\n"; echo "<INPUT TYPE=SUBMIT>\n"; echo "<FORM>\n"; ?>
Since the INSERT happens at the top, the new entry will always show up as he goes.
-- WARNING richardzend.com address is an endangered species -- Use ceo
l-i-e.com Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm
attached mail follows:
> I'm trying to integrate an Internet Telephony service for a client. I have a > number of variables I need to dump into the clients database and then to > pass to the Internet Telephony service via a Perl script they have provided > for me that will reside on the client's server. Can I somehow pass them > "behind the scenes" or should I use a redirect. There is info I need to keep > away from the end user, mainly the phone number.
exec("/path/to/perl/script '$phone_number' '$more_data' '$whatever'", $results, $errorcode); while (list(,$line) = each($results)){ echo $line, "<BR>\n"; } if ($errorcode){ echo "OS Error Code: $errorcode. Usually path/permissions. man errno.<BR>\n"); }
Or is the Perl script on a *DIFFERENT* server from your PHP script?... Then you'll need to use "cURL" or fopen or something to talk to that server.
-- WARNING richardzend.com address is an endangered species -- Use ceo
l-i-e.com Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm
attached mail follows:
> <? > $pav='nustatymai.php'; > if ( $nustatymaslangas == 1 ) { > setcookie("nustlangas", 1, time()+3600*24*30); > } else { > setcookie("nustlangas", 0, time()+3600*24*30); > } > if ( $nustatymaspastas == 1 ) { > setcookie("nustpastas", 1, time()+3600*24*30); > } else { > setcookie("nustpastas", 0, time()+3600*24*30); > } > if ( $jau == 1 ){ > header("Location: main.htm"); > exit; > } > > ?> > > <form action="<? echo $pav; ?>"> > <input type="hidden" name="jau" value="1"> > <SELECT name="nustatymaslangas"> > <option value="#">--- Pasirinkite ---</option> > <option value="0">Same Window</option> > <option value="1">New Window</option> > </select> > > <SELECT name="nustatymaspastas"> > <option value="#">--- Choose ---</option> > <option value="0">Same Window</option> > <option value="1">New Window</option> > </select> > <input type="submit" value="Submit"> > </form>
Doing both SetCookie and Location header in the same script is problematic.
No matter which order you pick, some browsers will do the Location before the SetCookie, and you have no Cookies set.
-- WARNING richardzend.com address is an endangered species -- Use ceo
l-i-e.com Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm
attached mail follows:
> Can php and perl code reside in the same file? When the document is served > up it parses the PHP and then the Perl?
No.
Apache does not allow "stacked handlers".
Actually, Apache 2.0 was to offer this feature, IIRC. Dunno if it made it through the process though... http://apache.org
-- WARNING richardzend.com address is an endangered species -- Use ceo
l-i-e.com Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm
attached mail follows:
Try these:
http://www.php.net/manual/en/ref.recode.php
http://php.net/manual/en/function.convert-cyr-string.php
-- WARNING richardzend.com address is an endangered species -- Use ceo
l-i-e.com Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm ----- Original Message ----- From: Vmá¹ ³{âi¹ <kubis
vosji.cz> Newsgroups: php.general To: Php-General
Lists. Php. Net <php-general
lists.php.net> Sent: Thursday, August 16, 2001 2:20 AM Subject: ISO-8859-2 to Windows-1250
> Hi, > is there any function which can converts strings from ISO-8859-2 to > Windows-1250? > > Thanks for your answers. > Tomas >
attached mail follows:
> Does Apache with static compiled PHP not work on Solaris 8? > Since the pages behave really crazy, we think it has something to do > with our PHP. > Does someone have a similar installation - which versions? > Or any help?
Ding!
This just set off a ringer in my head. :-)
Go back to your /usr/src/php* directory (or whever Solaris hides it) and dig through config.log and config.cache and whatnot to figure out if:
Did PHP use the "built-in" MySQL library rather than the source headers for the MySQL you are actually running?
If so, and it it's a different version from what you are actually running, then you'd see behaviour like this. MySQL sorta works, cuz some functions in the binary files are where/how PHP expects them, but a bunch aren't and they act all crazy.
If all else fails, just do:
./config.nice
and read the last 50 lines or so.
Either you get this big ASCII box about using the MySQL built-in libraries, or you're okay on that score.
-- WARNING richardzend.com address is an endangered species -- Use ceo
l-i-e.com Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm
attached mail follows:
I *THINK* somebody worked out the Samba stuff...
Search the archives. http://php.net/support.php
Also ask on php-windows
lists.php.net for the Samba.
There's a Mac list for PHP, and they might have some ideas on the AppleTalk stuff.
http://www.dynapolis.com (It's called "AMP" or "Apache/MySQL/PHP")
-- WARNING richardzend.com address is an endangered species -- Use ceo
l-i-e.com Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm ----- Original Message ----- From: Knut sætre <Godskalk
Bladet-Tromso.no> Newsgroups: php.general To: <php-general
lists.php.net> Sent: Friday, August 17, 2001 7:18 AM Subject: Auth atalk and samba
Hi Is there a way to authenticate users who are connected to the linux-box with samba or the AppleTalk protocol (Netatalk)?
I don't need strong security, this is on the Intranett behind a firewall. I only want to recognise the users, and give them a personalised WebPage.
It's simple to get the users ID address with php, but I need the corresponding usernames from the smb or netatalk users.
I'm running php 4.06, netatalk 1.5pre6 and smb 2.2.1a on RH 7.1
Knut G. Sætre Harstad Tidende Gruppen AS
attached mail follows:
> $max_row = 5; > if ($op == "next") { > $low = $low + $max_row; > $high = $low + $max_row;
Either this...
> $result = mysql_query("SELECT * FROM TABLENAME where Post='yes' LIMIT $low, $high"); > while($row = mysql_fetch_row($result)) { > echo "<b>$row[1] writes</b>:<br>\n"; > echo "    <i>$row[2]</i><br>\n"; > echo "<b>AskLee writes</b>:<br>\n"; > echo "    <i>$row[3]</i><br>\n"; > echo "<hr>\n"; > } > } > elseif ($op == "prev") { > $low = $low - $max_row; > $high = $high - $max_row;
Or this is wrong. :-)
I think $high should *always* be $low + $max_row;
> $result = mysql_query("SELECT * FROM TABLENAME where Post='yes' LIMIT $low, $high"); > while($row = mysql_fetch_row($result)) { > echo "<b>$row[1] writes</b>:<br>\n"; > echo "    <i>$row[2]</i><br>\n"; > echo "<b>AskLee writes</b>:<br>\n"; > echo "    <i>$row[3]</i><br>\n"; > echo "<hr>\n"; > } > } else {
Also, you really should compute your low/high, and *THEN* do one query, and one output.
As it stands now, if you change your query/output, you have to change it in three places at once.
> $low = 0; > $high = $low + $max_row; > $result = mysql_query("SELECT * FROM TABLENAME where Post='yes' LIMIT $low, $high"); > while($row = mysql_fetch_row($result)) { > echo "<b>$row[1] writes</b>:<br>\n"; > echo "    <i>$row[2]</i><br>\n"; > echo "<b>AskLee writes</b>:<br>\n"; > echo "    <i>$row[3]</i><br>\n"; > echo "<hr>\n"; > } > } > $result = mysql_query("SELECT * FROM mpn_asklee where Post='yes'"); > $num_rows = mysql_num_rows($result); > if ($num_rows > $max_row) { > echo "<table width=\"100%\" cellspacing=\"0\" border=\"0\" cellpadding=\"0\">\n"; > echo "<tr><td align =\"left\">\n"; > if ($low > $max_row) { > echo "<a href=\"$PHP_SELF?op=prev&low=$low&high=$high\">Previous</a>"; > } > echo "</td><td align =\"right\">\n"; > if ($num_rows > $high) { > echo "<a href=\"$PHP_SELF?op=next&low=$low&high=$high\">Next</a>"; > echo "</td></tr></table>\n" > } > } > ?>
Oh yeah: Start indenting between { and } The hair you save may be your own.
-- WARNING richardzend.com address is an endangered species -- Use ceo
l-i-e.com Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm
attached mail follows:
> I'm trying to get a "working..." informational dialog or window going > with my PHP page but I'm not getting anywhere. Here's the situation: > > When the user clicks on a link that has to gunzip a very large file, I > want a popup to say "Working..." while the file is uncompressing. > Then, when the file is uncompressed, I want the "Working..." popup to > close itself and then the parent window to load a new URL (where it > will use the uncompressed file). > > I've tried doing this with Javascript and window.open(), but I'm having > no luck. Any ideas?
You also need to use those layer thingies with DHTML or whatever...
I archived a sample somewhere...
Ah, here it is: (This is somebody else's code, not mine)
============[ code ]============ <HTML> ..<header and stuff>... <BODY onload=" if (IE) { wait.style.display = 'none'; } else { document.layers['wait'].visibility='hidden'; }"> <DIV style="position: absolute; left: 0; top: 0; width: 100%; height: 100%; cursor: wait;" id="wait"> <TABLE border="0" width="100%" height="100%"> <TR> <TD width="100%" valign="middle" align="center"> One moment please... <BR> <BR> <BR> Loading directory listing </TD> </TR> </TABLE> </DIV> ..<the rest of the page (reason of wait screen) >... </BODY> </HTML>
==========[ end code ]==========
NOTE: You should change 'if (IE)' to something usefull. If you just copy/paste this code, you'll get a javascript-error because IE isn't defined (it is on my site, :-)).
* R&zE:
-- »»»»»»»»»»»»»»»»»»»»»»»» -- Renze Munnik -- DataLink BV
-- -- E: renzedatalink.nl -- W: +31 23 5326162 -- F: +31 23 5322144 -- M: +31 6 21811143 -- H: +31 23 5516190 -- -- Stationsplein 82 -- 2011 LM HAARLEM -- -- http://www.datalink.nl -- ««««««««««««««««««««««««
-- WARNING richard
zend.com address is an endangered species -- Use ceo
l-i-e.com Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm
attached mail follows:
> How would I go about installing cURL for PHP on windows box?
Start searching for a file named curlphp.dll or similar.
First your PHP install, then http://php4win.de if it's back up, then http://php.net then, like Google or http://dogpile.com or whatever.
If all of that fails, then probably nobody has created such a DLL for you, and the real fun starts...
You *COULD* start looking for a cURL COM object out there on the Microsoft-centric sites (expect to pay for it) and try to use PHP's COM support to talk to it.
Or, you *COULD* snag the cURL sources and VC++ 6.0 or higher and try to compile them yourself. You'll probably soon find out why it doesn't exist, but with diligence and some work might become famous for being the guy who *made* it work :-) [That's pretty much how OpenSource software works...]
You may find it easier to just switch to Un*x where it just works :-)
-- WARNING richardzend.com address is an endangered species -- Use ceo
l-i-e.com Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm
attached mail follows:
You should be able to configure Apache to force the www. to appear, no matter what they type, or to keep using what they typed, if you didn't use any full URLs.
-- WARNING richardzend.com address is an endangered species -- Use ceo
l-i-e.com Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm ----- Original Message ----- From: Mehmet Kamil Erisen <erisen
yahoo.com> Newsgroups: php.general To: <php-general
lists.php.net> Sent: Friday, August 17, 2001 6:05 PM Subject: SESSION question.
> Hello, > I have implemented a user login with PHP Session functions. > THe problem I have is that if the user is logged in the > site using > http://mysite.com/login.php and starts a session, the > session is not recognized when user is trying to utilize > the site with > http://www.mysite.com/dosomething.php > > any suggestions? > > thanks, > erisen. > ultrAslan. > > ===== > Mehmet Erisen > http://www.erisen.com > > __________________________________________________ > Do You Yahoo!? > Make international calls for as low as $.04/minute with Yahoo! Messenger > http://phonecard.yahoo.com/
attached mail follows:
> We have just (in the last month or so) leased a cobalt raq all for our own > use. Great. However, the sites using this box are setup and maintained > using a web interface that comes as default with the box. when setting up > sites (subs or otherwise), it adds sites (and you have to specify users for > those sites) with directory trees like this:
Yeah, getting those babies up and running is easy. Figuring out where they do things and how to change it without breaking everything is not so easy :-(
> /home/sites/site1/web > /home/sites/site2/web > (etc) > > Obviously, this causes problems (like for the php scripts that are running > on the current setup, where files are included / required as a part of the > main directory, and out of the document root (/home/mainsite/includes might > be an example)).
This part is fairly easy and innocuous :-)
/home/sites/site1/web is the same as your old /home/mainsite/www You can safely put your includes for mainsite in /home/sites/site1 or create /home/sites/site1/includes and put them there.
Similarly, all your sub sites will have /home/sites/siteX/web and you can put the include files in /home/sites/siteX/includes.
If you have some "commmon" includes that span all the sub sites, I'd put them in /home/sites/includes/
But that's just me. You can put them anywhere that makes sense.
You'll need to find php.ini (Use a <?php phpinfo();?> page to do that) and change include_path
You may even want to make a chart of "old directory" | "new directory" for the two boxes until you get the hang of it.
> So, I'd like to learn how to use linux (bearing in mind that I have very > limited experience of unix based systems). I can perform the very basic > commands, but would like to learn how to use / mainpulate the box through > shell access rather than over a web interface (which ultimately, I'm > assuming, will give me more flexibility - for example, I'd rather know how > to install the latest version of php onto the server following the > installation instructions than to attempt to do it through another medium).
What *I* did was to pretent it was a RedHat box and threw source code into /usr/src/ and went on with life, but that's only cuz I was more familiar with RedHat than because it was the right thing to do...
> I've bought a couple of books and hope to delve into them in the course of > the weekend and the next few weeks to come. I'm assuming that one of the > first steps would be to install linux on my home machine and get a feel for > it (currently I'm running windows.... ouch).
Smart move. RedHat is probably still the easiest to install...
> So, here come the questions. > Where can I find the latest version of linux? I have had a brief look at > freshmeat.net and linux.com, but didn't find any download sections (I didn't > look too hard, for reasons soon to be explained).
Woof. You're just asking for a Linux distro argument :-)
There are a dozen (or more) different distributions of Linux with varying pros and cons.
The more commonly recommended include: RedHat FreeBSD Mandrake SuSe
and others I forget.
I'm still gonna stick with the RedHat answer as "easiest" for newbies. I'm sure others will weigh in with other opinions.
> If I install linux, can I still use windows as a secondary OS (perhaps > running over the top of linux?)
You *CAN*, indeed, re-partition your hard drive into two "halves" and install Linux in the new "half" that you stole from Windows.
> If I can run windows as well as linux, am I best formatting my main drive, > installing linux, then windows?
Well, if you don't have either on the box yet, I think you install Windows first, cuz it's more stupid about installing, and would wipe out Linux. (Or maybe that's by evil design...)
At any rate, there's a http://www.Linux-HowTo.org or somesuch that will have detailed instructions on dual-boot installation
> Is the httpdconf file one of the main files i need to confifure for sites, > or are there many others (I've read a little about setting users up in vi > and will read more on that, but are there mounds of files that you need to > configure when setting up a new virtual site?)
Honestly, if you're using a Cobalt RaQ, you're *probably* best off to just keep using that to add acounts/sites for now on the real server.
On your development box, you need to edit httpd.conf (and only httpd.conf) to create a new Host.
You usually want to create a new user on the machine (or at least an FTP user, if you don't provide shell access [ick!]) to associate with that site.
man adduser
will tell you all about that, and it's probably also in that Linux how to site. (Most everything is)
In fact, I'd suggest you bookmark that one, and use it. Most of these instructions there are targetted at your level :-) Though you may find that to do X, you need to do Y, which requires Z, and back track quite a bit before you get to something that makes sense. :-)
-- WARNING richardzend.com address is an endangered species -- Use ceo
l-i-e.com Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm
attached mail follows:
-----Original Message-----
From: Glyndower [mailto:idesign
tampabay.rr.com]
Sent: Sunday, August 19, 2001 12:12 AM
Cc: php-general
lists.php.net
Subject:
Ok, here we go....
I'm new to PHP and also to MySql, but i'm making a pretty good go so far. Until now, lol
I have a mysql database with several optional feilds (pe1.pe2.pe2,e1,e2,e3, etc)
What I'm looking for is a way to check the value of each optional feild and if said feild is "not null" or contains data. I want to create a header for that feild and then a bulleted list of the options in the feilds under the header.
i.e something along the lines of:
<?php if (pe1 = not null) print(Professional Education)?> <li> <?php printf(pe1)?> <li> <?php printf(pe2)?> <?php else (quit and check next set of optional feilds)?>
So the final output would end up like:
Professional Education * College * High School * Middle School
TIA
attached mail follows:
I can't seem to figure out the correct syntax of acessing an array of objects with creating a temp. variable... Is there a workaround for not creating it, or do I just need to deal with using $tempvar = $test[1]; $tempvar->variable?
here is an example of code // Start Code Snipet:
for ($i = 0;$i < 11;$i++) { $test[$i] = new class(); }
echo "$test[1]->variable";
//End code Snipet
The echo statement would return Object->variable on the webpage
Environemt info: PHP 4.06 W2k, running Apache
Any help would be much appreciated,
Sincerely, Athas Nikolakakos
attached mail follows:
> echo "$test[1]->variable";
Get rid of the quotes, they are useless and just confuse the parser.
-Rasmus
attached mail follows:
I've written a ShuffleCards function that will actually shuffle a deck of cards just like would happen in real life (divide the deck in half and stick them into each other with 1-3 cards between each other card)
function ShuffleCards(&$cardsArray, $times) { // Randomizes where to split within center (-3 to +3 from dead center) (MINIMUM 10 CARDS IN DECK) // Splits into two array. Randomizes how many cards from left and how many cards from right (between 1 and 3) // Alternates sides. Continues until both arrays are empty. $arraySize = count($cardsArray);
if($arraySize<10) return;
$deadCenter = $arraySize/2;
for($i=0;$i<$times;$i++) { reset($cardsArray);
$cutVariant = rand(-3, 3); $cutLocation = $deadCenter+$cutVariant;
$firstArray = array(); $secondArray = array();
for($z=0;$z<$arraySize;$z++) { if($z<$cutLocation) array_push($firstArray, $cardsArray[$z]); else array_push($secondArray, $cardsArray[$z]); }
$bottomFirst = rand(0, 1); $cardsArray = array();
while(count($firstArray) && count($secondArray)) { $leftNewCards = array(); $rightNewCards = array();
$leftVariant = rand(1, 3); if($leftVariant>count($firstArray)) $leftVariant = count($firstArray);
$rightVariant = rand(1, 3); if($rightVariant>count($secondArray)) $rightVariant = count($secondArray);
for($x=0;$x<$leftVariant;$x++) { array_push($leftNewCards, array_shift($firstArray)); }
for($y=0;$y<$rightVariant;$y++) { array_push($rightNewCards, array_shift($secondArray)); }
if($bottomFirst==0) { $newCardsArray = array_merge($leftNewCards, $rightNewCards); $bottomFirst = 1; } else { $newCardsArray = array_merge($rightNewCards, $leftNewCards); $bottomFirst = 0; }
reset($newCardsArray);
while(count($newCardsArray)) { array_push($cardsArray, array_shift($newCardsArray)); } }
if(count($firstArray)) { while(count($firstArray)) array_push($cardsArray, array_shift($firstArray)); } if(count($secondArray)) { while(count($secondArray)) array_push($cardsArray, array_shift($secondArray)); } } }
Robert Schultz - bert
ncinter.net
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]