Re: [PHP] Re: php and caching

2002-11-24 Thread Robert Cummings
Ernest E Vogelsinger wrote:
> 
> At 22:38 24.11.2002, Alex said:
> [snip]
> >But my  main page, for instance mail.php, includes top.php and bottom.php.
> >But top.php must be processed each time because it prints on every page on
> >my site if the user has new messages. But if all pages are cached, then it's
> >always the cached version that's printed to the user, so even if he has new
> >mail, it doesn't show (because the page is directly taken from the cache
> >instead of being re-requested).
> >So I don't want this situation to happen, but i'd want users to be able to
> >make use of their back button without clearing the forms. Is there a
> >solution around this problem?
> [snip]
> 
> You can't have all of both worlds - either allow the browser to cache, then
> the form content will be still available from the  button. Or you
> disallow caching, then it won't.

Actually you can. Try using session variables.

Cheers,
Rob.
-- 
.-.
| Worlds of Carnage - telnet wocmud.org 4000  |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Re: php and caching

2002-11-24 Thread Robert Cummings
Ernest E Vogelsinger wrote:
> 
> If you read my complete post you'll notice that I suggested using session
> variables. The issue why I first answered the question _without_ talking
> about session variables is the fact that Alex was talking about a search
> form. Search forms are often used on "normal" static web pages _without_
> the help of sessions... that's the reason.
> 
> Rest assured I know about sessions in PHP :)

That'll teach me to form an opinion and skim :) My apologies.

Cheers,
Rob.
-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Is it possible to do this in PHP ? If it is then, how ?

2002-11-27 Thread Robert Cummings
Axis Computers wrote:
> 
> Hi,
> 
> I was wondering if this is possible to in PHP ... I am developing an
> application for a pizza place, where touch typing interface is much faster
> than using the mouse, so I was wondering if I can develop an interface with
> a calculator style keypad, and the codes entered (using something like STDIN
> in Perl), are automatically compared to the MySQL database to provide
> realtime feedback to the user, such as code 32 is hawaian pizza, and after
> the user enters code 32 Hawaian pizza get's displayed as feedback ... and
> then awaits for some other input such as size, etc...

I can't think of any reason why not. Obviously this won't be a web
application :) Though a good design could be re-used to form an online
ordering application also.

Cheers,
Rob.
-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Re: Static functions (java/php)

2003-02-09 Thread Robert Cummings
Chris Hayes wrote:
> 
> At 23:09 9-2-2003, you wrote:
> >you may find the following link interesting
> >http://www.tek271.com/articles/JavaOrPhp.html
> >
> >David Eisenhart
> I cannot suppress the feeling that someone out there has a slight prejudice
> in favour of Java!

God yes, the guy seems to think that OOP is the do all end all style of coding...
personally I like to hybrid OOP and prcoedural concepts which you can't do in
Java. Also lots of other issues that he doesn't take into consideration such
as the task at hand and the appropriateness of one solution over another for
that task.

Cheers,
Rob.
-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] long running PHP application

2003-02-16 Thread Robert Cummings
I run a fantasy MUD and I have a PHP based daemon which checks for in game
player mail and if found and the player has registered an email address, then
it sends the MUD mail out to the player's email address. The program wakes up
once a minute to check the database and then goes back to sleep. It's been
running for months without a problem.

Cheers,
Rob.

Ilja Polvanovas wrote:
> 
> Does anybody have minds about problems running long running PHP scripts as
> standalone programs (ex. like servers, daemons). For example there is a
> "simple TCP/IP server" in Sockets chapter of the Manual. Have anybody any
> ideas how long can the script run ? is there any garbage collector in PHP,
> if it is, is it enough solution? Can the script run for unlimited time ? is
> there any restrictions ? Is it stable enough ?
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Sitewide Header & Footer Includes || Trouble with Relative Paths..........

2003-02-22 Thread Robert Cummings
I don't know if it helps... but you should take a look at the ini_set()
function. Perhaps you can set the appropriate stuff using that.

Cheers,
Rob.


CF High wrote:
> 
> Hey Tom.
> 
> Thanks for the idea; however, since we're not hosting the site on our own
> server, we don't have permissions for altering the php.ini file..
> 

-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] A question of time...

2003-03-10 Thread Robert Cummings
Hi all,

I recently had a freelancing experience that has left me somewhat sour and
questioning myself. Unfortunately I don't feel I can fairly evaluate myself
and so I owuld like to put the question to my peers who populate the PHP
forum as to whether I have performed competently.

Last week I took upon myself the task of fixing a clients shopping cart
system by way of adding session support and proper user registration
validation. To give you some idea of the parameters of the job...

- VNC development connection
- live server with no error output
- no session support whatsoever
- cart had no input validation, except basic javascript
- user registration permitted clobbering of other users
  and had no validation either
- PHP code was ad-hoc sprinkled through the pages
- comments were almost non-existent

The first day I decided it would be best to mirror the server so that
development time would be minimized (VNC is terrible for devlopment). This was
done without charge to the client despite it's time saving effect.

The second day I spent 13 hours familiarizing myself with their code and
pages, and on this day I also implemented a session management library for
easily accessing and setting session data (this included hooks for permanent
cookie data storage). I also fixed the user registration process and add
security validation to ensure user information could not accidentally (or
deliberately via form hacking) be accessed by someone other than the
registrant. Previously re-registration of an existing email address regardless
of password would clobber existing customer. At this time I also fixed the
cart and ensured prepopulation of forms for updating registration information.

The third day I first wasted an hour making my changes work on their
server because they decided to rename all the files I had changed thus
breaking all of the include() paths. After that I spent another 3 hours adding
support for returning to previous page before entering any of the cart
checkout or customer registration pages. At this time a response page was also
added to thank the customer for their purchase. Of course all of this was
tested to be functional and where necessary broken pre-existing code was
replaced or fixed to provide the correct functionality.

On the fourth day I spent 3 hours adding support for input validation
feedback to the registration validation so that customer's would know exactly
why they could not continue. I also added support for a password reminder to
inform the user of their password when forgotten. This included adding the
page, adding the form, validating that the user id existed and outputting
appropriate feedback if the user did not exist - and of course testing.

All in all I spent 20 hours total for the client at a rate of $40 USD/hr
which I believe is on the low end of freelance. I myself have 3 years
experience devloping PHP web applications. So the question I ask is whther
this time frame is reasonable, or am I just a slow crappy programmer that is
ripping these people off? They seem to think I should have had this done in
just a few hours, but my experience thus far indicates to me that they got
just service. Additionally it seems before I took the job, they had went
through several other PHP developers would said they couldn't do it (and I
don't really blame them considering the VNC connection and lack of comments or
error feedback).

If it turns out that I am incompetent, then I will happily send them a
bill for zero hours, otherwise I would like to take comfort that I am not
ripping them off.

Sincerely,
Robert Cummings
-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] A question of time...

2003-03-10 Thread Robert Cummings
"CPT John W. Holmes" wrote:
> 
> [snip]
> > If it turns out that I am incompetent, then I will happily send them a
> > bill for zero hours, otherwise I would like to take comfort that I am not
> > ripping them off.
> 
> Just my humble opinion, of course, but I think you did the job quickly
> considering what you were given to start with. $40/hour is pretty cheap,
> too.
> 
> No one likes paying and it always seems like a "little change" to those on
> the outside.
> 
> It would of been hard to nail down a contract given the circumstances, but
> that's what you should have done. Always get it in writing. If you agreed on
> $40/hour before hand without a "maximum" number of hours where you had to
> get back to them, then they have to pay.

Thanks, I did estimate 20 to 30 hours for them after I had set up the mirror
server and before the actual work began. At the same time I asked if they wanted
me to stop to which they replied that I should continue.

Cheers,
Rob.
-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] ^M in PHP

2003-03-13 Thread Robert Cummings
I know there's a binary for doing exactly that in linux but I can't for the
life of me remember the name. If you're text editor is any good you should
be able to do a search and replace for "\r" with "". I use joe, but that's
hardly the editor of choice for most.

Cheers,
Rob.

Liam Gibbs wrote:
> 
> I'm downloading a file from Windows to Linux through PHP. Understandably,
> there are ^Ms at the end of my lines. Is there a PHP function I can use to
> delete them?

-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Do query strings get spidered by Google?

2003-03-16 Thread Robert Cummings
I don't think Google follows URLS to every variation based on a query string.
I know to have some of my pages indexed I had to rewrite the URL so the query
string looked like a directory path.

Cheers,
Rob.

-{ Rene Brehmer }- wrote:
> 
> Judging from how Google has indexed my site, it simply follows all links
> it encounters on the site, since I atleast can find several of my pages
> that are a bunch of links deep inside the site...
> 
> Rene
> 
> On Sat, 15 Mar 2003 10:26:05 -0700, Mike Hillyer wrote about "[PHP] Do
> query strings get spidered by Google?" what the universal translator
> turned into this:
> 
> >I am trying to decide how to lay out a site with a lot of articles, and I am
> >wondering if query strings get spidered by Google. I was thinking it would
> >make for an easy search engine if I could put the articles in fulltext
> >searchable MySQL columns, but I do not want to lose the ability of search
> >engines to spider them. Otherwise, I believe there is a way to convert the
> >quert string to a trailing / so it looks like directory structure, does
> >anyone have info on that?
> 
> --
> Rene Brehmer
> 
> This message was written on 100% recycled spam.
> 
> Come see! My brand new site is now online!
> http://www.metalbunny.net
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Snarl, hiss, growl (frustration)

2003-07-04 Thread Robert Cummings
On Fri, 2003-07-04 at 12:44, Rasmus Lerdorf wrote:
> The difference is that you are getting a string from the file and not
> casting it to an integer.  You could also have fixed it by doing:
> 
>   $counter = (int) fread(...);

The cast isn't necessary, PHP happily transforms it for him when he
applies the ++ operator.

Cheers,
Rob.
-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Snarl, hiss, growl (frustration)

2003-07-04 Thread Robert Cummings

On Fri, 2003-07-04 at 13:13, Rasmus Lerdorf wrote:
> On Fri, 4 Jul 2003, Robert Cummings wrote:
> 
> > On Fri, 2003-07-04 at 12:44, Rasmus Lerdorf wrote:
> > > The difference is that you are getting a string from the file and not
> > > casting it to an integer.  You could also have fixed it by doing:
> > >
> > >   $counter = (int) fread(...);
> >
> > The cast isn't necessary, PHP happily transforms it for him when he
> > applies the ++ operator.
> 
> ;)  You are sure about that right?  Or else you wouldn't have posted this
> to 1000's of people.

I am absolutely sure of thus since I cut and pasted the original problem
code to a shell script to test. This was before I noticed the answer
mentioning the closing if block had already been posted. 

> 
> So what do you think this will output?
> 
> $a = "123\n";
> $a++;
> echo $a;
> 
> Try it.

Undoubtedly the above will work as we both know, the output will be
"123"; however, if you look at the original code in question, there is
no "\n" tailing the output written to the counter file and thus the
increment works fine (unless of course when he created the file to begin
he had a newline - something I did not do in my test :)

Cheers,
Rob.
-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] does anyone know how to tell if a PHP scrip is beingexecuted from the command line not a server HTTP request??

2003-07-06 Thread Robert Cummings
I don't know if it is a great way, but it has worked for me for a long
time now. I make the following test:

isset( $HTTP_SERVER_VARS['SERVER_PORT']

Cheers,
Rob.

On Sun, 2003-07-06 at 04:48, Jeffrey D. Means wrote:
> I am trying to write a script but for security I need to verify that it is
> not executed by a web server.  At this point I have just placed it outside
> the htdocs tree but would like to build into the script a test to die if it
> is being executed by a web server.
> 
> Thanks
> 
> Jeff Means
> CIO for MeansPC
> [EMAIL PROTECTED]
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] [ML] Are there any announcement rules for this list? (wasRe: [PHP] Re: NEW SPAMMER ...)

2003-07-08 Thread Robert Cummings
Personally I like to hear about new releases of PHP related products
here too. For how often it occurs, I can't see how 1 in 80 emails a day
is really going to impact the list. Especially since 10 to 20 emails are
generated in support or indignation for such announcements :)

+1

Cheers,
Rob.

On Tue, 2003-07-08 at 20:59, Joel Rees wrote:
> > I've just read the other thread about spammers and such.
> > Indeed, my announcement - even for a free platform - was not complying
> > to the posting guidelines as it not a response to any questions asked.
> > 
> > I apologize.
> 
> Where? The only guidelines that I can find for posting to this list are
> at 
> 
> http://www.php.net/mailing-lists.php
> 
> I see nothing there at all concerning announcements.
> 
> I personally appreciate brief announcements of related products,
> regardless of licensing. A tag, [ANNOUNCEMENT] or [ANN], in the subject
> line would be helpful, but that's the only comment I have on the subject.
> 
> If the list maintainers do have rules or guidelines about announcements,
> maybe one of them would speak up now?

-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Need hep with mysql function

2003-07-10 Thread Robert Cummings
This has been discussed a lot on many of the PHP forums in the past few
weeks. Mysql is not longer bundled with PHP. You need to use the
configuration option and set the location of your mysql base directory.

Cheers,
Rob.

On Thu, 2003-07-10 at 21:30, zlut arch wrote:
> Hi,
> 
> I encountered a problem that I have never seen in my 3 years of using php 
> and mysql. Yesterday, I installed MySql, php5, and apache2 on my new laptop. 
> php5 worked fine with apache2, and MySql was working fine on its own. But 
> when I tried to connect to MySql database, I get a strange error message: 
> "Fatal error: Call to undefined function: mysql_connect()". I thought this 
> is very strange since mysql_connect() is a built-in function in php5. How 
> can it be an undefined function? Does anyone know what is going on?
> 
> Thanks,
> 
> Zlutarch
> 
> _
> Add photos to your messages with MSN 8. Get 2 months FREE*.  
> http://join.msn.com/?page=features/featuredemail
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Code and Good Design Methods

2003-07-13 Thread Robert Cummings
Let's be honest, XSL is is one big logic step itself -- moreover it's a
whole other language to learn.

Cheers,
Rob.

