php-general Digest 26 Jan 2001 16:10:25 -0000 Issue 477

2001-01-26 Thread php-general-digest-help


php-general Digest 26 Jan 2001 16:10:25 - Issue 477

Topics (messages 36681 through 36739):

PHP/MYSql equivalent to Hypermail/Monharc?
36681 by: Greg Schnippel

Password security from PHP to MySQL
36682 by: Egan

Re: SQL Server DB to mySQL DB
36683 by: Jason Bouwmeester

Re: Persistent connections and transactions
36684 by: Martin A. Marques
36690 by: Frank Joerdens
36693 by: Martin A. Marques
36713 by: Frank Joerdens

Question about dopping zeros
36685 by: Ethan Nelson
36717 by: Randy
36723 by: Randy

mktime() not allowing dates before 1970
36686 by: Diego Fulgueira
36687 by: Monte Ohrt

PostgreSQL + PHP + SQL warning messages
36688 by: Evelio Martinez
36696 by: Martin A. Marques

Enabling track_vars.
36689 by: April
36694 by: Philip Olson

Splitting at word count
36691 by: H. Wade Minter

Fopen
36692 by: Nate

Re: Zend hit (Encoder price)
36695 by: Jim Jagielski
36699 by: Rasmus Lerdorf
36701 by: Jim Jagielski
36703 by: Dallas Kropka
36705 by: Dallas Kropka
36706 by: Rasmus Lerdorf

number_format() buggy round when usind database resultset
36697 by: Lucas Persona

Re: regular expression help
36698 by: Jeff Warrington

VAR and variables
36700 by: Matt
36708 by: Steve Edberg

html table
36702 by: Mike
36704 by: Rasmus Lerdorf
36707 by: Brian V Bonini
36715 by: Randy

file_exists search the include_path?
36709 by: Dean Hall
36720 by: John Donagher

edit plus
36710 by: Pat Hanna
36712 by: Randy
36718 by: Randy
36722 by: Dell Coleman

Re: Ideas?? (OT- MySQL)
36711 by: Randy

Get rid of da Zero's
36714 by: Ethan Nelson

Web based Time Sheets for Professionals
36716 by: Web Time Sheets

CGI and PHP
36719 by: Dave Stewart
36731 by: John Meredith

memory leak with mcrypt 2.4.5
36721 by: Remco Chang

Post without submit?
36724 by: Chris
36725 by: Richard S. Crawford
36726 by: DanO
36727 by: Richard S. Crawford
36728 by: Remco Chang

exec() bug?
36729 by: Dustin Butler

Ver 3 vs. Ver 4
36730 by: Karl J. Stubsjoen
36733 by: Zeev Suraski

Re: Greek PHP mailing list
36732 by: Stephan Ahonen

APC patch (PHPLIB support?)
36734 by: Daniel Cowgill

session without cookies
36735 by: tassilo.maussner.net

password protection
36736 by: Bill Rausch
36738 by: James Atkinson

Re: Search for the documentation
36737 by: Brian Clark

Tracing
36739 by: Morten Rønseth

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]


--




Hi, 

I have been using Hypermail for archiving our mailing lists but I'm 
becoming and more frustrated with its limitations. 

Is there an equivalent PHP script to hypermail out there? Ideally,
I would like to maintain the incoming e-mail addresses in a mysql
database.

Thanks,

-Greg




I know that ~.my.cnf with

  [client]
  password={mypass}

is the recommended method of securing your MySQL password when using a
shell command line to access MySQL.

But what is the recommended method for MySQL password security via
PHP?  Is there some way to make it use the ~.my.cnf file?

It seems to me that if you hardcode a MySQL password into your PHP
source code, it could become exposed inadvertently.  Forgive me if
this is already answered in the FAQ or manual.


Egan







Thanks for the tip. I actually read that the default for mySQL is TAB and LF
for delimiters, so I used those in SQL and exported a .txt file, imported it
into mySQL database and voila! A few code modifications and we be running on
mySQL.

Thanks again!
Jason

-Original Message-
From: Christopher Allen [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 25, 2001 9:16 AM
To: Jason Bouwmeester; [EMAIL PROTECTED]
Subject: Re: [PHP] SQL Server DB to mySQL DB


Just did this to a 65mb fixed width file.
What I did was get it into a csv file via perl :)

Then I created the db table.
Then I used:
load data infile "/file.csv" into table blah fields terminated by ',' ;
then go ahead and create any indexes etc...

!works slick!

 Is there an easy way to do this? I know that SQL Server can export a comma
 delimited file, can mySQL import this? I imagine the PHP will be easy to
 modify as long as the field names are the same.





El Jue 25 Ene 2001 14:34, Frank Joerdens escribi:
 On Thu, Jan 25, 2001 at 11:18:49AM -0300, Martin A. Marques wrote:
 [ . . . ]

  No, and thats why in the postgres list we talked about persistent
  connections not having much benefits. 

[PHP] Invoke PHP script from onLoad handler?

2001-01-26 Thread Chuck Mayo

Sorry if this has come up before.

I want to update a select list from a mySql database whenever the
browser window gets the focus. This is because I anticipate that the
user will frequently use a second window to make additions to the
database that holds the list values while filling in the form, and I
want those additions to be in the select list when the user returns.

At present I have PHP querying the db before I output the body tag, and
an onLoad() handler passes the returned records to a Javascript which
populates the list box with the query results, but I have only figured
out how to query the db when the page initially loads. I really need to
query the db and invoke the Javascript every time the window gets focus.

So, I guess my question is twofold: can I invoke a php function with an
onLoad handler, and if so, how can I have onLoad do both things - run
the php function to query the database, then run the Javascript to
populate the list box? Or is there another way?

TIA,
Chuck Mayo


-- 
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] max size of array

2001-01-26 Thread Giancarlo

what is the max number of elements into an array?



[PHP] max size of array

2001-01-26 Thread Giancarlo

what is the max number of elements into an array?



[PHP] Accessing variables from other Apache modules

2001-01-26 Thread Andreas 'Count' Kotes

Hi!

I'd like to get SSL_CLIENT_S_DN from mod_ssl but don't seem to be able
to get it using getenv() or apache_note(), it doesn't even show up when
doing phpinfo() .. any hints?

   Count

-- 
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] Uninstallation of CGI Version of PHP

2001-01-26 Thread [ rswfire ]

Hello...

I just upgraded my computer to NT5.  When doing so, I accidentally installed 
the wrong version of PHP.  =(

I installed the CGI version...  I want to use the ISAPI module.  How can I 
effectively undo what the installation program did to install the CGI 
version?  What should I do to install the ISAPI module now?

Thanks in advance for your help.

Sincerely,
rswfire
_
Get your FREE download of MSN Explorer at http://explorer.msn.com


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




[PHP] AUTH_PW External Authentication

2001-01-26 Thread Chen Shiyuan

Hello everyone!

I am currently using Apache-1.3.14 with php-4.0.4pl1 compiled statically 
into it and running on RedHat Linux 6.2 . Apache is configured to do 
authentication for certain URLs via a auth_ldap module which is 
dynamically loaded when Apache starts.

I noticed that when I access the protected URL, PHP_AUTH_PW will give me 
the password for the user who is currently logged to the protected site. 
If I recall correctly, earlier versions of PHP4 and PHP3 didn't have 
this "feature" .

This "feature" creates a problem when the protected URL is shared by 
many parties with each party providing it's own services under the 
protected URL as any party would be able to "steal" the 
username/password without the end user knowing. The username/password is 
used to control who has access to the protected URL and the parties are 
not required to make use of the password.

Is there anyway to disable this "feature" or is the disclosure of the 
password a bug?

Many thanks for any advice!

-- 
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] phpinfo ?

2001-01-26 Thread kaab kaoutar

Hi there!

I'm sure it's a stupid problem but the phpinfo does work while trying the 
following html code:

htmlheadtitlePHP Test/title/head
body
?php phpinfo() ?

/body/html

the result is a blank page!

And when i create an php file with only: ?php phpinfo() ?
i have a dos window where a list of information is listed quickly then 
shut!(i can hardly see it)
by the way is it the same to put php code between ?php ?
and ? ? and script language=php /script ?

thanks
_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.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] PHP 4.0.3 on Debian?

2001-01-26 Thread Thomas Wentzel

Hi again,

Okay! I am now able to compile (and use) Lerdorfs stocks example on 
my Laptop which runs RedHat... But I still can't get it to work on 
my Debian (work machine).

I use the following configure string on both machines - only differences
is the paths to pgsql and apxs
configure --enable-module=so --without-mysql --with-pgsql=/usr/local
--with-stocks=shared

On my RedHat (which has PHP 4.0.4) I get a nice little stocks.so...
On my Debian (which has PHP 4.0.3) I get a not so nice little stocks.a

