Re: [PHP] Bad Practices

2001-02-14 Thread Rick Hodger


"Jeff Oien" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Would people like to list bad practices and also point us
> newbies to any articles online dealing with syntax, correct
> use of single and double quotes etc.?

People who create scripts that include a need for access to a SQL database,
meaning you need to give it a username and password then making the damn
configuration file be called something stupid like config.inc.

When you are scripting, using anything with a .inc extension is just asking
for trouble. If someone requests that file, it'll get passed straight to
them. It's a .inc, which means that PHP does not know to parse it. Which
means, that person can see your usernames and passwords. And because it's a
public package, they're far more likely to know the path to said file.

--
Rick Hodger



-- 
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] strange behavior of mysql & php

2001-02-14 Thread Altaf Shaikh

Very strange thing happened today. I had a db and a website that was running
fine and wanted to add another mysql db to the account, and when i did the
site no longer connects to the mysql server. I did not change any passwords
or anything else for that matter, simply added a database with a diff name
and then poof. Any suggestions on how to figure out what's going on? I can
get to the original db via phpmyadmin and the data is there. It just wont
connect from the website to the server.

What could be going on?

Al



-- 
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 Digest 14 Feb 2001 08:47:09 -0000 Issue 511

2001-02-14 Thread php-general-digest-help


php-general Digest 14 Feb 2001 08:47:09 - Issue 511

Topics (messages 39486 through 39600):

empty form field => pgsql NULL gracefully how?
39486 by: Britton

Newbie -- tutorial exercises reveal too much -- pdf download not "saveable"
39487 by: Info
39546 by: David Robley

php and xml
39488 by: Jan Grafström
39496 by: Chris Lee
39502 by: Nathan Cassano

converting a date to a string format
39489 by: Don
39490 by: Egon Schmid (.vacation)
39493 by: Chris Lee
39497 by: Philip Olson
39532 by: Jared Howard

Using a variable in a variable
39491 by: Brandon Orther
39492 by: John Huggins
39494 by: Chris Lee
39495 by: Sam Masiello
39503 by: Alexander Wagner
39558 by: Maxim Maletsky

Piping/parsing Apache logs though PHP?
39498 by: Michael McGlothlin
39500 by: Kurth Bemis
39501 by: Thor M. Steindorsson
39504 by: Balak, Frank

Re: Would Like to know
39499 by: Chris Lee
39508 by: Sam Leibowitz
39557 by: Maxim Maletsky

Re: parse speed vs require speed
39505 by: Chris Lee
39555 by: Maxim Maletsky

Re: Your Opinion?! PHP4 coding style - Comment and Splitting source code
39506 by: Sam Leibowitz
39509 by: Mark Maggelet

XML parsing problems..
39507 by: Michael McGlothlin

INSERT into MSSQL Server
39510 by: Conover, Ryan
39511 by: Peter Houchin
39513 by: Michael McGlothlin

installing MySQL with PHP4.0.3pl1
39512 by: Paulson, Joseph V. \"Jay\"

Re: [PHP-DB] installing MySQL with PHP4.0.3pl1
39514 by: Thor M. Steindorsson
39516 by: Darryl Friesen

Re: SELECT statement
39515 by: Peter Houchin
39517 by: Michael McGlothlin

Re:LOCK TABLES x COMMIT/ROLLBACK
39518 by: Phil Daintree
39548 by: Christian Dechery

URGENT! Regarding file writing
39519 by: whatever
39521 by: Michael McGlothlin
39523 by: whatever
39525 by: Michael McGlothlin

could anyone please help me with this date coding?
39520 by: Charles Mulford
39540 by: David Robley

Upload form
39522 by: Brandon Orther
39538 by: jason cox
39541 by: Brandon Orther
39559 by: Maxim Maletsky

file upload temp file is and isn't there
39524 by: Aaron D. Turner
39528 by: Michael McGlothlin
39531 by: Aaron D. Turner
39539 by: jason cox
39543 by: Aaron D. Turner
39574 by: Aaron D. Turner

Still can't talk to the Oracle
39526 by: Kristofer Widholm

session encode
39527 by: Peter Houchin
39529 by: Michael McGlothlin
39536 by: Peter Houchin

Re: Here you have, ;o)
39530 by: Josh G

Going backwards with sessions.
39533 by: Doug Budny
39534 by: Michael McGlothlin
39535 by: Chris Lee
39537 by: Chris Lee
39545 by: Doug Budny

Re: GD library
39542 by: David Robley
39544 by: Michael McGlothlin

Re: [PHP-WIN] INSERT into MSSQL Server
39547 by: Frank M. Kromann

mysql_error() not really helping
39549 by: Christian Dechery
39561 by: scottrus.ipass.net
39569 by: David Robley
39573 by: David Robley

Fast Template woes
39550 by: Joseph H Blythe

Re: rename?
39551 by: Maxim Maletsky

PHP 4 on RedHat 7
39552 by: Mike Tuller
39560 by: scottrus.ipass.net
39578 by: Michael Stearne
39581 by: scottrus.ipass.net

Re: hidden form field.
39553 by: Maxim Maletsky

Re: Include
39554 by: Maxim Maletsky
39582 by: Ankur Verma

Re: ereg_replace
39556 by: Maxim Maletsky

Re: Bad Practices
39562 by: Mark Charette
39599 by: Rick Hodger

Short tags - proper name?
39563 by: Toby Butzon

Random String of n Length
39564 by: Jonathan Sharp
39566 by: Randall Blaine Goguen

Re: passthru environment variables
39565 by: Rich Puchalsky

is the list still up?
39567 by: LDL Enterprise
39568 by: LDL Enterprise
39571 by: Toby Butzon

ezmlm response (fwd)
39570 by: John Monfort

Line Break
39572 by: Deependra B. Tandukar
39575 by: David Robley
39576 by: John Monfort

re:linebreak
39577 by: Deependra B. Tandukar
39584 by: Steve Werby

Re: Any image drawing tutorials anywhere?
39579 by: Ankur Verma

Re: Cookies
39580 by: Ankur Verma

mail not sending to multiple address
39583 by: Peter Houchin

about session
39585 by: JW
39586 by: Maxim Maletsky
39588 by: Ankur Verma
39592 by: JW
39593 by: JW
39597 by: Maxim Maletsky

Installation on win32
39587 by: Sean Kennedy
39591 by: Julie Meloni
39595 by: Maxim Maletsky

SOAP
39589 by: Christopher Cheng
39590 by: Christ

RE: [PHP] OOP in web development

2001-02-14 Thread Nold, Mark


- 
Disclaimer: The information contained in this email is intended only for the
use of the person(s) to whom it is addressed and may be confidential or
contain legally privileged information. If you are not the intended
recipient you are hereby notified that any perusal, use, distribution,
copying or disclosure is strictly prohibited. If you have received this
email in error please immediately advise us by return email at
[EMAIL PROTECTED] and delete the email document without making a
copy. 

-

I have to agree that OOP is much better in abstracting than user defined
functions... why?

To return some data and display in a HTML table it i do:
$db = new DB;
$db->query("SELECT foo from bar");

$t = new Table;
echo $t->create($db->data);


Pretty easy. Now i could have all these have be functions

$data = query($connection_details,"SELECT foo from bar");
echo create_table($data);

But

What if i wanted a special connection specified as myDB that was consistant
through out my site? Or what if my table creation function has over 30
different options setable (colours, fonts, spacing by cells, columns, rows
and table)? This becomes difficult with pure functions as you end up with


echo
create_table($data,"nowrap","black",null,"white",null,null,null,"Tahoma",12,
null,null,null,array(array("bold")));

instead of

$t = new Table;
$t->options = "nowrap";
$t->heading["bgcolor"] = "black";
$t->heading["fontcolor"] = "white";
$t->global["font"] = "tahoma";
$t->global["fontsize"] = 12;
$t->column["total"]["format"] = "bold";

echo $t->create($db->data);

// Create another table with similiar properties, but different data
echo $t->create($mydb->data);



What if wanted to make my table definition reusable (you would have to make
sure all these class's are included like your functions)


class myTable extends Table {
  var $options = "nowrap";
  var $heading["bgcolor"] = "black";
  var $heading["fontcolor"] = "white";
  var $global["font"] = "tahoma";
  var $global["fontsize"] = 12;
  var $column["total"]["format"] = "bold";
}


Then from then on you could just call 


$t = new myTable;
echo $t->create($db->data);

Now if change my definition of what a myTable should look like i change it
once, not in everyfile as you might with functions. (You could however
define a new function called create_myTable that does something similiar).

The last benefit is that with phpdoc and similiar tools class's can be
autodocumented which is very nice.

Readability, maintainability and reusability are much higher with OOP. 



Mark Nold
[EMAIL PROTECTED]  
Senior Consultant
 
Change is inevitable, except from vending machines. 



-Original Message-
From: Jeff Warrington [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 14, 2001 4:42 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] OOP in web development


In article <[EMAIL PROTECTED]>, "Joe
Sheble (Wizaerd)" <[EMAIL PROTECTED]> wrote:

depending on the nature of what you are doing, one of the things
that i like about using classes is the ability to group functionality
under a larger structure, the class.  Instead of having a series of
disconnected functions, i can instead write them as class methods.

another feature that is a basic feature of oop stuff is the idea of
inheritence. So you can have a base class (CAR) that defines
behaviour common to all instanaces of that class (var wheels, var door,
method car start, method car turn signal on, etc...) Then you can
subclass the CAR class to define specific behaviour for a particular
car model (SPORTSCAR - var turbo, method car turbo on, etc..).

again, depending on what you are doing, this can be very beneficial.
I suggest you start small and also take a look at other people's code.
You will find alot of classes out there that make alot of sense and 
can give you ideas of new ways of doing things

Jeff


> I've been using PHP for over a year now and have been successfully
> running  three different websites developed with PHP, but I've never
> done anything  with classes or objects.  Even when returning data from a
> mySQL database, I  use mysql_fetch_array() instead of
> mysql_fetch_object().
> 
> What am I missing by not using objects and classes, other than 
> reusability?  What are the real benefits to using OOPs in PHP?
> 
>

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

2001-02-14 Thread Bogdan Morar

Search in:
XML-RPC Home Page : http://www.xmlrpc.com/
or
http://www.xmlhack.com/list.php?cat=25

Bogdan Morar
www.bogmor.com

Christopher Cheng wrote:
> 
> Is there any development of SOAP extension to PHP?
> 
> --
> 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] RE: OOP in web development

2001-02-14 Thread Tim Ward

oop should be used when you want to create things to manipulate in your
program that are of a consistent structure. A simple example I use is for
company contact details and addresses. By creating a contact class I can do
...

include("path/contact.pc");
$thiscontact = new contact("company_code");
// and then
$thiscontact->display();
$thiscontact->save();
$thiscontact->delete();
// etc.

the class methods take care of all the mysql data gathering so you don't
have to worry about it after you've written the class. If your data
structure changes (or even the name of the database or server) just change
the class definition.

What I wouldn't use classes for is collecting variables together (use
associative arrays).

Tim Ward
Senior Systems Engineer

Please refer to the following disclaimer in respect of this message:
http://www.stivesdirect.com/e-mail-disclaimer.html


> -Original Message-
> From: Joe Sheble (Wizaerd) [mailto:[EMAIL PROTECTED]]
> Sent: 13 February 2001 16:42
> To: [EMAIL PROTECTED]
> Subject: OOP in web development
> 
> 
> I've been using PHP for over a year now and have been 
> successfully running 
> three different websites developed with PHP, but I've never 
> done anything 
> with classes or objects.  Even when returning data from a 
> mySQL database, I 
> use mysql_fetch_array() instead of mysql_fetch_object().
> 
> What am I missing by not using objects and classes, other than 
> reusability?  What are the real benefits to using OOPs in PHP?
> 
> 

-- 
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] Image in a Template

2001-02-14 Thread Ankur Verma

keep the images in a folder on the file system and link the filename of the
picture to the product tuple in the dataabse.

I would suggest you use the product ID as the filename for the picture in
the folder. that shoudl amke it easier for you to administer.

best regards

Ankur Verma
HCL Technologies
A1CD, Sec -16
Noida, UP
India

- Original Message -
From: "Gary" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, February 14, 2001 1:55 AM
Subject: [PHP] Image in a Template


> Hi All,
>   I am writing a catalog and shopping cart. Our clients want a image on
> the page for the product. The page is a template generated on the fly. I
> could put the images in the db and call it from there, but I don't like
> doing that. Is there another  way to put the pic on the page?
>
> TIA
> Gary
>
>
> --
> 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 / NEWS

2001-02-14 Thread Thies C. Arntzen

thies   Wed Feb 14 00:16:05 2001 EDT

  Modified files:  
/php4   NEWS 
  Log:
  
  
  
Index: php4/NEWS
diff -u php4/NEWS:1.589 php4/NEWS:1.590
--- php4/NEWS:1.589 Tue Feb 13 18:09:12 2001
+++ php4/NEWS   Wed Feb 14 00:16:03 2001
@@ -4,13 +4,10 @@
 ?? ??? 200?, Version 4.0.5
 - PostgreSQL now does a rollback at the end of a request on every
   persistent connection. This is done by doing an "empty" transaction
-  on the connection (This was advised by someone from the PostgreSQL
-  core-team). If you leave transactions open on your page you will see a
-  "NOTICE:  BEGIN: already a transaction in progress" message in your
-  apache error_log. This message is created by the PostgreSQL libs - we can
-  do nothing about it. (Thies)
-- fixes PostgeSQL pg_connect() bug. We would sometimes close the default
-  link by acciedent. (Patch by: [EMAIL PROTECTED])
+  on the connection. This was advised by someone from the PostgreSQL
+  core-team. (Thies)
+- Fixed PostgeSQL pg_connect() bug. We would sometimes close the default
+  link by accident. (Patch by: [EMAIL PROTECTED])
 - Improved OCI8 dead-session detection. (Patch by: George Schlossnagle)
 - Fixed get_meta_tags() multiline bug #4556 (Sean)
 - Prefer random() over *rand48() (JimJag)



