php-general Digest 27 Nov 2001 06:00:23 -0000 Issue 1018
Topics (messages 75727 through 75747):
Re: php-general Digest 23 Nov 2001 14:10:17 -0000 Issue 1011
75727 by: Andrew Chase
Re: preventing multiple submissions
75728 by: Neil Freeman
Objects and sessions
75729 by: Greg Sidelinger
75730 by: Tamas Arpad
75739 by: Christopher William Wesley
Which 'make' is needed for linux to install php?
75731 by: Joelmon2001.aol.com
75733 by: Craig Vincent
75734 by: Joelmon2001.aol.com
Re: [PHP-DB] postgres optimization
75732 by: Martín Marqués
Re: Installing PHP 4 on a RAQ3
75735 by: Phil Ewington
Re: Need a script that will read Apache Log files and generate reports
75736 by: Chris Allen
php & frontpage
75737 by: Tobe Johnson - Johnsons
75738 by: Brandon Lamb
Info : L'Annuaire Francais par Departement facilite vos recherches
75740 by: annuaire.annuairefrancais.com
Re: SQL in Function
75741 by: Mark Roedel
addslashes, stripslashes
75742 by: Scott Aikin
75743 by: Pat Lashley
Updating Timestamps
75744 by: cosmin laslau
75745 by: Kurt Lieber
75746 by: David Robley
Selecting databases
75747 by: Marts
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]
----------------------------------------------------------------------
--- Begin Message ---
You might want to give 'wget' a try - it's a GNU utility for downloading
mirrors of web sites:
http://www.gnu.org/software/wget/wget.html
If you use it with the '-r' and '-k' options it will crawl your site
recursively, and convert absolute links to relative ones in the downloaded
HTML files.
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]
> Sent: Friday, November 23, 2001 6:10 AM
> To: [EMAIL PROTECTED]
> Subject: php-general Digest 23 Nov 2001 14:10:17 -0000 Issue 1011
>
>
>
> php-general Digest 23 Nov 2001 14:10:17 -0000 Issue 1011
>
> Topics (messages 75546 through 75577):
>
> Missing PHP.ini
> 75546 by: John Monfort
> 75547 by: Joseph Blythe
> 75548 by: Martin Towell
> 75549 by: John Monfort
> 75551 by: David Robley
>
> Re: error handling and __LINE__
> 75550 by: Papp Gyozo
>
> Re: SQL in Function
> 75552 by: David Robley
>
> strip php out of html
> 75553 by: Joseph Blythe
> 75554 by: David Robley
> 75555 by: Michael Sims
> 75556 by: Joseph Blythe
> 75558 by: Joseph Blythe
>
> Object Persistence like Resource Persistence already implemented?
> 75557 by: Yermo M. Lamers
>
> MySQL query problem!
> 75559 by: De Necker Henri
> 75561 by: David Robley
> 75562 by: De Necker Henri
> 75564 by: David Robley
>
> Re: GD, PNG
> 75560 by: Yamin Prabudy
> 75563 by: Joseph Blythe
>
> read file
> 75565 by: PHP Newbie
> 75566 by: Andrey Hristov
>
> HTTP_REFERER
> 75567 by: Jordan Elver
> 75568 by: gaouzief
> 75569 by: Sebastian Wenleder
> 75570 by: Matt Williams
> 75572 by: Jordan Elver
> 75573 by: Matt Williams
> 75577 by: Jordan Elver
>
> file upload troubles
> 75571 by: Nikola Veber
> 75574 by: fitiux
>
> php->html
> 75575 by: Christoph Starkmann
>
> upload problems
> 75576 by: Nikola Veber
>
> 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]
>
>
> ----------------------------------------------------------------------
>
--- End Message ---
--- Begin Message ---
Have a look at:
http://www.faqts.com/knowledge_base/view.phtml/aid/863/fid/129
May be of some use.
Neil
Derek Mailer wrote:
> I have a problem with a form on my website.
>
> it's part of a shopping cart application, whereby the form consists of a list of
>products and the user enters the quantity they require of each product in the field
>provided. Everything works okay except for the fact that if someone hits the submit
>button more than once the products will be added to the 'cart' more than once.
>
> I've tried altering the script that handles the posted form info, but the problem
>persists. I've also simplified the page that loads after adding products to the
>shopping cart so that it loads quicker (people are less likely to click the submit
>button more than once).
>
> Can anyone suggest a solution?
>
> Thanks in advance for any help.
>
> Regards,
>
> Derek
>
> **********************************************************************************
> This e-mail (and any attachment) is intended only for the attention
> of the addressee(s). Its unauthorised use, disclosure, storage
> or copying is not permitted. If you are not the intended recipient,
> please destroy all copies and inform the sender by return e-mail.
> This e-mail (whether you are the sender or the recipient) may be
> monitored, recorded and retained by Business Information
> Publications Limited (BiP). E-mail monitoring/ blocking software
> may be used, and e-mail content may be read at any time.You
> have a responsibility to ensure laws are not broken when composing
> or forwarding e-mails and their contents.
> **********************************************************************************
>
> ***************************************************************
> This message was virus checked with: SAVI 3.51
> last updated 20th November 2001
> ***************************************************************
--
--------------------------------
Email: [EMAIL PROTECTED]
[EMAIL PROTECTED]
--------------------------------
--- End Message ---
--- Begin Message ---
Can someone tell me how to store a class in a session var. I want to
test to see if it has been defined and if not create it. I'm having
problems with it right now.
This is what I'm trying currently
<?
Class a
{
var $temp;
function a()
{
$this->temp=1;
}
}
session_start();
if ( !isset( $c )
{
$c = new a();
session_register("a");
}
?>
later on I get errors about the class functions being undefined. Can
anyone please point me in the right direction on how to register my
objects as session vars.
--- End Message ---
--- Begin Message ---
> later on I get errors about the class functions being undefined.
> Can anyone please point me in the right direction on how to
> register my objects as session vars.
Class definition *must* be before any session_start() or
sessgion_register() if there are previously stored objects in the
session.
Regards,
Arpi
--- End Message ---
--- Begin Message ---
On Mon, 26 Nov 2001, Greg Sidelinger wrote:
> Can someone tell me how to store a class in a session var. I want to
There are several things you need to do.
1) include the class definition before you do anything
2) start the session shortly thereafter
3) register a session variable
4) create your object
5) serialize your object
6) store the serialized object (now a string) in your registered session
variable
Then to use the object again, you just have to
7) start the session back up
8) get the serialized value of your object from the registered session
variable
9) unserialize the string value back into an object
Wanna see how this works? I have a trivial example below, which involves
3 files.
- chair.class is my class definition.
- chair1.php sets up the session, creates the object, serializes and
stores it in a registered session variable.
- chair2.php gets the session variable's value, unserializes it, and uses
the object again.
-- chair.class
<?php
class chair{
// DATA MEMBERS
var $num_legs;
var $num_arms;
// CONSTRUCTOR
function chair( $legs = 3, $arms = 0 ){
$this->num_legs = $legs;
$this->num_arms = $arms;
}
// SETTERS
function setLegs( $legs ){
$this->num_legs = $legs;
return true;
}
function setArms( $arms ){
$this->num_arms = $arms;
return true;
}
// GETTERS
function getLegs( ){
return $this->num_legs;
}
function getArms( ){
return $this->num_arms;
}
}
?>
-- chair1.php
<?php
include( "chair.class" );
session_start();
$myChair = new chair( 5, 3 );
print( "My chair has " . $myChair->getLegs() . " legs, and " .
$myChair->getArms() . " arms." );
$serChair = serialize( $myChair );
session_register( "aChair" );
$aChair = $serChair;
?>
-- chair2.php
<?php
include( "chair.class" );
session_start();
$myChair = unserialize( $aChair );
print( "My chair has " . $myChair->getLegs() . " legs, and " .
$myChair->getArms() . " arms." );
?>
g.luck,
~Chris /"\
\ / September 11, 2001
X We Are All New Yorkers
/ \ rm -rf /bin/laden
--- End Message ---
--- Begin Message ---
I learned I need 3.8 at least gnu make for installing this freetype
which seems mandatory for good fonts with gd/php image creation
ok, so that made me think, which 'make' version on linux (raq 3 fyi)
would one need for php 4+?
I figure it's best to ask then to assume I have what it takes
Thanks for your time
Joel
--- End Message ---
--- Begin Message ---
> I learned I need 3.8 at least gnu make for installing this freetype
> which seems mandatory for good fonts with gd/php image creation
>
> ok, so that made me think, which 'make' version on linux (raq 3 fyi)
> would one need for php 4+?
I currently use 3.79.1 of GNU make (Linux slackware and redhat) and have
never had a problem with any version of PHP (3.x or 4.x)
Sincerely,
Craig Vincent
--- End Message ---
--- Begin Message ---
I use 3.7+ that's why I need confirmation, you are using a newer version
I dont' want to untar and find out it's expired, my version of make, that's
all
Thanks
--- End Message ---
--- Begin Message ---
http://candle.pha.pa.us/main/writings/pgsql/hw_performance/index.html
check this out!
On Lun 26 Nov 2001 09:40, you wrote:
> Browse the Linux Journal archives. Sometime this year there was an article
> on tunig PGSQL for performance.
> Miles Thompson
>
> At 02:45 PM 11/26/2001 +0800, you wrote:
> >hi,
> >
> >for php-db list users, i'm not sure if this is off-topic. please
> >inform me if it is.
> >
> >i'd like to ask anyone who have worked with PostgreSQL
> >for any advise on how to optimize its performance.
> >i have a database that has a few tables. one of which
> >may contain more than 50,000 records in the future.
> >
> >thanks!
> >
> >ric
> >
> >--
> >
> >==================================================================
> >Note: The information contained in this message may be privileged
> >and confidential and protected from disclosure. If the reader of
> >this message is not the intended recipient, or an employee or agent
> >responsible for delivering this to the intended recipient, you are
> >hereby notified that any dissemination, distribution or copying of
> >this communication is strictly prohibited. If you have received
> >this communication in error, please notify us immediately by
> >replying to the message and deleting it from your computer.
> >Thank you.
> >==================================================================
> >
> >
> >--
> >PHP Database 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]
--
Porqué usar una base de datos relacional cualquiera,
si podés usar PostgreSQL?
-----------------------------------------------------------------
Martín Marqués | [EMAIL PROTECTED]
Programador, Administrador, DBA | Centro de Telematica
Universidad Nacional
del Litoral
-----------------------------------------------------------------
--- End Message ---
--- Begin Message ---
Followed those instructions and apache gives an error when I restart:
Syntax error on line 33 of /etc/httpd/conf/httpd.conf:
Cannot load /usr/lib/apache/libphp4.so into server:
/usr/lib/apache/libphp4.so: cannot open shared object file: No such file or
directory
/usr/sbin/httpd
I have looked in /usr/lib/apache/ and all that is there is libperl.so, where
is it, and how can I find it? Help!!, Please :o)
-------------------------
Phil Ewington
Cold Fusion Developer
-------------------------
T: 01344 643138
E: mailto:[EMAIL PROTECTED]
-------------------------
> -----Original Message-----
> From: Philip Olson [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, November 25, 2001 6:50 PM
> To: Phil Ewington
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] Installing PHP 4 on a RAQ3
>
>
> Hello Phil,
>
> I've seen this come up a few times, search the archives for a bit:
>
> http://marc.theaimsgroup.com/?l=php-general&s=raq
>
> The following comes up and may be useful. Don't hesitate to reply back on
> how helpful it is, perhaps eventually some raq instructions can
> make their
> way into installation section of manual. Try:
>
> HOWTO: Installation on Cobalt RaQ (RaQ3 or RaQ4) :
> ------------------------------------------------------------
> http://marc.theaimsgroup.com/?l=php-general&m=98039640119670
>
> Also, the manual's install instructions should be of some use:
>
http://www.php.net/manual/en/install.unix.php
regards,
Philip Olson
On Sun, 25 Nov 2001, Phil Ewington wrote:
> Hi,
>
> As I have only ever worked on a Windows platform, installing PHP & MySQL
on
> a RAQ3 is completely alien to me. I attempted to install the binaries by
> following instructions I dug up somewhere, and it all went badly wrong :o(
>
> I have since had the RAQ reset so I could start again. This time round I
> installed the RaQ3-RaQ4-MySQL-3.23.37-1.pkg from cobalt, this went on OK,
> but now I need to install PHP. As there is no .pkg for the RAQ3, I have
been
> advised that I do need to install the binaries for PHP 4. Do I need to
give
> a path for the --with mysql option, and if so where does the .pkg install
> MySQL? Any idiot proof step by step instructions will be greatly
> appreciated, along with which is the best/most stable version of PHP 4?,
and
> where is best to install it?
>
> Thanks in advance,
>
> Phil.
>
> -------------------------
> Phil Ewington
> Cold Fusion Developer
> -------------------------
> T: 01344 643138
> E: mailto:[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]
>
--- End Message ---
--- Begin Message ---
http://www.analog.cx/
Subject: [PHP] Need a script that will read Apache Log files and generate
reports
--- End Message ---
--- Begin Message ---
I am trying to use PHP3.x and Front Page 2000. I am able to get it to work
o.k. in Frontpage. However, when I rename my *.htm page to a *.php3 page
and click 'Save', it drops all the theme information when I upload it to my
server. Is there an easy way to stop this from happening? I'm not sure if
this is a php issue or a FrontPage issue.
Thanks for any help you can provide. I saw several references to php and
FrontPage in researching this issue, but didn't come across this specific
thing.
Tobe
--- End Message ---
--- Begin Message ---
Why are you even using frontpage themes? If you know how to program PHP you
should be above using MS frontpage features... Frontpage is good for a
WYSIWYG editor, but I highly recommend NOT using its proprietary features...
use CSS or something...
Brandon L.
----- Original Message -----
From: "Tobe Johnson - Johnsons" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, November 26, 2001 2:23 PM
Subject: [PHP] php & frontpage
I am trying to use PHP3.x and Front Page 2000. I am able to get it to work
o.k. in Frontpage. However, when I rename my *.htm page to a *.php3 page
and click 'Save', it drops all the theme information when I upload it to my
server. Is there an easy way to stop this from happening? I'm not sure if
this is a php issue or a FrontPage issue.
Thanks for any help you can provide. I saw several references to php and
FrontPage in researching this issue, but didn't come across this specific
thing.
Tobe
--
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]
--- End Message ---
--- Begin Message ---
Bonjour,
L'annuaire Francais Par departement http://www.annuairefrancais.com integre desormais
un moteur de recherche pour affiner vos recherches sur le web.
L'inscription reste gratuite et la validation toujours manuelle. L'adresse
d'inscription est desormais http://inscrip.annuairefrancais.com
Pour toutes suggestions contactez par mail :
direction : [EMAIL PROTECTED]
validation : [EMAIL PROTECTED]
publicite : [EMAIL PROTECTED]
partenariat : [EMAIL PROTECTED]
INFORMATIONS :
retrait de notre liste d'info : http://supressinfo.annuairefrancais.com
(L'annuaire francais envoi 2 infos par an)
L'annuaire Francais
119 Rue des Pyrenees
75020 PARIS
+33 (0)1 43 67 00 74
--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: Oosten, Sjoerd van [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, November 22, 2001 2:01 AM
> To: '[EMAIL PROTECTED]'
> Subject: [PHP] SQL in Function
>
>
> function Activeyesno($month,$day,$year,$Project_id){
> $dayactief = mktime(0, 0, 0, $month, $day, $year);
> $daytemp = date("Y-m-d", $dayactief);
> $resultactive = mysql_query("SELECT * FROM EIAProjecten WHERE
> ((Project_begindatum >= '$daytemp' AND Project_id = '$Project_id') OR
> (Project_einddatum <= '$daytemp' AND Project_id =
'$Project_id'))",$db);
>
> $num_rows = mysql_num_rows($resultactive);
> if ($num_rows == '1'){
> return "red"; }
> }
>
> 1. Is it possible to make a sql connection in my function
Yes.
> 2. did i do something wrong?
Yes.
The thing you have to remember is that your database link identifiers,
etc., follow the same rules of scope as any other variable (and thus,
need to either be passed into your function as parameters or declared as
global).
Specifically, in your case, the $db variable referenced in your
mysql_query() call doesn't appear to have a value that's local to this
function.
---
Mark Roedel | "Blessed is he who has learned to laugh
Systems Programmer | at himself, for he shall never cease
LeTourneau University | to be entertained."
Longview, Texas, USA | -- John Powell
--- End Message ---
--- Begin Message ---
I've come across a strange problem working backwards with stripslashes after running
addslashes. I take a string like:
"\t\4"
and run it through addslashes, the result is:
\\t\\4
After grabbing this data from the database and running 'stripslashes', the data comes
out as:
"\t"
without the \4, for some reason stripslashes always removes any combination of \ and a
number. Does anybody know a way around this or can maybe provide some insight about
why this is happening?
Thank you!!!
- Scott
--- End Message ---
--- Begin Message ---
--On Monday, November 26, 2001 04:47:35 PM -0800 Scott Aikin
<[EMAIL PROTECTED]> wrote:
> I've come across a strange problem working backwards with stripslashes
> after running addslashes. I take a string like:
>
> "\t\4"
>
> and run it through addslashes, the result is:
>
> \\t\\4
>
> After grabbing this data from the database and running 'stripslashes',
> the data comes out as:
>
> "\t"
>
> without the \4, for some reason stripslashes always removes any
> combination of \ and a number. Does anybody know a way around this or
> can maybe provide some insight about why this is happening?
It probably isn't removing it, it's converting it into an EOT
character (0x04). That's pretty standard for most environments
that do backslash substitution. It should also convert \48 and
\060 into a '0' character. (The first being decimal, the second
octal due to the leading zero.)
-Pat
--- End Message ---
--- Begin Message ---
I'm using timestamps (God bless the little things) to keep track of database
updates, so to give users the latest updates by the second. Kinda neat. But
anyway, the timestamps are in one table, and when something is that table is
changed, it automatically updates.
However, I have another table which I want to affect the timestamps. Is
there a command for 'manually' updating a timestamp rather than by SQL's own
logic?
Thanks in advance.
Cosmin Laslau
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
--- End Message ---
--- Begin Message ---
This is more of a MySQL question than a PHP question, but...
The TIMESTAMP format in MySQL isn't a read-only field -- you can update the
data with your own timestamp information just like you can any other normal
database field. So, simply create a timestamp using PHP and insert that into
the field in MySQL.
--kurt
On Monday 26 November 2001 07:27 pm, cosmin laslau wrote:
> I'm using timestamps (God bless the little things) to keep track of
> database updates, so to give users the latest updates by the second. Kinda
> neat. But anyway, the timestamps are in one table, and when something is
> that table is changed, it automatically updates.
>
> However, I have another table which I want to affect the timestamps. Is
> there a command for 'manually' updating a timestamp rather than by SQL's
> own logic?
--- End Message ---
--- Begin Message ---
On Tue, 27 Nov 2001 13:57, cosmin laslau wrote:
> I'm using timestamps (God bless the little things) to keep track of
> database updates, so to give users the latest updates by the second.
> Kinda neat. But anyway, the timestamps are in one table, and when
> something is that table is changed, it automatically updates.
>
> However, I have another table which I want to affect the timestamps. Is
> there a command for 'manually' updating a timestamp rather than by
> SQL's own logic?
>
> Thanks in advance.
>
> Cosmin Laslau
The Mysql docs say:
Automatic updating of the rst TIMESTAMP column occurs under any of the
following conditions:
The column is not specified explicitly in an INSERT or LOAD DATA INFILE
statement.
The column is not specified explicitly in an UPDATE statement and some
other column changes value. (Note that an UPDATE that sets a column to
the value it already has will not cause the TIMESTAMP column to be
updated, because if you set a column to its current value, MySQL ignores
the update for efficiency.)
You explicitly set the TIMESTAMP column to NULL. TIMESTAMP columns
other than the first may also be set to the current date and time. Just
set the column to NULL or to NOW().
You can set any TIMESTAMP column to a value different than the current
date and time by setting it explicitly to the desired value. This is true
even for the rst TIMESTAMP column.
You can use this property if, for example, you want a TIMESTAMP to be set
to the current date and time when you create a row, but not to be changed
whenever the row is updated later:
Let MySQL set the column when the row is created. This will initialize
it to the current date and time.
When you perform subsequent updates to other columns in the row, set
the TIMESTAMP column explicitly to its current value.
On the other hand, you may find it just as easy to use a DATETIME column
that you initialize to NOW() when the row is created and leave alone for
subsequent updates.
TIMESTAMP values may range from the beginning of 1970 to sometime in the
year 2037, with a resolution of one second. Values are displayed as
numbers.
--
David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA
WWhhaatt ddooeess dduupplleexx mmeeaann??
--- End Message ---
--- Begin Message ---
Hay all,
I have a script that needs to be able to choose between 3 different
databases related to a pull down menu. Any ideas about what functions I
should be looking at
CHeers,
Marty ;)
--- End Message ---