On Sun, 2003-07-13 at 02:07, Ray Hunter wrote:
> Also u could build your own system that is php xml and xslt based. That
> will really help you separate the logic from the presentation.
> 
> Check out (dom)xml and (dom)xslt. Sometimes there is still logic in the
> presentation with template systemswith xslt however, it might be to
> much for the design (interface) guys.
> 
> Those should help u out.
> 
> --
> BigDog
> 
> 
> On Sat, 2003-07-12 at 20:08, Dan J. Rychlik wrote:
> > I am reading PHP and MySQL web development 2nd edition book.  Chapter 6 talks 
> > about displaying dynamic web content using class objects.  For the type of project 
> > that I am building, this is not optimal.  How do I keep my self from having html 
> > mixed with my PHP code?  In other words how do I serperate the two.  I need to 
> > concentrate on writing good code and not designing a nice looking website.  
> > (someone else is going to do that)  
> > 
> > Can I assign include() statements to a variable ?  How would you guys accomplish 
> > this?
> > 
> > Thanks so much in advance,
> > Daniel 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Passing $Vars between 2 php pages

2003-07-16 Thread Robert Cummings
Use the GET method (URL parameters). If you want to pass (foo=5) then
do the following:

 A link label 

Cheers,
Rob.

On Wed, 2003-07-16 at 12:44, Valentin wrote:
> Hi,
> is any way to pass a $Var from one to other php pages without using 
> and Cookies?
> 
> Thanks,
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Test (ignore)

2003-07-16 Thread Robert Cummings
Some of my mail hasn't appeared on list for a while,
just testing if connection is working.

IGNORE THIS MESSAGE :)

-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Too much of $GLOBALS[] a problem??

2003-07-17 Thread Robert Cummings
Rather than having the following scenario:

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

The following would be much cleaner and portable while still allowing
the ease of use of $GLOBALS based configuration:

$GLOBALS['myProjectName']['foo'] = 'foo';
$GLOBALS['myProjectName']['fee'] = 'fee';

Cheers,
Rob.


On Thu, 2003-07-17 at 22:58, Curt Zirzow wrote:
> Ow Mun Heng <[EMAIL PROTECTED]> wrote:
> > Hi All,
> > 
> > Just a quick question on this. In my scripts, I'm using A LOT Of
> > $GLOBALS['my_parameter'] to get the declared values/string. 1 example  below
> > :
> > 
> > function display_menu_html()
> > {
> > echo ''."\n";
> > echo ''."\n";
> > echo "\t".''."\n";
> > echo "\t".'' . $GLOBALS['home'] . "
> >
> > [...]
> >  
> > }
> > 
> > This isn't really a Problem but.. is it bad programming practice?? Or I
> > should just write another function that can return the values/string?
> 
> 
> yes and no, that is rather a debatable question.  
> 
> To make my functions that echo stuff cleaner I usually do stuff like:
> 
> function show_html() {
>  
>   
> 
>   
> 
>   
> 
> ?>
> }
>  
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] classes v. functions

2003-07-18 Thread Robert Cummings
On Fri, 2003-07-18 at 18:19, Andu wrote:
> 
> Say I have a database class with all kinds of functions for connection, 
> data manipulation, errors, etc:
> 
> $db = new db_sql;
> $db->connect();
> $db->do_this();
> $db->do_that();
> 
> How would that be different from an include file with a bunch of functions 
> doing the same thing?
> Is there any performance benefit one way or the other?
> I used EZ_Sql which is cool but didn't seem to speed things up in 
> comparison to the said include file.
> Still don't see the beef.
> 

Using your above example, the above would keep all of the internal data
that keeps track of the resource ID (for the connection), the current
result set, and the current row, etc. within the object instance scope.
Thus everytime you invoke a method on the object it works with it's own
set of data. In all honesty you can do this with functions also, but
then you would have something like the following:

$dbId = db_connect();
$data = db_do_this( $dbId );
$moreData = db_do_that( $dbId, $data )

As you can see this quickly can become cumbersome becaus eof the lack of
encapsulation. However, the OOP paradigm goes even further. Lets imagine
you now want log all use of your functions (methods :). To do this in
OOP you just extend the class and override the methods while still
allowing invocation of the inheritted methods. Thus your usage of your
new object code would look something like follows:

$db = new custom_db_sql;
$db->connect();
$db->do_this();
$db->do_that();

Whereas the function code would resemble the following:

$dbId = custom_db_connect();
$data = custom_db_do_this( $dbId );
$moreData = custom_db_do_that( $dbId, $data )

As you can see updating the function based code required more work. It
wasn't as modular since it couldn't take advantage of inheritance. This
is a trivial example btw, it's not perfect since there are books and
books written on this topic and I'm obviously glossing over a lot of
details. Once you get into design patterns you'll also see other
advantages of using objects versus functions. I hope this helps a teeny
weeny bit.

Cheers,
Rob.
-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: classes v. functions

2003-07-20 Thread Robert Cummings
On Sun, 2003-07-20 at 02:28, Andu wrote:
> 
> One shouldn't apply industrial theories to just everything.
> 

Object Oriented Design is not an industrial theory. It's a tried and
true practice with over a decade of computer science and practical use
behind it. Procedural programming is a subset of Object oriented
programming. Someday you'll need the higher level features OOD offers,
but until then it probably just won't make sense unless you actually go
and learn the principles from a good book or teacher. Trying to
formulate an opinion about OOD from the PHP mailing list is like trying
to form an opinion about nuclear physics from your buddy that watched
some show on nuclear power plants (maybe not that extreme, but hopefully
you get the point).

Cheers,
Rob.
-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] controlling winamp with COM

2003-07-21 Thread Robert Cummings
Depending on exactly how you intend to use this technology there are
several ways to go about it. One is to create a PHP C extension that you
compile into the PHP engine itself -- this I imagine can hook into the
API to control the open application. Then you can choose to use these
new extension functions in either a shell script to control the winamp
program from the current computer (or shell-script on a remote computer
that you SSH or telnet into), or you can create a PHP-based Web front
end to control the winamp application. The other alternative, is to just
have the PHP script call existing programs than can access the API on
the OS via the backtick or system(), etc... functions (this solution was
mentioned below :). It might even be possible that Winamp itself
provides hooks to a running instance of itself via command line
parameters (one can hope) which would simplify the task greatly.

Cheers,
Rob.


On Mon, 2003-07-21 at 23:40, Diego Fulgueira wrote:
> Look, i don't know if you already received a reply for your message, but i
> can tell you i know a lot about PHP and i have absolutely no idea how to do
> this.
> 
> I will just remind you that PHP is intended to be used as a server to client
> technology and that it might have some indirect interaction with winamp, but
> only on the server.
> 
> What you need is a lower level techonolgy. To do this, i would try to
> approach the problem with C/C++ or VisualBasic and then build an interface
> to make it work from PHP. But this would be kinda messy.
> 
> Good luck. I really hope you don't give up on this, because i think noone
> has ever done anything like it, and is always good to know that we people on
> this mailing list, are each day more powerful.
> 
> CHEERS.
> Diego.
> 
> - Original Message -
> From: "John Herren" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, July 21, 2003 9:25 PM
> Subject: [PHP] controlling winamp with COM
> 
> 
> > Is there any way to control an open winamp application in php? I want to
> > use php as a scheduler to play Winamp. The API has system calls to do
> > so, but I don't know how to implement the windows calls.
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] bug in addslashes command?

2003-07-22 Thread Robert Cummings
I recently upgraded from 4.1.2 all the way to 4.3.2 without a single
bump -- your experience may vary :)

Cheers,
Rob.

On Tue, 2003-07-22 at 16:11, Merlin wrote:
> there is definatelly a bug in 4.2.1 since this sentence:
> 
> Argostoli is the 'capitol' of Kefalonia / Kefallinia. One of the Greek
> Ionian islands.
> 
> will be escaped by - instead of  \
> 
> other examples run fine.
> 
> Does anybody know if there are any serious changes between the new php
> version and 4.2.1
> Can I upgrade without feering loosing functionality?
> 
> Thanx for your help,
> 
> Merlin
> 
> "David Nicholson" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
> news:[EMAIL PROTECTED]
> Hello,
> 
> This is a reply to an e-mail that you wrote on Tue, 22 Jul 2003 at
> 20:51, lines prefixed by '>' were originally written by you.
> > Hello there,
> > I am running php 4.2.1 on a linux machine. Not sure, but I think
> there
> > might
> > be a bug in there.
> > While putting data into the db I do get an error in a verry rar
> case.
> > All
> > values are escaped by addslashes commands.
> > This is the original string:
> > the 'capitol-' of Kefalonia
> > This is the string after addslashes:
> > the 'capitol-' of Kefalonia
> > Which leaves the last ' unescaped.
> 
> On my PHP 4.3.2 installation, echo addslashes("the 'capitol-' of
> Kefalonia"); displays:
> the 'capitol-' of Kefalonia
> which appears to be correct.
> 
> David.
> 
> --
> phpmachine :: The quick and easy to use service providing you with
> professionally developed PHP scripts :: http://www.phpmachine.com/
> 
>   Professional Web Development by David Nicholson
> http://www.djnicholson.com/
> 
> QuizSender.com - How well do your friends actually know you?
>  http://www.quizsender.com/
> (developed entirely in PHP)
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] USB Hard Drive

2003-07-23 Thread Robert Cummings
On Wed, 2003-07-23 at 12:49, Digital Directory USA, Inc wrote:
> I need to get a USB Hard Drive to "Auto Run" a flash movie when plugged
> into a USB port on all platforms of a PC (Win98, 2000, XP, ME). Can 
 ^^^
Off Topic but I must protest...

You forgot Linux in your list -- a gross oversight I'm sure!

Cheers,
Rob.
-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] I'm really getting annoyed with PHP

2003-07-23 Thread Robert Cummings
On Thu, 2003-07-24 at 23:24, Beauford.2005 wrote:
> It's obvious though that PHP can not handle it. This is why I am forced
> to use javascript. I have already spent a week on this and am not going
> to waste any further time. I have posted all my code and if someone can
> see a problem I'll look at it, but it just ain't worth the effort at
> this point.

PHP handles it fine -- I've been using it in my code for years now
without a single hiccup. With thousands (millions?) of others using it,
the assertion that PHP cannot handle "it" seems unequivocally incorrect.
That said it is more likely than not, that you yourself are unable to
handle "it". Furthermore, your style and mannerisms remind me of a
troll.

Cheers,
Rob.
-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] PHP should know my data!

2003-07-24 Thread Robert Cummings
Unfortunately I don't think some people "got" the joke. Next thing you
know their going to complain that PHP should have told them the
punchline ;)

Cheers,
Rob.

On Thu, 2003-07-24 at 18:17, Chris Hubbard wrote:
> Now this is funny.  John, you've captured the irony of a number of recent
> posts.  Congrats.  Been a while since I laughed this hard.  Cobol.  egad.
> That's a nice touch.
> Thanks for the levity.
> chris
> 
> 
> -Original Message-
> From: John Manko [mailto:[EMAIL PROTECTED]
> Sent: Thursday, July 24, 2003 2:04 PM
> To: PHP General
> Subject: [PHP] PHP should know my data!
> 
> 
> I just wrote a web app, but I'm completely disgusted with PHP.  The
> application works great, but PHP is not smart enough to know what data
> belongs in my database.  Really, I have to enter the stuff in myself.  I
> spent 2 long days writing this (sweating and crying), and you mean to
> tell me that it doesn't auto-populate my database information?  Come on,
> people!  Data entry is the thing of the past!  Maybe I'll convert my
> codebase to COBOL or something. At least, it has proven experience with
> user data!  Sometimes I wonder how long this "innovative" technology
> will last when there are incompetent languages like PHP, Perl, and
> Java.  Color me disappointed.
> 
> John Manko
> IT Professional
> 
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] How is this possible?

2003-07-27 Thread Robert Cummings
ASP merely outputs HTML. His table is basic HTML dynamically rendered
perhaps by an ASP component. This is also trivial to do in PHP.

Cheers,
Rob.


On Sun, 2003-07-27 at 18:38, Ryan A wrote:
> Hi,
> I am trying to get my data into a very similar layout as this:
> http://hostfilter.com/ComparePlan.asp?IntVal1=389&IntVal2=546&IntVal3=605
> see the table with the plans...how is he getting that in one table? what
> kind of logic is that? the best I can do is for each column I have to use
> another table (nested tables) but he has somehow managed to get all in
> one... is this a special ASP thing?
> 
> This is my implemption of it:
> http://bestwebhosters.com/compare.php?id%5B%5D=1&id%5B%5D=2&id%5B%5D=4&id%5B
> %5D=5&id%5B%5D=13&type=1
> 
> Its much slower, because it uses more tables and nested tables...but its in
> php :-)
> 
> 
> I just cant understand it...any ideas?
> 
> Cheers,
> -Ryan
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Stop neurotic posting

2003-08-07 Thread Robert Cummings
On Wed, 2003-08-06 at 16:36, Chris Sherwood wrote:
> 
> or what does it take to actually give a reasonable answer... if I am gonna
> be rude I  wont say anything... doesnt any one remember their mother telling
> them if you dont have anything nice to say dont say anything at all?
> 

That kind of thinking leads to things like Hitler :| If we never say
anything then it becomes the norm for people to continue their
behaviour. Currently the question being debated is what constitutes poor
behaviour/etiquette within this mailing list. While I agree that this
forum is primarily for answering questions -- I disagree that it is for
answering silly little questions that would be common knowledge if the
asker had bothered to read any tutorials or documentation -- most
especially when it appears that the poster didn't even bother to do any
kind of searching for themselves. I mean really, questions like "does X
do Y" is often as simple as writing 1 to 5 lines of test code which is
probably shorter than the email itself and doesn't pollute the mailing
list with 5 to 10 replies of "yes" or "no".

Cheers,
Rob.
-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Correct Coding

2003-08-07 Thread Robert Cummings
Looks good.

Cheers,
Rob.

On Thu, 2003-08-07 at 13:09, Christopher J. Crane wrote:
> Is this the best way to do this?
> 
> if(isset($Task) && $Task == "Add") { Do something }
> 
> I want to check if the variable is set and if so, if it is "Add".
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] detecting referer

2003-08-08 Thread Robert Cummings
You can get referrer information from the following:

$_SERVER['HTTP_REFERER']

This isn't foolproof though since the user can usually set in their
browser whether to have this information sent.

