php-general Digest 3 Mar 2001 07:07:50 -0000 Issue 544

Topics (messages 42384 through 42428):

Problem getting PostgreSQL to compile
        42384 by: K Old
        42419 by: The Hermit Hacker

Safe mode?
        42385 by: Leon Mergen
        42425 by: Asep Dindin

Re: server side cookies
        42386 by: Michael David
        42392 by: Mark Maggelet
        42411 by: Chris Lee

benefit of constants
        42387 by: Joe Sheble (Wizaerd)
        42395 by: Phil Glatz

Re: [PHP-DEV] pspell/aspell breaking
        42388 by: PHP development .echospace

Re: MySQL Create Table Problem
        42389 by: rm
        42397 by: David Smith
        42412 by: Jeff Oien

Is this my error or a bug?
        42390 by: Robert Covell

Re: Declaring SERVER-WIDE Variables & UNSERIALIZE overhead
        42391 by: Michael David

Re: [GENERAL] libpq.so.2.1 needed by  php-pgsql-4.0.1pl2-9
        42393 by: Paulo Parola
        42413 by: Joe Conway

Connection error
        42394 by: Shaohua Qu
        42396 by: David Smith
        42421 by: php3.developersdesk.com

Replace last 4 of 16 with ****
        42398 by: WreckRman2
        42399 by: Chris Fry
        42400 by: Krznaric Michael
        42401 by: WreckRman2

Netscape problems with PHP
        42402 by: Robert Fischler, Ph.D. ABD
        42410 by: Chris Lee

cutting apart form field data
        42403 by: Randy Johnson
        42408 by: rm

Problems with pdflib-3.02
        42404 by: Philip Murray

Sybase-CT problem
        42405 by: Sergio Murillo

How to convert a date to an int?(Need help as soon as possible)
        42406 by: Fang Li
        42407 by: Joe Stump
        42409 by: Alexander Skwar
        42414 by: Stephan Ahonen

quote problem
        42415 by: PeterOblivion.aol.com
        42416 by: Simon Garner
        42417 by: Simon Garner
        42418 by: Philip Olson

"highest" file
        42420 by: MaD dUCK

PHP with MySQL doubt
        42422 by: Pablo Pasqualino

Re: linking to specific spot on map?
        42423 by: php3.developersdesk.com

last inserted record
        42424 by: .:: romina ::.

Stripping HTML selectively?
        42426 by: Erick Papadakis
        42427 by: Brian Clark

Apache config -- RedirectMatch
        42428 by: Kefir Podmasli

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------


Hello,

I'm running RH 7 and Apache.  I have the latest version of PostgreSQL and it 
is installed and running correctly.  I have installed PHP with the 
--with-pgsql and it seems to install everything needed, but when I try to 
use pg_connect() it fails to connect.  Any ideas what I can do?

Thanks,
Kevin
[EMAIL PROTECTED]
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com






have you checked phpinfo() to make sure that pgsql support is actually
compiled in?  if so, any errors on connection, or just silently fails?

On Fri, 2 Mar 2001, K Old wrote:

> Hello,
>
> I'm running RH 7 and Apache.  I have the latest version of PostgreSQL and it
> is installed and running correctly.  I have installed PHP with the
> --with-pgsql and it seems to install everything needed, but when I try to
> use pg_connect() it fails to connect.  Any ideas what I can do?
>
> Thanks,
> Kevin
> [EMAIL PROTECTED]
> _________________________________________________________________
> Get your FREE download of MSN Explorer at http://explorer.msn.com
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>

Marc G. Fournier                   ICQ#7615664               IRC Nick: Scrappy
Systems Administrator @ hub.org
primary: [EMAIL PROTECTED]           secondary: scrappy@{freebsd|postgresql}.org





How can I turn off safe_mode using php.ini with php4.0.3pl1? All this doesn't work:

safe_mode="off"
safe_mode=off
safe_mode="0"
safe_mode=0
safe_mode="Off"
safe_mode=Off

Anyone has an idea?


Leon Mergen
[EMAIL PROTECTED]
President of Technical Operations
BlazeBox, Inc.
ICQ: 55677353




I think the second line is right, but I suggest to add space before and
after equal sign, if it is not working may be somethink else make the
problem.

safe_mode = off

-----Original Message-----
From: Leon Mergen [mailto:[EMAIL PROTECTED]]
Sent: 03 March, 2001 4:36 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Safe mode?


How can I turn off safe_mode using php.ini with php4.0.3pl1? All this
doesn't work:

safe_mode="off"
safe_mode=off
safe_mode="0"
safe_mode=0
safe_mode="Off"
safe_mode=Off

Anyone has an idea?


Leon Mergen
[EMAIL PROTECTED]
President of Technical Operations
BlazeBox, Inc.
ICQ: 55677353






Jeff: 

You're talking about sessions, for the most part.

Sessions are nice, as you can efficiently handle things like arrays with
10,000 items of 200 bytes each without doing something extremely stupid like
sending the user The Cookie From Hell (assuming a 2M cookie is even legal -
I forget if there is any limit or not).  Something like that is great when
you're paging through results.

Hope this has helped.

From: Jeff <[EMAIL PROTECTED]>
Date: Fri, 02 Mar 2001 10:58:05 -0500
To: [EMAIL PROTECTED]
Subject: server side cookies

Does anyone know how to set server side cookies in php?  Or can you
point me to a link on how to do this.
Please note that I am not asking how to set client side cookies.

Thanks,

Jeff


---
Michael David
The Miller Group
Web-based software for Schools
http://www.miller-group.net





On Fri, 02 Mar 2001 13:49:17 -0600, Michael David
([EMAIL PROTECTED]) wrote:
>Jeff:
>
>You're talking about sessions, for the most part.

I might be wrong but I think he's talking about setcookie(), for
which the docs are here:
http://www.php.net/manual/en/function.setcookie.php

meaning that the server sends the cookie info in a header, there's
another way to do it with javascript where the client code sets the
cookie. Anyway, one of these posts should cover what he wants :)

