|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
php-general Digest 4 Feb 2004 14:46:45 -0000 Issue 2570
php-general-digest-help
lists.php.net
Date: Wed Feb 04 2004 - 08:46:45 CST
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
php-general Digest 4 Feb 2004 14:46:45 -0000 Issue 2570
Topics (messages 176745 through 176794):
PEAR DB::isError acting strange
176745 by: David Clymer
Re: Document generation from XML
176746 by: Russell Seymour
176748 by: Greg Beaver
176750 by: daniel.electroteque.org
What should the permissions on a PHP file be?
176747 by: Pooya Eslami
176749 by: John Nichel
176751 by: Pooya Eslami
176753 by: John Taylor-Johnston
176757 by: John Nichel
Need to refine this:
176752 by: John Taylor-Johnston
176756 by: Jason Wong
176759 by: John Taylor-Johnston
176760 by: Douglas Douglas
176761 by: Adam Bregenzer
176762 by: John Taylor-Johnston
Re: authentication comparing to /etc/passwd
176754 by: John Taylor-Johnston
176755 by: John Taylor-Johnston
176777 by: Burhan Khalid
Re: Sendmail wrapper
176758 by: Manuel Lemos
newbie pls help
176763 by: Mrs. Geeta Thanu
176764 by: Raditha Dissanayake
176765 by: Jordan S. Jones
Re: Zlib Compression || Implementation || Bandwidth Savings?
176766 by: rush
[Newbide Guide] For the benefit of new members
176767 by: Ma Siva Kumar
PEAR DB 1.6.0RC4 released
176768 by: Daniel Convissor
Is there a PHP Style Sheet Switcher that doesn't reload pages?
176769 by: Freedomware
176770 by: Raditha Dissanayake
Date comparison
176771 by: BEOI 7308
176776 by: Burhan Khalid
176778 by: Michael Nolan
Re: Is there a PHP Style Sheet Switcher that doesn't reload
176772 by: Freedomware
176773 by: Adam Bregenzer
PDFlib, transparency and TIFF images
176774 by: Victor Spång Arthursson
PHP & MYSQL Drop Down Select Box
176775 by: Junaid Saeed Uppal
176786 by: Raditha Dissanayake
Slightly OT! PHP / HTML Editor for Linux
176779 by: Shaun
176780 by: Jay Blanchard
176787 by: Raditha Dissanayake
[ERR] RE: [PHP] Re: authentication comparing to /etc/passwd
176781 by: postmaster.hanmir.com
[ERR] RE: [PHP] Date comparison
176782 by: postmaster.hanmir.com
Re: Issue with 'W' in the date() function?
176783 by: Ford, Mike [LSS]
session problem
176784 by: marc serra
176788 by: Jason Wong
176789 by: Ford, Mike [LSS]
Re: R: [PHP] SQL Query Not Kosher?
176785 by: Ford, Mike [LSS]
Use of Class Reference Variable in another Class
176790 by: news.php.net
Session troubles
176791 by: DL
176793 by: Ford, Mike [LSS]
176794 by: Larry Brown
Recommendation on PHP encoder please
176792 by: Harry Sufehmi
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:
I'm having some problems with the DB::isError function identifying a
non-object as an error object (or so it seems). I'm using postgreSQL
7.3.x. The relevant code is below:
/*******************[ my code start ]***********************/
$sql_queries = array();
$sql_queries[0] = 'BEGIN';
$sql_queries[1] = "INSERT INTO domain (name,table_name)
VALUES('$domainname','$tablename')";
$sql_queries[2] = 'CREATE TABLE ' . $tablename . '_account ()
INHERITS (domain_account_template)';
$sql_queries[3] = 'CREATE TABLE ' . $tablename . '_alias () INHERITS
(domain_alias_template)';
$sql_queries[4] = 'CREATE TABLE ' . $tablename . '_option ()
INHERITS (domain_account_template)';
$sql_queries[5] = 'END';
// go though and execute all the queries (it fails on the
// first one
foreach($sql_queries as $query)
{
// show me which query is executing
echo $query . "<br/>";
$result = $db->query($query);
// this tells me that $result is an integer == 1 and
// so is DB_OK, which I believe the code above is returning
echo getType($result) . ": " . $result . ": " . DB_OK . "<br/>";
//this test tells me that it is NOT an object
if(is_object($result)) { echo "its an object."; }
else {echo "its NOT an object"; }
//this always ends up as true, because it executes the code
//in this block
if(DB::isError($result));
{
//at this point, I get a fatal error saying that I'm
//attempting to call a member function on a non-object
$error = $result->getMessage() . $result->getDebugInfo();
$db->query('ABORT');
die($error);
}
}
/********************[ my code end ]***********************/
now, when I looked at the DB::isError code, it looked like so:
/**
* Tell whether a result code from a DB method is an error
*
*
param int $value result code
*
*
return bool whether $value is an error
*
*
access public
*/
function isError($value)
{
return (is_object($value) &&
(get_class($value) == 'db_error' ||
is_subclass_of($value, 'db_error')));
}
So, it seems, that although I've already found (in my code) that the
variable in question is NOT an object, isError STILL finds that it is
not only an object, but is an object of class db_error!
I'm really confused. Clearly I'm missing something here. Does anyone
have any pointers for me?
-davidc
attached mail follows:
Ray,
I can create the XML of the document that I want to generate using the built
in XML functions in PHP.
THe thing I then want to do is be able to do is then use that XML to create
documents in multiple formats, e.g. PDF.
I think that I can use DocBook or Apache FO to do this, but I am not sure
which one to use or how to go about doing it.
Basically I want to be abel to speciy an output format and run the XML
through a transformation to get that format.
Does that make any more sense?
Russell
----- Original Message -----
From: "Ray Hunter" <bigdog
venticon.com>
Newsgroups: php.general
To: <php-general
lists.php.net>
Sent: Tuesday, February 03, 2004 8:56 PM
Subject: Re: [PHP] Document generation from XML
> On Tue, 2004-02-03 at 13:50, Russell Seymour wrote:
> > In the beginning only one output format was required, HTML and then PDF
was
> > a requirement. More and more formats are now required by my users and
> > rather than create a new output script for each different format I am
> > thinking about outputting the final report as XML and then putting that
> > through 'something' to render in the format that I require.
> >
> > However I am unclear as to the best way to do this as there seems to be
many
> > different ways. I have looked at using Apache FOP and DocBook, but they
all
> > spawn off in different directions and bringing in other things such as
Jade.
>
> You can create xml with various extensions in php. You can use sax or
> dom to do that or create your own strings that contain xml syntax. I
> have done both. What are you really trying to do? Create an xml file
> from various data sources? Or create an xml file from another xml file?
>
> --
> Ray
"Ray Hunter" <bigdog
venticon.com> wrote in message
news:1075841770.26428.15.camel
bigdog.info.trw.com...
> On Tue, 2004-02-03 at 13:50, Russell Seymour wrote:
> > In the beginning only one output format was required, HTML and then PDF
was
> > a requirement. More and more formats are now required by my users and
> > rather than create a new output script for each different format I am
> > thinking about outputting the final report as XML and then putting that
> > through 'something' to render in the format that I require.
> >
> > However I am unclear as to the best way to do this as there seems to be
many
> > different ways. I have looked at using Apache FOP and DocBook, but they
all
> > spawn off in different directions and bringing in other things such as
Jade.
>
> You can create xml with various extensions in php. You can use sax or
> dom to do that or create your own strings that contain xml syntax. I
> have done both. What are you really trying to do? Create an xml file
> from various data sources? Or create an xml file from another xml file?
>
> --
> Ray
attached mail follows:
Hi Russell,
If you're documenting PHP software, you might consider using
phpDocumentor. Your manual would be in DocBook, and phpDocumentor would
both transform to HTML/PDF/CHM, and link to the auto-parsed API docs
straight from the source. Kind of handy for people who'd rather code
than figure out where things have changed :)
Greg
--
phpDocumentor
http://www.phpdoc.org
Russell Seymour wrote:
> Good evening list,
>
> I apologise profusely if after reading anyone thinks that is OT, but I
> relally need some pointers with a project I am working on. I have searched
> the Internet for information on XML document generation but there is too
> much information that I cannot decide which way to go. Thanks lots in
> advance.
>
> I am currently writing a web based application using PHP that created
> reports on the fly from a multitude of data sources.
>
> In the beginning only one output format was required, HTML and then PDF was
> a requirement. More and more formats are now required by my users and
> rather than create a new output script for each different format I am
> thinking about outputting the final report as XML and then putting that
> through 'something' to render in the format that I require.
>
> However I am unclear as to the best way to do this as there seems to be many
> different ways. I have looked at using Apache FOP and DocBook, but they all
> spawn off in different directions and bringing in other things such as Jade.
>
> This post maybe slightly OT, but if nayone has any pointers on how I amy go
> about doing this I would be very very grateful.
>
> Thanks very much.
>
> Russell
attached mail follows:
> Hi Russell,
>
> If you're documenting PHP software, you might consider using
> phpDocumentor. Your manual would be in DocBook, and phpDocumentor
> would both transform to HTML/PDF/CHM, and link to the auto-parsed API
> docs straight from the source. Kind of handy for people who'd rather
> code than figure out where things have changed :)
>
> Greg
> --
> phpDocumentor
> http://www.phpdoc.org
>
What do u mean the manual would be in Docbook, how do i get it in docbook ?
I would like to fill the generated docs with more info than is already
there, including diagrams, flow charts , object framework diagrams. I also
have trouble with the headers of my scripts, here is an example of one
/**
*
author Dan Rossi <email>
*
version $Id: index.php,v 1.00 2003/05/21
* Shotlist Data Entry Interface
* This script handles the data entry of new shotlist tapes
* it also handles the editing and updating of current shotlist entries.
*/
Althought the description will only get parsed if there is an include above
and the header gets generated with the include statement, how can i fix
this ?
attached mail follows:
I need to know what is the most secure and reliable way to put permissions
on a .php file.
I usually put it as rw-r-r, is this good or is there a better way of
arranging the permissions?
attached mail follows:
Pooya Eslami wrote:
> I need to know what is the most secure and reliable way to put permissions
> on a .php file.
> I usually put it as rw-r-r, is this good or is there a better way of
> arranging the permissions?
>
Depends on your environment. I usually have mine set up as rw-rw----
(directories as rwxrwx---) with the owner the same as what my webserver
runs as (apache), and group writable so that multiple people can edit
them. Even if you're the only one who is going to edit the files, and
you're the owner of the files and you're set up rw-r--r--, you may run
into problems if php/Apache needs to write to the file (unless Apache is
running as you).
--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
attached mail follows:
> > I need to know what is the most secure and reliable way to put
permissions
> > on a .php file.
> > I usually put it as rw-r-r, is this good or is there a better way of
> > arranging the permissions?
> >
>
> Depends on your environment. I usually have mine set up as rw-rw----
> (directories as rwxrwx---) with the owner the same as what my webserver
> runs as (apache), and group writable so that multiple people can edit
> them. Even if you're the only one who is going to edit the files, and
> you're the owner of the files and you're set up rw-r--r--, you may run
> into problems if php/Apache needs to write to the file (unless Apache is
> running as you).
Well, I want to have the most security for my .php file because it stores
passwords. Besides if there is no permissions set for the 'world' how can
someone's browser use the .php file? shouldn't it atleast have a read or
execute (I'm not sure, please comment on this) persmission?
attached mail follows:
rw-r-r should do it. Permissions really only become an issue using Perl. PHP is very accomodating that way.
Pooya Eslami wrote:
> I need to know what is the most secure and reliable way to put permissions
> on a .php file.
> I usually put it as rw-r-r, is this good or is there a better way of
> arranging the permissions?
attached mail follows:
Pooya Eslami wrote:
>>>I need to know what is the most secure and reliable way to put
>
> permissions
>
>>>on a .php file.
>>>I usually put it as rw-r-r, is this good or is there a better way of
>>>arranging the permissions?
>>>
>>
>>Depends on your environment. I usually have mine set up as rw-rw----
>>(directories as rwxrwx---) with the owner the same as what my webserver
>>runs as (apache), and group writable so that multiple people can edit
>>them. Even if you're the only one who is going to edit the files, and
>>you're the owner of the files and you're set up rw-r--r--, you may run
>>into problems if php/Apache needs to write to the file (unless Apache is
>>running as you).
>
>
> Well, I want to have the most security for my .php file because it stores
> passwords. Besides if there is no permissions set for the 'world' how can
> someone's browser use the .php file? shouldn't it atleast have a read or
> execute (I'm not sure, please comment on this) persmission?
>
No, it's the webserver which is serving up the file; the client doesn't
come into play for permissions. Technically, the file only needs to be
r-------- with the owner of the file as same as the what the web server
is running as. However, you won't be able to write to it (unless you're
root). My suggestion would be, if you're going to be the only one
editing the file....
1) Make the owner of the file you
2) Make the group of the file the same as your webserver
3) Set the permissions to 640 (rw-r-----)
4) Place it in a directory outside of the webserver's document root
5) Make yourself the owner of the directory, and group the same as the
webserver.
6) Set permissions on the directory as 750 (rwxr-x---)
--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
attached mail follows:
Hi,
I need to refine this. I'm tired ... long day.
I would like to echo $mydata->district only once unless it changes.
echo "<table>\n";
while ($mydata = mysql_fetch_object($glquery))
{
#----- if $mydata->district is different, then
echo "<tr bgcolor=\"#CCCCCC\"><td>$mydata->district</td><td></td><td></td></tr>\n";
echo "<tr bgcolor=\"#CCCCCC\"><td>$mydata->city</td>
<td>$mydata->place</td>
<td>$mydata->meetingtime</td></tr>\n";
}
echo "</table>\n";
Clarity anyone :)
Thanks,
J
attached mail follows:
On Wednesday 04 February 2004 12:56, John Taylor-Johnston wrote:
Please use a meaningful subject.
> I need to refine this. I'm tired ... long day.
You're tired so you want others to do your work?
> I would like to echo $mydata->district only once unless it changes.
Maintain a 'flag' which stores 'previous' value of $mydata-district. If 'flag'
and $mydata-district differ print $mydata-district and update 'flag'.
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
People never lie so much as after a hunt, during a war, or before an election.
-- Otto Von Bismarck
*/
attached mail follows:
Jason,
> You're tired so you want others to do your work?
No ...
> Maintain a 'flag' which stores 'previous' value of $mydata-district. If 'flag'
> and $mydata-district differ print $mydata-district and update 'flag'.
I cannot declare $temp = $mydata->district; outside while ($mydata so ... ?
I'm missing something in my logic. That's why I asked.
It wouldn't make sense to declare this twice:
while ($mydata = mysql_fetch_object($myquery))
$temp = "";
echo "<table>\n";
while ($mydata = mysql_fetch_object($myquery))
{
$temp = $mydata->district;
while ($temp <> $mydata->region)
{
echo "<tr bgcolor=\"#CCCCCC\"><td>$mydata->district</td></tr>\n";
}
echo "<tr bgcolor=\"#CCCCCC\"><td>$mydata->city</td>
<td>$mydata->place</td>
<td>$mydata->meetingtime</td></tr>\n";
}
echo "</table>\n";
attached mail follows:
Just my two cents :)
$temp = "";
echo "<table>\n";
while ($mydata = mysql_fetch_object($myquery)) {
if ($temp != $mydata->district) {
$temp = $mydata->district;
echo "<tr bgcolor=\"#CCCCCC\"><td>$mydata->district</td></tr>\n";
}
echo "<tr bgcolor=\"#CCCCCC\"><td>$mydata->city</td>
<td>$mydata->place</td>
<td>$mydata->meetingtime</td></tr>\n";
}
echo "</table>\n";
Hope it helps.
__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/
attached mail follows:
On Wed, 2004-02-04 at 00:32, John Taylor-Johnston wrote:
> I cannot declare $temp = $mydata->district; outside while ($mydata so ... ?
> I'm missing something in my logic. That's why I asked.
> It wouldn't make sense to declare this twice:
> while ($mydata = mysql_fetch_object($myquery))
You could set the flag to null outside the loop, then check at the top
of your loop to see if the flag and district differ. If so set the
flag, echo what you need, and move on. The first time the loop runs the
flag will differ and you will set it to the first vale of district as
well as echo your district header, afterwords things will continue as
expected. If you do not want to print out the district info the first
time the loop runs then you can set $mydata outside the loop, initialize
the flag variable, then use a do..while[1] loop to process the rest of
your data.
-Adam
[1] http://us2.php.net/manual/en/control-structures.do.while.php
--
Adam Bregenzer
adam
bregenzer.net
http://adam.bregenzer.net/
attached mail follows:
> [1] http://us2.php.net/manual/en/control-structures.do.while.php
>
Thanks! Didn't see that page.
attached mail follows:
if($PHP_AUTH_USER != "user1") || ($PHP_AUTH_PW != "password")
... or somehting like that. I can't find it in the manual, but it is there someplace.
Adam Williams wrote:
> Hi, is there a PHP function or some sort of way to have a user enter their
> username and password in a form, and compare the username and password and
> see if the username exists and the password is correct?
>
> basically I want to have a page where a person enters their username and
> password and if correct to use the header function to send them to the a
> page.
--
John Taylor-Johnston
-----------------------------------------------------------------------------
"If it's not Open Source, it's Murphy's Law or broken."
' ' ' Collège de Sherbrooke
ô¿ô http://www.collegesherbrooke.qc.ca/languesmodernes/
- Université de Sherbrooke
http://compcanlit.ca/
819-569-2064
attached mail follows:
Found this too:
<?
if(!isset($PHP_AUTH_USER)) {
Header("WWW-authenticate: basic realm=\"$SID\"");
Header("HTTP/1.0 401 Unauthorized");
$title="Login Instructions";
echo "<blockquote>
You are not authorised to enter the site
</blockquote> \n";
exit;
} else {
if (!($conn=ora_logon("$PHP_AUTH_USER
$SID",$PHP_AUTH_PW))) {
Header("WWW-authenticate: basic realm=\"$SID\"");
Header("HTTP/1.0 401 Unauthorized");
$title="Login Instructions";
echo "<blockquote>
You are not authorised to enter the site
</blockquote> \n";
exit;
}
}
?>
attached mail follows:
John Taylor-Johnston wrote:
> if($PHP_AUTH_USER != "user1") || ($PHP_AUTH_PW != "password")
>
> ... or somehting like that. I can't find it in the manual, but it is
> there someplace.
>
> Adam Williams wrote:
>
>> Hi, is there a PHP function or some sort of way to have a user enter
>> their username and password in a form, and compare the username and
>> password and see if the username exists and the password is correct?
>>
>> basically I want to have a page where a person enters their username
>> and password and if correct to use the header function to send them
>> to the a page.
http://www.zend.com/zend/tut/authentication.php
--
Burhan Khalid
phplist[at]meidomus[dot]com
attached mail follows:
On 02/02/2004 06:18 PM, Federico Petronio wrote:
> Hi all... I have a chrooted Apache/PHP on Solaris 8 working fine except
> for one PHP function, mail(). I read that in Unix environments there is
> not possible to make PHP use a remote SMTP and it needs to find a
> sendmail executable un the path.
>
> Since including Postfix in the chrooted env. does not look very nice, I
> try to use a wapper (local_FS->remote_SMTP), but I am not happy with the
> one I found. It does not handle well the CC, nor the BCC so I change it
> a little, but still have issues (for explample if the SMTP does not
> responds, it don't try angain and the mail is lost).
>
> Do you know some sendmail wrapper to recomend?
You may want to try this class for composing and sending e-mail messages.
It comes with sub-classes specialized in deliverying messages with
sendmail or compatible, qmail and SMTP. If you do not want to use the
class directly, it comes with wrapper functions that emulate the mail()
function.
http://www.phpclasses.org/mimemessage
For SMTP delivery, you also need this:
http://www.phpclasses.org/smtpclass
--
Regards,
Manuel Lemos
Free ready to use OOP components written in PHP
http://www.phpclasses.org/
MetaL - XML based meta-programming language
http://www.meta-language.net/
attached mail follows:
Hi all,
I want to install apache and php in a redhat box version 8 and want apache
to load php. So how i shld proceed. Just downloading the rpms of both
and installing will help or I have to down load the source and compile it.
Pls help
Thank u
Geetha
attached mail follows:
Hi,
Defaults installations of RH 8 usually have both apache and php. You can
upgrade by
rpm -Uvh rpmname.rpm
but what you should really be doing is heading off to php.net and
reading their installation guide. and googling for php newby articles.
Mrs. Geeta Thanu wrote:
>Hi all,
>
>I want to install apache and php in a redhat box version 8 and want apache
>to load php. So how i shld proceed. Just downloading the rpms of both
>and installing will help or I have to down load the source and compile it.
>Pls help
>
>Thank u
>Geetha
>
>
>
--
Raditha Dissanayake.
------------------------------------------------------------------------
http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 150 KB | with progress bar.
attached mail follows:
This might help as well: http://www.php.net/manual/en/installation.php
Jordan S. Jones
Mrs. Geeta Thanu wrote:
>Hi all,
>
>I want to install apache and php in a redhat box version 8 and want apache
>to load php. So how i shld proceed. Just downloading the rpms of both
>and installing will help or I have to down load the source and compile it.
>Pls help
>
>Thank u
>Geetha
>
>
>
attached mail follows:
"Cf High" <noah
newminddesign.com> wrote in message
news:20040203182312.31763.qmail
pb1.pair.com...
> My lord, this rocks!
>
> Our pages load at least twice as fast now, and bandwidth will likely be
> reduced by at least a factor of 2.
>
> I would strongly recommend utilizing zlib compression functions to anyone
> looking to speed page delivery & reduce bandwidth!
I agree on that. It is funny that you often find people spliting hairs on
optimizing code like "but templates are slow" or even to the extreme "should
I use single or double quotes for strings?", while things like this affect
user expirience much, much more.
rush
--
http://www.templatetamer.com/
attached mail follows:
=======================================
This message is for the benefit of new subscribers
and those new to PHP. Please feel free to add
more points and send to the list.
=======================================
1. If you have any queries/problems about PHP try
http://www.php.net/manual/en first. You can
download a copy and use it offline also.
Please also try http://www.php.net/manual/faq.php
for answers to frequently answered questions
about PHP (added by Christophe Chisogne).
2. Try http://www.google.com next. Searching for
"php YOUR QUERY" may fetch you relevant
information within the first 10 results.
3. There is a searchable archive of the mailing
list discussion at
http://phparch.com/mailinglists. Many of the
common topics are discussed repeatedly, and you
may get answer to your query from the earlier
discussions.
For example: One of the repeatedly discussed
question in the list is "Best PHP editor".
Everyone has his/her favourite editor.
You can get all the opinions by going through the
list archives. If you want a chosen list try this
link : http://phpeditors.linuxbackup.co.uk/
(contributed by Christophe Chisogne).
4. Not sure if PHP is working or you want find out
what extensions are available to you?
Just put the following code into a file with a
.php extension and access it through your
webserver:
<?php
phpinfo();
?>
If PHP is installed you will see a page with a lot
of information on it. If PHP is not installed (or
not working correctly) your browser will try
to download the file.
(contributed by Teren and reworded by Chris W
Parker)
5. If you are stuck with a script and do not
understand what is wrong, instead
of posting the whole script, try doing some
research yourself. One useful trick is to print
the variable/sql query using print or echo
command and check whether you get what you
expected.
After diagnosing the problem, send the details of
your efforts (following steps 1, 2 & 3) and ask
for help.
6. PHP is a server side scripting language.
Whatever processing PHP does takes
place BEFORE the output reaches the client.
Therefore, it is not possible to access
users' computer related information (OS, screen
size etc) using PHP. Nor can you modify any the
user side settings. You need to go for
JavaScript and ask the question in a JavaScript
list.
On the other hand, you can access the information
that is SENT by the user's browser when a client
requests a page from your server. You can
find details about browser, OS etc as reported by
this request. - contributed by Wouter van Vliet
and reworded by Chris W Parker.
7. Provide a clear descriptive subject line. Avoid
general subjects like "Help!!", "A Question" etc.
Especially avoid blank subjects.
8. When you want to start a new topic, open a new
mail composer and enter the mailing list address
php-general
lists.php.net instead of replying to
an existing thread and replacing the subject and
body with your message.
9. It's always a good idea to post back to the
list once you've solved your problem. People
usually add [SOLVED] to the subject line of their
email when posting solutions. By posting your
solution you're helping the next person with the
same question. [contribued by Chris W Parker]
10. Ask smart questions
http://catb.org/~esr/faqs/smart-questions.html
[contributed by Jay Blanchard)
Hope you have a good time programming with PHP.
Best regards,
--
Integrated Management Tools for leather industry
----------------------------------
http://www.leatherlink.net
Ma Siva Kumar,
BSG LeatherLink (P) Ltd,
Chennai - 600106
attached mail follows:
Hi Folks:
I just released version 1.6.0RC4 of PEAR DB. Several things have been
fixed since RC1 which is included with the latest PHP RC release. Also,
if you're using 1.5.0 variants or earlier, definitely check out the new
version for loads of enhancements and way fewer bugs.
I've also spent a bunch of time documenting the new functionality and
fixing the old docs. Most of the changes are already viewable on the PEAR
website and most of the remaining improvements should be in place when the
docs get rebuilt Sunday around 12pm UTC.
So, please download the package and test it out as well as read the
documentation. Please file bug reports if stuff doesn't work or is
unclear.
Download: http://pear.php.net/get/DB-1.6.0RC4.tgz
Manual: http://pear.php.net/manual/en/package.database.php
Report Bugs: http://pear.php.net/bugs/report.php?package=DB
Home Page: http://pear.php.net/package/DB
Enjoy,
--Dan
PS: I'm not on the list. Just posting this as an announcement.
--
T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
data intensive web and database programming
http://www.AnalysisAndSolutions.com/
4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409
attached mail follows:
I have a JavaScript style sheet switcher that works quite nicely, but I
want to make a MULTI-style switcher; one that lets you switch various
items independently of one another.
It sounds like it can be done with either PHP or JavaScript, each with
its own advantages. The biggest disadvantage with PHP is that switching
styles reloads teh page.
Does anyone know if there's a PHP method that does NOT involve reloading
the page?
Here are a couple key articles I've checked out:
http://www.antipixel.com/blog/archives/2002/11/07/a_couple_of_changes.html
http://www.mcu.org.uk/sizeswitch.php
Thanks.
attached mail follows:
Hi,
This is explained in Kumar's mail which was sent out a little while ago.
If you didn't see it an older version is archived here:
http://www.mail-archive.com/php-general
lists.php.net/msg128334.html
but in short it can't be done.
> Does anyone know if there's a PHP method that does NOT involve
> reloading the page?
>
--
Raditha Dissanayake.
------------------------------------------------------------------------
http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 150 KB | with progress bar.
attached mail follows:
Hi
I want to substract $first_date to $second_date and print the result
this way :
xx days, xx hours, xx minutes
i tried (strtotime($second_date)-strtotime($first_date)) but what i get
is a timestamp
and i dont know what to do with it
Is there already a function to print the result in a human readable way
?
Thx
attached mail follows:
BEOI 7308 wrote:
> Hi
>
> I want to substract $first_date to $second_date and print the result
> this way :
>
> xx days, xx hours, xx minutes
>
> i tried (strtotime($second_date)-strtotime($first_date)) but what i
> get is a timestamp and i dont know what to do with it
>
> Is there already a function to print the result in a human readable
> way ?
>
> Thx
http://www.php.net/date
--
Burhan Khalid
phplist[at]meidomus[dot]com
attached mail follows:
Burhan Khalid wrote:
> BEOI 7308 wrote:
>
>>Hi
>>
>>I want to substract $first_date to $second_date and print the result
>>this way :
>>
>>xx days, xx hours, xx minutes
>>
>>i tried (strtotime($second_date)-strtotime($first_date)) but what i
>>get is a timestamp and i dont know what to do with it
>>
>>Is there already a function to print the result in a human readable
>>way ?
>>
>>Thx
>
>
> http://www.php.net/date
>
I'm not sure that helps too much. Subtracting unix timestamps will give
the difference in seconds. You can then use division and remainders to
calculate the hours, minutes and seconds.
Michael
attached mail follows:
Hmmmmm... I haven't found Kumar's style sheet switcher post yet, but if
you say it can't be done, I'll take your word for it.
Thanks for the tip.
Raditha Dissanayake wrote:
> Hi,
>
> This is explained in Kumar's mail which was sent out a little while ago.
> If you didn't see it an older version is archived here:
> http://www.mail-archive.com/php-general
lists.php.net/msg128334.html
>
> but in short it can't be done.
>
>> Does anyone know if there's a PHP method that does NOT involve
>> reloading the page?
>>
>
>
attached mail follows:
On Wed, 2004-02-04 at 04:47, Freedomware wrote:
> Hmmmmm... I haven't found Kumar's style sheet switcher post yet, but if
> you say it can't be done, I'll take your word for it.
The problem here is your approach. PHP can only be used to control the
content sent to browsers. Once the browser receives the content PHP is
out of the picture until the next reload. You have to use javascript or
some other client side language to change anything on a page once it is
loaded in the browser. The referred to post describes this in detail.
--
Adam Bregenzer
adam
bregenzer.net
http://adam.bregenzer.net/
attached mail follows:
Hi everyone - hope there's someone good at PDFlib out there…
I'm trying to use a picture, a TIFF image, with transparency, in a PDF
created by a PHP-script...
The manual says that only "explicit transparency" can be used when
working with TIFF images, and that this operation requires two steps…
But then the manual loses me, and I don't understand what the "two
steps" that seems to be required actually meens…
Isn't it sufficiant to have a TIFF image with transparency, or do I
have to have some kind of second image and use that as some kind of
mask to acquire transparency effects? Will this, if so, require two
image files per image instead as one?
Hope this is not OT, if so, i apologize…
Sincerely
Victor Spång Arthursson
Sweden / Denmark
attached mail follows:
Hello Everyone,
I am trying to make 2 drop down boxs using data from a mysql database , the
code is attached , the problem is I have a category and a sub category
table. The link between the two tables is the id ( ID in category table &
mid in subcat tables are the same ) . So i would like to make 2 drop down
boxes , one with the categories and the other with the the subcategories of
that specific category. I have written some code , which displays the
category just fine .. but doesnt display the subcategory :(. Kindly help me
out , My code is attached
regards
~junjun
/////////////////////////////////////////////////////////////////////// Code
Starts//////////////////////////////////////////////////////////////////
<html>
<head>
<title>Bismillah</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<script>
function ProcSel(title) {
SetCookie("subcat",title.value);
self.location.reload();
}
function SetCookie (name,thevalue) {
document.cookie = name + ' = ' + thevalue + ';';
}
</script>
<form name="form1" method="post" action="value.php">
<p> Subject Category:
<?PHP
include("conn.php");
$rslt = mysql_query("SELECT id, title from vu_mcats");
echo "<SELECT NAME='title' onChange='ProcSel(this)' SIZE='1'>n";
if ($cmfg=="")
if(mysql_num_rows($rslt))
$cmfg=mysql_result($rslt,0,"title");
while ($row = mysql_fetch_array($rslt)) {
echo "<OPTION VALUE='".$row['title']."'";
if ($cmfg == $row['title'])
echo " SELECTED>".$row['title']."";
else
echo ">".$row['title']."";
}
echo "</SELECT>";
?>
Choose Model:</TD>
<?PHP
$rslt = mysql_query("SELECT mid,id,title FROM vu_cats WHERE mid='$id'");
echo "<SELECT NAME='subcat' SIZE='1'>n";
while ($row = mysql_fetch_array($rslt)) {
echo "<OPTION VALUE='".$row['title']."'>".$row['title']." (".$row['id']."
VA)n";
}
echo "</SELECT>n";
?>
</p>
<p>
<input type="submit" name="Submit" value="Submit">
<input type="reset" name="Submit2" value="Reset">
</p>
</form>
<p> </p></body>
</html>
///////////////////End of Code//////////////////////////
attached mail follows:
hi,
Please visit the mysql website and read up on 'joins'. I guess you
haven't seen siva kumar's mail either. You can see an archived version here.
http://www.mail-archive.com/php-general
lists.php.net/msg128334.html
Junaid Saeed Uppal wrote:
>Hello Everyone,
>
>I am trying to make 2 drop down boxs using data from a mysql database , the
>code is attached , the problem is I have a category and a sub category
>table. The link between the two tables is the id ( ID in category table &
>mid in subcat tables are the same ) . So i would like to make 2 drop down
>boxes , one with the categories and the other with the the subcategories of
>that specific category. I have written some code , which displays the
>category just fine .. but doesnt display the subcategory :(. Kindly help me
>out , My code is attached
>
>regards
>
>~junjun
>
>/////////////////////////////////////////////////////////////////////// Code
>Starts//////////////////////////////////////////////////////////////////
>
><html>
>
><head>
>
><title>Bismillah</title>
>
><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
>
></head>
>
><body>
>
><script>
>
>function ProcSel(title) {
>
>SetCookie("subcat",title.value);
>
>self.location.reload();
>
>}
>
>function SetCookie (name,thevalue) {
>
>document.cookie = name + ' = ' + thevalue + ';';
>
>}
>
></script>
>
><form name="form1" method="post" action="value.php">
>
><p> Subject Category:
>
><?PHP
>
>include("conn.php");
>
>$rslt = mysql_query("SELECT id, title from vu_mcats");
>
>echo "<SELECT NAME='title' onChange='ProcSel(this)' SIZE='1'>n";
>
>if ($cmfg=="")
>
>if(mysql_num_rows($rslt))
>
>$cmfg=mysql_result($rslt,0,"title");
>
>while ($row = mysql_fetch_array($rslt)) {
>
>echo "<OPTION VALUE='".$row['title']."'";
>
>if ($cmfg == $row['title'])
>
>echo " SELECTED>".$row['title']."";
>
>else
>
>echo ">".$row['title']."";
>
>}
>
>echo "</SELECT>";
>
>?>
>
>Choose Model:</TD>
>
><?PHP
>
>$rslt = mysql_query("SELECT mid,id,title FROM vu_cats WHERE mid='$id'");
>
>echo "<SELECT NAME='subcat' SIZE='1'>n";
>
>while ($row = mysql_fetch_array($rslt)) {
>
>echo "<OPTION VALUE='".$row['title']."'>".$row['title']." (".$row['id']."
>VA)n";
>
>}
>
>echo "</SELECT>n";
>
>?>
>
></p>
>
><p>
>
><input type="submit" name="Submit" value="Submit">
>
><input type="reset" name="Submit2" value="Reset">
>
></p>
>
></form>
>
><p> </p></body>
>
></html>
>///////////////////End of Code//////////////////////////
>
>
>
--
Raditha Dissanayake.
------------------------------------------------------------------------
http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 150 KB | with progress bar.
attached mail follows:
Hi,
I've just switched from Windows to Linux and don't want to change back!
However I used to use Dreamweaver MX for all my PHP / HTML editing, can
anyone recommend a good alternative?
Many thanks
attached mail follows:
[snip]
I've just switched from Windows to Linux and don't want to change back!
However I used to use Dreamweaver MX for all my PHP / HTML editing, can
anyone recommend a good alternative?
[/snip]
Try Zend Studio. http://www.zend.com
attached mail follows:
Shiva Kumar i am referring to your post for the third time today !!
Shaun this topic is covered here:
http://www.mail-archive.com/php-general
lists.php.net/msg128334.html
best regards
Shaun wrote:
>Hi,
>
>I've just switched from Windows to Linux and don't want to change back!
>However I used to use Dreamweaver MX for all my PHP / HTML editing, can
>anyone recommend a good alternative?
>
>Many thanks
>
>
>
--
Raditha Dissanayake.
------------------------------------------------------------------------
http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 150 KB | with progress bar.
attached mail follows:
Transmit Report:
To: dbdustlr02
hanmir.com, 402 Local User Inbox Full (dbdustlr02
hanmir.com)
attached mail follows:
John Taylor-Johnston wrote:
> if($PHP_AUTH_USER != "user1") || ($PHP_AUTH_PW != "password")
>
> ... or somehting like that. I can't find it in the manual, but it is
> there someplace.
>
> Adam Williams wrote:
>
>> Hi, is there a PHP function or some sort of way to have a user enter
>> their username and password in a form, and compare the username and
>> password and see if the username exists and the password is correct?
>>
>> basically I want to have a page where a person enters their username
>> and password and if correct to use the header function to send them
>> to the a page.
http://www.zend.com/zend/tut/authentication.php
--
Burhan Khalid
phplist[at]meidomus[dot]com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Transmit Report:
To: dbdustlr02
hanmir.com, 402 Local User Inbox Full (dbdustlr02
hanmir.com)
attached mail follows:
BEOI 7308 wrote:
> Hi
>
> I want to substract $first_date to $second_date and print the result
> this way :
>
> xx days, xx hours, xx minutes
>
> i tried (strtotime($second_date)-strtotime($first_date)) but what i
> get is a timestamp and i dont know what to do with it
>
> Is there already a function to print the result in a human readable
> way ?
>
> Thx
http://www.php.net/date
--
Burhan Khalid
phplist[at]meidomus[dot]com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
On 03 February 2004 16:16, William Bailey contributed these pearls of wisdom:
> Ok. Its been a long day and my brain is starting to shut down
> so...
>
> How would i work out which year the 'W' relates to?
>
> I have a unix timestamp value and want to end up with the
> correct 'YW'
> value.
Look at strftime() http://www.php.net/strftime -- specifically, the %V and %G specifiers.
Cheers!
Mike
--
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: m.ford
leedsmet.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
attached mail follows:
Hi,
I'm working on a multi-langage website and i got problem with a fonction
which destroy my session :-(
I got a file which change my langage like this :
/********************************************/
session_start();
if ($_POST['langue']=="us")
$_SESSION['language']="us";
else if ($_POST['langue']=="fr")
$_SESSION['language']="fr";
header("Location: http://".$_SERVER['HTTP_HOST'].$_POST['page_name']);
/*********************************************/
When the header function is called I'm correctly redirected on the right
page but all my session variables are destroyed.
Can you please help me resolving this problem. I've tried directly entering
the path for redirection like that:
header("Location: index.php");
but it's the same problem.
Thanks in advance,
______________________________________
MARC SERRA
MASTER Commerce Electronique
IUP GMI AVIGNON
FRANCE
attached mail follows:
On Wednesday 04 February 2004 20:59, marc serra wrote:
> When the header function is called I'm correctly redirected on the right
> page but all my session variables are destroyed.
Try session_write_close() before you redirect.
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
I hope something GOOD came in the mail today so I have a REASON to live!!
*/
attached mail follows:
On 04 February 2004 12:59, marc serra contributed these pearls of wisdom:
> Hi,
>
>
>
> I'm working on a multi-langage website and i got problem with
> a fonction
> which destroy my session :-(
>
>
>
> I got a file which change my langage like this :
>
>
>
> /********************************************/
>
> session_start();
>
>
>
> if ($_POST['langue']=="us")
>
> $_SESSION['language']="us";
>
> else if ($_POST['langue']=="fr")
>
> $_SESSION['language']="fr";
>
>
>
> header("Location:
> http://".$_SERVER['HTTP_HOST'].$_POST['page_name']);
>
> /*********************************************/
If you rely on URL rewriting to transmit your session ID, this won't work for header redirects, so you need to manually include the SID value. In any case, this is good defensive programming (in case that configuration parameter ever gets changed!). So your redirect should look like:
header("Location: http://".$_SERVER['HTTP_HOST'].$_POST['page_name'].'?'.SID);
Cheers!
Mike
--
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: m.ford
leedsmet.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
attached mail follows:
On 03 February 2004 13:45, Alessandro Vitale contributed these pearls of
wisdom:
> try removing curly braces as follows:
>
> $query = mysql_query("UPDATE stories SET status='approved'
> WHERE story_id={$id}"); |
Nothing wrong with the above, it's perfectly valid -- just a slightly
different way of writing:
> $query = mysql_query("UPDATE stories SET status='approved'
> WHERE story_id=${id}");
Cheers!
Mike
--
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: m.ford
leedsmet.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
attached mail follows:
Inside of a class I am trying to make a call to a function in another class.
I have one class defined to be my DataBase Interface call "dbi". To use
that class I do this:
$db = new dbi;
Then I can use the functions in "dbi" like this:
$db->dbquery("select * from whatever");
Inside another class (Class2) I have several functions that need database
access. So in each function I can use "$db = new dbi;" and then use the
functions as usual ($db->dbquery("blah");).
I am wondering, can I create the new "dbi" instance at the top of Class2 and
have all the functions within Class2 use the "dbi" class reference variable
($db)?
If so, would the use be something like this:
$this->db->dbquery("blah");
Thank you,
Jonathan Duncan
www.jkdwebmagic.com
Web Site Hosting and Design
attached mail follows:
Hi all,
I am using PHP v4.12, and here is the scenario.
I have one page, index.php with a form that has a searchfield (dropdown) and
searchcriteria (textbox). When submitted I want to populate two session
variables with the form values of searchfield and searchcriteria. This page
also uses paging, and whenever I click next, my session variables seem to
die. I have globals turned on.
So basically, we the page initially loads I display all the results from a
db query. Paging works fine. If someone submits the form, I want to
populate two session variables and build a new sql statment based on the
user input. Clickling "next" or "previous" should retain the same search
results until the user submits the form again or those session variables
expire.
Help please.
Cheers,
David
attached mail follows:
On 03 February 2004 21:20, DL contributed these pearls of wisdom:
> Hi all,
>
> I am using PHP v4.12, and here is the scenario.
Which OS are you on? I seem to remember that a bug in 4.1.2 meant that sessions were "write only" on one particular group of OS -- but I can no longer remember whether it was *n*x or Windoze. (Or was that in PHP 4.2.1? -- like I said, it was the dim-and-distant past! ;) A search in the archives might tell you, but as 4.1.2 is now well out of date why not just upgrade?
Cheers!
Mike
--
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: m.ford
leedsmet.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
attached mail follows:
I know I may be displaying severe ignorance, but I have to ask... What do
you mean by "this page also uses paging"? What is "paging"?
Larry
-----Original Message-----
From: DL [mailto:tooptoosh
hotmail.com]
Sent: Tuesday, February 03, 2004 4:20 PM
To: php-general
lists.php.net
Subject: [PHP] Session troubles
Hi all,
I am using PHP v4.12, and here is the scenario.
I have one page, index.php with a form that has a searchfield (dropdown) and
searchcriteria (textbox). When submitted I want to populate two session
variables with the form values of searchfield and searchcriteria. This page
also uses paging, and whenever I click next, my session variables seem to
die. I have globals turned on.
So basically, we the page initially loads I display all the results from a
db query. Paging works fine. If someone submits the form, I want to
populate two session variables and build a new sql statment based on the
user input. Clickling "next" or "previous" should retain the same search
results until the user submits the form again or those session variables
expire.
Help please.
Cheers,
David
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Hi, my company's looking to buy a PHP encoder to secure the source code.
The encoded scripts should be able to run on Solaris platform (Apache webserver), and should only require minimum changes to the server.
I looked on Zend Encoder and was ready to suggest it when I realise that the US$ 960 tag is only for a year's license. And I don't think we have the budget to buy the perpetual license.
Could anyone recommend other PHP encoder for us?
Many thanks,
Harry
--
Kampanye open-source Indonesia - http://www.DariWindowsKeLinux.com
Solusi canggih, bebas ikatan, dan bebas biaya
v0sw6Chw5ln3ck4u6Lw5-2Tl6+8Ds5MRr5e7t2Tb8TOp2/3en5+7g5HC - hackerkey.com
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]