Cheers,
Rob.

On Thu, 2003-08-07 at 11:59, Creative Solutions New Media wrote:
> Hello,
> 
> Bit of a newbie question I guess.
> 
> What is the best way, using php, to detect information about the referrer to
> a page.  Is this possible/difficult using PHP?
> 
> Thanks,
> 
> Tim Winters
> Manager, Creative Development
> Sampling Technologies Incorporated (STI)
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
> W: 902 450 5500
> C:  902 430 8498
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Question on class syntax

2003-08-09 Thread Robert Cummings
The :: operator is used to access a static class method. In other words
you can use the class method without creating an instance of the class.

Alternatively you could have used the following less effcient syntax:

$cleaner = new htmlcleaner();
$value = $cleaner->cleanup( $value );

Cheers,
Rob.


On Thu, 2003-08-07 at 14:25, Luis Lebron wrote:
> I am currently using a php class that uses the following syntax:
> 
> $value= htmlcleaner::cleanup($value);
> 
> 
> What exactly is the :: used for? Is there a different syntax for :: ?
> 
> thanks,
> 
> Luis R. Lebron
> Project Manager
> Sigmatech, Inc

-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] htmlspecialchars() and HTML code

2003-08-10 Thread Robert Cummings
You're safe because when you apply htmlentities() these will be doubly
marked up. So if the file contains "&" then the browser will receive
"&".

HTH,
Rob.


On Fri, 2003-08-08 at 11:57, Thaddeus J. Quintin wrote:
> CPT John W. Holmes wrote:
> 
>  > Try this:
>  >
>  > This is  text
>  >
>  > If you submit that "text" and then print $_REQUEST['text'], you'll 
> see that
>  > you have
>  >
>  > This is  text
> 
> Ok, but that only makes me realize the further extent of the problem.
> 
> If the HTML file that they upload has '<' or '>' entities, then 
> these characters will be displayed in the text area as '<' and '>' 
> symbols.  So when  the text is submitted from the textarea, all of the 
> user's HTML entities will have been destroyed.
> 
> Any thoughts on this problem?
> 
> Thaddeus
> 
> CPT John W. Holmes wrote:
> 
> > From: "Thaddeus J. Quintin" <[EMAIL PROTECTED]>
> > 
> >>I'm working on a site where users have the option to type HTML code into
> >>a textarea, or upload HTML code from a local file which is then
> >>displayed in the text area.
> >>
> >>The obvious problem is that an uploaded file that contains a closing tag
> >>for a textarea can wreak havoc and eat up the rest of the page.  So, in
> >>order to get it to display properly, I called htmlspecialchars() on the
> >>string and that works fine.
> >>
> >>After any editing has been done, I can convert the text back using
> >>html_entity_decode().  This seems to be a decent solution to the problem.
> >>
> >>However, if the user has included htmlentities in their code, won't
> >>these get converted when I call the decode function?  Even something
> >>simple like using a '<' symbol for a little arrow.  This would need to
> >>remain a '<' and not get converted when html_entity_decode() is called.
> > 
> > 
> > You should not have to call html_entity_decode() at all. You encode the text
> > to get it to show in the text area. When the form is submitted, you get the
> > text exactly as it appears in the textarea. in other words, without the html
> > entities.
> > 
> > Try this:
> > 
> > This is  text
> > 
> > If you submit that "text" and then print $_REQUEST['text'], you'll see that
> > you have
> > 
> > This is  text
> > 
> > ---John Holmes...
> > 
> > 
> > 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Container Functions Continued.....

2003-08-11 Thread Robert Cummings
On Sun, 2003-08-10 at 18:04, Mike Morton wrote:
> Thanks to everyone who responded to me so far, but I fear that I have not
> explained myself too clearly.
> 
> First of all, I understand the argument about having a testing, development
> and live servers, however, in the real world not every client can afford
> that hardware and it is not always feasable for smaller websites to have all
> the equipment.  

This is usually solved with a virtual host which has virtually no impact
on your system -- but provides countless benefits over having a
production and test server rolled into one. I don't see why hardware
would be an issue.

> 
> So, lets base this on the fact that there is one server that has one URL,
> One IP and all development/testing is done on the live website.
> 
> Now that I have that out of the way.
> 
> What I am trying to accomplish is a function that can contain code blocks,
> like an if statement.  Something that would operate like:
> 
> developer_execute() {
>  execute this code only
> }
> 
> Where the function developer_execute would be defined as:
> function developer_execute() {
> if(getenv("REMOTE_ADDR")=="000.000.000.000") {
> %body
> }
> }
> 
> Where the %body is the actual code represented by 'execute this code only'
> above.
> 
> So, the question is, is there a way to create a function like an if function
> that does not only reply on the arguments between the ( and ) in the
> function call?

Forgive me if I'm ignorant, but it appears that you've answered your own
question in the above example -- the case being that it is indeed
possible.

Cheers,
Rob.
-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Freelance code optimizations

2003-08-11 Thread Robert Cummings
In that case it makes perfect sense since a concatenation is not
actually performed. The loops stuff though might be more tricky to
determine reasoning. I imagine it has to do with the execution tree and
references being created at various stages. Probably the for loop has an
extra step or two which over a large loop can produce noticeable
results.

Cheers,
Rob.

On Mon, 2003-08-11 at 14:06, Chris W. Parker wrote:
> Robert Cummings <mailto:[EMAIL PROTECTED]>
> on Monday, August 11, 2003 10:55 AM said:
> 
> > Or are you mistaken in assuming the
> > following works when perhaps you use this style as part of an echo
> > statement normally. 
> 
> I apologize. I did not copy and paste my the code I used in my test file
> into my email.
> 
> So you are right, I was using it in an echo statement and not during
> assignment. That's why you got the parse error.
> 
> 
> Chris.

-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP - Interpreted or Compiled Language

2003-08-14 Thread Robert Cummings
While is is true that the opcodes cannot be run as machine code, the
opcode (bytecode) can be run on any machine which has the PHP engine (or
an opcode reader). Does Java not call itself a compiled language? If so
then the simple addition of PHP Accelerator, or Zend Accelerator should
be sufficient to call it a compiled language. Anyways I can't really say
for sure, traditional scripting languages didn't create such blurry
lines between compiled and interpreted :)

Cheers,
Rob.

On Thu, 2003-08-14 at 10:27, Curt Zirzow wrote:
> * Thus wrote Binay Agarwal ([EMAIL PROTECTED]):
> > Thanks jay for quick response
> > 
> > I'll tell you what really forced me to go in the matter of interpreted or
> > Compiled language.
> > 
> > In the heart of PHP 4+  is Zend Engine which compiles (often says) the php
> > code into some intermediate code called opcode and then Zend executor
> > executes them converting these opcodes to machine language. right??
> > 
> > If it is so why PHP is an Interpreted Language.
> 
> My understanding is that the opcode'd file is just a list of
> opcodes (for zend) to interpret.  You can't take the opcode'd
> file and run it on your machine; thus it is still interpreted.  

-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP Session Problem!.....urgent!

2003-08-14 Thread Robert Cummings
The root of your problem is that sessions generally do not traverse
multiple domains. A possible solution is to embed an image in each of
the servers which references a PHP script in the other server, and while
doing so passes the sessionID along.

On server abc.foo.org you might have the following:

http://xyz.foo.org/sessionMap.php?sessionId=123456789"; />

While on server xyz.goo.org you would have the following:

http://abc.foo.org/sessionMap.php?sessionId=123456789"; />

What this does is create a session on the other server even though the
user has not "seemingly" visited it. By passing the original session ID
you indicate the session ID that should be used for the new session and
thus bypass any session ID generation. Then if the user visits that site
they will already be set up, and provided the session data is stored in
the same database for each site then all information will be
transferable.

The image which accesses the other server's sessionMap.php script would
only need to be output to the browser when a new session is created.

HTH,
Rob.


On Thu, 2003-08-14 at 13:29, [EMAIL PROTECTED] wrote:
> Dear Sir,
> 
> I've been using PHP for business and personal use for a while now, and I
> have to admit, I'm not just a user anymore and I am a fan. but it's been a
> while I came across a problem : I use session variables a lot for security
> purposes but I notice that PHP doesn't hold the session variables when I
> go from one URL to another URL.These are 2 different domains but located
> on the same server and in my php.ini I set a separate temp folder outside
> of both of those domains' folders,
> do you have any idea how I can solve this problem ?...so far the only
> solution I've found is that I pass the session ID to that page that's on
> the other server and then I can get access to session variables. It's just
> that if the person who is already logged in my system and they type in a
> different URL which is part my system also it's just a different URL , I
> lose them.
> 
> Any help is apprieciated,
> 
>  Sincerely
>Babak P.
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Correct Coding

2003-08-14 Thread Robert Cummings
That can generate an error if $Task was never assigned a value.

Cheers,
Rob.


On Thu, 2003-08-07 at 13:17, Juan Nin wrote:
> > Is this the best way to do this?
> > if(isset($Task) && $Task == "Add") { Do something }
> > I want to check if the variable is set and if so, if it is "Add".
> 
> why don't just do:
> 
> if($Task == "Add") { Do something }
> 
> regards,
> 
> Juan
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Stop neurotic posting

2003-08-14 Thread Robert Cummings
On Wed, 2003-08-06 at 15:45, Chris W. Parker wrote:
> 
> The reason I noted google didn't know what the heck I was talking about
> was because we're assuming the person asking the question (who btw is
> not me) wouldn't be able to come up with "php find a string in a
> string". That's the whole point! It's not that the person is lazy or
> stupid, it's that the person DOESN'T KNOW HOW to ask the question

As I stated already, they'd know how to ask the question if they
bothered to read a tutorial or a book -- maybe we should have a
different mailing list such as:

[EMAIL PROTECTED]

or maybe

[EMAIL PROTECTED]


> 
> u r such teh 1337 h4x0r. thx 4 playing!

Thanks... moron!

Cheers,
Rob.
-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Stop neurotic posting

2003-08-14 Thread Robert Cummings
Your example is ridiculous -- it looks like you want a search egnine to
properly phrase the question for you.

This works and is more concise and clear: php find a string in a string

Really, I don't think people should be using the mailing list in lieu of
purchasing a book on PHP or reading one of the many online tutorials.
After you've acquainted yourself with the language, the syntax, and some
coding style (I hate the "anyone see what's wrong with this [insert your
favourite piece of self coded 1000 character long mess here]), then by
all means ask questions which are troubling to you. I rarely answer
questions anymore because I find that many people want the coders on the
PHP mailing list to do their work for them because they're too lazy to
bother doing some research. Also to get back to the problem of wording
queries wrong in google or whatever -- maybe trying a fwe different
queries would help. Anyways this is all just my humble opinion.

Cheers,
Rob.


On Wed, 2003-08-06 at 14:44, Chris W. Parker wrote:
> Jennifer Goodie 
> on Wednesday, August 06, 2003 11:27 AM said:
> 
> >> and in any event they're often things I
> >> wouldn't have thought about looking up anyway.
> > 
> > 
> > I love how the argument for not doing research is not having the
> > time/not wanting to waste time.  That is just lazy and selfish.
> 
> I totally agree with you on the time factor. The answerers time (for
> lack of a better word) is more important than the questioners time
> (again, for lack of a better word).
> 
> But I think a good point that the above quote contains is "in any event
> they're often things I wouldn't have thought about looking up anyway".
> 
> I find that, although I know my question is rudimentary, I don't even
> know how to search for it on google or in the archives. I don't know
> what a function is called, or what it /might/ be called and therefore my
> only recourse is to describe what I'm thinking (or trying/wanting to do)
> to another human being that can better interpret my question than google
> or the archives can.
> 
> I'll even search groups.google.com by asking my question in as few words
> as possible. Sometimes it works, but sometimes it doesn't, and mainly
> because people don't always ask the same question the same way.
> 
> Here's an example...
> 
> "How do I return a string based on certain criteria? For example I've
> got the string 'magical mystery tour' and I want to return the word
> 'myst' if it's found within the original string."
> 
> A bad answer would be:
> 
> "RTFM http://php.net/preg_match";
> 
> A good answer would be:
> 
> "That can be done with a regular expression. The function you're looking
> for is called preg_match. http://php.net/preg_match";
> 
> 
> And guess what, I pasted that question into google and it gave me not
> one good result. It did tell me how the Rio works though.
> 
> 
> My .02
> 
> Chris.
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] How to point at a spot and get relevant information?

2003-08-14 Thread Robert Cummings
Since PHP plots the data according to the information in the database
then you know about where the data is located in the image. If PHP works
on a single plot coordinate then you need to increase the acceptable
clickable region and use this to find your point (otherwise people will
need to click on the exact coordinate pixel.

For instance:

To go back to my earlier Ottawa example. You have a coordinate in
your database for Ottawa, let's imagine it is 1030, 720. To make an
acceptable clickable region we could decide that 5 pixels on either side
is acceptable for retrieving the information. By doing so we define a
bounding box for the location of the data. The rectangle would be:

   ottawa.x - 5, ottawa.y - 5, ottawa.x + 5, ottawa.y + 5

Now, since you want the information when the cursor is pointed at the
coordinate and not when the user clicks the coordinate you are
restricted to using a client side technology to determine what data to
display to the user (Javascript, Java, whatever else). This also means
you will need to send all of the information about locations in the
image to the user (possibly dynamically produced Javascript code). If
this is to be done then you are probably better off to calculate the
bounding box constraints at the client side, rather than on the server
and sending the extra data.

HTH,
Rob.


On Thu, 2003-08-07 at 12:38, Yao, Minghua wrote:
> Sorry I didn't ask the question clearly.
> 
> I have a large table stored in a db. PHP plots the data in the table.
> I'd like the user to be able to get the relevant info of the spot when his
> cursor 
> points at that spot on the plot.
> 
> -MY

-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Hitler and Recent Threads

2003-08-14 Thread Robert Cummings
The so called Nazi clause is itself the invocation of Godwin's Law. Your
reading skills are flawed or you could have determined this from the
abounding literature available on the Web. Also there are many examples
of Godwin's Law being invoked and subsequently Quirk's exception being
raised. Thus said, having reviewed precedence, my usage of Quirk's
exception is correct and contrary to your misunderstanding.

Admittedly now I'm wasting my time (big deal), the group's time (sorry
all), but probably not your time. Future attempts to troll me into a
retarded discussion of the merits of Godwin's law or any other off-topic
fork from the original thread (regardless of how wrong you are -- which
will more than likely be the case) will be met with silence. 'Nuff said.

Cheers,
Rob.


On Thu, 2003-08-07 at 10:12, Mark wrote:
> As much as I'd like to get into the details of Godwin's Law and
> Quirk's Exception, I'll leave it with a minor explanation. Quirk's
> exception essentially says that you can't say "Hilter! There, the
> threads over." It doesn't say anything about invoking Godwin's Law.
> 
> Quirk's Exception: Intentional invocation of this so-called "Nazi
> Clause" is ineffectual.
> 
> Perhaps you could do a bit more reading on it. But the bottom line
> is, the thread HAS outlived its usefulness (if it ever had any) and,
> like discussions about religion or politics, is not going to change
> anyone's mind. And as they say, "Never argue with a fool. People will
> not be able to tell the differnce."
> 
> 
> 
> --- Robert Cummings <[EMAIL PROTECTED]> wrote:
> > Godwin's law in no way states that that the argument has been lost.
> > Only
> > that the thread has outlived it's usefulness. Unfortunately your
> > invocation of Godwin's law forces it to fall under Quirk's
> > exception
> > which generally makes you the fool.
> > 
> > Cheers,
> > Rob.
> > 
> > 
> > On Wed, 2003-08-06 at 23:11, Mark wrote:
> > > I believe according to Godwin's Law, Mr. Cummings has now lost
> > the
> > > argument.
> > > 
> > > > > > > That kind of thinking leads to things like Hitler :|
> > > 

-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] delete line

