Re: [PHP] Auto submit form, How?

2001-06-30 Thread Peter Dudley

http://www.devguru.com/Technologies/ecmascript/quickref/select.html

Javascript.  Use onBlur or onChange and call document.formname.submit().

Pete.

"Fates" <[EMAIL PROTECTED]> wrote in message
20010629125135.ELXV13240.femail10.sdc1.sfba.home.com@localhost">news:20010629125135.ELXV13240.femail10.sdc1.sfba.home.com@localhost...
> How do I auto load or auto submit a form on the same page?  I don't want
> to have to press the submit button instead just click on a value in the
> drop down form and it loads (I am lazy).
>
> Using php4.something
>
> --
> This email was sent using w3mail.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>



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




Re: [PHP] session question

2001-06-21 Thread Peter Dudley

There is a useful article here:
http://phpbuilder.com/columns/ying2602.php3?page=1

As to "up to a million users" logged in at once... don't you wantto have
multiple redundant web servers running under a load balancer?  If the rest
of your system can handle that many concurrent users, then I doubt PHP
sessions will be much more of a strain on your system... unless you're
storing some huge amount of data in each session.

Pete.

> ""Moax Tech List"" <[EMAIL PROTECTED]> wrote in message
00b101c0fa15$e47c4320$9865fea9@moax01">news:00b101c0fa15$e47c4320$9865fea9@moax01...
> I am setting up a website with a need to use some sort of
> session management for a large amount of users. I cannot
> use typical file based session managment because at any
> given time there could be up to a million users logged in
> at once. (It is a LAMP linux/apache/php4/mysql system).
> I am a bit confused though as how to go about this. The
> user will be authenticated by verifying a username/password
> combo in a database, and then a session created.
> My question is this:
> After authentication, which type of session managment
> should I use? I mean, just do the standard php stuff with
> the session_ functions? (wo'nt this be bad with the # of
> simoltaneous users i need to support, because of the # of
> files on the server?) Or, shall I use something more complex
> like PHPLIB or create my own scheme using mysql? Is
> there any exisiting code/functions that can make creating
> my own scheme easier in order to support mysql or am i
> way off with this question? I just need a bit of direction
> here and any help is appreciated. Thanks!



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




Re: [PHP] General Coding Question

2001-06-20 Thread Peter Dudley

You don't use a lot of javascript, do you?


""Chris Lee"" <[EMAIL PROTECTED]> wrote in message
9gr5f9$v2$[EMAIL PROTECTED]">news:9gr5f9$v2$[EMAIL PROTECTED]...
> im here to start a flamewar.
>
> dont use " then. why not use ' ?
>
>   echo "
>   
>"
>
>   echo "
>   
>"
> I like the second. it is proper html check it with w3.org.




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




Re: [PHP] Form security

2001-05-24 Thread Peter Dudley

Are you using sessions?  You can register a tracking variable on the form
page and then check that variable on the processing page.  If the posted
data comes from any page other than the one that you want it to, the
variable will not be set.  Not 100% sure, but I think this covers what
you've asked.

Pete.

""phpman"" <[EMAIL PROTECTED]> wrote in message
9ejeqp$gm7$[EMAIL PROTECTED]">news:9ejeqp$gm7$[EMAIL PROTECTED]...
> Other then checking the referer (to make sure the posted data came from
the
> right page) and user agent (to see if it exists), is there any other way
to secure a
> form from having other forms submitting to it?
>
> -dave




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




Re: [PHP] Interesting Problem (Sessions and Cookies)

2001-05-24 Thread Peter Dudley

You can indeed do this in javascript.  You need to put a FORM on the page in
the other frame and then access the data elements in that form with the
syntax
parent.frame[x].formname.elementname.value
or something along those lines.

This gets pretty ugly pretty quickly, IMO.  Also, I think you could run into
some real problems if the user opens multiple browser windows for these
pages... you could easily get data that is out of sync with what is stored
on the server in the example you gave if the user opened two windows and
began modifying the data in the two forms in both windows.

