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




[PHP] problem with cookies

2001-05-20 Thread Peter Knif

Hi! I'm trying to write a simple script that would set a cookie. I keep
receiving the following message:

Warning: Cannot add header information - headers already sent by (output
started at e:\inetpub\wwwroot\PHP\game.php:85) in
e:\inetpub\wwwroot\PHP\game.php on line 87

Here's the code:

85  echo "showing results\n";
86  echo "Right answers = $right\n";
87  setcookie("cookie_value", $right, time()+3600);

Could someone tell me what might cause this problem? Thanks.


--
* Peter Knif *

[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] problem with cookies

2001-05-20 Thread Peter Knif

never mind, I solved the problem.

--
* Peter Knif *

[EMAIL PROTECTED]
""Peter Knif"" <[EMAIL PROTECTED]> wrote in message
9e7ror$mp0$[EMAIL PROTECTED]">news:9e7ror$mp0$[EMAIL PROTECTED]...
> Hi! I'm trying to write a simple script that would set a cookie. I keep
> receiving the following message:
>
> Warning: Cannot add header information - headers already sent by (output
> started at e:\inetpub\wwwroot\PHP\game.php:85) in
> e:\inetpub\wwwroot\PHP\game.php on line 87
>
> Here's the code:
>
> 85  echo "showing results\n";
> 86  echo "Right answers = $right\n";
> 87  setcookie("cookie_value", $right, time()+3600);
>
> Could someone tell me what might cause this problem? Thanks.
>
>
> --
> * Peter Knif *
>
> [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] 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] 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] 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] 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] 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] 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] 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]




[PHP] PHP Uptime error

2001-06-24 Thread Peter Phillips

I have a PHP script with the following code in it;

$uptime = passthru ("/usr/bin/uptime");

but when I load the PHP page I get the following;

8:26pm up 0 min, 0 users, load average: 0.00, 0.00, 0.00

which is wrong (I have checked the uptime via telnet).  Can anybody please
help me try and fix this?

Thanks.

--
"Keyboard not detected, press F1 to continue..."




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

2001-06-26 Thread Peter Phillips

Thanks for your help, this is what I get when I try a uptime while logged in
as nobody.


host:/# su nobody
host:/$ uptime
Error: /proc must be mounted
  To mount /proc at boot you need an /etc/fstab line like:
  /proc   /proc   procdefaults
  In the meantime, mount /proc /proc -t proc
Error: /proc must be mounted
  To mount /proc at boot you need an /etc/fstab line like:
  /proc   /proc   procdefaults
  In the meantime, mount /proc /proc -t proc
  2:38am  up 0 min,  1 user,  load average: 0.00, 0.00, 0.00


These are the permissions is /proc:
-r--r--r--   1 root root0 Jun 26 02:39 loadavg
-r--r--r--   1 root root0 Jun 26 02:33 uptime

What should they be to enable nobody to access uptime?

Thanks again.

--
"Keyboard not detected, press F1 to continue..."

""Tim Zickus"" <[EMAIL PROTECTED]> wrote in message
002901c0fd67$2c251360$0401a8c0@lan">news:002901c0fd67$2c251360$0401a8c0@lan...
>
> Check the permissions on the files in /proc, which is where uptime gets
its
> info from, most likely.
>
> You could probably even read the pseudo-file '/proc/loadavg' as 'nobody'
> directly from PHP given the appropriate file permissions.
>
> - Tim
>   http://www.phptemplates.org
>
> > Richard Lynch's advice was correct, I cannot run uptime under nobody for
> > some reason.  Does anyone know how to change this?  The permissions are
> set
> > to allow everyone to execute it.
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>



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




Re: [PHP] PHP Uptime error

2001-06-27 Thread Peter Phillips

Thanks for everyone's help, it was the permissions on /proc that were
causing the problems.  I changed it to 755 and everything is working
perfectly.

Thanks again.

--
"Keyboard not detected, press F1 to continue..."

""Peter Phillips"" <[EMAIL PROTECTED]> wrote in message
9h9e9k$dti$[EMAIL PROTECTED]">news:9h9e9k$dti$[EMAIL PROTECTED]...
> Thanks for your help, this is what I get when I try a uptime while logged
in
> as nobody.
>
> 
> host:/# su nobody
> host:/$ uptime
> Error: /proc must be mounted
>   To mount /proc at boot you need an /etc/fstab line like:
>   /proc   /proc   procdefaults
>   In the meantime, mount /proc /proc -t proc
> Error: /proc must be mounted
>   To mount /proc at boot you need an /etc/fstab line like:
>   /proc   /proc   procdefaults
>   In the meantime, mount /proc /proc -t proc
>   2:38am  up 0 min,  1 user,  load average: 0.00, 0.00, 0.00
> 
>
> These are the permissions is /proc:
> -r--r--r--   1 root root0 Jun 26 02:39 loadavg
> -r--r--r--   1 root root0 Jun 26 02:33 uptime
>
> What should they be to enable nobody to access uptime?
>
> Thanks again.
>
> --
> "Keyboard not detected, press F1 to continue..."
>
> ""Tim Zickus"" <[EMAIL PROTECTED]> wrote in message
> 002901c0fd67$2c251360$0401a8c0@lan">news:002901c0fd67$2c251360$0401a8c0@lan...
> >
> > Check the permissions on the files in /proc, which is where uptime gets
> its
> > info from, most likely.
> >
> > You could probably even read the pseudo-file '/proc/loadavg' as 'nobody'
> > directly from PHP given the appropriate file permissions.
> >
> > - Tim
> >   http://www.phptemplates.org
> >
> > > Richard Lynch's advice was correct, I cannot run uptime under nobody
for
> > > some reason.  Does anyone know how to change this?  The permissions
are
> > set
> > > to allow everyone to execute it.
> >
> >
> >
> > --
> > 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] 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]




[PHP] -help

2001-07-06 Thread Peter Mead

-help


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




[PHP] max_execution_time & header

2001-07-09 Thread Peter Schumacher

I'm trying to backup a huge amount of data comming from a MySQL database.

It seems that my script times out before it is done.
I'm unable to persuade my ISP to raise the max_execution_time and thought of
using redirects instead (header).

I've written a script that backs up 500 rows and then redirects to a simple
script that in turn redirects back to my main script (with an offset).

I still run into the max_execution_time!!! I thought it would be reset as I
redirect to another page.

Any help appreciated.

Regards,

Peter Schumacher



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




[PHP] Re: HELP XML XML XML HELP

2001-12-06 Thread Peter Clarke

yes, echo the xml but send a header telling the browser it's xml:

header("Content-Type: text/xml");



"Olivier Masudi" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
>
>
> http://www.test.com/test.php?orderid=xyz
>
>
> test.php has to make a request to DB mysql and return a xml page like this
:
>
> 
>  amount="1234"
> currency="BEF">
>
> How can I do that ?
>  Should I just use echo  ?
>
>
> Help
>
>
>
>


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




[PHP] Re: URGENT: IIS doesn't like GET or POST

2001-12-06 Thread Peter Clarke

Check 'register_globals' in php.ini
It sounds like it's off which is much more secure

Instead of getting:
$var
you'll have:
$HTTP_GET_VARS['var']

It stops people sending any variables in the script.

Peter

"Ron Newman" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi,
> When I pass form variables to PHP using either GET or POST it works under
> PWS running on "localhost", but when I run the same script remotely on a
> Win2K Advanced Server and IIS machine, I get "Warning, not defined" errors
> for all the variables passed.
>
> Is there some configuration problem with IIS, or am I overlooking
something
> else?
>
> Ron
>
>


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




[PHP] Re: Xml Parse Extended Chars

2001-12-06 Thread Peter Clarke

The only predefine entities in XML are < > &
all others need to be defined in the dtd.
Best thing to do is leave the charatef as is in the xml and only run
htmlentites on the contents when sending the contents to an html web
browser.
The xml will happily hold the character as it is.

If you're using the XML Parser functions, you can choose the "target"
character encoding:
  ISO-8859-1 (default)
  US-ASCII
  UTF-8



"Chris Noble" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Ive ran into a stumbling block trying to parse an xml document. I control
> the parsing and the creation of the xml document so I can do any changes
> from either side of it. Problem I have run into is my xml document has a é
> in it. Ive ran htmlentities on it and it converts it to é but
> everytime I try and run xml parse on that I get the error code of
"undefined
> entity at line 108". Has anyone ran into this problem before or know a
> solution to handle these issues?
>
> Chris Noble
>
>


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

2001-12-07 Thread Peter Lalka


Hi.
I've instaled and cofigured php4 on WinNT with Apache Web server.
I can't use any fuction of Image manipulation, 'cause I get this error
message: ImageGif: No GIF support in this PHP build
In phpinfo() is listed that: gd lib.> enabled, zlib lib.> enabled.
What do I still miss there?
Peter.


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




Re: [PHP] Re: Image problem

2001-12-07 Thread Peter Lalka


Thanks, in phpinfo list really isn't support for GIF:(
How can I manipulate jpeg images? Which functions are for this img. format?
P.


|+->
||  Johan <[EMAIL PROTECTED]> |
||  Odoslané kým:  |
||  php-general-return-77040-lalkap=emo.seas.sk@lis|
||  ts.php.net |
|| |
|| |
||  07.12.2001 14:30   |
|| |
|+->
  
>---|
  |
   |
  | Komu:   [EMAIL PROTECTED]  
   |
  | Kópia: 
   |
  |   Predmet:[PHP] Re: Image problem  
   |
  
>---|



> I've instaled and cofigured php4 on WinNT with Apache Web server.
> I can't use any fuction of Image manipulation, 'cause I get this error
> message: ImageGif: No GIF support in this PHP build
> In phpinfo() is listed that: gd lib.> enabled, zlib lib.> enabled.
> What do I still miss there?

In the newest version of GD library (think it since about 1.3 or something)

does support GIF, because GIF is a commerial image format.

Use PNG or JPEG instead. That much better, or find a version with GIF
support.

You can see what Image formats you GD can use by make a file with follow
content:


:o)

Regards,

Johan

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






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




[PHP] Re: [PEAR-DEV] Template class

2001-12-11 Thread Peter Bowyer

I think I've seen something like this before... hang on, isn't it called PHP???

Could you explain what advantages you see in doing it this way, as I can't 
see any :-(

Peter.

At 11:00 PM 12/10/01 +0100, Wolfram Kriesing wrote:
>(just in case any of the people on PEAR-DEV will read this at all,
>since everyone must be tired of the template class debates :-)  )
>
>i just wanted to say what i had to write, because i didnt see any of
>the existing template classes/engines provide me with that
>
>the main features are:
># compiling template class which (almost) only replaces '{' by and '}' by ?>, with pre and post filters
># uses indention to create the '{' and '}' for php-code inside the
>template, so clean code is a requirement and no closing tags like:
>{/if} are needed
># leaves all the power of php to you, not only the functionality the
>template engine implements
># nothing to learn, just use '{' and '}' instead of the php-tags in
>your template and indent your code properly
># the seperation of source and representation is all up to the
>programmer (either this is good or bad)
># provides some default filter
>
>
>a possible template
>-
>{if(sizeof($disadvantages))}
> {foreach($disadvantages as $aDisadvantage)}
> {$aDisadvantage}
>{else}
> no disadvantages registered yet :-)
>-
>
>the compiled code is nothing more than this
>-
>
> 
> 
>
> no disadvantages registered yet :-)
>
>-
>so you can see - easy to use, nothing to learn and should be fast :-)
>
>feel free to have a look at
> http://wolfram.kriesing.de/programming/
>
>
>
>PS: BTW what was the decision on a multiple classes in PEAR
>which do the same thing?
>
>--
>Wolfram
>
>--
>PEAR Development Mailing List (http://pear.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]

--oOo--
Narrow Gauge on the web - photos, directory and forums!
http://www.narrow-gauge.co.uk
--oOo--
Peter's web page - Scottish narrow gauge in 009
http://members.aol.com/reywob/
--oOo--


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

2001-12-12 Thread Peter Hicks

Armin,

It may be for your applications, and it may be for mine, but not everyone uses
MySQL, and MySQL support is only part of PHP itself.

Cater for the large 'minority' of people who don't use PHP + MySQL :)


Peter.


On 12 Dec 2001, Armin Hartinger wrote:

> Personally, I think it should be something f-based ... the f will then
> be replaced with the "ph" ... e.g. Phish etc...
>
> Also I think it should be something maritime ...
> Penguin, Dolphin
>
> After all, Linux, PHP & MySQL is the killer-combo, isn't it?
>
> -Armin
>
> On Tue, 2001-12-11 at 19:32, Andrew Chase wrote:
> > Maybe an animal beginning with "P" would be a good Mnemonic device (and good
> > for alliteration; think "The PHP Panda" or "The PHP Platypus".)  Hmm, I
> > guess Panda and Platypus aren't particularly "powerful" animals, though. :/
> >
> > Other animals beginning with "P":
> >
> > Pelican
> > Panther (cheesy)
> > Polliwog
> > Protozoa
> >
> > Of course, the Penguin is already spoken for. :)
> >
> > Personally, I don't have a problem with the current PHP logo... From a
> > marketing standpoint, I don't know; has MySQL become a more attractive
> > prospect to the pointy haired bosses of the world since they streamlined
> > their logo and added a Dolphin?  It would be interesting to know.
> >
> > If PHP was going to adopt a mascot, I kinda like the idea of the Platypus.
> > If you want to force a metaphor, think of PHP as an interesting language
> > that fits between traditional scripting languages and the HTTP server - sort
> > of like the Platypus is an interesting critter that fits somewhere between
> > mammal and.. whatever else. :)
> >
> > -Andy
> >
> >
> > > -Original Message-
> > > From: Tim Ward [mailto:[EMAIL PROTECTED]]
> > > Sent: Tuesday, December 11, 2001 2:02 AM
> > > To: PHP; Valentin V. Petruchek
> > > Subject: RE: [PHP] Logo proposal
> > >
> > >
> > > Chinchillas are fluffy, and I don't think anyone is using them for their
> > > logo.
> > >
> > >   --
> > >   From:  Valentin V. Petruchek [SMTP:[EMAIL PROTECTED]]
> > >   Sent:  10 December 2001 16:58
> > >   To:  PHP
> > >   Subject:  [PHP] Logo proposal
> > >
> > >   Hello world of php-programmers!
> > >
> > >   It seemes to me PHP is very powerful tool and very popular among
> > >   web-programmers, too. As for me I use php for solving web tasks for
> > > 2 years
> > >   and I'm very satisfied with it.
> > >
> > >   It seemes to me current PHP logo (can be found by
> > >   http://www.php.net/gifs/logo.gif) doesn't suite to PHP. It's common
> > > logo
> > >   without any idea except using title in it.
> > >
> > >   I propose to create and develop new PHP logo corresponding to its
> > > power.
> > >
> > >   My propose is WoodPecker (e.g. like Woody).
> > >
> > >   Other propositions?
> > >
> > >   Respectfully, Zliy Pes http://www.zliypes.com.ua
> > >
> > >
> > >
> > >
> > >
> > >
> >
> >
> > --
> > 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] strange empty array behavior being at in_array()