>Sessions are nice, as you can efficiently handle things like arrays
>with
>10,000 items of 200 bytes each without doing something extremely
>stupid like
>sending the user The Cookie From Hell (assuming a 2M cookie is even
>legal -
>I forget if there is any limit or not).  Something like that is
>great when
>you're paging through results.
>
>Hope this has helped.
>
>From: Jeff <[EMAIL PROTECTED]>
>Date: Fri, 02 Mar 2001 10:58:05 -0500
>To: [EMAIL PROTECTED]
>Subject: server side cookies
>
>Does anyone know how to set server side cookies in php?  Or can you
>point me to a link on how to do this.
>Please note that I am not asking how to set client side cookies.
>
>Thanks,
>
>Jeff
>
>
>---
>Michael David
>The Miller Group
>Web-based software for Schools
>http://www.miller-group.net
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: php-list-
>[EMAIL PROTECTED]






you mean sessions? cookies are client side, sessions are server side (with assistance 
from cookies or url re-writing)

http://php.net/manual/en/ref.session.php

should have more then enough information, phpbuilder also has a few articles.


-- 

 Chris Lee
 Mediawaveonline.com

 ph. 250.377.1095
 ph. 250.376.2690
 fx. 250.554.1120

 [EMAIL PROTECTED]



"Jeff" <[EMAIL PROTECTED]> wrote in message 
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Does anyone know how to set server side cookies in php?  Or can you
point me to a link on how to do this.
Please note that I am not asking how to set client side cookies.

Thanks,

Jeff


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]





Other than the fact you cannot overwrite them (which helps with 
carelessness), is there any real benefit to declaring a CONSTANT over just 
defining a variable?  In typical compiled programs, I believe constants or 
macros don't load into the symbol table, thus reducing memory requirements 
for the executable.  But since PHP isn't a compiled program, but a script 
parser, is there any real benefit?





At 12:48 PM 03/02/2001 -0700, Joe wrote:
>is there any real benefit to declaring a CONSTANT over just defining a 
>variable?

The fact they can't be overwritten makes them more appropriate for true 
constants, absolutely no way to change their values.  I frequently use them 
in include files to set widths, etc., that are brought into all the pages 
in a project.

Plus, they have global scope - great if you are in the habit of forgetting 
global declarations in functions <g>.

And my guess is their is less overhead in using them, even in an 
interpreted environment.





Thanks for the nice report - I'll know what to suggest to those who ask in the future. 
I've heard of somewhat similar problems with aspell on other platforms, and yet have 
to figure out how to work around them:(

One thing I noticed after I replied to you: after you compile pspell and aspell, you 
*need* to go back to pspell and do:
cd modules
./add-modules
cd ..
make
make install
ldconfig -v

That's just the way it works. aspell is dependent on pspell, but pspell needs to know 
that aspell exists to work with it. Kinda like a circular dependency

Vlad



----- Original Message -----
From: Seth Northrop
To: [EMAIL PROTECTED],[EMAIL PROTECTED]
Sent: Fri, 2 Mar 2001 11:16:13 -0800 (PST)
Subject: Re: [PHP-DEV] pspell/aspell breaking


On Fri, 2 Mar 2001, PHP development @echospace wrote:

&gt; I remember being able to compile, but not use pspell on a RH7 machine. Never had 
time to look into it. Maybe now I will. Compile problems might be due to the fact that 
gcc 2.96 is behaving oddly - I couldn't compile half the things with it properly. Try 
recent egcs instead. It looks however that I can't blame compiler only in your case. 
If you can't get it resolved, could you please submit a bug report with the part of 
the output where compile fails (not just *that* very line, but like 50 preceding lines 
too - a larger chunk so I can see)
&gt;&gt;&gt;

Hmmm. So, I try to recompile to reproduce the error, this time advancing
back to .12; I compile; no errors AND the module error goes away (thus,
it works great as it always had on RH6.2).

Weird.<BR>
These are the only two things I can think of.

My progression was this; get .12 (it failed to compile; (php+apache -
pspell/aspell compiled fine), read php-dev, saw there might be issues so I
reverted back to .11.2 (pspell). It compiled, but, with the aspell module
issue. Figured perhaps it was the most recent aspell (I had gotten
aspell-.33); so, I reverted that back to 32.6; recompiled still got aspell
module issues. Noted that RH7 have some glibc issues (and, it had caused
some other issues with aspell/pspell); updated both glibc and gcc from
redhat (rpm updates), recompiled, still had aspell module issues with PHP.
Finally, to replicate the compile error I went BACK to pspell .12,
recompiled, everything worked.

So, the two things I can think of is:

a) the newest aspell libraries are causing problems either in the compile
or in the aspell module loading

b) redhat's buggy glibc/gcc

the only odd thing was that I can't necessarily isolate either of these as
the cause. But, aspell 32.6+pspell .12+updated RH glibc 2.2-12 &amp;
gcc-2.96-69 + apache 1.3.14 + php-4.0.4pl1 works on RH 7 now. My
inclination is that it's aspell, since, the same behavior existed with
both stock and updated glibc and gcc.


&gt;
&gt;
&gt;
&gt; ----- Original Message -----
&gt; From: Seth Northrop
&gt; To: [EMAIL PROTECTED],[EMAIL PROTECTED]
&gt; Sent: Thu, 1 Mar 2001 18:41:25 -0800 (PST)
&gt; Subject: [PHP-DEV] pspell/aspell breaking
&gt;
&gt;
&gt; Setup:
&gt; aspell-.32.6
&gt; pspell-.11.2
&gt; php-4.0.4pl1
&gt; apache_1.3.14
&gt; RH 7.0
&gt; glibc 2.2-12
&gt; gcc-2.96-69
&gt;
&gt; Procedure:
&gt; ./pspell-.11.2/configure
&gt; make &amp;&amp; make install
&gt;
&gt; ./aspell-.32.6/configure 
&gt; make &amp;&amp; make install
&gt;
&gt; ./php-4.0.4pl1/configure --without-gd --with-mysql
&gt; --with-config-file-path=/usr/local/apache/etc --enable-debug=no
&gt; --with-pspell --with-apache=/usr/local/src/apache_1.3.14
&gt; make &amp;&amp; make install
&gt;
&gt; ./apache_1.3.14/configure --prefix=/usr/local/apache --with-layout=GNU
&gt; --disable-module=userdir --disable-module=include
&gt; --activate-module=src/modules/php4/libphp4.a
&gt; make &amp;&amp; make install
&gt;
&gt; Results in:
&gt; Warning: PSPELL couldn't open the dictionary. reason: Unable to load the
&gt; "aspell" module. in foo.inc on line 564
&gt;
&gt; Aspell works great on the command line. Am I missing something?
&gt;
&gt; Incidently, I can't even get php to compile with pspell-.12
&gt;
&gt; Ideas?
&gt; Seth
&gt;
&gt;
&gt;