-- 
PHP CVS 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] ereg_replace

2001-02-14 Thread Robin Vickery

> ""VB" == "Brian V Bonini" <[EMAIL PROTECTED]> writes:

 > I know you can replace A or B or C with D but can you replace A
 > with B and C with D exclusively with one call to ereg_replace or
 > does this need to be done seperately?

With ereg_replace it must be done seperately, but if you use
preg_replace you can pass it a list of replacements. like this:

\n";

$string = preg_replace( 
array( '/my/', '/string/'), 
array( 'your', 'bit of text' ), 
$string 
  );

print $string . "\n";
?>

The output would be:

   this is my string.
   this is your bit of text.


-- 
Robin Vickery.
BlueCarrots, 14th Floor, 20 Eastbourne Terrace, London, W2 6LE

-- 
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] OOP in web development

2001-02-14 Thread Phil Driscoll

I don't want to start an OOP flame thread here, so I'll shut up after this
posting - it's just that nobody is speaking up for not using OOP :)

The point needs to be made that code reuse, readability and maintainability
do not come from whether or not you choose to use OOP techniques. They come
from a combination of careful thought, planning, skill and experience.

In almost all cases, whatever you write will be executed by a microprocessor
that knows nothing of OOP, but just plods through a sequence of
instructions, occasionally shooting off to execute a subroutine or two. What
this shows is that whatever fine OOP constructs you devise they can be
represented in the plain old procedural world.

I'm pretty sure that most of the OOP tricks PHP does are done by pretending
that things are objects but really they are arrays, and as you might expect,
the procedural way to implement the same functionality is to use arrays!

Mark's example comparing:

create_table($data,"nowrap","black",null,"white",null,null,null,"Tahoma",12,
null,null,null,array(array("bold")));

with:

$t = new Table;
$t->options = "nowrap";
$t->heading["bgcolor"] = "black";
$t->heading["fontcolor"] = "white";
$t->global["font"] = "tahoma";
$t->global["fontsize"] = 12;
$t->column["total"]["format"] = "bold";

could more fairly have used something like:

$t=create_table();
$t['options'] = "nowrap";
$t['heading']['bgcolor']= "black";

etc.

As you can see, there is hardly any difference at all.

My point is really that you can use whatever technique you want, but you can
get your code reuse, readability and maintainability from either. As you
might have guessed, I favour procedural as I feel that more of the code is
visible and in my control.

YMMV
--
Phil Driscoll
Dial Solutions
+44 (0)113 294 5112
http://www.dialsolutions.com
http://www.dtonline.org




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

2001-02-14 Thread Sascha Schumann

sas Wed Feb 14 02:12:30 2001 EDT

  Modified files:  
/php4   TODO 
  Log:
  Add note about removing the requirement that you need to include the
  respective class definition before using a session variable of the type
  object.
  
  This has been the best suggestion so far and is very likely to be adopted
  in the near future.
  
  Submitted by: Hartmut Holzgraefe
  
  
Index: php4/TODO
diff -u php4/TODO:1.115 php4/TODO:1.116
--- php4/TODO:1.115 Thu Feb  8 11:11:47 2001
+++ php4/TODO   Wed Feb 14 02:12:29 2001
@@ -94,6 +94,8 @@
   locked individually.
 * write a network-transparent storage back-end with fallover
   facilities
+* provide a callback facility which is executed upon encountering
+  an unknown classname during deserialization
 
 ext/sockets
 ---



-- 
PHP CVS 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] Oracle Web & Php

2001-02-14 Thread kaab kaoutar

Hi!
is there a possiblily to use with in an Oracle Web server ?
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] charactersets

2001-02-14 Thread Dominick Vansevenant

Hello,

I am outputting different french accents on my webpages.

They are imported in MySQL and there with a simple select I can see the
accents are
in good condition:

e.g.: Adresse lié à un atlas électronique

But when I use PHP to process the label into for example a select box with
option fields,
I get something like this:

e.g.: Adresse li‚ … un
atlas ‚lectronique

I suppose I should change something in MySQl or in the PHP settings, can
anyone point me to the setting?

Thanks in advance,

Dominick



-- 
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: could anyone please help me with this date coding?

2001-02-14 Thread Tim Ward


> -Original Message-
> From: Charles Mulford [mailto:[EMAIL PROTECTED]]
> Sent: 13 February 2001 22:56
> To: PHP User Group
> Subject: could anyone please help me with this date coding?
> 
> 
> Hi all!  could anybody help me? I am fairly new to PHP and I 
> inherited these
> scripts from someone who doesn't work with me anymore. They 
> seem to puke on
> this portion while running them on win2k, latest php4 and 
> mysql. On Linux
> platform they work as they are supposed to.
> thanks in advance!
> 
> Charles Mulford
> 
> -
> 
> $max_date = 90;
> $ini_date = 0;
> echo("\t \n");
>  do {
>  $dis_date = date("D\. M\. d\, Y", strtotime ("+$ini_date day"));
>  $val_date = date("Y-m-d", strtotime ("+$ini_date day"));
>  echo("\t[$ini_date]

this looks wrong, in effect you're outputting  value = "'2001-02-14'"
try just ...
  echo("\t[$ini_date]

> $dis_date\n");
> }
> while (++$ini_date <= $max_date);
> 
> -
> 

Tim Ward
Senior Systems Engineer

Please refer to the following disclaimer in respect of this message:
http://www.stivesdirect.com/e-mail-disclaimer.html

-- 
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/standard basic_functions.c dir.c php_dir.h

2001-02-14 Thread Derick Rethans

derick  Wed Feb 14 02:48:49 2001 EDT

  Modified files:  
/php4/ext/standard  basic_functions.c dir.c php_dir.h 
  Log:
  - Added the chroot function for changing root in a script.
  #- This can be usefull when using PHP in a shell environment, or when PHP
  #  runs as CGI which needs a little more security
  
  
Index: php4/ext/standard/basic_functions.c
diff -u php4/ext/standard/basic_functions.c:1.302 
php4/ext/standard/basic_functions.c:1.303
--- php4/ext/standard/basic_functions.c:1.302   Mon Feb  5 13:59:16 2001
+++ php4/ext/standard/basic_functions.c Wed Feb 14 02:48:48 2001
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: basic_functions.c,v 1.302 2001/02/05 21:59:16 zeev Exp $ */
+/* $Id: basic_functions.c,v 1.303 2001/02/14 10:48:48 derick Exp $ */
 
 #include "php.h"
 #include "php_main.h"
@@ -465,6 +465,7 @@
PHP_FE(opendir, NULL)
PHP_FE(closedir,NULL)
PHP_FE(chdir,   NULL)
+   PHP_FE(chroot,  NULL)
PHP_FE(getcwd,  NULL)
PHP_FE(rewinddir,   NULL)
PHP_STATIC_FE("readdir", php_if_readdir, NULL)
Index: php4/ext/standard/dir.c
diff -u php4/ext/standard/dir.c:1.52 php4/ext/standard/dir.c:1.53
--- php4/ext/standard/dir.c:1.52Sat Dec 16 12:52:43 2000
+++ php4/ext/standard/dir.c Wed Feb 14 02:48:48 2001
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: dir.c,v 1.52 2000/12/16 20:52:43 andi Exp $ */
+/* $Id: dir.c,v 1.53 2001/02/14 10:48:48 derick Exp $ */
 
 /* {{{ includes/startup/misc */
 
@@ -219,6 +219,30 @@
if (dirp->id == DIRG(default_dir)) {
php_set_default_dir(-1 DIRLS_CC);
}
+}
+
+/* }}} */
+/* {{{ proto int chroot(string directory)
+   Change root directory */
+
+PHP_FUNCTION(chroot)
+{
+   pval **arg;
+   int ret;
+   
+   if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg) == FAILURE) {
+   WRONG_PARAM_COUNT;
+   }
+   convert_to_string_ex(arg);
+
+   ret = chroot((*arg)->value.str.val);
+   
+   if (ret != 0) {
+   php_error(E_WARNING, "chroot: %s (errno %d)", strerror(errno), errno);
+   RETURN_FALSE;
+   }
+
+   RETURN_TRUE;
 }
 
 /* }}} */
Index: php4/ext/standard/php_dir.h
diff -u php4/ext/standard/php_dir.h:1.11 php4/ext/standard/php_dir.h:1.12
--- php4/ext/standard/php_dir.h:1.11Thu Dec  7 04:09:38 2000
+++ php4/ext/standard/php_dir.h Wed Feb 14 02:48:48 2001
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: php_dir.h,v 1.11 2000/12/07 12:09:38 sas Exp $ */
+/* $Id: php_dir.h,v 1.12 2001/02/14 10:48:48 derick Exp $ */
 
 #ifndef PHP_DIR_H
 #define PHP_DIR_H
@@ -28,6 +28,7 @@
 PHP_FUNCTION(opendir);
 PHP_FUNCTION(closedir);
 PHP_FUNCTION(chdir);
+PHP_FUNCTION(chroot);
 PHP_FUNCTION(getcwd);
 PHP_FUNCTION(rewinddir);
 PHP_NAMED_FUNCTION(php_if_readdir);



-- 
PHP CVS 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/standard dir.c

2001-02-14 Thread Derick Rethans

derick  Wed Feb 14 03:02:55 2001 EDT

  Modified files:  
/php4/ext/standard  dir.c 
  Log:
  - Added an extra chdir("/"); as sugested by Sascha
  
  
Index: php4/ext/standard/dir.c
diff -u php4/ext/standard/dir.c:1.53 php4/ext/standard/dir.c:1.54
--- php4/ext/standard/dir.c:1.53Wed Feb 14 02:48:48 2001
+++ php4/ext/standard/dir.c Wed Feb 14 03:02:54 2001
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: dir.c,v 1.53 2001/02/14 10:48:48 derick Exp $ */
+/* $Id: dir.c,v 1.54 2001/02/14 11:02:54 derick Exp $ */
 
 /* {{{ includes/startup/misc */
 
@@ -239,6 +239,13 @@

if (ret != 0) {
php_error(E_WARNING, "chroot: %s (errno %d)", strerror(errno), errno);
+   RETURN_FALSE;
+   }
+
+   ret = chdir("/");
+   
+   if (ret != 0) {
+   php_error(E_WARNING, "chdir: %s (errno %d)", strerror(errno), errno);
RETURN_FALSE;
}
 



-- 
PHP CVS 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] apache & php

2001-02-14 Thread ited

help!

i want to get started!

how do configure Apache to work with PHP?

apparently it is not because my browser will not "find" the test files.php.

please help me to test it.

i am using Mac OS X (pb) so i should follow any Unix procedure ok, i think.

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]




[PHP] download prompt not woking on macintosh

2001-02-14 Thread Sebastian Stadtlich

Hi all

I tried to build a script that displays the 'save-file dialog', because the
files that should be downloaded
are huge 32bit jpeg for printing. the problem is that it works in IE on PC,
Netscape on PC and MAC, but
not in IE on a MAC. the files are jpeg, IE on Mac either tried to open the
files ( which does not work, 
because they are CYMK), or displayes the filename 'download.php' in the save
dialog 
PLEASE HELP our designers can't be the only persons to use Mac on the
world...
i tried everycombination of the following headers, but without success...

thanks 
sebastian

code :

/*
header("Content-Type: application/octet-stream");
header("Content-Disposition: inline;
filename=\"".basename($download)."\"");
set_time_limit(0);
readfile($download) or die ("File nicht gefunden oder sonstiger
Fehler aufgetreten.");
*/

  header("Content-Type: application/download\n");
  header("Content-Disposition: inline; filename=\"$download\"");
  set_time_limit(0);
  readfile($download);
/*

  header("Content-Type: application/download\n");
  header("Content-Disposition: attachment; filename=\"$download\"");
  $fn=fopen("$download" , "r");
  fpassthru($fn);
*/
 /*
   header("Content-Type: doesn/matter\r\n");
   header("Content-Disposition: filename=$download\r\n\r\n");
   header("Content-Transfer-Encoding: binary\r\n");
   readfile($download) or die ("File nicht gefunden oder sonstiger
Fehler   aufgetreten.");
 */
 /*
   header("Content-Type: doesn/matter\r\n");
   header("Content-Disposition: filename=$download");
   header("Content-Transfer-Encoding: binary\r\n");
   header("Content-Length: ".filesize($download));
   readfile($download);
 */

-- 
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: functable / dslgen

2001-02-14 Thread Hartmut Holzgraefe

hholzgraWed Feb 14 03:09:06 2001 EDT

  Modified files:  
/functable  dslgen 
  Log:
  add a hint about where version.dsl comes from
  
  
Index: functable/dslgen
diff -u functable/dslgen:1.1.1.1 functable/dslgen:1.2
--- functable/dslgen:1.1.1.1Tue Oct 10 10:34:32 2000
+++ functable/dslgenWed Feb 14 03:09:06 2001
@@ -41,9 +41,16 @@
 mysql_free_result($result);
 
 