I just noticed... That I get a warning when compiling on my Debian - I
guess it's nothing, but I'm grasping for straws here...
The warning is:
Thomas:/usr/local/src/php4-4.0.3pl1# make install  fisse2
In file included from sapi_apache.c:58:
/usr/local/src/php4-4.0.3pl1/php_version.h:3: warning: `PHP_VERSION'
redefined
/usr/local/src/php4-4.0.3pl1/main/php_version.h:3: warning: this is the
location of the previous definition

Is anybody able to compile .so files on Debian??

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]




Re: [PHP] Post without submit?

2001-01-26 Thread Max A. Derkachev

Hello Chris,

Friday, January 26, 2001, 8:23:27 AM, you wrote:

C is there anyway to post without clicking a submit button?

You can, e.g. using javascript event.
onSomething="document.forms['formname'].submit()"

-- 
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




-- 
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]




Re: [PHP] How to make links?

2001-01-26 Thread Richard Lynch

 How do make admin site that lists htm documents from directory and i can
 define link name to each of these?
 So when user comes, he sees link list to these documents, with names i
 defined.

Something not unlike this might work:
[Untested code]

create table links(
linkid int(11) auto_increment unique not null,
title text,
directory text,
filename text
);

?php
exec("/usr/bin/pwd", $results, $error);
if ($error){
die("Error $error executing pwd.  Usually path/permissions.BR\n");
}
$directory = $results[0];
$query = "select title, filename from links where directory =
'$directory'";
$links = mysql_query($query) or die(mysql_error());
while(list($title, $filename, $url) = mysql_fetch_row($links)){
$link[$filename] = $title;
}
$dir = opendir($directory);
$urldir = substr($directory,
strlen("/full/path/to/your/web/root/htdocs/"));
while($filename = readdir($dir)){
if (isset($link[$filename])){
echo "A HREF=$urldir/$filename$link[$filename]/ABR\n";
}
else{
echo "A HREF=$urldir/$filename$filename/ABR\n";
}
}
?

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



-- 
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]




Re: [PHP] Date -1

2001-01-26 Thread Richard Lynch

I am trying to show the records created from the previous day. How can I
make it show the date before today? My date field is like 2001-01-24
16:13:51. Below shows the current day...


$FileDate = date ("Y-m-d");

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

$query = "select * from warbirds_db WHERE FileDate LIKE '%$FileDate%' ORDER
BY FileID DESC";
$result = mysql_db_query ("combatfs", $query);

Might be easier/better to use MySQL's date_add() and/or date_format() or
whatever they called it.
http://mysql.org

You'll just do:

$query = "select ... where date_format("Y-m-d", FileDate) =
date_format("Y-m-d", date_sub(now(), '1 day'))";

Only odds are really got I got the function names/syntax wrong since I don't
use MySQL.

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



-- 
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]




Re: [PHP] Zend hit (Encoder price)

2001-01-26 Thread Richard Lynch

 You are entirely correct.  However, I (personally) feel that by pricing it
so
 high you're targeting a very small niche market at a higher rate.  Pricing
it
 in the "$300.00" range would not cost you that niche - but it would gain
you
 the "x-million" users/freelance developers.  Sure, $6,000 is 20x $300, but
 it's ONLY x20.  When you're talking about a userbase on the 'net, x20 is
 NOTHING.  "Go big and expensive" seems the "old way" and "go small and
 dominate the market" seems the new...um, paradigm.  (Yes, I just wanted
 to say that word.  For all it's overuse, I think it just looks neat.)

Unfortunately, it's not that simple.

You haven't factored in Support costs nor administrative overhead nor...
Well, I don't know what else the Marketing folks do when they figure these
things out, but that's why I'm not in Marketing, eh?

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



-- 
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]




Re: [PHP] Urgent answers needed for FILE UPLOAD problem....

2001-01-26 Thread Richard Lynch

 Hello all. I've spent the past month or two implementing a file upload
 utility for the web based on PHP's http upload method. It works fine for
 smaller files, and it's been working fine for files I've tried up to and
 including 400 megs at a time. The problem I'm having is that we want to
 roll this out on a center-wide scale, but that would most likely mean
files
 up to 1Gig being uploaded at a time. Is this possible through the http
 upload process. I've been unsuccessful thus far to upload a file this
large
 for some reason. Upon checking the Apache error_log, I found the following
 message:

 FATAL: erealloc(): Unable to allocate 112568001 bytes
 [error] PHP Warning: File Upload Error - No Mime boundary found after
start
 of file header in unknown line 0

Woof!

Okay, I can't even imagine somebody sitting through a 1Gig upload, but let's
assume that it really is reasonable for your application.

If you are conking out at ~400 M, I'm going to make a SWAG that maybe the
file upload procedure basically tries to suck it all in through RAM and
isn't paging it to disk and dumping RAM as it goes.  You go past 256 okay,
cuz you got swap space (standard swap of 1:1 for real RAM).

So, as a test, make your swap partition + RAM = 800M and see if you get
around 700M before it conks out.

You may also want to read the PHP source code involving the file upload
functions and see if there's anything you can puzzle out about them and how
they work.

You may just need to add some code to page the upload to disk as it comes in
and free up the RAM that's the beginning of the "file" for usage.

[I say that so blithely not being the one that has to do the coding, don't I
:-)]

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



-- 
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]




Re: [PHP] can't upload files if extension has more than one dot.

2001-01-26 Thread Richard Lynch

 I am trying to upload the files to the sever. For files that has only one
 dot such as abc.txt and 123.doc, it works fine. But when uploading files
 that have more than one dot such as 123.txt.pdf, there's problem, and I
 tried to echo the $userfile[i], and it is "none". Codes are attached as
 following:

 FORM  name="test" method="post" action="meeting_addDocs.php"

You'll need to post or provide a URL to the source for meeting_addDocs.php
probably

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



-- 
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]




Re: [PHP] trouble with updating the id numbers

2001-01-26 Thread Richard Lynch

 Hi all.  In the project I'm working on, I've got a table with ids that are
 written based on how many records are in the table.  i.e., the first
record
 has an ID of 1, the 50th is 50, etc.  When a row gets deleted (I created a
 web interface, I don't want all these members using phpMyAdmin), the ID's
of
 all the records after it are supposed to be decremented by one.  I thought
 it was working, but yesterday it didn't.  Can anyone see what I'm doing
 wrong?

Like, doing what you are doing is just a Bad Idea in general...

I know it offends your organizational sensibilities to have holes in your ID
scheme, but it's really better in the long run...

You see, at some point, you may have another table with things in it that
need to be cross-referenced to the things in this table.  When that happens,
you really don't want to run around trying to update all those tables at
once -- Because while you're still halfway through that process, somebody
will be surfing to look at record #42 -- And whatevery is associated with
#42 in the other table, well, you haven't updated that yet, because they are
surfing at the same exact instant that your updates are taking place...  So
they are going to get the old 42's cross-references and be all confused.

Still, just in case you really, really need this 1-50 thing, you can do
it -- Just keep the *real* ID internally and when you delete, don't mess
with that.

Probably the easiest way to renumber them is like this:

$query = "update $tablename set fields[0] = fields[0] - 1 where fields[0] 
$editval";

 ***
 if ($delete == 1){
  #delete the row
  $worked = mysql_query("delete from $tablename where
 $fields[0]=\"$editval\" ", $database);
  if (!$worked){
   echo "couldn't delete anythingp";
  }//end if

  $connection =
@mysql_connect("localhost",$PHP_AUTH_USER,$PHP_AUTH_PW);
  $database = @mysql_select_db($databasename, $connection);
  $del = mysql_query("select * from $tablename where RestID =
 $restidval", $database);
  while ($Info_Array = mysql_fetch_array($del)){
#update the ids of each record
if($Info_Array[$v]  $editval){ #v is a fieldname (specifically
 the id) defined above
  mysql_query("update $tablename set $fields[0] =
 ($fields[0]-1) where $fields[0] = \"$Info_Array[$v]\" ", $database);
}//end if
   }//end while

   $delete=0; #reset the delete flag
 }//end if

 ***

 Assume that all the variables have the values they're supposed to (cuz
last
 I checked, they do. :))

 Thanks for your help. Again.

 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]



-- 
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]




Re: [PHP] Read Vs. Include

2001-01-26 Thread Richard Lynch

 I want to *read* a file into a page and not process any PHP.  I'm just
 reading an HTML file.  I though it was simple, I thought I had it figured
 out, but now when I try, I get the following error:

Unless there is PHP code in there that you want to make sure it doesn't get
executed, 'include' will work just fine.

If you need to read the file and splat it to the browser, I think passthru()
is what you want.

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



-- 
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]




Re: [PHP] Splitting at word count

2001-01-26 Thread Richard Lynch

 I'm doing a page where the front page will show "news" stories.  What I'd
 like is if the story is longer than X words/chars/etc, the index page will
 show the first X words, then a link for the full story.

 Does anyone have a good idea on how to split after a certain number of
 words?

?php
if (strlen($story)  50){
$start = 50;
#You may want to add "\t" and "-" and suchlike as "break" chars:
while (isset($story[$start])  $story[$start] != ' ' 
$story[$start] != "\n")){
$start++;
}
echo substr($story, 0, $start);
#We may have managed to squeeze out the last word...
if ($start  strlen($story)){
echo "A HREF=fullstory.php?story_id=$story_idM O R E/A";
}
}
else{
echo $story;
}
?

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



-- 
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]




Re: [PHP] Anyone who can help me making a loop of this?

2001-01-26 Thread Richard Lynch

The "easiest" way to do that kind of output is "recursion"

It's a kind of iteration/looping thing where a function calls itself.

Sample:

function fact($x){
if ($x == 0){
return 1;
}
else{
return $x * fact($x - 1);
}
}

Basically the function eats itself rather like those Russion porcelain dolls
nestled inside each other.

It's easier to "reverse" your data structure to get it to work though:

$tingtang[0] = array(1, 7);
$tingtang[1] = array(2, 4);
$tingtang[2] = array(3);
.
.
.

IE, each tingtang knows its "children", rather than the parent.

In your case it would be something like:

function tingtang($tt, $depth = 0){
global $tingtang;
echo str_repeat("nbsp;", $depth * 4), "tingtang$ttBR\n";
while (list(,$child) = each($tingtang[$tt])){
tingtang($child, $depth+1);
}
}
tingtang(0);

Note:  Recursion has an overhead at each function call -- So very "deep"
trees can become performance problems.

For a much more in-depth look at this sort of thing, check out the rather
long threads about "forums" and "recursion" in the PHP Mailing List
archives.  (Probably back in version 3 archives, actually)

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
- Original Message -
From: Christian Sakshaug [EMAIL PROTECTED]
Newsgroups: php.general
Sent: Thursday, January 25, 2001 12:34 PM
Subject: [PHP] Anyone who can help me making a loop of this?


 Anyone who can help me making a loop of this?
  http://www.sakshaug.net/phps/loop.txt

 I have tried many things, but I can't get it perfect...





 Best Regards, Christian Sakshaug
 --
 Email: [EMAIL PROTECTED]
 Web:   www.sakshaug.net
 Tel: +47 913 95 618



 --
 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]




Re: [PHP] number_format() buggy round when usind database resultset

2001-01-26 Thread Richard Lynch

 I'm finding some problems on using number_format($value, $decimal, ",",
 ".") when I have a value comming from a resultset (database query
 results)...
 If I had something like '123.45', using number_format it will return
 '123,00'.
 I think this happens because my value is a string and PHP rounds it
 before using it on number_format. If I try to change the data type like
 (double) $value, I will also have a '123.00' result.
 I could do something on database like 'to_char(FIELD, '999G999D99') but
 database default is '.' for decimal separator and ',' for thousand
 separator...and I want the opposite.
 Suggestions/Solutions? :)

Your database may have a number_format() function that can better interact
with the internal data of the database.

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



-- 
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]




Re: [PHP] Fopen

2001-01-26 Thread Richard Lynch

 ?
  $fp = fopen("http://www.parentprofiles.com/clicker.php?profile_id=" .
$this-profile_id
 . "code=1","r");
 echo $fp;
 ?

 to do it. however when I do all I get is a response that says:
 Resource id #1
 instead of giving me the page. Any ideas?

Basically, that Resource id # 1 is like a paper receipt at the lumber yard.

You need to take the piece of paper 'round back and pick up your lumber.

We do it that way cuz you might be picking up a lot of lumber :-)

Or, in the case of web sites, you might only need the first few lines of the
HTML, so there's no point in shoving the whole thing through if you're not
going to read it all.

while (!feof($fp)){
$html = fread($fp, 1024); #Reads 1K max at a time.
echo htmlEntities($html);
}

You can increase the 1024 to whatever number you find works best to get the
page the fastest.

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



-- 
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]




Re: [PHP] session without cookies

2001-01-26 Thread Richard Lynch

 i use the session-functions with php4 and everything works fine.
 but if a visitor turns off cookies nothing seems to work..

 is there a way to support a sessionid with cookies and thru the url ?

Yes.  Compile PHP --with-trans-id (?) or just echo $PHP_SESSID (or whatever
it is) into all your URLs and FORMs.

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



-- 
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] can't upload files with more than one dot in the file name.

2001-01-26 Thread david klein

Hello!

I am trying to upload the files to the sever. For files that has only one
dot such as abc.txt and 123.doc, it works fine. But when uploading files
that have more than one dot such as 123.txt.pdf, there's problem, and I
tried to echo the $userfile[i], and it is "none". Codes are attached as
following:

FORM  name="test" method="post" action="meeting_addDocs.php"
enctype="multipart/form-data"
tr align="center"
  td valign="top" colspan="2"
  input type="file" name="userfile[]" size="18"
  /td
  td valign="top" colspan="2"
  input type="file" name="userfile[]" size="18"
  /td
   /tr
/FORM


Thank you very much in advance.

_
Get your FREE download of MSN Explorer at http://explorer.msn.com


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




[PHP] Re: Get rid of da Zero's

2001-01-26 Thread Art Wells

preg_replace("/0+$/","",$number);

On Thu, 25 Jan 2001, Ethan Nelson wrote:

 Almost there... actually this creates one problem...

 It turns 40.00 into 4

 It needs to quit shaving zero's when it hits the decimal point.

 40.00 into 40
 45.50 into 45.5
 40.25 into 40.25

 Thanks

 -Original Message-
 From: Philip Hallstrom [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, January 25, 2001 12:43 PM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] Question about dopping zeros


 ereg_replace("[0\.]*$", "", $number)

 should do it.  I'm not sure you need the slash in front of the dot or
 not. try it and see.

 In article
 [EMAIL PROTECTED] you
 write:
 I need to format decimals that are percise to the second place in the
 following format:
 
 4.00 to 4
 4.50 to 4.5
 4.25 to 4.25
 
 As you can see, I just want to drop the trailing zeros, and if necessary
 the
 decimal.
 
 Thanks
 
 ___
 Ethan Nelson, Systems Administrator
 Net Solutions, LLC
 840 Lawrence Street
 Eugene, OR 97401
 [EMAIL PROTECTED]
 http://www.netsolutionsllc.com
 Voice +1 541 345-7087
 Fax   +1 541 485-5519
 
 
 --
 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]
 



-- 
http://www.artwells.com/
That which indicates nothing
introduces everything.


-- 
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]




Re: [PHP] Get rid of da Zero's

2001-01-26 Thread Christian Reiniger

On Thursday 25 January 2001 23:27, Ethan Nelson wrote:

 It needs to quit shaving zero's when it hits the decimal point.

 40.00 into 40
 45.50 into 45.5
 40.25 into 40.25

Hmm,
$ValWithoutZ = (double) $ValWithZ;

should work fine (i.e. interpreting the number as floating-point value 
instead of as string)

-- 
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)

"use the source, luke." (obi-wan gnuobi)

--
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] test

2001-01-26 Thread Brian V Bonini

test

-- 
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]




Re: [PHP] Persistent connections and transactions

2001-01-26 Thread Nuno Silva

Frank Joerdens wrote:

 On Thu, Jan 25, 2001 at 05:10:54PM -0300, Martin A. Marques wrote:
 [ . . . ]
 
 OK, lets see if we can understand what each other is saying (maybe I'm not 
 getting your point here).
 Lets say browser A connects to the apache server, to a page using php code. 
 Lets say the code is OK (no bugs). Apache opens a persistent connection to 
 the database and starts executing the queries. Now the connection between the 
 apache server and the web browser doesn't close until the queries are all 
 finished and the output is send back to the browser.
 Now, how about if browser B connects to the apache server just in the middle 
 of the execution of the queries that browser A asked for?
 Well, the connection between Browser A and the web server is still opened, so 
 another httpd child process answers the request.
 
 
 I thought one of the points being raised (can't find the mail/thread I'm
 referring to now) was that somehow confusion might ensue from a mix-up,
 on the Apache/PHP level, regarding the client identity, thus corrupting a
 transaction in progress. It seemed to make sense but now that we've
 discussed it, I can't see anymore how it might happen.
 
  . . . [ goes away to search mail archives ] . . .
 
 Ah, here we go. A post from Rod Taylor on pgsql-hackers on Dec 27:
 
 -- begin quote --
 The *real* problem with persistent connections is:
 
 Script1:  BEGIN;
 Script1:  UPDATE table set row = 'things';
 Script2:  Insert into table (id) values ('bad data');
 Script1: COMMIT;
 
 Since script2 managed to do a BAD insert in the middle of script1's
 transaction, the transaction in script1 fails.  Obvious solution?  Don't
 do
 connection sharing when a transaction is enabled.  The whole persistent
 connection thing is only valid for mysql as it's the only thing that
 doesn't
 really support transactions (and even thats partially changed).
 
 They need to look for stuff going through (keywords like BEGIN) and
 'lock'
 that connection to the single entity that opened it.
 
 It's much easier to write your own.  I wrote a few functions like:
 
 get_connection('DB PARMS');
 begin_transaction();
 
 commit_transaction();
 close_connection();
 -- end quote --
 
 [ . . . ]
 
 My question would be, and seeing Adams thoughts, wouldn't it be the best 
 optimization configuration of php.ini to have only one persistent conection? 
 Wouldn't there be one per-child? Any way, you can't have two connections to 
 the same httpd child.
 
 
 Those where my thoughts too (or, rather, Adams thoughts ;)), and this is
 what I am trying at the moment.
 
 Regards, Frank
 
hi,
i ran across this transaction problem vs. persistent conn in pgsql some time ago.

I found two workaround methods:
- don't use persistent conn's :-) or;
- start every conn with the usual pg_pconnect and then query a rollback to the server:
$query="ROLLBACK work;"

(this will kill any supposed transaction in ABORT STATE that some child had left).

postgres don't support nested transactions (yet), but when it does maybe you should 
add multiple "ROLLBACK WORK;" queries :-)

Regards,
Nuno




-- 
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] Circle using GD

2001-01-26 Thread Piotr Duszynski

I need to draw circle using GD library. Can you get me some function doing
this? 
Thanks.

-- 

Piotr Duszynski

http://www.softomat.com.pl
http://filmomat.3miasto.pl 
http://www.3miasto.pl

-- 
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]




RE: [PHP] Echo and Print

2001-01-26 Thread Nathan Cassano


As I understand it, echo is somewhat of an language construct and print is a
function.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 26, 2001 11:37 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Echo and Print


I know it is a kind of stupid question but I was trying to figure out
the difference between "Echo" and "Print" and I didn't find it...Could
anybody explain that to me??
Thank you

Felipe Lopes


MailBR - O e-mail do Brasil -- http://www.mailbr.com.br
Faa j o seu.  gratuito!!!

--
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]




[PHP] Conditional include based on virtual host ?

2001-01-26 Thread Alain Fontaine

Hello,

I have developed a large web application the contents of which (language and
data) depends on the URL the site is accessed from, e.g. en.site.com would
display the "english" site, and "fr.site.com" would display the french site,
and so on.

The whole thing is "parameterized" through a set of global variables (or
defines) that reside in a file called settings.php. The question is: how can
I include the "right" settings.php file, depending on the virtual host used
to access the site? This is an Apache server on Linux, and I thought setting
the "include_path" for every virtual host in the vhosts section of
httpd.conf would maybe do the trick ?

Thanks !



-- 
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]




Re: [PHP] Ideas?? (OT- MySQL)

2001-01-26 Thread Website4S

Thanks for the input, I have turned it around now as you said and recorded 
the projectID in the bid table rather than the other way round.

Cheers

Ade

-- 
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]




Re: [PHP] Read Vs. Include

2001-01-26 Thread Daniel Grace

Any of these will work:

echo implode("\n", file($filename));

fpassthru(fopen($filename, "r"));

readfile($filename);

You probably want readfile().
http://www.php.net/manual/en/function.readfile.php

--
 - Daniel Grace http://dewin.oldbattery.com/

  "Space may be the final frontier but its made in a Hollywood basement."
- Red Hot Chili Peppers - Californication
""Karl J. Stubsjoen"" [EMAIL PROTECTED] wrote in message
005b01c086fa$ec53ba30$0afc020a@kstubsjoen">news:005b01c086fa$ec53ba30$0afc020a@kstubsjoen...
 Hello,

 I want to *read* a file into a page and not process any PHP.  I'm just
 reading an HTML file.  I though it was simple, I thought I had it figured
 out, but now when I try, I get the following error:

 Fatal error: Call to unsupported or undefined function read() in
 /var/www/wherever.com/betastore/iscookies.php on line 41

 Here is the code (line 41 is superceded by a +):

 37: # display no cookies message
 38: function NoCookies() {
 39: global $DOCUMENT_ROOT;
 40: $LocalScript = $DOCUMENT_ROOT . "/betastore";
 41:  read ($LocalScript . "/thispage.html");
 42: }

 Thanks for any help.



 --
 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]




RE: [PHP] how do you erase quotes from variable?

2001-01-26 Thread Dustin Butler

 I have a variable(s) that hold the string:
 
 "name"
 
 and I'd like to kill the quotes so it contains:
 
 name
 
 I am aware of the strlen() function but can find the concant
 
 Little Help?
 
 Mike

If you *know* the variable is quoted you could also do:

$new = substr($variable, 1, -1);

I think this would be faster if you were doing a zillion of them as it
doesn't have to find the quotes.

Dustin


-- 
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]




Re: [PHP] sleep and usleep not working ??

2001-01-26 Thread Benny Nissen

Hi

Sorry - but as far as I can tell it does not work. It still have the same
strange behavior.
When using sleep I have no output. Usleep has no wait time (or it may delay
output a bit but not program execution) ?

Benny


""Daniel Grace"" [EMAIL PROTECTED] skrev i en meddelelse
94m72k$qd9$[EMAIL PROTECTED]">news:94m72k$qd9$[EMAIL PROTECTED]...
 ""Benny Nissen"" [EMAIL PROTECTED] wrote in message
 94k0ql$em$[EMAIL PROTECTED]">news:94k0ql$em$[EMAIL PROTECTED]...
  Hi All
 
  I have tried to get this to work but it does not produce any output in
the
  browser - why
 
  $i = 1;
  while ($i)
  {
   if(connection_aborted())
break;
 
   echo $i;
   echo "BR";
  $i++;
 
   sleep(1);
  //usleep(1000);
  }
 

 If you're trying to get a delayed output affect (which isn't recommended,
 but would probably work in this case as long as you're not inside a
table),
 you'll either need to do:

 ob_implicit_flush(1);
 // at the beginning of the script (use 0 to turn it back off)

 or:
 flush(); // after the echo and before the sleep.



 Side note: When you're using PHP for shell scripts (Don't look at me like
 that) and the like, ob_implicit_flush is your friend.

 --
  - Daniel Grace http://dewin.oldbattery.com/

   "Space may be the final frontier but its made in a Hollywood basement."
 - Red Hot Chili Peppers - Californication




 --
 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]




RE: [PHP] Echo and Print

2001-01-26 Thread SED

Hi, I cut  paste this from an earlier e-mail from this list, hope it helps:


-
The print() function returns a boolean indicating the status of the call. If
the write was successful, print() returns 1. If not, it returns 0. This can
be used to detect when the client has closed the connection, and appropriate
measures taken. The builtin echo does not provide this same service.

This may be handy for you, though there's probably a lot more to it.

HTH
Jon

-

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!
--

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: 26. janar 2001 11:37
To: [EMAIL PROTECTED]
Subject: [PHP] Echo and Print


I know it is a kind of stupid question but I was trying to figure out
the difference between "Echo" and "Print" and I didn't find it...Could
anybody explain that to me??
Thank you

Felipe Lopes


MailBR - O e-mail do Brasil -- http://www.mailbr.com.br
Faa j o seu.  gratuito!!!

--
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]




[PHP] PHP on MAC

2001-01-26 Thread iGuru

I want to install PHP on iMAC with MAC OS 9, please advise if possible.

Further, is there any lowcost or free web server that supports PHP on my MAC
OS9.

Thanks in advance.





-- 
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] How can I specify connection timeout when open IMAP mailobox?

2001-01-26 Thread Dezider Gra

When I try to connect to mailbox, I get error "Connection timed out". Is
it possible to specify timeout for this?

TIA.
Dezider.



-- 
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] updating time fields

2001-01-26 Thread Kurth Bemis

i am wondering if anyone has written a snippet to process the current date 
or mktime into a mysql timestamp feild.

~kurth


-- 
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] Premature end of script headers error

2001-01-26 Thread pil

Hi,

I compiled and installed php4 for the first time and it seems that all
went right as the notice in /var/log shows:

[notice] Apache/1.3.12 (Unix) PHP/4.0.4pl1 configured -- resuming normal
operations

But when I try to execute any sort of php script Im stuck with an
Internal Server error and /var/log says:

[error] [client 127.0.0.2] Premature end of script headers:
/usr/local/httpd/cgi-bin/test.php

Neither an answer in the manual nor in the FAQ 
Thanks for reply.

W. Pichler

Please cc me cause Im not subscribed to this list.

-- 
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]




Re: [PHP] Search for the documentation

2001-01-26 Thread Brian Clark


(BC == "Brian Clark") [EMAIL PROTECTED] betokened:

BC I'm using Beta 2.10a (I'm in the Beta program), but I'm not
BC completely sure when this new feature was added (some where
BC between 2.00 and 2.10a):

BC If you go into settings and syntax for PHP in Preferences, I see a
BC 'function pattern' text field which has:

BC ^[ \t\s]*function[ \t\s].*\([^;]*$

BC And I'm now guessing that's why $(CurWord) is smart enough to
BC "figure it out" :-)

No, that's not right either. That shouldn't have anything to do with
it. Because it still works with something like:

$GLOBALS['|HTTP_HOST'] for HTTP_HOST and $|GLOBALS['HTTP_HOST'] for
the word globals.

Where | is the cursor.

Ahh! It's because of the new (?) 'Word Delimiters' field in Prefs -
General where you have: ,.?!;:/(){}[]"'

Spiffy.

-Brian



-- 
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]




Re: [PHP] pdflib: unable to generate on the fly, need to write to file

2001-01-26 Thread Dominic Schanen

On Thu, 25 Jan 2001 18:42:41 -0700 (MST), [EMAIL PROTECTED]
wrote:

I don't know, but I'd love to know the answer to this, too.  I currently have 
to do the same as you: output to file and then direct the browser to the disk-
based file.  (Then I have to bother about file cleanup.)

I had pdflib version 3.03 and found the patch that Uwe talked about and
that fixed my problem with the creating pdfs out of memory. However,
with IE, you will need to create it from file so you can get the
document length so that IE displays the document appropriately. What I
do to get around this is create the document in a tmp folder with the
time stamp and then unlink the same file after I have appropriately
fpassthru() the file to the browser with the appropriate headers for IE
(Content-length).

--
Dominic


-- 
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]




Re: [PHP] Splitting at word count

2001-01-26 Thread Jose Casal-Gimenez


 I'm doing a page where the front page will show "news"  
stories.  What I'd  like is if the story is longer than X 
 words/chars/etc, the index page will  show the first X 
 words, then a link for the full story. 
 Does anyone have a good idea on how to split after a  
certain number of  words?
 

We have a "news" section with an index page that shows the 
first 3 articles in our queue. These articles are limited 
to their first 29 words. We then add a link to the full 
article.

You can view this live: http://www.ukc.ac.uk/news/index.php

   $article = fgets($fd, 8192)
   /* Full text of your article. We get it from a file 
  using fgets($fd, 8192) */

   /* remove tags if there are any */
   $newscontent = strip_tags($article) ; 
   $pattern = " " ;
   $arr = split($pattern, $newscontent, 50);
   $story .=  ("p") ;
   for ($i = 0 ; $i  29 ; $i++)
   {
  $story .= (" " . $arr[$i]) ;
   } 
   $story .= (" (cont.) a 
href=\"yourarticlefilename.html\"Full article/a/p\n");


We use this PHP in the HEAD of our document, so whenever 
we want it to be published we just use ? echo $story ; ? 

It may not be very elegant, but it does work fine!

Hope it helps

Jose

Jose Casal-Gimenez [EMAIL PROTECTED]
University Web Support Officer
Communications  Development Office
G17, The Registry, University of Kent, CT2 7NZ
Tel: (01227) 823102


-- 
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] posting plain/text with CURL?

2001-01-26 Thread Mathijs Homminga

Q: Is it possible to post plain/text data from PHP with the build-in CURL
functions?

Hello Mr. General PHP!

I want to post PLAIN/TEXT data to some webpage (through SSL). I want to do
this in PHP by using the build-in CURL support. However, by default, CURL is
posting the data as "url-encoded.." (as if it came from a form), but I want
it to be "plain/text" (not var=value pairs)!
If I use the CURL binary (calling it from the commandline), I can specify
extra header-info and force the postdata to be interpreted as plain/text.
Like this:

curl [] -H "Content-Type: plain/text"

This works perfectly! Is it possible to do this by using the build-in CURL
functions?

M. Homminga







-- 
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] update db

2001-01-26 Thread Kurth Bemis

whats the php function that will let me update a db field?  I've been 
looking at the manual but there seems to be no mention of it.

~kurth


-- 
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]




RE: [PHP] Splitting at word count

2001-01-26 Thread Dustin Butler

 I'm doing a page where the front page will show "news" 
 stories.  What I'd
 like is if the story is longer than X words/chars/etc, the 
 index page will
 show the first X words, then a link for the full story.
 
 Does anyone have a good idea on how to split after a certain number of
 words?
 
 Thanks,
 Wade

Put the story in an array and grab the first x elements?  Say you want 50
words you would do:

$num_of_words = 50;
$story_array = explode(" ", $story, $num_of_words);
$story_preview = implode(" ", array_pop($story));

Assuming all words are seperated by a space.

Dustin


-- 
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] Why the Change in Ver 4?

2001-01-26 Thread Karl J. Stubsjoen

  Does Version 4 support either { } "squiglees" or [ ] "brackets" in this
  code:
  
  if($retrn{strlen($retrn)-1} == '')
  -or-
  if($retrn[strlen($retrn)-1] == '')
 
  Yes.  This is a 4.x feature only.  The idea is that in the long run, []
  will no longer be supported for string offsets, only {} will.

What is the motivation behind this change?


-- 
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] disregard last two questions

2001-01-26 Thread Kurth Bemis

i'm a bit slow todayplease disregard those last 2 questions from me and 
i answered them myself :-)


-- 
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] Do they like shut this list down at night or what?

2001-01-26 Thread Dallas Kropka

Why is it that I never get messages in the list from the late night coders
after like 6 central?


-- 
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]




Re: [PHP] Zend hit (Encoder price)

2001-01-26 Thread Christopher Allen


 Unfortunately, it's not that simple.

 You haven't factored in Support costs nor administrative overhead nor...
 Well, I don't know what else the Marketing folks do when they figure these
 things out, but that's why I'm not in Marketing, eh?


Right it's not my game either (marketing), but perhaps Zend would be willing
to supply why the price is at $6,000.
As you said above , it doesn't just stop when I buy the encoder. Whose going
to do the encoding and continue doing the encoding
with continued releases etc? A graphic designer? A consultant? I  have
listened to the arguments, 6000 is steep when you compare it with a download
from freshmeat. Writing  a c-module is not *that* far away from writing some
of the more complicated php/perl/python scripts.
Indeed this is what furthers php. I would rather see Zend charging for
support contracts, rather than the actual product



-- 
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]




Re: [PHP] Urgent answers needed for FILE UPLOAD problem....

2001-01-26 Thread Rasmus Lerdorf

Because of the way the code is currently written, a file upload ends up in
RAM before it gets written to disk.  If you want to upload 1Gig files, you
need 1Gig of RAM.  That's crap, we know, and Jim Winstead has volunteered
to fix this.  Not sure what the timeline is on it yet though.

-Rasmus


On Thu, 25 Jan 2001, Tim Meader wrote:

 Hello all. I've spent the past month or two implementing a file upload
 utility for the web based on PHP's http upload method. It works fine for
 smaller files, and it's been working fine for files I've tried up to and
 including 400 megs at a time. The problem I'm having is that we want to
 roll this out on a center-wide scale, but that would most likely mean files
 up to 1Gig being uploaded at a time. Is this possible through the http
 upload process. I've been unsuccessful thus far to upload a file this large
 for some reason. Upon checking the Apache error_log, I found the following
 message:

 FATAL: erealloc(): Unable to allocate 112568001 bytes
 [error] PHP Warning: File Upload Error - No Mime boundary found after start
 of file header in unknown line 0

 Now, am I correct in thinking that the second line is merely a result of
 the failed upload? If so, then I suppose that can be disregarded, but which
 program is generating the erealloc(), Apache or PHP?

 I've been following threads on File Upload for quite a while now, and all
 relevent settings in the php.ini are set correctly to allow file uploads of
 this size (at least in theory). All settings having to do with upload
 limits are set at "20", however, no documentation states what value
 this setting stands for (kb, Mb, etc.), so this SHOULD roughly be equal to
 2Gigs, assuming that it defaults to bytes. Also the timeout has been set to
 86400 seconds, ie a 24hour period.

 The current box this is running on is a Ultra 5 running Solaris 7, Apache
 1.3.14, with PHP 4.0.4. It has 256 megs of ram, and the partition being
 used for this test phase is 18 gigs, so size shouldn't be an issue. The
 temp upload directory in the php.ini has also been set to use a temp folder
 on this same partition.

 PLEASE, any suggestions you have would be MUCH appreciated. Thank you in
 advance for any and all replies. Hope to hear something soon!


 --
 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]




[PHP] You can have a visa card .. no deposit

2001-01-26 Thread garey

  This company is offering a visa card with no annual fee, no deposit and 
will pay you for the people you refer.Just request the web address by
replying to :  

   [EMAIL PROTECTED]  

 Insert "request " in the subject line
Thank you

-- 
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]




Re: [PHP] zend ide debugger

2001-01-26 Thread Terrence Chay

1-month commercial license ($90).

Download wasn't too bad. I haven't had a chance to check out the Zend
LaunchPad. The installation (Apache Linux PHP 4.04pl1+patches) took me about
30 minutes for client and server which included the wait on the license key.
It took us another day to put up because there is no mention that the
debugger doesn't work with the optimizer on. Zend customer service fixed
that though.

The IDE is pretty nice. Startup (Windows version through Samba) takes a
long time and there are still some crashing issues. It's nowhere near as
spry as PHPEd but we're talking about a integrated debugger. The interface
is Swing-based as near as I can tell and my main gripe besides the speed is
I can't use the scroll wheel. It still crashes a bunch (not sure if it's the
debugger or what). I passed it off to an engineer so I can't comment
further. (He's having trouble getting it to recognize the include files.
Anyone have a tip?)

BTW, the debugger has a browser mode, it sends off some codes in a the
get string of the URL. I didn't test it.

Some people like source level debuggers and I think it's a good tool
especially considering all the headaches Nexidion Designer gave us a while
back. Personally, the last time I used a debugger, I was making a calculator
using an 80186 (the debugger was a hardware one the size of two coffee table
books stacked next to each other) so obviously I never got used to them. If
you come from the Boreland C/Visual Studio world, I suppose you might find
the IDE essential. If my engineers ever use it, I'll get the company to
spring for a license or 5.

Take care,

terry

-- 
terry chay, Director of Engineering, http://www.QIXO.com/
QIXO /kick.so/ - Integrating Many Travel Web Sites Into One
W: 1.408.394-8102 F:1.408.516.9090M: 1.408.314.0717
E-Mail: mailto:[EMAIL PROTECTED] ICQ: 16069322
PGP Fingerprint: 6DCF 1634 547C 935D 4912  2A44 A4A2 79AB DFFF F110 


-- 
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]




Re: [PHP] Greek PHP mailing list

2001-01-26 Thread Chris Hayes


 kyk():Prgm:Local a,b,c:
13-a:
"|+|"-b:ClrIO:Output
 0,-1,left(b,a)""right(b,a):While abs(13-a)13:getKey()-c:If abs(50-c)=1
 Then:a+c-50-a:Output 0,-1,left(b,a)""right(b,26-a):EndIf:EndWhile:EndPrgm

 Play with the 1 and 3 keys. Guess what it does by just looking at the code,
 and win a free donut (should arrive within 6-8 weeks, and shouldn't be too
 stale by then). 1 and 3 have character codes 49 and 51, respectively, if you
 want to take this on...

Talking about OT!
Is this a so-called kiloliner? From the times when a home computer had 1k,
16k or 64k?

I say it is a game where you steer a Yen-sign along the line with the 1 and
3. If you go too far left or right you end the program (while).

|+|  3
|+|  3
|+|  1
|+|  3
|+|  3
|+|  3
...
|+|  3
|+|  3
|+|  3
end

I'm not familiar with these toys, i'm a biologist. So i can't tell what the
0,-1 in the output does. It may be the location of the output, so it is just
a one line you see, with a moving Y. It can also mean it scrolls, then the
suggestion of a road is made and you seem to move along the road. It is not
too exciting though as the only way to move is to press a button.

The + sign does not mean anything but the middle line of the road (if it is
a road) and as you see, i guess it skips one place when you cross it.

Satisfied?
Chris



--  C.Hayes  Droevendaal 35  6708 PB Wageningen  the Netherlands  --




--
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] if ... else ...

2001-01-26 Thread Chakravarthy K Sannedhi

Hi all,

I am having 5 rows in a mysql database related to five
different users. these rows contains their firstname,
lastname and details of scenes 1 to 5(these details
are numeric values from 1 to 3). if any of these
fields from scenes 1 to 5 are empty that will be
detected from the firstname of the user(collected from
a form with a filed name 'fname') by opening the
database and will be indicated to that user from which
scene he got empty fields. here is the code that i
wrote works like a champ.

$db = mysql_connect ("localhost","myname","password")
or die("bUnable to connect to database./b");
mysql_select_db ("nimitztest",$db) or die("bUnable
to select database./b");
$result = mysql_query ("select * from mytable order by
id",$db);
if ($row=mysql_fetch_array($result))
{
while ($row=mysql_fetch_array($result))
{
$FirstName = $row["firstname"];
if ($fname == $FirstName) 
{
for ($i=1; $i=5; $i++)
  {
  $Num[$i] = $row["num$i"];
  if ($Num[$i] == '') {
  printf ("You have to goto Scene$ip"); 
  break;
   }
  } 
}
}
}

But when i include the else statement like below, to
indicate an user with all the fields filled up as 'You
don't have any thing to fill', this code is giving
weird results such as printing like this onto the
screen:

You don't have anything to fill
You have to goto Scene2
You have to goto Scene3
You have to goto Scene4
You have to goto Scene5

for a user with scene2 onwards empty fields.
This may be, because of fault in my code or because of
misinterpretation of the mysql functions by me. 

-
for ($i=1; $i=5; $i++)
{
  $Num[$i] = $row["num$i"];
  if ($Num[$i] == '') {
  printf ("You have to goto Scene$ip");
  }
  else {
  printf ("You don't have anything to fillp");
  }
}
--

Please correct me about the mistake i am making over
above.

TIA
Chakravarthy K Sannedhi



__
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices. 
http://auctions.yahoo.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]




Re: [PHP] session without cookies

2001-01-26 Thread Chris Lee

compile with --enable-trans-sid

works great for me :)

Chris Lee
Mediawaveonline.com




[EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 hi..

 i use the session-functions with php4 and everything works fine.
 but if a visitor turns off cookies nothing seems to work..

 is there a way to support a sessionid with cookies and thru the url ?

 thanks

 markus


 --
 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]




Re: [PHP] PHP on MAC

2001-01-26 Thread lou

You can't on os9.

You have to run it on osX PB (or osx server I believe)

Go here:

http://homepage.mac.com/LightyearDesign/MacOSX/Packages/

 I want to install PHP on iMAC with MAC OS 9, please advise if possible.
 
 Further, is there any lowcost or free web server that supports PHP on my MAC
 OS9.
 
 Thanks in advance.
 
 
 
 


 I want to install PHP on iMAC with MAC OS 9, please advise if possible.
 
 Further, is there any lowcost or free web server that supports PHP on my MAC
 OS9.
 
 Thanks in advance.
 
 
 
 


-- 
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] Looking for Code Example: Telneting to server to verify password

2001-01-26 Thread Scott Brown

I dont know if this is reasonable to do or not, but what I'm thinking of
validating a user based on his/her current username/password.

Does anyone know if this is possible to do?

Or better yet - does someone have some code sitting around I can scavange
from?  PHPBuilder didnt help much



-- 
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] sessions without cookies?

2001-01-26 Thread Noel Akins

Would there be any point in using php sessions if you aren't using cookies? 
You have to store login info anyway, why not just use a temp table to store 
transaction info and write to the database at the end of a session? From 
what I've read on sessions, you have to use cookies
thanks


-- 
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] which syntax?

2001-01-26 Thread kaab kaoutar

hi!

what's the difference between using
?php ? and using ? ? and using script  language="php" /script

thanks
_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.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] arg....

2001-01-26 Thread Kurth Bemis

i'm having a horrible time updating 2 fields in the same db.  I don't get 
an error but the fields aren't updatedcan anyone send me a snippet for 
the to learn from?

~kurth


-- 
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]




RE: [PHP] arg....

2001-01-26 Thread Kurth Bemis

At 12:31 PM 1/26/2001, Krznaric Michael wrote:

sorry - here you all go..


// number crunching time
$count++;
$time = date("Y-m-d H:i:s");

$result = mysql_query("INSERT INTO links (count) VALUES $count WHERE lid=$id");

echo $result;



 You need to be a little more specific about DB and problem type.
You may have to commit the transaction if commit is not implict (ex Oracle).
There could be many resons including your SQL statement.

Mike

-Original Message-
From: Kurth Bemis [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 26, 2001 12:23 AM
To: [EMAIL PROTECTED]
Subject: [PHP] arg


i'm having a horrible time updating 2 fields in the same db.  I don't get
an error but the fields aren't updatedcan anyone send me a snippet for
the to learn from?

~kurth


--
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]




[PHP] include_path in windows

2001-01-26 Thread Shane McBride

I am trying to get my php.ini file configured correctly.

I have a script that calls the require function/command( I'm not sure which it is..)

Here's what the .ini file is:
include_path=d:\sites;d:\sites\merchantpower\setup

According to the notation in the .ini file I have the correct syntax, but it never 
seems to look in the second path.

Can someone explain this to me better. Remember I'm dealing with Windows to do 
development.

I would think that the script would start to look in the d:\sites directory and then 
go to any sub directory from there...

TIA,
-Shane



Re: [PHP] arg....

2001-01-26 Thread Shawn Blaylock

You might want to try this:

mysql_query("INSERT INTO links (count) VALUES ("$count") WHERE
lid=$id");


Kurth Bemis wrote:
 
 At 12:31 PM 1/26/2001, Krznaric Michael wrote:
 
 sorry - here you all go..
 
 // number crunching time
 $count++;
 $time = date("Y-m-d H:i:s");
 
 $result = mysql_query("INSERT INTO links (count) VALUES $count WHERE lid=$id");
 
 echo $result;
 
  You need to be a little more specific about DB and problem type.
 You may have to commit the transaction if commit is not implict (ex Oracle).
 There could be many resons including your SQL statement.
 
 Mike
 
 -Original Message-
 From: Kurth Bemis [mailto:[EMAIL PROTECTED]]
 Sent: Friday, January 26, 2001 12:23 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] arg
 
 
 i'm having a horrible time updating 2 fields in the same db.  I don't get
 an error but the fields aren't updatedcan anyone send me a snippet for
 the to learn from?
 
 ~kurth
 
 
 --
 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]

-- 

Shawn Blaylock, ClipperNet Software Engineer
[EMAIL PROTECTED]
http://www.clipper.net/
Eugene OR  541-431-3360 x406
Toll Free  866-673-6260 x406

-- 
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]




Re: [PHP] Persistent connections and transactions

2001-01-26 Thread Frank Joerdens

On Fri, Jan 26, 2001 at 11:01:14AM +, Nuno Silva wrote:
[ . . . ]
 i ran across this transaction problem vs. persistent conn in pgsql some time ago.
 
 I found two workaround methods:
 - don't use persistent conn's :-) or;
 - start every conn with the usual pg_pconnect and then query a rollback to the 
server:
 $query="ROLLBACK work;"
 
 (this will kill any supposed transaction in ABORT STATE that some child had left).
 
 postgres don't support nested transactions (yet), but when it does maybe you should 
add multiple "ROLLBACK WORK;" queries :-)

Ah. Very cool. What I _still_ don't quite understand, though, is _how_
exactly this situation could come about. And what the worst case would
be. What if you don't kill the transaction in ABORT STATE?

Ta, Frank

-- 
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]




Re: [PHP] Greek PHP mailing list

2001-01-26 Thread Chris Hayes

 The options: Get a graph-link cable (which I can't find ANYWHERE), or make
 your own during study hall, making them sufficiently stupid that the code can
 be compressed down to a screenful:

 kyk():Prgm:Local a,b,c:13-a:"|+|"-b:ClrIO:Output
 0,-1,left(b,a)""right(b,a):While abs(13-a)13:getKey()-c:If abs(50-c)=1
 Then:a+c-50-a:Output 0,-1,left(b,a)""right(b,26-a):EndIf:EndWhile:EndPrgm

 Play with the 1 and 3 keys. Guess what it does by just looking at the code,
 and win a free donut (should arrive within 6-8 weeks, and shouldn't be too
 stale by then). 1 and 3 have character codes 49 and 51, respectively, if you
 want to take this on...

I must admit it is shorter code than javascript would be:
(ie4+, NS4+)

html
head
script language="javascript1.2"
ns4 = (document.layers)? true:false
ie4 = (document.all)? true:false
document.a=13

function keyDown(e) {
a=document.a
b="|+|";
  if (ns4) {var keycode = e.which-50; }
  if (ie4) {var keycode = event.keyCode-50; }

if (Math.abs(keycode)==1){
a=a+keycode
if ((Math.abs(a-13))12)
{alert("CRASH!");document.TI.ROAD.value="";document.a
=13;return 0;}
document.TI.ROAD.value=(b.substring(0,a)+""+ b.substr(a,26))
}
document.a=a
}

document.onkeydown = keyDown
document.captureEvents(Event.KEYDOWN)



/script
body
Do not click inside screen. Press 1 to go left, 3 to go right (on keyboard).

table border=1 bgcolor="#D0D0D0"
trtd colspan=3 align=rightfont size=2 type="arial,helvetica,sans-
serif"Javascript instrument/font/tr

trtd colspan=3
FORM NAME="TI"
INPUT TYPE="TEXT" NAME="ROAD" size="30"
/FORM
/td/tr
trtdSQRTtdMEMtdCOS/tr
trtd7td8td9/tr
trtd4td5td6/tr
trtd1td2td3/tr
trtdnbsp;td0tdnbsp;/tr
/table
/body
/html


--  C.Hayes  Droevendaal 35  6708 PB Wageningen  the Netherlands  --




--
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]




Re: [PHP] arg....

2001-01-26 Thread Iván Sánchez Ortega \MR\

"Kurth Bemis" ...
 At 12:31 PM 1/26/2001, Krznaric Michael wrote:

 sorry - here you all go..


 // number crunching time
 $count++;
 $time = date("Y-m-d H:i:s");

 $result = mysql_query("INSERT INTO links (count) VALUES $count WHERE
lid=$id");

 i'm having a horrible time updating 2 fields in the same db.  I don't get
 an error but the fields aren't updatedcan anyone send me a snippet
for
 the to learn from?

well, if you want to UPDATE fields into a database, then PLEASE NOT INSERT
data...

that code should look:

$result = mysql_query("UPDATE links (count) VALUES ($count) WHERE lid=$id");

i suppose that you are getting $count from the DB before doing $count++; ...

and also have a look at the data types of that table... if the column
'count' is not of NUMBER type, you'll need some quotes in the query... also
applies for the lid.




-- 
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] include_path again

2001-01-26 Thread Shane McBride

OK, I figured out that I had forgotten the quotes around the path(s), but I still 
don't understand the path itself. Will it look in sub directories.For example:

include_path=".;d:\sites"

Will PHP look in any subs under sites?


- Shane



[PHP-I18N] You can have a visa card .. no deposit

2001-01-26 Thread garey

  This company is offering a visa card with no annual fee, no deposit and 
will pay you for the people you refer.Just request the web address by
replying to :  

   [EMAIL PROTECTED]  

 Insert "request " in the subject line
Thank you

-- 
PHP Internationalization 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]




Re: [PHP] Flash/PHP

2001-01-26 Thread Rasmus Lerdorf

 You can use premade flash movies just as you would in HTML. Therefore
 everything that is normally available is available in PHP, plus if you
 want, you get to use the wonderful libswf!  :)

libswf isn't maintained anymore though.  We will soon have the ming
library in PHP, but it works already.  Go to freshmeat.net and search for
"ming".  You can see an example of it on slide 33 of the presentation at
http://conf.php.net/nordu2001

-Rasmus


-- 
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]




Re: [PHP] Flash/PHP

2001-01-26 Thread Mike Chambers

I have created a Generator / PHP library which makes it easy to create Flash
content from PHP using Macromedia Generator.

Unfortunately, do to some bugs in PHP with the System() command on Windows,
I am not going to release the library until the next PHP update (assuming
they fix the bugs).

mike chambers

[EMAIL PROTECTED]

http://www.markme.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]




[PHP] php_oracle.dll

2001-01-26 Thread kaab kaoutar

hi!
how can i get the php_oracle.dll, i'm working on windows NT workstation!
thanks!
_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.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] common.inc probs.

2001-01-26 Thread Shane McBride

I have a script that pulls in the following file via: require 'common.inc'

The problem occurs when it hits the $UNIX_PATH variable. At least I think that's where 
it creates a problem. If I comment it out it works fine, but I of course need that 
variable. 

First of all I created a script that creates this file and I don't understand why it 
doubled the backslashes in the $UNIX_PATH variable. Secondly, why it is crapping out 
on the double backslashes? I thought PHP would use the first one as an escape 
character.

As a side note: I know the example shown here shows a windows path for the unix path 
variable, I'm trying to port this over to winders..  :-0

?
$DB_SERVER="localhost";
$DB_LOGIN="shane";
$DB_PASSWORD="whatever";
$DB_NAME="test";
$HTTP_HOST="localhost";
$AUTH_USER="admin";
$AUTH_PASS="installme";
$CO_NAME="RDI Technologies";
$EMAIL="[EMAIL PROTECTED]";
$UNIX_PATH="d:\\sites\\mercpow\\mp\images\";
$WWW_PATH="http://localhost/mp/images/$image";
$DOC_ROOT="mp";
$ADMINROOT="admin";
?

TIA-

-Shane




Re: [PHP] Echo and Print

2001-01-26 Thread kaab kaoutar


print is a function where u can add html tags like
print("brb hello $name") however echo is a command where we can't 
include html tags ! echo "hello".$name


From: Philip Olson [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
CC: [EMAIL PROTECTED]
Subject: Re: [PHP] Echo and Print
Date: Fri, 26 Jan 2001 18:29:27 + (GMT)



What is the difference between echo and print ?
---
http://www.faqts.com/knowledge_base/view.phtml/aid/1/fid/41

Philip

On 26 xxx -1 [EMAIL PROTECTED] wrote:

  I know it is a kind of stupid question but I was trying to figure out
  the difference between "Echo" and "Print" and I didn't find it...Could
  anybody explain that to me??
  Thank you
 
  Felipe Lopes
 
 
  MailBR - O e-mail do Brasil -- http://www.mailbr.com.br
  Faça já o seu. É gratuito!!!
 
  --
  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]


_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.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]




Re: [PHP] Modulus

2001-01-26 Thread Teodor Cimpoesu

Hi Mike!
On Thu, 25 Jan 2001, Mike P wrote:

 I know i'm a liitle slow but why does 2%4 = 2 and not 0 or 1
cause 4*0+2=2

 thanks
 Mike
 [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]
-- teodor

-- 
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]




Re: [PHP] Echo and Print

2001-01-26 Thread Philip Olson

 print is a function where u can add html tags like
 print("brb hello $name") however echo is a command where we can't 
 include html tags ! echo "hello".$name

This is VERY incorrect, please read this :

 What is the difference between echo and print ?
 ---
 http://www.faqts.com/knowledge_base/view.phtml/aid/1/fid/41

And then try this :

$name = 'fred';

echo  "brb$name/bbr" . $name;
print "brb$name/bbr" . $name

Then try this :

echo  'sup','yo';
print 'sup','yo'; // Parse error!

But that FAQ explains it better then I can so ...

Philip

 On 26 xxx -1 [EMAIL PROTECTED] wrote:
 
   I know it is a kind of stupid question but I was trying to figure out
   the difference between "Echo" and "Print" and I didn't find it...Could
   anybody explain that to me??
   Thank you
  
   Felipe Lopes



-- 
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] CGI ERROR on IIS4 and PHP 4.0.4pl1

2001-01-26 Thread Angel Behar

Hi !!

I'm running PHP under IIS4 and PHP 4.0.4pl1 and all my scripts work perfect
but one that try to access  a DBF database via ODBC.

I set all the permission on php.exe , the database and the script.

the error I receive is :

The specified CGI application misbehaved by not returning a complete set of
HTTP headers. The headers it did return are:

I've been reading a lot of threads obou this and I set all the privileges
and still not working, and as I said earlier all my scripts work but this.

I appreciate any help.

Thanks in advance.

Angel.


-- 
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] mod_php4 + mod_python + apache 1.3.14: no workie!

2001-01-26 Thread Aaron Faby

Hello,

I have successfully compiled mod_php4 and mod_python as DSO's for apache 
1.3.14, and both will
work independently with apache, but if I try to load both of them at I 
get the following apache
error:

dyld: /usr/sbin/apache multiple definitions of symbol _pcre_free
/System/Library/Apache/Modules/mod_python.so definition of _pcre_free
/System/Library/Apache/Modules/libphp4.so definition of _pcre_free

Has anyone gotten these modules to work concurrently? TIA!

--
Aaron Faby   Software 
Developer
Tenon Intersystems 
 
[EMAIL PROTECTED]
1123 Chapala Street
805-963-6983
Santa Barbara, CA 93103 
http://www.tenon.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]




Re: [PHP] how to rename a database

2001-01-26 Thread Dominic

at a mysql prompt in the database where your table resides, type the
following:

alter table currentname rename newname;

That should take care of it.

--
Dominic

Fang Li wrote:
 
 Does anyone know how to rename a database in MySQL?
 Thanks!
 
 fang
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
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-CVS] cvs: php4 /ext/pdf pdf.c php_pdf.h

2001-01-26 Thread Egon Schmid

eschmid Fri Jan 26 10:52:37 2001 EDT

  Modified files:  
/php4/ext/pdf   php_pdf.h pdf.c 
  Log:
  Fixed some protos.
  

Index: php4/ext/pdf/php_pdf.h
diff -u php4/ext/pdf/php_pdf.h:1.12 php4/ext/pdf/php_pdf.h:1.13
--- php4/ext/pdf/php_pdf.h:1.12 Fri Jan 26 00:20:23 2001
+++ php4/ext/pdf/php_pdf.h  Fri Jan 26 10:52:37 2001
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: php_pdf.h,v 1.12 2001/01/26 08:20:23 steinm Exp $ */
+/* $Id: php_pdf.h,v 1.13 2001/01/26 18:52:37 eschmid Exp $ */
 
 #ifndef PHP_PDF_H
 #define PHP_PDF_H
@@ -89,7 +89,7 @@
 PHP_FUNCTION(pdf_setrgbcolor_stroke);
 PHP_FUNCTION(pdf_setrgbcolor);
 PHP_FUNCTION(pdf_open_image_file);  /* new parameters: [char *stringpram, int 
intparam] */
-PHP_FUNCTION(pdf_open_CCITT);  /* new function */
+PHP_FUNCTION(pdf_open_ccitt);  /* new function */
 PHP_FUNCTION(pdf_open_image);  /* new function: checkit not yet completeted :( */
 PHP_FUNCTION(pdf_close_image);
 PHP_FUNCTION(pdf_place_image);
Index: php4/ext/pdf/pdf.c
diff -u php4/ext/pdf/pdf.c:1.66 php4/ext/pdf/pdf.c:1.67
--- php4/ext/pdf/pdf.c:1.66 Fri Jan 26 00:20:23 2001
+++ php4/ext/pdf/pdf.c  Fri Jan 26 10:52:37 2001
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: pdf.c,v 1.66 2001/01/26 08:20:23 steinm Exp $ */
+/* $Id: pdf.c,v 1.67 2001/01/26 18:52:37 eschmid Exp $ */
 
 /* pdflib 2.02 ... 3.0x is subject to the ALADDIN FREE PUBLIC LICENSE.
Copyright (C) 1997-1999 Thomas Merz. 2000-2001 PDFlib GmbH */
@@ -115,7 +115,7 @@
PHP_FE(pdf_setrgbcolor_stroke, NULL)
PHP_FE(pdf_setrgbcolor, NULL)
PHP_FE(pdf_open_image_file, NULL)  /* new parameters: [char *stringpram, int 
intparam] */
-   PHP_FE(pdf_open_CCITT, NULL)/* new function */
+   PHP_FE(pdf_open_ccitt, NULL)/* new function */
PHP_FE(pdf_open_image, NULL)/* new function */
PHP_FE(pdf_close_image, NULL)
PHP_FE(pdf_place_image, NULL)
@@ -375,9 +375,7 @@
 
 
 /* {{{ proto int pdf_open([int filedesc])
-   Opens a new pdf document. If filedesc is NULL, document is created in memory.
-   This is the old interface, only for compatibility 
-   use pdf_new + pdf_open_file instead */
+   Opens a new pdf document. If filedesc is NULL, document is created in memory. This 
+is the old interface, only for compatibility use pdf_new + pdf_open_file instead */
 PHP_FUNCTION(pdf_open) 
 {
zval **file;
@@ -506,7 +504,7 @@
 }
 /* }}} */
 
-/* {{{ proto int pdf_show_boxed(int pdfdoc, string text, double x-koor, double 
y-koor, double width, double height, string mode, [string feature])
+/* {{{ proto int pdf_show_boxed(int pdfdoc, string text, double x-koor, double 
+y-koor, double width, double height, string mode [, string feature])
Output text formated in a boxed */
 PHP_FUNCTION(pdf_show_boxed) 
 {
@@ -781,7 +779,7 @@
 /* }}} */
 
 /* {{{ proto void pdf_set_text_pos(int pdfdoc, double x, double y)
-   Set the position of text for the next pdf_show call */
+   Sets the position of text for the next pdf_show call */
 PHP_FUNCTION(pdf_set_text_pos) 
 {
zval **arg1, **arg2, **arg3;
@@ -820,7 +818,7 @@
 /* }}} */
 
 /* {{{ proto double pdf_stringwidth(int pdfdoc, string text [, int font, double size])
-   Returns width of text in current font*/
+   Returns width of text in current font */
 PHP_FUNCTION(pdf_stringwidth)
 {
zval **arg1, **arg2, **arg3, **arg4;
@@ -1515,7 +1513,7 @@
 /* }}} */
 
 /* {{{ proto void pdf_setrgbcolor_fill(int pdfdoc, double red, double green, double 
blue)
-   Sets filling color to rgb color value */
+   Sets filling color to RGB color value */
 PHP_FUNCTION(pdf_setrgbcolor_fill)
 {
zval **arg1, **arg2, **arg3, **arg4;
@@ -1536,7 +1534,7 @@
 /* }}} */
 
 /* {{{ proto void pdf_setrgbcolor_stroke(int pdfdoc, double red, double green, double 
blue)
-   Sets drawing color to rgb color value */
+   Sets drawing color to RGB color value */
 PHP_FUNCTION(pdf_setrgbcolor_stroke)
 {
zval **arg1, **arg2, **arg3, **arg4;
@@ -1557,7 +1555,7 @@
 /* }}} */
 
 /* {{{ proto void pdf_setrgbcolor(int pdfdoc, double red, double green, double blue)
-   Sets drawing and filling color to rgb color value */
+   Sets drawing and filling color to RGB color value */
 PHP_FUNCTION(pdf_setrgbcolor)
 {
zval **arg1, **arg2, **arg3, **arg4;
@@ -1577,8 +1575,8 @@
 }
 /* }}} */
 
-/* {{{ proto int pdf_add_bookmark(int pdfdoc, string text [, int parent, int open]);
-   Add bookmark for current page */
+/* {{{ proto int pdf_add_bookmark(int pdfdoc, string text [, int parent, int open])
+   Adds bookmark for current page */
 PHP_FUNCTION(pdf_add_bookmark)
 {
zval **arg1, **arg2, **arg3, **arg4;
@@ -1725,7 +1723,7 @@
 }
 
 /* {{{ proto int pdf_open_gif(int pdf, string giffile)
-   Opens a gif file and returns an image for placement in a pdf document */
+   Opens a GIF file and returns an 

Re: [PHP] how to rename a database

2001-01-26 Thread Philip Olson


Here's a FAQ on renaming a mysql database :

http://www.faqts.com/knowledge_base/view.phtml/aid/1262/fid/102

If anyone has useful words to add to it then do so.

Philip

 Fang Li wrote:
  
  Does anyone know how to rename a database in MySQL?
  Thanks!
  
  fang
  
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
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] Uninstallation of CGI Version of PHP -- ISAPI Module Wanted Instead

2001-01-26 Thread rswfire

Hello...

I just upgraded my computer to NT5.  When doing
so, I accidentally installed 
the wrong version of PHP.  =(

I installed the CGI version...  I want to use the
ISAPI module.  How can I 
effectively undo what the installation program
did to install the CGI 
version?  What should I do to install the ISAPI
module now?

Thanks in advance for your help.

Sincerely,
rswfire


__
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices. 
http://auctions.yahoo.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] Display progress in browser using flush(); IE versus NS

2001-01-26 Thread Spallek, Heiko

Hi,

I have a script which slowly processes several thousand lines of text. I
want to give users a feeling for that the process is not dead. Thus, I am
using:

...
print "processing ";
print"
";
flush();

for($i=0;$icount($total);$i++) {
print".
  ";
flush();
// do something time consuming
}
...

Works perfect in IE 5.5: It shows the word "processing" followed every 2
seconds (denpending on what I am doing) by a new period.

But, in Netscape nothing shows up until the entire process has finished.
When I push "stop" on the Netspace menu it shows what was transfered so far
and "Transfer interrupted!" But, I would rather have it the way it is in IE.

Any idea how to improve the code above?
Thanks!

Der Heiko

Buchtipp: http://www.aufbruch.com/
Heiko und Gisela Spallek:
Aufbruch ins Land der unbegrenzten Moeglichkeiten.
Studieren, Arbeiten und Leben in den USA: Tips fuer Neuankoemmlinge
2. erweiterte und ueberarbeitete Auflage: ISBN: 3-934407-01-3






-- 
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]




Re: [PHP] common.inc probs.

2001-01-26 Thread Mark Maggelet

On Fri, 26 Jan 2001 13:37:42 -0500, Shane McBride
([EMAIL PROTECTED]) wrote:
I have a script that pulls in the following file via: require
'common.inc'

The problem occurs when it hits the $UNIX_PATH variable. At least I
think that's where it creates a problem. If I comment it out it
works fine, but I of course need that variable.

First of all I created a script that creates this file and I don't
understand why it doubled the backslashes in the $UNIX_PATH
variable. Secondly, why it is crapping out on the double
backslashes? I thought PHP would use the first one as an escape
character.

As a side note: I know the example shown here shows a windows path
for the unix path variable, I'm trying to port this over to
winders..  :-0

?
$DB_SERVER="localhost";
$DB_LOGIN="shane";
$DB_PASSWORD="whatever";
$DB_NAME="test";
$HTTP_HOST="localhost";
$AUTH_USER="admin";
$AUTH_PASS="installme";
$CO_NAME="RDI Technologies";
$EMAIL="[EMAIL PROTECTED]";
$UNIX_PATH="d:\\sites\\mercpow\\mp\images\";

it's obvious if you look at it, you want:
$UNIX_PATH="d:\\sites\\mercpow\\mp\\images\\";



--
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] Using PHP to do centralized site authentication

2001-01-26 Thread Aaron D. Turner

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


I'm trying to do something in PHP4.0.4p1 that in the past I've done in
mod_perl, but appears to be more difficult.  Basically I have some PHP
code that does access checks against a DB to see if that user has access
to the requested URL.  I'm using mod_layout to call the PHP script so I
can wrap static html pages, CGI's, and not just PHP pages.

The issue is that for CGI's, I don't seem to be able to prevent the CGI
from actually executing and displaying content.  About the best I can do
is generate a 302 with a 0 second delay in the meta tags to send them to a
"Sorry buddy" page, but the CGI output is displayed briefly.

Does anyone know of a way to force the Apache process to abort further
processing?  exit and die just kill off the PHP processing engine, leaving
the CGI running.  I tried trigger_error, but that just displayed a nice
error message.

Anyone have any other ideas?  I've thought about generating a 302 in the
http-headers and using the Location: parameter to send them someplace else
(like how mod_rewrite does redirection) but I can't seem to get it to
work.

Thanks.

- -- 
Aaron Turner [EMAIL PROTECTED]|synfin.net|linuxkb.org  URI:www.synfin.net
They that can give up essential liberty to obtain a little temporary safety 
deserve neither liberty nor safety. -- Benjamin Franklin

pub 1024D/F86EDAE6  Sig: 3167 CCD6 6081 0FFC B749  9A8F 8707 9817 F86E DAE6
All emails by me are PGP signed; a lack of a signature indicates a forgery.
I have retired my PGP 2.6.2 key: FBE1 CEED 57E4 AB80  596E 60BF 451B 20E8 
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.4 (GNU/Linux)
Comment: Public key at: http://www.synfin.net/aturner/pgpkey.asc

iEYEARECAAYFAjpx1jEACgkQhweYF/hu2ubKJwCfXrm/sQEy3t8u7vefaGlD/Pyb
zTYAn1EcoNK+fBdnF8IFLMn6ojANnbyb
=PGwr
-END PGP SIGNATURE-



-- 
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]




Re: [PHP] Using PHP to do centralized site authentication

2001-01-26 Thread Rasmus Lerdorf

Just do:

Header("Location: $url");
exit;

-Rasmus

On Fri, 26 Jan 2001, Aaron D. Turner wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1


 I'm trying to do something in PHP4.0.4p1 that in the past I've done in
 mod_perl, but appears to be more difficult.  Basically I have some PHP
 code that does access checks against a DB to see if that user has access
 to the requested URL.  I'm using mod_layout to call the PHP script so I
 can wrap static html pages, CGI's, and not just PHP pages.

 The issue is that for CGI's, I don't seem to be able to prevent the CGI
 from actually executing and displaying content.  About the best I can do
 is generate a 302 with a 0 second delay in the meta tags to send them to a
 "Sorry buddy" page, but the CGI output is displayed briefly.

 Does anyone know of a way to force the Apache process to abort further
 processing?  exit and die just kill off the PHP processing engine, leaving
 the CGI running.  I tried trigger_error, but that just displayed a nice
 error message.

 Anyone have any other ideas?  I've thought about generating a 302 in the
 http-headers and using the Location: parameter to send them someplace else
 (like how mod_rewrite does redirection) but I can't seem to get it to
 work.

 Thanks.

 - --
 Aaron Turner [EMAIL PROTECTED]|synfin.net|linuxkb.org  URI:www.synfin.net
 They that can give up essential liberty to obtain a little temporary safety
 deserve neither liberty nor safety. -- Benjamin Franklin

 pub 1024D/F86EDAE6  Sig: 3167 CCD6 6081 0FFC B749  9A8F 8707 9817 F86E DAE6
 All emails by me are PGP signed; a lack of a signature indicates a forgery.
 I have retired my PGP 2.6.2 key: FBE1 CEED 57E4 AB80  596E 60BF 451B 20E8
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.0.4 (GNU/Linux)
 Comment: Public key at: http://www.synfin.net/aturner/pgpkey.asc

 iEYEARECAAYFAjpx1jEACgkQhweYF/hu2ubKJwCfXrm/sQEy3t8u7vefaGlD/Pyb
 zTYAn1EcoNK+fBdnF8IFLMn6ojANnbyb
 =PGwr
 -END PGP SIGNATURE-



 --
 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]




[PHP] PHP on FreeBSD 3.2

2001-01-26 Thread Julia A . Case

I'm having some trouble with PHP4 on a FreeBSD 3.2 machine.  PHP3 compiles 
and works fine, but PHP4 gives a floating point error (both as a module 
and static).  PHP4 under FreeBSD 4.2 works fine.

Any ideas,
Julia

-- 
[  Julia Anne Case  ] [Ships are safe inside the harbor,   ]
[Programmer at large] [  but is that what ships are really for.]  
[   Admining Linux  ] [   To thine own self be true.   ]
[ Windows/WindowsNT ] [ Fair is where you take your cows to be judged. ]
  

-- 
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]




Re: [PHP] PHP on FreeBSD 3.2

2001-01-26 Thread Rasmus Lerdorf

Try a snapshot from http://snaps.php.net

This should be fixed.

-Rasmus

On Fri, 26 Jan 2001, Julia A . Case wrote:

 I'm having some trouble with PHP4 on a FreeBSD 3.2 machine.  PHP3 compiles
 and works fine, but PHP4 gives a floating point error (both as a module
 and static).  PHP4 under FreeBSD 4.2 works fine.

 Any ideas,
 Julia

 --
 [  Julia Anne Case  ] [Ships are safe inside the harbor,   ]
 [Programmer at large] [  but is that what ships are really for.]
 [   Admining Linux  ] [   To thine own self be true.   ]
 [ Windows/WindowsNT ] [ Fair is where you take your cows to be judged. ]


 --
 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]




[PHP] header problems

2001-01-26 Thread Kurth Bemis

when i put this
header('location: $url');

i get this

http://domain.com/$url

what the hell am i doing wrong?


-- 
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] File upload error

2001-01-26 Thread Data Driven Design

I have a script that works fine on my server but gives this error on the
server where I need it.

Warning: File Upload Error - Unable to open temporary file [./php06339aaa]
in /home/sites/site9/web/photo_admin/upload.php3 on line 138

Could someone point me in the right direction?

Thanks.

Data Driven Design
PO Box 1084
Holly Hill, Florida 32117

http://www.datadrivendesign.com
http://www.rossidesigns.net


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




Re: [PHP] setting register_globals off

2001-01-26 Thread Alex Black

Sort of along these lines, has anyone done tests to see if you can 100%
ditch php.ini, and run all the php config info in httpd.conf? I'd much
rather do it that way, I'd only have to maintain 1 file...

_a




On 1/25/01 1:36 AM, in article
Pine.BSF.4.10.10101250910530.26823-10@localhost, "Philip Olson"
[EMAIL PROTECTED] wrote:

 Hi Catalin,
 
 I'm trying to decipher what can and cannot be set with ini_set myself and
 am slowly figuring it out :-)  This cannot be set this way but rather it
 could be set through .htaccess so :
 
 this works in .htaccess :
 
   php_value register_globals off
 
 this will not work in script :
 
   ini_set("register_globals","off");
 
 The latter will set the "local value" but it won't be of any use, it will
 remain "on" although if you do ini_get("register_globals") right below it
 it'll report them as "off" when in fact they are "on"  There you have it.
 The answer is "NO" as, as quoted from a similar question awhile ago :
 
 "Directives that affect actions that are taken before a script is
 parsed, such as mangling EGPCS data, can not be changed by the script."
- Rasmus
 
 This certainly falls into that category.
 
 Regards,
 
  be outside the box.
 Philip Olson
 http://www.cornado.com/
 
 
 On Thu, 25 Jan 2001, Catalin Borcea wrote:
 
 Can I set "register_globals=off" using a runtime configuration directive
 (something like ?php_register_globals_off?)?
 
 TIA
 -- Catalin Borcea --
   \\\|///
  \\ - - //
( @ @ )
  -oOOO(_)OOOo
 
 
 
 
 -- 
 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]




Re: [PHP] Best way to describe Doc as HTML

2001-01-26 Thread Alex Black

   print "Content-type: text/html\n\n";

That's the "perl" method, because perl doesn't have any native functions for
adding stuff to the response header, so you just print it :)


   header( "Content-type: test/html" );

The above is correct.

_alex


-- 
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]




Re: [PHP] header problems

2001-01-26 Thread Teodor Cimpoesu



Kurth Bemis wrote:
 
 when i put this
 header('location: $url');
 
 i get this
 
 http://domain.com/$url
 
 what the hell am i doing wrong?
 
erm,
header ("Location: $url");

[double quotes, so PHP will consider your dollars, yens or whatever]

--teodor

-- 
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] Sybase

2001-01-26 Thread Rick Ridgeway

Can someone give me an example of a simple sybase query page?

here is what i have:

?
$server = "someserver";
$user = "sybuser";
$pass = "sybpass";
$query = "select * from SomeSillyTable where ThatSillyGuy='me'";
sybase_connect ($server, $user, $pass);
sybase_query ($query);
sybase_close ();
?

Here is what I get:

Warning: -1 is not a Sybase link index in /www/smurfy/include/clumpysql.php on
line 7

Warning: -1 is not a Sybase link index in /www/smurfy/include/clumpysql.php on
line 8


-- 
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]




Re: [PHP] PHP on MAC

2001-01-26 Thread Michael A. Peters


On Friday, January 26, 2001, at 09:16 AM, lou wrote:

 You can't on os9. 

Sure you can.
Its called webten

http://www.webten.com/

and it supports php

  
 You have to run it on osX PB (or osx server I believe) 

Or you could go with a freely available operating system such as Linux.
You can get YellowDog or Debian CD's dirt cheap from http://www.cheapbytes.com/

The commercial nix aren't the only nix for PowerPC :P

  
 Go here: 
  
 http://homepage.mac.com/LightyearDesign/MacOSX/Packages/ 
  
  I want to install PHP on iMAC with MAC OS 9, please advise if possible. 
   
  Further, is there any lowcost or free web server that supports PHP on my MAC 
  OS9. 
   
  Thanks in advance. 
   
   
   
   
  
  
  I want to install PHP on iMAC with MAC OS 9, please advise if possible. 
   
  Further, is there any lowcost or free web server that supports PHP on my MAC 
  OS9. 
   
  Thanks in advance. 
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Michael A. Peters
Abriasoft Senior Developer

(510)  623-9726x357
Fax: (510) 249-9125
--
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]




Re: [PHP] Using a variable to select what variable to use...???

2001-01-26 Thread Steve Edberg

At 9:32 AM -0800 1/26/01, Brandon Orther wrote:
Hello,

I am doing a do loop and I want it to change what variable to use each
run...

First time use: $run1

Second time use: $run2

Third time use: $run2

I hope you can understand what I am saying.



'Variable variables'; see

http://www.php.net/manual/en/language.variables.variable.php

If you meant $run3 on the third time line, then you can use

for ($i=1; $i$SomeNumber; $i++)
{
$SomeValue = some_function(${run$i});
}

Or, use could say

for ($i=1; $i$SomeNumber; $i++)
{
$VarName = "run$i";
$SomeValue = some_function($$VarName);
}

If you actually _wanted_ to use '$run2' on the third time, I'm 
interpreting that to mean you want to limit the maximum value of the 
digit to 2. If so, you could do

for ($i=1; $i$SomeNumber; $i++)
{
$VarName = 'run'.max($i, 2);
$SomeValue = some_function($$VarName);
}


-Steve



Brandon Orther
WebIntellects Design/Development Manager
[EMAIL PROTECTED]
800-994-6364
www.webintellects.com



-- 
+--- "They've got a cherry pie there, that'll kill ya" --+
| Steve Edberg   University of California, Davis |
| [EMAIL PROTECTED]   Computer Consultant |
| http://aesric.ucdavis.edu/  http://pgfsun.ucdavis.edu/ |
+-- FBI Special Agent Dale Cooper ---+

-- 
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]




Re: [PHP] PHP on FreeBSD 3.2

2001-01-26 Thread Julia A . Case

Thanks, it works now.

Julia

Quoting Rasmus Lerdorf ([EMAIL PROTECTED]):
 Try a snapshot from http://snaps.php.net
 
 This should be fixed.
 
 -Rasmus
 
 On Fri, 26 Jan 2001, Julia A . Case wrote:
 
  I'm having some trouble with PHP4 on a FreeBSD 3.2 machine.  PHP3 compiles
  and works fine, but PHP4 gives a floating point error (both as a module
  and static).  PHP4 under FreeBSD 4.2 works fine.
 
  Any ideas,
  Julia
 
  --
  [  Julia Anne Case  ] [Ships are safe inside the harbor,   ]
  [Programmer at large] [  but is that what ships are really for.]
  [   Admining Linux  ] [   To thine own self be true.   ]
  [ Windows/WindowsNT ] [ Fair is where you take your cows to be judged. ]
 
 
  --
  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]

-- 
[  Julia Anne Case  ] [Ships are safe inside the harbor,   ]
[Programmer at large] [  but is that what ships are really for.]  
[   Admining Linux  ] [   To thine own self be true.   ]
[ Windows/WindowsNT ] [ Fair is where you take your cows to be judged. ]
  

-- 
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]




RE: [PHP] File upload error

2001-01-26 Thread Robert Collins

that sounds like a permissions error.
check the permissions for all of the directories and the file along your
path.


-Original Message-
From: Data Driven Design [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 26, 2001 1:04 PM
To: [EMAIL PROTECTED]
Subject: [PHP] File upload error


I have a script that works fine on my server but gives this error on the
server where I need it.

Warning: File Upload Error - Unable to open temporary file [./php06339aaa]
in /home/sites/site9/web/photo_admin/upload.php3 on line 138

Could someone point me in the right direction?

Thanks.

Data Driven Design
PO Box 1084
Holly Hill, Florida 32117

http://www.datadrivendesign.com
http://www.rossidesigns.net


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



[PHP] Check for Page

2001-01-26 Thread Karl J. Stubsjoen

How could I:

How could I check to make sure a page exists before I redirect to it (a page
within my own server, but page name passed in querystring - therefore it
could be changed by client)?

Thanks!


-- 
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]




RE: [PHP] rand(), mt_rand(), and my inability to make either of them random.

2001-01-26 Thread Robert Collins

this is a function that I wrote to solve this problem, but it is almost
impossible to get a truly random number you can get somthing pretty close by
seeding with somthing like the time function, using the seconds since epoch
and this should be hard to duplicate.

?php
function random_number($config, $lownum, $highnum){

$time = date(U);
$seed = srand($time);
$rand = rand($lownum, $highnum);

echo  "FONT FACE=\"$fontstyle\" SIZE=\"$fontsize\"
COLOR=\"$fontcolor\"$rand/FONT";

$lownum  = "1";
$highnum = "100";
random_number("config.inc.php", $lownum, $highnum);

}
?

-Original Message-
From: April [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 26, 2001 1:50 PM
To: PHP General
Subject: [PHP] rand(), mt_rand(), and my inability to make either of
them random.


I have this scriptlet:

$items = 6;
$randnum = rand(1,$items);
echo $randnum . "brbr";

Always, no matter how many times I hit refresh, it'll always return the
lowest possible value, in this case 1.  If I have rand(4,$items), it returns
four.

So I tried mt_rand(), with this:

$items = 6;
$randnum = mt_rand(1,$items);
echo $randnum . "brbr";

This always, without fail, returns the highest possible value.  6 in this
case.

I'm using Apache/4.0.3pl1 on Windows 2000, locally, just to develop.  Could
this be a cache type problem?  Could the gods be conspiring to drive me
steadily insane?

April


-- 
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]



RE: [PHP] Check for Page

2001-01-26 Thread Robert Collins

Try this:

?
$filename = "dat.txt";

if (file_exists($filename)){
echo "file exists";
} else {
echo "file does not exist";
}
?

Robert W. Collins
Web Developer II
Insight / TC Computers
www.insight.com
www.tccomputers.com

-Original Message-
From: Karl J. Stubsjoen [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 26, 2001 1:58 PM
To: PHP Mailing List
Subject: [PHP] Check for Page


How could I:

How could I check to make sure a page exists before I redirect to it (a page
within my own server, but page name passed in querystring - therefore it
could be changed by client)?

Thanks!


-- 
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]



  1   2   >