--
PHP Development Mailing List &lt;http://www.php.net/&gt;
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
<BR>

________________________________________
Finally! Real applications on the web!
Free email, contacts, and file storage.
http://www.echospace.com





Shouldn't the primary key spec come at the end of the
table create command, not in the middle ex...

CREATE TABLE president (
last_name varchar(15) NOT NULL,
first_name varchar(15) NOT NULL,
suffix varchar(5) NOT NULL,
city varchar(20) NOT NULL,
state varchar(2) NOT NULL,
birth date NULL,
death date NULL,
primary key (first_name))

something like the above.



__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/




Quick example...

CREATE TABLE user (
   userid int(10) unsigned DEFAULT '0' NOT NULL auto_increment,
   usergroupid smallint(5) unsigned DEFAULT '0' NOT NULL,
   username varchar(50) NOT NULL,
   password varchar(50) NOT NULL,
   email varchar(50) NOT NULL,
   parentemail varchar(50) NOT NULL,
   coppauser smallint(6) DEFAULT '0' NOT NULL,
   homepage varchar(100) NOT NULL,
   icq varchar(20) NOT NULL,
   aim varchar(20) NOT NULL,
   yahoo varchar(20) NOT NULL,
   biography mediumtext NOT NULL,
   signature mediumtext NOT NULL,
   adminemail smallint(6) DEFAULT '0' NOT NULL,
   showemail smallint(6) DEFAULT '0' NOT NULL,
   invisible smallint(6) DEFAULT '0' NOT NULL,
   usertitle varchar(250) NOT NULL,
   customtitle smallint(6) DEFAULT '0' NOT NULL,
   joindate int(10) unsigned DEFAULT '0' NOT NULL,
   canpost smallint(6) DEFAULT '0' NOT NULL,
   cookieuser smallint(6) DEFAULT '0' NOT NULL,
   daysprune smallint(6) DEFAULT '0' NOT NULL,
   lastvisit int(10) unsigned DEFAULT '0' NOT NULL,
   lastactivity int(10) unsigned DEFAULT '0' NOT NULL,
   lastpost int(10) unsigned DEFAULT '0' NOT NULL,
   posts smallint(5) unsigned DEFAULT '0' NOT NULL,
   timezoneoffset smallint(6) DEFAULT '0' NOT NULL,
   emailnotification smallint(6) DEFAULT '0' NOT NULL,
   imgurl varchar(150) NOT NULL,
   PRIMARY KEY (userid),
   KEY idxgroups (username, usergroupid)
);

-----Original Message-----
From: Jeff Oien [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 02, 2001 2:09 PM
To: PHP
Subject: [PHP] MySQL Create Table Problem


This is driving me nuts. I really tried to figure it out
myself. I have a form for creating a table. The form
fields have field_name field_type field_length, and
checkboxes for not_null, auto_increment and primary.

When I check the primary key checkbox it always makes
the first field the primary key no matter what. And it
makes two date fields I enter NULL and the rest NOT
NULL no matter what I put in the checkboxes. The code
is below along with a printout of the SQL query. I only
wanted suffix and death date to be null. This is combination
from PHP Fast and Easy and MySQL by Dubois.

$sql = "CREATE TABLE $table_name (";

for ($i = 0; $i < count($field_name); $i++) {

        $sql .= "$field_name[$i] $field_type[$i]";

        if ($not_null[$i] == "Y") {
                $additional = " NOT NULL";
        } else {
                $additional = " NULL";
        }

        if ($auto_increment[$i] == "Y") {
                $additional .= " AUTO_INCREMENT";
        } else {
                $additional .= "";
        }

        if ($primary[$i] == "Y") {
                $additional .= " primary key";

        } else {
                $additional .= "";
        }

        if ($field_length[$i] != "") {
                $sql .= "($field_length[$i]) $additional,";
        } else {
                $sql .= " $additional,";
        }

}

$sql = substr($sql, 0, -1);

$sql .= ")";

------------

CREATE TABLE president (last_name varchar(15) NOT NULL primary
key,first_name
varchar(15) NOT NULL,suffix varchar(5) NOT NULL,city varchar(20) NOT
NULL,state
varchar(2) NOT NULL,birth date NULL,death date NULL)


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]





I found where the problem stems from after correcting a couple
items per your example but still don't know why it won't work.

It comes from using checkboxes in the form for PRIMARY KEY,
AUTO_INCREMENT and NOT NULL or NULL. When I use checkboxes
like this:

<td align=center>
<input type=\"checkbox\" name=\"not_null[]\" value=\"Y\">
</td>

it totally messes up the query. But when I use 

<td align=center>
<input type=\"text\" name=\"not_null[]\" size=1>
</td>

and either leave it blank or enter "Y" it works fine! This
is really driving me nuts and I'm afraid it's going to be
something stupid staring me in the face.
Jeff Oien

