[PHP] Re: Warnings on the bottom of the pages on Linux

2004-12-30 Thread Jason Barnett
I haven't done it (what's the point since I'm a Windows user lol), but you can change the default error handler. If it's error messages at the bottom of HTML pages you want then just choose appropriate HTML elements you need to align a message at the bottom of your page.

Re: [PHP] Warnings on the bottom of the pages on Linux

2004-12-30 Thread Jason Barnett
Is it possible to achieve this in Linux ? Any help would be apreciated. Warm regards. http://us4.php.net/manual/en/ref.outcontrol.php Call me stupid (actually please don't :) ) but how does output buffering help in this case? Are you suggesting he write an output handler? -- Teach a person

[PHP] Re: [suspicious - maybe spam] Static Keyword

2004-12-30 Thread Jason Barnett
Paul Higgins wrote: Hi, I was reading this article: http://www.phppatterns.com/index.php/article/articleview/6/1/1/ . I have a question about it. If you create this static Singleton object, does it persist in memory globally? Or is it recreated each time a .php page is requested? AFAIK

Re: [PHP] How to argue with ASP people...

2004-12-30 Thread Jason Barnett
Ben wrote: Daniel Schierbeck wrote: Tony Di Croce wrote: What points can I bring up in PHP's favor? In what areas does PHP trounce ASP? First of all, ASP doesn't run on anything but Windows servers (unless you're willing to use ChiliASP... *hiss*) Exactly! Portability is key. Not being

[PHP] Re: multiple deleting and updating raw mysql via php

2005-01-05 Thread Jason Barnett
Please do not spam the list. John sent you to the MySQL list as they are better to handle MySQL query questions. If you have a question about how to execute your specific query then you can refer to the PHP manual: http://php.net/manual/en/function.mysql-query.php -- Teach a person to

[PHP] Re: XML Filters for illegal characters

2005-01-05 Thread Jason Barnett
Douglas 1 Jones wrote: Hello, I'm wondering if anyone knows of a filter that can take data to be wrapped in XML tags and filter this data encoding any illegal XML characters or, if they cannot be encoded, remove them. The problem I have is a database that contains text that must be wrapped in

Re: [PHP] migrating to PHP 5 + Apache 2 from PHP 4.3.8 + Apache 1.3.33.

2005-01-06 Thread Jason Barnett
Symbulos Partners wrote: We know that. We understood all of that. Let me ask you this. Do you know what underlying libraries are associated with the extensions you want to use (in your list below)? If you do then you *should* be able to google for each library individually and see if that

Re: [PHP] Persistent PHP web application?

2005-01-06 Thread Jason Barnett
What you are talking about is opcode caching. While it certainly speeds things up, it can be done much faster. When you cache a file that contains a large PHP array definition, all you are caching are the instructions to create that array. On every request these instructions need to be

[PHP] Re: PHP 5 confusion

2005-01-06 Thread Jason Barnett
Don wrote: Hi, Reading the PHP 5 documentation at: HYPERLINK http://www.php.net/manual/en/language.oop5.basic.phphttp://www.php.net/man ual/en/language.oop5.basic.php, I am confused. In the example given, what is the difference between: $assigned = $instance; $reference = $instance; I

[PHP] Re: Subclassing website

2005-01-06 Thread Jason Barnett
Henning Sato von Rosen wrote: Hi all! I want to subclass a large website mainly written in PHP. The sublassing is useful for testing when you want to test a change, a bugfix or a new design, and only a few pages change. The subclass would consist of an almost empty representation of the website

[PHP] Re: On large application organization [long and possibly boring]

2005-01-06 Thread Jason Barnett
Jay Blanchard wrote: Good afternoon gurus and gurettes, If I have a large app what is the difference, other than having a very large file, of doing this switch($action){ /* several dozen cases to follow */ case foo: writing out all of the code break; } and

Re: [PHP] Persistent PHP web application?

2005-01-07 Thread Jason Barnett
Does not up to date mean the code isn't working with current releases of php 4 or 5? I'd be interested in giving it a try. I believe this is the case. AFAIK the APC library doesn't support PHP5 or at least it didn't when I looked at it. If you want to pitch in support for APC you should just

Re: [PHP] On large application organization [long and possibly boring]

2005-01-07 Thread Jason Barnett
Jamie Alessio wrote: Correct me if I am wrong, but includes (and/or requires) will get all of the code in all of the cases regardless if the case is being processed. You're wrong. The include() and require() statements are only evaluated when they are reached in your application code, so there is

Re: [PHP] On large application organization [long and possibly boring]

2005-01-07 Thread Jason Barnett
Otherwise, I'm curious as to why you're using a large switch, not that it's bad inherently IMHO, but there may be a better overall approach. /jw I don't know why *he* wants to do it, but one useful example is the MVC model (google MVC phppatterns if you're unfamiliar with the term). For a

Re: [PHP] On large application organization [long and possibly bo

2005-01-07 Thread Jason Barnett
the file is not even read! The include() method is not only more efficient but also easier to maintain as you suggest. The efficiency point is at least debatable -- opening and reading the file is actually quite an expensive operation, the cost of which may outweigh the A good point not to be

Re: [PHP] On large application organization [long and possibly boring]

2005-01-07 Thread Jason Barnett
Remember, I am old school. My first programming venture was in the 70's with FORTRAN, so all of you young bucks view programming differently than I do. I have a tendency to view things more from a C or C++ POV in I am indeed a young buck... but now I find myself moving (backwards?) because I have

Re: [PHP] On large application organization [long and possibly boring]

2005-01-07 Thread Jason Barnett
Consider yourself bytten, RTFM indeed! (BTW, this behavior is not really mentioned anywhere that I can find in TFM, it is more or less an assumption to be made from an example which would not prove the include) OK this is the last time I push the button on this one, but since you asked ;)

Re: [PHP] On large application organization [long and possibly bo

2005-01-07 Thread Jason Barnett
Bottom line: I always require_once at the top of a file for any files that I will require. No sense in doing anything else if the required files aren't there. For conditionally including files include_once() has always made the most sense to me. I'm not sure that's the best strategy: since

Re: [PHP] On large application organization [long and possibly boring]

2005-01-07 Thread Jason Barnett
Assumably, if includes were processed before the script was executed, it would show a syntax error in foo2.php. We ran Good point about the syntax error. the test (v 4.2.1) and no error was returned, so that pretty much answers the question (READ: includes are not processed until they are

[PHP] Re: unable to load curl

2005-01-10 Thread Jason Barnett
Sagar C Nannapaneni wrote: Hi, I've got a strange issue here i'm using apache2 with php 4.3.9 on win 2000. I've pointed the php extension directory to extension_dir = C:\php\extensions where all the extension dlls reside. All extensions are working and all dlls are loading properly,, What do

[PHP] Re: PHP Accellerator into Zend Engine2 by default

2005-01-10 Thread Jason Barnett
Kioto wrote: PHP is scripting language interpreted and not compiled. I want know about the difference beetwean the bytecode of JSP and ASP.NET than PHP-Accelerator. Why this extension isn't a built-in into Zend Engine parsing ? This is a better solution to comparison the performace of PHP versus

[PHP] Re: strange sessions

2005-01-10 Thread Jason Barnett
What was your question? Well if the problem is continuing sessions you need to either use cookies or append a session id to the end of a URL. -- Teach a person to fish... Ask smart questions: http://www.catb.org/~esr/faqs/smart-questions.html PHP Manual: http://php.net/manual/ php-general

[PHP] Re: unable to load curl

2005-01-10 Thread Jason Barnett
Please respond to the newsgroup and not to my personal email. quoteIs it a file access/ownership thing?/quote This is possible. Have you checked permissions for PHP user? My original question remains unanswered though and it is probably a better place to start... extension_dir =

Re: [PHP] 403 not working -- apache 2 / php5 / linux

2005-01-10 Thread Jason Barnett
the wrong permissions. Why does apache not server the 403 on the php page? Maybe this is better off in the apache list. Yeah, this is really better on an Apache list... but... http://httpd.apache.org/docs/mod/core.html#errordocument -- Teach a person to fish... Ask smart questions:

[PHP] Re: Get name of extending class with static method call

2005-01-11 Thread Jason Barnett
M. Sokolewicz wrote: try using __CLASS__ Torsten Roehr wrote: This is a good suggestion but I wonder... Torsten do you have a large heirarchy of parent classes or just one parent? E.g. Car - Sports Car - Porsche. More importantly will __CLASS__ resolve to the class name that you need... If

[PHP] Re: Get name of extending class with static method call

2005-01-11 Thread Jason Barnett
__CLASS__ contains the name of the class the method is in. In my sample it would be 'Car' and not 'Porsche'. What I don't understand is why the behaviour of debug_backtrace() has been changed!?! Regards, Torsten I have no idea why the behaviour changed (I didn't really use the function before,

Re: [PHP] Re: Get name of extending class with static method call

2005-01-11 Thread Jason Barnett
Christopher Fulton wrote: This should work for you then(maybe...i don't have php5 on my system, so it may not, but i think it would. http://us4.php.net/manual/en/function.get-class.php class Car { function drive() { return get_class($this); } } class Porshe { }

Re: [PHP] Building key sequences from strings

2005-01-11 Thread Jason Barnett
Greg Donald wrote: On Tue, 11 Jan 2005 16:10:00 -0500 (EST), Bruce Cooper [EMAIL PROTECTED] wrote: I'm trying to set up a custom sort for multi-level [i.e. nested] arrays. The problem is I can't seem to get PHP to recognize syntax such as follows $test=$test_array.'[index][next]'; Perhaps this

Re: [PHP] Re: Apache 2.0 and Sessions

2005-01-12 Thread Jason Barnett
Warning: session_start(): open(C:\WINDOWS\TEMP\\sess_8c53cb2382f75076c51ed4b3edece36b, O_RDWR) Search the archives... seriously... guaranteed you will find the answer to this. -- Teach a person to fish... Ask smart questions: http://www.catb.org/~esr/faqs/smart-questions.html PHP Manual:

Re: [PHP] Re: Get name of extending class with static method call

2005-01-12 Thread Jason Barnett
By tunnelling the call through Porsche's own drive() method debug_backtrace() will contain two traces, one of them with the correct class name. I tried using reflection but reflecting car by using __CLASS__ doesn't give any information about the classes that extend it. So this doesn't work either.

[PHP] Re: array walk and class member functions

2005-01-12 Thread Jason Barnett
Tom wrote: Hi I'm batting my head against a wall on this one... I have a class that has a constructor which sets some initial conditions, and then a public function that does some work. I want to be able to call this function from an external array_walk call, but when I try and reference it as

[PHP] Re: Generic question : migrating from java based RPC server to PHP

2005-01-12 Thread Jason Barnett
Ranjan K. Baisak wrote: This might be a very generic question. I am in a process of migrating my java based RPC server to PHP. Luckily with the help of the list I could able to make sure that all rpc and xml related function are getting excuted in Apache server. I am using Apache2 in WInXP. But

Re: [PHP] array walk and class member functions

2005-01-12 Thread Jason Barnett
indeed that page does not make it very clear, it's the generic call_back syntax, which can be used practically everywhere a callback function is expected, the array you pass can be in the form of: array($object, 'methodname') or array('classname', 'methodname') the second version allows you to

[PHP] Re: php style guides

2005-01-12 Thread Jason Barnett
Tim Burgan wrote: Hi everyone, What 'rules' do you follow about styling/formatting your PHP code? Do you follow a guide that is available online? sacred_cow_warningPlease do not flame me here, different strokes for different folks!/sacred_cow_warning If you're entirely new to coding in PHP ...

Re: [PHP] Data Enryption

2005-01-12 Thread Jason Barnett
function encrypt( $string ) { $key = '[EMAIL PROTECTED]'; No offense intended to you sir... but why do you use a static key in this way instead of using mcrypt? Please forgive my naivete regarding encryption. $result = ''; for( $i = 1; $i = strlen( $string );

Re: [PHP] geographic search engine

2005-01-12 Thread Jason Barnett
Richard: I found this post incredibly useful. Thank you! Richard Lynch wrote: If you only want close things to a given location, the curvature of the earth is pretty insignificant. ... I realized one day that at a distance of a hundred miles or less, I just didn't *CARE* about curvature of the

[PHP] Re: How to compile a script into executable file

2005-01-13 Thread Jason Barnett
M. Sokolewicz wrote: Kioto wrote: Hi all and sorry for my ignorance. I have used the Bcompiler to compiler a script into .exe file to distribuited on Windows System but i don't have any result. Can you explain how to realize with a simple example ? not. PHP scripts don't need to be compiled.

[PHP] Re: quicker arrays as func args?

2005-01-13 Thread Jason Barnett
M. Sokolewicz wrote: Justin French wrote: Hi all, Pretty sure this can't be done, but thought I'd ask any way... I have a function where the 3rd argument is an array.. function foo($a,$b,$c) { echo $a.$b; print_r($c); } Obviously the function does more than that, but anyway, I want the

[PHP] Re: PHP5 silently throwing exceptions???

2005-01-17 Thread Jason Barnett
Gerard Samuel wrote: Im currently using php 5.0.3 on a dev box, trying to figure out how to correctly use exceptions in my code. Exceptions can be A Good Thing. Per chance, I was monitoring the __autoload() function, and Im noticing that calls are being made to exception classes that I've setup.

[PHP] Re: Obtaining the base dir of a file in a web server

2005-01-17 Thread Jason Barnett
Juan Antonio Garrido wrote: Hi everybody: I use this sentence ($htmlFile = $_SERVER['DOCUMENT_ROOT'] ) for obtaining the complete route of a file in my web server, but inserts a white space to final char and i need remove it. I use the trim function but it continue there. How can i remove it?

Re: [PHP] Re: PHP5 silently throwing exceptions???

2005-01-17 Thread Jason Barnett
Gerard Samuel wrote: Jason Barnett wrote: Gerard Samuel wrote: I've debugged it down to this - //try //{ $db-connect(); //} //catch(databaseException $e) //{ //throw $e; //} The ::connect() method is supposed to throw a databaseException if a connection cannot be made. In my tests

[PHP] Re: PHP in MS-DOS

2005-01-17 Thread Jason Barnett
Shawn McKenzie wrote: Thanks, but I'm not running Windows, I'm running just MS-DOS from a bootable floppy. Hence my question :-) PHP seems to actually be the php5ts.dll. Would there be binaries for MS-DOS or is there a way to get this working? Thanks! -Shawn You darn trickster... don't tell

[PHP] Re: $_POST array not being populated

2005-01-17 Thread Jason Barnett
Bennie Foreman wrote: Hi, I am new to the PHP world so don't give me too much grief if this has a simple solution. My problem is that the $_POST array is not being populated. I have created a form and the method of that form is POST. I have started the session using session_start() but still

Re: [PHP] Re: PHP5 silently throwing exceptions???

2005-01-17 Thread Jason Barnett
Jochem Maas wrote: Jason Barnett wrote: Gerard Samuel wrote: I haven't checked the source on this one so I can't guarantee that what I've said above is true, but I believe it to be true. Someone correct me if I'm wrong (wouldn't be the first time ;) seems to me like you 'on the money'. I

[PHP] Re: PHP in MS-DOS

2005-01-17 Thread Jason Barnett
Shawn McKenzie wrote: I have not been successful with running PHP under DOS (no windows). Is this possible? TIA, Shawn For windows specific questions you are usually better off asking on the php-windows list. Yes this is possible. What is probably happening is your PHP script is executing

Re: [PHP] Trouble with Apache 2.0, PHP and MySQL

2005-01-17 Thread Jason Barnett
Greg Donald wrote: On Fri, 14 Jan 2005 12:34:53 -0800, Phillip S. Baker [EMAIL PROTECTED] wrote: Any help here would be appreciated. Simple.. your PHP doesn't have MySQL support. Rebuild it or install the rpm or package or whatever. What kind of 'Linux box' is it? Greg is right. Also it's

[PHP] Re: multiple sessions on same server/domain

2005-01-18 Thread Jason Barnett
Valter Toffolo wrote: ok i have one server with a single domain, each user have it's home with a public_html so i get mydomain.com/~user1/ and mydomain.com/~user2/ and so on. but each user might like to use sessions so how can i make it work so that sessions would have each one it's own variables

[PHP] Re: Hidden Images.

2005-01-18 Thread Jason Barnett
Rob Adams wrote: Ok - Let me restate some of this: I am creating these images in PHP. I have a script right now that accepts two images. A main one, and the one that will be hidden. These can be either jpg, gif, or png. It then outputs a png image like this: http://imagineinc.net/images/ By

[PHP] Re: How to access remote files with php?

2005-01-19 Thread Jason Barnett
Sephiroth wrote: Hi all, How to access remote files with php? For ex: $sFile = http://www.php.net/123.txt;; if (file_exists($sFile)) { $hFile = fopen($sFile); ... fclose($hFile); } Regards, Sephiroth You can use the file functions with URLs so long as you have allow_url_fopen set to TRUE in

[PHP] Re: Windows CLI and task scheduler

2005-01-19 Thread Jason Barnett
Dominic Schanen wrote: I changed the scheduled task to use php.exe instead of php-win.exe and that cleared up the errors with unloading the profile that were appearing in the application log. Could this possibly be a bug with php-win.exe and not cleaning up properly? Thanks, Dominic Honestly,

[PHP] PHP|Cruise

2005-01-19 Thread Jason Barnett
Jeremiah Johnson wrote: Hi All, I'm wondering if anyone is planning on attending PHP Tropics (www.phparch.com/tropics), and if so whether anyone would be interested in splitting a room with a non-smoker. Thanks, Jeremiah I feel really, really nerdy saying this but... I think this sounds like a

Re: [PHP] Windows CLI and task scheduler

2005-01-19 Thread Jason Barnett
Richard Lynch wrote: Dominic Schanen wrote: I've written several command line scripts to run as scheduled tasks on a Windows 2000 Server machine. They run fine, no problems. However, the application log is filling up with errors stating that windows was unable to unload my registry profile. I know

Re: [PHP] Re: Windows CLI and task scheduler

2005-01-19 Thread Jason Barnett
Richard Lynch wrote: Dominic Schanen wrote: I changed the scheduled task to use php.exe instead of php-win.exe and that cleared up the errors with unloading the profile that were appearing in the application log. Could this possibly be a bug with php-win.exe and not cleaning up properly? I think

[PHP] Re: class structure.

2005-01-20 Thread Jason Barnett
Dustin Krysak wrote: Hi there, I am pretty new to writing classes (and pretty new to PHP itself), but I was wondering what was the best format for constructing There are a few general patterns that show up time after time. They happen so often that there are formal names for them. This isn't

[PHP] Re: phppatterns.com, Nice idea, shame about the site (was Re: [PHP] Re: class structure.)

2005-01-20 Thread Jason Barnett
Ben Edwards wrote: On Thu, 20 Jan 2005 09:37:37 -0500, Jason Barnett [EMAIL PROTECTED] wrote: Dustin Krysak wrote: Hi there, I am pretty new to writing classes (and pretty new to PHP itself), but I was wondering what was the best format for constructing There are a few general patterns that show

Re: [PHP] Re: SPL Exceptions

2005-01-20 Thread Jason Barnett
[UPDATE 1-20-2005] Im making a minor additional note, just in case it comes up again. From the lack of responses I got on this, I thought I may have missed the point from your responses. But I've found some information that may or may not be correct. Speculation - The SPL exceptions that I

Re: [PHP] Re: phppatterns.com, Nice idea, shame about the site (was Re: [PHP] Re: class structure.)

2005-01-20 Thread Jason Barnett
Ben Edwards wrote: ... http://phppatterns.com/index.php/article/archive/1/ Cool, thats the type of thing. Why don't you have a link at the top with something like 'patterns directory' or alternativly have a 'about us' link with the stuff at phppatterns and use phppatterns for the paterns

Re: [PHP] Re: class structure.

2005-01-20 Thread Jason Barnett
Richard Lynch wrote: Jason Barnett wrote: Think of declaration of properties and methods as a contract. When something is public it is available to all of PHP. When it is private it is only usable by the class that you define it in. When it is protected it is a hybrid; it is usable to the class

[PHP] Re: I don't want to use include

2004-06-23 Thread Jason Barnett
Qt wrote: Dear sirs, Actually I am using virtual server and I think I have no write to use crontab/ But this methods become to me interesting. I will try to learn more about how to use crontab and where can I find that in my virtual server? This isn't exactly a PHP issue, it's your operating

[PHP] PHP-based XML utilities

2004-06-23 Thread Jason Barnett
Hey all, I've been working a lot more with XML recently and it seems like there's been a fair number of other people using XML too (based on the moderate number of XML-based problems showing up on this list). So, I thought I might build a form with PHP that helps people trying to work with

[PHP] Re: Create a function

2004-07-01 Thread Jason Barnett
$pages = array('index.html' = 'Home', 'search.html' = 'Search'); function menu($pages) { foreach ($pages as $page = $desc) { if (stristr($_SERVER['SCRIPT_FILENAME']), $page) { echo 'pa class=nav href=index.html/ab' . $desc . '/b/p'; } else { echo 'pa class=nav

[PHP] Re: Create a function

2004-07-01 Thread Jason Barnett
Jason Barnett wrote: $pages = array('index.html' = 'Home', 'search.html' = 'Search'); function menu($pages) { foreach ($pages as $page = $desc) { if (stristr($_SERVER['SCRIPT_FILENAME']), $page) { sheesh, $desc should be in between anchors echo 'pa class=nav href=index.htmlb' . $desc

[PHP] Re: Help needed

2004-07-03 Thread Jason Barnett
Completely new? Well, there are a lot of articles on the web that will get you started... just try googling for MySQL PHP tutorial. If you're willing to put in the time you can do it yourself... but there are a lot of PHPers out there that can do it for you right now. -- PHP General Mailing

[PHP] Re: Strange Session Problem

2004-07-03 Thread Jason Barnett
I don't think your problem is with the sessions at all... rather, I think you need to change the include command: [snip] include($CFG-usersdir); // ***This line causes session problems*** exit; } [/snip] try changing this to: [snip] include($CFG-usersdir); exit; } [/snip] Ever tried

[PHP] Re: web page output as we go

2004-07-03 Thread Jason Barnett
Is there any way I can tell the web browser to start trickling the data onto the page? TIA HAND :-D As Torsten so kindly pointed out to me before, your friend is the flush() function: http://www.php.net/flush Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

[PHP] frames compatibility

2004-07-03 Thread Jason Barnett
Hey all, I'm working on a project and considering splitting up the pages into frames. I'm mostly wondering are the frames implementations across browsers relatively similar? I'm thinking that I'd use 3 frames split like this: 1. Filelist of documents to edit 2. A document editor 3. A help

[PHP] Re: PHP doesnt work!

2004-07-03 Thread Jason Barnett
Gmo Baez wrote: Hello, I have a Freebsd server 5.2.1 with Apache 2.0.48 and PHP 4.3.4. After the installation everything looks normal, but after i created some PHP web files to test it, I found that PHP is not working. When i open de PHP document with the browser i only receive a blank page. But

[PHP] Re: user-defined superglobals

2004-07-04 Thread Jason Barnett
About the only user-defined superglobals are constants. If you really want to get the value of a global variable while inside of a function, you could just use GLOBAL. Or if you REALLY wanted to, you could store the variables in the $_SESSION superglobal array. But I'm curious, why do you

Re: [PHP] user-defined superglobals

2004-07-04 Thread Jason Barnett
every script. For performance reasons it would be much better if certain values or code could be cached, as is the case with the ASP global.asa file. If the files and scope was limited to an application, or Web site, then a certain level of security should be possible. Well if you're looking

[PHP] Re: Including files within a class definition

2004-07-05 Thread Jason Barnett
include (extended_methods_stuff.php); } I know that I can probably extend this class to add the extra functionality however the other generated classes rely on the name of this class so I cannot just extend this class and it's name cannot change. Is there any way to have an include prior to the

[PHP] Re: Including files within a class definition

2004-07-05 Thread Jason Barnett
I really ought to check my code before posting... but you get the idea :) ?php class generatedFoo { public function __autoload($class) { include /path/to/class/$class.php; } // other stuff } ? http://www.php.net/zend-engine-2.php -- PHP General Mailing List (http://www.php.net/) To

[PHP] Re: problems linking a DLL to Zend symbols like

2004-07-05 Thread Jason Barnett
Try php.internals -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: Sending PHP to different targeted frames

2004-07-06 Thread Jason Barnett
Robert Frame wrote: I've created a web page utilizing 3 frames (header, index, main). In the frame named 'main' I have a form setup for logging into a MySQL database. On a successful login I want to change the html in 'index' and 'main'. The active frame 'main' is easy, as the new html code will

[PHP] parse_ini_file VS. constructor with many parameters

2004-07-06 Thread Jason Barnett
I have a class definition that has a lot of private properties. These properties don't need to change often, in fact a user could probably just change the values once and forget about most of them. So this makes me think that I should use parse_ini_file and a configuration file to let users

Re: [PHP] custom tags

2004-07-07 Thread Jason Barnett
Eric Emminger wrote: Hi George, How about this? parse the html as xml and replace the component tags with whatever php/html code output that result to a file include the file from previous step There's actually a PEAR package which can help you with this as well:

Re: [PHP] parse_ini_file

2004-07-07 Thread Jason Barnett
I'd prefer the text file. It's easier to open that and change values plus they don't have to worry about PHP syntax as much. Haven't tried, but you should be able to import them as private variables for your class... Thanks for the advice John. OK, so extending this a bit: would it be better

Re: [PHP] parse_ini_file VS. constructor with many parameters

2004-07-07 Thread Jason Barnett
John W. Holmes wrote: I'd prefer the text file. It's easier to open that and change values plus they don't have to worry about PHP syntax as much. Haven't tried, but you should be able to import them as private variables for your class... Thanks for the advice John. OK, so extending this a

[PHP] Re: PHP Sessions Question

2004-07-08 Thread Jason Barnett
Ed Lazor wrote: What kind of problems could be happening server-side that would result in PHP sessions randomly disappearing? And, is there a way to log or track this information? Oh, and best of all, any recommendations on solutions? To try logging this, you probably need to make your own

Re: [PHP] Creating Rows and Columns Using for() Loops

2004-07-09 Thread Jason Barnett
I populated the guest's name statically so I can see how the loop works. The looping is wrong and it only yields 7 rows. In the first row it has 1 column of data, the second row has two columns of data, the third one has three columns of data, and so on. How do I fix it to where each date column

Re: [PHP] Re: PHP Sessions Question

2004-07-09 Thread Jason Barnett
On garbage collection, it happens sometimes within seconds and sometimes within minutes. It tends to occur in batches with lulls of 20 to 30 minutes. So, for example, I can login, navigate through 11 different pages to generate the problem, navigate 2 pages to generate the problem, and then not

[PHP] Re: php mls and realtor.com

2004-07-09 Thread Jason Barnett
Edward Peloke wrote: I have a site where the user currently enters their data into a local db, then goes to another site and enters it for the state mls, then uses realtor.com to enter it for that mls, they want one form where they can enter the date and have it go to all three. Has anyone worked

[PHP] Re: search string / query format

2004-07-11 Thread Jason Barnett
You might try checking out the Codewalkers.com previous contests. They did one a while back that was for accessing google through PHP scripts. I doubt any of them would have database support built-in, but it would give you a head start on the input fields. -- PHP General Mailing List

Re: [PHP] How to use multiple cookie statements

2004-07-12 Thread Jason Barnett
Or if you feel lazy... then you can use serialize / unserialize. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Exceptions

2004-07-12 Thread Jason Barnett
public function execute($query) { if (!$this-dbh) { $this-connect(); } // My $query has quotes in it // I try to escape the quotes $query = mysql_escape_string($query); // It causes an error $ret = mysql_query($query, $this-dbh);

[PHP] Re: PHP and HTML Conventions

2004-07-12 Thread Jason Barnett
Harlequin wrote: Hi all. I just wondered if the general convention was to use entirely PHP and simply encase HTML TAGs within that or use a mix and simply use PHP TAGs when required. It depends on the project, but when possible I prefer to have as much static content as possible for better

[PHP] Re: [Q] Using $_SERVER['DOCUMENT_ROOT'] correctly

2004-07-12 Thread Jason Barnett
Is your common script in the server root? If so then you can use something like this in the file: define('WWWROOT', basename(__FILE__)); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: Dynamic to Static

2004-07-15 Thread Jason Barnett
Ed Lazor wrote: Is anyone taking a dynamic PHP / MySQL site and storing or cacheing it statically in order for pages to display more quickly when visitors access the site? If so, what solutions are you using to achieve this? Thanks, Ed Hey Ed, there are a couple of ways that you can do it

[PHP] Re: [Q] PHP 101 -- How to check for session existence?

2004-07-15 Thread Jason Barnett
Hey Michael, I think you really only need to check the $_SESSION array, not necessarily each index. if (!isset($_SESSION)) { // login header('Location: ' . MEMBER_LOGIN_PAGE); } else { // session exists } However, if you want to have non-empty values for your session variables you should

[PHP] Re: New object model

2004-07-15 Thread Jason Barnett
Troy S wrote: Is there an ini-file setting so that objects are passed by value as in PHP 4? If so, how long is this likely to be supported? Thanks, Troy Although you can turn on zend engine 1 compatibility, if you intend to distribute your code you cannot expect this on most servers. Another

[PHP] RE: php vs. cgi app

2004-07-15 Thread Jason Barnett
Bruce, you need to start new threads when you ask a new question... a lot of people don't bother to check out a thread that's already got responses, and it really makes more logical sense to start a new one anyway (original post is below my response)... When you say cgi vs. php, I'm going to

[PHP] Re: including external C header files and libraries

2004-07-16 Thread Jason Barnett
Jeremy Booker wrote: I have a 3rd party SDK written in C. It includes a compiled .a file and a header file (.h). Is there any way that I can call the functions included in the SDK from within a php script? Regards, Jeremy Yes you can extend the Zend engine. You'll need to write an

[PHP] Re: How to tell if the file is already locked with flock()???

2004-07-16 Thread Jason Barnett
Scott Fletcher wrote: Hi! How do we tell if the file is already locked when someone use a flock() on the file?? FletchSOD Do you mean within PHP code? If that's the case then this is taken care of by the flock() function... it checks the file's status and based on the parameter(s) that you

[PHP] Re: How To capture WebCam

2004-07-16 Thread Jason Barnett
Please search google for tutorials, you can often find them when you use the right keywords. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: Trouble with include/require

2004-07-16 Thread Jason Barnett
That will try and find a file in these locations in order: /var/www/html/projects/include/db.inc ./db.inc /php/includes/db.inc And will use the first one found. I would not suggest using ini_set() inside you're scripts to adjust your paths. Curt Hey Curt, why do you suggest we don't use

[PHP] Re: finding a substring

2004-07-16 Thread Jason Barnett
C.F. Scheidecker Antunes wrote: Hello all, I need to read lines within a text file that might have a value='somevalue' string the position of value= varies from line to line but there's only one value= in each line. So what I need to do is to parse the file and find the value= and put their

[PHP] Re: How can I tell if a path is absolute?

2004-07-17 Thread Jason Barnett
Anyway it's looking a lot like I'll have to detect the Win32 build of PHP at runtime, and choose the method based on that. All because PHP doesn't have an is_absolute function or anything similarly convenient. :-/ TX A, methinks I have a competitor for a FileSystem Manager :) Perhaps I

[PHP] .lnk extension for windows files / shortcuts

2004-07-18 Thread Jason Barnett
Trejkaz, I'll make you a deal. I'll test out some code for you on my windows box and you test out my code on your linux box. I'm also building unit tests into the package so it should be easy to test everything. In any case, I started testing this out a little more on my box and noticed a

[PHP] Re: Is Function Constants the Correct Term?

2004-07-18 Thread Jason Barnett
pre ? define(LOGIN,user); define(PASS,pass); define(DB,mysql); function dblogin($login,$pass,$db) { $mysql = mysql_connect(localhost,$login,$pass); mysql_select_db($db,$mysql); } ? /pre If you're trying to protect your login credentials, you could create a class for performing mysql

[PHP] Re: Using and Echoing Session Variables

2004-07-18 Thread Jason Barnett
Harlequin wrote: Hi everyone. A few quick pointers if you have time... I've created a session, easy enough: ?php session_start(); ? I've created variables: $_SESSION['UserID'] = UserID; $_SESSION['Authorised']=yes; $_SESSION['logname'] = $logname; When a user clicks a link to a test page I created

Re: [PHP] Book Required

2004-07-18 Thread Jason Barnett
This - I think - highlights the problem. *I* have been programing for 25+ years, but only switched to PHP last year. I decided not to worry I would love to hear why you switched... although some might consider it off topic. too much about PHP4, and have only run with the Beta PHP5. PEAR DB

<    1   2   3   4   5   6   7   >