php-general Digest 7 Feb 2001 16:17:41 -0000 Issue 498
Topics (messages 38487 through 38554):
Re: Name of Class' instance
38487 by: Steve Werby
Re: parent constructor
38488 by: Aaron Tuller
38525 by: Christian Reiniger
Re: Alarm/Timer in PHP??
38489 by: Rasmus Lerdorf
Re: Indexing Engine
38490 by: Steve Werby
Re: Odd question regarding creating a php file
38491 by: Steve Werby
38548 by: Dusten
Re: Header Location Question
38492 by: David Robley
Re: Retrieve item from table at random
38493 by: Steve Werby
38507 by: Ben Gollmer
38541 by: Steve Werby
Re: sending mail with PHP from web
38494 by: Steve Werby
38516 by: Jon Haworth
Re: software development qu
38495 by: Dean Hall
Re: How to use phpIRC and question about HTML streaming!
38496 by: Zenith
Emacs PHP doc/ref system?
38497 by: Phil. C
phplib phplib-7.2b is severely inconsistent
38498 by: Jeff
PHP Contractor In Israel
38499 by: Shimon Dekel
Time problem
38500 by: Roman
38540 by: Steve Werby
image* functions won't work.
38501 by: Lauri Jakku
38506 by: David Robley
Re: GD, TTF, and Anit-Alias
38502 by: Lauri Jakku
Re: XSLT problems....
38503 by: sterling hughes
Alternative PHP Cache
38504 by: Herman Tolentino
Re: Sessions and Objects
38505 by: Matthias Krehl
38520 by: Christian Reiniger
Re: Just a thanks
38508 by: mfourny.bluewin.ch
[newbie] easy question about fopen ("$filename", "r+")
38509 by: SED
38526 by: Christian Reiniger
Re: Mixing PHP code with phplib templates... possible?
38510 by: Max A. Derkachev
PHP File Uplaod Path
38511 by: Dhaval Desai
38514 by: Michael Hall
Seeking a SuperHost
38512 by: Lux
38544 by: Michael Kimsal
php & mod_perl
38513 by: Andrzej Roszkowski
38527 by: Christian Reiniger
open_basedir bug or misunderstanding?
38515 by: Remco van den Berg
Compile error in php4.04pl1 with apache
38517 by: Eric Persson
Re: Passing an array as an argument.
38518 by: Christian Reiniger
Re: Com
38519 by: Christian Reiniger
38521 by: Pavel Kalian
38529 by: Christian Reiniger
38530 by: Pavel Kalian
38532 by: Christian Reiniger
38533 by: Dominick Vansevenant
Re: binmode() in php?
38522 by: Christian Reiniger
what is ::?
38523 by: Chien-pin Wang
Re: Io Ports?
38524 by: Christian Reiniger
function problem ...
38528 by: Miguel Loureiro
38531 by: Frederico Augusto Costa
Re: I wish: IIS and ISAPI $PHP_AUTH_USER
38534 by: Phil Driscoll
Re: Questions about simple php problems
38535 by: Jon Haworth
Re: How to get information out of an external page?
38536 by: Tobias Talltorp
Re: which template?
38537 by: Alexander Wagner
Re: db forms creator?
38538 by: Tim Ward
Access a printer via PHP
38539 by: ThoVer Webproducties
38545 by: Cal Evans
Re: Dear Friends & Future Millionaire:
38542 by: Jon Haworth
38549 by: Carsten Gehling
MS SQL Question
38543 by: Conover, Ryan
HTTP Authentication
38546 by: Nick Kostirya
Where to put the include()
38547 by: Remi Ricard
20 Million Fresh E-Mail Addresses
38550 by: Luke2
Hosting in UK
38551 by: TV Karthick Kumar
list() = each() Question
38552 by: Jason Mowat
38553 by: Jason Mowat
PHP - CGI Version
38554 by: Tim Livers
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]
----------------------------------------------------------------------
"Boget, Chris" <[EMAIL PROTECTED]> wrote:
> So if you do:
>
> $joeBob = new myClass();
>
> "myClass" can somehow know that "joeBob" is the name of
> it's instance?
>
> I'm thinking 'no', but would like verification.
I'm not aware of a way to do so. I'm curious why you'd want to? If you
want to pass "joeBob" to the class you can do so as the parameter of one of
the methods. And my guess is that you already know, but if you want to
refer to a method or property of a class from within the class, you do using
syntax like $this->property_here.
--
Steve Werby
COO
24-7 Computer Services, LLC
Tel: 804.817.2470
http://www.247computing.com/
ok, I == dumb. this works:
$parentClass = get_parent_class($this);
eval("$parentClass::$parentClass();");
still, I think I should be able to do what I wrote below.
-aaron
At 8:05 PM -0800 2/6/01, Aaron Tuller wrote:
>why doesn't this work?
>
>$parentClass = get_parent_class($this);
>parent::{$parentClass}();
>
>I get a parse error. can I not use variable functions with the "::" syntax?
>
>I tried eval() and it loses the context.
>
>thanks for the help!
>
>-aaron
>
>--
>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]
On Wednesday 07 February 2001 05:14, Aaron Tuller wrote:
> ok, I == dumb. this works:
>
> $parentClass = get_parent_class($this);
> eval("$parentClass::$parentClass();");
>
> still, I think I should be able to do what I wrote below.
Um, you know the name of your parent class, so why do you use
get_parent_class() at all?
--
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)
"Software is like sex: the best is for free" -- Linus Torvalds
Just use the standalone php binary and write yourself a little php script
and run it from your cron periodically.
-Rasmus
On Wed, 7 Feb 2001, GAYTAN BAHAMONDEZ DANIEL EDUARDO wrote:
> Hi there,
> I need to do some kind of alarm in php, I have a date(dd-mm-yyyy)
> in mysql and need that system warn me a week or so before that date, is
> there a function like that in php??
>
> Thanks in advance
> Daniel Gaytan B.
>
>
> --
> 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]
>
"Diego Fulgueira" <[EMAIL PROTECTED]> wrote:
> I was wondering if anyone around knows of a tool (free if possible) to
index
> all the pages of my website and implement a search engine. I prefer it to
> run on NT.
My favorite is mnoGoSearch (formerly udmsearch) found at
http://search.mnogo.ru/. I could hype it in great detail, but I'll let you
do your own research. It's an indexer, backend and frontend search engine.
ht://Dig is also pretty popular. Both are free. Both run on many
Linux/Unix flavors. I don't believe either run on NT.
--
Steve Werby
COO
24-7 Computer Services, LLC
Tel: 804.817.2470
http://www.247computing.com/
"Dusten" <[EMAIL PROTECTED]> wrote:
> fwrite($fp, "<?php
> $result = mysql_query("SELECT * from winLoss WHERE
> login='$login' AND pass='$pass'");
> ?>
> Ive ommited the redundant things. Basicly it just creates this: SELECT *
> from winLoss WHERE login='' I need that value in there. Any ideas?
When you enclose variables (as represented by $ followed by variable name)
within double quotes the content found within the double quotes are parsed
and translated into their value counterparts. When you enclose variables
within single quotes the variables remain intact as variables. So if you
want to pass the SQL statement with the variables intact enclose in single
quotes. If your problem is simply that the variables are translating to
empty values, you need to do some debugging. At the same point in the code
put:
echo "login: $login, pass: $pass";
If the values don't appear then they're not available to the code. It might
be something as simple as you having the code within a function and the
variables being set outside the function in which case you should refer to
them as $GLOBALS[login] or $HTTP_POST_VARS[login] or $HTTP_GET_VARS[login]
or whatever's appropriate for your application.
--
Steve Werby
COO
24-7 Computer Services, LLC
Tel: 804.817.2470
http://www.247computing.com/
In reply to Chris. The reason I'm having this page created is because people
will need to be able to see this person's "win/loss" record. I have a script
that displays all of the ppl registered and when you view their page, you
can get a real time report on their ratings. As another alternative: I could
pass the variables into a 'template' page and create it from there, but I
didn't want all my links to be buttons with hidden variables in them. I hope
I cleared that up.
Thanks for your help
Dusten
"Chris Lee" <[EMAIL PROTECTED]> wrote in message
95q4hi$b9u$[EMAIL PROTECTED]">news:95q4hi$b9u$[EMAIL PROTECTED]...
> there are a few errors in here. number one being this.
>
> echo "... mysql_query("SELECT ...";
>
> do you see it? youve got the " in the middle there, that is ending your "
"
> section, not what you wanted right. second too is the fact anything in " "
> will be evaluated, anything in ' ' will not.
>
> fwrite($fp, '<?php $result = mysql_query("SELECT * ... "); ?> <html> ...
> </html>');
>
> In the future I find if your having a problem with a string, echo it to
the
> screen, see what happens.
>
> Got a question for you, what is this next page for? im curious why you are
> opting todo this this way. are you trying to get around sending variables
> through POST/GET/COOKIES ? I would highly recommed sessions if this is
your
> idea. Speed and Easy of use will be greatly increased. Please respond back
> with your answer, Im curious.
>
>
> --
>
>
>
> Chris Lee
> Mediawaveonline.com
> [EMAIL PROTECTED]
>
>
>
>
>
> ""Dusten"" <[EMAIL PROTECTED]> wrote in message
> 95q1bv$ekv$[EMAIL PROTECTED]">news:95q1bv$ekv$[EMAIL PROTECTED]...
> > I'm having trouble creating a php file. I've tried to explain it to the
> > peeps in IRC but am having trouble. It'll be easier to paste my code:
> > ...
> > $result2 = mysql_query("INSERT INTO winLoss(login, pass)
> > VALUES('$login', '$pass')");
> >
> > if($result2)
> > {
> > $fp = fopen
> ("/home2/colorado/public_html/profiles/$screen_name$ext",
> > "w");
> > fwrite($fp, "<?php
> > $result = mysql_query("SELECT * from winLoss WHERE
> > login='$login' AND pass='$pass'");
> > ?>
> >
> > <html>
> > <head>
> > <title>$screen_name</title>
> > </head>").........
> >
> > Ive ommited the redundant things. Basicly it just creates this: SELECT *
> > from winLoss WHERE login='' I need that value in there. Any ideas?
> >
> > Thank you (sorry about the repost)
> > Dusten
> >
> >
> >
> >
> > --
> > 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]
>
On Wed, 7 Feb 2001 13:27, Jeff Oien wrote:
> I have the code below within a larger web page which is
> like a portal. When I submit the form, I get this message:
>
> --------
> Warning: Cannot add header information - headers already sent by (output
> started at c:\apache\htdocs\index1.php3:9)
> --------
>
> Can I get it to take me to the BigCharts site and leave the
> page I'm on? Thanks.
> Jeff Oien
>
> --------
> <?php
>
> print "<form method=\"post\" action=\"$PHP_SELF\">";
> print "Symbol<br>";
> print "<input type=\"Text\" size=\"5\" name=\"symbol\"><br>";
> print "<INPUT type=\"hidden\" name=\"op\" value=\"ds\">";
> print "<input type=\"Submit\" value=\"Chart\">";
>
> if ($op == "ds") {
> $url = 'http://www.bigcharts.com/quickchart/quickchart.asp?symb= .
> $symbol'; header ("Location: $url");
> }
> ?>
If you are going to use header, you _must_ make sure that nothing is output
to the server, not even white space or blank lines, before the header
function is called.
--
David Robley | WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/
AusEinet | http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA
"David Robley" <[EMAIL PROTECTED]> wrote:
> On Wed, 7 Feb 2001 11:28, enthalpy wrote:
> > anyone have example code for randomly grabing an item from a mysql
table?
> >
>
> Mysql 3.23 will let you order by RAND() and you could use a LIMIT to
> restrict to one result. I haven't tried it, though.
I can confirm that what David suggested does work. If you're using an older
MySQL you can do something like the following. It requires two queries
instead of one. First return all records and count # of records (alternate
method is to just use an SQL count() statement), then generate a random # in
PHP b/w 0 and the # of records, then use an SQL quuery with LIMIT
random_row_number, 1 (return 1 record).
$result = mysql_query( $sql, $handle ) or die( "No records." );
$result_num_records = mysql_num_records( $result );
srand( ( double ) microtime() * 1000000 );
$row_offset = rand( 0, $result_num_records );
$sql = "SELECT * FROM my_table LIMIT $row_offset, 1 ";
--
Steve Werby
COO
24-7 Computer Services, LLC
Tel: 804.817.2470
http://www.247computing.com/
I've got a better way yet:
select RAND() as rand_col, column_name from table_name order by rand_col
Only one query for randomized results, no PHP/Perl/etc. You can of course
add the 'limit 1' on the end to get one row back. I use this method a lot -
my main server is running 3.22.32 but my test server always has the latest
version installed, and this way my code is compatible across all versions.
Ben
At 10:50 PM 2/6/2001, you wrote:
>"David Robley" <[EMAIL PROTECTED]> wrote:
> > On Wed, 7 Feb 2001 11:28, enthalpy wrote:
> > > anyone have example code for randomly grabing an item from a mysql
>table?
> > >
> >
> > Mysql 3.23 will let you order by RAND() and you could use a LIMIT to
> > restrict to one result. I haven't tried it, though.
>
>I can confirm that what David suggested does work. If you're using an older
>MySQL you can do something like the following. It requires two queries
>instead of one. First return all records and count # of records (alternate
>method is to just use an SQL count() statement), then generate a random # in
>PHP b/w 0 and the # of records, then use an SQL quuery with LIMIT
>random_row_number, 1 (return 1 record).
>
>$result = mysql_query( $sql, $handle ) or die( "No records." );
>$result_num_records = mysql_num_records( $result );
>
>srand( ( double ) microtime() * 1000000 );
>$row_offset = rand( 0, $result_num_records );
>
>$sql = "SELECT * FROM my_table LIMIT $row_offset, 1 ";
>
>--
>Steve Werby
>COO
>24-7 Computer Services, LLC
>Tel: 804.817.2470
>http://www.247computing.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]
"Ben Gollmer" <[EMAIL PROTECTED]> wrote:
> I've got a better way yet:
>
> select RAND() as rand_col, column_name from table_name order by rand_col
Ben, you must have overlooked David Robley's reply and my confirmation that
his idea does indeed work (which was in the email you responded to). David
said the same thing - I left your message intact so you can reread. At 3:20
AM it's easy to overlook things. <smile> I gave an alternate solution so
that the reader and others who may still be running MySQL 3.22x would have a
solution. For those who want to see it in action, the books and sites
sections in the side columns ar http://www.sexcriminals.com/ are generated
using a MySQL ORDER BY RAND() LIMIT limit_number query. And no it's not a
porn site.
--
Steve Werby
COO
24-7 Computer Services, LLC
Tel: 804.817.2470
http://www.247computing.com/
>
> Only one query for randomized results, no PHP/Perl/etc. You can of course
> add the 'limit 1' on the end to get one row back. I use this method a
lot -
> my main server is running 3.22.32 but my test server always has the latest
> version installed, and this way my code is compatible across all versions.
>
> Ben
>
> At 10:50 PM 2/6/2001, you wrote:
> >"David Robley" <[EMAIL PROTECTED]> wrote:
> > > On Wed, 7 Feb 2001 11:28, enthalpy wrote:
> > > > anyone have example code for randomly grabing an item from a mysql
> >table?
> > > >
> > >
> > > Mysql 3.23 will let you order by RAND() and you could use a LIMIT to
> > > restrict to one result. I haven't tried it, though.
> >
> >I can confirm that what David suggested does work. If you're using an
older
> >MySQL you can do something like the following. It requires two queries
> >instead of one. First return all records and count # of records
(alternate
> >method is to just use an SQL count() statement), then generate a random #
in
> >PHP b/w 0 and the # of records, then use an SQL quuery with LIMIT
> >random_row_number, 1 (return 1 record).
> >
> >$result = mysql_query( $sql, $handle ) or die( "No records." );
> >$result_num_records = mysql_num_records( $result );
> >
> >srand( ( double ) microtime() * 1000000 );
> >$row_offset = rand( 0, $result_num_records );
> >
> >$sql = "SELECT * FROM my_table LIMIT $row_offset, 1 ";
> >
> >--
> >Steve Werby
> >COO
> >24-7 Computer Services, LLC
> >Tel: 804.817.2470
> >http://www.247computing.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]
>
>
> --
> 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]
>
"Yamin Prabudy" <[EMAIL PROTECTED]> wrote:
> i had make a web interface to send announcement mail to my
customers,..rite
> now i had about 500
> once I send mail to my customers my server hang ( i guess to much open
> file)...i complie by kernel again to get a big descriptor, but still
worried
> about the hang problem....i put a delay in my program so it send a mail
and
> delay in x time, but i get a web error and my mail stop sending in my
> customer number 300
set_time_limit( 240 ); // Increase allowable script execution time to 240
seconds.
This will probably help in your case, but you might want to look at a
mailing list manager like majordomo or mailman to pass the email to. Then
the mailing list manager can handle delivery to the recipients. You can
always write the recipient list file dynamically using PHP. Or you may want
to insert the records into a queue table in the same MySQL database where
your recipients are coming from and run a cron job every X minutes to
determine if there are any records in the queue and if so to pull a set
number of them from the table and send them emails then delete the records
from the table.
--
Steve Werby
COO
24-7 Computer Services, LLC
Tel: 804.817.2470
http://www.247computing.com/
Can we see some code? I run a very similar thing (sending mails to around
500 people whose details are stored in a MySQL database and accessed via
PHP) - the only difference is my OS is NT4 not FreeBSD.
-----Original Message-----
From: Yamin Prabudy [mailto:[EMAIL PROTECTED]]
Sent: 07 February 2001 02:58
To: PHP List
Subject: [PHP] sending mail with PHP from web
Hi there,...
i had make a web interface to send announcement mail to my customers,..rite
now i had about 500
once I send mail to my customers my server hang ( i guess to much open
file)...i complie by kernel again to get a big descriptor, but still worried
about the hang problem....i put a delay in my program so it send a mail and
delay in x time, but i get a web error and my mail stop sending in my
customer number 300
sorry for the broken english
can any one help me with this kind of problem...
i get my customer from mysql table, using freebsd4.1 and php4
Yamin Prabudy
--
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, since no one seems interested in replying, I'll put it a different
way.
Does anyone know of a language-independent way to document an API? I've
thought of writing Java interfaces or using IDL, but I'd like to hear if
anyone has a better idea.
Dean.
""Dean Hall"" <[EMAIL PROTECTED]> wrote in message
95plm6$5gu$[EMAIL PROTECTED]">news:95plm6$5gu$[EMAIL PROTECTED]...
> Hope this isn't too off-topic.
>
> [Background:]
>
> I'm developing a enterprise web development platform of sorts; the details
> aren't too important, but I'm looking for a way to keep this as general as
> possible.
>
> PHP is my embedded language of choice, and I'll develop the software in
PHP
> first, but I'd first like to come up with a standardized API of sorts to
> interface with the database and provide (web developer) user
functionality.
> This way, when I (or someone else) port the application to say, Perl or
JSP
> (ColdFusion is just out! I think I'll make it a part of my license that it
> can never be ported to CF. :-) ), each implementation has a common
> interface.
>
> [Real question:]
>
> So, I've looked into using IDL (Java - CORBA) as a standardized way to
> define my API. This seems to be a decent way to do it -- although I have
no
> need to use the CORBA functionality that it provides. I just need a
> standardized way to DEFINE my API . . . for reference mostly.
>
> Has anyone dealt with this? What do you use to do this? Or is there a
> standard technique used in the industry?
>
> Thanks in advance.
> Dean.
>
>
>
> --
> 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]
>
Thanks you very much!!
Does anyone know of a PHP quick reference or documentation system for Emacs?
I have been playing around with the HTML manual, trying to get it to load
into a window based on the current function, but I'm not having much
success. Any help would be greatly appreciated!
Thank you,
Phil.
Can anyone explain this? I thought phplib was supposed to
provide a consistent interface to databases. If you depend
on the mysql and pgsql layers to work the same you are
screwed. Their connect method inconsistency is pathetic.
One function returns a value and the other does not. This
code is straight from "phplib-7.2b" If you don't believe me
download it yourself.
There are also other differences. Member var
"Halt_On_Error" exists in db_mysql but not db_pgsql. There
is no good reason for this inconsistency.
This is their "production" release. From their own website:
"This is the most current production release of PHPLIB. It
is basically a 7.2 release with some minor bugfixes, such as
..."
//------------------------------------------------------------------------------
## THIS IS IN "db_mysql.inc"
/* public: connection management */
function connect($Database = "", $Host = "", $User = "",
$Password = "") {
/* Handle defaults */
if ("" == $Database)
$Database = $this->Database;
if ("" == $Host)
$Host = $this->Host;
if ("" == $User)
$User = $this->User;
if ("" == $Password)
$Password = $this->Password;
/* establish connection, select database */
if ( 0 == $this->Link_ID ) {
$this->Link_ID=mysql_pconnect($Host, $User,
$Password);
if (!$this->Link_ID) {
$this->halt("pconnect($Host, $User, \$Password)
failed.");
return 0;
}
if (!@mysql_select_db($Database,$this->Link_ID)) {
$this->halt("cannot use database ".$this->Database);
return 0;
}
}
return $this->Link_ID;
}
//------------------------------------------------------------------------------
## THIS IS IN "db_pgsql.inc"
function connect() {
if ( 0 == $this->Link_ID ) {
$cstr = "dbname=".$this->Database.
$this->ifadd($this->Host, "host=").
$this->ifadd($this->Port, "port=").
$this->ifadd($this->User, "user=").
$this->ifadd($this->Password, "password=");
$this->Link_ID=pg_pconnect($cstr);
if (!$this->Link_ID) {
$this->halt("Link-ID == false, pconnect failed");
}
}
} // !!!!!!!!! WHERE IS THE DAMN RETURN
VALUE???????????!!!!!!!!!
//------------------------------------------------------------------------------
--
Jeff Greer
- B.S. computer science - Univ. MO - Rolla
- web developer/software engineer,
dedicated to the struggle against the fascist
Microsoft hegemony
I am looking for someone able to do PHP contract or consulting work in
Tel-Aviv Israel,
Please write directly to me: [EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>
Thanks
==============================
Shimon Dekel, Israeli Vegetable Board
Information System Manager
2 Karlibach St Tel-Aviv 67132
<mailto:[EMAIL PROTECTED]> [EMAIL PROTECTED]
<http://www.yerek.co.il> www.yerek.co.il
==============================
Hello !!
I have one problem with mysql database. In table i have 2 arrays with time
format.
For example this arrays calls IN and OUT. In php script i want to have
distinction between
this arrays. For example IN is 8:30:45 and OUT is 16:45:15 and result
will be: 8:14:30. Exists any function which do this. Tnanx.
Roman
"Roman" <[EMAIL PROTECTED]> wrote:
> I have one problem with mysql database. In table i have 2 arrays with time
> format.
> For example this arrays calls IN and OUT. In php script i want to have
> distinction between
> this arrays. For example IN is 8:30:45 and OUT is 16:45:15 and result
> will be: 8:14:30. Exists any function which do this. Tnanx.
If your MySQL fields are a datetime type (YYYY-MM-DD hh:mm:ss) then you can
convert them to seconds since epoch (Jan 1, 1970 at midnight) and then
calculate the difference and divide by a number to get appropriate units.
Below is a set of functions I wrote to do that. Before I get to that here's
a simpler solution:
// $time = "16:45:15";
$time_array = explode( ":", $time);
// $time[0] = 16, $time[1] = 45, $time[2] = 15
$time_since_midnight = $time[0] * 3600 + $time[1] * 60 + $time[2];
// Do this conversion for both times, subtract and convert units.
function get_mysql_to_epoch( $date )
{
list( $year, $month, $day, $hour, $minute, $second ) = split(
"([^0-9])", $date );
return date( "U", mktime( $hour, $minute, $second, $month, $day,
$year ) );
}
function get_elapsed_time( $time_start, $time_end, $units = "seconds",
$decimals = "2" )
{
$divider[years] = ( 60 * 60 * 24 * 365 );
$divider[months] = ( 60 * 60 * 24 * 365 / 12 );
$divider[weeks] = ( 60 * 60 * 24 / 7 );
$divider[days] = ( 60 * 60 * 24 );
$divider[hours] = ( 60 * 60 );
$divider[minutes] = ( 60 );
$divider[seconds] = 1;
$elapsed_time = ( ( get_mysql_to_epoch( $time_end ) -
get_mysql_to_epoch( $time_start ) )
/ $divider[$units] );
$elapsed_time = sprintf( "%0.{$decimals}f", $elapsed_time );
return $elapsed_time;
}
<?php
// Usage example
$time_in = "2000-06-14 06:30:00";
$time_out = "2000-12-22 13:45:00";
// Full use of function.
echo "<br>Days: ";
echo get_elapsed_time( $time_in, $time_out, "days", "3" );
// Use defaults for units and decimal places.
echo "<br>Seconds: ";
echo get_elapsed_time( $time_in, $time_out );
?>
--
Steve Werby
COO
24-7 Computer Services, LLC
Tel: 804.817.2470
http://www.247computing.com/
Hi,
i've installed latest apache and php.. and find out that the
image* functions dosen't work ..
apache_1.3.17
freetype-2.0.1
gd-1.8.4
jpeg-6b
php-4.0.4pl1
are compiled & installed without any whine ..
--
Terv.
\-^-/
( o o )
v - Idiots try to maintain order, We can control chaos.
/ \
_______o00o___o00o______________________
' : Lauri 'Suni' Jakku - Contact info `,
`----------------------------------------'
| | Cellular phone : +358 40 823 6353
| | Phone : +358 6 321 6159
| | email : [EMAIL PROTECTED]
| | Address : Ahventie 22-24 N 150/1, 62500 Vaasa
´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´
On Wed, 7 Feb 2001 17:52, Lauri Jakku wrote:
> Hi,
> i've installed latest apache and php.. and find out that the
> image* functions dosen't work ..
>
> apache_1.3.17
> freetype-2.0.1
> gd-1.8.4
> jpeg-6b
> php-4.0.4pl1
>
> are compiled & installed without any whine ..
What do you mean 'don't work'? Are there error messages? Create a
document with just
<?php phpinfo() ?>
in it and see if in fact GD support etc are enabled in PHP
--
David Robley | WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/
AusEinet | http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA
On Tue, 6 Feb 2001, Brandon Orther wrote:
> Hello
>
> I am making a php script that make an image with the text that I send to the
> script. What I was wondering is if there was an anti-alias function in GD
> for my test.
>
i've made one that has zoom function and 4 buildin styles done with php's
default fonts. if some one knows antialias related stuff please inform :)
--
Terv.
\-^-/
( o o )
v - Idiots try to maintain order, We can control chaos.
/ \
_______o00o___o00o______________________
' : Lauri 'Suni' Jakku - Contact info `,
`----------------------------------------'
| | Cellular phone : +358 40 823 6353
| | Phone : +358 6 321 6159
| | email : [EMAIL PROTECTED]
| | Address : Ahventie 22-24 N 150/1, 62500 Vaasa
´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´
Javier Muniz wrote:
>
> In my experience this is caused by an error in your .xsl... not exactly
> the most verbose error so I don't know what's actually happening here.
>
> -jm
>
Yup, it is, to correct this, place the following function in your xslt
document::
function report_xslt_error($parser, $code, $level, $messages)
{
echo "Parser: $parser";
echo "\n<br>\n";
echo "Code: $code";
echo "\n<br>\n";
echo "Level: $level";
echo "\n<br>\n";
echo "Messages: ";
echo "\n<br>\n";
var_dump($messages);
}
And then before the xslt_run() function call place the following::
xslt_set_error_handler($parser, 'report_xslt_error');
And you will see a verbose listing of the errors.
Or you can upgrade to the latest cvs which output's a correct error!
-Sterling
Dear folks,
Anybody out there with experience using Alternative PHP Cache
(http://apc.communityconnect.com)? I am at a loss for information regarding
its use with PHP, specifically, Zend Optimizer. Thanks in advance.
Herman
As far as I unterstood: No! The variables however should be accessible
directly (*sic*). I wonder why there is no nice example documented how to
take advantage of objects in PHP sessions. I'd really appreciate any hints!
bye Matthias
Matthias Krehl
[EMAIL PROTECTED]
> -----Ursprüngliche Nachricht-----
> Von: Conover, Ryan [mailto:[EMAIL PROTECTED]]
> Gesendet: Dienstag, 6. Februar 2001 19:39
> An: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Betreff: Sessions and Objects
>
>
> If I save an object as a session var. will I still have access to its
> methods.
>
> Ryan
>
On Tuesday 06 February 2001 19:39, Conover, Ryan wrote:
> If I save an object as a session var. will I still have access to its
> methods.
Yes, at least with PHP4. I'm doing that all the time.
--
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)
"Software is like sex: the best is for free" -- Linus Torvalds
YES, it's true this list is realy cool, every one get help in an
effective maner;
even beginers in PHP like me.
A major THANK YOU for all of you...
Marc
Josh G wrote:
>
> Just a thanks to everyone on this list, for being helpful, and for
> being tolerant. It seems it's a rare thing these days.
>
--
/*======================================================*/
/* Fourny ElectronicEDiting (FEED) */
/* */
/* Multimedia development for CD-ROM & the WEB */
/* Marc + Jacqueline Fourny */
/* */
/* http://www.bluekangaroo.ch (your English Bookshop) */
/* */
/*======================================================*/
Hi,
If I load e.g. textfile.txt with the file pointer at the beginning of the
file and write a line or two into it, does it always overwrite the first
lines? Is there any function that *always* moves the old lines down
automatically?
Regards,
Sumarlidi Einar Dadason
SED - Graphic Design
------------------------------------------
Phone: (+354) 4615501
Mobile: (+354) 8960376
Fax: (+354) 4615503
E-mail: [EMAIL PROTECTED]
Homepage: www.sed.is <- New Homepage!
------------------------------------------
On Wednesday 07 February 2001 09:42, SED wrote:
> If I load e.g. textfile.txt with the file pointer at the beginning of
> the file and write a line or two into it, does it always overwrite the
> first lines?
Yes
> Is there any function that *always* moves the old lines
> down automatically?
No. You'll have to code that yourself (read file - add lines - write file)
--
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)
"Software is like sex: the best is for free" -- Linus Torvalds
Hello derek,
Tuesday, February 06, 2001, 7:58:25 PM, you wrote:
df> Hi Max,
df> Thanks for the reply. Unfortunately, the solution you suggest means
df> that I would have to do a set_var on all hyperlinks (i.e., define all
df> hyperlinks everywhere on the site), which is a huge amount of
df> maintenance. What I thought about yesterday was creating some sort
df> of token (e.g., {@@@@@}) that could be tacked onto the end of
df> hyperlinks that I want to add session info to.
Of course, you can have static hyperlinks in your template, ending
with, say, {sessinfo},
e.g. <a href='somedir/somescript.php{sessinfo}'>blabla</a>
and then in the script:
$tpl->set_var('sessinfo', ((SID) ? '?'.SID : ''))
df> Maybe there's a
df> better way... I don't know! :(
Another way is to turn output buffering on before processing the
template, and after $tpl->pparse(...) save the buffer, and apply a
regexp to it, which would append session info to every link on the
page.
And the last, should-be the best way. Compile PHP with
--enable-trans-sid and forget about manual appending the session info
to the links and forms.
--
Best regards,
Max A. Derkachev mailto:[EMAIL PROTECTED]
Symbol-Plus Publishing Ltd.
phone: +7 (812) 324-53-53
http://www.Books.Ru -- All Books of Russia
�
Hi!
I need help with uploading files with php.
What is the default directory where the files are
uploaded..?
I want to specify a particular directory where the
files have to come after they are uploaded.
Is it possible to specify a path in the script where
the files will automatically be copied after uploading
to the temporary directory.
Please help me out ...
Thank You
Dhaval Desai
__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices.
http://auctions.yahoo.com/
On Wed, 7 Feb 2001, Dhaval Desai wrote:
> Hi!
>
> I need help with uploading files with php.
> What is the default directory where the files are
> uploaded..?
/tmp ... file name is php(n) where 'n' is an incrementing number
> I want to specify a particular directory where the
> files have to come after they are uploaded.
> Is it possible to specify a path in the script where
> the files will automatically be copied after uploading
> to the temporary directory.
>
TEMPDIR environment variable
Mick
Anyone know of a good host that has php built with pdflib? I'm setting
one up myself right now, but I can't with any conscience recommend that
to a client who needs this option.
I need the host to have super tech support. I just got off a host that
when I asked them to add a pop3 mail account (It was bad enought they
wouldn't let me do that myself), they accidentally wiped my whole
account, reset it, and acted like nothing had happened and I wouldn't
notice my shit was gone.
It's kind of funny in hind sight.
Thanks!
Lux
--
John Luxford
Simian Systems
w: www.simian.ca
e: [EMAIL PROTECTED]
p: 204.946.5955
--
--
John Luxford
Simian Systems
w: www.simian.ca
e: [EMAIL PROTECTED]
p: 204.946.5955
--
You're setting one what up yourself? A hosting company?
Or just a hosting situation for yourself?
Won't get much play here, but anyone looking to do anything
serious should undoubtedly invest in a dedicated server of
their own. Hire another company to host and manage it, but have it to
yourself. Invest in a backup plan. There are a fair number of
hosts in the <$300/month range, including decent bandwidth
and some included support hours.
In one instance, I am paying ~$100/month for a dedicated server,
which I can remotely admin as I please, but there's always someone to
call for the infrequent reboot, or "please install/upgrade package X", etc.
They've since raised their rates, but I was 'grandfathered' in. :)
Most of the basic stuff people need done can be done thru webmin,
a decent package in its own right. Adding a POP3 account for someone
should be a 2 minute job, and I don't think I've ever had the *ability*
to erase accounts setting up another emailbox. I don't even know
how you'd accomplish both tasks at the same time.
Again, if you're doing anything serious, and need accountability,
I insist that, while spending thousands isn't a guarantee of anything
(clients paying 5 figures/month for hosting STILL have problems
that go unresolved for days), trying to get 'super support' from a company
you're only paying $20/month to just won't happen. Not as a fundamental
business policy - you might get good support, then bad support.
<stepping off soapbox>
The php.net page has the list of hosts on it someplace that support PHP,
and there are dozens of 'host lists' on the web. I'm happy to share my
experiences
with people offlist if anyone wants to contact me.
Lux wrote:
> Anyone know of a good host that has php built with pdflib? I'm setting
> one up myself right now, but I can't with any conscience recommend that
> to a client who needs this option.
>
> I need the host to have super tech support. I just got off a host that
> when I asked them to add a pop3 mail account (It was bad enought they
> wouldn't let me do that myself), they accidentally wiped my whole
> account, reset it, and acted like nothing had happened and I wouldn't
> notice my shit was gone.
>
> It's kind of funny in hind sight.
>
> Thanks!
>
> Lux
>
> --
>
> John Luxford
> Simian Systems
>
> w: www.simian.ca
> e: [EMAIL PROTECTED]
> p: 204.946.5955
Hi!
After compiling mod_perl into Apache, httpd crashes. ???? Any ideas????
php 4.0.4pl1 Apache 1.3.12 mod_perl latest ;) (1.25 if i good remember ;)
--
Thomas
On Wednesday 07 February 2001 10:13, Andrzej Roszkowski wrote:
> After compiling mod_perl into Apache, httpd crashes. ???? Any ideas????
> php 4.0.4pl1 Apache 1.3.12 mod_perl latest ;) (1.25 if i good remember
IIRC the INSTALL mentioned possible conflicts in MySQL support for these
modules. Have a closer look at it again.
--
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)
"Software is like sex: the best is for free" -- Linus Torvalds
Hi php users,
I found something strange and don't know if it is a bug or that it is the
way it should work.
Situation:
----------
open_basedir = .
PHP-4 runs as apache module. (unix)
Safe-mode is on.
Webserver document tree:
/home/www/html/
There exists a link in that tree to the www directory of a user:
/home/www/html/rvdberg -> /home/rvdberg/www
I have a PHP script in:
/home/rvdberg/www/test_fopen.php
and a file:
/home/rvdberg/www/textfile.txt
Problem:
---------
When opening files in the current directory with PHP:
$fp = fopen("./textfile.txt","r");
This gives an error complaining about the open_basedir setting not allowing
to open this file.
It all DOES work when I do the same thing in a directory which isn't
pointed to by a symbolic link! So, the same php file in the directory
/home/www/html/php_testdir/test_fopen.php
works!?
Question:
---------
What I want is clear I think: I only want the php scripts to be able to
open files in the current directory and further down in the tree.
Setting open_basedir to "." seems logical, but doesn't work.
Seems to be related to the symbolic link.
How to solve? Or should I submit a bug report?
-Remco
--
----------------------------------------------------------------------------
Remco van den Berg Admin/SO/helpdesk DSE
ICQ: 47514668 [EMAIL PROTECTED] http://www.dse.nl/
----------------------------------------------------------------------------
Hi !
I've been trying to compile apache with php4.04pl1 as a static module into
apache 1.3.17. configure, make and make install works fine with php. When I
get to apache configure works but when trying to run make I get an error.
configure is run with:
./configure --prefix=/usr/local/apache --activate-module=src/modules/php4/li
bphp4.a
If I exclude --activate-module the make and make installs succeed.
I also tried to use php4.03pl1 instead, which works fine. With php4.04pl1 on
apache 1.3.14 I get the same result.
The error I get is the following:
gcc -c -I./os/unix -I./include -DLINUX=22 -I/home/eric/src/php-4.0.4pl1 -
I/home/eric/src/php-4.0.4pl1/main -I/home/eric/src/php-4.0.4pl1/main -I/home
/eric/src/php-4.0.4pl1/Zend -I/home/eric/src/php-4.0.4pl1/Zend -I/home/eric/
src/php-4.0.4pl1/TSRM -I/home/eric/src/php-4.0.4pl1/TSRM -I/home/eric/src/ph
p-4.0.4pl1 -DUSE_EXPAT -I./lib/expat-lite -DNO_DL_NEEDED `./apaci` modules.c
gcc -c -I./os/unix -I./include -DLINUX=22 -I/home/eric/src/php-4.0.4pl1 -
I/home/eric/src/php-4.0.4pl1/main -I/home/eric/src/php-4.0.4pl1/main -I/home
/eric/src/php-4.0.4pl1/Zend -I/home/eric/src/php-4.0.4pl1/Zend -I/home/eric/
src/php-4.0.4pl1/TSRM -I/home/eric/src/php-4.0.4pl1/TSRM -I/home/eric/src/ph
p-4.0.4pl1 -DUSE_EXPAT -I./lib/expat-lite -DNO_DL_NEEDED `./apaci`
buildmark.c
gcc -DLINUX=22 -I/home/eric/src/php-4.0.4pl1 -I/home/eric/src/php-4.0.4pl1/
main -I/home/eric/src/php-4.0.4pl1/main -I/home/eric/src/php-4.0.4pl1/Zend -
I/home/eric/src/php-4.0.4pl1/Zend -I/home/eric/src/php-4.0.4pl1/TSRM -I/home
/eric/src/php-4.0.4pl1/TSRM -I/home/eric/src/php-4.0.4pl1 -DUSE_EXPAT -I./li
b/expat-lite -DNO_DL_NEEDED `./apaci` \
-o httpd buildmark.o modules.o modules/standard/libstandard.a
modules/php4/libphp4.a main/libmain.a ./os/unix/libos.a ap/libap.a
lib/expat-lite/libexpat.a -Wl,-rpath,/usr/local/mysql//lib -rdynamic -L/us
r/local/mysql//lib -Lmodules/php4 -L../modules/php4 -L../../modules/php4 -lm
odphp4 -lpam -ldl -lmysqlclient -lresolv -lm -ldl -lcrypt -lnsl -lresolv
-lm -lcrypt
/usr/local/mysql//lib/libmysqlclient.a(my_compress.o): In function
`my_uncompress':
my_compress.o(.text+0x97): undefined reference to `uncompress'
/usr/local/mysql//lib/libmysqlclient.a(my_compress.o): In function
`my_compress_alloc':
my_compress.o(.text+0x12b): undefined reference to `compress'
collect2: ld returned 1 exit status
make[2]: *** [target_static] Error 1
make[2]: Leaving directory `/home/eric/src/apache_1.3.17/src'
make[1]: *** [build-std] Error 2
make[1]: Leaving directory `/home/eric/src/apache_1.3.17'
make: *** [build] Error 2
I guessed there was some problems with the mysqlpart in php, and maybe that
the mysql version was wrong or something, but I tried several different
versions of mysql.
I must be something funny with php4.04pl1 or something else?
Any help or suggestions would be appreciated!
Best regards,
Eric
On Tuesday 06 February 2001 18:18, April wrote:
> How do you pass an array as an argument to a function?
Just as any other variable. Read on...
> function process_members($asker_rank, $email) {
>
> global $database_mysql;
> mysql_select_db($database_mysql);
>
> while (list ($key, $val) = each ($email)) {
> echo "$key => $val<br>";
> }
>
> }
> ######### Doing the same thing with the function here returns this
> error, though. ########
> // Warning: Variable passed to each() is not an array or object in
> lib.inc on line 447
> process_members($asker_rank, $total_members, $email);
Look at the definition of process_members() again. The function takes two
values. The first is called $asker_rank and the second $email.
Now you pass *three* values to it. #1, $asker_rank, is fine. But #2,
$total_members, is passed in place of $email, so every time the function
body accedded its "$email" parameter, it gets the value of $total_members
- which is not an array.
The third parameter is ignored.
--
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)
"Software is like sex: the best is for free" -- Linus Torvalds
On Tuesday 06 February 2001 19:07, Vora Vor wrote:
> > "Fatal error: Cannot instantiate non-existent class: com in
> /var/www/html/version2/file.php on line 8" is the result of running the
> following code:
>
> <?
> $word=new COM("word.application") or die("Cannot start word");
> print "Loaded word version ($word->Version)\n";
> $word-visible =1 ;
> ?>
>
> Why?
You didn't define a class "COM".
(1) You did write such a class, right? It does not come with PHP
(2) function names are case sensitive
--
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)
"Software is like sex: the best is for free" -- Linus Torvalds
COM of course comes with PHP (but is available on Win only), RTFM on calling
COM support...
Pavel
----- Original Message -----
From: "Christian Reiniger" <[EMAIL PROTECTED]>
To: "php" <[EMAIL PROTECTED]>
Sent: Wednesday, February 07, 2001 11:49 AM
Subject: Re: [PHP] Com
On Tuesday 06 February 2001 19:07, Vora Vor wrote:
> > "Fatal error: Cannot instantiate non-existent class: com in
> /var/www/html/version2/file.php on line 8" is the result of running the
> following code:
>
> <?
> $word=new COM("word.application") or die("Cannot start word");
> print "Loaded word version ($word->Version)\n";
> $word-visible =1 ;
> ?>
>
> Why?
You didn't define a class "COM".
(1) You did write such a class, right? It does not come with PHP
(2) function names are case sensitive
--
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)
"Software is like sex: the best is for free" -- Linus Torvalds
--
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]
On Wednesday 07 February 2001 11:52, Pavel Kalian wrote:
> COM of course comes with PHP (but is available on Win only), RTFM on
> calling COM support...
Yes, but there ain't no class "COM". Read the manual section about COM
support.
--
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)
"Software is like sex: the best is for free" -- Linus Torvalds
The COM construct was introduced in PHP4 as a replacement for com_*
functions to provide something looking similar to MS's syntax AFAIK and it
exists and works at least for me and many others. And it behaves more or
less like a normal class.
Cheers
Pavel
----- Original Message -----
From: "Christian Reiniger" <[EMAIL PROTECTED]>
To: "php" <[EMAIL PROTECTED]>
Sent: Wednesday, February 07, 2001 12:20 PM
Subject: Re: [PHP] Com
On Wednesday 07 February 2001 11:52, Pavel Kalian wrote:
> COM of course comes with PHP (but is available on Win only), RTFM on
> calling COM support...
Yes, but there ain't no class "COM". Read the manual section about COM
support.
--
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)
"Software is like sex: the best is for free" -- Linus Torvalds
--
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]
On Wednesday 07 February 2001 12:40, Pavel Kalian wrote:
> The COM construct was introduced in PHP4 as a replacement for com_*
> functions to provide something looking similar to MS's syntax AFAIK and
> it exists and works at least for me and many others. And it behaves
> more or less like a normal class.
Hmm, it's at least not mentioned in the manual.
--
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)
"Software is like sex: the best is for free" -- Linus Torvalds
Anyone has good examples for COM usage?
D.
-----Original Message-----
From: Christian Reiniger [mailto:[EMAIL PROTECTED]]
Sent: woensdag 7 februari 2001 12:48
To: php
Subject: Re: [PHP] Com
On Wednesday 07 February 2001 12:40, Pavel Kalian wrote:
> The COM construct was introduced in PHP4 as a replacement for com_*
> functions to provide something looking similar to MS's syntax AFAIK and
> it exists and works at least for me and many others. And it behaves
> more or less like a normal class.
Hmm, it's at least not mentioned in the manual.
--
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)
"Software is like sex: the best is for free" -- Linus Torvalds
--
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]
On Tuesday 06 February 2001 20:03, Joel Alan Chornik wrote:
> is there an equivalent in PHP to Perl´s binmode() function?
> does anyone know?
See the docs for fopen ()
---
The mode may contain the letter 'b'. This is useful only on systems
which differentiate between binary and text files (i.e., it's useless on
Unix). If not needed, this will be ignored
---
--
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)
"Software is like sex: the best is for free" -- Linus Torvalds
Dear all,
Pardon me if this is explained somewhere in the
documentation. I've found the :: notation (double colons) in class
definitions of PHP's ~/lib/php directory, such as DB.php. It looks like
doing the same thing as -> notation. Can someone help to explain this a
little bit or provide links to the explaination? Thanks a lot!
Chien-pin
On Wednesday 07 February 2001 00:47, Chris wrote:
> Is it possible to access IO ports with PHP, specifically the parallel
> port. I would like to do this with php, not printing functions, but
> access to the port, like being able to control LED's, etc. I didn't see
> any functions in php for that so I think I probably have to use C or
> something.
Yes, use C. PHP doesn't have such functionality, nor should it have it.
--
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)
"Software is like sex: the best is for free" -- Linus Torvalds
Hello
I have a script that use other script file(php) twice, I call a function with certain
parameters and call it again with other parameters and when runnig the script, the
first function works well, but on second time I got a error message: "Fatal error:
Cannot redeclare getndays() in Unknown on line 5".
Anyone kows what is my problem ???
T.Y.
Miguel Loureiro <[EMAIL PROTECTED] >
Try require_once($your_file) or verify in $your_file use the function
function_exists()
[]'s
------------------------
Frederico Augusto Costa
[EMAIL PROTECTED]
------------------------
On Wed, 7 Feb 2001, Miguel Loureiro wrote:
> Hello
> I have a script that use other script file(php) twice, I call a function with
>certain parameters and call it again with other parameters and when runnig the
>script, the first function works well, but on second time I got a error message:
>"Fatal error: Cannot redeclare getndays() in Unknown on line 5".
> Anyone kows what is my problem ???
> T.Y.
> Miguel Loureiro <[EMAIL PROTECTED] >
>
>Did you happen to copy the php4ts.dll into the winnt directory? I am not
>sure of the error you are getting, but it may help?????
I have all my dlls in a separate php directory since they are never going to
be shared with anything else. I'm sure that this is not the problem, as a
simple echo'hello' script will sometimes work, so the dll definitely gets
loaded.
Cheers
--
Phil Driscoll
Dial Solutions
+44 (0)113 294 5112
http://www.dialsolutions.com
http://www.dtonline.org
> One exception, on the main page, I have "index.html" which is simply a
> copy of "Index.php" renamed. This is so that requests to www.server.org/
> will come up correctly.
>
> Probably there's a place to fix that in apache, but I haven't gone after
it
> yet.
There is a way to fix this on Apache, and a very easy one at that.
Go into your httpd.conf file and look for a set of lines that look something
like:
<IfModule mod_dir.c>
DirectoryIndex index.php index.shtml
</IfModule>
The DirectoryIndex directive lists, in order, which pages the server should
look for when it receives a request ending in /. As you can see, my config
looks for an index.php file, followed by an index.shtml file. If it fails
for both of these, I *think* it will return an HTTP 404 error.
HTH
Jon
Try this:
http://www.zend.com/codex.php?id=39&single=1
Just replace the fopen() and eregi() to suit your needs.
// Tobias
""David Tandberg-Johansen"" <[EMAIL PROTECTED]> wrote in message
95onrm$dj6$[EMAIL PROTECTED]">news:95onrm$dj6$[EMAIL PROTECTED]...
> Hello!
>
> I try to get some information from an public DB to controll that the users
> input is right.
>
> I can access the DB via http, so I dont have to logg in to it
>
> The public DB write out and plain HTML page.
>
> I want to check if only one of the records is the same as the user input.
I
> am only using the information in public DB to verify, and nothing else.
>
> Example of output from DB:
> *********************************
> Name : Joe
> Lastname: Doe
> Userid: 45545654 /*this is the information I wants
> City: New York
> *********************************
>
> I figured out that I have to use fopen () and fread().
>
> Could anyone give mes some hints!
>
> Thank's
>
> David
>
>
>
> --
> 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]
>
Thomas Jaske wrote:
> Which template can I use to do this simply?
>
> $template = new Template();
> $template->assign(content_item, placeholder);
> $page = template($template_file);
> $page->print();
With PHPlib-Templates, it would look like this:
$template = new Template("./path/to/template/files");
$template->set_file("anyname",$filename);
$template->set_var("placeholder","content");
$template->pparse("anyname");
Wagner
--
Three may keep a secret, if two of them are dead.
There isn't an easy way as the form is filled in client side (and is html
not PHP). Work out the info you need to plug Into the SQL command line
(ALTER or CREATE TABLE). Build a form asking for that info and have it
submit to the same page which does the PHP and SQL bit using the filled in
fields from the form.
Tim Ward
Senior Systems Engineer
Please refer to the following disclaimer in respect of this message:
http://www.stivesdirect.com/e-mail-disclaimer.html
> -----Original Message-----
> From: Jaxon [mailto:[EMAIL PROTECTED]]
> Sent: 04 February 2001 23:18
> To: [EMAIL PROTECTED]
> Subject: db forms creator?
>
>
> Hi, can anyone point me towards an easy way to generate forms
> to update a
> mysql database?
>
> I've seen some sites where I can specify a list of table
> fields and the
> datatype for each, and get an output of:
>
> 1. the sql to create the table
> 2. a php form that can be used to update the table
>
> problem is I can't find the site now :)
>
> has anyone else found this?
>
> Regards,
> jaxon
>
>
Hello,
For an e-commerce project we want to connect
the mySQL-database we created to a printer
(attached to a computer which has 24h
internet [and mySQL database] access). I
assume it's different to couple the
mySQL-database directly to a printer.
We are however accessing the database via
PHP, so I think it might be possible to send
a command to a printer directly from the PHP
file which puts the data into the database as
well.
We want to do this in order to have an order
via the website printed directly. In fact,
the printer should start printing as soon as
an order is added to the seperate table in
the mySQL database (by a special PHP
document).
Does anyone know whether this is possible
and, if it's possible, could you tell me how?
Thanks in advance,
Thomas.
Thomas,
You don't connect databases to printers. As you discerned, you could use a
program to query the database and output the results to a printer.
I f you absolutely MUST have it start printing AS SOON as the order is
inserted into the database (and I challenge you to re-think that
requirement) then the PHP script that adds it to the database needs to also
output it to the printer. This might be the easiest way anyhow.
Sorry, I've never tried to print from PHP so I don't know the specifics but
one possible way to do it would be to open a file handle to your printer and
write to it like it were any other file. My preference would be to write
the order out to a file and then issue a system command to print that file.
Cal
http://www.calevans.com
-----Original Message-----
From: ThoVer Webproducties [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 07, 2001 7:33 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Access a printer via PHP
Hello,
For an e-commerce project we want to connect
the mySQL-database we created to a printer
(attached to a computer which has 24h
internet [and mySQL database] access). I
assume it's different to couple the
mySQL-database directly to a printer.
We are however accessing the database via
PHP, so I think it might be possible to send
a command to a printer directly from the PHP
file which puts the data into the database as
well.
We want to do this in order to have an order
via the website printed directly. In fact,
the printer should start printing as soon as
an order is added to the seperate table in
the mySQL database (by a special PHP
document).
Does anyone know whether this is possible
and, if it's possible, could you tell me how?
Thanks in advance,
Thomas.
--
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]
If I'd sent $5 off for every spam I've received someone else would be a
millionaire by now.
-----Original Message-----
From: Duncan Hill [mailto:[EMAIL PROTECTED]]
Sent: 06 February 2001 21:00
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Dear Friends & Future Millionaire:
On 2001-02-06, Hi Tech Services did say,
>
> AS SEEN ON NATIONAL TV:
<snip>
> PLACE YOUR ORDER FOR THESE REPORTS NOW :
> ====================================================
> REPORT# 1: The Insider's Guide to Advertising for Free on the Net
Can we _please_ get the full headers for this message? The list
software seems to strip them right off.
--
Sapere aude
My mind not only wanders, it sometimes leaves completely.
--
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]
From: "Jon Haworth" <[EMAIL PROTECTED]>
Sent: Wednesday, February 07, 2001 4:01 PM
> If I'd sent $5 off for every spam I've received someone else would be a
> millionaire by now.
And if I had $5 for every time somebody on a mailing list commented a spam
mail that went through the list, I'd be equally rich. :-)
No offense Duncan and Jon, but you're actually increasing the traffic as
much as the spammer himself. Just ignore the spam, let it pass through.
Now somebody will probably tell me I'm doing exactly the same by mentioning
this to you... ;-)
- Carsten
I am trying to update a table with data from another table within the same
database with the following SQL
UPDATE common SET common.[Extended Description] = extended.[Extended
Description] WHERE common.[id] = extended.[Extended Description]
the id is the primary key. I keep getting the following error.
Server: Msg 107, Level 16, State 3, Line 1
The column prefix 'extended' does not match with a table name or alias name
used in the query.
Server: Msg 107, Level 16, State 1, Line 1
The column prefix 'extended' does not match with a table name or alias name
used in the query.
Anyone have any ideas.
Ryan
Hi, all.
HTTP Authentication in PHP 4 - Apache don't work!!!
Help me.
Best.
__________________________________________________
<?php
if(!isset($PHP_AUTH_USER)) {
Header("WWW-Authenticate: Basic realm=\"My Realm\"");
Header("HTTP/1.0 401 Unauthorized");
echo "Text to send if user hits Cancel button\n";
exit;
} else {
echo "Hello $PHP_AUTH_USER.<P>";
echo "You entered $PHP_AUTH_PW as your password.<P>";
}
?>
Hi,
I want to know why in the second file I don't get
a=134 as expected.
// fileToBeIncluded.php
<?PHP
$a = 134;
function f1() {
global $a;
echo "a=$a <BR>";
}
class smallClass {
function smf1() { f1(); }
}
?>
// file that don't work as expected
// print a=
<?PHP
function f2()
{
include ('./fileToBeIncluded.php');
f1();
}
echo "<html>";
f2();
echo "</html>";
?>
// file that work as expected
// print a=134
<?PHP
include('./fileToBeIncluded.php');
function f2() {
f1();
}
echo "<html>";
f2();
echo "</html>";
?>
[EMAIL PROTECTED]
TO BE REMOVED FROM FUTURE MAILINGS, SIMPLY REPLY TO THIS
MESSAGE AND PUT
"REMOVE" IN THE SUBJECT.
20 MILLION
E-MAIL ADDRESSES
FOR ONLY $249
**Over Night International Shipping Included**
Many Call This "The "Perfect E-Mail List"
Over 20-Million Of The Best E-Mail Addresses Available
_/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/
Our research has found that many people have tried one or more of
the following...
Free Classifieds? (Don't work anymore)
Web Site? (Takes thousands of visitors)
Banners? (Expensive and losing their punch)
E-Zine? (Hope they have a *huge* subscriber list)
Search Engines? (Forget it, unless you're in the top 20)
S O W H A T W I L L W O R K ?
Although often misunderstood, there is one method that has proven
to succeed time-after-time.
E - M A I L M A R K E T I N G ! !
IT'S A FACT... If you're not using your computer to generate
income, GOOD income, you're leaving money on the table.
Here's what the experts have to say about E-Mail Marketing:
"E-mail is an incredible lead generation tool"
-Crains Magazine
"A gold mine for those who can take advantage of
bulk e-mail programs" - The New York Times
"Blows away traditional Mailing" - Advertising Age
Here's an example of your potential earnings if you have a
product or service that brings you a profit of around $30.
Remember, on the Internet, you can make money 7 days a week, 24
hours a day... even while you sleep, orders come from all over
the world!
Orders
Per Day Weekly Monthly Yearly
1 $ 210 $ 840 $ 10,080
2 420 1,680 20,160
3 630 2,520 30,240
5 1,050 4,200 50,400
10 2,100 8,400 100,000
15 3,150 12,600 151,200
THE QUESTION IS... how do you generate those orders?
The least expensive and fastest way is through E-Mail Marketing.
You want to make some money?
I can put you in touch with over 20 million people at virtually no cost.
Can you make one cent from each of theses names?
If you can you have a profit of over $200,000.00
That's right, I have over 20 Million Fresh email
addresses that I will sell for only $249. These are all
fresh addresses that include almost every English person
on the Internet today, with no duplications. They are
all sorted and ready to be mailed. That is the best
deal anywhere today!
Don't believe it? People are making that kind of
money right now by doing the same thing, that is
why you get so much email from people selling you
their product....it works!
These 20 Million email addresses are
yours to keep, so you can use them over and
over.
This offer is not for everyone. If you can not
see just how excellent the risk / reward ratio
in this offer is then there is nothing I can do
for you. To make money you must stop dreaming
and TAKE ACTION.
Over the past 2 years, we have gained a reputation for having the
cleanest, most responsive e-mail address lists in the industry.
No one has gone to the work it takes to produce an e-mail address
list of this quality.
Here's how we prepare our e-mail lists:
1. We clean and eliminate all duplicates.
2. Next, we use a filter list of 400+ words/phrases to clean even
more. No address with inappropriate or profane wording survives!
3. Then we use our private database of thousands of known
Internet "extremists", those opposed to any kind of commercial
e-mail, and kicked off every one we could find.
4. All domains were verified to insure they're valid.
5. And finally, we sorted the list into easy-to-manage packets of
20,000 addresses in simple text (.txt) format that will work with
any computer operating system.
******************************************
It is time to order!
Shipping is not an issue.
******FedEx next day world wide shipping included********
As soon as we receive payment we will FedEx your e-mail list via
CD straight to your door anywhere in the world FedEx next day guaranteed.
******International Orders Welcome*********
US funds paid via paypal.com welcomed
PayPal is now available in the following countries:
Australia
Austria
Belgium
Brazil
Canada
Denmark
France
Germany
Hong Kong
Ireland
Israel
Italy
Japan
Mexico
Netherlands
New Zealand
Norway
Portugal
Singapore
South Africa
South Korea
Spain
Sweden
Switzerland
United Kingdom
PayPal.com is very easy to sign up to. They accept wire transfers,
checks and credit cards from any of the countries listed above.
This payment process is in your own interest of safety. Paypal.com
processes all transactions and keeps all your personal information
secret. After signing up please send the U.S. equivalent of $249
to [EMAIL PROTECTED] last name Smith.
If there is another way you would like to pay please e-mail me
at [EMAIL PROTECTED] and I will get back to you.
*******Wondering out how to send 20 million E-mails********
I will tell you how/where to download the softwhere you need for free
Please NOTE:
Congress shall make no law respecting an establishment of religion, or
prohibiting the free exercise thereof, or abridging the freedom of speech
or of the press; or the right of the people peaceably to assemble, and to
petition the Government for a redress of grievances.
Amendment I, The US Constitution
Hi List,
Can any body suggest / recommend me a good web hosting provider ?.
I want to register some domains and host with the same provider which
essentially has php, mysql, postgresql & good support.
Pls. let me know.
Thanks in adv.
~ Karthick
Greets,
I have a quick question:
$Array = array(
"val1" => "Value 1",
"val2" => "Value 2",
"val3" => "Value 3"
);
while(list($a,$b,$c,$d) = each($Array)) {
print "$a = $c and $b = $d <br>";
}
Doesn't the "each" construct return a 4 element array, where element 1's
index is 0, element 2's index is 1, element 3's index is "key" and element
4's index is "value"? Now, if that is the case, the above should work,
right? I should create a list containing $a, $b, $c and $d, where $a and $c
contain key information, and $b and $d contain value information? For some
reason, $c and $d are NULL...
What am I missing here?
Cheers,
Jason
Hehehe,
I searched around on PHP.net, and found this tidbit of information. It
sounds to me that list() is written to only accept the first two elements
from the each(). Please correct me if I am misinformed :-)
Cheers,
Jason
[EMAIL PROTECTED]
16-Feb-2000 03:41
Ok, for you folks who are learning this, here's something that should help
your comprehension of each(), because I bashed my brains for a while on this
one.
The first example indicates that each() spits out a 4-cell 1 dimensional
array. This is all fine and dandy until you get to the second example, where
that seems to be thrown out the window, because though each() is still
spitting out 4 array elements, the list() being used is set up to only
accept 2 values, as it's being executed with only wo variables in it!
For some folks, this might not be a problem, but I couldn't understand the
mismatch - why was it done, and where did the array go that each()
generated?? Well, upon executing that code, it turns out that the first two
array elements of the 4 element array that each() creates are assigned to
those two variables, and the last two array element values are just thrown
away - they're totally ignored. It's how PHP is written.
Now, why do that? Well, the example was definitely written more to show
folks how to use each() to make life much easier when dealing with a
particular operations array in PHP that a lot of people work with, but it
also has the side effect (which hopefully my little explaination has made
more palatable) of demonstrating how each() can act when being used with
other functions that don't necessarily want all of each()'s input.
""Jason Mowat"" <[EMAIL PROTECTED]> wrote in message
95rrbg$p3i$[EMAIL PROTECTED]">news:95rrbg$p3i$[EMAIL PROTECTED]...
> Greets,
>
> I have a quick question:
>
> $Array = array(
> "val1" => "Value 1",
> "val2" => "Value 2",
> "val3" => "Value 3"
> );
>
> while(list($a,$b,$c,$d) = each($Array)) {
> print "$a = $c and $b = $d <br>";
> }
>
> Doesn't the "each" construct return a 4 element array, where element 1's
> index is 0, element 2's index is 1, element 3's index is "key" and element
> 4's index is "value"? Now, if that is the case, the above should work,
> right? I should create a list containing $a, $b, $c and $d, where $a and
$c
> contain key information, and $b and $d contain value information? For
some
> reason, $c and $d are NULL...
>
> What am I missing here?
>
> Cheers,
> Jason
>
>
>
> --
> 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 have installed the CGI version of PHP and customized Apache's
httpd.conf. (Had to use CGI for this instance).
Since I only need (and want) a few php scripts to be available on this
server, I added the following line to httpd.conf in order to get my
script to work.
ScriptAlias /myfile.php /location/myfile.php
Then I added the following to "myfile.php"
#!/usr/local/bin/php
<?
phpinfo()
?>
Everything works fine except that I get "X-Powered-By: PHP/4.0.4pl1
Content-type: text/html #!/usr/local/bin/php" at the top of the page.
Any Ideas on how to get rid of this stuff in the output? I have looked
through the php.ini file, and php.net but couldn't find anything.
Thanks in advance
Tim