-echo ";; DO NOT EDIT THIS FILE !!!\n";
-echo ";; as it is auto-generated from the same database\n";
-echo ";; as the functiontable at http://www.zend.com/phpfunc\n";
+echo ";; DO NOT EDIT THIS FILE !!!"
+echo ";; as it is auto-generated from the same database"
+echo ";; as the functiontable at "
+echo ";; http://www.zugeschaut-und-mitgebaut.de/php"
+echo ";; you can generate it yourself by unsing the code"
+echo ";; to be found under the functable repository in CVS"
+echo ";;"
+echo ";; if you think this is out of date :"
+echo ";; mailto:[EMAIL PROTECTED]"
+echo ";;"
 echo "(define (index-char-val ch)
   (case ch
 ((#\\A #\\a) 65)



-- 
PHP CVS 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 / NEWS

2001-02-14 Thread Derick Rethans

derick  Wed Feb 14 03:27:29 2001 EDT

  Modified files:  
/php4   NEWS 
  Log:
  - Added the notification of the chroot function addition
  #- I forgot this with the initial commit
  
  
Index: php4/NEWS
diff -u php4/NEWS:1.590 php4/NEWS:1.591
--- php4/NEWS:1.590 Wed Feb 14 00:16:03 2001
+++ php4/NEWS   Wed Feb 14 03:27:28 2001
@@ -2,6 +2,7 @@
 |||
 
 ?? ??? 200?, Version 4.0.5
+- Added the chroot() function (Derick)
 - PostgreSQL now does a rollback at the end of a request on every
   persistent connection. This is done by doing an "empty" transaction
   on the connection. This was advised by someone from the PostgreSQL



-- 
PHP CVS 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] pro's and con's of storing images

2001-02-14 Thread Adrian Murphy

I'm putting togeather a simple website buider app.
i'm allowing users to upload images.I'm wondering whether i should store
those images in a database or create dirs for each user.the mysql db has a
relatively small capacity but storing them to the db might make it simpler
for me.
also ftp functions don't work on the server and my damn isp keeps fobbing me
off when i ask him to do anything.


-- 
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: functable / dslgen

2001-02-14 Thread Hartmut Holzgraefe

hholzgraWed Feb 14 03:32:30 2001 EDT

  Modified files:  
/functable  dslgen 
  Log:
  stupidity fix
  
  
Index: functable/dslgen
diff -u functable/dslgen:1.2 functable/dslgen:1.3
--- functable/dslgen:1.2Wed Feb 14 03:09:06 2001
+++ functable/dslgenWed Feb 14 03:32:30 2001
@@ -41,16 +41,16 @@
 mysql_free_result($result);
 
 
-echo ";; DO NOT EDIT THIS FILE !!!"
-echo ";; as it is auto-generated from the same database"
-echo ";; as the functiontable at "
-echo ";; http://www.zugeschaut-und-mitgebaut.de/php"
-echo ";; you can generate it yourself by unsing the code"
-echo ";; to be found under the functable repository in CVS"
-echo ";;"
-echo ";; if you think this is out of date :"
-echo ";; mailto:[EMAIL PROTECTED]"
-echo ";;"
+echo ";; DO NOT EDIT THIS FILE !!!";
+echo ";; as it is auto-generated from the same database";
+echo ";; as the functiontable at ";
+echo ";; http://www.zugeschaut-und-mitgebaut.de/php";
+echo ";; you can generate it yourself by unsing the code";
+echo ";; to be found under the functable repository in CVS";
+echo ";;";
+echo ";; if you think this is out of date :";
+echo ";; mailto:[EMAIL PROTECTED]";
+echo ";;";
 echo "(define (index-char-val ch)
   (case ch
 ((#\\A #\\a) 65)



-- 
PHP CVS 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] re:linebreak

2001-02-14 Thread Jens Nedal

Hy there everyone on the board 8), just a new listviewer droppign in.

In case of displaying \n that are stored in a variable or com from a DB or
inptu field you can also use nl2br($var) which automatically converts those
linebreaks to  and so get displayed correctly. Though that will not work
for the tabs.

Jens



Ostry & Partner http://www.ostry.com
Hietzingerhauptstr. 145 1130 Vienna, Austria  +43 1 877 74 54-18




on 14.02.2001 6:41 Uhr, Steve Werby at [EMAIL PROTECTED] wrote:

> "Deependra B. Tandukar" <[EMAIL PROTECTED]> wrote:
>> I did with . "\r\n" too is not giving a new line.
> 
> Actually "\n" does create a newline.  If you view the source code of the web
> page from the browser you'll see that it works.  "\n" is not an HTML tag.
> It's not designed to create a newline in the HTML output sent to the
> browser.  As you discovered, the  tag will do that.  Hope that is clear.
> "\n" is typically used in PHP code so that when one looks at the HTML code
> sent to the browser one doesn't have to look at lines of HTML code that
> contain hundreds upon hundreds of characters.
> 
> --
> Steve Werby
> COO
> 24-7 Computer Services, LLC
> Tel: 804.817.2470
> http://www.247computing.com/
> 


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




AW: [PHP] Bad Practices

2001-02-14 Thread Sebastian Stadtlich

OR you could tell apache to parse everything that ends with .inc with php.
you can name it .inc .linux .linuxsucks .microsoftsucks

(you'll need to have access to http.conf or .htaccess+right to override ...)

sebastian

> -Ursprüngliche Nachricht-
> Von: Rick Hodger [mailto:[EMAIL PROTECTED]]
> Gesendet: Mittwoch, 14. Februar 2001 09:51
> An: [EMAIL PROTECTED]
> Betreff: Re: [PHP] Bad Practices
> 
> 
> 
> "Jeff Oien" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Would people like to list bad practices and also point us
> > newbies to any articles online dealing with syntax, correct
> > use of single and double quotes etc.?
> 
> People who create scripts that include a need for access to a 
> SQL database,
> meaning you need to give it a username and password then 
> making the damn
> configuration file be called something stupid like config.inc.
> 
> When you are scripting, using anything with a .inc extension 
> is just asking
> for trouble. If someone requests that file, it'll get passed 
> straight to
> them. It's a .inc, which means that PHP does not know to 
> parse it. Which
> means, that person can see your usernames and passwords. And 
> because it's a
> public package, they're far more likely to know the path to said file.
> 
> --
> Rick Hodger
> 
> 
> 
> -- 
> 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] Bad Practices

2001-02-14 Thread Yasuo Ohgaki
> "Jeff Oien" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Would people like to list bad practices and also point us
> > newbies to any articles online dealing with syntax, correct
> > use of single and double quotes etc.?
>
> People who create scripts that include a need for access to a SQL
database,
> meaning you need to give it a username and password then making the damn
> configuration file be called something stupid like config.inc.

I think putting PHP configuration files under web document directory is not
recommended.For most PHP files, that user never have to see, are better to
place outside of web docuemnt directory.

However, I prefer to separate PHP code and HTML as much as possible. So I
put some files that has non-standard extentions under web document
direcutory.

You can setup Apache to deny any request for *.inc file, or whatever
extention, just like .htaccess. If you want to put *.inc, or whatever, I
strongly recommend to deny all the request to those files.

> When you are scripting, using anything with a .inc extension is just
asking
> for trouble. If someone requests that file, it'll get passed straight to
> them. It's a .inc, which means that PHP does not know to parse it. Which
> means, that person can see your usernames and passwords. And because it's
a
> public package, they're far more likely to know the path to said file.

--
Yasuo Ohgaki

-- 
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] mysql_error() not really helping

2001-02-14 Thread Christian Dechery

>Christian -
>
>You need to be checking the return values of the mysql_*() functions. Make
>sure you're not calling them with a @mysql_*() as that will disable error
>reporting.
>
>Perhaps you should give us some examples of what's failing and how?
>
>Also, if the server isn't yours the server admin may have turnd down the
>level of error reporting in php so errors never even show up. See
>http://www.php.net/manual/en/configuration.php and look at display_errors
>and
>error_reporting then check your server settings with phpinfo().

the server is local, I'm running it (apache 1.3.12)...
I set the error_reporting to the default in php.ini, I even set error_reporting(E_ALL),
but all I got were warnings about every thing PHP did, nothing MySQL related...
but nevermind, I've already fixed me a function that I call EVERY query
I run (altough I find this very annoying) that tells me when there's a sql
syntax error...

thanks



. [ Christian Dechery  ]
. Webdeveloper @ Tá Na Mesa!
. Listmaster @ Gaita-L
. http://www.tanamesa.com.br



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

2001-02-14 Thread Matt DeLong

Also try:
http://www.textpad.com/



Thanks,

Matt DeLong
Studio 77

eBusiness & Wireless Solutions Provider
615.793.2947
www.studio77.com


- Original Message -
From: Brandon Orther <[EMAIL PROTECTED]>
To: PHP User Group <[EMAIL PROTECTED]>
Sent: Thursday, January 18, 2001 11:28 AM
Subject: RE: [PHP] PHP Editors


> I am not sure what OS you are running but for windows I use PHPED. Check
it
> out at www.phped.com
>
> -Original Message-
> From: Karl J. Stubsjoen [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, January 18, 2001 7:03 AM
> To: PHP Mailing List
> Subject: [PHP] PHP Editors
>
>
> So what editor is recommended?  I'm a little familiar with Emacs (kinda
> cool, but I'm use to keywords and such being colored - as in Interdev).
>
> 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 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/oci8 oci8.c

2001-02-14 Thread Thies C. Arntzen

thies   Wed Feb 14 05:06:04 2001 EDT

  Modified files:  
/php4/ext/oci8  oci8.c 
  Log:
  ocifreedesc() now spits a NOTICE when called the "wrong" way.
  
  
Index: php4/ext/oci8/oci8.c
diff -u php4/ext/oci8/oci8.c:1.106 php4/ext/oci8/oci8.c:1.107
--- php4/ext/oci8/oci8.c:1.106  Mon Feb 12 06:36:28 2001
+++ php4/ext/oci8/oci8.cWed Feb 14 05:06:03 2001
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: oci8.c,v 1.106 2001/02/12 14:36:28 thies Exp $ */
+/* $Id: oci8.c,v 1.107 2001/02/14 13:06:03 thies Exp $ */
 
 /* TODO list:
  *
@@ -489,7 +489,7 @@
 
php_info_print_table_start();
php_info_print_table_row(2, "OCI8 Support", "enabled");
-   php_info_print_table_row(2, "Revision", "$Revision: 1.106 $");
+   php_info_print_table_row(2, "Revision", "$Revision: 1.107 $");
 #ifndef PHP_WIN32
php_info_print_table_row(2, "Oracle Version", PHP_OCI8_VERSION );
php_info_print_table_row(2, "Compile-time ORACLE_HOME", PHP_OCI8_DIR );
@@ -2610,7 +2610,9 @@
}
}
 
-  RETURN_FALSE;
+   php_error(E_NOTICE, "OCIFreeDesc() should not be called like this. Use 
+$somelob->free() to free a LOB");
+
+   RETURN_FALSE;
 }
 /* }}} */
 



-- 
PHP CVS 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] Installation on win32

2001-02-14 Thread Matt Williams

You will also need to add this for the module

LoadModule php4_module "c:/php/sapi/php4apache.dll"


M@
> -Original Message-
> From: Maxim Maletsky [mailto:[EMAIL PROTECTED]]
> Sent: 14 February 2001 08:02
> To: 'Sean Kennedy'; PHP Mailing List
> Subject: RE: [PHP] Installation on win32
>
>
> add this into your httpd.conf file:
>
> ## PHP 4.0.3pl1 
> AddType application/x-httpd-php .php .phtml .php3 .html .inc
> AddType application/x-httpd-php-source .phps
> 
>
> Cheers,
> Maxim Maletsky
>
>
>
> -Original Message-
> From: Sean Kennedy [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, February 14, 2001 4:32 PM
> To: PHP Mailing List
> Subject: [PHP] Installation on win32
>
>
> Ok, I am trying to install php4 on a win32 system as a module for
> apache.  I
> have followed all the instructions for both apache and php.  Now, when I
> load up a page, it is blank, and when I view the source, I see my
> php file.
> For example...
>
>  /*index.php*/
> echo ('Hello');
> ?>
>
> Now, when I load this in my browser, I see this as the source, but nothing
> displays on the page.  Anybody recognize this?  Can anybody point
> me in the
> right direction?
>
> Thank you in advance.
>
> Sean Kennedy
>
>
> --
> 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 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] ereg_replace

2001-02-14 Thread Brian V Bonini

That's exactly what I want to do Thanks!

> -Original Message-
> From: Robin Vickery [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, February 14, 2001 5:05 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] ereg_replace
> 
> 
> > ""VB" == "Brian V Bonini" <[EMAIL PROTECTED]> writes:
> 
>  > I know you can replace A or B or C with D but can you replace A
>  > with B and C with D exclusively with one call to ereg_replace or
>  > does this need to be done seperately?
> 
> With ereg_replace it must be done seperately, but if you use
> preg_replace you can pass it a list of replacements. like this:
> 
>  $string = "this is my string.";
> 
> print $string . "\n";
> 
> $string = preg_replace( 
> array( '/my/', '/string/'), 
> array( 'your', 'bit of text' ), 
> $string 
>   );
> 
> print $string . "\n";
> ?>
> 
> The output would be:
> 
>this is my string.
>this is your bit of text.
> 
> 
> -- 
> Robin Vickery.
> BlueCarrots, 14th Floor, 20 Eastbourne Terrace, London, W2 6LE
> 
> -- 
> 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] Uploading files on Win98 SE

2001-02-14 Thread Ulrich Hacke

Hello,
I try to code a script where users can upload files to the server. Whenever
I hit the submit button PHP crashes. I run PHP 3.0.17, Apache 1.3 on a Win98
SE machine. My code looks like this:






Is this a known problem in the Win32 distribution or has anyone some hints?

Best regards,
Uli


-- 
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] AW: Apache not starting after adding php via mod_so.

2001-02-14 Thread Sieger, Roland

Hi gurus, 

this is a somewhat update of the previous mail, never received an answer
to the original post. And it might be, that this list is the wrong
audience for my real problem. 

The problem still exists, that apache httpd 1.3.14 is not starting, if
the "php" related things are in httpd.conf at start time. 
However: if i comment the 2 lines, added by make install from php, in
httpd.conf , start the server with apachectl start, uncomment those 2
lines and send kill -1 to the first httpd process, everything (even with
oci8) works ok. 

Anybody seen this , please advise.  

Mit freundlichen Grüßen 

G.Roland Sieger, CIT 

Email  : [EMAIL PROTECTED]
Phone : (49) 89 5110 413 
Fax : (49) 89 5110 532

Postanschrift : 
Süd-Chemie AG 