2003-08-14 Thread Robert Cummings
If your file isn't too large then you can use:

$lineArray = file( $pathToYourFile );
unset( $lineArray[$lineNum - 1] );

if( ($fl = fopen( $pathToYourFile, "w+" )) !== false )
{
foreach( $lineArray as $line )
{
fputs( $fl, $line );
}

fclose( $fl );
}

Note that the above has not been tested. If your file is quite large,
you will probably be better off reading in each line one at a time and
writing out the line to a temporary file when it isn't the line your are
trying to omit. Then replace the original file with the temporary file.

HTH,
Rob.


On Tue, 2003-08-12 at 11:38, Rodney Green wrote:
> I've been looking and haven't found anything on this. How do you open a file
> then select a line and delete that line?
> 
> Thanks,
> Rod
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Correct Coding

2003-08-14 Thread Robert Cummings
You can -- but correct me if I'm wrong -- won't that possibly cause an
exception to fire which could be extremely heavy if a custom exception
handler is implemented?

Cheers,
Rob.

On Thu, 2003-08-07 at 13:35, skate wrote:
> 
> 
> > That can generate an error if $Task was never assigned a value.
> > 
> 
> could you not do 
> 
> if(@$Task == "Add" ){do something }
> 
> to suppress the error of the variable not being set?
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] How to point at a spot and get relevant information?

2003-08-14 Thread Robert Cummings
The ability to determine relevant information strongly depends on what
you know about the information you are displaying to the user. I'm
assuming you know about the information you are presenting to the user
and so it should be possible to map the coordinate system that the user
interacts with, to a global coordinate system for which you have
information about given aspects of the map. If you don't already have a
relationship between the graphics you are working with and the relevant
information, then this is probably your starting point. For instance if
it were a map of a city that occupied a rectangle of space on the
graphics (this is simplified since it could be any polygon), you would
probably have two coordinates that indicate a bounding box for that city
on the global map.

0,0
.---.
|   |
|   |
|   |
| * Ottawa  |
| [1024,718 to 1035,726]|
|   |
|   |
`---'
 2500,1500

Thus a coordinate where the following holds:

(x >= 1024 && x <= 1035 && y >= 718 && y <= 726)

would correspond to the city of Ottawa. These coordinates could easily
be stored in a database for easy lookup by your PHP application.

Anyways I hope I'm understanding your problem correctly.

Cheers,
Rob.


On Thu, 2003-08-07 at 11:59, Yao, Minghua wrote:
> Robert and skate,
> 
> Thank you for your reponses. The problem is there are thousands of spots on
> the plot.
> The locations are random. 
>  
> -MY
> -Original Message-
> From: Robert Cummings [mailto:[EMAIL PROTECTED]
> Sent: Thursday, August 07, 2003 11:00 AM
> To: skate
> Cc: Yao, Minghua; [EMAIL PROTECTED]
> Subject: Re: [PHP] How to point at a spot and get relevant information?
> 
> 
> ou should be able to use an image map form input widget to get the
> coordinates that the user selects from some image you display to them.
> Then the determination of relevant information can occur server side via
> PHP. I don't have experience with this, but it appears to be how
> mapquest works:
> 
> http://mq-mapgen ...
> 
> HTH,
> Rob.
> 
> 
> On Thu, 2003-08-07 at 11:52, skate wrote:
> > 
> > 
> > >
> > > > Dear all,
> > > >
> > > > Anybody knows how to write a graphic plotting code such that when
> users
> > > > point
> > > > at that spot, they can get the information relevant to that spot?
> Thanks
> > > > in advance.
> > > >
> > 
> > 
> > that'd be pretty intense. to do this feasbly with PHP, you'd have to
> analyse
> > the picture first with the GD library. but to allow the user to interact
> > with this, your gonna have to store all values into JavaScript. the users
> > interaction can't be done with PHP, as that's all client side.
> > 
> > this would result in possibly huge amounts of code to download, and fairly
> > high processing time. i don't know if there's a javascript alternative, or
> > maybe some other technology someone's made. this wouldn't be so hard in
> > flash tho...
> > 
> > 
> > 
> > -- 
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> > 
> > 
> 
> -- 
> .-.
> | Worlds of Carnage - http://www.wocmud.org   |
> :-:
> | Come visit a world of myth and legend where |
> | fantastical creatures come to life and the  |
> | stuff of nightmares grasp for your soul.|
> `-'
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Freelance code optimizations

2003-08-14 Thread Robert Cummings
I've never seen a "comma" concatenation operator in PHP and the
following when cut and paste to a test PHP script generates a parse
error under PHP 4.3.2. Could you elaborate on this operator? Is it part
of the PHP 5 engine? Or are you mistaken in assuming the following works
when perhaps you use this style as part of an echo statement normally.

Cheers,
Rob.


On Mon, 2003-08-11 at 13:29, Chris W. Parker wrote:
>
>  , concatenation
> 
> $myString = "Hello this is my string."
>   ," This is more of my string."
>   ," And even more of my string."
>   ," And even more of my string."
>   ," And even more of my string."
>   ," And even more of my string."
>   ," And even more of my string."
>   ," And even more of my string."
>   ," And even more of my string."
>   ," And even more of my string."
>   ," And even more of my string."
>   ," And even more of my string."
>   ," And even more of my string.";

-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Hitler and Recent Threads

2003-08-14 Thread Robert Cummings
Godwin's law in no way states that that the argument has been lost. Only
that the thread has outlived it's usefulness. Unfortunately your
invocation of Godwin's law forces it to fall under Quirk's exception
which generally makes you the fool.

Cheers,
Rob.


On Wed, 2003-08-06 at 23:11, Mark wrote:
> I believe according to Godwin's Law, Mr. Cummings has now lost the
> argument.
> 
> > > > > That kind of thinking leads to things like Hitler :|
> 
> 
> =
> Mark Weinstock
> [EMAIL PROTECTED]
> ***
> You can't demand something as a "right" unless you are willing to fight to death to 
> defend everyone else's right to the same thing.
> ***
> 
> __
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free, easy-to-use web site design software
> http://sitebuilder.yahoo.com
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Stop neurotic posting