2001-12-24 Thread Peter Vereshagin

I wonder why something non-empty is considered to be an empty array
element:
===
if ( in_array('pattern', array( 0 ) ) )
   print "Got it";
===
I got the true condition. However, after I populate the array with
antries other than 0 and ''
the condition fails.
I think that would not be PHP error. But what's the thing I
misunderstood?

-- 
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] strange empty array behavior being at in_array()

2001-12-24 Thread Peter Vereshagin

Bogdan Stancescu wrote:
> 
> Try in_array('pattern',array('')) and in_array(1,array(0)). The quirk you
> found is predictable, as we know how PHP behaves when converting strings to
> integer values... 

you mean PHP converts string pattern to integer before apply pattern?
But what's the kind of technique? ASCII?

> And 'pattern' evaluates to 0 -- '55pattern' for example
> doesn't match -- but then again, what kinda word is that? :-)

I see no reason not to consider it to evaluate to 0 the same way:)
Either, you probably mean digits' sense? what kind of?


> Peter Vereshagin wrote:
> 
> > I think that would not be PHP error. But what's the thing I
> > misunderstood?

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




[PHP] Re: arrays

2001-12-24 Thread Peter Clarke

The best thing for converting XML to HTML is XSLT (that's what it was made
for). PHP can do the convertion using the XSLT functions (which require
Sablotron):
http://www.php.net/manual/ref.xslt.php

Peter

"Php Dood" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I'm trying to figure out how to parse an xml document, and convert it into
> html...
> i know how to parse in simple xml stuff for example
> easy is pretty easy to parse in, and i know how to code that,
> but when you start adding flags that i'm going to need variables for,
> example easy is not so easy.
>
> ***
> paste sample xml
> ***
> 
>
>
>   date="060801" high_temp="24.78" low_temp="14.51" sky_desc="3"
> precip_desc="*" temp_desc="8" air_desc="*" uv_index="7"
> wind_speed="18.51" wind_dir="270" humidity="48" dew_point="12.01"
> comfort="25.28" rainfall="*" snowfall="*" precip_prob="0" icon="2" />
>   date="060901" high_temp="20.34" low_temp="13.68" sky_desc="1"
> precip_desc="*" temp_desc="7" air_desc="20" uv_index="7"
> wind_speed="18.51" wind_dir="270" humidity="57" dew_point="9.23"
> comfort="19.23" rainfall="*" snowfall="*" precip_prob="2" icon="1" />
>   date="061001" high_temp="20.35" low_temp="12.01" sky_desc="3"
> precip_desc="*" temp_desc="7" air_desc="*" uv_index="7"
> wind_speed="*" wind_dir="*" humidity="56" dew_point="9.80"
> comfort="*" rainfall="*" snowfall="*" precip_prob="1" icon="2" />
>   date="061101" high_temp="20.34" low_temp="12.02" sky_desc="3"
> precip_desc="*" temp_desc="7" air_desc="*" uv_index="7"
> wind_speed="*" wind_dir="*" humidity="57" dew_point="10.34"
> comfort="*" rainfall="*" snowfall="*" precip_prob="1" icon="2" />
>   date="061201" high_temp="22.01" low_temp="13.12" sky_desc="3"
> precip_desc="*" temp_desc="7" air_desc="*" uv_index="7"
> wind_speed="*" wind_dir="*" humidity="55" dew_point="11.45"
> comfort="*" rainfall="*" snowfall="*" precip_prob="1" icon="2" />
>   date="061301" high_temp="23.12" low_temp="13.12" sky_desc="7"
> precip_desc="*" temp_desc="7" air_desc="*" uv_index="7"
> wind_speed="*" wind_dir="*" humidity="46" dew_point="9.79"
> comfort="*" rainfall="*" snowfall="*" precip_prob="2" icon="2" />
>   date="061401" high_temp="23.12" low_temp="13.68" sky_desc="7"
> precip_desc="*" temp_desc="7" air_desc="*" uv_index="7"
> wind_speed="*" wind_dir="*" humidity="49" dew_point="10.34"
> comfort="*" rainfall="*" snowfall="*" precip_prob="3" icon="2" />
>
>
>


-- 
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] SNMP with 4.1.0

2001-12-24 Thread Peter Hicks

All,

I am having terrible difficulty trying to build 4.1.0 as an Apache shared
module. Without SNMP support, all is well. However, as soon as I add
--with-snmp=..., I get the following at compile time:

gcc: /usr/local/snmp/lib/.libs/libsnmp.so: No such file or directory
make[3]: *** [snmp.la] Error 1
make[3]: Leaving directory `/usr/local/src/web/ssl2/php-4.1.0/ext/snmp'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/usr/local/src/web/ssl2/php-4.1.0/ext/snmp'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/local/src/web/ssl2/php-4.1.0/ext'
make: *** [all-recursive] Error 1


This only happens when PHP is being compiled as a shared module, and only
happens when SNMP support is compiled in.

Anyone got any ideas?

Festive wishes,


Peter.


-- 
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] SNMP with 4.1.0

2001-12-24 Thread Peter Hicks

Hi Brian

On Mon, 24 Dec 2001, Brian Clark wrote:

> > gcc: /usr/local/snmp/lib/.libs/libsnmp.so: No such file or directory
>
> Does libsnmp.so actually exist in /usr/local/snmp/lib?

Yes (a symlink to another file, which exists), and SNMP is detected fine
through 'configure'.

I have two theories. The first is that libsnmp.so is the name of the Apache
module that is being compiled and it is being referenced incorrectly; the
second is that a spurious .libs/ has appeared from somewhere.

As I said in the first e-mail, it works fine when PHP is to be statically
compiled in to Apache, which leads me to believe my first theory more than the
second



Peter.


-- 
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] Basic PHP PROGRAMMER needed

2001-12-25 Thread Peter Reck


Dear Listmembers,

I just started to structure WEBPRESENCE SERVICES in a way of generating
income for those participating in the venture. We're still building a
portfolio and just finished this site:
http://www.150plusidea.com/

On the "registration" link you see a contact information collection form,
which is connected to a MySQL db on the server via a PHP4 script.

Our GOAL is to develop that CONTACT INFORMATION/REGISTRATION FORM and its
management into a "COOKIE CUTTER" feature for our future clients. The
person which has handled the php scripting is no longer working with us,
hence we're looking for a new programmer who would like to play with us!

Please direct your response to:

mailto:[EMAIL PROTECTED]

Mele Kalikimaka [Merry Xmas],

Peter
Aloha Web Presence


-- 
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] inserting a file into MSSQL

2002-01-08 Thread Peter Lavender

Hi everyone,

Does anyone have a link to a good reference on how to insert a binary file
(zip file) into MSSQL?

I've got the upload and stuff working, just a bit unsure about how I'm now
going to put the file(it's been moved) into the database itself.  The
datatype I have used is Image, but most of the examples I have seen have
used text or some similar to store the file.

Thanks,

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]




[PHP] inserting a file into MSSQL

2002-01-08 Thread Peter Lavender

Sorry to post twice, I should have said that I'm using php 4.1.11.

A PEAR example would be even better :)

> Hi everyone,
>
> Does anyone have a link to a good reference on how to insert a binary file
> (zip file) into MSSQL?
>
> I've got the upload and stuff working, just a bit unsure about how I'm now
> going to put the file(it's been moved) into the database itself.  The
> datatype I have used is Image, but most of the examples I have seen have
> used text or some similar to store the file.
>
> Thanks,
>
> 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]




[PHP] binary data - MSSQL

2002-01-09 Thread Peter Lavender

Hi Everyone,

I did ask this earlier, but I have made some head way since, but I'm still
not sure that I have things right.

What datatype should I use for zip files?

How do I create a link to a file to be downloaded from the database?

All the examples I have read all relate to images, which hasn't really
helped.

THanks,

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]




[PHP] session problems not finding my variables..

2002-01-15 Thread Peter Lavender

Hi everyone,

I'm not sure what I have done wrong here.  I haven't been sucessful in
finding anything that points to what the cuase could be.

What I find interesting is that I have used session in another area of the
web site with out problems.  The only difference between it and the way I
have done it here is that I'm using the header function in this bit of code,
where as the session is started and variables registered and the processing
is done on another page.

Anyway here is the code for the log in page:



function checkdetails($db, $HTTPVARS) {
//check if allowed access
$user = $HTTPVARS['uid'];
$passwd = $HTTPVARS['passwd'];

$sql = "select * from tbl_maxware where loginID = '$user' and password =
'$passwd';";
$result = $db->query($sql);
checkError($result, $db, "Error in checkDetails");

if ($result->numrows() == 0) {
echo "";
echo "Error Loging In";
echo "Not a valid login try again or contact the admin";
echo "Try Again";
echo "";
exit();
} else {
// matched in the maxware table
$result->fetchinto($success);
$UID = $success[0];
$logUID = $success[1];
$logName = $success[2];
//echo session_save_path();
session_register("UID", "logUID", "logName");
// send them to the main page
header("Location: ./supportau.php");
}

} // end checkdetails

if (array_key_exists( "uid", $HTTP_POST_VARS ) ) {
checkdetails($db, $HTTP_POST_VARS);
} else {
login();
}
?>



Code for the following "main page"










Support Database






This returns an error:

 PHP Warning: Undefined variable: logName in
c:\inetpub\wwwroot\supportau\supportau.php on line 25

Thanks,

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]




[PHP] find and replace help.. VERY important

2002-01-16 Thread Peter Sienkiewicz

Hello ladies and gentlemen,
 
I need a function that opens up an HTML file and looks for
 
position:absolute;top:1038px;left:104px
 
then changes the left: value to be 100 less then it currently is
 
so it should then look like 
 
position:absolute;top:1038px;left:4px
 
The problem is that the left: value changes from line to line
 
This is a very important script, and I need it to search and replace
thru 400 files. If anyone has an tips, please help.



Thank You for your time.
Peter
 
 



[PHP] Re: php 4.1 and DOMXML question.

2002-01-16 Thread Peter Clarke

function getNodeContent ($node) {
$content = '';
$nodechild = $node->children();
if ( is_array( $nodechild ) ) {
reset ($nodechild);
while (list (, $val) = each ($nodechild)) {
if ( $val->type == XML_TEXT_NODE ) {
 $content .= $val->content;
}
}
return $content;
}
}

Peter


"Aaron" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> How the hell do I get the content of a node
>
> before all I had to do was go $node->content
>
> now it doesnt seem to work.
>
> I know they changed $node->name to $node->tagname.
>
> I tried, content, tagcontent, value, mmm some other things. I give up,
> couldnt find any info anywhere either...
>
> theres a set_content() method but doenst seem to be a get_content()
> method :(.
>


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




Re: [PHP] Re: php 4.1 and DOMXML question.

2002-01-17 Thread Peter Clarke


"Aaron" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Well that works. But its a little bizzare. I have to do that to get the
> content of a node even when that node has no children...
>
> e.g.
> 
> 
> SOME TEXT GOES HERE
> 
> 
>
> So even if the current node is "morestuff" I still have to do the
> currentnode->children etc. blah.
>
> which is a bit dodgey

Ah but the content of the node IS a child of the node. Everything inside a
node is it's child
eg:
html line 1html line 2
The children of  are:
'html line 1' AND '' AND 'html line 2'

Peter


> Peter Clarke wrote:
>
> >function getNodeContent ($node) {
> >$content = '';
> >$nodechild = $node->children();
> >if ( is_array( $nodechild ) ) {
> >reset ($nodechild);
> >while (list (, $val) = each ($nodechild)) {
> >    if ( $val->type == XML_TEXT_NODE ) {
> > $content .= $val->content;
> >}
> >}
> >return $content;
> >}
> >}
> >
> >Peter
> >
> >
> >"Aaron" <[EMAIL PROTECTED]> wrote in message
> >[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> >
> >>How the hell do I get the content of a node
> >>
> >>before all I had to do was go $node->content
> >>
> >>now it doesnt seem to work.
> >>
> >>I know they changed $node->name to $node->tagname.
> >>
> >>I tried, content, tagcontent, value, mmm some other things. I give up,
> >>couldnt find any info anywhere either...
> >>
> >>theres a set_content() method but doenst seem to be a get_content()
> >>method :(.
> >>
> >
> >
>
>
>


-- 
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] system(), passthru(), exec() not working as from command line

2002-01-20 Thread Peter Janett

I'm trying to get gnupg (OpenPGP) working on my system, which is Solaris 2.6
on Sparc, with PHP 4.0.6 and Apache/Stronghold.

I have the program compiled, as it works at the command line.  Here's what
works at the command line:
/usr/local/bin/gpg --encrypt -ao /usr/local/www/htdocs/777/crypted -r
'<[EMAIL PROTECTED]>'
/usr/local/etc/www/htdocs/777/plain_text_mesage.txt

If I type the above at the command line, when logged in as the user Apache
and PHP is running as (nobody), it encrypts the contents of the file
/usr/local/etc/www/htdocs/777/plain_text_mesage.txt and writes it to the
file /usr/local/www/htdocs/777/crypted, which is what I want.  (The
directory /usr/local/www/htdocs/777/ is "chmod 777", and PHP can write a
file in that directory.)

I've tried everything I can think of, but it looks like a command from PHP
is not working like it is at the command line.

I've tried:

system("/usr/local/bin/gpg --encrypt -ao
/usr/local/www/htdocs/777/crypted -r '<[EMAIL PROTECTED]>'
/usr/local/etc/www/htdocs/777/plain_text_mesage.txt");

passthru("/usr/local/bin/gpg --encrypt -ao
/usr/local/www/htdocs/777/crypted -r '<[EMAIL PROTECTED]>'
/usr/local/etc/www/htdocs/777/plain_text_mesage.txt");

exec("/usr/local/bin/gpg --encrypt -ao /usr/local/www/htdocs/777/crypted -r
'<[EMAIL PROTECTED]>'
/usr/local/etc/www/htdocs/777/plain_text_mesage.txt");

$command= `(/usr/local/bin/gpg --encrypt -ao
/usr/local/www/htdocs/777/crypted -r '<[EMAIL PROTECTED]>'
/usr/local/etc/www/htdocs/777/plain_text_mesage.txt`;

(Each of the above 4 lines of code probably word wrapped in this email, and
the last line contains backtics, not single quotes.)

So, I'm stumped.  I was following the basics of the article at:
http://hotwired.lycos.com/webmonkey/00/20/index3a.html?tw=programming

Thanks,

Peter Janett

New Media One Web Services

New Upgrades Are Now Live!!!
Windows 2000 accounts - Cold Fusion 5.0 and Imail 7.1
Sun Solaris (UNIX) accounts - PHP 4.0.6, mod_perl/1.25,
Stronghold/3.0 (Apache/1.3.22), MySQL 3.23.43

PostgreSQL coming soon!

http://www.newmediaone.net
[EMAIL PROTECTED]
(303)828-9882





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




Re: [PHP] How should I cache database data for php?

2002-01-21 Thread Peter Janett

I hate mention another language, but query caching is one area where Cold
Fusion shines.  (I'm a huge PHP fan and user, I'm just sharing my
experience.)

I have worked on sites with high traffic, and been able to greatly reduce
the page load times and database load by using "cached queries".

Here's a quote from the administrator area of Cold Fusion:
"Limits the maximum number of cached queries that the server will maintain.
Cached queries allow for retrieval of result sets from memory rather than
through a database transaction. Since the queries reside in memory, and
query result set sizes differ, there must be some user imposed limit to the
number of queries that are cached. When this value is exceeded, the oldest
query is dropped from the cache and is replaced with the specified query"

This is from the settings page where you specify the global server settings,
kind of like php.ini.

I think caching in memory is a faster and better way of caching, as writing
to a file seems to have limits on speed and resources, and therefore can
only be so much better than querying the database directly.

One thing that strikes me as a reason this can be accomplished in Cold
Fusion is that when you create a query, you assign it a name, datasource,
etc.  So each query has an "Alias", so the results can be stored in memory.
There isn't really that type of alias on PHP, unless you could somehow set
the return results to a global variable.

So, what about caching database results in memory?

Thanks,

Peter Janett

New Media One Web Services

New Upgrades Are Now Live!!!
Windows 2000 accounts - Cold Fusion 5.0 and Imail 7.1
Sun Solaris (UNIX) accounts - PHP 4.0.6, mod_perl/1.25,
Stronghold/3.0 (Apache/1.3.22), MySQL 3.23.43

PostgreSQL coming soon!

http://www.newmediaone.net
[EMAIL PROTECTED]

- Original Message -
From: "Matt Friedman" <[EMAIL PROTECTED]>
To: "'Manuel Lemos'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Monday, January 21, 2002 9:16 PM
Subject: RE: [PHP] How should I cache database data for php?


> My experience has been that large sites that need lots of db and file
> access and that are heavily trafficked use a file caching solution.
>
> Results of db queries and dynamic pages are loaded into flat files which
> the client then browses. This is the type of system used by sites that
> get in the millions of hits per month. It's simple and it works.
> Generally the database is the bottle neck. Using a file cache system
> avoids using the db. Pretty straightforward.
>
> The other strategy is to scale the hardware which is wise also. Sites
> that get that many hits are generating $$$ so the cost of hardware is
> cheap for them. They may have several gigs of memory per server and very
> fast processors. These machines can handle very large peaks in activity.
>
> Matt Friedman
> Web Applications Developer
> www.SpryNewMedia.com
> Email: [EMAIL PROTECTED]
>
>
> -Original Message-
> From: Manuel Lemos [mailto:[EMAIL PROTECTED]]
> Sent: Monday January 21, 2002 10:07 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] How should I cache database data for php?
>
> Hello,
>
> Jeff Bearer wrote:
> > I want the app to query the caching layer just about the same way it
> > queries the database, but add a few other details, time to live, cache
> > name etc.  The caching layer will check to see if the query is cached,
> > make sure it's not expired, and return the data just like a result set
> > from the db query.  If it is expired, or doesn't exist then it will
> > query and create the cache file for next time.
> >
> > I'm leaning toward storing the data in XML, and kicking around the
> idea
> > of storing it on a ram disk so it would have killer fast access time.
>
> XML? Why?
>
> In my experience, using XML for things that need to scale is a major
> mistake. If you want to serve HTML, why storing data in XML? You will
> need to parse and transform it in HTML which only makes things much
> worse than just storing data in nicely normalized database tables.
>
> Regards,
> Manuel Lemos
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


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




[PHP] Re: XML / XSLT parsing using PHP

2002-01-24 Thread Peter Clarke

"Lasse Laursen" <[EMAIL PROTECTED]> wrote in message
02c301c1a4c4$42e03620$[EMAIL PROTECTED]">news:02c301c1a4c4$42e03620$[EMAIL PROTECTED]...
> Hi,
>
> We are about to develop a CMS that uses XML and XSLT.
>
> The XML files contains some static information (header, footers and common
> non-dynamic information). We would like to have a XML file that would
> contain a field like:
>
> 
>   <...>
>   <...>
>   <...>
> 
>
> Before the XML file is loaded into the PHP script that uses the
xslt_process
> routine to convert the XML/XSLT files into plain HTML we would like to
> replace the  field with come dynamic content (eg. some other
> variables, etc.)
>
> What's the easiest way to do that? SAX or?
>

Load the XML into a variable,
do whatever changes to it,
then process the variable with xslt_process.


> Furthermore the 'xslt_process' function requires the following parameters:
>
> xslt_process (resource xh, string xml, string xsl [, string result [,
array
> arguments [, array parameters]]])
>
> where the XML and XSLT variables are references to files. - The XML file
is
> in our example a variable (eg. $current_xml_file = "x";) and therefor
we
> cannot use the xslt_process function? Of cause we can store the XML var.
in
> a temporary location and then read the file, but that's an extreamly ugly
> approach! :) Any ideas?
>

Have a look at:
http://www.php.net/manual/en/function.xslt-process.php
Example 3 Using the xslt_process() to transform a variable containing XML
data and a variable containing XSL data into a variable containing the
resulting XML data



> I'm looking forward to your replies :)
>
>
> Yours
> --
> Lasse Laursen <[EMAIL PROTECTED]> - Systems Developer
> NetGroup A/S, St. Kongensgade 40H, DK-1264 København K, Denmark
> Phone: +45 3370 1526 - Fax: +45 3313 0066 - Web: www.netgroup.dk

Peter Clarke


-- 
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] PHP4 html email

2002-01-31 Thread Peter Atkins

All,

I'm building a tool that takes form input and sends out an html email with a
word doc attached.
It sends the text and html version of the email but I can't open the
attachment. It opens blank.

Anyone have a thought or two about this?


if ($attachment) {
$fp = fopen($attachment, "rb");
$data = fread($fp, filesize($attachment));
$data = chunk_split(base64_encode($data));
fclose($fp);

// add the MIME data
$str .= "--" . $boundary . "\r\n";
$str .= "Content-Type: application/octet-stream; name=\"" .
$attachment ."\"\r\n";
$str .= "Content-Transfer-Encoding: base64\r\n";
$str .= "Content-Disposition: attachment; filename=\"" . $attachment
."\"\r\n\r\n";
$str .= $data . "\r\n";
}


thanks,
-p

-- 
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] HTML Email attachment problem

2002-01-31 Thread Peter Atkins

All,

I'm building a tool that takes form input and sends out an html email with a
word doc attached.
It sends the text and html version of the email but I can't open the
attachment. It opens blank.

Anyone have a thought or two about this?


if ($attachment) {
$fp = fopen($attachment, "rb");
$data = fread($fp, filesize($attachment));
$data = chunk_split(base64_encode($data));
fclose($fp);

// add the MIME data
$str .= "--" . $boundary . "\r\n";
$str .= "Content-Type: application/octet-stream; name=\"" .
$attachment ."\"\r\n";
$str .= "Content-Transfer-Encoding: base64\r\n";
$str .= "Content-Disposition: attachment; filename=\"" . $attachment
."\"\r\n\r\n";
$str .= $data . "\r\n";
}


thanks,
-p


-- 
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] Making your include files invisible (header() in if loop)

2002-01-31 Thread Peter Brown

I don't know if this is related but header() must be called before any
actual output is sent.

One way to resolve this is to use the ob_start() tag at the start of the
code, this turns output buffering on.

Mind you I am no expert and stand ready to be corected and berated.

Peter


I wanted to hide the existance of my include files by making them
'invisible': give a 404 error when requested. This worked, but the files
that were including were obviously 404ing too. So I decided to use
$PHP_SELF and check whether the script's PHP_SELF was it's filename,
which would mean that it was being accessed directly, as opposed to
being included. I tried this code:



(include.php)



at the top of the include files, but it wasn't working. Change the
header() to an echo and test it. It echoed. So it's a problem with the
header(). I tried this:





and it worked perfectly. Can header() not be in an if loop or something
like that?



-- 
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] Problem...header already sent by

2002-02-04 Thread Peter Run

Hi,
  I get the warning message (see below), whenever I try anything with
authentication/session with PHP.  This is tried under Windows (PHPTriad).  I
get the same message with my Linux drive as well.  I appreciate your help.
Please reply here and cc: to my personal email [EMAIL PROTECTED]

Thanks in advance,
-Peter
**
Warning: Cannot add header information - headers already sent by (output
started at C:\apache\htdocs\proj\sports\phps\verify.php:2) in
C:\apache\htdocs\proj\sports\phps\verify.php on line 26
***

1. 
2. 







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




Re: [PHP] Problem...header already sent by

2002-02-04 Thread Peter Ruan


I tried it w/o the  tag and I get the BAD Header message.

-Peter

>From: Jeff Sheltren <[EMAIL PROTECTED]>
>To: "Peter Run" <[EMAIL PROTECTED]>,[EMAIL PROTECTED]
>Subject: Re: [PHP] Problem...header already sent by
>Date: Mon, 04 Feb 2002 21:30:42 -0800
>
>You can't send anything before you send headers...  the "html" tag is
>messing you up I believe.
>
>Jeff
>
>At 08:24 PM 2/4/2002 -0800, Peter Run wrote:
>>Hi,
>>   I get the warning message (see below), whenever I try anything with
>>authentication/session with PHP.  This is tried under Windows (PHPTriad).  
>>I
>>get the same message with my Linux drive as well.  I appreciate your help.
>>Please reply here and cc: to my personal email [EMAIL PROTECTED]
>>
>>Thanks in advance,
>>-Peter
>>**
>>Warning: Cannot add header information - headers already sent by (output
>>started at C:\apache\htdocs\proj\sports\phps\verify.php:2) in
>>C:\apache\htdocs\proj\sports\phps\verify.php on line 26
>>***
>>
>>1. 
>>2. > 
>>
>>
>>  23.   if (!$auth) {
>>  24.  header("www-Authenticate: Basic realm='Private'");
>>  25.  header("HTTP/1.0 401 Unauthrized");
>>...
>>?>
>>
>>
>>
>>
>>
>>
>>
>>--
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, visit: http://www.php.net/unsub.php
>
>




_
Chat with friends online, try MSN Messenger: http://messenger.msn.com


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




Re: [PHP] Problem...header already sent by

2002-02-04 Thread Peter Run

Okay, I deleted the other stuff and just put this code and I get this from
my interpreter?  Is this a setting problem?

Thanks,
Peter



[Mon Feb 04 22:36:30 2002] [error] [client 127.0.0.1] malformed header from
script. Bad header=HTTP/1.0 401 Unauthorized: /apache/php/php.exe

"Martin Towell" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
you have :
24.  header("www-Authenticate: Basic realm='Private'");
25.  header("HTTP/1.0 401 Unauthrized");

I have (and this works)

  Header ("WWW-authenticate: Basic realm=\"$blah\"");
  Header ("HTTP/1.0 401 Unauthorized");

* "Unauthrized" should be "Unauthorized" - missing "o"


-Original Message-
From: Niklas Lampén [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 05, 2002 4:51 PM
To: Php-General
Subject: RE: [PHP] Problem...header already sent by


There can't be _anything_ before headers. Even a single space and/or
linebreak causes an error.


Niklas


-Original Message-
From: Peter Ruan [mailto:[EMAIL PROTECTED]]
Sent: 5. helmikuuta 2002 7:42
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP] Problem...header already sent by



I tried it w/o the  tag and I get the BAD Header message.

-Peter

>From: Jeff Sheltren <[EMAIL PROTECTED]>
>To: "Peter Run" <[EMAIL PROTECTED]>,[EMAIL PROTECTED]
>Subject: Re: [PHP] Problem...header already sent by
>Date: Mon, 04 Feb 2002 21:30:42 -0800
>
>You can't send anything before you send headers...  the "html" tag is
>messing you up I believe.
>
>Jeff
>
>At 08:24 PM 2/4/2002 -0800, Peter Run wrote:
>>Hi,
>>   I get the warning message (see below), whenever I try anything with

>>authentication/session with PHP.  This is tried under Windows
(PHPTriad).
>>I
>>get the same message with my Linux drive as well.  I appreciate your
help.
>>Please reply here and cc: to my personal email [EMAIL PROTECTED]
>>
>>Thanks in advance,
>>-Peter
>>**
>>Warning: Cannot add header information - headers already sent by
>>(output started at C:\apache\htdocs\proj\sports\phps\verify.php:2) in
>>C:\apache\htdocs\proj\sports\phps\verify.php on line 26
>>***
>>
>>1. 
>>2. > 
>>
>>
>>  23.   if (!$auth) {
>>  24.  header("www-Authenticate: Basic realm='Private'");
>>  25.  header("HTTP/1.0 401 Unauthrized");
>>...
>>?>
>>
>>
>>
>>
>>
>>
>>
>>--
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, visit: http://www.php.net/unsub.php
>
>




_
Chat with friends online, try MSN Messenger: http://messenger.msn.com


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




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




Re: [PHP] Problem...header already sent by

2002-02-04 Thread Peter Ruan

Okay, I deleted the other stuff and just put this code and I get this from
my interpreter?  Is this a setting problem?

Thanks,
Peter

"Niklas lampén" <[EMAIL PROTECTED]> wrote in message
007701c1ae09$1bde80b0$ba93c5c3@Niklas">news:007701c1ae09$1bde80b0$ba93c5c3@Niklas...
> There can't be _anything_ before headers. Even a single space and/or
> linebreak causes an error.
>
>
> Niklas
>
>
> -Original Message-
> From: Peter Ruan [mailto:[EMAIL PROTECTED]]
> Sent: 5. helmikuuta 2002 7:42
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: Re: [PHP] Problem...header already sent by
>
>
>
> I tried it w/o the  tag and I get the BAD Header message.
>
> -Peter
>
> >From: Jeff Sheltren <[EMAIL PROTECTED]>
> >To: "Peter Run" <[EMAIL PROTECTED]>,[EMAIL PROTECTED]
> >Subject: Re: [PHP] Problem...header already sent by
> >Date: Mon, 04 Feb 2002 21:30:42 -0800
> >
> >You can't send anything before you send headers...  the "html" tag is
> >messing you up I believe.
> >
> >Jeff
> >
> >At 08:24 PM 2/4/2002 -0800, Peter Run wrote:
> >>Hi,
> >>   I get the warning message (see below), whenever I try anything with
>
> >>authentication/session with PHP.  This is tried under Windows
> (PHPTriad).
> >>I
> >>get the same message with my Linux drive as well.  I appreciate your
> help.
> >>Please reply here and cc: to my personal email [EMAIL PROTECTED]
> >>
> >>Thanks in advance,
> >>-Peter
> >>**
> >>Warning: Cannot add header information - headers already sent by
> >>(output started at C:\apache\htdocs\proj\sports\phps\verify.php:2) in
> >>C:\apache\htdocs\proj\sports\phps\verify.php on line 26
> >>***
> >>
> >>1. 
> >>2.  >> 
> >>
> >>
> >>  23.   if (!$auth) {
> >>  24.  header("www-Authenticate: Basic realm='Private'");
> >>  25.  header("HTTP/1.0 401 Unauthrized");
> >>...
> >>?>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>--
> >>PHP General Mailing List (http://www.php.net/)
> >>To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
>
>
>
> _
> Chat with friends online, try MSN Messenger: http://messenger.msn.com
>
>
> --
> 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




Re: [PHP] Problem...header already sent by

2002-02-04 Thread Peter Ruan

Okay, I deleted the other stuff and just put this code and I get this from
my interpreter?  Is this a setting problem?

Thanks,
Peter



[Mon Feb 04 22:36:30 2002] [error] [client 127.0.0.1] malformed header from
script. Bad header=HTTP/1.0 401 Unauthorized: /apache/php/php.exe

"Niklas lampén" <[EMAIL PROTECTED]> wrote in message
007701c1ae09$1bde80b0$ba93c5c3@Niklas">news:007701c1ae09$1bde80b0$ba93c5c3@Niklas...
> There can't be _anything_ before headers. Even a single space and/or
> linebreak causes an error.
>
>
> Niklas




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




RE: [PHP] Problem...header already sent by

2002-02-04 Thread Peter Brown

If you include ob_start() at the beginning of the code this will turn
output buffering on and hence enable you to send the header() tag at any
line in the code.

Peter

-Original Message-
From: Ryan F. Bayhonan [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, 5 February 2002 5:54 PM
To: Peter; [EMAIL PROTECTED]
Subject: Re: [PHP] Problem...header already sent by


Hello Peter. Good Day.

Omitting  does not solve the problem. I've experience this
problem also before. I found out that the once causing the problem is
when any data that has been sent to the client. I have listed some
example below.

Examples: All of these will cause a warning when header is called.

1. Since the tag  will be interpreted by the client browser first
before the  tags, data has been sent to the client, telling
the client that an html file is being rendered. So when the browser
interprets the header function, a warning will be issued.




2. This will also cause an error. Remember that a call to an echo or
print function will send data (the parameters of the function) to the
client. So when the header is interpreted, a warning will be issued.



Hope this is clear to you now. When a data has been sent already to the
client, a call to a header will fail. The best thing you must do is to
put the logic/check part on the first line of the file (See below). In
the example below, I check first is the a user is valid by calling the
the function verify_user( params... ) before any other html tags be
rendered. So when the user is not valid it will redirect an error page,
if it is valid, the Welcome to page will be printed.




Welcome to the page.



Hope this help you more.

Until then...

Ryan F. Bayhonan

- Original Message -
From: "Peter" <[EMAIL PROTECTED]>
To: "Ryan F. Bayhonan" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Tuesday, February 05, 2002 2:14 PM
Subject: Re: [PHP] Problem...header already sent by


> Hi Ryan,
>   I tried and took the  tags out and I still get the same

> messaage.  Why?
>
> Thanks,
> Peter
>
>
> > Hello Peter.
> >
> > I discribe my reply below:
> >
> > > **
> > > Warning: Cannot add header information - headers already sent by
(output
> > > started at C:\apache\htdocs\proj\sports\phps\verify.php:2) in 
> > > C:\apache\htdocs\proj\sports\phps\verify.php on line 26
> > > ***
> >
> > This warning message appear when the server already send data to the
> client.
> >
> > > 1. 
> > > 2.  > > 
> > >
> > >
> > >  23.   if (!$auth) {
> > >  24.  header("www-Authenticate: Basic realm='Private'");
> > >  25.  header("HTTP/1.0 401 Unauthrized");
> > > ...
> > > ?>
> > > 
> >
> > In the above code, the  tag has been sent to the client
> browser
> > already, thus when calling header function it would cause a warning
> telling
> > you that data has been rendered already.
> >
> > Hope this help.
> >
> > Ryan
> >
> >
>
> --
> 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


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




Re: [PHP] Problem...header already sent by

2002-02-05 Thread Peter Ruan

Hi Jason,
  Yeap, I ran 'phpinfo()' Server API=CGI.  I look at the manual and you are
right, I must run it as Apache module.  Can someone tell me how do I change
the setting to run as an APACHE module instead?

Thanks,
-Peter

"Jason Wong" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> On Tuesday 05 February 2002 15:20, Peter wrote:
> > Hi Ryan,
> >   Thanks for the examples.  Okay, I deleted the other stuff and just put
> > this code and I get this from
> > my interpreter?  Is this a setting problem?
>
>
> Are you running PHP as a CGI? If so, what you want to do cannot be done.
See
> chapter "HTTP authentication with PHP".
>
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
>
> /*
> You will triumph over your enemy.
> */



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




Re: [PHP] Problem...header already sent by

2002-02-05 Thread Peter Ruan

Ryan,
   I just tried it with my Linux box and I get the authentication 
box...which is good sign.  So it looks like a PHP in MS Windows (the 
'fabulous' windows) setting which from the error.log file indicates as well.

/** error message listed in error.log **/
[Mon Feb 04 22:36:30 2002] [error] [client 127.0.0.1] malformed header 
from script. Bad header=HTTP/1.0 401 Unauthorized: /apache/php/php.exe


In looks like a setting problem in some .ini file.  Do you know how to 
correct this problem?

Thanks for the help!
-Peter






Ryan F. Bayhonan wrote:

> It will work as expected Peter.
> 
>  header ("WWW-authenticate: Basic realm=\"Private\"");
> header ("HTTP/1.0 401 Unauthorized");
> echo "Unauthorized";
> exit;
> ?>
> 
> So where do we go from here??
> 
> Ryan
> 
> 
> 


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




[PHP] array variable passing in session.

2002-02-07 Thread Peter Ruan

Hi,
  I am running into a problem that I can't figure out the solution to.  So
I'm hoping that someone can give me some pointers here.  I have two files
(see below):  verify.php and edit.php
  The job of verify.php is basically to verify that a user is in the
database before allowing him/her to edit the information.  The information
retrieved is saved to arrary varaiable $row.  I do a session_register() to
$row and that information should be passed to subsequent pages that has
session_start(), right?  However, when I tried to print out the information
again in edit.php, it doesn't seem to register it in.  At first I thought it
was the array problem, so I put the array variable $dummy to test it out and
that can be reigstered and retrieved correctly.  What am I doing wrong???
Also, how do I redirect to a page automatically once the user is verfied
(right now I have to ask the user to click on a link to redirect).

Thanks in advance,
Peter

/*** verify.php /
User ID and password missmatch, try again!";
} else {
while ($row = mysql_fetch_array($result)) {
   session_register(row);  // register information retrieved from
MySQL
}
printf("Successfully Logged In! Click
Here");
echo "";
}
?>


/* edit.php */
";
}

foreach ($row as $data) {
echo $data . "";
}
?>



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




[PHP] Re: How to Configure the MySql Database?

2002-02-07 Thread Peter Ruan

Hi,
  I recommend using a nice program call PHPTriad.  It's painless and you
don't have to worry about anything.  The only downside is that it cofigures
PHP as CGI module only.

-Peter
"Karadamoglou Kostas" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
I don't know to configure MySql Database On Apache Server in Windows System.
What I must do? (step by step)




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




[PHP] Re: array variable passing in session.

2002-02-07 Thread Peter Ruan

Hi Joe,
  The record has other information as well, names, phone, and etc.  I like
to store everything in an array and reference to it later.  That way I don't
have to do another mysql_xxx() later for the subsequent pages...that should
save sometime, right?
  The problem has gone away once I switched back to good old Linux.  The
same code works now for both Linux and Windows...I still don't know why it
didn't work in the first place...probably the 'reliable' Windows has
something to do with it. :-)

Thanks,
Peter

"Joe Van Meer" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi Peter, are you limited to using arrays? If not, try  msql_fetch_row()
> since you are only looking for the one record, ie: the corresponding
> username and password record for the username and password that was
passed.
>
> Hope this helps, Joe :)
>
>   session_start();
>
>  include("config.php");
>  mysql_connect($host_name, $user_name, $passwd)
>or die("Unable to connect to $hostname.");
>  // select database on MySQL server
>  mysql_select_db($db_name) or die("Unable to select databse.");
>
>  // formulate the query
>  $sql_statement = "SELECT user_id, password FROM $table_name WHERE
> user_id  = '$user_id' AND
>password = '$password'";
>
>  $result = mysql_query($sql_statement) or die("Unable to execute
> query.");
>
> //if there is a corresponding record
> if(mysql_fetch_row($result)) {
>
>
> $usid = mysql_result($result,0);
>  $pswd = mysql_result($result, 1);
>
>
> //create session variables
>
> session_register("password");
> $password = $pswd;
>
> session_register("user_id");
> $username = $usid;
>
>
> //echo a friendly message or use header() function to redirect the user to
> the appropriate page
> echo "Succesful login!";
> }
> else
> {
> //the user is not a registered member so redirect them to a sign up page
or
> another page to try and login again
> header("Location: signup.php");
>
> }
>
> ?>
>
>
>
>
>
> Peter Ruan <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Hi,
> >   I am running into a problem that I can't figure out the solution to.
So
> > I'm hoping that someone can give me some pointers here.  I have two
files
> > (see below):  verify.php and edit.php
> >   The job of verify.php is basically to verify that a user is in the
> > database before allowing him/her to edit the information.  The
information
> > retrieved is saved to arrary varaiable $row.  I do a session_register()
to
> > $row and that information should be passed to subsequent pages that has
> > session_start(), right?  However, when I tried to print out the
> information
> > again in edit.php, it doesn't seem to register it in.  At first I
thought
> it
> > was the array problem, so I put the array variable $dummy to test it out
> and
> > that can be reigstered and retrieved correctly.  What am I doing
wrong???
> > Also, how do I redirect to a page automatically once the user is verfied
> > (right now I have to ask the user to click on a link to redirect).
> >
> > Thanks in advance,
> > Peter
> >
> > /*** verify.php /
> >  >session_start();
> >
> > include("config.php");
> > mysql_connect($host_name, $user_name, $passwd)
> >   or die("Unable to connect to $hostname.");
> > // select database on MySQL server
> > mysql_select_db($db_name) or die("Unable to select databse.");
> >
> > // formulate the query
> > $sql_statement = "SELECT * FROM $table_name WHERE
> >user_id  = '$user_id' AND
> >   password = '$password'";
> >
> > $result = mysql_query($sql_statement) or die("Unable to execute
> > query.");
> >
> > $num_of_rows = mysql_num_rows($result);
> > /* XXX: test array variable...take out later */
> > $dummy = array("one", "two", "three");
> > session_register(dummy);
> >
> > if (!$num_of_rows) {
> > echo "User ID and password missmatch, try again!";
> > } else {
> > while ($row = mysql_fetch_array($result)) {
> >session_register(row);  // register information retrieved
from
> > MySQL
> > }
> > printf("Successfully Logged In! Click
> > Here");
> > echo "";
> > }
> > ?>
> >
> >
> > /* edit.php */
> >  > session_start();
> > foreach ($dummy as $val) {
> > echo $val . "";
> > }
> >
> > foreach ($row as $data) {
> > echo $data . "";
> > }
> > ?>
> >
> >
>
>



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




Re: [PHP] RE: Creating Tab-Delimited Text File

2002-02-08 Thread Peter Janett

To make it download, use "header" to set your content type:
header("Content-type: text/tab-separated-values\n\n");

Make sure the above is the first this the script outputs, and the only other
thing it outputs is data.

Take your code that spits out the data in html, strip out all the html, then
separate the values with a tab (\t), and a carriage return at the end.
So, while looping through the results:
print "$db_1\t$db_2\t$db_3\r";

That gives you tab separated data, with one row per line.

HTH,

Peter Janett

  ~~ New Media One Web Services ~~
"Web Hosting for Web Developers"

New Upgrades Are Now Live!!!
Windows 2000 accounts - Cold Fusion 5.0 and Imail 7.1
Sun Solaris (UNIX) accounts - PHP 4.0.6, mod_perl/1.25,
Stronghold/3.0 (Apache/1.3.22), MySQL 3.23.43

PostgreSQL coming soon!

http://www.newmediaone.net
[EMAIL PROTECTED]
(303)828-9882

- Original Message -
From: "Phillip S. Baker" <[EMAIL PROTECTED]>
To: "PHP Email List" <[EMAIL PROTECTED]>
Sent: Thursday, February 07, 2002 2:54 PM
Subject: Re: [PHP] RE: Creating Tab-Delimited Text File


> At 01:42 PM 2/7/2002, Andrew Chase wrote:
> >Which part are you having trouble with, specifically?  The task as you've
> >described it is very straightforward, almost pseudo-code. :)
> >
> >-Andy
>
> I know very well how to do the Db query and then loop through the results
> to display the info on an HTML page.
> However I have not done the part about actually creating a new file in the
> text format make sure the results are tab-delimited and then make it
> available for download.
>
> Can you help me with that part specifically?
>
> Thanks
> Phillip
>
>
> > > -Original Message-
> > > From: Phillip S. Baker [mailto:[EMAIL PROTECTED]]
> > > Sent: Thursday, February 07, 2002 12:32 PM
> > > To: PHP Email List
> > > Subject: Creating Tab-Delimited Text File
> > >
> > >
> > > Greetings All,
> > >
> > > What I want to do is create a tab-delimited text file for download
from
> > > records in a database.
> > > I am not sure on how to do this.
> > >
> > > So what I want to do is as follows.
> > > ON a page a button is clicked.
> > > Script is activated that pulls records from a database.
> > >  From these records a tab-delimited text file is created.
> > > A save dialogue box appears so the user to save the text file to
> > > his harddrive.
> > >
> >
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, visit: http://www.php.net/unsub.php
>
> Blessings
>
> Phillip
>
> Those who give up essential liberty for a little safety,
> deserve neither liberty nor safety.
>  - Ben Franklin
>
>
> --
> 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




[PHP] Re: Execing problems

2002-02-08 Thread Peter Clarke

Make sure that exec() will not get any kind of response from the script if
you want it in the background.
This works for me:

$command = "funky script stuff here";
exec ("$command >/dev/null 2>&1 &");

Peter Clarke

"Jason Rennie" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi all,
>
> I have a seperate perl script that I need to start running from a php
> script. The script does a fork into the backgroup and exits.
>
> when i do an
>
> exec("funky script stuff here");
>
> The page just hangs trying to load again, apparently after I call the
> exec.
>
> I've also tried
>
> exec("script stuff &")
>
> but it does the same thing.
>
> Any ideas anybody ?
>
> Jason
>
> --
> Hofstadter's Law : "It always takes longer than you expect, even when you
> take Hofstadter's Law into account."
>


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




Re: [PHP] Re: Implement @-domains with PHP?

2002-02-12 Thread Peter Janett

$what_you_want = "$HTTP_HOST" . "$REQUEST_URI";

Peter Janett

New Media One Web Services

New Upgrades Are Now Live!!!
Windows 2000 accounts - Cold Fusion 5.0 and Imail 7.1
Sun Solaris (UNIX) accounts - PHP 4.0.6, mod_perl/1.25,
Stronghold/3.0 (Apache/1.3.22), MySQL 3.23.43

PostgreSQL coming soon!

http://www.newmediaone.net
[EMAIL PROTECTED]
(303)828-9882

- Original Message -
From: "Philip Hallstrom" <[EMAIL PROTECTED]>
To: "Christian Blichmann" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, February 12, 2002 10:54 AM
Subject: [PHP] Re: Implement @-domains with PHP?


> I don't think that string actually gets sent unless the browser receives a
> 401 Auth Required (I think that's it) header.
>
> Even if you have that setup and put a page with phpinfo() in it you'll
> notice that none of the environment variables will look like the url
> you've got below.  The browser pulls that out first and sends them as
> separate headers...
>
> I think anyway...
>
> On Tue, 12 Feb 2002, Christian Blichmann wrote:
>
> > Hello Again!
> >
> > "Cc Zona" <[EMAIL PROTECTED]> wrote in message
> > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > > I'd like to retrieve the "http://someReallyWeirdAtDomain"-part.
> > >
> > > <http://php.net/parse-url>
> > >
> >
> > I think you misunderstood my question, my problem is not how to parse
the
> > URI,
> > I discovered the the parse_url-function before... My problem is much
more
> > trivial,
> > how to retrieve the string the user type into the address bar of his/her
> > browser???
> >
> > --
> > Christian
> >
> > _
> > don't hesitate - email me with your thoughts:
> > e-mail: [EMAIL PROTECTED]
> >  - please remove the ".nospam" from address.
> > _
> > do you want to know more?
> > web:http://www.blichmann.de
> >
> >
> >
> > --
> > 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
>


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




[PHP] MySQL question...not sure if this is the correct forum to ask.

2002-02-14 Thread Peter Ruan

Hi,
  I have a quick MySQL question...if this is not the correct forum for
it, then someone please point me to the right one.

  Can the UPDATE statement have conditional check embedded in it?  I
have a page that displays a record (in a FORM format) that the user can
change the information on each column.  I want to check each column and
see which has been changed and update the table for entries that were
changed only.

for each column data {
  if column is changed
  then update;
  else
  do nothing;
}

Maybe I am making this too complicated than it needs and just go ahead
and update all of the columns regardless with the new values, regardless
they are actually different or not.

Thanks in advance,
-Peter




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




[PHP] fsockopen timeout

2002-02-15 Thread Peter Clarke

According to the manual;
http://www.php.net/manual/en/function.fsockopen.php
Depending on the environment, optional connect timeout may not be available.

Does anyone know what environment is needed for it to be available?
I have Redhat Linux 7.1 - and the timeout doen't seem to work.

Any ideas?

Peter


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




[PHP] automatically updating software

2002-11-11 Thread Peter VanDijck
Hi,
I want to write some (browser based) software that will get installed on
the client's servers, and I want it to update automatically (as in
Windows XP: new updates are downloaded and presented for install). Can
that be done with PHP? Some ideas so far (that will probably betray my
ignorance :): 
- updating images will require write access that may introduce security
issues?
- keeping almost all code in a database and update that?
- or require write access to a directory outside of the web root?
- any existing approaches - apps already doing it?
- what are the limits of updates distributed this way?
- how much extra coding does this method imply?
Peter

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




Re: [PHP] automatically updating software

2002-11-11 Thread Peter VanDijck

> > Some ideas so far (that will probably betray my ignorance :): - updating
> > images will require write access that may introduce security issues?
> 
> Security issues will prevent you from reading or writing any files that
> your PHP process doesn't have permissions for.  In my experience, the only
> reliable way to do this is by using FTP using the username and password that
> the user will (presumably) give you.

But that's scary for the user (granting some company access to your
server???). Isn't there another way? I was thinking I could keep crucial
function libraries in a database (not sure if that is possible??) and
then just update them like that, no write access hassles. Can that be
done? Can you keep your functions in a database and "include" them from
there?
Peter

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




[PHP] Need CyberCash MCK for Linux

2002-11-11 Thread Peter Janett
I'm moving a site over from a Sun server to a Linux server, and need the
CyberCash MCK software to install on the Linux box.

I know that Verisign has purchased and swallowed CyberCash into their
PayFlowPro system, but I just need to move an existing, functioning site
that uses CyberCash.

So, anyone know where (or have a copy) of the CyberCash MCK software for
Linux?

Thanks,

Peter Janett

New Media One Web Services





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




[PHP] a conditionial insert

2002-11-18 Thread Peter Houchin
howdy have made up a script to insert stuff into my db but  I want it to be
conditionial as in I only want it inserterd if it matches the condition..

function new_user() {
//check to see if the company is in the list


  $result = mysql_query("SELECT * FROM resellers WHERE
company='$_POST[company]'");
// if it's not then ...
if ($result == FALSE){
blah
}
//if it is then insert the rest of the stuff to the db
else {
$res = mysql_query(INSERT)
}

but doing it this way doesn't seem to help.. any one got any idea's?

I've had a look around and haven't been able to see a example like this...

Cheers

Peter
"the only dumb question is the one that wasn't asked"



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




[PHP] Apache Module vs CGI, both??

2002-11-18 Thread Peter Janett
I'm setting up a new server that will host many different customer sites via
Apache virtual hosts.  I'm trying to decide if I should use SuExe with
Apache, and run PHP and Perl with it, or just to run everyone as the web
server user, and compile PHP (and/or Mod_Perl) as a module.

I understand the security issues of having all Perl and PHP scripts run as
the same user as Apache, but I'm not sure I have a full grasps of the pros
and cons of each setup.

I'm hoping to get opinions, suggestions, etc. about each possible setup,
which I would assume will include some of the safety switches that can be
setup in PHP when compiled as an Apache module.

Any and all info or ideas most appreciated!

Peter Janett

New Media One Web Services

New Upgrades Are Now Live!!!
Windows 2000 accounts - Cold Fusion 5.0 and Imail 7.1
Sun Solaris (UNIX) accounts - PHP 4.1.2, mod_perl/1.25,
Stronghold/3.0 (Apache/1.3.22), MySQL 3.23.43

PostgreSQL coming soon!

http://www.newmediaone.net
[EMAIL PROTECTED]
(303)828-9882




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




RE: [PHP] a conditionial insert

2002-11-18 Thread Peter Houchin

Hi

just wanted to say thanks Justin.. I've got it working with your idea  I
needed to change this line

if($result && mysql_num_rows($result) > 0)

to

if ($result && mysql_num_rows($result) < 1)

and it works a treat.

Thanks

Peter

> I'm no expert, but I think $result will return true if the query was
> successful, it's not dependant on if there were rows returned.
>
> To check if there was a row returned, use mysql_num_rows($result)
>
>
> $result = mysql_query("SELECT * FROM resellers WHERE
> company='$_POST[company]'");
> if($result && mysql_num_rows($result) > 0)
> {
> // insert
> }
> else
> {
> //something else
> }
>
>
>
> Justin French
> 
> http://Indent.com.au
> Web Developent &
> Graphic Design
> 
>
>


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




RE: [PHP] RE: running php as cgi script

2002-11-18 Thread Peter Houchin
Hi
> I'm trying to run a simple test php script as a cgi script on my ISP's
> server 
> and haven't been able to get it to work, although according them it is 
> possible.
> 
> I have an example from a book  which gives the following steps:
> 
> 1. Put the script in the cgi-bin
> 2. run chmod 755
> 3. include "#!/usr/bin/php" at the top. (I have checked that this is the
> 
> correct location of php on the server)
> 
> The test script they give looks like this:
> 
> #!/usr/bin/php
> 
> echo "This is a small CGI program."
> 
add a ; to the end of the line above so it looks like this 
echo "This is a small CGI program.";

> Doesn't look like the usual php syntax to me, but I guess this is
> different.
> Anyway I've tried it a bunch of different ways and it hasn't worked and
> I 
> haven't been able to find much on the subject from Google. 
> Can someone tell me where I'm going wrong?
What error messages are you getting, if any ??

Cheers
Peter

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




RE: [PHP] Variable passing through a form

2002-11-20 Thread Peter Houchin
at a guess would say have some hidden inputs on your form that echo the
var's pass from part 2 that way when your form is submitted in part 3 it
gets sent along with the new stuff

> -Original Message-
> From: Michael Benbow [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, 21 November 2002 2:24 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Variable passing through a form
>
>
>
> Hi,
>
> I currently have a page divided into three areas, two of which
> are iframes.
>
> The user selects a component out of part 1, which decides what is shown
> in part 2.  When something is clicked in part 2 the information updates
> in the second iframe, or part 3.  This is all working fine through
> $PHP_SELF and target.
>
> I am now working in part 3 of my page which has already had variables
> passed to it from part 2, however when I try to make selections on this
> page which should update in the same area ($PHP_SELF) I am losing all
> the variables which were earlier passed.  I have tried $REQUEST_URI also
> which didn't help.
>
> example:
>
> after coming from part 2 $REQUEST_URI might be
> test.php?var1=a&var5=f&var16=d .  If I then select and option on this
> new form and then send it to itself I lose everything that was
> originally there (output might then be test.php?newvar=new)
>
> The line which executes my form is (currently)  action="" method="get"
> enctype="multipart/form-data"> , and as I said $REQUEST_IRI does contain
> the variables on initial loading.  I need to keep these initial
> variables and add the new (ie test.php?var1=a&var5=f&var16=d&newvar=new)
>
> Please help!
>
> Thanks,
> Michael.
>
>
>
> --
> 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




Re: [PHP] REPLY NEEDED

2002-11-21 Thread Peter Goggin
Where has this crap come from?
Regards

Peter Goggin
- Original Message - 
From: "MICHAEL OSHODI" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, November 20, 2002 5:51 PM
Subject: [PHP] REPLY NEEDED



 ASSISTANCE

WE ARE MEMBERS OF A SPECIAL COMMITTEE FOR BUDGET AND
PLANNING OF THE NIGERIA NATIONAL PETROLEUM CORPORATION
 (NNPC)IN WEST AFRICA. THIS COMMITTEE IS PRINCIPALLY CONCERNED
WITH CONTRACT AWARDS AND APPROVAL. WITH OUR POSITIONS,
WE HAVE SUCCESSFULLY SECURED FOR OURSELVES THE SUM OF
THIRTHY ONE MILLION, FIVE HUNDRED THOUSAND UNITED
STATES DOLLARS (US$31.5M). THIS AMOUNT WAS CAREFULLY
MANIPULATED BY OVER-INVOICING OF AN OLD CONTRACT.

BASED ON INFORMATION GATHERED ABOUT YOU, WE BELIEVE
YOU WOULD BE IN A POSITION TO HELP US IN TRANSFERING
THIS FUND (US$31.5M) INTO A SAFE ACCOUNT. IT HAS BEEN
AGREED THAT THE OWNER OF THE ACCOUNT WILL BE
COMPENSATED WITH 30% OF THE REMITTED FUNDS, WHILE WE
KEEP 60% AS THE INITIATORS AND 10% WILL BE SET ASIDE
TO OFFSET EXPENSES AND PAY THE NECESSARY TAXES.WE
INTEND TO USE PART OF OUR OWN SHARE TO IMPORT FROM
YOUR COUNTRY AGRICULTURAL AND CONSTRUCTION MACHINERY.
THIS IS BECAUSE THE PRESENT GOVERNMENT OF MY COUNTRY
IS EMPHASISING ON PROVIDING FOOD AND HOUSING FOR ALL
ITS CITIZENS BEFORE THE NEXT ELECTION. HENCE,
AGRICULTURAL AND CONSTRUCTION EQUIPMENT ARE IN HIGH
DEMAND OVER HERE. WE SHALL ALSO NEED YOUR ASSISTANCE
IN THIS REGARD ON A COMMISSION TO BE AGREED UPON WHEN
WE FINALLY MEET.

ALL MODALITIES OF THIS TRANSACTION HAVE BEEN CAREFULLY
WORKED OUT AND ONCE STARTED WILL NOT TAKE MORE THAN
SEVEN (7) WORKING DAYS, WITH YOUR FULL SUPPORT. THIS
TRANSACTION IS 100% RISK FREE.

MOREOVER, WE SHALL NEED THE FOLLOWING FROM YOU TO 
ENABLE US BEGIN THE TRANSACTION FORMALLY. THEY ARE; 
YOUR FULL NAME AND ADDRESS OR YOUR COMPANY NAME, 
ADDRESS AND TELEPHONE/FAX NUMBERS, YOUR BANKERS 
NAME AND ADDRESS, YOUR ACCOUNT NUMBER AND NAME. 
THIS INFORMATION WILL BE USED ALONGSIDE OTHER VITAL
 DOCUMENTS OVER HERE IN PREPARING THE NECESSARY 
APPLICATION FOR PAYMENT TO THE CONCERNED QUARTERS 
WHERE PAYMENT APPROVALS WOULD BE SECURED IN FAVOUR
 OF YOUR COMPANY FOR THE PAYMENT OF OUR FUND(US$31.5M)
 INTO YOUR NOMINATED ACCOUNT FOR US ALL. BY OUR APPLICATION, 
IT WILL BE ASSUMED THAT THIS SUM IS BEING REQUESTED AS 
PAYMENT, WHICH IS LONG-OUTSTANDING, FOR A CONTRACT, 
WE SHALL CLAIM WITH OUR POSITION, YOU OR YOUR COMPANY
 EXECUTED FOR (NNPC) SOMETIME IN 1997. HENCE, WE SHALL 
FOLLOW ALL THE LEGAL OFFICIAL PROTOCOLS USUALLY 
OBSERVED BY FOREIGN CONTRACTORS WHENEVER THEY 
ARE DEMANDING PAYMENT FOR CONTRACTS EXECUTED 
FOR THE GOVERNMENT OF MY COUNTRY.

FURTHERMORE, IMMEDIATELY THE FINAL APPROVAL IS GRANTED, 
THE FUND WILL BE TRANSFERRED INTO YOUR ACCOUNT WITHIN 72
HOURS, BY WHICH TIME MY PARTNERS AND I WILL BE IN YOUR COUNTRY 
FOR THE FINAL DISBURSEMENT IN THE RATIO ALREADY SPELT OUT TO YOU.

 PLEASE, YOU SHOULD ENDEAVOUR TO GIVE US AN ACCOUNT 
WHICH YOU HAVE ABSOLUTE CONTROL OVER. THIS IS VERY 
IMPORTANT BECAUSE WE WOULD NOT WANT A SITUATION 
WHEN THE MONEY IS IN THE ACCOUNT, YOU NOW TELL US 
YOU WOULD NEED TO BE AUTHORISED BY ANOTHER PERSON 
BEFORE WE CAN HAVE OUR OWN SHARE.

YOU WILL NOT BE REQUIRED TO TRAVEL OUT OF YOUR COUNTRY, 
ME AND MY PARTNERS, WE TRAVEL DOWN TO YOUR COUNTRY 
FOR THE DISBURSEMENT OF THE FUND, AFTER THE FINAL TRANSACTION. 
WE WILL ALSO DISCUSS ABOUT OIL BUSINEES IN MY COUNTRY 
WHEN WE COME DOWN OVER THERE. BECAUSE WE WOULD 
LIKE TO ESTABLISH A JOINT BUSINESS WITH YOU. THAT IS 
WE WILL USE YOUR NAME TO REGISTER AND  
INCORPORATE AN OIL COMPANY IN MY COUNTRY. 

BESIDES, ON THE COMPLETION OF THIS TRANSFER, 
ALL DOCUMENTS USED FOR THE PURPOSE WILL BE 
WITHDRAWN FROM THE QUARTERS THEY ARE SUBMITTED 
BY OUR CONTACTS IN THESE OFFICES AND DESTROYED, 
THEREAFTER. SO, THERE WILL NOT BE ANY PROBLEM 
ARISING FROM THIS TRANSACTION NOW OR IN THE FUTURE.
IF THIS PROPOSAL SATISFIES YOU, PLEASE REACH US ONLY
BY EMAIL FOR MORE INFORMATION. 

PLEASE, TREAT AS URGENT AND VERY IMPORTANT.

YOURS FAITHFULLY,

CHIEF MICHAEL OSHODI




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




Re: [PHP] Linux and Apache

2002-11-22 Thread Peter Janett
Or, if you don't have access to the main httpd.conf file, just put a
DirectoryIndex line in a .htaccess file in your root folder that lists all
possible indexes, followed by your default front page:

DirectoryIndex index.html index.shtml index.htm index.php index.php3
/index.php

So, if non of the first 5 file names are found in the directory, Apache will
redirect to your front page (assumption is your frontpage is called
index.php, if it's not, change the last value, but leave the /).

HTH,

Peter Janett

New Media One Web Services

New Upgrades Are Now Live!!!
Windows 2000 accounts - Cold Fusion 5.0 and Imail 7.1
Sun Solaris (UNIX) accounts - PHP 4.1.2, mod_perl/1.25,
Stronghold/3.0 (Apache/1.3.22), MySQL 3.23.43

PostgreSQL coming soon!

http://www.newmediaone.net
[EMAIL PROTECTED]
(303)828-9882



- Original Message -
From: "Ernest E Vogelsinger" <[EMAIL PROTECTED]>
To: "conbud" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, November 22, 2002 3:48 PM
Subject: Re: [PHP] Linux and Apache


> At 23:11 22.11.2002, conbud said:
> [snip]
> >Hi. I spent the last 3 days looking through the apache docs to figure out
> >how to disable directory listing. I can disable the directory listing to
my
> >images folder but then all the images on the site dont work. I tried
using
> >Allow from mydomain
> >and
> >Allow from localhost
> >Allow from 127.0.0.1
> [snip]
>
> "Allow" specifies who can _read_ the folder and has nothing to do with
> sending a directory listing or not.
>
>  From the Apache FAQ, paragraph 19:
> http://httpd.apache.org/docs/misc/FAQ-E.html#indexes
>
> [quote]
> How do I turn automatic directory listings on or off?
> If a client requests a URL that designates a directory and the directory
> does not contain a filename that matches the DirectoryIndex directive,
then
> mod_autoindex can be configured to present a listing of the directory
contents.
> To turn on automatic directory indexing, find the Options directive that
> applies to the directory and add the Indexes keyword. For example:
> 
> Options +Indexes
> 
> To turn off automatic directory indexing, remove the Indexes keyword from
> the appropriate Options line. To turn off directory listing for a
> particular subdirectory, you can use Options -Indexes. For example:
> 
> Options -Indexes
> 
> [/quote]
>
> To disable indexing completely, simply omit the "Indexes" option on the
> document root directory.
>
> What happens if e.g. the /images/ directory is accessed, a "Forbidden"
> response is sent:
>
> -
> Forbidden
> You don't have permission to access /images/ on this server.
> -
>
>
> --
>>O Ernest E. Vogelsinger
>(\)ICQ #13394035
> ^ http://www.vogelsinger.at/
>
>
>
> --
> 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




[PHP] perplexed as to why this is happening...

2002-11-24 Thread Peter Houchin
Howdy,

I'm doing a simple db check.. grabbing a db value, in this case $sec, based
on the user name registered in the session,
I've created a user called test with $sec  equal to "2" but when i get to
the second echo of $sec the value has changed to "1" and I can't understand
why... can some one please give me some idea as to why this is happening?

elseif ($_POST['cost'] >=11){
//query db
$res = mysql_query("SELECT sec FROM users WHERE uname='$_SESSION[uname]'");
$num = mysql_numrows($res) ;
if ($num == 1) {
//get results
$sec = mysql_result($res, 0, 'sec');
echo $sec; // pulls out sec as 2 ( as is sposed to )
}
if (!$sec = "1"){
echo "please contact your nearest
representive";
}
else {
echo $sec; // on this echo $sec has changed value from 2 to 1

Cheers

Peter
"the only dumb question is the one that wasn't asked"



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




RE: [PHP] perplexed as to why this is happening...

2002-11-24 Thread Peter Houchin
thanks for that .. I must be going blind :)

> -Original Message-
> From: Michael Hazelden [mailto:[EMAIL PROTECTED]]
> Sent: Monday, 25 November 2002 11:44 AM
> To: 'Peter Houchin'; php_gen
> Subject: RE: [PHP] perplexed as to why this is happening...
> 
> 
> Ahem ...
> 
> $sec=1 means "set $sec to 1"
> 
> You want
> 
> $sec==1
> 
> :-)
> 
> M.
> 
> -Original Message-
> From: Peter Houchin [mailto:[EMAIL PROTECTED]]
> Sent: 25 November 2002 00:53
> To: php_gen
> Subject: [PHP] perplexed as to why this is happening...
> 
> 
> Howdy,
> 
> I'm doing a simple db check.. grabbing a db value, in this case 
> $sec, based
> on the user name registered in the session,
> I've created a user called test with $sec  equal to "2" but when i get to
> the second echo of $sec the value has changed to "1" and I can't 
> understand
> why... can some one please give me some idea as to why this is happening?
> 
> elseif ($_POST['cost'] >=11){
> //query db
> $res = mysql_query("SELECT sec FROM users WHERE 
> uname='$_SESSION[uname]'");
> $num = mysql_numrows($res) ;
> if ($num == 1) {
> //get results
> $sec = mysql_result($res, 0, 'sec');
> echo $sec; // pulls out sec as 2 ( as is sposed to )
> }
> if (!$sec = "1"){
> echo "please contact your nearest
> representive";
> }
> else {
> echo $sec; // on this echo $sec has changed value from 2 to 1
> 
> Cheers
> 
> Peter
> "the only dumb question is the one that wasn't asked"
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> _
> This message has been checked for all known viruses by the 
> MessageLabs Virus Control Centre.
> 
> This message has been checked for all known viruses by the 
> MessageLabs Virus Control Centre.
> 
>   
> *
> 
> Notice:  This email is confidential and may contain copyright 
> material of Ocado Limited (the "Company"). Opinions and views 
> expressed in this message may not necessarily reflect the 
> opinions and views of the Company.
> If you are not the intended recipient, please notify us 
> immediately and delete all copies of this message. Please note 
> that it is your responsibility to scan this message for viruses.
> 
> Company reg. no. 3875000.  Swallowdale Lane, Hemel Hempstead HP2 7PY
> 
> *
> 
> -- 
> 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




RE: [PHP] forum module for NUKE?

2002-11-25 Thread Peter Houchin
there's sort of one in there already ... but also check out
http://www.nukescripts.net/ and that has links off that for other nuke
sites/add on's

> -Original Message-
> From: The Gabster [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, 26 November 2002 9:35 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] forum module for NUKE?
>
>
> Hi all,
>
> I am looking for a php forum module for NUKE portal system. I am
> specifically looking for the same functionality as yahoogroups
> has where the
> user can post/receive messages on a specified email address- beside
> accessing the forum via the web.
>
> Thanks a lot,
> GAbi.
>
> __
> http://65.104.178.73/marshall/
>
>
>
> --
> 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




RE: [PHP] Warning with Header("Location: test.php")

2002-11-25 Thread Peter Houchin
your header command must go before any other out put to the page ..

eg

 

boo

 etc

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, 26 November 2002 3:02 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Warning with Header("Location: test.php")
>
>
> I have user Header("Location: test.php") in a php file. It is not working,
> instead I have got a warning of the form
>
> Warning: Cannot add header information - headers already sent by (output
> started at /var/www/html/test.php:5) in /var/www/html/test.php on line 15
>
> Here line 15 contains the Header ("Location:test.php") line.
> I will be grateful if you can help me.
>
>
> --
> 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




[PHP] deleting a record.

2002-11-26 Thread Peter Houchin
howdy all,
this should be fairly simple but not turning out to be so am asking for a
little help..
I have a script that fetches all the records in a table and display's them
on the screen.
I get and display the records with the following:
".$myrow['id']."  ".$myrow['company']."";
printf("(DELETE)",
$PHP_SELF, $myrow["id"]);
}?>

now when I click on delete it just reloads the page and doesn't delete the
record. I have this code before anything else on the page to handle the
delete...

if($delete){
$res= mysql_query("DELETE FROM resellers WHERE id=$id");
header("Location: admin2.php?op=resellers");
}

I am relying on the $delete and $id to be set by the url link.

any idea's as I'd like to be able to do this with out having to use a form
with hidden vars..

Cheers

Peter
"the only dumb question is the one that wasn't asked"



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




RE: [PHP] Re: deleting a record.

2002-11-26 Thread Peter Houchin
Thanks Kyle, got it working like a treat :) for some reason it wasn't
selecting the DB but it is now :D

> -Original Message-
> From: Kyle Gibson [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, 27 November 2002 10:05 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Re: deleting a record.
>
>
> >  > // get the list of resellers from the db
> > $res = mysql_query("SELECT * FROM resellers ORDER BY id");
> >
> > // print all records in the DB
> > while ($myrow = mysql_fetch_array($res)){
> > echo " > class=\"content\">".$myrow['id']."
>   > align='justify'> > class=\"content\">".$myrow['company']."";
> > printf(" >
> href=\"%s?op=resellers&id=%s&delete=yes\">(DELETE)",
> > $PHP_SELF, $myrow["id"]);
> > }?>
>
> There's an easier way to display this. It should make your life
> easier...made mine.
>
> Take a look:
>
>  // get the list of resellers from the db
> $res = mysql_query("SELECT * FROM resellers ORDER BY id");
>
> // print all records in the DB
> while ($myrow = mysql_fetch_array($res)): ?>
> 
> 
>  
> 
> 
> 
> (DELETE)
> 
>
>
> > now when I click on delete it just reloads the page and doesn't
> delete the
> > record. I have this code before anything else on the page to handle the
> > delete...
> >
> > if($delete){
> > $res= mysql_query("DELETE FROM resellers WHERE id=$id");
> > header("Location: admin2.php?op=resellers");
> > }
>
> What you should do here is check to see if $res is failing, simply by
> doing the following:
>
> if(!$res) echo "error";
>
> Then, place an 'exit;' after the header(...) command to see if the
> $delete variable is actually being passed.
>
> --
> Kyle Gibson
> admin(at)frozenonline.com
> http://www.frozenonline.com/
>
>
> --
> 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




[PHP] displaying record number in a cell in a table

2002-11-26 Thread Peter Houchin
howdy,

I've had a look around and haven't been able to find what I'm after..

What I'm trying to do is display the number of each individual record with
in a table in a db WITH OUT relying on the records id, here what I've come
up with so far:

//get and count the number of records in the table
$result = mysql_query("SELECT count(*) AS num FROM resellers");
$num = mysql_result($result,0,"num");

//display the number of records
for ($i = 1; $i <= $num; $i++) {?>




http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] displaying record number in a cell in a table

2002-11-26 Thread Peter Houchin
Thanks Robert

> -Original Message-
> From: Van Andel, Robert [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, 27 November 2002 11:43 AM
> To: Peter Houchin; php_gen
> Subject: RE: [PHP] displaying record number in a cell in a table
>
>
> $result = mysql_query("select * from [database table]");
>
> echo "";
>
> while($data = mysql_fetch_array($result))
> {
>   $count++;
>   echo "";
>   echo "$count";
>   echo "$data[0]";
>   echo "$data[1]";
>   ...and so on
>   echo "";
>
> }
>
> echo "";
>
> This will give you a row number for each row.
>
> Robbert van Andel
>
> -Original Message-
> From: Peter Houchin [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, November 26, 2002 4:49 PM
> To: php_gen
> Subject: [PHP] displaying record number in a cell in a table
>
>
> howdy,
>
> I've had a look around and haven't been able to find what I'm after..
>
> What I'm trying to do is display the number of each individual record with
> in a table in a db WITH OUT relying on the records id, here what I've come
> up with so far:
>
> //get and count the number of records in the table
> $result = mysql_query("SELECT count(*) AS num FROM resellers");
> $num = mysql_result($result,0,"num");
>
> //display the number of records
> for ($i = 1; $i <= $num; $i++) {?>
> 
> 
> print $i;?>
> 
> 
> 
> now this all works except that it displays 12345etc in every cell of the
> html table when i need it to display as
>
> 1
> 2
> 3
> 4
> 5
> etc
>
> with each number on a new row in the html table ..
>
> TIA & I hope i've made what am after clear enough...
>
> Cheers
>
> Peter
> "the only dumb question is the one that wasn't asked"
>
>
>
> --
> 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
>
>


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




Re: [PHP] controlling ownership on file uploads ...

2002-11-27 Thread Peter Janett
Since the user Apache is running as created the file, it owns it too.

Make a quick PHP script to delete the files when ready.

HTH,

Peter Janett

New Media One Web Services

New Upgrades Are Now Live!!!
Windows 2000 accounts - Cold Fusion 5.0 and Imail 7.1
Sun Solaris (UNIX) accounts - PHP 4.1.2, mod_perl/1.25,
Stronghold/3.0 (Apache/1.3.22), MySQL 3.23.43

PostgreSQL coming soon!

http://www.newmediaone.net
[EMAIL PROTECTED]
(303)828-9882

- Original Message -
From: "Kenn Murrah" <[EMAIL PROTECTED]>
To: "php list" <[EMAIL PROTECTED]>
Sent: Wednesday, November 27, 2002 10:03 AM
Subject: [PHP] controlling ownership on file uploads ...


> Greetings.
>
> I've written a simple form to allow my clients to upload files to me, and
it
> works fine EXCEPT that the uploaded file is owned by "www" and I while I
can
> read the file, I don't have the necessary permissions to delete it when
done
> ...
>
> Since this site is being hosted elsewhere, is there a way I can control
> ownership so that I can delete the file?  I've written my ISP/web hoster
and
> received no response -- usually that's their subtle way of telling me I
> should ask the PHP quiestion here :-)
>
> Any and all help would be appreciated.
>
> Thanks,
>
> kenn
>
>
>
> --
> 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




Re: [PHP] problem with https

2002-11-27 Thread Peter Janett
The fact that https://whatever gives you a 404 file not found means that
Apache SSL IS working, but it's not pointing where you want it to.

So, you need to check the DocumentRoot setting in httpd.conf and see that
it's pointing where you want it.

You probably either have a virtual host set on port 443 to point to the
wrong DocumentRoot, or you need to set one up on port 443, pointing to the
right DocumentRoot.

HTH,

Peter Janett

New Media One Web Services

New Upgrades Are Now Live!!!
Windows 2000 accounts - Cold Fusion 5.0 and Imail 7.1
Sun Solaris (UNIX) accounts - PHP 4.1.2, mod_perl/1.25,
Stronghold/3.0 (Apache/1.3.22), MySQL 3.23.43

PostgreSQL coming soon!

http://www.newmediaone.net
[EMAIL PROTECTED]
(303)828-9882


- Original Message -
From: "Andre Dubuc" <[EMAIL PROTECTED]>
To: "Vivek Kedia" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, November 27, 2002 9:23 AM
Subject: Re: [PHP] problem with https


> Hi Vivek,
>
> If you are accessing https on localhost, you would need to enter:
>
> https://localhost/whatever_file
>
> You might want to check whether you have https enabled: check phpinfo()
under
> 'Apache Environment'. [HTTPS ] should be "on" as well.
>
> hth,
> Andre
>
>
> On Wednesday 27 November 2002 10:14 am, Vivek Kedia wrote:
> > i have apache 1.3.26 on php 4.2.3 everything else is
> > running fine except "https//whatever"   when i am
> > trying to access the files thru apache , I have looked
> > for SSL properties in httpd.conf and everything is
> > properly enables( that what i think ) . The error
> > generated is "page not found" and when i am running
> > without "s" in the "https://"; the page is being
> > displayed properly ,
> > Do any1 have any idea
> >
> >
> > vivek kedia
> > [EMAIL PROTECTED]
> >
> > __
> > Do you Yahoo!?
> > Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
> > http://mailplus.yahoo.com
>
> --
> 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




RE: [PHP] Postnuke --- Meta keywords and title different for all the pages...

2002-11-28 Thread Peter Houchin
Howdy,

um what exactly do you want to do? add meta tag's to each individual
page?

> -Original Message-
> From: Manoj Nahar [mailto:[EMAIL PROTECTED]]
> Sent: Friday, 29 November 2002 5:26 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Postnuke --- Meta keywords and title different for all
> the pages...
>
>
> Hi there,
>
> I would like to know has anybody being able to do this.
>
> Each page has its own meta keywords and title.
>
> I have searched lot of information about it but no luck.
>
> any help or pointer with this would be greatly appreciated.
>
> Manoj
>
>
> --
> 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




RE: [PHP] apache httpd-2.0.40-8 and scanning alternate extensions for php

2002-12-01 Thread Peter Houchin
if its not there add it

> -Original Message-
> From: Larry Brown [mailto:[EMAIL PROTECTED]]
> Sent: Monday, 2 December 2002 10:31 AM
> To: PHP List; Evan Nemerson
> Subject: RE: [PHP] apache httpd-2.0.40-8 and scanning alternate
> extensions for php
>
>
> That's what I'm saying, there is absolutely no mention of php in
> httpd.conf.
> That line does not exist.  It does in previous versions of RedHat
> / Apache.
> Is it possible that this is some kind of RedHat modification?
>
> Larry S. Brown
> Dimension Networks, Inc.
> (727) 723-8388
>
> -Original Message-
> From: Evan Nemerson [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, December 01, 2002 4:53 PM
> To: Larry Brown; [EMAIL PROTECTED]
> Subject: Re: [PHP] apache httpd-2.0.40-8 and scanning alternate extensions
> for php
>
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> Find the line that looks like "AddType application/x-httpd-php .php", and
> change it to "AddType application/x-httpd-php .php .html"
>
>
> On Sunday 01 December 2002 01:34 pm, Larry Brown wrote:
> > I just moved to a machine with RH8 that has their latest version of
> apache.
> > On prior versions httpd.conf had a section that I could set to have the
> > server scan .html extensions for php tags.  There is no longer such a
> > section even though the server does appropriately scan .php files.  Does
> > anyone know how I can have it scan different extensions?
> >
> > Larry S. Brown
> > Dimension Networks, Inc.
> > (727) 723-8388
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.0.7 (GNU/Linux)
>
> iD8DBQE96oTZ/rncFku1MdIRAlXQAJ9lV5cmg2MLXnnSIVsFWW157+puBQCfTzya
> TGBEeaXx+9XlBxHbzEtWwos=
> =Ajqh
> -END PGP SIGNATURE-
>
>
>
> --
> 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




[PHP] invalid range

2002-12-02 Thread peter a
when I do this

eregi("^([a-zåäö_\.- ]+)$",$value);

I get this:

Warning: Invalid range end in 
/home/zinekweb/public_html/corporate/_mcm_contacts_upload.php on line 42

Why?

I running Apache1.3 on my XP machine with PHP 4.2something.. but when I upload to  a 
RedHat7.2 server with Apache.1.3 and PHP4.0something I get this error.

Can anyone help me out here? Any clues?

   /peter a


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




RE: [PHP] hiding php

2002-12-02 Thread Peter Houchin
yes look around for sum thing like chilli soft from sun microsystems, but
it's not free.. i dunno if there is a free one..

> -Original Message-
> From: Larry Brown [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, 3 December 2002 4:13 PM
> To: PHP List
> Subject: [PHP] hiding php
>
>
> This should bump up my popularity here...can you run asp on apache?  The
> reason I ask is that I understand you can use a php option to
> hide the fact
> that you are running php.  This sounds like a good idea to keep people
> guessing, but I also want to use .asp extensions and have them parsed for
> the php tags.  I thought this would be nice if someone wanted to
> screw with
> a site they wouldn't even be trying tools that would apply.
> However, if you
> can't run asp on apache nobody would be fooled.  Any thoughts?
>
> Larry S. Brown
> Dimension Networks, Inc.
> (727) 723-8388
>
>
>
>
> --
> 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




RE: [PHP] Prevent storing data when reload

2002-12-03 Thread Peter Houchin
yep have the submit got to another page and then have a header location in
there to go back to the original page  that the form is on

> -Original Message-
> From: Lars Espelid [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, 4 December 2002 10:17 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Prevent storing data when reload
>
>
> Hello,
>
> I have a php-page whith a form-schema which stores data to a
> mysql-database
> on submit. (The schema posts data to the same page (php-self).)
>
> When I reload the page the data gets stored once more. I'm sure this is a
> well known problem. Are there any smart tricks to prevent this from
> happening?
>
> Thanks!
>
> Lars
>
>
>
> --
> 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




[PHP] how to make a individual submit...

2002-12-03 Thread Peter Houchin
howdy

i have got me a form, that when submitted is effectlively only one variable,
but when i submit it, it grabs the last field displayed instead of the one
selected.. normally this would be easy but I think because I have it inside
a loop it's playing havock on me..


-[form code in side the while loop] -
// print all records in the DB
while ($myrow = mysql_fetch_array($res)):
$count++;?>


 



// pass on $myrow['id'] to next page


---

--[processing code of the form]--
function usubmit(){
$id = $_POST['number'];
$res=mysql_query("SELECT * from users WHERE id='$id'");
$num = mysql_numrows($res) or die ( Header("Location:
logerror.php?op=log_error") );
$email = mysql_result($res, 0, 'email');
$passwd = mysql_result($res, 0, 'passwd');
$uname = mysql_result($res, 0, 'uname');
$fname = mysql_result($res, 0, 'firstname');
if(!$boo){
echo mysql_error();
} else {
//test output of values
echo $id; // show's id to be the last id in the DB
echo "";
echo $email;
echo "";
echo $uname;
echo "";
echo $passwd;
echo "";
echo $fname;
echo "";
}
---


Cheers

Peter
"the only dumb question is the one that wasn't asked"



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




RE: [PHP] Whimper, help :)

2002-12-03 Thread Peter Houchin
what are the field types in the mysql DB? 

> -Original Message-
> From: John Taylor-Johnston [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, 4 December 2002 4:13 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Whimper, help :)
> 
> 
> Tom,
> Anyone,
> 
> No I'm not looking for a ", I'm trying to pass double quotes into MySQL.
> Like I said, it works when debugging:
> 
> http://ccl.flsh.usherb.ca/print/print.html?search=%26quot%3Bready+
> maria%26quot%3B
> http://ccl.flsh.usherb.ca/print/display.test.inc.phps
> 
> but fails when I try to pass my double quotes in:
> 
> http://ccl.flsh.usherb.ca/print/index.html?search=%26quot%3Bready+
> maria%26quot%3B
> http://ccl.flsh.usherb.ca/print/display.table.inc.phps
> 
> $sql = "SELECT id,AU,ST,BT,AT FROM `$table` WHERE MATCH 
> (TNum,YR,AU,ST,SD,BT,BC,AT,PL,PR,PG,LG,AUS,KW,GEO,AN,RB,CO) 
> AGAINST ('".stripslashes($search)."' IN BOOLEAN MODE) ORDER BY id asc";
> 
> I already have the  $search
> 
> I have tried many variations.
> 
> > If you are looking for " in a string just quote it with '
> > example
> > $like = '"ready maria"';
> > $ sql = " SELECT .. WHERE  LIKE '$like'";
> > no need to escape anything
> 
> 
> -- 
> 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




RE: [PHP] passing sessions via POST

2002-12-04 Thread Peter Houchin


> -Original Message-
> From: Myrage [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, 5 December 2002 3:55 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] passing sessions via POST
>
>
> How do we pass sessions via post ?? I seem to lose the session once it has
> been submitted through the POST Method.
>
> Any help??

to set sessions 1st make sure session_start(); is towards, if not at, the
top of every page
to set session vars $_SESSION[var] = $_POST[var]
to call a session var echo $_SESSION[var];


Cheers
Peter


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




RE: [PHP] Solaris

2002-12-08 Thread Peter Houchin
Kris,

a couple of options for you to try are http://www.sun.com/bigadmin
http://www.solariscentral.com also have a search in google

also you can try this... resart the machine and press stop a after the
banner comes up and you get the "ok" prompt .. then type boot -s (for single
user mode) (you will need to know the root password) it will come up with a
message saying something like .. you are about to enter into maintance
mode.. press control-c to proceed in normal start up mode.

once you have entered in the root password you will be able to mode around
the directories via the command line .. then is a simple matter of tying cd
/etc/rc2.d ; rm 

> -Original Message-
> From: Kris [mailto:[EMAIL PROTECTED]]
> Sent: Monday, 9 December 2002 12:04 PM
> To: PHP List
> Subject: [PHP] Solaris
>
>
> Sorry I know this is off subject but I'm in a bind.
>
> I have a problem with my Solaris box booting up.
> Does I fairly new to all of this so does anybody know a good
> newsgroup for Solaris??
>
> My problem is I added a file so a program would auto load. I
> added the file to etc/rc2.d
> Now this program loads perfect but continues to run and the rest
> of the O/S can't load.
> How can I access that director to delete the file??
>
> Thanks for any help
>
> Kris
>
>


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




RE: [PHP] Can anyone help? PHP script/MySQL problem

2002-12-10 Thread Peter Houchin
Steven,

given what you've just said have you double checked that the spelling is the
same for the field names in your code and also in the db.. also have you
tried to just pass the info on to another page and displaying it?

> -Original Message-
> From: Steven M [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, 11 December 2002 10:26 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Can anyone help? PHP script/MySQL problem
>
>
> Rich,
>
> I'm not getting any error messages.  I have just checked my
> database and the
> only data other than that i manually entered is an auto-increment
> number and
> a random password, which i assume were produced when you filed in
> the form.
> There is no first name, last name, email etc which there should
> have been if
> you filled in the form.
>
> If it was working fine you would recieve an email automatically at the
> address you specified.
>
> If you have any ideas what's wrong i'd love to hear them.
>
> Steven M
> >
> >
> >
> > --
> > 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




RE: [PHP] Report Viruses

2002-12-10 Thread Peter Houchin
only 8? i came in to work this morning and had over 20 of em :( 

> -Original Message-
> From: Stephen [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, 11 December 2002 12:13 PM
> To: Justin French
> Cc: PHP List
> Subject: Re: [PHP] Report Viruses
> 
> 
> Both return mailer demons... 8 more viruses just to check this 
> email. Thank
> goodness I have a virus protection program!!!
> 
> 
> - Original Message -
> From: "Justin French" <[EMAIL PROTECTED]>
> To: "Stephen" <[EMAIL PROTECTED]>; "PHP List"
> <[EMAIL PROTECTED]>
> Sent: Tuesday, December 10, 2002 7:59 PM
> Subject: Re: [PHP] Report Viruses
> 
> 
> > The postmaster@ or abuse@ address of his provider/ISP?
> >
> > Justin
> >
> >
> > on 11/12/02 9:22 AM, Stephen ([EMAIL PROTECTED]) wrote:
> >
> > > This is off topic but, where can you go to report viruses? I've been
> spammed
> > > with them a lot lately from this person and I'd like to stop him.
> > >
> > > Thanks,
> > > Stephen Craton
> > > http://www.melchior.us
> > >
> > > "What is a dreamer that cannot persevere?" -- http://www.melchior.us
> >
> > Justin French
> > 
> > http://Indent.com.au
> > Web Development &
> > Graphic Design
> > 
> >
> >
> >
> 
> 
> 
> -- 
> 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




RE: [PHP] Sendmail

2002-12-10 Thread Peter Houchin
check out sendmail.org

> -Original Message-
> From: Kris [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, 11 December 2002 6:03 PM
> To: PHP List
> Subject: [PHP] Sendmail
> 
> 
> Hey Guys
> 
> I know this is off subject but you people seem to be the only 
> people on the net that know anything :)
> 
> I'm running Solaris 8 and the version of sendmail that comes with that.
> I was sending a batch of emails before with sendmail. I got an 
> error message:
> Sendmail [5899]: gBB1Eov05899: SYSERR(nobody): deliver: for k 1: 
> Not enough space
> 
> Do you know how I can get around this and make it run??
> 
> Thanks 
> 
> Kris
> 

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




[PHP] Re: Uploading a directory via browser w/ php

2002-12-11 Thread Peter Dotinga
Föíö Öxî‰êójînyóon wrote:

Hi I’m wondering if any body has done somthing like uploading a whole
directory trough webbrowser using php, 
or has any Ideas how such a thing can be done, any Ideas appriciated.
 
A serverside-only solution isn't possible. On the clientside, a piece of 
software (eg. java-applet) has to be run to select all the files i a 
directory and somehow move them towards the server.
You could zip the directory to be uploaded into 1 single file, upload it 
and use php to unzip.
For moving large amounts of files around i suggest you use a 
file-transfer protocol such as ftp or scp.

Regards,

Peter


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



RE: [PHP] Plz help to solve my problem.

2002-12-16 Thread Peter Houchin
you will need to say what drive the temp folder is on so c:\temp\ in the
php.ini

> -Original Message-
> From: Martin Towell [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, 17 December 2002 4:11 PM
> To: 'Elaine Kwek'; PHP
> Subject: RE: [PHP] Plz help to solve my problem.
>
>
> From this error
>
> Warning: Failed to write session data (files). Please verify that the
> current setting of session.save_path is correct (/tmp) in Unknown
> on line 0
>
> It looks like you'll have to change php.ini to have
> session.save_path point
> to a valid path. Maybe \temp\  ?
>
> HTH
> Martin
>
> -Original Message-
> From: Elaine Kwek [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, December 17, 2002 4:08 PM
> To: PHP
> Subject: [PHP] Plz help to solve my problem.
>
>
> I am now trying to use php session control in my web application. i try to
> copy a coding an test it...but it come out error. i not sure how to solve
> it. Plz help me...I using Apache server.
>
> the code sample is like this:
>
> 
>   session_start();
>   session_register("sess_var");
>
>   $sess_var = "Hello world!";
>
>   echo "The content of \$sess_var is $sess_var";
>
> ?>
>
>
> And this is the result of the page:
>
> Warning: open(/tmp\sess_c0fe7c6a4524488a979e20d90b2eebb2, O_RDWR)
> failed: No
> such file or directory (2) in c:\Program Files\Apache
> Group\Apache\htdocs\Office_Management_System\tmp\page1.php on line 3
>
> The content of $sess_var is Hello world!
>
> Warning: open(/tmp\sess_c0fe7c6a4524488a979e20d90b2eebb2, O_RDWR)
> failed: No
> such file or directory (2) in Unknown on line 0
>
> Warning: Failed to write session data (files). Please verify that the
> current setting of session.save_path is correct (/tmp) in Unknown
> on line 0
>
>
> thanx to whom reply to me...
>
> Elaine Kwek
>
>
> --
> 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
>
>
>


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




[PHP]

2002-12-17 Thread Peter Trotman




 

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




[PHP] Re: php reference behavior

2002-12-17 Thread Peter Clarke
22 Manopohuji wrote:


hi, i'm running into some weird behavior with php references.  i
distilled it down to some test code below:

 'dean' );

$var1['arrayref']  =  & $array;

$var2  =  $var1;

echo "var1:\n";
print_r( $var1 );

echo "var2:\n";
print_r( $var2 );

$var1['arrayref']  =  NULL;

echo "var1:\n";
print_r( $var1 );

echo "var2:\n";
print_r( $var2 );

?>

it seems that setting a hash key to a reference to something, and then
repointing that key to NULL, apparently sets the original 'something' to
NULL instead of just 'repointing' the hash key!  am i missing something
obvious here, or is this behavior not what you'd normally expect?  i
wrote similar code in perl, and it behaved as i expected: the second
hash still pointed to the original target (i am almost certain c/c++ and
java also behave this way).  so what is going on with php?  does anyone
know how to get it to do what i want it to do --  i.e., merely unset the
key mapping of one of the hashes, leaving the other hash still pointing
at the target?  thansk for any insight you might be able to give!

xomina






Have a look at: http://www.php.net/manual/en/language.references.php
They are not like C pointers, they are symbol table aliases.

Instead of:
$var1['arrayref']  =  NULL;
use:
unset($var1['arrayref']);


Peter


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




[PHP] problem with sending pages directly from browser

2002-12-18 Thread Peter Kocnar
I have problem with sending pages directly(by Send->Page
by E-mail...) from browser(ie6) with Outlook 2002. It
tells:"The current document type can not be sent as
mail.Would you like to send a Short cut instead?". The
pages use php sessions and it is https with 128 bit
encryption. I found that it is caused by the combination
of https and php session. Is there a solution?
Thanks in advance.
Peter



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




[PHP] problem with sending pages directly from browser

2002-12-18 Thread Kocnár Peter
I have problem with sending pages directly(by Send->Page
by E-mail...) from browser(ie6) with Outlook 2002. It
tells:"The current document type can not be sent as
mail.Would you like to send a Short cut instead?". The
pages use php sessions and it is https with 128 bit
encryption. I found that it is caused by the combination
of https and php session. Is there a solution?
Thanks in advance.
Peter



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




[PHP] problem with sending pages directly from browser

2002-12-18 Thread Kocnár Peter
I have problem with sending pages directly(by Send->Page
by E-mail...) from browser(ie6) with Outlook 2002. It
tells:"The current document type can not be sent as
mail.Would you like to send a Short cut instead?". The
pages use php sessions and it is https with 128 bit
encryption. I found that it is caused by the combination
of https and php session. Is there a solution?
Thanks in advance.
Peter




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




[PHP] problem with sending pages directly from browser

2002-12-19 Thread Kocnár Peter
I have problem with sending pages directly(by Send->Page
by E-mail...) from browser(ie6) with Outlook 2002. It
tells:"The current document type can not be sent as
mail.Would you like to send a Short cut instead?". The
pages use php sessions and it is https with 128 bit
encryption. I found that it is caused by the combination
of https and php session. Is there a solution?
Thanks in advance.
Peter



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