Lenbachplatz 6 

80333 München 

>  -Ursprüngliche Nachricht-
> Von:  Sieger, Roland  
> Gesendet: Montag, 12. Februar 2001 21:03
> An:   [EMAIL PROTECTED]
> Betreff:  Apache not starting after adding php via mod_so.
> 
> hello gurus, 
> 
> this is the first time, trying to solve a problem with this list. I
> checked some of the archives, may be not all. So if that has been an
> already asked question, please forgive. I also do not know anything
> about the common "behaviour" on this list. 
> 
> But anyway : here is the problem: 
> 
> compiled apache (1.3.14) on a SuSe Linux - Box ..  starts and works
> with plain setup. 
> installed Oracle 8 client. installed php4.0.4.pl1, tested the thing
> with plain php.  Get the correct results off the oracle DataBase.  
> 
> With httdp.conf 2 lines are added from the php make/make install : 
> 
> LoadModule php_module libexec/libphp4.so
> 
> and 
> 
> AddModule mod_php4.c 
> 
> the httpd server is not coming up does not give any log files. So i
> assume httpd is dieing before he can get anywhere. 
> 
> any clues , every help appreciated. 
> 
> 
> Mit freundlichen Grüßen 
> 
> G.Roland Sieger, CIT 
> 
> Email  : [EMAIL PROTECTED]
> Phone : (49) 89 5110 413 
> Fax : (49) 89 5110 532
> 
> Postanschrift : 
> Süd-Chemie AG 
> 
> Lenbachplatz 6 
> 
> 80333 München 
> 

--
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] adding lib files...

2001-02-14 Thread Julia A . Case

If I have a lib.so file can I just link it in with php and have access to the 
functionality in lib.so?  If not can someone show me the way to adding things to 
php?

Julia 
(sorry if this is a stupid question)

-- 
[  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] PHP globals aren't really globals

2001-02-14 Thread Christian Dechery

I've been programming in C all my life, and now I just started developing
in PHP and I'm really enjoying it, it has all the missing improvements that
C needed to be more user-likely.

But one thin I can't get, how can PHP call a variabel global, if it isn't
global.
A global var, is a var defined outside all functions and it's available
to all and altered by all, without having to redefine or call the var again.

In PHP, for a var to be global you have to add a 'global $var' inside the
function u want to use it. THis is not nice, what about if u have a form
with 50 fields and want a function to validate all of them, u have to pass
them all to the function or build a little piece of code to make all th
$GLOBALS local right?

Is this really the idea of global vars?


. [ Christian Dechery  ]
. Webdeveloper @ Tá Na Mesa!
. Listmaster @ Gaita-L
. http://www.tanamesa.com.br



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

2001-02-14 Thread Kevin Connolly

Does anyone know anything about using PGP with PHP pages? 
Any tutorials or examples would be much appreciated!!
Thanks,
Kev



Re: [PHP] PHP globals aren't really globals

2001-02-14 Thread Thierry Coopman

At 11:24 AM -0300 2/14/01, Christian Dechery wrote:
>I've been programming in C all my life, and now I just started developing
>in PHP and I'm really enjoying it, it has all the missing improvements that
>C needed to be more user-likely.
>
>But one thin I can't get, how can PHP call a variabel global, if it isn't
>global.
>A global var, is a var defined outside all functions and it's available
>to all and altered by all, without having to redefine or call the var again.
>
>In PHP, for a var to be global you have to add a 'global $var' inside the
>function u want to use it. THis is not nice, what about if u have a form
>with 50 fields and want a function to validate all of them, u have to pass
>them all to the function or build a little piece of code to make all th
>$GLOBALS local right?
>
>Is this really the idea of global vars?
>

Well having a form with LOTS of fields, it might be advisable to have 
the fields send an array straigt away

have the name of your fields something like <.. name="feedback[name]" 
..> and just use global $feedback and the whole array is at your 
disposition.

This doens't change the way global is treated in PHP but might help 
you in your setup. having these in an array will also greatly make 
sessions easier, if you have to follow all these fields on multiple 
pages.

-- 
Thierry Coopman - [EMAIL PROTECTED]
My opinions are personal, and have really nothing or nothing to do 
with Keytrade!

He who laughs last probably made a back-up.

-- 
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] fsockopen timeout not working

2001-02-14 Thread Plamen Slavov

Hi all,
Does someone know why fsockopen timeout does not work?
php3 
$mydata=fsockopen($machine,$port,&$errno,&$errstr,30);

I think that this function should fail after 30
seconds, but it just blocks the script.

__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.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] PHP globals aren't really globals

2001-02-14 Thread Boget, Chris

> function u want to use it. THis is not nice, what about if u 
> have a form with 50 fields and want a function to validate 
> all of them, u have to pass them all to the function or build 
> a little piece of code to make all the $GLOBALS local right?
> Is this really the idea of global vars?

Yes.  But with regards to form variables, all you need to do is
make one variable global:

$HTTP_POST_VARS

it is an associative array that contains all the post variables from 
the form.  Make it global and just loop through it.

Chris



[PHP-CVS] cvs: php4 /ext/mnogosearch config.m4 php_mnogo.c

2001-02-14 Thread Sergey Kartashoff

gluke   Wed Feb 14 06:27:46 2001 EDT

  Modified files:  
/php4/ext/mnogosearch   config.m4 php_mnogo.c 
  Log:
  Added mnogosearch version checking into config.m4.
  Some proto fixes.
  
  
Index: php4/ext/mnogosearch/config.m4
diff -u php4/ext/mnogosearch/config.m4:1.3 php4/ext/mnogosearch/config.m4:1.4
--- php4/ext/mnogosearch/config.m4:1.3  Mon Feb  5 06:00:35 2001
+++ php4/ext/mnogosearch/config.m4  Wed Feb 14 06:27:45 2001
@@ -1,5 +1,5 @@
 dnl $Source: /local/repository/php4/ext/mnogosearch/config.m4,v $