I think you'd essentially be swapping one set of problems for another set of
problems.

Pete.


""Jason Caldwell"" <[EMAIL PROTECTED]> wrote in message
9ejakc$32m$[EMAIL PROTECTED]">news:9ejakc$32m$[EMAIL PROTECTED]...
> Is there a way to store users input on *another* page (i use frames), in
> hidden fields, then be able to update those hidden fields as the user goes
> along, also, be able to extract that data when a user returns back to a
> previous form?
>
> I'm thinking of using this instead of Sessions or Cookies.  Basically a
> blank page that will hold all the data from the input fields, allowing a
> user (should they need to go back, say, to form1 to make some changes,
when
> they click submit, form2 will still contain the data they previously
entered
> and will not be blank, as is normally the case.)
>
> Thanks
> Jason




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




Re: [PHP] PHP & XML Parsing

2001-05-23 Thread Peter Dudley

> Interesting..  So to be consistent with proper XML formatting,
> should the server hosting the XML file convert the & into
> & ?

It depends on the situation, I believe.  The server that sends you XML
should indeed provide you well-formed XML, which it's not doing.  Probably
what should happen is that the server sending the XML should urlencode URLs
in the cdata elements, and then after you parse the XML file you should
urldecode the URLs.  I would be surprised if this hasn't been done as some
standard part of XML parsing and I've just missed it in my limited use of
XML parsers.

> I certainly feel like I'm missing something...  Although I'm a bit at
> odds as to how to troubleshoot this new file.
> I no longer get the errors, but I'm not getting the results I'm looking
for either.


I'm not sure what results you're looking for exactly, but if you put in a
bunch of echo statements at various points throughout your parsing routines,
you will see that none of the "if x = y" conditions are matching.  Here's
what I'd recommend:

1.  put in a bunch of echo statements to print out your variables at
different points in your parsing, just to make sure it's doing what you
expect it to.  Do a full audit of your characterData routine through this
method, and I think it will show you where the errors are.  (I did not see
the exact error right away so I gave up since I do have a day job.  :-)

2.  keep your first eregi_replace statement, then when you're printing out
the links, re-convert it with a reverse eregi_replace to turn the & back
into a simple &.  This will send it to the HTML browser in the format you
want, I hope.

I hope this is of some help.

Pete.



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




Re: [PHP] Passing variables

2001-05-23 Thread Peter Dudley

You can "pass" variables through the session mechanism.
http://www.php.net/manual/en/ref.session.php

This will require some additional work to get your sessions working
properly, but you probably want to do that anyway at some point.  I have
found the session mechanism to be extremely useful so far, though to this
point it's only been in a development (not production) environment.

Pete.
PS:  If you want to get really ugly, you can have all your links actually be
javascript functions that submit a form full of hidden elements via POST.
Uglier and more bug-prone than including them in the link URL, but you don't
run into URL length limits and you don't get people quite as easily changing
the values to see what happens.

> Is there any other way of passing variables other than submitting them
> through a form and passing them using a URL? E.G. Currently I am passing
> them though a url which is not the safest means in anyway.




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




Re: [PHP] Class var not retaining values

2001-05-21 Thread Peter Dudley

Could it be that you need your for loop to iterate <= instead of < ?  As it
is, I don't think it will ever show anything.  After all, you are setting
$index to 0 at the beginning of the function every time you call it.

My guess is you actually want to keep track of $index as an instance
variable outside the function and reference it via $this->index in all the
places where you have $index.

class AR {
var $index = 0;

function AddReason($score, $reason, $id)
 {
  $this->reasons[$this->index] = "$score|$reason|$id";
  for ($i = 0; $i <= $this->index; $i++)
  {
   $out = $this->reasons[$i];
   echo "$out...";
  }
  $this->index++;
  return $score;
 }
}



Pete.