> Quick example...
> 
> CREATE TABLE user (
>    userid int(10) unsigned DEFAULT '0' NOT NULL auto_increment,
>    usergroupid smallint(5) unsigned DEFAULT '0' NOT NULL,
>    username varchar(50) NOT NULL,
>    password varchar(50) NOT NULL,
>    email varchar(50) NOT NULL,
>    parentemail varchar(50) NOT NULL,
>    coppauser smallint(6) DEFAULT '0' NOT NULL,
>    homepage varchar(100) NOT NULL,
>    icq varchar(20) NOT NULL,
>    aim varchar(20) NOT NULL,
>    yahoo varchar(20) NOT NULL,
>    biography mediumtext NOT NULL,
>    signature mediumtext NOT NULL,
>    adminemail smallint(6) DEFAULT '0' NOT NULL,
>    showemail smallint(6) DEFAULT '0' NOT NULL,
>    invisible smallint(6) DEFAULT '0' NOT NULL,
>    usertitle varchar(250) NOT NULL,
>    customtitle smallint(6) DEFAULT '0' NOT NULL,
>    joindate int(10) unsigned DEFAULT '0' NOT NULL,
>    canpost smallint(6) DEFAULT '0' NOT NULL,
>    cookieuser smallint(6) DEFAULT '0' NOT NULL,
>    daysprune smallint(6) DEFAULT '0' NOT NULL,
>    lastvisit int(10) unsigned DEFAULT '0' NOT NULL,
>    lastactivity int(10) unsigned DEFAULT '0' NOT NULL,
>    lastpost int(10) unsigned DEFAULT '0' NOT NULL,
>    posts smallint(5) unsigned DEFAULT '0' NOT NULL,
>    timezoneoffset smallint(6) DEFAULT '0' NOT NULL,
>    emailnotification smallint(6) DEFAULT '0' NOT NULL,
>    imgurl varchar(150) NOT NULL,
>    PRIMARY KEY (userid),
>    KEY idxgroups (username, usergroupid)
> );
> 
> -----Original Message-----
> From: Jeff Oien [mailto:[EMAIL PROTECTED]]
> Sent: Friday, March 02, 2001 2:09 PM
> To: PHP
> Subject: [PHP] MySQL Create Table Problem
> 
> 
> This is driving me nuts. I really tried to figure it out
> myself. I have a form for creating a table. The form
> fields have field_name field_type field_length, and
> checkboxes for not_null, auto_increment and primary.
> 
> When I check the primary key checkbox it always makes
> the first field the primary key no matter what. And it
> makes two date fields I enter NULL and the rest NOT
> NULL no matter what I put in the checkboxes. The code
> is below along with a printout of the SQL query. I only
> wanted suffix and death date to be null. This is combination
> from PHP Fast and Easy and MySQL by Dubois.
> 
> $sql = "CREATE TABLE $table_name (";
> 
> for ($i = 0; $i < count($field_name); $i++) {
> 
>       $sql .= "$field_name[$i] $field_type[$i]";
> 
>       if ($not_null[$i] == "Y") {
>               $additional = " NOT NULL";
>       } else {
>               $additional = " NULL";
>       }
> 
>       if ($auto_increment[$i] == "Y") {
>               $additional .= " AUTO_INCREMENT";
>       } else {
>               $additional .= "";
>       }
> 
>       if ($primary[$i] == "Y") {
>               $additional .= " primary key";
> 
>       } else {
>               $additional .= "";
>       }
> 
>       if ($field_length[$i] != "") {
>               $sql .= "($field_length[$i]) $additional,";
>       } else {
>               $sql .= " $additional,";
>       }
> 
> }
> 
> $sql = substr($sql, 0, -1);
> 
> $sql .= ")";
> 
> ------------
> 
> CREATE TABLE president (last_name varchar(15) NOT NULL primary
> key,first_name
> varchar(15) NOT NULL,suffix varchar(5) NOT NULL,city varchar(20) NOT
> NULL,state
> varchar(2) NOT NULL,birth date NULL,death date NULL)
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 




Is this following due to a bug in either Payflow Pro SDK or in PHP or my
messup?  It just seems to odd that the warning is for pfpro_version and then
the configtest fails because of pfpro_version.  Here are the errors and code
it is using:


----When making PHP----
root@server5:/usr/local/phpApache/php-4.0.4pl1# make > make.out
pfpro.c: In function `php_if_pfpro_version':
pfpro.c:129: warning: initialization makes pointer from integer without a
cast
root@server5:/usr/local/phpApache/php-4.0.4pl1#



----When doing configtest----
root@server5:/usr/local/phpApache/php-4.0.4pl1# ../../apache/bin/apachectl
conf
igtest
Syntax error on line 213 of /usr/local/apache1317/conf/httpd.conf:
Cannot load /usr/local/apache1317/libexec/libphp4.so into server:
/usr/local/apa
che1317/libexec/libphp4.so: undefined symbol: PNVersion
root@server5:/usr/local/phpApache/php-4.0.4pl1#



----The code that the error is in(../php-4.0.4pl1/ext/pfpro/pfpro.c)----
/* {{{ proto string pfpro_version()
   Returns the version of the Payflow Pro library */
PHP_FUNCTION(pfpro_version)
{
        if (ZEND_NUM_ARGS() != 0) {
                WRONG_PARAM_COUNT;
        }

        RETURN_STRING(PNVersion(), 1);
}
/* }}} */

Thanks,

-Bob






Simon:

Thanks for the SHMEM heads-up.  It's defiantly a step up in efficiency/speed
than calling the databases, however, I wonder about the overhead of loading
and unserializing on every page.  Another issue is portability -- while the
servers here are MacOS X and Linux-based, future systems may be Windows
clunkers, where SHMEM isn't an option.

I'm going to have to send a message/feature request to the developer list as
well.. maybe they'll have more insight, or will be able to run with my
request/tell me why it's bad.

---
Michael David
The Miller Group
Web-based software for Schools
http://www.miller-group.net

> From: "Simon Garner" <[EMAIL PROTECTED]>
> Date: Fri, 2 Mar 2001 15:59:39 +1300
> To: "Michael David" <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]>
> Subject: Re: [PHP] Declaring SERVER-WIDE Variables
> 
> Hi Michael,
> 
> I've never used it myself, but this may be of some use:
> 
> http://www.php.net/manual/en/ref.shmop.php
> 
> If I understand it correctly, this lets you write a string into an area of
> memory which can be accessed from any process - i.e. another httpd process.
> 
> If you wanted to save an array you would need to serialize() it first.
> 
> 
> Cheers
> 
> Simon Garner
> 
> 
> From: "Michael David" <[EMAIL PROTECTED]>
> 
>> Greetings, fellow PHP hackers!
>> 
>> The current project I'm working on is porting software written in Tango to
>> PHP4.  Because these programs heavily rely on information held in
> (off-site)
>> databases, the tango programs were written to have a set of array
> variables
>> declared from SQL queries, which then any user hitting the site would have
>> access to.
>> 
>> Ie...
>> 
>> User 1 hits the webapge.. the server realizes this is the first user and
>> populates the arrays with data from the source database.  The page is able
>> to use these arrays.
>> 
>> User 2 hits the webpage.. the server already has the arrays packed with
>> data, and user 2 is able to hit the pages quickly, due to no queries being
>> made.  All users are this way.
>> 
>> Some events would require that these arrays be re-hashed such as when a
> user
>> updates, inserts or changes the value of an item in the database.  These
>> changes.
>> 
>> When this update happens, the changes would be made to the server-wide
>> variables, so ANY user on the machine (independant of sessions) would have
>> the fresh data when it next pulls from the arrays.
>> 
>> ....
>> 
>> Ideally, this would be like settings HTTP_SERVER_VARS[school_array] to
>> contain the data, where every page would have $school_array there without
>> any additional work, and a refresh being a small function that creates the
>> arrays needed and sticks them into HTTP_SERVER_VARS[array_name].  (Along
> the
>> lines of PHP_SELF, but not dynamic in that sense.)
>> 
>> Some of this could be handled with sessions, but my concern is that
> carrying
>> ALL of this data with each user is a waste of resources, and will require
>> more database calls than needed.
>> 
>> If anyone has ANY ideas, PLEASE share them! :)
>> 
>> Regards,
>> 
>> Michael
>> 
>> 
>> ---
>> Michael David
>> The Miller Group
>> Web-based software for Schools
>> http://www.miller-group.net
>> 
>> 
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>> 
> 





Maybe somebody here might be able to help me so I am forwarding this.

TIA,
Paulo

----- Original Message ----- 
From: Paulo Parola 
To: [EMAIL PROTECTED] 
Sent: Thursday, March 01, 2001 4:31 PM
Subject: [GENERAL] libpq.so.2.1 needed by php-pgsql-4.0.1pl2-9


Hi,

I am running Redhat 7.0 with PHP 4.0.1pl2. I currently installed PostgreSQL 7.1beta, 
but now when trying to enable Postgres access to PHP (package php-pgsql-4.0.1pl2-9) I 
get the following error:

[root@atlas PostgreSQL]# rpm -ivh php-pgsql-4.0.1pl2-9.i386.rpm
error: failed dependencies:
        libpq.so.2.1 is needed by php-pgsql-4.0.1pl2-9

What are my options? 
 
1) Force installation with rpm "nodependency" option? 
 
2) Create some symlink? Currently I have at /usr/lib the following files:

lrwxrwxrwx    1 root     root           12 Mar  1 11:17 libpq.so -> libpq.so.2.1
lrwxrwxrwx    1 root     root           12 Mar  1 11:07 libpq.so.2 -> libpq.so.2.1
lrwxrwxrwx    1 root     root           12 Mar  1 11:17 libpq.so.2.0 -> libpq.so.2.1
-rwxr-xr-x    1 root     root        70311 Jan 29 05:19 libpq.so.2.1

3) Some other tips?
 
Thank you in advance,
 
Paulo
 




>[root@atlas PostgreSQL]# rpm -ivh php-pgsql-4.0.1pl2-9.i386.rpm
>error: failed dependencies:
>        libpq.so.2.1 is needed by php-pgsql-4.0.1pl2-9

<snip>

>2) Create some symlink? Currently I have at /usr/lib the following files:
>lrwxrwxrwx    1 root     root           12 Mar  1 11:17 libpq.so ->
libpq.so.2.1
>lrwxrwxrwx    1 root     root           12 Mar  1 11:07 libpq.so.2 ->
libpq.so.2.1
>lrwxrwxrwx    1 root     root           12 Mar  1 11:17 libpq.so.2.0 ->
libpq.so.2.1
>-rwxr-xr-x    1 root     root        70311 Jan 29 05:19 libpq.so.2.1

It looks from the above that libpq.so.2.1 is in /usr/lib.
Try adding this line to /etc/ld.so.conf:

/usr/lib

and the run "ldconfig".

Hope this helps,

Joe





Hi,

When I run the code:

<?php
        mysql_connect ("LOCALHOST","webmaster2","hironsc0");
?>

I got error message:
  Fatal error: Call to unsupported or undefined function mysql_connect() in
...

HELP!

Thanks in advance,

Sharon





        Try this... You need to set a variable for the connection. Also you might
be careful when sending examples of your code as you have given everyone on
this list your username/password to your database.

<?php

$connection = mysql_connect ("localhost", "webmaster2", "******");
if ($connection == false){
  echo mysql_errno().": ".mysql_error()."<BR>";
  exit;
}

?>




-----Original Message-----
From: Shaohua Qu [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 02, 2001 4:00 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Connection error


Hi,

When I run the code:

<?php
        mysql_connect ("LOCALHOST","webmaster2","*****");
?>

I got error message:
  Fatal error: Call to unsupported or undefined function mysql_connect() in
...

HELP!

Thanks in advance,

Sharon


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]





Addressed to: <[EMAIL PROTECTED]>
              [EMAIL PROTECTED]

** Reply to note from <[EMAIL PROTECTED]> Fri, 2 Mar 2001 15:59:55 -0500
>
> Hi,
>
> When I run the code:
>
> <?php
>       mysql_connect ("LOCALHOST","webmaster2","hironsc0");
> ?>
>
> I got error message:
>   Fatal error: Call to unsupported or undefined function mysql_connect() in

English translation:  You have not compiled MySQL support into PHP.  You
will need to re-compile, or find a different RPM.  If you compile it
yourself, be sure to add  with-mysql to the ./configure command.


If this is on a Windows host, look in php.ini and uncomment the line
that loads the MySQL DLL.




Rick Widmer
Internet Marketing Specialists
http://www.developersdesk.com




        I am building an account manager for my web hosting clients in which they
can edit thier information, etc only I do not want to display the entire
credit card number on the site. Instead I would like to replace the last 4
numbers with a * if possible. Can anyone assist me with the code to do this.
Thanks in advance...

        David Smith
        Indy Web Design
        http://www.indywebdesign.com





You could split the card number into groups of 4 digits and. in the form, make the
last one <input type="password" name="xxx" size="4">.

This would do what you need.

Chris

WreckRman2 wrote:

>         I am building an account manager for my web hosting clients in which they
> can edit thier information, etc only I do not want to display the entire
> credit card number on the site. Instead I would like to replace the last 4
> numbers with a * if possible. Can anyone assist me with the code to do this.
> Thanks in advance...
>
>         David Smith
>         Indy Web Design
>         http://www.indywebdesign.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]

--
Chris Fry
Quillsoft Pty Ltd
Specialists in Secure Internet Services and E-Commerce Solutions
10 Gray Street
Kogarah
NSW  2217
Australia

Phone: +61 2 9553 1691
Fax: +61 2 9553 1692
Mobile: 0419 414 323
eMail: [EMAIL PROTECTED]
http://www.quillsoft.com.au

You can download our Public CA Certificate from:-
https://ca.secureanywhere.com/htdocs/cacert.crt

**********************************************************************

This information contains confidential information intended only for
the use of the authorised recipient.  If you are not an authorised
recipient of this e-mail, please contact Quillsoft Pty Ltd by return
e-mail.
In this case, you should not read, print, re-transmit, store or act
in reliance on this e-mail or any attachments, and should destroy all
copies of them.
This e-mail and any attachments may also contain copyright material
belonging to Quillsoft Pty Ltd.
The views expressed in this e-mail or attachments are the views of
the author and not the views of Quillsoft Pty Ltd.
You should only deal with the material contained in this e-mail if
you are authorised to do so.

This notice should not be removed.





Hi,

        O.k. this is of the top of my head, but you should get the point.
For more info refer to 
http://www.php.net/manual/en/function.substr.php . 

<?
$CC_Number=5602232659988123;

$rest = substr ($CC_Number, 0, 11)."****";

print "Your credit card number is $CC_Number";
?>

What you're doing is extracting the first 12 number and adding "****" to the
end of that string.  Hope it helps.

Mike


-----Original Message-----
From: WreckRman2 [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 02, 2001 4:22 PM
To: PHP List Post
Subject: [PHP] Replace last 4 of 16 with ****


        I am building an account manager for my web hosting clients in which
they
can edit thier information, etc only I do not want to display the entire
credit card number on the site. Instead I would like to replace the last 4
numbers with a * if possible. Can anyone assist me with the code to do this.
Thanks in advance...

        David Smith
        Indy Web Design
        http://www.indywebdesign.com


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Excellent, thank you very much...

-----Original Message-----
From: Krznaric Michael [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 02, 2001 4:32 PM
To: 'WreckRman2'; PHP List Post
Subject: RE: [PHP] Replace last 4 of 16 with ****


Hi,

        O.k. this is of the top of my head, but you should get the point.
For more info refer to
http://www.php.net/manual/en/function.substr.php .

<?
$CC_Number=5602232659988123;

$rest = substr ($CC_Number, 0, 11)."****";

print "Your credit card number is $CC_Number";
?>

What you're doing is extracting the first 12 number and adding "****" to the
end of that string.  Hope it helps.

Mike


-----Original Message-----
From: WreckRman2 [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 02, 2001 4:22 PM
To: PHP List Post
Subject: [PHP] Replace last 4 of 16 with ****


        I am building an account manager for my web hosting clients in which
they
can edit thier information, etc only I do not want to display the entire
credit card number on the site. Instead I would like to replace the last 4
numbers with a * if possible. Can anyone assist me with the code to do this.
Thanks in advance...

        David Smith
        Indy Web Design
        http://www.indywebdesign.com


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]





Hello all (first post for me!):

I've been running into problems when testing PHP scripts on Netscape (when
MSIE works fine).

First problem (SOLVED) was that Netscape does something funny with the
$PHP_SELF environmental variable, so I've learned to circumvent the problem
by just hard-coding the page name instead of relying on the $PHP_SELF trick.

Second problem (UNSOLVED, SO FAR) is that Netscape (...and I'm talking about
Communicator 4.75 for the Mac, at least) doesn't carry my session variables
over from page to page.  Has anyone else ran into this problem and found a
solution?

Thanks!!!
P.S.   Things seem to work fine in the new Netscape 6, but most Mac users
are still at 4.75.

-- 
Robert Fischler, PhD ABD
IUB Campus Manager
CampCampus.com





ok your experiencing some very strange errors. I would love to comment on the PHP_SELF 
thing, if you want me to I'll email you.

do you have php configured with --trans-sid? is the cookie PHPSESSID being set on the 
client? is the SID being transfered on all non-full urls when cookies are not being 
used.? a few comments some people may not realize.

sessions with cookies
------------------------
 - will transfer across full urls
 - will transfer acress full form urls
 - will not set SID
 - will not transfer across multiple domainnames

sessions without cookies
------------------------
 - will set SID
 - will transfer across multiple domainnames if the domain name is on the same server 
and $SID is manualy appended to the url
 - will transfer across full urls if $SID is appended to the url
 - will transfer across full form urls if $SID is appended to the form url

use code like this and you can fix some of those issues.

<?php

 function mtime()
 {
  $mtime = microtime();
  $mtime = str_replace('.', '', $mtime);
  $mtime = explode(' ', $mtime);
  $mtime = $mtime[1] . $mtime[0];

  return($mtime);
 }

 if ( isset($HTTP_GET_VARS['PHPSESSID']) )
  session_id($HTTP_GET_VARS['PHPSESSID']);
 if ( isset($HTTP_POST_VARS['PHPSESSID']) )
  session_id($HTTP_POST_VARS['PHPSESSID']);

 if (!isset($HTTP_SESSION_VARS['SessionID']))
 {
  $SessionID = mtime();
  session_register('SessionID');
 }

 $PHPSESSID = session_id();
 $SID = "PHPSESSID=$PHPSESSID";

 //----

 echo "
 <a href='http://$SERVER_NAME/$PHP_SELF?$SID'>here </a>
 ";

?>

I amcurious on how this works out


-- 

 Chris Lee
 Mediawaveonline.com

 ph. 250.377.1095
 ph. 250.376.2690
 fx. 250.554.1120

 [EMAIL PROTECTED]


""Robert Fischler, Ph.D. ABD"" <[EMAIL PROTECTED]> wrote in message 
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Hello all (first post for me!):

I've been running into problems when testing PHP scripts on Netscape (when
MSIE works fine).

First problem (SOLVED) was that Netscape does something funny with the
$PHP_SELF environmental variable, so I've learned to circumvent the problem
by just hard-coding the page name instead of relying on the $PHP_SELF trick.

Second problem (UNSOLVED, SO FAR) is that Netscape (...and I'm talking about
Communicator 4.75 for the Mac, at least) doesn't carry my session variables
over from page to page.  Has anyone else ran into this problem and found a
solution?

Thanks!!!
P.S.   Things seem to work fine in the new Netscape 6, but most Mac users
are still at 4.75.

-- 
Robert Fischler, PhD ABD
IUB Campus Manager
CampCampus.com


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]





okay  I want to have the user submit multiple values in a text form field

ex

day,night,month

How do I take that data and break it apart into separate variables?

thanks

randy




look at the explode or split functions in the php help
docs


--- Randy Johnson <[EMAIL PROTECTED]> wrote:
> okay  I want to have the user submit multiple values
> in a text form field
> 
> ex
> 
> day,night,month
> 
> How do I take that data and break it apart into
> separate variables?
> 
> thanks
> 
> randy
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> To contact the list administrators, e-mail:
> [EMAIL PROTECTED]
> 


__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/




I have script that generates a pdf width some text and two images in it. One
of the images is just a header and works fine. The other is a photo, now,
this sometimes works and sometimes doesn't.  I can't figure out why.

When the photo doesn't appear I eventually get a box saying something like
"An I/O processing error occured". Sorry, can't remember the exact message,
and as I write this message I can't seem to get it back. Also, when you
print one of the broken PDF's it locks up the browser (works fine on the
non-broken ones).

Here is the script I use to send the generated PDF to the browser:

<?

    if(file_exists("/path/to/file/photo.gif")) {
        $pic = pdf_open_image_file($pdf, "gif", "/path/to/file/photo.gif");
        pdf_place_image($pdf, $pic, 38, 450, 1.5);
    }

    ....
    ....
    ....

    pdf_show_boxed($pdf, "$rcpt_name\n$address\n\nInvoice no:
$invoice_no\nDue Date: $rowdata[duewhen]\n\nNet Price: \$$netprice\nGST:
\$$gst\n\nTotal to pay: \$$total", 380, 10, 200, 150, "right");

    pdf_end_page($pdf);
    pdf_close($pdf);
    fclose($fp);

    header( "Content-type: application/x-pdf" );
    header( "Content-Disposition: filename=$REMOTE_USER.$id.pdf" );
    header( "Content-Description: PDF Format Invoice" );
    header("Location: /invoicing/$REMOTE_USER.$id.pdf");

?>


Anyhelp would be muchly appreciated.

Cheers

PS, Its all in IE5.x in win98/win2k

Philip Murray
[EMAIL PROTECTED]





I just installed  a Sybase_CT module in php 4.0 on a linux machine. I'm
trying to move a web site from a buggy and crashy NT box but I'm having
trouble with the mssql_result call.

This is what i get.

Warning: 2 is not a valid Sybase result resource in
/var/www/html/crap.php on line 54

Line 54 reads:

$ssn = mssql_result($result,$a,0);


I also get this error on all the mssql_result on the for loop.
I made it work changing it with mssql_fetch_* calls but I want to move a
big site to the linux bos and I would be a momumetla job rewriting the
whole code.

Can you please help?

Thanks

Sergio







Hi, All,
I am stucked here.Would you please help as soon as you can?

LiveDate = "Mar 12,2001"

how to convert it to a int?

mktime(0,0,0,?,?,?)
Because the LiveDate is changable, I could't put a 3,12,2001 in the mktime.

Thanks a lot.

Fang





Well if you have a consistent format (like Month Day, FullYear) then you could
do this:

  function get_unix_stamp($date)
  {
    $months = array('Jan' => 1,'Feb' => 2,
                    'Mar' => 3,'Apr' => 4,
                    'May' => 5,'Jun' => 6,
                    'Jul' => 7,'Aug' => 8,
                    'Sep' => 9,'Oct' => 10,
                    'Nov' => 11,'Dec' => 11);
    $foo = explode(' ',$date);
    $month = $months[$foo[0]];
    $day = str_replace(',',$foo[1]);
    $year = $foo[2];

    return mktime(0,0,0,$month,$day,$year);
  }

--Joe

On Fri, Mar 02, 2001 at 06:58:45PM -0500, Fang Li wrote:
> Hi, All,
> I am stucked here.Would you please help as soon as you can?
> 
> LiveDate = "Mar 12,2001"
> 
> how to convert it to a int?
> 
> mktime(0,0,0,?,?,?)
> Because the LiveDate is changable, I could't put a 3,12,2001 in the mktime.
> 
> Thanks a lot.
> 
> Fang
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 

-------------------------------------------------------------------------------
Joe Stump, PHP Hacker, [EMAIL PROTECTED]                                 -o)
http://www.miester.org http://www.care2.com                                 /\\
"It's not enough to succeed. Everyone else must fail" -- Larry Ellison     _\_V
-------------------------------------------------------------------------------





So sprach Fang Li am Fri, Mar 02, 2001 at 06:58:45PM -0500:
> Hi, All,
> I am stucked here.Would you please help as soon as you can?
> 
> LiveDate = "Mar 12,2001"
> 
> how to convert it to a int?

        $months = array( "Jan" => 1,
                         "Feb" => 2,
                         ...........
                         "Dec" => 12
                       );

        $month = substr($LiveDate, 3);

        $month_num = $months( $month );

        $comma = strpos($LiveDate, ",");

        $day = substr($LiveDate, 2, $comma - 2);

        $year = substr($LiveDate, 4, $comma);

Something like this should work - I'm not too sure about the values for
substr, but it should give you an idea.

Alexander Skwar
-- 
How to quote:   http://learn.to/quote (german) http://quote.6x.to (english)
Homepage:       http://www.digitalprojects.com   |   http://www.iso-top.de
   iso-top.de - Die guenstige Art an Linux Distributionen zu kommen
                Uptime: 1 day 1 hour 5 minutes




http://www.php.net/manual/en/function.strtotime.php

No need to code it yourself, just say $timestamp = strtotime($livedate)

Sig for a Day
Stephan Ahonen, ICQ 491101
"That's very funny Scotty, now beam down my clothes!"
Come back tomorrow for a different sig!
Backspace a single "s" to reply by email





Hey,

Wondering if any of you can help me with a problem

im trying to get something like this into $var  :

<title>blah "blah" blah</title>

How can I do it if its multi lined

Someone suggested
content =  END <<
BLAH BLAHC
BLHAC
END;

but that doesnt seem to work with quotes

Thanks
- Peter




From: <[EMAIL PROTECTED]>

> Hey,
> 
> Wondering if any of you can help me with a problem
> 
> im trying to get something like this into $var  :
> 
> <title>blah "blah" blah</title>
> 
> How can I do it if its multi lined
> 
> Someone suggested
> content =  END <<
> BLAH BLAHC
> BLHAC
> END;
> 
> but that doesnt seem to work with quotes
> 
> Thanks
> - Peter
> 


You need to escape the quote characters by prefixing them with a backslash.


<?php
    $title = "<title>blah \"blah\" blah</title>";
?>


Cheers

Simon Garner





From: <[EMAIL PROTECTED]>

> Unfortunatly thats not an option since some dumb founded people will be
using
> the script and they dont understand that concept...
>
> any other suggestions?
>
> - Peter


Okay, a heredoc may be better then:

<?php
    $title = <<<END
<title>blah "blah" blah</title>
END;
    echo $title;
?>

The syntax in your original e-mail was not quite right - heredocs should
work fine with quotes.

http://www.php.net/manual/language.types.string.php


Cheers

Simon Garner





A couple resources to help :

  http://www.php.net/manual/en/language.types.string.php

  http://www.zend.com/zend/tut/using-strings.php

Each describes the ability to do :

  $var = '<title>blah "blah" blah</title>';
  $var = "<title>blah 'blah' blah</title>";
  $var = "<title>blah \"blah\" blah</title>";

And using here doc, <<< , like so :

$var = <<<EOD
  Example of "string"
  spanning multiple 'lines'
  using heredoc syntax.
EOD;



Regards,    


Philip Olson
http://www.cornado.com/

On Fri, 2 Mar 2001 [EMAIL PROTECTED] wrote:

> Hey,
> 
> Wondering if any of you can help me with a problem
> 
> im trying to get something like this into $var  :
> 
> <title>blah "blah" blah</title>
> 
> How can I do it if its multi lined
> 
> Someone suggested
> content =  END <<
> BLAH BLAHC
> BLHAC
> END;
> 
> but that doesnt seem to work with quotes
> 
> Thanks
> - Peter
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 





hey,

given a directory structure like

$DOCUMENT_ROOT/2001/03/02     (where 02 is a file in dir 03/

which obviously represents a date, i would like to implement a page
such as latest.php, which will go to $DOCUMENT_ROOT, list all the
directories, sort them numerically, choose the largest, chdir, repeat,
chdir, and obtain the name of the file that is associated with the
"highest" number.

this is related to an announcement page, where a central page
display.php handles the date directory tree. sometimes, there are
releases on consecutive days, but it may happen that an announcement
is a couple of days back, in which case i want latest.php to find it
automatically and dynamically.

any hints?

martin

[greetings from the heart of the sun]# echo madduck@!#:1:s@\@@@.net
-- 
"when I was a boy I was told
 that anybody could become president.
 now i'm beginning to believe it."
                                                    -- clarence darrow




Hi

I have an account on a hosting service provider.

They have a server with a lot of clients... and there, each client has his own
Apache binary compiled with PHP 4.

They also offer MySQL... but they only have ONE server for all their customers,
and so, they just offer one db to each one.

I need to have a lot of different db, so I compiled my own MySQL on the server

The General MySQL runs at port 3310
I compiled my own MySQL to run at port 3311

I tried it with php, conecting to localhost:3311 and it works fine (with
phpMyAdmin)...

Now, the question is:
Should I do something special with my Apache/php?

I generally compile my PHP with the --with-mysql=/path/to/mysql

But now I am using normally the preinstalled PHP on the server without
any problem...

Should I recompile my php and tell to the ./configure script the path where my
own MySQL is? or it isn't necesary?

Thanks!

Pablo Pasqualino
Mar del Plata, Argentina
http://www.marplatense.com






Addressed to: Floyd Baker <[EMAIL PROTECTED]>
              [EMAIL PROTECTED]

** Reply to note from Floyd Baker <[EMAIL PROTECTED]> Thu, 01 Mar 2001 16:39:23 -0500
>
>
>
> Hi..  We have a city map using co-ordinates to link to specific info on various
> buildings, etc.  The links bring up an information page with data and photos for
> each building locations on the map.
>
> My question is, when this information page is accessed from another direction,
> say a menu, can there be a link that operates in 'reverse', back to the map and
> the building in question?   We still want people to see the map, relating to a
> specific building, whether they start there or end up there.
>
> I thought the map could perhaps position itself so that the point of interest is
> always in the center, or that it blinks, or has a arrow pointing to it.  It
> doesn't matter what the final display looks like, just that is shows a
> particular location clearly.


If you have a small number of locations <100 or so, and you only want to
show one at a time, I'd seriously consider just making 100 maps with
markers on them, and sending the right one when needed.  This will be
much faster to serve as there is no graphic processing involved.

If you want to be able to have multiple random selections where more
than one location is shown on a map, you are stuck generating them on
the fiy.  I would start with a stock map and use GD to draw a marker
over the top of it for each location you want to hilite.  In each of
your database records you would record the x and y coordinates of the
point on the map where the building is located.

If you want to build maps with various center points and scales, and be
able to plot buildings on it, you will want to store the lat and lon of
the building, and store everything else using lat/lon.  If you are going
to do this, look for someone very good with geometry to design the math.
It can get tricky trying to show a section of a sphere on a flat
screen.



Rick Widmer
Internet Marketing Specialists
http://www.developersdesk.com




hello.

i'm having a little bit of problems with a little mysql table i'm using. the
table has no primary key nor index nor nothing.

i was wondering if it's possible to select the last inserted record of a
table with this characteristics.

i've been trying but with no good results.

thanks for all the help you can provide,

romina
A paranoid is someone who knows a little of what's going on





Hello,

need some help. i need to take an HTML file that is written by a user in a
very bad format, for instance:

    <font class="sometihng" style="....">Hi!</font>

and get the following:

    <font>Hi!</font>


i tried to look at "strip_tags" but then it only returns me:


    Hi!


thanks in advance/erick



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.230 / Virus Database: 111 - Release Date: 25-Jan-01







Hi Erick,

@ 12:22:39 AM on 3/3/2001, [EMAIL PROTECTED] wrote:

> i tried to look at "strip_tags" but then it only returns me:

http://www.php.net/manual/en/function.strip-tags.php

string strip_tags (string str [, string allowable_tags])

"Note: Allowable_tags was added in PHP 3.0.13, PHP4B3."

-Brian
--
 Please do not carbon copy me on list replies.






Hi,

I'm sorry for this OT question, but I need to configure 
apache to emit 503 accross the whole server _except_ in 
two directories. I thought I'd use 

RedirectMatch 503 ^/(?!docs|error)

but Apache fails to start with "Regular expression could 
not be compiled." It doesn't grok the assertion. How can 
I achieve this behavior?

please, cc me, I'm not on the list

TIA

kefir



Reply via email to