-dnl $Id: config.m4,v 1.3 2001/02/05 14:00:35 gluke Exp $
+dnl $Id: config.m4,v 1.4 2001/02/14 14:27:45 gluke Exp $
 
 PHP_ARG_WITH(mnogosearch,for mnoGoSearch support,
 [  --with-mnogosearch[=DIR]   Include mnoGoSearch support.  DIR is the 
mnoGoSearch base
@@ -17,13 +17,35 @@
   MNOGOSEARCH_LIBDIR=$PHP_MNOGOSEARCH/lib
 fi
 
-AC_ADD_INCLUDE($MNOGOSEARCH_INCDIR)
+AC_MSG_CHECKING(for mnoGoSearch version)
 
 if test -x "$MNOGOSEARCH_BINDIR/udm-config"; then
+   MNOGOSEARCH_VERSION=`$MNOGOSEARCH_BINDIR/udm-config --version`
+   MNOGOSEARCH_VERSION_ID=`$MNOGOSEARCH_BINDIR/udm-config -version-id`
+
+   if test $? -ne 0; then
+   AC_MSG_RESULT(<= 3.1.9)
+   AC_MSG_ERROR(mnoGoSearch 3.1.10 at least required)
+   fi
+   
+   if test -l "$MNOGOSEARCH_VERSION_ID" -gt 6; then
+   AC_MSG_RESULT(<= 3.1.9)
+   AC_MSG_ERROR(mnoGoSearch 3.1.10 at least required)
+   fi
+   
+   if test "$MNOGOSEARCH_VERSION_ID" -lt 30110; then
+   AC_MSG_RESULT(<= 3.1.9)
+   AC_MSG_ERROR(mnoGoSearch 3.1.10 at least required)
+   fi
+   
+   AC_MSG_RESULT($MNOGOSEARCH_VERSION)
+   
PHP_EVAL_LIBLINE(`$MNOGOSEARCH_BINDIR/udm-config --libs`, 
MNOGOSEARCH_SHARED_LIBADD)
 else
-   AC_ADD_LIBRARY_WITH_PATH(udmsearch, $MNOGOSEARCH_LIBDIR, 
MNOGOSEARCH_SHARED_LIBADD)
+   AC_MSG_ERROR(udm-config script not found in $MNOGOSEARCH_BINDIR)
 fi
+
+AC_ADD_INCLUDE($MNOGOSEARCH_INCDIR)
 
 AC_DEFINE(HAVE_MNOGOSEARCH,1,[ ])
 
Index: php4/ext/mnogosearch/php_mnogo.c
diff -u php4/ext/mnogosearch/php_mnogo.c:1.13 php4/ext/mnogosearch/php_mnogo.c:1.14
--- php4/ext/mnogosearch/php_mnogo.c:1.13   Fri Feb  9 05:29:19 2001
+++ php4/ext/mnogosearch/php_mnogo.cWed Feb 14 06:27:45 2001
@@ -1,5 +1,5 @@
 /* $Source: /local/repository/php4/ext/mnogosearch/php_mnogo.c,v $ */
-/* $Id: php_mnogo.c,v 1.13 2001/02/09 13:29:19 gluke Exp $ */
+/* $Id: php_mnogo.c,v 1.14 2001/02/14 14:27:45 gluke Exp $ */
 
 /*
+--+
@@ -682,12 +682,12 @@
 /* }}} */
 
 
-/* {{{ proto int udm_errno(int agent)
-   mnoGoSearch error number */
-DLEXPORT PHP_FUNCTION(udm_errno)
+/* {{{ proto int udm_free_agent(int agent)
+   Free mnoGoSearch session */
+DLEXPORT PHP_FUNCTION(udm_free_agent)
 {
pval ** yyagent;
-   UDM_AGENT * Agent;
+   UDM_RESULT * Agent;
switch(ZEND_NUM_ARGS()){
case 1: {
if (zend_get_parameters_ex(1, &yyagent)==FAILURE) {
@@ -699,19 +699,20 @@
WRONG_PARAM_COUNT;
break;
}
-   ZEND_FETCH_RESOURCE(Agent, UDM_AGENT *, yyagent, -1, "mnoGoSearch-Agent", 
le_link);
-   RETURN_LONG(UdmDBErrorCode(Agent->db));
+   ZEND_FETCH_RESOURCE(Agent, UDM_RESULT *, yyagent, -1, "mnoGoSearch-agent", 
+le_link);
+   zend_list_delete((*yyagent)->value.lval);
+   
+   RETURN_TRUE;
 }
 /* }}} */
 
 
-/* {{{ proto string udm_error(int agent)
-   mnoGoSearch error message */
-DLEXPORT PHP_FUNCTION(udm_error)
+/* {{{ proto int udm_errno(int agent)
+   Get mnoGoSearch error number */
+DLEXPORT PHP_FUNCTION(udm_errno)
 {
pval ** yyagent;
UDM_AGENT * Agent;
-   
switch(ZEND_NUM_ARGS()){
case 1: {
if (zend_get_parameters_ex(1, &yyagent)==FAILURE) {
@@ -724,17 +725,18 @@
break;
}
ZEND_FETCH_RESOURCE(Agent, UDM_AGENT *, yyagent, -1, "mnoGoSearch-Agent", 
le_link);
-   RETURN_STRING(UdmDBErrorMsg(Agent->db),1);
+   RETURN_LONG(UdmDBErrorCode(Agent->db));
 }
 /* }}} */
 
 
-/* {{{ proto int udm_free_agent(int agent)
-   Free mnoGoSearch session */
-DLEXPORT PHP_FUNCTION(udm_free_agent)
+/* {{{ proto string udm_error(int agent)
+   Get mnoGoSearch error message */
+DLEXPORT PHP_FUNCTION(udm_error)
 {
pval ** yyagent;
-   UDM_RESULT * Agent;
+   UDM_AGENT * Agent;
+   
switch(ZEND_NUM_ARGS()){
case 1: {
if (zend_get_parameters_ex(1, &yyagent)==FAILURE) {
@@ -746,10 +748,8 @@
WRONG_PARAM_COUNT;
break;
}
-   ZEND_FETCH_RESOURCE(Agent, UDM_RESULT *, yyagent, -1, "mnoGoSearch-agent", 
le_link);

[PHP] $PHP_SELF in Netscape PART 2

2001-02-14 Thread John Vanderbeck

Ok, I made all the changes from $PHPSELF to $PHP_SELF, and i'm further along
with Netscape than before.  However, it now seems that there are still some
statements that $PHP_SELF isn't evaluated in.  However, now I can narrow it
down to certain statements:

WORKS:
   echo "Main -> $category";

DOES NOT WORK:
echo '',
$subcategories[$index], '';


- John Vanderbeck
- Admin, GameDesign



-- 
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 globals aren't really globals

2001-02-14 Thread Christian Dechery

>> function u want to use it. THis is not nice, what about if u
>> have a form with 50 fields and want a function to validate
>> all of them, u have to pass them all to the function or build
>> a little piece of code to make all the $GLOBALS local right?
>> Is this really the idea of global vars?
>
>Yes.  But with regards to form variables, all you need to do is
>make one variable global:
>
>$HTTP_POST_VARS
>
>it is an associative array that contains all the post variables from
>the form.  Make it global and just loop through it.

exactly, u need to loop to an array to get the globals u want.
this is not the idea of global, global is global... if it's set outside
of ALL functions it should be available 'with no extra code' to ALL functions,
it works that way in all programming language I'm familiar with... why not
in PHP? that's what I wanna know, why globals in PHP doesn't really work
like globals?


. [ Christian Dechery  ]
. Webdeveloper @ Tá Na Mesa!
. Listmaster @ Gaita-L
. http://www.tanamesa.com.br



--
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] adding lib files...

2001-02-14 Thread Rasmus Lerdorf

No, you can't just add random .so libraries directly like that.  You will
have to write a PHP extension that maps the API implemented by your
library to a set of user-callable PHP functions.  The ext/ext_skel script
gets you on your way towards writing such an extension, but you need to be
an experienced C programmer to actually do this.

-Rasmus

On Wed, 14 Feb 2001, Julia A . Case wrote:

> If I have a lib.so file can I just link it in with php and have access to the
> functionality in lib.so?  If not can someone show me the way to adding things to
> php?
>
> Julia
> (sorry if this is a stupid question)
>
> --
> [  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]




RE: [PHP] PHP globals aren't really globals

2001-02-14 Thread Boget, Chris

> >Yes.  But with regards to form variables, all you need to do is
> >make one variable global:
> >$HTTP_POST_VARS
> >it is an associative array that contains all the post variables from 
> >the form.  Make it global and just loop through it.

> exactly, u need to loop to an array to get the globals u want.

No, to the the variables/values that you want.

> this is not the idea of global, global is global... if it's set outside
> of ALL functions it should be available 'with no extra code' 
> to ALL functions, it works that way in all programming language 
> I'm familiar with... why not in PHP? that's what I wanna know, 
> why globals in PHP doesn't really work like globals?

Perhaps I'm missing something.  In order to access the value of any
variable defined outside the scope of the function, you have to declare
it as "global".  This is true in every single instance.  If you do not, then
you cannot access the value of that variable.  While it's been a while
since I've worked with C, I seem to recall it being the case there as
well.  And in Pascal.  And in VB.  Again, it's been a while so I could be
wrong (but don't think so).  
Also, PHP was written in C.  Why would they institute a behaviour 
that was radically different than what is part of the parent language?

Chris



Re: [PHP] $PHP_SELF in Netscape PART 2

2001-02-14 Thread Rog

John Vanderbeck wrote:
 >DOES NOT WORK:
 >echo '',
 >$subcategories[$index], '';

You are using commas instead of periods, use ".$PHP_SELF." instead of 
",$PHP_SELF," (and for the other instances as well).


 Visit the Gates Motel webgame:
 http://www.gameslate.com/gatesmotel/


-- 
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 globals aren't really globals

2001-02-14 Thread Rasmus Lerdorf

> I've been programming in C all my life, and now I just started developing
> in PHP and I'm really enjoying it, it has all the missing improvements that
> C needed to be more user-likely.
>
> But one thin I can't get, how can PHP call a variabel global, if it isn't
> global.
> A global var, is a var defined outside all functions and it's available
> to all and altered by all, without having to redefine or call the var again.

That may be your definition of a global variable.  It isn't mine.  The
fact that you have some way to access the variable from every scope makes
it global by my definition.

Also, all global variables are available via $GLOBALS['var_name'].  And if
you really do have 50 global variables, you should really appreciate this
feature as your chances of having local/global variable overlaps which can
cause weird bugs is that much higher.  I would suggest grouping your
variables into logical arrays of information and doing a 'global' on these
arrays instead.

> In PHP, for a var to be global you have to add a 'global $var' inside the
> function u want to use it. THis is not nice, what about if u have a form
> with 50 fields and want a function to validate all of them, u have to pass
> them all to the function or build a little piece of code to make all th
> $GLOBALS local right?

If you have a form with 50 fields, name them like this:





Then simply make do: global $blah

> Is this really the idea of global vars?

The idea is to avoid really nasty scope-related bugs that are common in C
code that uses lots of global variables.  Years and years ago when I wrote
the first version of PHP I was working for a telco writing software for a
large telephone switch.  The code was huge and extremely ugly.  Global
variables everywhere.  The team had been chasing a bug for about a week
when I got stubborn and decided it was time to kill the bug.  I printed
out all the source code and laid it out in a long hallway as I crawled
along with different coloured pens and manually traced my way through it
as none of the debuggers we had at the time were of any use.  After
countless hours the bug turned out to be inside a function that silently
modified a global variable which affected another piece of code in a
completely different part of the program.

I swore I would not have the same problem in PHP and thus the requirement
for people to be explicit about using global variables inside functions.
Hopefully it also forces a little bit of structure and organization on
people.

-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] pro's and con's of storing images

2001-02-14 Thread Thomas Deliduka

On 2/14/01 7:12 AM this was written:

> I'm putting togeather a simple website buider app.
> i'm allowing users to upload images.I'm wondering whether i should store
> those images in a database or create dirs for each user.the mysql db has a
> relatively small capacity but storing them to the db might make it simpler
> for me.
> also ftp functions don't work on the server and my damn isp keeps fobbing me
> off when i ask him to do anything.

I would make an upload form and put the image on the server. IMHO, but
that's only because I've never really worked with BLOB values in mySQL
-- 

Thomas Deliduka
IT Manager
 -
New Eve Media
The Solution To Your Internet Angst
http://www.neweve.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] PHP globals aren't really globals

2001-02-14 Thread John Vanderbeck

> Perhaps I'm missing something.  In order to access the value of any
> variable defined outside the scope of the function, you have to declare
> it as "global".  This is true in every single instance.  If you do not,
then
> you cannot access the value of that variable.  While it's been a while
> since I've worked with C, I seem to recall it being the case there as
> well.  And in Pascal.  And in VB.  Again, it's been a while so I could be
> wrong (but don't think so).

Not realy.  In most languages, heck , all I can think of, the variable's
scope is simply dependant on WHERE it was declared, not how it was declared.
If in C/C++ you define a variable outside the scope of any function, then it
becomes global and can be accessed by any function.

I'm not arguing one side or the other, just stating :) I personally find the
PHP way a bit annoiying, but its workable, and i'm SURE there was a reason
for it.  Just not sure what that reason was :)

- John Vanderbeck
- Admin, GameDesign

>
> Chris
>


-- 
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] Help Work with files

2001-02-14 Thread Karl J. Stubsjoen

Hello, I need to work with files on my web server.  I need to be able move
them, delete them, rename them etc...
Is there a section in the documentation devoted to this?
- How do I list files in a directory?

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] $PHP_SELF in Netscape PART 2

2001-02-14 Thread John Vanderbeck

> You are using commas instead of periods, use ".$PHP_SELF." instead of
> ",$PHP_SELF," (and for the other instances as well).

Huh? I am going off of the example from the PHP documentation:

>From http://www.php.net/manual/en/function.urlencode.php
echo '';

So I am using that as a model:
echo ' A HREF=" ', $PHP_SELF, '?mode=index&category=',
urlencode($cateogory), ' ">Blah';

- John Vanderbeck
- Admin, GameDesign

>
>
>  Visit the Gates Motel webgame:
>  http://www.gameslate.com/gatesmotel/
>
>


-- 
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 globals aren't really globals

2001-02-14 Thread Rog

Rasmus wrote:
 >I swore I would not have the same problem in PHP and thus the requirement
 >for people to be explicit about using global variables inside functions.
 >Hopefully it also forces a little bit of structure and organization on
 >people.

Hear, hear and thank you Rasmus. It seems to me that the several other ways 
folks have listed to solve this one example indicates that we don't really 
need the temporary convenience of wide open globals (temporary as in it 
doesn't end up very convenient when they create problems).


 Visit the Gates Motel webgame:
 http://www.gameslate.com/gatesmotel/


-- 
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] Help Work with files

2001-02-14 Thread Brian V Bonini

exec
fclose
feof
fflush
fgetc
fgetcsv
fgets
fgetss
file
file_exists
fileatime
filectime
filegroup
fileinode
filemtime
fileowner
fileperms
filesize
filetype

> -Original Message-
> From: Karl J. Stubsjoen [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, February 14, 2001 10:14 AM
> To: PHP Mailing List
> Subject: [PHP] Help Work with files
>
>
> Hello, I need to work with files on my web server.  I need to be able move
> them, delete them, rename them etc...
> Is there a section in the documentation devoted to this?
> - How do I list files in a directory?
>
> 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 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 globals aren't really globals

2001-02-14 Thread John Vanderbeck

> Rasmus wrote:
>  >I swore I would not have the same problem in PHP and thus the
requirement
>  >for people to be explicit about using global variables inside functions.
>  >Hopefully it also forces a little bit of structure and organization on
>  >people.
>
> Hear, hear and thank you Rasmus. It seems to me that the several other
ways
> folks have listed to solve this one example indicates that we don't really
> need the temporary convenience of wide open globals (temporary as in it
> doesn't end up very convenient when they create problems).

I was always tought very simply, don't use globals :)

However, that isn't always an option.  I have no problems with the way PHP
does things.  I think its a good idea for the shelter. What I find
interesting is that it seems when you are first learning a language, you use
more globals, than when you are more experienced with it.  When I first
started programmig in C, 99% of my variables were global.  Look at any of my
C/C++ code nowadays, over 10 years later, and you will be hard pressed to
find a global.

PHP is still new to me, so i'm still trying to use alot of globals.  Because
of the way PHP handles it, i'm jumping through a few hoops.  That is
annoying, but I don't consider it a problem, because as I get better, I know
I will go back through and rewrite things to not use globals.  I guess my
confusion is this: I am passing all my variables around between scripts by
sending them through the URLs (index.php?mode=index).  I guess what "annoys"
me, is I would expect those to be available from inside the functions, but
they aren't.

- John Vanderbeck
- Admin, GameDesign

>
>  Visit the Gates Motel webgame:
>  http://www.gameslate.com/gatesmotel/
>
>
> --
> 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 globals aren't really globals

2001-02-14 Thread Christian Dechery


>The idea is to avoid really nasty scope-related bugs that are common in
>C
>code that uses lots of global variables.  Years and years ago when I wrote
>the first version of PHP I was working for a telco writing software for
>a
>large telephone switch.  The code was huge and extremely ugly.  Global
>variables everywhere.  The team had been chasing a bug for about a week
>when I got stubborn and decided it was time to kill the bug.  I printed
>out all the source code and laid it out in a long hallway as I crawled
>along with different coloured pens and manually traced my way through it
>as none of the debuggers we had at the time were of any use.  After
>countless hours the bug turned out to be inside a function that silently
>modified a global variable which affected another piece of code in a
>completely different part of the program.
>
>I swore I would not have the same problem in PHP and thus the requirement
>for people to be explicit about using global variables inside functions.
>Hopefully it also forces a little bit of structure and organization on
>people.

thanks...
now I have an answer I can swallow... cuz I simply didn't get why PHP (which
came from C) had a differente behaviour according to globals.
I never had any problem handling them, but in the other hand I never had
50 of them in a program.
I can understand that making global every single form variable would take
a whole lot of control by the compiler...

I just came with a nice foreach() to make my globals local, and I have to
put them in ALL my functions that handles form vars... I'll consider using
arrays in my next forms

but hey, don't worry... PHP really kicks ASP ass in all matters! :)

cya


. [ Christian Dechery  ]
. Webdeveloper @ Tá Na Mesa!
. Listmaster @ Gaita-L
. http://www.tanamesa.com.br



--
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/mnogosearch config.m4

2001-02-14 Thread Sergey Kartashoff

gluke   Wed Feb 14 06:39:39 2001 EDT

  Modified files:  
/php4/ext/mnogosearch   config.m4 
  Log:
  mnoGoSearch config.m4 freebsd compatibility fix.
  
  
Index: php4/ext/mnogosearch/config.m4
diff -u php4/ext/mnogosearch/config.m4:1.4 php4/ext/mnogosearch/config.m4:1.5
--- php4/ext/mnogosearch/config.m4:1.4  Wed Feb 14 06:27:45 2001
+++ php4/ext/mnogosearch/config.m4  Wed Feb 14 06:39:39 2001
@@ -1,5 +1,5 @@
 dnl $Source: /local/repository/php4/ext/mnogosearch/config.m4,v $
-dnl $Id: config.m4,v 1.4 2001/02/14 14:27:45 gluke Exp $
+dnl $Id: config.m4,v 1.5 2001/02/14 14:39:39 gluke Exp $
 
 PHP_ARG_WITH(mnogosearch,for mnoGoSearch support,
 [  --with-mnogosearch[=DIR]   Include mnoGoSearch support.  DIR is the 
mnoGoSearch base
@@ -24,11 +24,6 @@
MNOGOSEARCH_VERSION_ID=`$MNOGOSEARCH_BINDIR/udm-config -version-id`
 
if test $? -ne 0; then
-   AC_MSG_RESULT(<= 3.1.9)
-   AC_MSG_ERROR(mnoGoSearch 3.1.10 at least required)
-   fi
-   
-   if test -l "$MNOGOSEARCH_VERSION_ID" -gt 6; then
AC_MSG_RESULT(<= 3.1.9)
AC_MSG_ERROR(mnoGoSearch 3.1.10 at least required)
fi



-- 
PHP CVS 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] Bad Practices

2001-02-14 Thread Krznaric Michael

Hi,

There certain common issues that arise with many beginners.  Take a
look at this article http://www.wdvl.com/Authoring/Languages/PHP/Debugging/
.  At the end of this article is a check list of a few things to consider
when everything doesn't go exactly right.

Mike

-Original Message-
From: Jeff Oien [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 13, 2001 1:11 PM
To: PHP
Subject: [PHP] Bad Practices


Would people like to list bad practices and also point us
newbies to any articles online dealing with syntax, correct
use of single and double quotes etc.? 

I would like to get a good handle on these issues right
from the beginning. As a Web designer I like to use 
standard HTML and do everything correctly even if the
browser is forgiving. I notice that a LOT of programmers
write bad HTML and I would imagine many of the publicly
available PHP scripts aren't exactly kosher either. What are 
some of the most objectionable things you see? Thanks.
Jeff Oien

-- 
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] Link Exchange Robot

2001-02-14 Thread Ben Ocean

Hi;
There's a great little proggie I use to scout out potential link exchange 
partners for my clients called Zeus.

I have no financial interest in Zeus.

*However*, there are some facilities in this proggie I don't care for: 
facilities designed to slow one down (and presumably keep the company from 
being known as a developer of devices for spammers, not that I advocate 
spamming). I also have a Linux box with a T-1 line that could kick serious 
butt, and this (of course) is built for Windoze. That, plus the fact that I 
now find I need a whole bunch of these robots and I'd like to legally skate 
on the licencing fee :) Which (finally) brings me to my question: Does 
anyone know of an open source program that does the same thing?
TIA,
BenO


-- 
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_SELF in Netscape PART 2

2001-02-14 Thread Chris Lee

dont use ' , ' use ' . '

echo 'hello';

--


Chris Lee
Mediawaveonline.com

em. [EMAIL PROTECTED]

ph. 250.377.1095
ph. 250.376.2690
fx. 250.554.1120


""John Vanderbeck"" <[EMAIL PROTECTED]> wrote in message
005601c09696$08331480$[EMAIL PROTECTED]">news:005601c09696$08331480$[EMAIL PROTECTED]...
> Ok, I made all the changes from $PHPSELF to $PHP_SELF, and i'm further
along
> with Netscape than before.  However, it now seems that there are still
some
> statements that $PHP_SELF isn't evaluated in.  However, now I can narrow
it
> down to certain statements:
>
> WORKS:
>echo " HREF=$PHP_SELF?mode=index&category=root>Main -> $category";
>
> DOES NOT WORK:
> echo '',
> $subcategories[$index], '';
>
>
> - John Vanderbeck
> - Admin, GameDesign
>
>
>
> --
> 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] HTTP Authentication not getting unset

2001-02-14 Thread Toby Miller

Hey all,

New problem. I really hope there's something simple to do to fix it. Check out this 
scenario and tell me if there's a step that I'm missing.

Inside my common footer on my site the very first call is to an include called 
UserAuth.inc.php.

UserAuth.inc.php checks $REQUEST_URI to see if the present directory or URL is 
protected or not.

If it is protected then it checks to see if $PHP_AUTH_USER is set. If it is then it 
runs through the usual HTTP Authentication. If it fails it goes to a failure page, if 
it succeeds then it logs the user in.

Now I can surf around on the site and that same authentication will continue to be 
used for the rest of the site where ever another protected directory or file is found 
(as to be expected).

Now to logout I have a page called logout.php. If you go to this page (which also 
includes the same footer) there is another action that takes place.

If the $REQUEST_URI contains logout.php then I print the same "401" header that I 
print for authentication and unset $PHP_AUTH_USER, $PHP_AUTH_PW and $AUTH_USER. 
$AUTH_USER is the user authentication object in my class file UserAuth.class.php. I'm 
just unsetting this so that no code will still have record of the old authentication 
object to do anything with.

Now if I try to read the $PHP_AUTH_USER or $PHP_AUTH_PW variables anyplace on the site 
they don't exist, until I go back to one of the protected pages. Then they 
miraculously re-appear and are readily available once again without requiring the user 
to log back in.

If you've got any ideas, suggestions, guesses or references, please reply. I've run 
out of ideas. I can also provide the code that I'm using if you think it might just be 
a problem with my logic. I don't think this is the case as I shouldn't be able to read 
any variable that has been unset, but like I said, I'm running out of ideas.

System: RedHat 6.1-6 i686 Kernel 2.2.13
Server: Apache 1.3.12
PHP: 4.0.3pl1

Thanks,
Toby




Re: [PHP] PHP globals aren't really globals

2001-02-14 Thread John Monfort



 I believe you use globals $var to ACCESS a global variable, not to
 define.

 If I understand correctly, and please correct me if I am wrong, this a
way to ge around the name space...

 ex. for something like

  $my_var = 10;

  function test () {
$my_var = 15;
   }

  because of these variables are in a different name space, they are not
  the same.

 If you intended to change the first variable, then you should do
 something like

  function test() {
globals $my_var;
$my_var = 15;
  }


 This would change the value of $my_var from 10 to 15.

 Please correct me, if I'm wrong.


__John Monfort_
_+---+_
 P E P I E  D E S I G N S
   www.pepiedesigns.com
"The world is waiting, are you ready?"
-+___+-

On Wed, 14 Feb 2001, Christian Dechery wrote:

> I've been programming in C all my life, and now I just started developing
> in PHP and I'm really enjoying it, it has all the missing improvements that
> C needed to be more user-likely.
>
> But one thin I can't get, how can PHP call a variabel global, if it isn't
> global.
> A global var, is a var defined outside all functions and it's available
> to all and altered by all, without having to redefine or call the var again.
>
> In PHP, for a var to be global you have to add a 'global $var' inside the
> function u want to use it. THis is not nice, what about if u have a form
> with 50 fields and want a function to validate all of them, u have to pass
> them all to the function or build a little piece of code to make all th
> $GLOBALS local right?
>
> Is this really the idea of global vars?
>
>
> . [ Christian Dechery  ]
> . Webdeveloper @ Tá Na Mesa!
> . Listmaster @ Gaita-L
> . http://www.tanamesa.com.br
>
>
>
> --
> 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] date maniplations

2001-02-14 Thread Don

Hello,

Sorry if I am confused by the date functions in the manual but I am.
Here's what I want to do:

I have a string in the form MM/DD/.  I wish to:
1) convert it to a date
2) add $n days to it
3) convert back to a string in the same format above

I believe I can accomplish [2] and [3] with:

$mytdate = date("m/d/Y",mktime(0,0,0,date("m")
,date("d")+$n,date("Y")));

How do I accomplish step 1?
Can I type cast a string to a date?

Thanks,
Don


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

2001-02-14 Thread Boget, Chris

> Sorry if I am confused by the date functions in the manual but I am.
> Here's what I want to do:
> I have a string in the form MM/DD/.  I wish to:
> 1) convert it to a date
> 2) add $n days to it
> 3) convert back to a string in the same format above
> I believe I can accomplish [2] and [3] with:
> $mytdate = date("m/d/Y",mktime(0,0,0,date("m")
> ,date("d")+$n,date("Y")));
> How do I accomplish step 1?
> Can I type cast a string to a date?