""Bob"" <[EMAIL PROTECTED]> wrote in message
9ec2rm$etg$[EMAIL PROTECTED]">news:9ec2rm$etg$[EMAIL PROTECTED]...
> I have a class defined with a var $reasons that I will use as an array.
The
> code to add to it is:
>
>  function AddReason($score, $reason, $id)
>  {
>   static $index = 0;
>   $this->reasons[$index] = "$score|$reason|$id";
>   for ($i = 0; $i < $index; $i++)
>   {
>$out = $this->reasons[$i];
>echo "$out...";
>   }
>   $index++;
>   return $score;
>  }
>
> However, every time I call it, the value stored in the reasons array seems
> to disappear, and the array holds no data.  It seems to be behaving like a
> local variable, even though it is in a class.  Any suggestions would be
> greatly appreciated.
>
> Thanks



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




Re: [PHP] PHP & XML Parsing

2001-05-18 Thread Peter Dudley

The problem is in your link URL, where you pass CGI parameters.  When XML
sees the & character, it assumes it's a special character thing such as
& or ", so it's expecting a semicolon.

http://cupe.ca/news/cupenews/showitem.asp?ID=2823&cl=1

Just yesterday I discovered a program called XML Spy which you can get on a
30-day eval from www.tucows.com.  This was what pointed out the error to me
in your file.