2003-08-14 Thread Robert Cummings
Hitler began his conquest by taking a country here, a country there
while other countries sat around saying to each other oh he won't keep
doing it. Let's DO NOTHING! Obviously that plan was flawed -- and that
is what I was referring to -- not that by being quiet suddenly the world
will be plunged into war again (not that it isn't already).

Cheers,
Rob.

On Wed, 2003-08-06 at 17:11, Chris Sherwood wrote:
> Hitler is it?
> 
> why is it everytime someone mentions a proper ettiquette, or some common
> sense thing that it is immeadiately taken to an extreme..
> 
> is this reasonable behaviour? does it portray us as adults, maybe adults who
> have a major chip on our shoulders... all I am saying is if you feel nasty
> ... keep it to yourself
> 
> now how does that equate to being like or bringing back hitler?
> 
> 
> - Original Message -
> From: "Robert Cummings" <[EMAIL PROTECTED]>
> To: "Chris Sherwood" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Wednesday, August 06, 2003 2:04 PM
> Subject: Re: [PHP] Stop neurotic posting
> 
> 
> > On Wed, 2003-08-06 at 16:36, Chris Sherwood wrote:
> > >
> > > or what does it take to actually give a reasonable answer... if I am
> gonna
> > > be rude I  wont say anything... doesnt any one remember their mother
> telling
> > > them if you dont have anything nice to say dont say anything at all?
> > >
> >
> > That kind of thinking leads to things like Hitler :| If we never say
> > anything then it becomes the norm for people to continue their
> > behaviour. Currently the question being debated is what constitutes poor
> > behaviour/etiquette within this mailing list. While I agree that this
> > forum is primarily for answering questions -- I disagree that it is for
> > answering silly little questions that would be common knowledge if the
> > asker had bothered to read any tutorials or documentation -- most
> > especially when it appears that the poster didn't even bother to do any
> > kind of searching for themselves. I mean really, questions like "does X
> > do Y" is often as simple as writing 1 to 5 lines of test code which is
> > probably shorter than the email itself and doesn't pollute the mailing
> > list with 5 to 10 replies of "yes" or "no".
> >
> > Cheers,
> > Rob.
> > --
> > .-.
> > | Worlds of Carnage - http://www.wocmud.org   |
> > :-:
> > | Come visit a world of myth and legend where |
> > | fantastical creatures come to life and the  |
> > | stuff of nightmares grasp for your soul.|
> > `-'
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> 
> 
-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Freelance code optimizations

2003-08-14 Thread Robert Cummings
Comparison to a variable is expectedly slower since the engine must
perform a lookup into the running script's variable list. Since a
constant doesn't require a lookup it's access time is O( 1 ) whereas the
lookup of a variable will lie someplace between O( 1 ) and O( lg n )
depending on the algorithm used.

Cheers,
Rob.


On Mon, 2003-08-11 at 15:44, Ray wrote:
> also, if you can compare to a constant, there is a notable difference as well.
> 
>  $i = 0;
> $a = 1000;
> while( $i++ < $a ){}
> ?>
> real  0m10.268s
> user  0m10.000s
> sys   0m0.030s
> 
>  $i = 0;
> $a = 1000;
> while( $i++ < 1000 ){}
> ?>
> real  0m7.057s
> user  0m6.880s
> sys   0m0.020s
> 
> so if $a is something like the size of an array or another thing that affects 
> the number of times the loop needs to be run. then if you can, reverse the 
> order of the loop so you can compare to 0 (or another constant)
> 
>  $a = 1000;
> $i = $a;
> while( $i-- > 0 ){}
> ?>
> real  0m7.111s
> user  0m6.870s
> sys   0m0.040s
> 
> YMMV
> 

-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Freelance code optimizations

2003-08-14 Thread Robert Cummings
On Mon, 2003-08-11 at 13:29, Chris W. Parker wrote:
> 
> * while loop
> 
> $ctr = 0;
> $val = 0;
> while($ctr<10)
> {
>   $val++;
>   $ctr++;
> }
> 
> ** for loop
> 
> $val = 0;
> for($ctr=0;$ctr<10;$ctr++)
> {
>   $val++;
> }
> 

I get the following results (very consistently +/- .1) which agrees with
your results and also shows an improvement over your own optimization.

for( $i = 0; $i < 1000; $i++ ){}

> time php foo.php 
Content-type: text/html
X-Powered-By: PHP/4.3.2

4.42user 0.03system 0:04.60elapsed 96%CPU (0avgtext+0avgdata
0maxresident)k
0inputs+0outputs (528major+216minor)pagefaults 0swaps

---

$i = 0;
while( $i < 1000 ){ $i++; }

> time php fee.php 
Content-type: text/html
X-Powered-By: PHP/4.3.2

4.22user 0.01system 0:04.43elapsed 95%CPU (0avgtext+0avgdata
0maxresident)k
0inputs+0outputs (527major+216minor)pagefaults 0swaps

---

$i = 0;
while( $i++ < 1000 ){}

> time php foo.php 
Content-type: text/html
X-Powered-By: PHP/4.3.2

2.97user 0.00system 0:03.09elapsed 96%CPU (0avgtext+0avgdata
0maxresident)k
0inputs+0outputs (526major+216minor)pagefaults 0swaps

---

Notice the large difference when the incrementation occurs within the
while check itself.

Cheers,
Rob.


-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Forms

2003-08-14 Thread Robert Cummings
If I understand your question correctly it sounds like you want to
populate a database on Server A with data residing in a database on
server B via a form hosted on server A *grin*. Obviously this is
tedious, and if there are a lot of entries then I would suggest writing
a script to populate and submit the form automatically. If you are lucky
everything will be done via HTML GET method (URL parameters); however,
it is more likely that it uses the POST method. You can do some reading
into posting data via HTML request headers, or you can look and see if
there is a class that does what you want in PEAR or PHP Classes.

HTH,
Rob.


On Tue, 2003-08-12 at 10:18, Kris Reid wrote:
> I'm having trouble explaining this so please bare with me.
> 
> Say there is a form hosted on server A on a web page
> Something simple like
> 
> 
> 
> 
> 
> 
> 
> 
> I have the data on server B in a mysql database that needs to be inserted via that 
> form. 
> I have written a script that will grab one record and submit it via the form.
> The only problem is I have to keep going back and refreshing my web page to get it 
> to submit another record.
> 
> Is there a way of doing this? Please note I have no access to Server A so I can't 
> just edit there database. Does this make sense? :)
> 
> Thanks
> 
> Kris

-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] global scope issue

2003-08-14 Thread Robert Cummings
The script below works fine for me. Do you have track_vars set to "On"?
I'm not 100% sure it's related, but it might be since I don't have any
problem with your sample script.

Cheers,
Rob.


On Wed, 2003-08-13 at 10:26, Shawn McKenzie wrote:
> I'm having problems using global vars.  I have read the docs and all of the
> notes but it's not helping.  Simplified example:
> 
> /dir1/script2.php
>  $test = array ( 'a' => '1', 'b' => '2');
> ?>
> 
> /dir1/script1.php
>  include("/dir1/script2.php");
> print_r($test);  //works great
> print_r($GLOBALS['test']);  //does not work
> ?>
> 
> This is a local include so the vars should be in the global scope right?
> Any help please?
> 
> TIA
> -Shawn

-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Forms

2003-08-14 Thread Robert Cummings
As I mentioned already you would be best not using Javascript and
performing the submission via PHP. I wrote the following snippet in the
past to do something similar to what you are asking. Study it and see if
you can adapt it to your own needs. You should be able to loop on the
form submission but you may want to disable script time limit if you
expect that this will take a while.

function submitForm( $host, $path, $data )
{
$headerString =
'POST '.$path.' HTTP/1.0'   ."\r\n"
   .'User-Agent: Lynx ;)'   ."\r\n"
   .'Host: '.$host  ."\r\n"
   .'Accept: */*'   ."\r\n"
   .'Content-type: application/x-www-form-urlencoded'   ."\r\n"
   .'Content-length: ';

$postData = '';
foreach( $data as $key => $value )
{
$postData .= urlencode( $key ).'='.urlencode( $value ).'&';
}

$postData = ereg_replace( '.$', '', $postData );

$headerString .= ''.strlen( $postData )."\r\n\r\n";
$headerString .= $postData."\r\n";

$content = sendRequest( $host, $headerString );
$content = implode( "\n", $content );

echo 'CONTENT'."\n\n".$content."\n\n";
}

function sendRequest( $host, $header )
{
$fp = fsockopen
(
$host,
80,
$errno,
$errstr,
30
);

$data = '';

if( !$fp )
{
echo "Error: $errstr ($errno)\n";
}
else
{   
fputs( $fp, $header );

while( !feof( $fp ) )
    {
$data .= fgets( $fp, 128 );
}

fclose( $fp );
}

return explode( "\n", $data );
}

Cheers,
Rob.


On Tue, 2003-08-12 at 20:45, Kris Reid wrote:
> 
> - Original Message -
> From: "Robert Cummings" <[EMAIL PROTECTED]>
> 
> > If I understand your question correctly it sounds like you want to
> > populate a database on Server A with data residing in a database on
> > server B via a form hosted on server A *grin*. Obviously this is
> > tedious, and if there are a lot of entries then I would suggest writing
> > a script to populate and submit the form automatically. If you are lucky
> > everything will be done via HTML GET method (URL parameters); however,
> > it is more likely that it uses the POST method. You can do some reading
> > into posting data via HTML request headers, or you can look and see if
> > there is a class that does what you want in PEAR or PHP Classes.
> >
> > HTH,
> > Rob.
> >
> 
> Robert
> 
> Thanks for explaining my situation better. That's spot on.
> I have php grabbing data from my database and filling the form. Then
> JavaScript automatically submits the form.
> However once the form is submitted. Server A forwards the browser else
> where. So I have to type in my URL again.
> 
> Is there some way I can more or less dump my database into theirs via the
> form. There are a #$%^ load of records.
> 
> Thanks
> 
> Kris
> 

-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] How to point at a spot and get relevant information?

2003-08-14 Thread Robert Cummings
ou should be able to use an image map form input widget to get the
coordinates that the user selects from some image you display to them.
Then the determination of relevant information can occur server side via
PHP. I don't have experience with this, but it appears to be how
mapquest works:

http://mq-mapgen ...

HTH,
Rob.


On Thu, 2003-08-07 at 11:52, skate wrote:
> 
> 
> >
> > > Dear all,
> > >
> > > Anybody knows how to write a graphic plotting code such that when users
> > > point
> > > at that spot, they can get the information relevant to that spot? Thanks
> > > in advance.
> > >
> 
> 
> that'd be pretty intense. to do this feasbly with PHP, you'd have to analyse
> the picture first with the GD library. but to allow the user to interact
> with this, your gonna have to store all values into JavaScript. the users
> interaction can't be done with PHP, as that's all client side.
> 
> this would result in possibly huge amounts of code to download, and fairly
> high processing time. i don't know if there's a javascript alternative, or
> maybe some other technology someone's made. this wouldn't be so hard in
> flash tho...
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Discussion: do you consider null a value or strictly a type?

2003-08-17 Thread Robert Cummings
There has been a recent thread on the internals list as to the meaning
and usage of the "null" datatype. Zeev claims, perhaps rightly so, the
following:

Zeev wrote:
>
> null is not a value, was never meant to be a value, and won't be a
> value

Interestingly though, the PHP documentation at

http://www.php.net/manual/en/language.types.null.php

indicates the following:

The special NULL value represents that a variable has no value. NULL
is the only possible value of type NULL. 

Which is obviously contradictory since it claims to be a variable having
no value and yet also claims it is a special value. Also the following
snippet from: 

http://www.php.net/manual/en/language.operators.assignment.php

seems to also indicate that null is a value -- namely:

The basic assignment operator is "=". Your first inclination might
be to think of this as "equal to". Don't. It really means that the
the left operand gets set to the value of the expression on the
rights (that is, "gets set to"). 

The above reference might not be obvious, but since you can assign the
null constant, then it says the "left operand gets set to the value
of..." seemingly indicating that null is a value.

Now the point of the discussion is not to indicate who is right or who
is wrong -- that would appear to be a ridiculous argument. I am more
interested in finding out the practices and experience of PHP
developers. I'd like to know how many people treat null as a value, and
how many do not. For instance to you ever assign default values of null
to instance variables, or local variable, or array entries? I know in
practice that I have, and find it quite convenient to represent a
default value.

Cheers,
Rob.
-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] READ RECEIPTS [WAS: $GLOBAL question]

2003-08-18 Thread Robert Cummings
This is pretty off topic -- but most clients also let you refuse to send
receipts automatically -- which is how I deal with them.

Cheers,
Rob.

On Mon, 2003-08-18 at 17:04, Dan Anderson wrote:
> > p.s. Is there not an option on your mail reader to automatically send
> > read receipts? I mean, can't you have it by default send the receipt
> > instead of requesting your intervention? If not, you might like to think
> > about getting a better client. thanks!
> 
> You ever open a spam and 30 seconds later get a follow up spam?  That's
> what happens from automatically sending read reciepts.  Also, spammers
> love to use them as a tool to figure out who actually reads spam -- even
> if you just click on it for a second to press the DEL key.
> 
> However, so many people request read reciepts that even though I wish
> they didn't exist I can't see complaining to a mailing list about them.
> 
> -Dan

-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] CHAT about PHP

2003-08-20 Thread Robert Cummings
On Wed, 2003-08-20 at 11:11, Curt Zirzow wrote:
> * Thus wrote Damian Brown ([EMAIL PROTECTED]):
> > www.phpexpert.org
> > Programming Help
> > and General Programming Topics
> 
> Is this a joke?

Looks like an email harvester. Why does it need an email address?

Cheers,
Rob.
-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: back button and forms

2003-08-20 Thread Robert Cummings
GET method has restrictions -- you are only guaranteed proper handling
of the first 1024 (or some such limit) after which the behaviour is
considered undefined. Thus using the GET method is generally only
feasible for small forms.

Cheers,
Rob.


On Wed, 2003-08-20 at 14:08, rush wrote:
> "Tim Winters" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > Is there any way to avoid this from happening?
> 
> instead of POST, you could use GET as form method.
> 
> More nicely, but also much more work, is to use N layers on one page for
> each group of inputs and to switch layers by javascript. That way, all data
> will be posted as one big form, in single action. This would also solve
> nasty problem your solution has if user clicks on new window in the middle
> of forms and contionues to enter different data in both of windows, this is
> quiote likely to confuse dta you are storing to the session.
> 
> rush
> --
> http://www.templatetamer.com/
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] in the middle of shift and pop

2003-08-20 Thread Robert Cummings
On Wed, 2003-08-20 at 23:38, Jaap van Ganswijk wrote:
> 
> Finding a single element in a doubly linked list can
> be sped up using a hash-code table, but it also
> makes things like renumbering numerically indexed
> entries a lot harder (I think, I never used a
> combination of these things.)

Doubly threaded red-black trees are good for in order traversal and
arbitrary lookup. As with most structures that provide more speed, you
use more memory :)  O( lg n ) insertion, O( lg n ) deletion, O( lg n )
search. Threaded means the in order nodes are threaded into a linked
list. PHP I believe uses hashes of some sort, I'm not sure how they keep
track of the insertion order for doing a foreach loop -- I guess we
could look. On a more related topic: if he's happy with the unset()
function but wants the indexes renumbered, he could write a C function
which performs the renumbering. Should keep it relatively fast and
provide the option of renumbering -- or not.

Cheers,
Rob.
-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Test

2003-08-21 Thread Robert Cummings
Please ignore -- I haven't been able to post lately.

-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Newbie Question

2003-08-21 Thread Robert Cummings
Even if they do know about it, it's functionality conforms to what they
said you can do: use SQL statements within a PHP page to load the data
*grin*.

Cheers,
Rob.

On Thu, 2003-08-21 at 14:53, Curt Zirzow wrote:
> * Thus wrote Phil King ([EMAIL PROTECTED]):
> > Hi Robbert,
> > 
> > I beleive my ISP does not allow any GUI interface into mysql databases on
> > the server.
> > They have advised me that ALL functions, table creation, modification,
> > loading data etc has to be done from PHP.
> > 
> > It appears I have to use SQL statements within a PHP page to load the data.
> 
> Just go to phpMyAdmin.com, download the source code and install it on
> the server. The hosting company doesn't need to know anything about
> it. 
> 
> 
> Curt
> -- 
> "I used to think I was indecisive, but now I'm not so sure."
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: google style paginating

2003-08-21 Thread Robert Cummings
Ummm I wouldn't do what these guys suggest (at least not all of it)...
perform two queries, one counting the total number of returns the other
to actually get the subset. Don't retrieve ALL the queries then only
display a subset. Otherwise what's the point of using the LIMIT clause
for conservation of resources? The "SELECT COUNT( * ) FROM foo" query is
usually optimized to be extremely fast so the first query is almost
negligible in contrast to the second.

Cheers,
Rob.


On Thu, 2003-08-21 at 18:52, John Ryan wrote:
> just split up your total number of results ($num_rows) by the results per
> page (10, i think) and create a for loop to loop from page1 to pagex,
> creating a link with offset for each one.
> 
> simple.
> "Ted Conn" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > Hi I am new to this newsgroup and I plan on replying to all the posts I
> can
> > for now... but Id like to start out by asking a question. I am trying to
> > paginate my sql results in 10 by 10, which I have been able to do no
> > problem. but what I want to do is have the pages layed out in google style
> > with (1)(2)(3)(4) etc etc and each one is clickeable that will take you to
> > that page. I'll show you the code I am using now for next and back
> > buttons...
> >
> >
> >
> > //located at top of page
> >  > include("include/conex.php");
> > $link=Conectarse();
> > ?>
> >
> > //start of body, this verifies that so is numeric, divisible by 10, and a
> > valid number
> >  > $q="SELECT id FROM tblNoticias ORDER BY id ";
> > $result=MYSQL_QUERY("$q",$link);
> > $num_rows=(MYSQL_NUM_ROWS($result));
> > if ( isset($_GET['so']) && is_numeric($_GET['so']) )
> > {
> >  if ( ($_GET['so'] > $num_rows) || ($_GET['so'] < 0) )
> >   $so='0';
> >  else
> >  {
> >   if ($_GET['so'] % 10)
> >$so='0';
> >   else
> >$so=$_GET['so'];
> >  }
> > }
> > else
> >  $so='0';
> > ?>
> >
> > //return results
> >
> >  > $q="SELECT id,titulo,texto,img1_data FROM tblNoticias ORDER BY id DESC
> LIMIT
> > $so,10";
> > $result=(MYSQL_QUERY("$q",$link));
> > while ($row=(MYSQL_FETCH_ARRAY($result))){
> > ?>
> >
> > // next and back buttons
> >
> >  >
> >   if ( $so >=10)
> >   {
> >   $sortback= $so-10;
> >   echo " class=\"mainText\"><<
> > Atras" ;
> >   }
> >   ?>
> >  >
> >  $sortforth=$so + 10;
> >   $existencias=MYSQL_QUERY("SELECT id FROM tblNoticias LIMIT
> > $sortforth,10",$link);
> >   $existencias=MYSQL_NUM_ROWS($existencias);
> >   if ( $existencias > 0 )
> >   echo "  > class=\"mainText\"> Siguiente >> ";
> >?>
> >
> >
> > DID I PUT WAY TO MUCH CODE?? Sorry, and I apreciate your help.
> >
> > How can I implement the google style paging into this code?
> >
> > Thank you...
> >
> >
> >
> >
> > Ted Conn Lider de Proyectos [EMAIL PROTECTED] Scinet México S.A. de C.V.
> > +52 (222) 294-05-95 al 97 Sin costo: 01-8000-DOTCOM Puebla · DF ·
> Monterrey
> > www.scinet.com.mx
> >
> >
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] isset bug?

2003-08-22 Thread Robert Cummings
This should help:

http://www.php.net/manual/en/function.array-key-exists.php

Cheers,
Rob.


On Fri, 2003-08-22 at 13:26, Curt Zirzow wrote:
> * Thus wrote Christian Calloway ([EMAIL PROTECTED]):
> > Ok, here's the deal. I like to use $_GET and $_POST variables without values
> > to notify my scripts that some action must be taken. For example, given the
> > following URL:
> > 
> > http://blahdomain/blah.php?productid=1&edit
> > 
> > or given the following form element:
> > 
> > 
> 
> simply add a value="1" and it will fix your problem.
> 
> > 
> > My blah.php script will check if edit set using the following line:
> > 
> > if (isset($_REQUEST["edit"]))
> > {
> > ..
> > }
> > 
> > and then it will take the appropriate actions (lets just say its updating a
> > record in the database). Locally I am running PHPv4.3.2, and everything
> > works fine. I have been working on a large web-based application for the
> > last month, and yesterday I put it up live. Our host unfortunately runs
> > PHPv4.2.1 and I have no access to the conf files (those bastards) and
> > globals are set to on. Low and behold, the isset function returns false when
> > a $_POST or $_GET variable is passed but contains no value, which would be
> > exactly the same thing as checking the variable itself:
> > 
> 
> 
> Curt
> -- 
> "I used to think I was indecisive, but now I'm not so sure."
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Clean Up the sand box time

2003-08-22 Thread Robert Cummings
Absolutely, the best way *tongue in cheek* is to format as follows:

$news = mysql_query($sql) or die( print "document.write(\"".mysql_error()."\");");

$found = 0;
while( $mydata = mysql_fetch_object( $news ) )
{
if( $getaddr == $mydata->IPAddress )
{
$found = 1;
}
}

if( $found > 0 )
{
echo "document.write(\"$getaddr already visited. \");";
}
else
{
echo "document.write(\"insert $getaddr into $table. \");";
}

Look how neat that is, who could possibly come up with a better style of
formatting than that!?

Cheers,
Rob.


On Fri, 2003-08-22 at 17:26, John Taylor-Johnston wrote:
> This is my favourite question. Can I clean up my 'if then' statements a tad?
> Must be a cleaner way?
> Still learning, still having fun :)
> Thanks,
> John
> 
>  $news = mysql_query($sql) or die(print "document.write(\"".mysql_error()."\");");
> 
>  $found = 0;
>  while ($mydata = mysql_fetch_object($news))
>  {
>   if($getaddr == $mydata->IPAddress)
>   {
>   $found = 1;
>   }
>  }
> 
>   if ($found > 0)
>   {
>   echo "document.write(\"$getaddr already visited. \");";
>   }else{
>   echo "document.write(\"insert $getaddr into $table. \");";
>   }


-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] anyone have any idea as to how to display a message aftera page has started loading??

2003-08-22 Thread Robert Cummings
Also make sure you don't have output buffering or compression on for the
page in question.

Cheers,
Rob.


On Fri, 2003-08-22 at 16:42, Dan Joseph wrote:
> Hi,
> 
> > I am looking for a way to say please wait generating thumbnails... while
> > actually doing so.  I have tried calling the JavaScript alert() function
> > before starting the image processing but it waits for the page to
> > complete loading before displaying the alert box.  anyone have any ideas
> > on this??  BTW: at the time I am trying to display a message I have
> > already started output to the browser.
> 
>   Try looking up the flush() function on php.net.  That _might_ do what you
> want.
> 
> -Dan Joseph
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: google style paginating

2003-08-22 Thread Robert Cummings
IMHO a PEAR pager package sounds like a sledgehammer when all that's
needed is a hammer.

Cheers,
Rob.

On Fri, 2003-08-22 at 17:59, Rob Yelvington wrote:
> The Pear Pager class works like a champeen, too.  It'll paginate results 
> however you'd like it to.
> 
> ~Rob
> 
> 
> Chris W. Parker wrote:
> > Robert Cummings <mailto:[EMAIL PROTECTED]>
> > on Thursday, August 21, 2003 4:46 PM said:
> > 
> > 
> >>Don't retrieve ALL the queries then
> >>only display a subset. Otherwise what's the point of using the LIMIT
> >>clause for conservation of resources?  The "SELECT COUNT( * ) FROM
> >>foo" query is usually optimized to be extremely fast so the first
> >>query is almost negligible in contrast to the second.
> > 
> > 
> > Heh... I've never really used COUNT() so I'll have to see how much it
> > speeds up my searching. :)
> > 
> > 
> > Good idea!
> > 
> > Chris.

-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Using PHP to get size of mySQL data?

2003-08-22 Thread Robert Cummings
Untested, but looks about right:

select sum( length( article_text ) ) as total
from articles_table
where user_id = 'user to match";

This is SQL though, so it's kinda OT.

Cheers,
Rob.


On Fri, 2003-08-22 at 22:45, Jeff Lewis wrote:
> I want to query a table of text articles and when selecting them I am
> wondering if I can grab the actual size of the articles in question.
>  
> So if someone has two articles, I want to see if they have reache 100kb
> in total.
>  
> Does that make sense to anyone? is that possible with PHP?
>  
> Jeff 
-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Status Chaing Toggle / Code

2003-08-23 Thread Robert Cummings
Code and query look about right -- my guess is you're another one of the
multitude of people who haven't bothered to read the docs about register
globals and how they are now off by default. If the following solves
your problem, then yes indeed, such are you.

include("../../application2.php");
$CFG->dbname = "ipo_students";

//
// $student_id probably came in from $_GET or $_POST.
//
$student_id
= isset( $_GET['student_id'] )
? $_GET['student_id']
: (isset( $_POST['student_id'] )
? $_POST['student_id']
: null;

if( is_null( $student_id ) )
{
echo 'You have some other problem!'."\n";
}

db_connect($CFG->dbhost, $CFG->dbname, $CFG->dbuser, $CFG->dbpass);
$qid = db_query("SELECT printed FROM outgoing_student
 WHERE id=$student_id");

Cheers,
Rob.

On Fri, 2003-08-22 at 14:45, Tony Pagliocco wrote:
> Ok , I am slightly confused at the moment, maybe someone can shed me some
> light about the situation.
> 
> I have a php page that pulls a query of all students in a table that have
> fit a criteria, in this case, where
> the field, named "web", is set to Y
> 
> So when you open the page, all people with Y = web , are spit out into a
> table.
> 
> Name - Address - Printed..
> 
> -
> Example:
> 
> Joe Smith - 5 Smith Road - Not Printed
> Randy bob - 4 Joe Road - Not Printed
> 
> --- 
> 
> Now when the query outputs, I can click on the "Not Printed" link and it
> should
> update the persons row to change the vaule of the field named Printed from N
> to Y.
> 
> Then when I referesh the page, it should look the same but instead of it
> saying 
> "Not Printed" it should say "Printed" next to the persons row.
> 
> So based on the above example, if we were to click on Joe Smith's "Not
> Printed" link,
> if we were to pull the page up later, it would now show "Printed"
> 
> We want to have a list of all students who have Y = Web but also at the same
> time
> monitor who we have pritned info on and who we dont, hence the reason for
> the toggle.
> 
> I've included the code below to the function, my update looks correct but
> when I'm coming 
> back to the query page, its not changing the status of the "Not Printed" ,
> so even 
> if Printed is Y now in the field, it still says Not Pritned.
> 
> Any ideas? TIA everone
> 
> 
>  
> ## parameter: $student_id
> 
> include("../../application2.php");
> $CFG->dbname = "ipo_students";
> 
> db_connect($CFG->dbhost, $CFG->dbname, $CFG->dbuser, $CFG->dbpass);
> $qid = db_query("SELECT printed FROM outgoing_student
>  WHERE id=$student_id");
> $row = mysql_fetch_array($qid);
> $printed = $row['printed'];
> 
> echo "current value of printed is $printed";
> if ($printed == 'n' || $printed == 'N' || empty($printed)) {
>   $newvalue = "Y";
> } else {
>   $newvalue = "N";
> }
> 
> db_query("UPDATE outgoing_student SET printed='$newvalue' WHERE
>   id='$student_id'");
> 
> echo "Go to previous page and refresh";
> 
> 
> ?>
> 
> 
> 
> Tony Pagliocco
> Systems Administrator
> Arizona State University
> International Programs Office
> Phone: (480) 727-6279
> Email: [EMAIL PROTECTED]
> 
> 
-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] CMS question.

2003-08-26 Thread Robert Cummings
On Mon, 2003-08-25 at 10:14, Edmond Baroud wrote:
> On August 25, 2003 08:13 am, Jay Blanchard wrote:
> 
> > What makes you think that the developer did something unethical?
> 
> It looks like you're familiar with this particular case and the developper 
> happens to be your friend so you're defending him?
> Anyways, I believe I said "to make a long stroy short". but if you insist on 
> knowing why I said that he did something unethical (let me add to that 
> "unprofessional" ); he sold an intellectual property which he was paid to 
> developpe to competitors in the business.

Legalize is very specific. If the contract didn't specifically state
that rights to the intellectual property would be part of the deal, then
he has merely sold a solution, not the rights to the intellectual
property itself. many companies are contracted for solutions, many
companies retain the rights to their intellectual property after
completion of the solution. Unless the contract is clear, he has done
nothing unethical or unprofessional.

Cheers,
Rob.

> 
> 
> > I have seen those small icons used by numerous developers, but I don't
> > know if they are available for uncredited or uncompensated works. Other
> > than that those screenshots look like dozens of packages I have seen.
> 
> Thanks for the feedback.
> 
> > Capable to upload what in a batch?
> 
> Have you ever seen anyone upload bananas or oranges on the net? the most 
> obvious word that could be placed here is "files", excuse me for forgetting 
> to mention it!
> 
> BTW: thanks for the your time Jay.
> 
> Ed.
> 
> -- 
> Edmond Baroud 
> Senior UNIX sysadmin mailto:[EMAIL PROTECTED]
> Fingerprint  140F 5FD5 3FDD 45D9 226D  9602 8C3D EAFB 4E19 BEF9
> "UNIX is very user friendly, it's just picky about who its friends are."
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] math functions?

2003-08-26 Thread Robert Cummings
Is there some reason you can't use the modulus operator?

http://www.php.net/manual/en/language.operators.arithmetic.php

Cheers,
Rob.


On Tue, 2003-08-26 at 11:07, Amanda McComb wrote:
> I am having trouble finding math functions on php.net.  I am also getting
> "page not found" errors when trying to search.
> 
> Basically, I'm looking for a mod or division function - something I can
> use to tell me when a number is evening divisable by a certain number.
> 
> Thanks!
> Amanda
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: math functions?

2003-08-26 Thread Robert Cummings
Just to be precise, modulus does NOT return true and false. Given A%B it
returns the remainder after dividing B into A. This happens to be
equivalent to false when there is no remainder, and equivalent to true
when there is a remainder.

Cheers,
Rob.


On Tue, 2003-08-26 at 11:11, Kae Verens wrote:
> Amanda McComb wrote:
> > I am having trouble finding math functions on php.net.  I am also getting
> > "page not found" errors when trying to search.
> > 
> > Basically, I'm looking for a mod or division function - something I can
> > use to tell me when a number is evening divisable by a certain number.
> 
> % is the mod operator in quite a few languages, and works in PHP as well.
> 
> if(7%4), for example, will return true (3), while (12%6) will return false
> 
> integers only, IIRC
> 
> Kae
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Isn't it grea...t

2003-03-17 Thread Robert Cummings
Bix wrote:
> 
> I think it is an amazing feat to have a scripting language with such a
> comprehensive (with user notes) documentation, helpful community of users
> and developers, and a team of writers who for little reward, continue to
> develop PHP to make it work better and faster for us all to use.
> 
> So here's to PHP!

*cheers* to that!

Rob
-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Which is quicker, if-else statements

2003-03-18 Thread Robert Cummings
Kevin Stone wrote:
> 
> Logically the if-else construct is faster becuase PHP doesn't have to parse
> and execute the second conditional.  An if-elseif construct is ussually
> followed by an else block to describe a default action if no other
> conditions are true.  Otherwise you may as well use sequential if()
> statements becuase it's exactly the same thing.
> - Kevin

Sequential if() statments will not be the same as the if-elseif() system
when more than two conditional checks are matched. The sequential will
process both blocks, whereas the if-elseif() will only process the first
match :)

Cheers,
Rob.
-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Automatic Headers and Footers

2003-06-06 Thread Robert Cummings
Yes it can be done, using the auto-prepend feature call a script that
turns output buffering on. Then in the auto-appended script read the
buffer a manipulate ith with the automatic header and footer. Thus you
modify the content only and achieve what you want without modifying 
the actual HTML file.

Cheers,
Rob.
-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

Wendell Brown wrote:
> 
> Ok guys, I think I have a challenge for you (actually, I don't think
> this can be done, but I've been proven wrong every time I've made that
> assumption with php in the past, so I'll ask anyway).  Here's the
> question:
> 
> Is there a way to have php insert headers and/or footers into all of
> the html files in a given directory on the fly (not actually modifying
> the files)?  And by this I mean take an existing valid HTML file and
> add headers and footers and end up with a valid HTML file.
> 
> Now, before some of you get trigger happy and tell me to read the
> manual and point me to things like .htaccess, auto_prepend_file, google
> and the like, think about what I'm really asking  It needs to
> insert the header after the -body- tag and put the footer in before the
> -/body- tag.  It needs to do this without modifications to the HTML
> file.
> 
> And yes, I understand that by default HTML files aren't going to be
> effected by the auto_prepend_file (since they aren't php files) - so it
> will require adding HTML to the list of php parsed file types.
> 
> For instance, the goal would be to take the following code:
> 
> -HTML-
> -Head-
> -Title-This is a test-Title-
> -body-
> 
> Well, did it work?
> 
> -/body-
> -/html-
> 
> and convert it to this:
> 
> -HTML-
> -Head-
> -Title-This is a test-Title-
> -body-
> -h1-This is a page header-/h1-
> 
> Well, did it work?
> 
> -h3-This is the footer-/h3-
> -/body-
> -/html-
> 
> Can it be done?  I don't think so, but I leave it up to your wiles to
> suggest a solution
> 
> Thanks!!!

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Automatic Headers and Footers

2003-06-06 Thread Robert Cummings
Jay Blanchard wrote:
> 
> There are so many ways to skin this cat. You could (as you said, it will
> require adding HTML to the list of php parsed file types) have the
> header, body, and footer files read into a single file and then output.
> You could do something like this ... (a lot of folks use the following
> simple method to include navigation in web pages)...
> 
> 
> 
> 
>  include("headerfile.inc");
> ?>
>  ... other html ...
> 
>  ... other html ...
> 
>  ... other html ...
> 
>  ... other html ...
> 
>  include("footerfile.inc");
> ?>
> 
> 
> 
> I do not think that this needs to be difficult, but if you want more
> complexity you could have it.

The reasonn for my "difficult" answer was because the criteria for his
solution indicated that he did not want to modify the html pages themselves.
Thus the above solution is invalid :|

Cheers,
Rob.
-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] buildconf doesn't seem to be working for 4.3.2

2003-06-04 Thread Robert Cummings

I could have sworn buildconf was used to rebuild the configure
script with any new extensions added to the ext/ directory. For
some reason though nothing is being added and I'm getting no
warning for PHP 4.3.2 Anyone have any ideas?

Cheers,
Rob.
-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] buildconf doesn't seem to be working for 4.3.2

2003-06-04 Thread Robert Cummings
Puzzling as heck, the buildconf just took, perhaps was related to the
timestamp of the config.m4 file changing since it never took untill I
started mucking with that. incidentally it worked even though the
contents weren't changed *pffft* :)

Cheers,
Rob.

Robert Cummings wrote:
> 
> I could have sworn buildconf was used to rebuild the configure
> script with any new extensions added to the ext/ directory. For
> some reason though nothing is being added and I'm getting no
> warning for PHP 4.3.2 Anyone have any ideas?

-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] piping email directly into PHP

2003-06-11 Thread Robert Cummings
Just a small addendum, I also suggest using -C if you are using a non CLI PHP
binary. This prevents PHP from changing directories to the location of the script.
Perhaps not important for your needs, but if like me, you do many shell based
scripts without the CLI version, it is very useful.

Cheers,
Rob.

Adrian Teasdale wrote:
> 
> Wow, thanks! A nice detailed reply that should keep me busy for a good few
> hours
> 
> All the best
> 
> Ade
> 
> > -Original Message-
> > From: John S. Huggins [mailto:[EMAIL PROTECTED]
> > Sent: 11 June 2003 23:02
> > To: Adrian Teasdale
> > Cc: [EMAIL PROTECTED]
> > Subject: Re: [PHP] piping email directly into PHP
> >
> >
> > On Wed, 11 Jun 2003, Adrian Teasdale wrote:
> >
> > >-Hi there
> > >-
> > >-We are wanting to create a little help/crm tool for internal
> > use.  Rather
> > >-than reading (and parsing) in an email from a pop account, is it now
> > >-possible to pipe email in directly to a database via PHP?  If so, any
> > >-pointers on how to do it and anything to watch out for?
> >
> > You might get good clues by examining the phorummail.php file in the
> > Phorum.org forum script in their scripts directory of their tarball.
> >
> > http://www.phorum.org/
> >
> > As I recall, it is meant to be passed email messages via .forward or
> > something like that.  It then looks at the mail contents and deals with it
> > accordingly.  Phorum is a MySQL thing so I assume they write the data to
> > the database.
> >
> > Note that this file is meant to run like a typical shell script with this
> > in the first line:
> >
> > #!/usr/local/bin/php -q
> >
> > Thus, you must have a compiled php executable in /usr/local/bin or
> > whereever you keep your favorite programs.
> >
> > Just compile PHP with no parameters in ./configure and it should make a
> > php binary perfect for use as a shell program tool.
> >
> > The "-q" turns off header generation I think making php a very suitable
> > progamming language.

-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] which is quicker? pseudo XML, or database?

2003-06-13 Thread Robert Cummings
I you don't expect to do much with the data then I would recommend using an
SQL table since then you can easily search on all of the fields. Later if you
find you have more needs then conversion to XML will be trivial. Regardless
of which route you take if speed is an issue you can always cache either the
parsed XML or the SQL query results. It doesn't make much difference.

Cheers,
Rob.

Justin French wrote:
> 
> Hi all,
> 
> I'm looking at a site where there will be a lot of articles, all of which
> will be added once, and rarely edited again...
> 
> Let's say each article consisted of 6 data types:
> - id
> - author
> - authorEmail
> - datePublished
> - introduction
> - bodyText
> 
> I'm considering:
> 
> a) storing this data in a MySQL table (a fairly simple query)
> b) storing this data in a pseudo XML format like:
> 
> 24
> Justin French
> [EMAIL PROTECTED]
> 2003-11-28
> This is my intro
> This is my text and html -- say 1000 words?
> 
> I plan on doing my own performance tests, but I'd love to hear any opinions
> about which would form of data retrieval would cause less of a performance
> burden on the server (MySQL is on the same box as the htdocs and apache).
> 
> TIA,
> 
> Justin
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] which is quicker? XML or database?

2003-06-14 Thread Robert Cummings
John Hicks wrote:
> 
> Hi Justin--
> 
> I've been wrestling with a similar problem.
> 
> You say:
> > I'm considering:
> >
> > a) storing this data in a MySQL table (a fairly simple
> > query) b) storing this data in a pseudo XML format like:
> >
> > 24
> > Justin French
> > [EMAIL PROTECTED]
> > 2003-11-28
> > This is my intro
> > This is my text and html -- say 1000 words?
> 
> Um, the above isn't pseudo XML. It's actually perfectly
> fine XML. Nothing pseudo about it.

Not to quibble (ok JUST to quibble :) It isn't correct XML because it
has no root tag *heheh*.

Cheers,
Rob.
-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: speed on XML files

2003-06-16 Thread Robert Cummings
Try compression, XML generally cmopresses very well since it is usually text.

Cheers,
Rob.

Diana Castillo wrote:
> 
> I send an xml request to a remote server and get back the xml response.
> 
> "Catalin Trifu" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > Hi,
> >
> > Receiving from where ?
> >
> > Cheers,
> > Catalin
> >
> >
> > "Diana Castillo" <[EMAIL PROTECTED]> wrote in message
> > news:[EMAIL PROTECTED]
> > > I have problems receiving large xml files, they take too long, does
> anyone
> > > have a solution?
> > > thank you,
> > > Diana

-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Agh! Driving me crazy!

2003-06-18 Thread Robert Cummings
Mike At Spy wrote:
> 
> Anyone see anything wrong with this line of code?
> 
> $fine = mysql_query("INSERT INTO
> tblPOItems(poID,poItemUPC,poItemNumber,poItemDescription,poItemInnerCasePkg,
> poInnerQuantity,poItemEstQuantity,poItemCostEach,poItemSuggestedSellPrice)
> values('$poID', '$place[0]', '$inmb', '$ides', '$iicp', '$cases',
> '$place[1]', '$iice', '$isgs'");

I realize this problem has already been fixed, but if messy developers took
the time to format their code into something readable (my suggestion below)
then finding such trivial errors would be a walk in the park.

$fine = mysql_query
(
"INSERT INTO tblPOItems "
   ."( "
   ."poID, "
   ."poItemUPC, "
   ."poItemNumber, "
   ."poItemDescription, "
   ."poItemInnerCasePkg, "
   ."poInnerQuantity, "
   ."poItemEstQuantity, "
   ."poItemCostEach, "
   ."poItemSuggestedSellPrice "
   .") "
   ."values "
   ."( "
   ."'$poID', "
   ."'$place[0]', "
   ."'$inmb', "
   ."'$ides', "
   ."'$iicp', "
   ."'$cases',
   ."'$place[1]', "
   ."'$iice', "
   ."'$isgs' "
);

Cheers,
Rob.
-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] return all non-tag characters

2003-06-21 Thread Robert Cummings
Everything you need is at:

http://www.php.net/manual/en/function.strip-tags.php

Cheers,
Rob.

Mike Migurski wrote:
> 
> >I want to be able to retrieve and return all character that are not
> >located in html tags.  For example:
> >
> >1234567
> >or
> >1234567
> >
> >I would just like it to be equal to 1234567, but I would need it to work
> >with any tags and attributes.
> 
> A good starting point might be preg_replace, search pattern '/<[^>]+>/',
> replace pattern ''.
> 
> -
> michal migurski- contact info and pgp key:
> sf/cahttp://mike.teczno.com/contact.html
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] how to call php from C?

2003-06-23 Thread Robert Cummings
[EMAIL PROTECTED] wrote:
> 
> Hello,
>I have a working C program that runs like a cgi
> by sending back a web page. I would like include in it
> some authentication code by checking
> 
> $au = $_SESSION['AuthenticatedUser']
> 
> previously set up by a php script.I don't like to recode
> all in php because I expect a nasty performace slowdown.
> 
> Can I call session_start() and so on from my C program?
> Any example code?

I'm not sure how you would go about doing this, a more natural
solution IMHO would be to incorporate your C code into a PHP
extension which would then give you access to the C library you
have written directly in PHP.

Cheers,
Rob.
-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Expensive WEB HOST NEEDED!!!!!

2003-06-24 Thread Robert Cummings
Do we really need all this pessimism?? I have the exact host he needs. It
supports PHP, MySQL, and sending emails. It has absolutely no pop-up ads
and no watermarks. There is no advertising whatsoever. And the best part...
it is ABSOLUTELY FREE!!


ABSOLUTE FREE[tm] hosting is available only to those members of an elite
group of suckers that make monthly curtesy donations of $1000. Account will
be activate upon receipt of first donation.


Cheers,
Rob.

Marios Adamantopoulos wrote:
> 
> I need a web host too
> It MUST support PHP, ASP, JSP/Servlets, MySQL, SQL Server 2000, SQL Server
> 7, Oracle 8 and Oracle 9. It should have a minimum of 1,000,000 pop-up ads,
> but I will allow it if it has xxx pictures, big pictures though.
> 
> And and before I forget, I WANT TO PAY 1,000 a day for 1 Mb of space and 8Mb
> of RAM.
> 
> GET REAL there no such thing as FREE HOSTING
> 
> -Original Message-
> From: Jay Blanchard [mailto:[EMAIL PROTECTED]
> Sent: 24 June 2003 13:20
> To: Denis 'Alpheus' Cahuk; [EMAIL PROTECTED]
> 
> [snip]
> Like I said, I need a web host.
> It MUST support PHP, mySQl and sending emails, optional.
> It shouldn't have any ads (pop-ups, ads), but I will allow if it has
> watermarks (SMALL! watermarks).
> It should be TOTALY FREE!
> [/snip]
> 
> Denis I am going to make a small suggestion, please Google for this
> information. Apparently many of the answers that have been given to you on
> this list are not acceptable. Do some research. There is no such thing as
> totally free.
> 
> HTH!
> 
> Jay
> 
> --
> PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
> http://www.php.net/unsub.php

-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] weird switch behaviour

2003-06-24 Thread Robert Cummings
Try the following:

echo '['.$type.']';

to rule out the possibiliy of spaces around the word.

Cheers,
Rob.

cg wrote:
> 
> I am testing a var in a switch statement,
> switch($type)
> {
> case "HIRE":
> statements;
> break;
> etc
> default:
> echo "In Default";
> break;
> }
> I can echo $type directly above the switch statement, confirm it contains
> the string "HIRE", but the switch takes the default every time!!
> 
> what is going on??
> 
> thanks
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] my first PHP...posting in forms

2003-06-24 Thread Robert Cummings
Register globals is probably off. This is old news, keep
up to date by reading hte release documents.

Cheers,
ROb.

Wilbert Enserink wrote:
> 
> hi All,
> 
> I got this simple form. Input is submitted using POST to another script. In this 
> other script the variables/values pairs are used.
> I tested these scripts on several ISP's, no problem everything goes fine.
> Now I migrate the scripts to a different ISP, and voila, the input fields are not 
> transported. Everything is empty.
> 
> Anybody has any idea why this is? is this a PHP configuration thing? Maybe something 
> to do with GPC order??
> 
> Any idea's are most welcome!
> 
> thx Wilbert
> 
> -
> Pas de Deux
> Van Mierisstraat 25
> 2526 NM Den Haag
> tel 070 4450855
> fax 070 4450852
> http://www.pdd.nl
> [EMAIL PROTECTED]
> -

-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP parser extension?

2003-06-24 Thread Robert Cummings
I don't know that this kind of funcitonality exists, but that would be
a sweet deal if it did.

Cheers,
Rob.

anzenews wrote:
> 
> Hi!
> 
> I hope this is the right newsgroup for posting this... PHP.dev doesn't seem
> to be alive anymore?
> 
> Is there some extension or anything that would allow me to hook my code to
> PHP parser? Even lex and yacc for PHP would be great...
> What I want to do is this: lets say tou want to extract all comments from
> PHP code. Sure, you can search for '/*' and '*/', and take everything in
> between as a comment, but it is not really an idiot-proof way of doing it.
> The Right Way (tm) would be to have a parser to do it. There are no tools
> to produce a parser in PHP available (at least to my knowledge) and we
> don't want to build it from the scratch (it is possible, but not the
> easiest way) - but we do have tools that could build such parser in C (lex
> & yacc). And since C is the language used for writing extensions to PHP, we
> can do it - we just take zend-scanner.l and zend-parser.y and replace all
> the code that interprets PHP with the code that prints out comments - piece
> of cake. The only problem is - I really wouldn't want to dl() it every time
> I need it, not to mention the fact that it is not possible with ISPs that
> have secure mode enabled, besides - PHP parser changes from time to time.
> To think I should have to support such code for every possible application
> gives me creeps. The solution is simple: such extension should be in the
> main PHP distribution, but instead of doing predetermined things (like
> printing out comments) it should allow developers to hook their own
> function wherever they wish - as the code was being parsed, these functions
> would get called.
> 
> Now for the questions:
> - has anyone done someting like this before?
> - license - is it OK to take zend_scanner.l and zend_parser.y - I guess the
> extension should be then published under Zend license, not GPL?
> - is anyone interested in such an extension anyway?
> 
> There are many possible applications that could use such extension:
> documentation generator (one that works whatever the code), obfuscator,
> preprocessor,... It is advanced usage only as the developer should know
> about parsers, but still...
> 
> If there is enough interest, I could throw together an API of some sort,
> maybe even whole extension... Please comment, send opinions, answers,...
> 
> Please do not send mail privately as I have this address just for posting
> to newsgroups - I will not receive it.
> 
> By!
> 
> Anze
> 
> (By the way, about idiot-proof programs: "Programming is a race between
> programmers and universe; programmers, trying to build better idiot-proof
> programs, and universe, trying to build better idiots. So far, universe is
> winning.")
> 
> -
> Please do not send mail privately - I do NOT read mail sent
> to this address, it is used only for newsgroups (spam
> protection).
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: php caches mysql connections to same host

2003-06-24 Thread Robert Cummings

See the new_link parameter option for mysql_connect. It should solve
your problem. On the other hand, what you are doing is fine, I did it
for my pool since I can't use the new_link option because I'm retaining
compatibility back to PHP 4.1.2

Cheers,
Rob.


dorgon wrote:
> 
> for better understanding:
> 
> 
>$conn1 = mysql_connect("localhost", "user", "pwd");
>mysql_select_db("database1", $conn1);
> 
>$conn2 = mysql_connect("localhost", "user", "pwd");
>mysql_select_db("database2", $conn2); // select two diff. DBs
> 
>echo $conn1."";
>echo $conn2."";
> 
> 
> returns:
>Resource id #2
>Resource id #2
> 
> BUT:
>$conn1 = mysql_connect("127.0.0.1", "user", "pwd");
>mysql_select_db("database1", $conn1);
>$conn2 = mysql_connect("localhost", "user", "pwd");
>mysql_select_db("database2", $conn2); // select two diff. DBs
> 
> ...returns two different resource IDs (which I'd like to have).
> 
> When using mysql_pconnect I'm always getting correctly different
> resource ids.
> 
> /dorgon
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Error reporting at runtime

2003-06-25 Thread Robert Cummings
This is hardly perfect since it shows all errors, but it works for me:

ini_set( 'display_errors',   1 );
ini_set( 'log_errors',   1 );
ini_set( 'error_reporting', -1 );


Anthony wrote:
> 
> I have error reporting turned off in my php.ini file on my production
> server.  I have an app I'm writing that I need to run on the same server (no
> one can see it though).  Anyway.  I want to turn on error reporting during
> runtime for this particular app while I'm debugging it.  so I put
> error_reporting (E_ERROR | E_WARNING | E_PARSE | E_NOTICE); in the script,
> but I don;t see any warnings.  I also tried error_reporting(2047); or
> error_reporting(8);  still nothing.  To sest it, I tried to echo some random
> variable that doesn't exist in the very next line, but no warning about it.
> So what gives?  What am I doing wrong?  Basicaly I want the same effect as
> if I had error_reporting  =  E_ALL set in php.ini.
> 
> - Anthony
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP 5.0.0 Beta 1

2003-06-29 Thread Robert Cummings
On Sun, 2003-06-29 at 14:19, Sterling Hughes wrote:
>
>   - Due to issues surrounding the MySQL 4.0 license, the MySQL libraries
> are no longer bundled with PHP.  For more information on these
> licensing changes please see the MySQL licensing policy [1]
>
> [1] http://www.mysql.com/products/licensing.html

I read the licensing information in the above link, but I'm curious what
exactly in it necessitated the need to unbundle MySQL? Anyone have a
quick answer?

Cheers,
Rob.
-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: [PHP-QA] Re: [PHP] PHP 5.0.0 Beta 1

2003-06-29 Thread Robert Cummings
Ahhh crap. I read the PHP license a long time ago. I guess time faded my
memory and I began to think of it as GPL.

Thanks,
Rob.

On Sun, 2003-06-29 at 15:02, Derick Rethans wrote:
> On Sun, 29 Jun 2003, Robert Cummings wrote:
> 
> > On Sun, 2003-06-29 at 14:19, Sterling Hughes wrote:
> > >
> > >   - Due to issues surrounding the MySQL 4.0 license, the MySQL libraries
> > > are no longer bundled with PHP.  For more information on these
> > > licensing changes please see the MySQL licensing policy [1]
> > >
> > > [1] http://www.mysql.com/products/licensing.html
> > 
> > I read the licensing information in the above link, but I'm curious what
> > exactly in it necessitated the need to unbundle MySQL? Anyone have a
> > quick answer?
> 
> It's GPL.
> 
> Derick
> 
> -- 
> "Interpreting what the GPL actually means is a job best left to those
> that read the future by examining animal entrails."
> -
>  Derick Rethans http://derickrethans.nl/ 
>  International PHP Magazine  http://php-mag.net/
> -
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] question about executing a bash shell script...

2002-08-16 Thread Robert Cummings

Kelly Meeks wrote:
> 
> Hi folks,
> 
> I'm learning shell scripting via linux, and have written a script that creates the 
>core files necessary for a users website from a master set of files.
> 
> Works from the shell just fine (bash makethesite.sh username pathtoputfiles 
>pathtogetfiles)
> 
> Trying to execute this via php, and it literally does nothing.
> 
> If I try something like:
> $bashoutput=shell_exec('bash makethesite.sh username pathtoputfiles pathtogetfiles');
> echo $bashoutput;
> 
> I get nothing output, and the script doesn't execute.


I'm asuming you are executing something like the following:

php myPhpScript.php

The following will probably give you the desired results...

php -qC myPhpScript.php

This prevents PHP from switching out of the current directory.

HTH,
Rob.
-- 
.-.
| Robert Cummings |
:-`.
| Webdeployer - Chief PHP and Java Programmer  |
:--:
| Mail  : mailto:[EMAIL PROTECTED] |
| Phone : (613) 731-4046 x.109 |
:--:
| Website : http://www.webmotion.com   |
| Fax : (613) 260-9545 |
`--'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] question about executing a bash shell script...

2002-08-16 Thread Robert Cummings

Kelly Meeks wrote:
> 
> Hi Robert,
> 
> Thanks so much for the prompt reply.
> 
> Actually, I'm not trying to execute a php script, I'm trying to execute a
> shell (bash) script.
> 
> This works at the command line:
> bash makethesite.sh param1 param2 param3
> 
> This doesn't work via php
> $bashresult=shell_exec('bash makethesite.sh param1 param2 param3');
> echo $bashresult;

You are trying to execute a bash script from PHP though. When you invoke
the php engine it usually changes directory (to the root defined in the
php.ini I think). To stop this so that it will remain in the current
directory so that when you run bash it will see the bash script in the
current directory, you need to use the -C command line option. I believe
your environment is inherited by php and subsequently bash and so if
you don't use the -C option bash will be looking in the wrong directory.

Cheers,
Rob.

> 
> Doesn't execute the script, nothing in $bashresult
> 
> Kelly
> - Original Message -
> From: "Robert Cummings" <[EMAIL PROTECTED]>
> To: "Kelly Meeks" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Friday, August 16, 2002 4:44 PM
> Subject: Re: [PHP] question about executing a bash shell script...
> 
> > Kelly Meeks wrote:
> > >
> > > Hi folks,
> > >
> > > I'm learning shell scripting via linux, and have written a script that
> creates the core files necessary for a users website from a master set of
> files.
> > >
> > > Works from the shell just fine (bash makethesite.sh username
> pathtoputfiles pathtogetfiles)
> > >
> > > Trying to execute this via php, and it literally does nothing.
> > >
> > > If I try something like:
> > > $bashoutput=shell_exec('bash makethesite.sh username pathtoputfiles
> pathtogetfiles');
> > > echo $bashoutput;
> > >
> > > I get nothing output, and the script doesn't execute.
> >
> >
> > I'm asuming you are executing something like the following:
> >
> > php myPhpScript.php
> >
> > The following will probably give you the desired results...
> >
> > php -qC myPhpScript.php
> >
> > This prevents PHP from switching out of the current directory.
> >
> > HTH,
> > Rob.
> > --
> > .-.
> > | Robert Cummings |
> > :-`.
> > | Webdeployer - Chief PHP and Java Programmer  |
> > :--:
> > | Mail  : mailto:[EMAIL PROTECTED] |
> > | Phone : (613) 731-4046 x.109 |
> > :--:
> > | Website : http://www.webmotion.com   |
> > | Fax : (613) 260-9545 |
> > `--'
> >

-- 
.-.
| Robert Cummings |
:-`.
| Webdeployer - Chief PHP and Java Programmer  |
:--:
| Mail  : mailto:[EMAIL PROTECTED] |
| Phone : (613) 731-4046 x.109 |
:--:
| Website : http://www.webmotion.com   |
| Fax : (613) 260-9545 |
`--'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] secure files acess

2002-08-16 Thread Robert Cummings

David Buerer wrote:
> 
> I have a bunch of files which need to be kept secure. I need to allow a user
> access to them them based on a criteria which I can programmatically
> determine.
> 
> My question, is how can I allow the user to download or view only one file
> on my computer without allowthem to just enter the URL into their browser of
> the file and view it?

Have a php script authenticate the user, then if authenticated, use the
reafile() function to output it to the user directly. Since PHP can see
more than just the web space the files just need to reside outside of
the websapce.

Cheers,
Rob.
-- 
.-----.
| Robert Cummings |
:-`.
| Webdeployer - Chief PHP and Java Programmer  |
:--:
| Mail  : mailto:[EMAIL PROTECTED] |
| Phone : (613) 731-4046 x.109 |
:--:
| Website : http://www.webmotion.com   |
| Fax : (613) 260-9545 |
`--'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] secure files acess

2002-08-16 Thread Robert Cummings

Robert Cummings wrote:
> 
> David Buerer wrote:
> >
> > I have a bunch of files which need to be kept secure. I need to allow a user
> > access to them them based on a criteria which I can programmatically
> > determine.
> >
> > My question, is how can I allow the user to download or view only one file
> > on my computer without allowthem to just enter the URL into their browser of
> > the file and view it?
> 
> Have a php script authenticate the user, then if authenticated, use the
> reafile() function to output it to the user directly. Since PHP can see
  ^^^^^

readfile() even :p

Cheers,
Rob.
-- 
.-.
| Robert Cummings |
:-`.
| Webdeployer - Chief PHP and Java Programmer  |
:--:
| Mail  : mailto:[EMAIL PROTECTED] |
| Phone : (613) 731-4046 x.109 |
:--:
| Website : http://www.webmotion.com   |
| Fax : (613) 260-9545 |
`--'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] secure files acess

2002-08-16 Thread Robert Cummings

David Buerer wrote:
> 
> Thankyou Robert, THat is a great and easy way to do it.
> 
> What if I need to initiate a download to the user?

If you set the mime type properly the browser will
automatically make it a download versus displaying it.

Cheers,
Rob.
-- 
.-----.
| Robert Cummings |
:-`.
| Webdeployer - Chief PHP and Java Programmer  |
:--:
| Mail  : mailto:[EMAIL PROTECTED] |
| Phone : (613) 731-4046 x.109 |
:--:
| Website : http://www.webmotion.com   |
| Fax : (613) 260-9545 |
`--'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] resizing an image

2002-08-29 Thread Robert Cummings

ROBERT MCPEAK wrote:
> 
> Could someone show me some php that proportionally resizes an image?
> I'm collecting user sumbitted images and need them all to be within
> certain size constraints.  What's the simplest, best way to do this?
> 
> Sample code would be a huge help, as I'm a newbie and have not done
> anything with PHP image processing functions.

*sheesh* read the first comment at:

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

-- 
.-.
| Robert Cummings |
:-`.
| Webdeployer - Chief PHP and Java Programmer  |
:--:
| Mail  : mailto:[EMAIL PROTECTED] |
| Phone : (613) 731-4046 x.109 |
:--:
| Website : http://www.webmotion.com   |
| Fax : (613) 260-9545 |
`--'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Writing Files

2002-08-30 Thread Robert Cummings

Georgie Casey wrote:
> 
> How do you write files so that theyre chmoded 777 by default. the folders
> theyre written to are 0777 but the files aren't. so i cant delete or modify
> the files through PHP, i have to first chmod them with FTP, which takes
> ages.

There are a number of things you may find useful to read about in PHP:

chmod
chown
umask

Also you might want to look into the sticky bit for directories. Someone
feel like adding more about sticky bits... I'm pretty vague on them, just
know when they're set (and I don't remember how to) that files written
to the directory inherit group ownership.

Cheers,
Rob.
-- 
.-.
| Robert Cummings |
:-`.
| Webdeployer - Chief PHP and Java Programmer  |
:--:
| Mail  : mailto:[EMAIL PROTECTED] |
| Phone : (613) 731-4046 x.109 |
:--:
| Website : http://www.webmotion.com   |
| Fax : (613) 260-9545 |
`--'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Any netscape users out there?

2002-09-03 Thread Robert Cummings

Netscape 4.xx series is notorious for caching issues. When you post data and then
try to view the source code netscape thinks it has expired and thus gone. Another
issue is when you resize the view source window, netscape reloads the page *ack*.
On my site at http://www.wocmud.org I think my no cache headers even cause netscape
to choke since I can't get page source on any of my pages in the 4.xx series. My
solution is to use Mozilla/Netscape 7 to view the source when I need to and just
use the 4.xx brokwser when I want to make sure it looks ok visually.

HTH,
Rob.
---

"Ashley M. Kirchner" wrote:
> 
> Dan Ostrowski wrote:
> 
> > Post data makes Netscape REFUSE to show the underlying source code!  It's 
>virtually impossible to design form handling stuff when I can't see the code that's 
>generated when i send post data.  Is this a bug and how do you fix it??
> 
> i've never seen this problem in ns, at least not with the stuff i've designed in 
>the past.  do you have a page/form somewhere we could look at?

-- 
.-.
| Robert Cummings |
:-`.
| Webdeployer - Chief PHP and Java Programmer  |
:--:
| Mail  : mailto:[EMAIL PROTECTED] |
| Phone : (613) 731-4046 x.109 |
:--:
| Website : http://www.webmotion.com   |
| Fax : (613) 260-9545 |
`--'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Any netscape users out there?

2002-09-03 Thread Robert Cummings

Shouldn't be any bleeding from shared libraries. but then I'm on Linux
and your probably under windows, and so I don't know for sure anymore :)

Cheers,
Rob.

Dan Ostrowski wrote:
> 
> Which is strange because I use Netscape 6. Hmm... Perhaps I should upgrade to 7.
> 
> Also, would the fact that I have Netscape 4.x installed on the same machine as my 
>Netscape 6 cause anything funny to "bleed" over, you think? Perhaps its a shared 
>library thing..
> 
> hmmm...
> 
> Well thanks for the advice...
> 
> regards,
> dan

-- 
.-.
| Robert Cummings |
:-`.
| Webdeployer - Chief PHP and Java Programmer  |
:--:
| Mail  : mailto:[EMAIL PROTECTED] |
| Phone : (613) 731-4046 x.109 |
:--:
| Website : http://www.webmotion.com   |
| Fax : (613) 260-9545 |
`--'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




  1   2   3   4   5   6   7   8   9   10   >