No, but you can do this:

$startDate = explode( "/", $dateString );

$mytdate = date( "m/d/Y", mktime( 0, 0, 0, $startDate[0], $startDate[1]+$n,
$startDate[2] );

Chris



[PHP] need better solution

2001-02-14 Thread Christian Dechery

I need a better solution for reporting SQL errors.

I'm used to work with ASP, and whenever a query has a syntax error, it stops
the script and reports the error as if it was a compile error. This is very
usefull, but int PHP it doesn't work like that, I know.

I came with a function query_error() that I call after each query, that
prints out the query, the error and the line... so I need to call it like
this.

if(!$rs) query_error($query,__LINE__);

but having to writ this down after EVERY single query, along with the __LINE__
thing can get very boring, does anyone has a better solution?


. [ Christian Dechery  ]
. Webdeveloper @ Tá Na Mesa!
. Listmaster @ Gaita-L
. http://www.tanamesa.com.br



--
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 globals aren't really globals

2001-02-14 Thread Rasmus Lerdorf

>  I believe you use globals $var to ACCESS a global variable, not to
>  define.

That's correct.  To be perfectly correct here, what you are doing is
creating a reference to the global variable.  Think of it as an alias to
the same variable as the global variable.

  global $foo;

would be equivalent to:

  $foo = & $GLOBALS['foo'];

With the latter giving you the ability to use a different name for the
local reference to the globally-scoped variable.

-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] need better solution

2001-02-14 Thread Chris Lee

works for me, just call it. change it to better match yours if you like.

 function check_db($query = 'Unavailble')
 {
  global $store_db;
  if ( mysql_errno() )
{
  echo "Error: Problem with DataBase : $store_db\n";
  echo "Error: " . mysql_errno() . ':' . mysql_error() . "\n";
  echo "Query: $query\n";
  exit();
}
 }

I havent played with a more automatic metod, ie. error_reporting();


--


Chris Lee
Mediawaveonline.com

em. [EMAIL PROTECTED]

ph. 250.377.1095
ph. 250.376.2690
fx. 250.554.1120



""Christian Dechery"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
I need a better solution for reporting SQL errors.

I'm used to work with ASP, and whenever a query has a syntax error, it stops
the script and reports the error as if it was a compile error. This is very
usefull, but int PHP it doesn't work like that, I know.

I came with a function query_error() that I call after each query, that
prints out the query, the error and the line... so I need to call it like
this.

if(!$rs) query_error($query,__LINE__);

but having to writ this down after EVERY single query, along with the
__LINE__
thing can get very boring, does anyone has a better solution?


. [ Christian Dechery  ]
. Webdeveloper @ Tá Na Mesa!
. Listmaster @ Gaita-L
. http://www.tanamesa.com.br



--
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] RE: $PHP_SELF in Netscape PART 2

2001-02-14 Thread John Vanderbeck

I converted everythign over to use '.' instead of  ',' but I still get the
same exact results.  That is, $PHP_SELF is resolved to NULL, and every other
variable to the correct data.  Here is the new string:

echo ''
.$subcategories[$index]. '';


I think i'm just going to give up on this and rewrite it, because it DOES
work if I do the old double quotes bit.  Just means I need to re-arrange it
and do it in multiple ECHO statements, because I can't do the urlencode() in
double quotes. But I would really like to understand WHY this doesn't work.
Again, all other varaibles are properly resolved, and in IE $PHP_SELF is
properly resolved.

- John Vanderbeck
- Admin, GameDesign


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

2001-02-14 Thread Nguyen, David M

Hi all,