When I was using XSL last year for the first time, I had a devil of a time
figuring out how to get URLs, particularly with query strings attached,
through the XML parsers.  Try using the %codes in your URLs instead of & and
other special characters; that should help, if I remember correctly.
(Similarly, building HREF tags using XSL stylesheets seemed pretty awkward,
but I'm sure I was missing some crucial tidbit of information.)

Pete.

"Mike Gifford" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello,
>
> In looking for a good script to parse XML files I stumbled across the
following
> tutorial (which looks very good):
> http://www.wirelessdevnet.com/channels/wap/features/xmlcast_php.html
>
> I have set this script up here:
> http://www.airdiv-cupe.org/portal/newsfeed_new_parser.php
>
> and I keep getting the following error (even after making a number of
changes):
> XML error: not well-formed at line 16
>
> And I'm not sure how to troubleshoot this problem.
>
> I'm assuming that it is referring to line 16 on the XML file, in this
case:
> http://cupe.ca/xml/cupenews.rdf
>
> My parsing definitions are as follows
>$itemTitleKey = "^rdf^item^title";
>$itemLinkKey = "^rdf^item^link";
>$itemDescKey = "^rdf^item^description";
>
> Any help would be appreciated.
>
> Mike




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




Re: [PHP] Why is this not working

2001-05-17 Thread Peter Dudley

can you write directly to the password file using crypt() instead of trying
to run the htpasswd program?  I think I used to do this in Perl, but it's
been a LONG time since I tried it.  I think it worked, though.

Pete.
PS:  I'm also pretty sure that if you can't write direclty to the .htpasswd
file, you can specify multiple password files in your .htaccess file, and
you should be able to write to an alternative password file.

""YoBro"" <[EMAIL PROTECTED]> wrote in message
9e1okc$3de$[EMAIL PROTECTED]">news:9e1okc$3de$[EMAIL PROTECTED]...
> The .htpasswd file lives in the root of my user account.
> ie:
>
> [www] directory
>  .htpasswd file
>
> It then goes:
>
> [www]
>  |
>  [public_html]
>  [htocs]
>   |
>   All website content etc
>
> If I go beyond the www directory, I get a list of hundreds of directories
> and files.
> This is where I found the the htpasswd executable under
>
> /usr/local/bin
>
> Even if i define that path in my code it is still not working
> The output of ls the root beyond www dir is far to much to put into this
> message.
>
> Is that what you were asking, or am on the wrong track?
>
> YoBro
>
>
>
>
> "MaD dUCK" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > also sprach YoBro (on Fri, 18 May 2001 10:45:12AM +1200):
> > > If I try su nobody it asks for nobody's password. If i enter no
> > > password a I get Authentication denied.
> >
> > you aren't root.
> >
> > can you give me an output of 'ls -l '
> >
> > martin;  (greetings from the heart of the sun.)
> >   \ echo mailto: !#^."<*>"|tr "<*> mailto:"; net@madduck
> > --
> > printer not ready.
> > could be a fatal error.
> > have a pen handy?
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>



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




Re: [PHP] References & Object XML-Parser

2001-05-16 Thread Peter Dudley

I am new to PHP's OO (though not to OO or to PHP), but here's a fix and my
assessment of why it works:

In your tag functions, you need to change the $this reference to instead
refer to your $xml_parser object, thus:

function tag_open($parser,$tag,$attributes) {
global $xml_parser;
$xml_parser->result .= "TAG: ".$tag."";
}

My speculation as to why this happens is that the actual parsing is going on
in the parser object you create in the xml() function.  The tag_open
function is being called not as a method in your xml class but rather as a
simple callback function, so it does not get all the context of the xml
object... instead, it has the context of the parser object.  So if you bring
the $xml_parser variable in as a global and then use it to set your result
variable, you should see the results you're looking for (I did).

Pete.


"Mirek Novak" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi,
>
> I'm new to this list, and was forced to join because of following
> problem, BTW searching through the archive ended without any useable
> results. The problem is in following code - which is little extended
> source from example in manual entry for xml_set_object() function. I've
> added one member variable called result and there I'm storing everything
> what is parsed through parser - I want to have control over what is
> parsed - then, when I wanted to show the result - variable was empty,
> but when u'll  uncomments line in tag_open() function, will see
> interesting results - var. is being updated.
> Where is mistake?
>
> Mirek Novak
>
> -  PHP code follows
> 
>  class xml {
> var $parser;
> var $result;
>
> function xml() {
> $this->parser = xml_parser_create();
> $this->result="result";
> xml_set_object($this->parser,&$this);
> xml_set_element_handler($this->parser,"tag_open","tag_close");
> xml_set_character_data_handler($this->parser,"cdata");
> }
>
> function parse($data) {
> xml_parse($this->parser,$data);
> }
> function tag_open($parser,$tag,$attributes) {
> var_dump($parser,$tag,$attributes);
> $this->result.="TAG: ".$tag."";
>
> // if u uncomment line below, U'll see, that $this->result really
> contains what it shoud
> // echo $this->result;
> }
>
> function cdata($parser,$cdata) {
> var_dump($parser,$cdata);
> $this->result.="DATA: ".$cdata."";
> }
>
> function tag_close($parser,$tag) {
> var_dump($parser,$tag);
> }
>
> }
>
>
> $xml_parser = new xml();
> $xml_parser->parse("PHP");
> echo $xml_parser->result;
>
> ?>




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




Re: [PHP] PHP & Java ?

2001-05-04 Thread Peter Dudley

If it's javascript, then be careful about echoing PHP variables into
Javascript strings.  If you have something like (in Javascript)

var myString = '';

and $phpString contains any apostrophes, then the javascript will break
because Javascript thinks the string has ended prematurely.  E.g, if
$phpString is "My cat's pajamas" then the javascript would be sent to the
browser thus:

var myString = 'My cat's pajamas';

and you can see that there are too many single quotes, which will, of
course, cause Javascript's high-powered debugging utilities to kick in and
give you a highly useful error report.

Pete.

> While working on some web sites which contain mouse over java, and then
> adding in some db stuff via php/mysql, the java seems to break.
> Is there something special I need to do to prevent that break?
> Is this a common problem?
> Does using templates get around that problem ?




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




[PHP] need CORBA/satellite examples

2001-05-03 Thread Peter Dudley

I have been searching for some time now for examples of code that uses =
satellite, but the best I can find is the README and the entries in the =
PHP manual.  Can anyone point me to code that uses satellite that I can =
learn from (or if you have code you don't want to post, feel free to =
send directly)?  I'm new to the specifics of CORBA, so seeing relevant =
PHP code while wading through other CORBA docs would be very helpful.

Thank you for any assistance!

Pete