I have a PHP web form setup for user to fill in information then email it to
me after pressing SUBMIT button.  Everytime user uses double-quote(") or
single(') it inserts (/) right in front of " or '.  Does anyone know why and
how to fix it?  Please advise.  Below is example of what I got from my email
when user submits form to me. 


Topic: Added \"Initial login to the EMS\" procedure.


Thanks in advance,
David

 

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




RE: [PHP] Why???

2001-02-14 Thread Boget, Chris

> I have a PHP web form setup for user to fill in information 
> then email it to me after pressing SUBMIT button.  Everytime 
> user uses double-quote(") or single(') it inserts (/) right in front 
> of " or '.  Does anyone know why and how to fix it?  Please advise.  

Look up:

stripslashes();

Chris



Re: [PHP] Why???

2001-02-14 Thread John Vanderbeck

I can help you there, as I had the same problem until someone else helped
me.  This is because PHP will escape the input it gets.  I think this is
dependant on some enviroment setting, but I can't recall which one.

To fix it you call stripslashes($var);

- John Vanderbeck
- Admin, GameDesign

- Original Message -
From: "Nguyen, David M" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, February 14, 2001 11:02 AM
Subject: [PHP] Why???


> Hi all,
>
> I have a PHP web form setup for user to fill in information then email it
to
> me after pressing SUBMIT button.  Everytime user uses double-quote(") or
> single(') it inserts (/) right in front of " or '.  Does anyone know why
and
> how to fix it?  Please advise.  Below is example of what I got from my
email
> when user submits form to me.
>
>
> Topic: Added \"Initial login to the EMS\" procedure.
>
>
> Thanks in advance,
> David
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
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] HTTP Authentication not getting unset

2001-02-14 Thread Toby Miller

Sorry, I meant common header, not footer.

Inside my common "header" on my site ..
(which also includes the same "header") ...

- Original Message -
From: "Toby Miller" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, February 14, 2001 10:37 AM
Subject: [PHP] HTTP Authentication not getting unset


Hey all,

New problem. I really hope there's something simple to do to fix it. Check
out this scenario and tell me if there's a step that I'm missing.

Inside my common footer on my site the very first call is to an include
called UserAuth.inc.php.

UserAuth.inc.php checks $REQUEST_URI to see if the present directory or URL
is protected or not.

If it is protected then it checks to see if $PHP_AUTH_USER is set. If it is
then it runs through the usual HTTP Authentication. If it fails it goes to a
failure page, if it succeeds then it logs the user in.

Now I can surf around on the site and that same authentication will continue
to be used for the rest of the site where ever another protected directory
or file is found (as to be expected).

Now to logout I have a page called logout.php. If you go to this page (which
also includes the same footer) there is another action that takes place.

If the $REQUEST_URI contains logout.php then I print the same "401" header
that I print for authentication and unset $PHP_AUTH_USER, $PHP_AUTH_PW and
$AUTH_USER. $AUTH_USER is the user authentication object in my class file
UserAuth.class.php. I'm just unsetting this so that no code will still have
record of the old authentication object to do anything with.

Now if I try to read the $PHP_AUTH_USER or $PHP_AUTH_PW variables anyplace
on the site they don't exist, until I go back to one of the protected pages.
Then they miraculously re-appear and are readily available once again
without requiring the user to log back in.

If you've got any ideas, suggestions, guesses or references, please reply.
I've run out of ideas. I can also provide the code that I'm using if you
think it might just be a problem with my logic. I don't think this is the
case as I shouldn't be able to read any variable that has been unset, but
like I said, I'm running out of ideas.

System: RedHat 6.1-6 i686 Kernel 2.2.13
Server: Apache 1.3.12
PHP: 4.0.3pl1

Thanks,
Toby




-- 
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] RE: $PHP_SELF in Netscape PART 2

2001-02-14 Thread John Vanderbeck

Ok, I feel like the big idiot now.

I fixed the problem.  It was because of the whole global bit.  The ones that
were not working were inside a function, the ones that were working were
outside the function.  I guess I ASSUMED (yeah we know what happens when you
do that) that things like $PHP_SELF were always global.

Sorry to have bothered everyone :(

- John Vanderbeck
- Admin, GameDesign

- Original Message -
From: "John Vanderbeck" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, February 14, 2001 10:59 AM
Subject: [PHP] RE: $PHP_SELF in Netscape PART 2


> I converted everythign over to use '.' instead of  ',' but I still get the
> same exact results.  That is, $PHP_SELF is resolved to NULL, and every
other
> variable to the correct data.  Here is the new string:
>
> echo ''
> .$subcategories[$index]. '';
>
>
> I think i'm just going to give up on this and rewrite it, because it DOES
> work if I do the old double quotes bit.  Just means I need to re-arrange
it
> and do it in multiple ECHO statements, because I can't do the urlencode()
in
> double quotes. But I would really like to understand WHY this doesn't
work.
> Again, all other varaibles are properly resolved, and in IE $PHP_SELF is
> properly resolved.
>
> - John Vanderbeck
> - Admin, GameDesign
>
>
> --
> 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 vs JSP

2001-02-14 Thread Michael Kimsal

Not really a JSP/PHP issue, but you mention that there's another developer.
Are you in a bidding war with this person?  If you're vying for business,
don't get into putting JSP down, not out of hand anyway.  Simply state
the benefits that PHP has to offer.  Our machines may be weird, but we've
found that PHP running against servlets (on enhydra) - PHP generally
runs faster.  This all depends on the JVM underneath of course, and I don't
remember which ones we tested.  JSP seems to run even slower, though we
didn't do scientific testing.  :)  This doesn't mean JSP is bad, but that for
equivalent
performance, you may need more expensive hardware, which affects a
project's bottom line.

Assumption is that this would be a dedicated server - I don't know of too many
hosting companies that offer JSP service (sure they exist someplace tho).
Compare compilation time of JSP pages vs. the compilation time of PHP4 through
the APC.  There doesn't seem to be any time at all with APC, yet with JSP there
is/was a noticeable compilation lag on the first execution of a page - I've been
told there are faster compilers, but we were using "standard" stuff.  (getting
over
my head here, but I've *seen* the development effects of servlets, and JSP
gets compiled into servlets, so there's even an extra step there).

Again, if you're bidding, you'll lose if you just say 'JSP sucks'.  There was
an zdnet article a few weeks ago - JSP/ASP/CF/PHP.  PHP was the
fastest, JSP the slowest.

Good luck - contact me offlist if you want to discuss this further.


[EMAIL PROTECTED] wrote:

> Hi,
>
> Just wondering if anyone knows of any links to information relating to PHP vs
> JSP where PHP is my language of choice and another developer is recommending
> JSP but I know nothing about JSP to help me convince the buyer that PHP is a
> better choice.
>
> A question that was raised is that PHP cannot be integrated with C++ for
> large functions etc.
>
> My response was that I haven`t found a function that PHP cannot handle
> therefor integration was not a requirement
>
> Anyone else have any valid upside or downsides to the languages which could
> help
>
> Thanks
> 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]


-- 
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] need better solution

2001-02-14 Thread Michael Kimsal

What version of PHP are you using?  If there's a syntax error in our
statements, it stops execution, just like ASP.

There are error_reporting levels you can play with, and have errors trigger
certain functions to handle the errors gracefully.


Christian Dechery wrote:

> I need a better solution for reporting SQL errors.
>
> I'm used to work with ASP, and whenever a query has a syntax error, it stops
> the script and reports the error as if it was a compile error. This is very
> usefull, but int PHP it doesn't work like that, I know.
>
> I came with a function query_error() that I call after each query, that
> prints out the query, the error and the line... so I need to call it like
> this.
>
> if(!$rs) query_error($query,__LINE__);
>
> but having to writ this down after EVERY single query, along with the __LINE__
> thing can get very boring, does anyone has a better solution?
>
> . [ Christian Dechery  ]
> . Webdeveloper @ Tá Na Mesa!
> . Listmaster @ Gaita-L
> . http://www.tanamesa.com.br
>
> --
> 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] Link Exchange Robot

2001-02-14 Thread Michael Kimsal

There are modules in CPAN that do some of this -
the camel book I think has a chapter on that.  Oreilly also
has/had a book out regarding writing robots and such.
Sample code should all work for perl - switching to PHP if you
want/need shouldn't be too hard.


Ben Ocean wrote:

> Hi;
> There's a great little proggie I use to scout out potential link exchange
> partners for my clients called Zeus.
> 
> I have no financial interest in Zeus.
> 
> *However*, there are some facilities in this proggie I don't care for:
> facilities designed to slow one down (and presumably keep the company from
> being known as a developer of devices for spammers, not that I advocate
> spamming). I also have a Linux box with a T-1 line that could kick serious
> butt, and this (of course) is built for Windoze. That, plus the fact that I
> now find I need a whole bunch of these robots and I'd like to legally skate
> on the licencing fee :) Which (finally) brings me to my question: Does
> anyone know of an open source program that does the same thing?
> TIA,
> BenO
>
> --
> 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_SELF in Netscape PART 2

2001-02-14 Thread Charlie Llewellin

A comma works when you use echo. Is there any reason why this is a bad idea?

Charlie Llewellin
- Original Message - 
From: "John Vanderbeck" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, February 14, 2001 9:11 AM
Subject: Re: [PHP] $PHP_SELF in Netscape PART 2


> > You are using commas instead of periods, use ".$PHP_SELF." instead of
> > ",$PHP_SELF," (and for the other instances as well).
> 
> Huh? I am going off of the example from the PHP documentation:
> 
> >From http://www.php.net/manual/en/function.urlencode.php
> echo '';
> 
> So I am using that as a model:
> echo ' A HREF=" ', $PHP_SELF, '?mode=index&category=',
> urlencode($cateogory), ' ">Blah';
> 
> - John Vanderbeck
> - Admin, GameDesign
> 
> >
> >
> >  Visit the Gates Motel webgame:
> >  http://www.gameslate.com/gatesmotel/
> >
> >
> 
> 
> -- 
> 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] Why???

2001-02-14 Thread Philip Olson

This is because you have magic_quotes_gpc set to ON, this setting can be
read about here :

http://www.php.net/manual/en/configuration.php#ini.magic-quotes-gpc

http://www.php.net/manual/en/function.get-magic-quotes-gpc.php

Which, as you'll read about, adds the quotes automatically.  Also, have a
look here :

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

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

It will make sense.

Regards,


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

On Wed, 14 Feb 2001, Nguyen, David M wrote:

> Hi all,
> 
> I have a PHP web form setup for user to fill in information then email it to
> me after pressing SUBMIT button.  Everytime user uses double-quote(") or
> single(') it inserts (/) right in front of " or '.  Does anyone know why and
> how to fix it?  Please advise.  Below is example of what I got from my email
> when user submits form to me. 
> 
> 
> Topic: Added \"Initial login to the EMS\" procedure.
> 
> 
> Thanks in advance,
> David
> 
>  
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 


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

2001-02-14 Thread Nguyen, David M

The / is coming from $topic, how do I use stripslashes to remove / .  Can
someone give me an example how to code it?

Here is my original PHP script:

\n");
print ("\n");
print ("$title\n");
print ("\n");
print ("\n");
print ("Thank you.  Your submission has been sent. Back to Home Page.\n");
print ("\n");
print ("");

==



-Original Message-
From: John Vanderbeck [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 14, 2001 10:07 AM
To: Nguyen, David M; [EMAIL PROTECTED]
Subject: Re: [PHP] Why???


I can help you there, as I had the same problem until someone else helped
me.  This is because PHP will escape the input it gets.  I think this is
dependant on some enviroment setting, but I can't recall which one.

To fix it you call stripslashes($var);

- John Vanderbeck
- Admin, GameDesign

- Original Message -
From: "Nguyen, David M" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, February 14, 2001 11:02 AM
Subject: [PHP] Why???


> Hi all,
>
> I have a PHP web form setup for user to fill in information then email it
to
> me after pressing SUBMIT button.  Everytime user uses double-quote(") or
> single(') it inserts (/) right in front of " or '.  Does anyone know why
and
> how to fix it?  Please advise.  Below is example of what I got from my
email
> when user submits form to me.
>
>
> Topic: Added \"Initial login to the EMS\" procedure.
>
>
> Thanks in advance,
> David
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


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

2001-02-14 Thread Karl J. Stubsjoen

When you @ "at" a command (supress error messaging) within a function, is
the scope of the @ within the function?

Example:


CloseODBC(1);

# is error message supressed here too?


function CloseODBC($connection_id)
{
# error messaging supressed
@odbc_close($connection_id);

}


-- 
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] HTTP Authentication not getting unset

2001-02-14 Thread Chris Lee

Ive found the same thing and currently do not have a workaround, it seems
that browsers cache this. one method Ive thought of and never tested is to
set a session variable, cross reference that SessionID, PHP_AUTH_PW,
PHP_AUTH_USER are all valid, if not then your not loged in correctly. to log
out just unset SessionID. any future pages will not load. even if the
PW/USER are valid the Session wouldnt.

If the browser has cookies disabled, you have compiled php with --trans-sid,
and the user uses the back button the user would still be able to view
cached pages. you might want to put some fancy no-cache headers in there
somewhere and hope the browser supports them.

you might even want to impliment a time based system, set the SessionID =
time() on every header; but first check if the current SessionID < 30min old
then invalid login vs updateing SessionID to equal current time()

This would prevent anyone from viewing cached pages more then 30min old and
force them to re-login

--


Chris Lee
Mediawaveonline.com

em. [EMAIL PROTECTED]

ph. 250.377.1095
ph. 250.376.2690
fx. 250.554.1120





""Toby Miller"" <[EMAIL PROTECTED]> wrote in message
006901c0969f$cfcf2700$[EMAIL PROTECTED]">news:006901c0969f$cfcf2700$[EMAIL PROTECTED]...
> Sorry, I meant common header, not footer.
>
> Inside my common "header" on my site ..
> (which also includes the same "header") ...
>
> - Original Message -
> From: "Toby Miller" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, February 14, 2001 10:37 AM
> Subject: [PHP] HTTP Authentication not getting unset
>
>
> Hey all,
>
> New problem. I really hope there's something simple to do to fix it. Check
> out this scenario and tell me if there's a step that I'm missing.
>
> Inside my common footer on my site the very first call is to an include
> called UserAuth.inc.php.
>
> UserAuth.inc.php checks $REQUEST_URI to see if the present directory or
URL
> is protected or not.
>
> If it is protected then it checks to see if $PHP_AUTH_USER is set. If it
is
> then it runs through the usual HTTP Authentication. If it fails it goes to
a
> failure page, if it succeeds then it logs the user in.
>
> Now I can surf around on the site and that same authentication will
continue
> to be used for the rest of the site where ever another protected directory
> or file is found (as to be expected).
>
> Now to logout I have a page called logout.php. If you go to this page
(which
> also includes the same footer) there is another action that takes place.
>
> If the $REQUEST_URI contains logout.php then I print the same "401" header
> that I print for authentication and unset $PHP_AUTH_USER, $PHP_AUTH_PW and
> $AUTH_USER. $AUTH_USER is the user authentication object in my class file
> UserAuth.class.php. I'm just unsetting this so that no code will still
have
> record of the old authentication object to do anything with.
>
> Now if I try to read the $PHP_AUTH_USER or $PHP_AUTH_PW variables anyplace
> on the site they don't exist, until I go back to one of the protected
pages.
> Then they miraculously re-appear and are readily available once again
> without requiring the user to log back in.
>
> If you've got any ideas, suggestions, guesses or references, please reply.
> I've run out of ideas. I can also provide the code that I'm using if you
> think it might just be a problem with my logic. I don't think this is the
> case as I shouldn't be able to read any variable that has been unset, but
> like I said, I'm running out of ideas.
>
> System: RedHat 6.1-6 i686 Kernel 2.2.13
> Server: Apache 1.3.12
> PHP: 4.0.3pl1
>
> Thanks,
> Toby
>
>
>
>
> --
> 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] Closing Databases

2001-02-14 Thread Karl J. Stubsjoen

I am making ODBC connections and MySQL connections, and want to make sure
I'm closing my connection properly.  Someone once replied that you do not
need to worry about terminating the query set (for MySQL), that PHP takes
care of this for you, is this true for the ODBC connection as well?

So what I am doing, is making a connection to the db, querying the db using
select statements, and then releasing the db connection with:  mysql_close
or odbc_close.  Is that good enough?

Thanks!

Karl


-- 
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] XML parsing without the PHP4 XML functions

2001-02-14 Thread Stefen Lars

Hello all

I have recently been assigned the task of parsing an xml file and format the 
contents of the file in HTML. The xml file lies on another server. Our web 
space provider does not provide the XML functions (nor is he willing to 
install them) :-gr.

I am sure that I am not the only who has come across this problem.

Would someone have already created a few functions to parse xml that they 
are willing to share?

I have the following structure to deal with:


  
ProductName
Why does it not work
Because it is not turned on
  


There are whole load of s in the file.

I then want to display the contents a bit like this:

echo $product;
echo $question;

etc (of course with some HTML formatting, like a bulleted list).

Any help would be really VERY appreciated!

Thanks

S



_
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] Oracle Web & Php

2001-02-14 Thread Christian Reiniger

On Wednesday 14 February 2001 11:44, kaab kaoutar wrote:

> is there a possiblily to use with in an Oracle Web server ?

RTFM (look at the manual, topic "Oracle functions")

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

Even idiots can handle computers, and many do.

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

2001-02-14 Thread Andrew Hill

Karl,

That should be good enough.  What you were told is true - PHP does close
connections when the script exits, but every so often this can fail, so
closing the connection explicitly is good practice.

Best regards,
Andrew
--
Andrew Hill - OpenLink Software
Director Technology Evangelism
eBusiness Infrastructure Technology
http://www.openlinksw.com


> -Original Message-
> From: Karl J. Stubsjoen [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, February 14, 2001 11:47 AM
> To: PHP Mailing List
> Subject: [PHP] Closing Databases
>
>
> I am making ODBC connections and MySQL connections, and want to make sure
> I'm closing my connection properly.  Someone once replied that you do not
> need to worry about terminating the query set (for MySQL), that PHP takes
> care of this for you, is this true for the ODBC connection as well?
>
> So what I am doing, is making a connection to the db, querying
> the db using
> select statements, and then releasing the db connection with:  mysql_close
> or odbc_close.  Is that good enough?
>
> Thanks!
>
> Karl
>
>
> --
> 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] Newbie file upload problem

2001-02-14 Thread Tom Beidler

I'm trying to get some the example files from Thickbooks to work, although
I've also tried php.net and PHPBuilder with similar results.

I'm dealing with an ISP so I can't view php.ini or change permissions
directly.

Using the most basic elements of the script I get errors immediately after
trying to submit the form which posts the file. The errors vary across
browsers. In IE I get "Attempt to load accessing url
"http://.../do_upload.php" failed." Netscape gives an error something like
"File does not exist."

I've asked the ISP to check the permissions on the PHP temp directory and
assign PHP the permission to write to my final destination directory. Which
they say they have done.

Any ideas where to look next?

Thanks,
Tom



>>.>>.>>>.>.>  <.<.<<<.<<.<<<.<<
Tom BeidlerOrbit Tech Services
805.682.8972 (phone)   http://www.orbittechservices.com/
805.682.5833 (fax) [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] Qoute problem

2001-02-14 Thread Tanya Brethour


Hi! I was hoping that someone could help me out. I am not positive if I
understand whats going on.. so let me try to explain.

This is a process to modify news articles in a MySQL database.

(From the point after picking the article to modify)
PHP Script #1:
  I grab everything from the database and stick it into the HTML form
(textarea, text, etc). I allow the user to modify whatever they want.

PHP Script #2:
 This script takes the new information and displays it to the user.. it is
a preview of what it will look like with the changes.

PHP Script #3:
 Updates the news article in the database.

Now the problem I am having.. is that the description and content fields
have qoutes in them. For example:
Description: I like to run and walk. I love "smelly cheese."

So.. when it tries to update the database. It will only store this as the
description:
I like to run and walk. I love\\

I know that its because the qoutes are not being escaped correctly.. and
it seems as though it is escaping the escape. 

So my question is.. how can I keep my qoutes?

Just FYI.. I am making the user enter in the description and content in
html. So i cant just change the qoutes to HTMLTags because it would change
my  and  etc.

Below is an example of the code (shortened for an example):

PHP Script #1: Editing description

print'

Description:';
echo $info["description"];
print'
';

PHP Script #2: (preview changes)


Description:
 

PHP Script #3: (update database)
$sql = "UPDATE news SET release_date='$date', title='$title',
description='$describe', contact='$contact', content='$test', type='$type'
WHERE news_id=$id";
$result = mysql_query($sql)


Thanks in advance.

-Tanya







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

2001-02-14 Thread Web master

My understanding is, it simple supress the any messages generated from 
the result. So I guess it is local.

Karl J. Stubsjoen wrote:

> When you @ "at" a command (supress error messaging) within a function, is
> the scope of the @ within the function?
> 
> Example:
> 
> 
> CloseODBC(1);
> 
> # is error message supressed here too?
> 
> 
> function CloseODBC($connection_id)
> {
> # error messaging supressed
> @odbc_close($connection_id);
> 
> }
> 
> 


-- 
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] Undocumented Socket functions?

2001-02-14 Thread Rog

Can anyone here decipher for me some of the undocumented Socket functions 
in PHP4?

For instance, how do I use select() to multiplex multiple connections?

With the functions that are documented, there is a nice example of a simple 
echoing TCP server, but it only accepts a single connection which has 
limited usage. Can anyone come up with an example to expand that to 
multiple connections.

The suggestions in the manual to read man pages & C tutorials has helped me 
wrap my head around the multiplexing loop concept, but I still can't 
decipher how to actually create this using the functions available (mostly 
because I don't program in C).


 Visit the Gates Motel webgame:
 http://www.gameslate.com/gatesmotel/


-- 
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] XML parsing without the PHP4 XML functions

2001-02-14 Thread Chris Lee

If your satisfied with IE5.0 customers you could do all that without php,
use an XSL file. Now if you want PHP to parse the XML file, I can see why,
your going to have to get XML installed. Have you considered other
providors? there are lots. Im one of them. Ive been told there are ways of
adding modules dynamically on runtime

http://php.net/manual/en/function.dl.php

Ive never needed it / used it. sorry :(

--


Chris Lee
Mediawaveonline.com

em. [EMAIL PROTECTED]

ph. 250.377.1095
ph. 250.376.2690
fx. 250.554.1120


""Stefen Lars"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello all
>
> I have recently been assigned the task of parsing an xml file and format
the
> contents of the file in HTML. The xml file lies on another server. Our web
> space provider does not provide the XML functions (nor is he willing to
> install them) :-gr.
>
> I am sure that I am not the only who has come across this problem.
>
> Would someone have already created a few functions to parse xml that they
> are willing to share?
>
> I have the following structure to deal with:
>
> 
>   
> ProductName
> Why does it not work
> Because it is not turned on
>   
> 
>
> There are whole load of s in the file.
>
> I then want to display the contents a bit like this:
>
> echo $product;
> echo $question;
>
> etc (of course with some HTML formatting, like a bulleted list).
>
> Any help would be really VERY appreciated!
>
> Thanks
>
> S
>
>
>
> _
> 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 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] Is this "typecast" safe?

2001-02-14 Thread John Vanderbeck

I'm a little unsure of how variables are cast around in PHP, since it seems
like VisualBasic where I don't declare any types, the compiler just figures
it out.

Would something like this be safe?
$info = fread($file, filesize("blah");
$info = explode("\n", $info);

echo $info[0];



- John Vanderbeck
- Admin, GameDesign



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

2001-02-14 Thread Brandon Orther

Hello,

I am trying to get the value for a file input field to have a starting value
I can't seem to get it to work when using Value=\"C:\test.gif\"  does anyone
have any advise?

Thank you,


Brandon Orther
WebIntellects Design/Development Manager
[EMAIL PROTECTED]
800-994-6364
www.webintellects.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] Qoute problem

2001-02-14 Thread Web master

My approach towards this problem was to parse the data before inserting 
and before displaying.
Before inserting the data entered by user, do something like 
str_replace($comments, "'","~") and do the same thing for " do a 
different character like | and then insert it into database.
Do the reverse before displaying the data, it should fix your problem..

Tanya Brethour wrote:

> Hi! I was hoping that someone could help me out. I am not positive if I
> understand whats going on.. so let me try to explain.
> 
> This is a process to modify news articles in a MySQL database.
> 
> (From the point after picking the article to modify)
> PHP Script #1:
>   I grab everything from the database and stick it into the HTML form
> (textarea, text, etc). I allow the user to modify whatever they want.
> 
> PHP Script #2:
>  This script takes the new information and displays it to the user.. it is
> a preview of what it will look like with the changes.
> 
> PHP Script #3:
>  Updates the news article in the database.
> 
> Now the problem I am having.. is that the description and content fields
> have qoutes in them. For example:
> Description: I like to run and walk. I love "smelly cheese."
> 
> So.. when it tries to update the database. It will only store this as the
> description:
>   I like to run and walk. I love\\
> 
> I know that its because the qoutes are not being escaped correctly.. and
> it seems as though it is escaping the escape. 
> 
> So my question is.. how can I keep my qoutes?
> 
> Just FYI.. I am making the user enter in the description and content in
> html. So i cant just change the qoutes to HTMLTags because it would change
> my  and  etc.
> 
> Below is an example of the code (shortened for an example):
> 
> PHP Script #1: Editing description
> 
> print'
> 
> Description:';
> echo $info["description"];
> print'
> ';
> 
> PHP Script #2: (preview changes)
> 
> 
> Description:
>  
> 
> PHP Script #3: (update database)
> $sql = "UPDATE news SET release_date='$date', title='$title',
> description='$describe', contact='$contact', content='$test', type='$type'
> WHERE news_id=$id";
> $result = mysql_query($sql)
> 
> 
> Thanks in advance.
> 
> -Tanya
> 
> 
> 
> 
> 
> 
> 


-- 
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] Oracle Web & Php

2001-02-14 Thread kaab kaoutar

Hi!
thanks but i'm talking of oracle server! i mean instead of using pws or IIS 
or apache , may i use php with an oracle server

thanks

>From: Christian Reiniger <[EMAIL PROTECTED]>
>Reply-To: [EMAIL PROTECTED]
>To: [EMAIL PROTECTED]
>Subject: Re: [PHP] Oracle Web & Php
>Date: Wed, 14 Feb 2001 17:44:40 +0100
>
>On Wednesday 14 February 2001 11:44, kaab kaoutar wrote:
>
> > is there a possiblily to use with in an Oracle Web server ?
>
>RTFM (look at the manual, topic "Oracle functions")
>
>--
>Christian Reiniger
>LGDC Webmaster (http://sunsite.dk/lgdc/)
>
>Even idiots can handle computers, and many do.
>
>--
>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]




[PHP] mysql int_val?

2001-02-14 Thread bill

Does mySQL have an equivalent to PHPs intval()  function?

I have fields whose contents are "Less than 100", "Less than 200", "Less
than 300", and I want to do a

SELECT * FROM my_table WHERE $mynumber <= intval(myfield)

thanks,

bill


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

2001-02-14 Thread Phil Driscoll

>I am trying to get the value for a file input field to have a starting
value
>I can't seem to get it to work when using Value=\"C:\test.gif\"  does
anyone
>have any advise?

Stop trying! Any browser that would let you do this is opening up a fair old
potential security hole. I'm pretty sure it can't be done.

Cheers
--
Phil Driscoll
Dial Solutions
+44 (0)113 294 5112
http://www.dialsolutions.com
http://www.dtonline.org


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

2001-02-14 Thread Jon Haworth

It may be that the \t in your string is being interpreted as a tab.

Try using /, or escaping your \.

Cheers
Jon


-Original Message-
From: Brandon Orther [mailto:[EMAIL PROTECTED]]
Sent: 14 February 2001 17:14
To: PHP User Group
Subject: [PHP] 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] freelance developer available - perl/php/mysql/c++/linux

2001-02-14 Thread jeff saenz

hey-

If anyone is looking for a freelance web developer check me out. I have
recently become available. We're talking perl/php/mysql/c++/linux and a
bs degreee.

jeff

--
Jeff Saenz ([EMAIL PROTECTED])
Perl/PHP/SQL/Unix Consulting
http://www.planetoid.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] currency converter class

2001-02-14 Thread Adrian Murphy

anyone point me in the direction of a good currency converter class written
in php.
a euro converter will do!
thanx.


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

2001-02-14 Thread Michael McGlothlin

Which is why anyone with a clue makes any special extensions they use 
protected by the web server. Which is why I protect .inc, .cfg, .class, 
etc. It's also a good idea not to store config-type files in the web tree.

Rick Hodger wrote:

> "Jeff Oien" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> 
>> Would people like to list bad practices and also point us
>> newbies to any articles online dealing with syntax, correct
>> use of single and double quotes etc.?
> 
> 
> People who create scripts that include a need for access to a SQL database,
> meaning you need to give it a username and password then making the damn
> configuration file be called something stupid like config.inc.
> 
> When you are scripting, using anything with a .inc extension is just asking
> for trouble. If someone requests that file, it'll get passed straight to
> them. It's a .inc, which means that PHP does not know to parse it. Which
> means, that person can see your usernames and passwords. And because it's a
> public package, they're far more likely to know the path to said file.
> 
> --
> Rick Hodger
> 
> 
> 



-- 
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] foreach OCIBindByName()

2001-02-14 Thread Butler, Shaun


So I want to bind multiple values that are in an associative array

I have this code 


foreach ($binds as $key=>$value)
{
OCIBindByName($this->m_cursor,":$key",$value,-1);
}

but it only seems to work for one value in the array, the array conetents 
would be something like 

$binds["id"] = 54;
$binds["name"] = Dick;

anyone get this to work or have any idea why it works when the array only has 
one thing in it?   Thanks in advance

-- 
Shaun Butler
[EMAIL PROTECTED]
x2905

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

2001-02-14 Thread thor

Personally, I've tried quite a few, including those mentioned.
Somehow I always end up back in HomeSite (actually Cold Fusion Studio, the advanced 
brother of Homesite).

But, if you want a free editor, try scITE available at www.scintilla.org, it's free 
and available for windows and linux.

cheers,
Thor.

-- Original Message --
From: "Matt DeLong" <[EMAIL PROTECTED]>
Date: Wed, 14 Feb 2001 07:18:57 -0600

>Also try:
>http://www.textpad.com/
>
>
>
>Thanks,
>
>Matt DeLong
>Studio 77
>
>eBusiness & Wireless Solutions Provider
>615.793.2947
>www.studio77.com
>
>
>- Original Message -
>From: Brandon Orther <[EMAIL PROTECTED]>
>To: PHP User Group <[EMAIL PROTECTED]>
>Sent: Thursday, January 18, 2001 11:28 AM
>Subject: RE: [PHP] PHP Editors
>
>
>> I am not sure what OS you are running but for windows I use PHPED. Check
>it
>> out at www.phped.com
>>
>> -Original Message-
>> From: Karl J. Stubsjoen [mailto:[EMAIL PROTECTED]]
>> Sent: Thursday, January 18, 2001 7:03 AM
>> To: PHP Mailing List
>> Subject: [PHP] PHP Editors
>>
>>
>> So what editor is recommended?  I'm a little familiar with Emacs (kinda
>> cool, but I'm use to keywords and such being colored - as in Interdev).
>>
>> 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 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 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] Is this "typecast" safe?

2001-02-14 Thread Chris Lee

Try it, it should be no problem.


--


Chris Lee
Mediawaveonline.com

em. [EMAIL PROTECTED]

ph. 250.377.1095
ph. 250.376.2690
fx. 250.554.1120


""John Vanderbeck"" <[EMAIL PROTECTED]> wrote in message
011a01c096a7$f8e78080$[EMAIL PROTECTED]">news:011a01c096a7$f8e78080$[EMAIL PROTECTED]...
> I'm a little unsure of how variables are cast around in PHP, since it
seems
> like VisualBasic where I don't declare any types, the compiler just
figures
> it out.
>
> Would something like this be safe?
> $info = fread($file, filesize("blah");
> $info = explode("\n", $info);
>
> echo $info[0];
> 
>
>
> - John Vanderbeck
> - Admin, GameDesign
>
>
>
> --
> 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]




  1   2   3   >