[PHP] Creating file & file permissions

2002-11-22 Thread Kris
Hi All

I'm trying to create temp files with my script.
I'm using the line
$fp = fopen("users/temp123", "w+");

which produces the follow error

Warning: fopen("users/temp123", "w+") - Permission denied in
/webSite/signup.php on line 71

How do I get around this??

Thanks

Kris



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




[PHP] URL hiding

2002-11-26 Thread Kris
Hi

When I pass variables to a new page in the address bare of the browser it looks like

www.whatever.com/index.php?uName=Kris&passWd=1234

How can I hide this so it's just

www.whatever.com/index.php or even better just

www.whatever.com

thanks

Kris




Re: [PHP] URL hiding

2002-11-26 Thread Kris
I already use POST as the form method.
I know
www.whatever.com/index.php?uName=Kris can be the same as
www.whatever.com?uName=Kris

I just want to get rid of the ?uName=Kris part on the end
I still need the variables to be passed I just don't want the user to be
able to see them.

Thanks for your help

Kris

- Original Message -
From: "Marco Tabini" <[EMAIL PROTECTED]>
To: "Kris" <[EMAIL PROTECTED]>
Cc: "PHP-General" <[EMAIL PROTECTED]>
Sent: Wednesday, November 27, 2002 9:12 AM
Subject: Re: [PHP] URL hiding


> If index.php is the index page of your website, then you do not need to
> specify it at all.
>
> i.e. www.whatever.com/index.php?uName=Kris
>
> is functionally equivalent to www.whatever.com?uName=Kris
>
> A way to get rid of the variables passed in the query string is to use
> POST instead of GET as the method of your HTML form.
>
>
> Hope this helps,
>
>
> Marco
> --
> 
> php|architect - The magazine for PHP Professionals
> The first monthly worldwide magazine dedicated to PHP programmers
>
> Come visit us at http://www.phparch.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] Solaris

2002-12-08 Thread Kris
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




Re: [PHP] Solaris

2002-12-08 Thread Kris
Thank you so much

Worked like a charm!! :)

Kris

- Original Message -
From: "Peter Houchin" <[EMAIL PROTECTED]>
To: "Kris" <[EMAIL PROTECTED]>; "PHP List" <[EMAIL PROTECTED]>
Sent: Monday, December 09, 2002 12:01 PM
Subject: RE: [PHP] Solaris


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


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




[PHP] Sendmail

2002-12-10 Thread Kris
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] Sendmail

2002-12-10 Thread Kris
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] php-general-unsubscribe@lists.php.net

2002-12-19 Thread Kris

- Original Message -
From: "Quentin Bennett" <[EMAIL PROTECTED]>
To: "PHP GENERAL LIST" <[EMAIL PROTECTED]>
Sent: Friday, December 20, 2002 10:23 AM
Subject: RE: [PHP] Problem with sessions.


Hi,

Is your 'other server' identical (Web Server, PHP Version, register_globals
setting)?

Quentin

-Original Message-
From: Mike Hillyer [mailto:[EMAIL PROTECTED]]
Sent: Friday, 20 December 2002 12:43 p.m.
To: PHP GENERAL LIST
Subject: [PHP] Problem with sessions.


Hello All;

Please forgive me if I am repeating an often asked question, but I am having
a problem with sessions. I simply cannot get them to work.

The sample code I provide works on another server perfectly, this is the
first page:

Session variables set!";
 echo "go to next page";

?>

When called, the following file arrives in /tmp:

sess_f9c5e87b35ae66eac64a9a346321b269

name|s:5:"hilde";pass|s:10:"mypassword";



So obviously the session file is being created.
However, when I go to page2.php?PHPSESSID=f9c5e87b35ae66eac64a9a346321b269
Which has this code:

The password of $name is $pass ";

?>

I get "The Password of  is "

As a response. Both pages work perfectly on another server, so I am having
trouble finding the problem, especially since the session file is actually
created in /tmp

My PHP.ini file is standard to a RedHat RPM install, but I will include it
as an attachment.

Any help would be greatly appreciated!

Mike Hillyer

The information contained in this email is privileged and confidential and
intended for the addressee only. If you are not the intended recipient, you
are asked to respect that confidentiality and not disclose, copy or make use
of its contents. If received in error you are asked to destroy this email
and contact the sender immediately. Your assistance is appreciated.

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

2003-01-21 Thread Kris
Hi

I'm having dramers with fscanf 
I have a line:
text, text, text

I can't work out how to scan removing the comma and whitespace.
the text can be absolutle anything.

at the moment I have 
$array = fscanf ($fp, %s%[^,] %s%[^,] %s%[^,]);

Thanks

Kris


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




Re: [PHP] Re: fscanf

2003-01-21 Thread Kris
I've tried 
$array = fscanf ($fp, "%s, %s, %s\n");
earlier. It picks up
array[0] == text,

I need 
array[0] == text
array[1] == text
array[2] == text

Thanx

K

- Original Message - 
From: "Jason k Larson" <[EMAIL PROTECTED]>
To: "Kris" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Wednesday, January 22, 2003 9:52 AM
Subject: Re: [PHP] Re: fscanf


> I think he is looking more for:
> $array = fscanf ($fp, "%s, %s, %s\n");
> 
> But with split, wouldn't that need to be:
> 
> $array = split(', ', $line);
> 
> http://www.php.net/manual/en/function.split.php
> or
> 
> $array = preg_split ('/[\s,]+/', $line);
> using: http://www.php.net/manual/en/function.preg-split.php
> 
> HTH,
> Jason k Larson
> 
> 
> Philip Hallstrom wrote:
> > Why not:
> > 
> > $array = split("[ ,]", $line);
> > 
> > ?
> > 
> > On Wed, 22 Jan 2003, Kris wrote:
> > 
> > 
> >>Hi
> >>
> >>I'm having dramers with fscanf
> >>I have a line:
> >>text, text, text
> >>
> >>I can't work out how to scan removing the comma and whitespace.
> >>the text can be absolutle anything.
> >>
> >>at the moment I have
> >>$array = fscanf ($fp, %s%[^,] %s%[^,] %s%[^,]);
> >>
> >>Thanks
> >>
> >>Kris
> 
> 
> 
> -- 
> 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] Re: fscanf

2003-01-21 Thread Kris
Thanx Brian...Works good enough for me :)

K


- Original Message -
From: "Brian T. Allen" <[EMAIL PROTECTED]>
To: "'Kris'" <[EMAIL PROTECTED]>; "'Jason k Larson'"
<[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Wednesday, January 22, 2003 10:58 AM
Subject: RE: [PHP] Re: fscanf


> Given the information below this works:
>
> 
> $string ="text1, text2, text3";
> $array = preg_split("/[, ]/", $string, -1, PREG_SPLIT_NO_EMPTY);
> echo "|" . $array[0] . "|" . $array[1] . "|" . $array[2] . "|";
>
> ?>
>
> I put it between pipes to confirm the absence of spaces...
>
> It may or may not be the best way, but it is one way.
>
> Brian
>
> > -Original Message-
> > From: Kris [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, January 21, 2003 5:02 PM
> > To: Jason k Larson
> > Cc: [EMAIL PROTECTED]
> > Subject: Re: [PHP] Re: fscanf
> >
> >
> > I've tried
> > $array = fscanf ($fp, "%s, %s, %s\n");
> > earlier. It picks up
> > array[0] == text,
> >
> > I need
> > array[0] == text
> > array[1] == text
> > array[2] == text
> >
> > Thanx
> >
> > K
> >
> > - Original Message -
> > From: "Jason k Larson" <[EMAIL PROTECTED]>
> > To: "Kris" <[EMAIL PROTECTED]>
> > Cc: <[EMAIL PROTECTED]>
> > Sent: Wednesday, January 22, 2003 9:52 AM
> > Subject: Re: [PHP] Re: fscanf
> >
> >
> > > I think he is looking more for:
> > > $array = fscanf ($fp, "%s, %s, %s\n");
> > >
> > > But with split, wouldn't that need to be:
> > >
> > > $array = split(', ', $line);
> > >
> > > http://www.php.net/manual/en/function.split.php
> > > or
> > >
> > > $array = preg_split ('/[\s,]+/', $line);
> > > using: http://www.php.net/manual/en/function.preg-split.php
> > >
> > > HTH,
> > > Jason k Larson
> > >
> > >
> > > Philip Hallstrom wrote:
> > > > Why not:
> > > >
> > > > $array = split("[ ,]", $line);
> > > >
> > > > ?
> > > >
> > > > On Wed, 22 Jan 2003, Kris wrote:
> > > >
> > > >
> > > >>Hi
> > > >>
> > > >>I'm having dramers with fscanf
> > > >>I have a line:
> > > >>text, text, text
> > > >>
> > > >>I can't work out how to scan removing the comma and whitespace.
> > > >>the text can be absolutle anything.
> > > >>
> > > >>at the moment I have
> > > >>$array = fscanf ($fp, %s%[^,] %s%[^,] %s%[^,]);
> > > >>
> > > >>Thanks
> > > >>
> > > >>Kris
> > >
> > >
> > >
> > > --
> > > 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 General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Re: fscanf

2003-01-21 Thread Kris
Actually found a little problem

I forgot to mention some lines can be

text, t e x t, te xt
t e xt, text, text

This splits it into more then 3 parts.
Any ideas on this? Shouldn't I be able to use just fscanf to get the results
I'm after??

Thanks

K

- Original Message -
From: "Brian T. Allen" <[EMAIL PROTECTED]>
To: "'Kris'" <[EMAIL PROTECTED]>; "'Jason k Larson'"
<[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Wednesday, January 22, 2003 10:58 AM
Subject: RE: [PHP] Re: fscanf


> Given the information below this works:
>
> 
> $string ="text1, text2, text3";
> $array = preg_split("/[, ]/", $string, -1, PREG_SPLIT_NO_EMPTY);
> echo "|" . $array[0] . "|" . $array[1] . "|" . $array[2] . "|";
>
> ?>
>
> I put it between pipes to confirm the absence of spaces...
>
> It may or may not be the best way, but it is one way.
>
> Brian
>
> > -Original Message-
> > From: Kris [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, January 21, 2003 5:02 PM
> > To: Jason k Larson
> > Cc: [EMAIL PROTECTED]
> > Subject: Re: [PHP] Re: fscanf
> >
> >
> > I've tried
> > $array = fscanf ($fp, "%s, %s, %s\n");
> > earlier. It picks up
> > array[0] == text,
> >
> > I need
> > array[0] == text
> > array[1] == text
> > array[2] == text
> >
> > Thanx
> >
> > K
> >
> > - Original Message -
> > From: "Jason k Larson" <[EMAIL PROTECTED]>
> > To: "Kris" <[EMAIL PROTECTED]>
> > Cc: <[EMAIL PROTECTED]>
> > Sent: Wednesday, January 22, 2003 9:52 AM
> > Subject: Re: [PHP] Re: fscanf
> >
> >
> > > I think he is looking more for:
> > > $array = fscanf ($fp, "%s, %s, %s\n");
> > >
> > > But with split, wouldn't that need to be:
> > >
> > > $array = split(', ', $line);
> > >
> > > http://www.php.net/manual/en/function.split.php
> > > or
> > >
> > > $array = preg_split ('/[\s,]+/', $line);
> > > using: http://www.php.net/manual/en/function.preg-split.php
> > >
> > > HTH,
> > > Jason k Larson
> > >
> > >
> > > Philip Hallstrom wrote:
> > > > Why not:
> > > >
> > > > $array = split("[ ,]", $line);
> > > >
> > > > ?
> > > >
> > > > On Wed, 22 Jan 2003, Kris wrote:
> > > >
> > > >
> > > >>Hi
> > > >>
> > > >>I'm having dramers with fscanf
> > > >>I have a line:
> > > >>text, text, text
> > > >>
> > > >>I can't work out how to scan removing the comma and whitespace.
> > > >>the text can be absolutle anything.
> > > >>
> > > >>at the moment I have
> > > >>$array = fscanf ($fp, %s%[^,] %s%[^,] %s%[^,]);
> > > >>
> > > >>Thanks
> > > >>
> > > >>Kris
> > >
> > >
> > >
> > > --
> > > 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 General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] htpasswd

2003-01-22 Thread Kris
Hi

I've built a secure site. After the user has chosen a valid username and password I 
want my script to run htpasswd on the .htpasswd file in the directory. 
The script can run htpasswd as it doesn't have permission. 
What is the safest way to do this?
Should I chmod htpasswd or is there a better option for this whole thing??

Thanks

Kris




[PHP] Threading

2003-03-11 Thread Kris
I want to be able to thread objects .I'm not really sure at all where to start. 
I have an example php script

sleepFor(10);
$b->sleepFor(5);
$c->sleepFor(1);

class sleeper {

 function sleepFor($num) {
  sleep($num);
  echo "sorry I was a sleep for $num \r\n";
 }

}

?>

I want so object $c would print first not last as it is sleeping for less time.
Does that make sense?

Thanks for any help

Kris



[PHP] Threading objects

2003-03-12 Thread Kris
I want to be able to thread objects. I'm not really sure at all where to
start. but I want a script where multiple objects are being processed at the
same time.
I have an example php script

sleepFor(10);
$b->sleepFor(5);
$c->sleepFor(1);

class sleeper {

 function sleepFor($num) {
  sleep($num);
  echo "sorry I was a sleep for $num \r\n";
 }

}

?>

I want so object $c would print then object $b then object $a as the
sleeping time is less and less.
Does that make sense? Please ask if you don't understand

Thanks for any help you can offer what so ever.

Kris




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



Re: [PHP] Threading objects

2003-03-12 Thread Kris
Hi Wilbert

Thanks for responding. However I am completely aware of how objects work as
I come from a Java back ground.
If you are familiar with Java at all I'm looking for something like the
PipedOutputStream, PipedInputStream and Thread classes

I want the processes objects to be threaded, therefore processing
simultaneously.
This would mean $c would print first as it slept for the least amount of
time.

All I'm really asking is how do you initiate threading with PHP?
A small example would be nice

Regards

Kris


- Original Message -
From: "W. Enserink" <[EMAIL PROTECTED]>
To: "Kris" <[EMAIL PROTECTED]>; "PHP List" <[EMAIL PROTECTED]>
Sent: Wednesday, March 12, 2003 9:29 PM
Subject: Re: [PHP] Threading objects


> i'm not sure what you want. But you have created objects here in $a,$b and
> $c.
> If you want to order them in a special way you have to write the
> functionality of course. I think you have to do this before the object is
> created because you define the variables 10,5,1 before the objects are
> created. Once the objects are created they themselves don't know nothing
> form each other. So th eparent object has to control this, or in your case
a
> 'parent piece of script'.
>
> You can use $a,$b,and $c as regular,ordinary variables.  further on.
>
> hope it helped,
>
> Wilbert
>
> - Original Message -
> From: "Kris" <[EMAIL PROTECTED]>
> To: "PHP List" <[EMAIL PROTECTED]>
> Sent: Wednesday, March 12, 2003 12:18 PM
> Subject: [PHP] Threading objects
>
>
> > I want to be able to thread objects. I'm not really sure at all where to
> > start. but I want a script where multiple objects are being processed at
> the
> > same time.
> > I have an example php script
> >
> >  >
> > $a = new sleeper();
> > $b = new sleeper();
> > $c = new sleeper();
> >
> > $a->sleepFor(10);
> > $b->sleepFor(5);
> > $c->sleepFor(1);
> >
> > class sleeper {
> >
> >  function sleepFor($num) {
> >   sleep($num);
> >   echo "sorry I was a sleep for $num \r\n";
> >  }
> >
> > }
> >
> > ?>
> >
> > I want so object $c would print then object $b then object $a as the
> > sleeping time is less and less.
> > Does that make sense? Please ask if you don't understand
> >
> > Thanks for any help you can offer what so ever.
> >
> > Kris
> >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
>
> -
> Pas de Deux
> Van Mierisstraat 25
> 2526 NM Den Haag
> tel 070 4450855
> fax 070 4450852
> http://www.pdd.nl
> [EMAIL PROTECTED]
> -
>
> --
> 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] Threading objects

2003-03-12 Thread Kris
Is it possible to some how thread a php script threw apache. There has to be
something you can do, it seems there is always something you can do :)
What I want is the following.
I administer a mailing list that has a few hundred thousand subscribed
recipients.
I've written a script that runs threw the DB and validates the email
address.
First by format then by connecting to the mail server.
This script takes way to long to run as it has to do one at a time.
I want to some how thread this so it can be validating multiple emails at a
time.
Please excuse my ignorance on the subject my web programming experience is
rather limited.

Thanks

Kris



- Original Message -
From: "Rasmus Lerdorf" <[EMAIL PROTECTED]>
To: "Kris" <[EMAIL PROTECTED]>
Cc: "W. Enserink" <[EMAIL PROTECTED]>; "PHP List" <[EMAIL PROTECTED]>
Sent: Thursday, March 13, 2003 1:04 AM
Subject: Re: [PHP] Threading objects


> > All I'm really asking is how do you initiate threading with PHP?
> > A small example would be nice
>
> You don't.  This is a web scripting language, not Java.
>
> -Rasmus
>
> --
> 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: Approved

2003-08-20 Thread kris
Please see the attached file for details.
-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Server Setup Walkthrough?

2002-08-30 Thread Kris

Hi All,

Relatively new to PHP and Apache. I've had some trouble setting up my own
web server for learning on - I basically have no idea where to start in
order to get them both working together. Does anyone have a link to a
website (or the time to help me) that I could take a look at? I'd much
appreciate it.

Regs,
Kris



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




[PHP] Sending variables help

2002-11-21 Thread Kris
Hi All

I want to send variables from one page to another page.
How can I go about this???

I don't want to use a form. Or if using a form I don't want the user to have
to hit the submit button.

Thanks

Kris



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




[PHP] fputs/fgets working irregularly

2002-06-09 Thread Kris

Hi all,

I'm having some trouble getting my basic news script to work. Here is the
code:

 $fp = fopen("data/prev.txt","r");
 while (!feof ($fp)) {
 $pr = fgets($fp, 4096);
 }
 fclose($fp);

 $fp = fopen("data/news.txt","r");
 while (!feof ($fp)) {
 $ag = fgets($fp, 4096);
 }
 fclose($fp);

 $fp = fopen("data/news.txt","w");
 $np = fputs($fp,$pr);
 fclose($fp);

 $fp = fopen("data/news.txt","a");
 $ng = fputs($fp,$ag);
 fclose($fp);

The news.txt does not append what is stored in $pr for some reason. I can't
put my finger on what the problem is, the file is chmod correctly as well.
Can anyone help?

Thanks,
Kris



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




[PHP] 4.0.4 Postgres link resource bug?

2001-01-15 Thread kris

Hi,

I have a script that worked up until I upgraded the server from PHP 
4.0.2 to 4.0.4.  I get:

1 is not a valid PostgreSQL link resource.  Why is this broken all of 
a sudden?  here is some code:

function SQLCall($call){
global $psqlhost, $psqldb, $rows, $result;
$db_connect=pg_connect("host=$psqlhost 
dbname=$psqldb");
$result=pg_exec($db_connect, "$call");
$rows=pg_numrows($result);
}

$call="insert into agents (fname, lname, address, city, state, 
zip, email,
country, homephone, workphone, company, username, password, 
created, visits, fax, status,
pridomain, title) values ('$fname', '$lname', '$address', '$city', 
'$bizstate',
'$zip', '$email', '$country', '$homephone', '$workphone', '$company', 
'$username',
'$cryptpass', '$created', $visits, '$fax', '$status', '$pridomain', 
'$title')";
SQLCall($call);
include("results/newagent.php");

This (bug?) seems to only affect INSERT calls to pg_sql.  The 
functions within the script which use UPDATE sql calls (using the 
same SQLCall($call) function in this script work fine.

Any ideas?

Thanks,

Kris

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

2001-12-29 Thread Kris

Hi,

Does anyone know where these have gone, or have them archived somewhere?
Google hasn't cached them.

http://www.lerdorf.on.ca/nntp.phps
and
http://www.lerdorf.on.ca/nntp.php3

Alternatively, anyone who has/has done code to take the headers, and
only the headers, of posts in a newsgroup and whack them into (& update
with new entries) a database, that would be nice to save me the coding
time :-)



-- 
Kris | [EMAIL PROTECTED] | ICQ: 10537480
AIM: katticist | MSN: [EMAIL PROTECTED] | YIM: k_j_clarke
PGP: http://home.clara.net/kjclarke/pgpkeys.txt


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




[PHP] need help with cookies

2001-03-22 Thread kris

Hi, I am trying to set a cookie and it doesn't work.  I am running IE 5.
I have IE set to prompt before setting cookies but I never get a prompt.

Here is my code - basically, if someone logs in, it is to set a cookie.
What am I missing?   Kris

if($success==1){
$loginid="$id";
NewSessionID($id);
GetProfile($id);
$page_title="LTT: $loginid Index";
include("html-head.php3");
if($id==""){
include("ln/ln_ln_dna.php3");
exit;
}
include("ms/rg1/index.php3");
exit;
}

function NewSessionID($id){
$sid="";
$length=16;
srand((double)microtime()*100);
$SessPool = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
$SessPool .= "abcdefghijklmnopqrstuvwxyz";
$SessPool .= "0123456789";

for($tempslime=0; $tempslime < $length; $tempslime++) {
$sid .= substr($SessPool, (rand()%(strlen($SessPool))), 1);
}
setcookie("LoginAuth", $sid,time()+3600);
}

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




RE: [PHP] need help with cookies

2001-03-22 Thread kris

I beleive I am attempting to set this cookie before any headers are sent.
?
Kris
On 22 Mar 01, at 14:38, Brian V Bonini wrote:

> I believe you need to set the cookie
> before any other header information is 
> passed.
> 
> -brian
> 
> > -Original Message-
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, March 22, 2001 2:23 PM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] need help with cookies
> > 
> > 
> > Hi, I am trying to set a cookie and it doesn't work.  I am running IE 5.
> > I have IE set to prompt before setting cookies but I never get a prompt.
> > 
> > Here is my code - basically, if someone logs in, it is to set a cookie.
> > What am I missing?   Kris
> > 
> > if($success==1){
> > $loginid="$id";
> > NewSessionID($id);
> > GetProfile($id);
> > $page_title="LTT: $loginid Index";
> > include("html-head.php3");
> > if($id==""){
> > include("ln/ln_ln_dna.php3");
> > exit;
> > }
> > include("ms/rg1/index.php3");
> > exit;
> > }
> > 
> > function NewSessionID($id){
> > $sid="";
> > $length=16;
> > srand((double)microtime()*100);
> > $SessPool = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
> > $SessPool .= "abcdefghijklmnopqrstuvwxyz";
> > $SessPool .= "0123456789";
> > 
> > for($tempslime=0; $tempslime < $length; $tempslime++) {
> > $sid .= substr($SessPool, 
> > (rand()%(strlen($SessPool))), 1);
> > }
> > setcookie("LoginAuth", $sid,time()+3600);
> > }
> > 
> > -- 
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> > 
> > 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 



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




[PHP] list down

2005-02-25 Thread Kris
sent an email to the list earlier.. never received a copy.. its like the 
list went down around 8AM CST?

--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 266.4.0 - Release Date: 2/22/05
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] php5.0.3 compile problem "cannot find libz"

2005-02-25 Thread Kris
Hello,
I have PHP5 running but wanted to recompile for mysql support.
./configure --prefix=/usr/local/php5 
--with-apxs2=/usr/local/apache2/bin/apxs --with-libxml-dir=/usr/lib 
--with-mysql=/usr/local/mysql

it complained about libz so I added --with-zlib-dir as:
./configure --prefix=/usr/local/php5 
--with-apxs2=/usr/local/apache2/bin/apxs --with-libxml-dir=/usr/lib 
--with-mysql=/usr/local/mysql --with-zlib-dir=/usr/lib

And so configure errors out on "Cannot find libz"
my /usr/lib contains:
zlib.so, libz.so.1  ..
Can anyone tell me what I need to do on my ./configure to get rolling?
This PHP is currently running with Apache2.. I am running MySQL5 as 
well.. my working PHP install was configured using the first configure 
statement in this email minus --with-mysql.. working just fine....

Thanks
Kris
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 266.4.0 - Release Date: 2/22/05
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: document

2004-04-21 Thread kris
Please read the document.


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

[PHP] Re: here

2004-06-24 Thread kris
See the file.



Norton AntiVirus eliminato1.txt
Description: plain/text
-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] PHP Crypt on MacOSX

2004-10-25 Thread Kris
I recently moved a site to a MacOSX based Apache/PHP server.  Apparently 
crypt only uses DES.  I read somewhere that "there is no way to get it 
use use MD5", which sounds hard to beleive considering the OS is BSD based.

So.. here is my dilema.. My db contains usernames and passwords.  The 
passwords are MD5 $1ljdslkjdsf$lkjdsaflkjdsf (created by crypt().)  So 
on this new box, new accounts created get DES passwords.  I just as well 
prefer to not see any DES encryptions used in this db.

Any Mac OSX'ers in here that may have a solution?  All my users 
recreating new passwords for their account is not an option.

Thanks for any ideas,
Kris
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] file upload

2004-10-26 Thread Kris
H
Setup a CRON job using SCP or cURL.  You can use SOAP or create your own 
similar system.  I have never used SOAP but use the same principles.

Example:  Company X needs some strange format of data (text file, CSV or 
whatever) delivered to them SECURELY at 5am EST.  The company cannot 
afford to pay for any sane sysAdmin to do this at -7 GMT.  Thanks to 
advances in PHP, the sane admin can now do what was once done via PERL 
and CRON; create a PHP shell script [executed by CRON] to do the following:

Pull data from a database, create this alleged data file, send the file 
via SCP or cURL.  If you use cURL, the remote system has a script which 
receives your connection and parses alleged file.  Security and parsing 
is another topic altogether.

PHP is a server side scripting language.  A browser is just another way 
to view output from PHP.

PHP is so many fantastic things.  It is generally less "malicious" than 
your needs purport.  Sounds like you need the efficacies of javascript 
if the example above does not fit your scenario.  Since most people 
ignore the wisdom of turning javascript off in their browsers, you 
should be able to take advantage of many of the "features" it 
provides.   However, you need to visit a javascript list for anything 
down this path.  If you are not forthcoming enough as to your 
intentions, you are most likely not going to receive any assistance 
simply because your idea sounds "malicious".

Programmers tend to keep the caveats of programming exploits unto 
themselves.  However, it is just as likely that your intent is not 
malicious, and therefore you may wish to simply revise your question and 
description of the problem/scenario you are attempting to overcome.  All 
in all, more information leads to... more information! :)  I speak from 
experience.  I post confusing questions at times too, which result in 
confused responses or links to manual pages I've already read more than 
once.  The real solution to this aside is to post more detailed questions.


Victor C. wrote:
Thanks for answering Chris..
What if I want to send a file from my web server to another site for them to
parse?  I already know what file I want to send and I do not want to have to
select the file by doing "browsing".
"Chris" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
 

You can't, at least you SHOULDN'T. Just think about what you're asking
for, you want to download a file from a users computer, without them
knowing about it.
Major security/privacy issues there that browsers try to prevent.
Chris
Victor C. wrote:
   

Hi,
I'm trying to submit a file from "index.php" to "index2.php". I know how
 

to
 

do file upload in PHP. On "index.php"
I have:




The next page would only need to use $HTTP_POST_FILES['myfile'] to access
the submitted file.
My question is: if I already know which file I want to submit, say
"file1.xml".  How can I just ask "index.php"
to submit "file1.xml" to "index2.php"?  Without asking the users to pick
 

the
 

file to upload?
Thanks a lot in advance!

 

 

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


Re: [PHP] file upload

2004-10-26 Thread Kris
Victor
Yes, Chris is correct.  Maybe you can POST your file via cURL to the 
remote script expecting to receive your file from the authentication 
site.  Definitely check PEAR.  There is also some info at php.net about 
new SOAP capabilites built-in to PHP 5.  Unfortunately I have only used 
cURL to do similar to what I think you are trying to do, so I can only 
suggest at this time to review what is new in PHP (which is where I saw 
mention of this "built-in SOAP" of PHP5.)

Feel free to write back and we will continue in attempts to assist.
Chris wrote:
Ahh, if you *have* to push the data (which you obviously do) and the 
authentication site has no other authentication methods then you have 
to POST the file with PHP. It can be done, there are many classes for 
it, I can't recommend any specific class, but I'm sure someone else 
here could.

I would surprise me if something in PEAR ( http://pear.php.net/ ) 
couldn't do it. Just look for an HTTP class that can POST files.

Chris
Victor C. wrote:
See... basically, I have two sites. One site provides user 
authentication
and another one requests the authentication. The requesting site need to
send to the authentication site its request in an XML.  The 
authentication
site is suppose to get the XML file using $HTTP_POST_FILES.  I'm 
using PHP
to dynamically generate the request XML file and I need to submit it 
to the
authenticating site; but I don't want to use file upload and browse
functionality, because the authentication process is suppose to be
transparent to the end users.

Again, thanx for the help and any insights would be greatly 
appreciated. :)


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


Re: [PHP] Re: PHP Crypt on MacOSX

2004-11-03 Thread Kris
Galen,
Thank you for the response.  I understand where you are coming from; 
your use of MD5 hash.  In short, my goal is to recreate crypt()'s method 
of creating "unix style" passwords without using PHP's built-in crypt() 
function... (as seen in /etc/shadow on a *nix server, ie. 
$1$sed$blaaah instead of standard MD5 hash which does not use 
$1$$ to store a "seed".)

Ultimately, my problem exists related to the server I am using, where 
the server's PHP crypt (using libmcrypt) returns with the fact that
CRYPT_MD5 = 0 .

In researching, I have been told that this is a limitation of Mac OS X, 
that "there is no way to have libmcrypt support both DES and MD5" on 
this OS.. but I know there must be a way because it is easy to have a 
FreeBSD server use both DES and MD5.

I had an old BSD box online for years.. where old account passwords in 
/etc/shadow were encrypted via two character salt DES.  One day, I made 
a simple change to the box's config and then any new accounts created 
would use MD5.  The "coolest" part is that any old passwords in DES 
could remain DES, and BSD's libmcrypt could determine if a passwd in 
/etc/shadow was DES or MD5 and handle accordingly.  Obviously, this kept 
me from having to call clients and change their password so as to 
re-encrypt their respective /etc/shadow entry into MD5.

I hope this email better explains my situation.   I'll check out man md5 
on the Mac box and see what I can figure out.  In the meantime, if this 
email helps to generate any ideas which may be helpful in my current 
quest, your input would be most appreciated.

Thanks again,
Kris
Galen P.Zink wrote:
Kris,
I'm not quite sure what you mean here. When I work with md5, I always 
have considered it to work like this:

string -> md5 = hash
On any system, the md5 binary, md5 php function, and MySQL md5 (in 
most cases - though in certain situations you could have problems if 
you have a field of the wrong type or length) all work exactly alike.

This is how I have always thought of md5 and considered it to be 
"standard" and I've never had a problem with it. I've made dozens of 
web and other php/mysql applications.

There have never been seeds or anything else involved in my 
experiences. I do know that in some cases a "salt" is setup on certain 
unix systems. I don't know a lot more about this and I don't know how 
it applies to your situation. I would encourage you to look at "man 
md5" in the command line under OS X which documents OpenSSL and md5 
well. I imagine there is a function there somewhere to work with the 
salt or seed or whatever you have going.

If you can give me some specific examples of your situation I might be 
able to help more, but I would encourage you to poke a little deeper 
yourself first. Let me know how it goes.

-Galen
On Nov 3, 2004, at 11:22 AM, Kris wrote:
Hi Galen,
Yes, OSX seems nice, however, still having a problem with MD5 on the 
box.

When I use MySQL's MD5('$password'), it generates MD5 but not in the 
traditional *nix manner, ie. $1$hy67ju86h$nughjgh86fgasdf.  Instead I 
seem to just get a hash, no $1$blahblahseed$, just a long string (MD5 
hash I presume).

My original problem is that, on my development server, I have MD5 
encrypted passwords in the manner shown above $1$yadayada$ I 
didnt see in the php MD5 how to recreate this without using crypt().  
I can get the seed $1$123456789$ into a $var but how do you get MD5 
to use the seed from a variable to compare db password against 
password data from a form?  Can you help?  Is this possible?

Thanks,
Kris
Galen wrote:
I use md5 all the time and OS X is my web development staging 
environment! I write and test all my scripts on OS X and then send 
off to the server. I don't use crypt, but I have never seen any 
problems going between the two. apache, php, mysql, rsync, ssh, scp, 
everything *nixy plus a nice interface makes OS X the ideal web 
development environment - at least for me.

Not only can MySQL do md5, there is an md5 function in php which 
I've used many times under OS X no problem:
http://us2.php.net/md5

If that wasn't enough, OS X ships with an md5 binary that's in the 
usual file path so typing "md5" in the command line will pull it up 
and "man md5" gives all the info you could need on using it. I don't 
encourage the use of the command line version of md5 for php because 
it will be slower than the built in php function, but it is there!

-Galen
On Oct 25, 2004, at 10:38 AM, Daniel Schierbeck wrote:
Kris wrote:
I recently moved a site to a MacOSX based Apache/PHP server.  
Apparently crypt only uses DES.  I read somewhere that "there is 
no way to get it use use MD5", which sounds hard to beleive 
considering the OS is BSD based.
So.. here is my dilema.. My db contains user

Re: [PHP] Re: PHP Crypt on MacOSX

2004-11-04 Thread Kris
Galen P.Zink wrote:
Kris,
I doubt there's "no way" to do this under OS X. Maybe by default, you 
have a curve ball to deal with. But considering the kernel is open 
source, you could make this OS do anything... literally :)
That is how I feel as well.  Being a long-time *nix/BSD user.. I have 
heard it before and never believe "it cant be done".  I remember back on 
the C64, they said the computer would not support a 9600BAUD modem, then 
one day I am plugging one into my cartridge port and getting "blazing" 
speeds (LOL This was in the eighties obviously)...

A second problem, and why I want to create some PHP to mimic crypt() 
"unix style" passwords without actually using crypt() is due to the fact 
that this box is not my box and so the option of modifying the OS is 
currently not an option.  Consider this thread dead unless someone else 
has a solution.  Thanks for thinking it through.  Your time has been 
greatly appreciated.

A side note; I am amazed that no one else on this list can or is jumping 
into this discussion about using PHP to mimic PHP's crypt() function in 
order to create "unix style" MD5 passwords.  I know it has been done 
before, and can be done probably many different ways.  The idea of using 
system() or exec() to call MD5 is an option I will be looking into, 
however, I know there must be another option.  I have considered 
rewriting my own version of crypt() to not use libmcrypt but the 
information on the C-like Zend language used to write your own embedded 
PHP functions is a bit vague in regards to me "getting over the learning 
curve".  My other option is to just move this to another server and then 
my existing crypt() based code will resume functioning as expected.

I dont except a reply from Rasmus or Zeev, as they are extremely busy 
guys, however, I won't stop them if they are interested in this thread.

Help me Obi Won, you are my only hope. LOL
Take Care,
Kris
[EMAIL PROTECTED]
Where is your PHP package coming from? If you've already been using 
the http://entropy.ch binary, maybe you should try compiling your own. 
Or get (and either compile yourself or just install binaries) it via 
fink (http://fink.sf.net/) which often gives you different options for 
libraries to use and such during install. Or any number of other 
options. I wonder if there is some build option or something setup in 
the configuration process that affects this. I seriously wonder how 
libmcrypt could have this sort of limitation under OS X, but I am not 
that type of programmer.

I would encourage you to play with this and post your results to the 
php-general list as well as letting me know how it goes.

-Galen
On Nov 3, 2004, at 2:31 PM, Kris wrote:
Galen,
Thank you for the response.  I understand where you are coming from; 
your use of MD5 hash.  In short, my goal is to recreate crypt()'s 
method of creating "unix style" passwords without using PHP's 
built-in crypt() function... (as seen in /etc/shadow on a *nix 
server, ie. $1$sed$blaaah instead of standard MD5 hash which 
does not use $1$$ to store a "seed".)

Ultimately, my problem exists related to the server I am using, where 
the server's PHP crypt (using libmcrypt) returns with the fact that
CRYPT_MD5 = 0 .

In researching, I have been told that this is a limitation of Mac OS 
X, that "there is no way to have libmcrypt support both DES and MD5" 
on this OS.. but I know there must be a way because it is easy to 
have a FreeBSD server use both DES and MD5.

I had an old BSD box online for years.. where old account passwords 
in /etc/shadow were encrypted via two character salt DES.  One day, I 
made a simple change to the box's config and then any new accounts 
created would use MD5.  The "coolest" part is that any old passwords 
in DES could remain DES, and BSD's libmcrypt could determine if a 
passwd in /etc/shadow was DES or MD5 and handle accordingly.  
Obviously, this kept me from having to call clients and change their 
password so as to re-encrypt their respective /etc/shadow entry into 
MD5.

I hope this email better explains my situation.   I'll check out man 
md5 on the Mac box and see what I can figure out.  In the meantime, 
if this email helps to generate any ideas which may be helpful in my 
current quest, your input would be most appreciated.

Thanks again,
Kris
Galen P.Zink wrote:
Kris,
I'm not quite sure what you mean here. When I work with md5, I 
always have considered it to work like this:

string -> md5 = hash
On any system, the md5 binary, md5 php function, and MySQL md5 (in 
most cases - though in certain situations you could have problems if 
you have a field of the wrong type or length) all work exactly alike.

This is how I have always thought of md5 and considered it to be 
"standard" and I've never had a problem with it. I

[PHP] Automajickally POST to a remote form

2002-11-25 Thread Kris Williams
Heyas,

Once upon a time I used to be able to POST form data to external sites with 
ASP and an MSXML (or something) server object on IIS and I'm wondering if 
there's a similar sort of technique using PHP.  Would prefer it if I didn't 
have to use anything that isn't part of your typical PHP/Apache install (if 
there is such a thing) but will take what I can get.

The easiest description of what I'm attempting is:  user hits PHP page, 
page submits predefined search terms to Google and the results are 
displayed.  The user wouldn't have interacted with the search at all (ie: 
no button clicks) as it's all performed by the PHP script.

Thoughts?
Kris 


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



Re: [PHP] Automajickally POST to a remote form

2002-11-26 Thread Kris Williams


You can post with PHP using cURL or doing it yourself manually.
Search the archives for this, as the previous answers to this are
more complete than what I have time to explain now. Here is a quick
example of the manual approach:

http://shiflett.org/tutorials/php_post.txt


Thanks Chris.  A useful answer that's much appreciated :)

And yeh, after just after posting I realised my example using Google was a 
bad one with of the GET/POST thing.  Just tried to pick a generic site as 
an example as what I'm intending to do is probably too much hassle to 
explain in full.


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



[PHP] Re: Checking for HTTP:// at the start of a string and more ////

2003-03-01 Thread Kris Jones
Untested:

if (preg_match('/^http:\/\/[^\.\s]+\.[^\s]+\/$/i', $string))
   // valid string
else
   // invalid string
Should match a string beginning with 'http://', followed by one or more
characters that are no dots or whitespace, followed by a dot, followed >by 
one or more characters that are not whitespace, and terminated with >a 
slash. The terminating 'i' makes the search case insensitive.
I've also been looking for this information. Can you please point me to a 
list of those string codes? My search for them in the documentation has been 
fruitless.







_
The new MSN 8: advanced junk mail protection and 2 months FREE*  
http://join.msn.com/?page=features/junkmail

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


[PHP] regex makes my head hurt

2003-03-04 Thread Kris Jones
I've been attempting to figure out regex, and I've realized I need to start 
over from scratch. And get lots of help!

I'm inputting a text file containing html which will contain this:

IBM
2:59pm

76.17
I need to be able to match this string via a variable. I would like to put 
everything from the "" to the "" into a variable so I can 
parse it later. I think I can do that bit on my own.

So I "borrowed" some code from another source, but I need an algorithm that 
will match the above chunk of html.

I give it the name:

$name = "IBM";

and it matches everything from the "" to the "".

   if (preg_match("/  part using $name(.*?)/", $line, 
$out)) {

   $title = $out[1];
   break;
   }
}
echo "$title";
I can't figure out how to escape all the parts of:

Do the other parts look okay?

_
The new MSN 8: advanced junk mail protection and 2 months FREE*  
http://join.msn.com/?page=features/junkmail

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


[PHP] "Anchor Collector"

2003-07-08 Thread Kris Yates
http://192.168.0.1/index.php?DSE=matrix&access=31337#herd

1. Grab the Anchor reference "herd" from the fake URL above and store
it as a variable using PHP.
You already know the facts...
QUERY_STRING: DSE=matrix&access=31337
REQUEST_URI=/index.php?DSE=matrix&access=31337
HTTP Request: Get /index.php?DSE=matrix&access=31337
PHP_SELF=/index.php
_REQUEST["DSE"]: matrix
_REQUEST["access"]: 31337
and same for _SERVER vars per normal PHP operation.

So, does anyone have any ideas?   I was just going to ereg and parse it 
out to a variable but
PHP cant 'grab' the anchor passed as part of the URI requested.  
According to what I have found, browsers dont send the anchor in the URI 
but use the anchor "locally" within the page.
This is okay, except when the index.php dynamically generates frames 
containing references to dynamically generated pages.  I want to pass 
the anchor in one of the frames.

So far, my conclusion deems #1 impossible.  I am hoping someone can 
prove me wrong.

Kristophari

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


Re: [PHP] Spammer! Re: [PHP] ANNOUNCING: Rekall V2.0.0 for Linux/UNIX....

2003-07-08 Thread Kris Yates
With all due respect to everyone, including the alleged spammer, this 
has been my rule since '84.

If you are in a discussion group, dont advertise something unless 
someone posts a question where a product would act as a specific 
solution to their specific need.  The advertiser would then be expected 
to mention how exactly the product advertised affects the output of the 
question, or solves the problem posed by said question.  Obviously, this 
thread should be either moved to another list or else just killed since 
spam has no direct links to PHP, nor did Rekall have any direct link to 
any question posed on the PHP general list.

Ultimately, it is the list moderators responsibility to establish a set 
of core rules for interaction inside this 'virtual world' we all use to 
help others learn PHP.  I do not know that this list has any core rules 
defined.  On my lists, where rules are not defined, I just delete 
spammers without warning or notice, and furthermore ban that email 
address from the list permenantly. But then again, I am just oldschool 
BOFH from the eighties.

I say let us allow this thread to die and/or let the owners/moderators 
handle it as they see fit.  What if the alleged spammer is friends with 
Rasmus Lerdorf?  Would that affect your opinion?  Not mine, but just 
something to ponder as we allow the dead [posts] to rest in peace.

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


[PHP] Where do I post loadable extensions questions? (semi-multi-part)

2003-07-09 Thread Kris Yates
Hi,

Is there a better list for posting question about creating loadable 
extensions (.so) for PHP?  Or is this [php-general] the best place to post?

Also, I saw a post on another PHP related site that said this was not C, 
but some kind of C macro language? - - but you can use real C code?  
Confusing... Can someone define more clearly what I am actually writing?

I have successfully recreated the demo extension found in the manual, 
and have created/compiled
some other basic "modules" with only minor problems/guesswork involved.  
At this point, I am limited by lack of documentation in the PHP manual, 
and my lack of knowledge of C.  I am picking it up [C] rather quickly 
due to just not being a novice at programming (ie. PHPing since early 
'98).  I have found no other source code examples of modules except the 
one in the manual.  Does anyone have any links or samples?

Thanks,

Kristophari

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


[PHP] PHPSESSID auto-append

2003-07-16 Thread Kris Yates
What php.ini setting causes the following:

A link in a document index gets modified by PHP, 
so that the end-user sees
index

in the source? How do you turn this off?

Thanks,

Kris

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


Re: [PHP] error problem

2003-08-14 Thread Kris Reid
Sorry the second "echo "Hello world";" was meant to have no semi colon

- Original Message -
From: "Kris Reid" <[EMAIL PROTECTED]>
To: "PHP List" <[EMAIL PROTECTED]>
Sent: Thursday, August 14, 2003 12:37 PM
Subject: [PHP] error problem


When I have an error in my code nothing gets written to the screen.

If I have



It will works normal.
but if I have



Nothing gets written to the browser. Not even the error message.

When I run php on the command line I get error messages just not when
running through a browser.
Where should I start looking for the problem?

Thanks

Kris




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



[PHP] error problem

2003-08-14 Thread Kris Reid
When I have an error in my code nothing gets written to the screen.

If I have



It will works normal.
but if I have



Nothing gets written to the browser. Not even the error message.

When I run php on the command line I get error messages just not when running through 
a browser.
Where should I start looking for the problem?

Thanks

Kris



[PHP] Forms

2003-08-14 Thread Kris Reid
I'm having trouble explaining this so please bare with me.

Say there is a form hosted on server A on a web page
Something simple like








I have the data on server B in a mysql database that needs to be inserted via that 
form. 
I have written a script that will grab one record and submit it via the form.
The only problem is I have to keep going back and refreshing my web page to get it to 
submit another record.

Is there a way of doing this? Please note I have no access to Server A so I can't just 
edit there database. Does this make sense? :)

Thanks

Kris


Re: [PHP] Forms

2003-08-14 Thread Kris Reid

- Original Message -
From: "Robert Cummings" <[EMAIL PROTECTED]>
To: "Kris Reid" <[EMAIL PROTECTED]>
Cc: "PHP List" <[EMAIL PROTECTED]>
Sent: Wednesday, August 13, 2003 12:25 AM
Subject: Re: [PHP] Forms


> If I understand your question correctly it sounds like you want to
> populate a database on Server A with data residing in a database on
> server B via a form hosted on server A *grin*. Obviously this is
> tedious, and if there are a lot of entries then I would suggest writing
> a script to populate and submit the form automatically. If you are lucky
> everything will be done via HTML GET method (URL parameters); however,
> it is more likely that it uses the POST method. You can do some reading
> into posting data via HTML request headers, or you can look and see if
> there is a class that does what you want in PEAR or PHP Classes.
>
> HTH,
> Rob.
>
>
> On Tue, 2003-08-12 at 10:18, Kris Reid wrote:
> > I'm having trouble explaining this so please bare with me.
> >
> > Say there is a form hosted on server A on a web page
> > Something simple like
> >
> > 
> > 
> > 
> > 
> >
> >
> >
> > I have the data on server B in a mysql database that needs to be
inserted via that form.
> > I have written a script that will grab one record and submit it via the
form.
> > The only problem is I have to keep going back and refreshing my web page
to get it to submit another record.
> >
> > Is there a way of doing this? Please note I have no access to Server A
so I can't just edit there database. Does this make sense? :)
> >
> > Thanks
> >
> > Kris
>
> --
> .-.
> | Worlds of Carnage - http://www.wocmud.org   |
> :-:
> | Come visit a world of myth and legend where |
> | fantastical creatures come to life and the  |
> | stuff of nightmares grasp for your soul.|
> `-'
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>

Robert

Thanks for explaining my situation better. That's spot on.
I have php grabbing data from my database and filling the form. Then
JavaScript automatically submits the form.
However once the form is submitted. Server A forwards the browser else
where. So I have to type in my URL again.

Is there some way I can more or less dump my database into theirs via the
form. There are a #$%^ load of records.

Thanks

Kris



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



[PHP] Foreach POST VARS problem

2003-08-15 Thread Kris Yates
It seems to me that this used to work but I guess something has changed 
somewhere between PHP 4.2 and 4.3?

I am running PHP 4.3.2 as an Apache DSO on an FBSD box.  If it is not 
obvious, I am trying to parse checkbox form POST results as seen below:

   $colors="";
   foreach($HTTP_POST_VARS as $ThisVar=>$ThisVal){
   if(ereg("color-", $ThisVar) AND $ThisVal=="on" OR $ThisVal==1){
   $newVarA=explode("-", $ThisVar);
   $colors.="$newVarA[1]:";
   }
   }
*Warning*: Invalid argument supplied for foreach() in 
*/devda1/htdocs/2binteractive.com/htdocs/0new/content/lanskyShopAdmin.php* 
on line 2

I guess I just need to know what this variable name has been changed 
to.  I searched the PHP.NET manual for $HTTP_POST_VARS and got no results.

Thanks in advance & sorry for the dumb question..

Kris

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


Re: [PHP] Screen Resoultion

2003-08-15 Thread Kris Yates
Leif K-Brooks wrote:

[EMAIL PROTECTED] wrote:

i didnt understand a word of that , please rephrase ??

ASP doesn't do an upload meter by magic. PHP can do anything ASP can 
do, it simply doesn't have built-in features for anything unessential.

So true.. I use PHP a lot to dynamically generate DHTML and JScript, 
which of course are tied to ways to get data back to PHP from 
jscript/dhtml results. My latest project is dynamically generating "cool 
menus" using Thomas Brattli's Coolmenus library (jscript/dhtml) with PHP 
and database results.

A while back, out of sheer boredom, I wrote a PHP script which 
dynamically generates a PHP script using database results, saves it to a 
database, and then
"grabs" and executes the new script.  I havent used that for anything 
except playing around and burning time/killing boredom.  However, I also 
have a PHP program which you can run and edit the source code for the 
program inside the program itself, hit render and all of a sudden you 
are running the new version of the program.  It is so cool that it is 
just plain sick.  I use this methodology all the time - every day, 
everyone loves it, and my fridge has good food in it as a result.  My 
point is that nothing is impossible, it is all just a matter of how you 
perceive things and how you react to these perceptions.  Free your mind 
and the paychecks will follow, not to mention good code will just flow 
from your fingertips.  :)

Kris
http://2binteractive.com
http://doomstar.com/?target=me


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


Re: [PHP] Screen Resoultion

2003-08-15 Thread Kris Yates
Chris W. Parker wrote:

Kris Yates <mailto:[EMAIL PROTECTED]>
   on Friday, August 15, 2003 11:55 AM said:
 

However, I also have a PHP program which you can run and edit the
source code for the program inside the program itself, hit render and
all of a sudden you are running the new version of the program. It is
so cool that it is just plain sick.  I use this methodology all the
time - every day, everyone loves it, and my fridge has good food in
it as a result.
   

Hhmmm... tell us more.



c.

 

Basically it is just a lean and mean content editor I wrote that saves 
anything (html, php, yada yada-you-name-it) to a database.  I use it 
inside an "environment framework" system I created which controls 
logging in and using the editor. So you go to the 'site', log in, and 
then you can run the editor and whatever other apps you have been given 
user-level access to.  Your access level also determines what content 
you can access.  Low level access users can edit only their own 
content.  "Super elite" users can view/edit all content of all users, 
and as well can edit the HTML/PHP, etc. of the site itself.   As "super 
user elite", you can also select the content editor and edit the source 
code (PHP) of the content editor.  Really, you can edit any application 
that is inside the environment framework system.  ...hmmm.. Based on a 
setting defined for each peice of content in the database, when you 
click 'render', some PHP files may be written to a specified file system 
while other content 'chunks' stay in the database and never rendered out 
as files.  These chunk files can but do not contain PHP... this is used 
for just content or referencing actual content chunks.. so I created a 
very basic macro psuedo language using PHP.. I call it metaChunk but I 
imagine the name may already be taken, otherwise this email acts as my 
copyright to that name according to the Berne Copyright convention.  :)  
LOL ... An example of a content 'chunk' as seen in the editor (just an 
example that does not *really* exist - just typing junk from my head 
that would parse):

Hello !!$:varuser!!
You have logged in !!$:logins!! times
!!displayChunk:menu.js!!
!!displayChunk:userscreen!!
!!includefile:funk.php!!
The output is of course an HTML document that the end-user sees in ye 
olde browser.

This is all a couple of years old and since then I have found others 
that have developed similar things.. lots of CMS systems and macro 
languages.  someone said my metaChunk psuedo lang looks like 
"struts", which I have yet to see for myself or bother to read about.  
So Chunks can include and run PHP, display and render other chunks, and 
display variables.  One day I may expand it.  I'd like to release all 
this to open source but I just cant afford to do that yet, and a 
contract with my employer is another deterent.  I am guessing others out 
there are in the same boat.  I have been PHP'ing since late 98 but 
working on this stuff specifically since 2k.  In my 3 years of 
developing this stuff, I have made a point to not examine open source 
code so as to keep everything 'original'.  I am just an old school 
programmer/ex hacker from the 80's that refuses to rip others off as I 
have already been ripped off a time or two in the past both in the music 
biz and the technology biz, including *major* media companies to say the 
least

If you were to put  inside the database as a 
content 'chunk', it will just display the PHP to the web-browser instead 
of actually executing the code.  All in all this whole deal just makes 
my life easier since I dont need my users being able to exec any code.

Just FYI, this project started in late 2000 after my return from Los 
Angeles where I was recording at Paramount.  I bought a Commodore 64 SX 
at a yard sale for $5.00 US.  I got a copy of CNET 10.0 BBS out of a 
dusty old box and set it up for fun.  It became my reference point for 
the first few months to create a BBS like system for the web which was 
similar to the old days of BBS, unlike the majority of BBS type systems 
on the web today.  Just trying to be unique and different in my own 
old-school way.   I blab about all of this vaguely at my doomstar.com 
site, which implements these tools and my employer is also allowing me 
to reuse my codeBase in applications I develop for their clients.

Note to all:  please send private replies as any further discussion 
could quickly become 'off topic' for the php-general list.  I am 
interested in meeting other like minded people whom already know how to 
code and just want to throw ideas around for fun and inspiration.

Thanks for you interest in my work!  It is greatly appreciated.

Kris
http://doomstar.com/?target=me
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Bug in Ereg?

2003-08-15 Thread Kris Yates
Hi,

I have a form with checkboxes that POSTs to a PHP script.

What is posted [ from phpinfo() ]:

_POST["color-1"]  on
_POST["color-4"]  on
_POST["color-6"]  on
Parser:
   foreach($_POST as $ThisVar=>$ThisVal){
   if(ereg("color-", $ThisVar) AND $ThisVal=="on" OR $ThisVal==1){
   $newVarA=explode("-", $ThisVar);
   $colors.="$newVarA[1]:";
   }
   }
Expected Output:

$colors="1:4:6:";

Real Output:

$colors=":1:4:6:";

I can work with the output I am getting, however, I am curious why I am 
not getting the "expected output".  Can anyone shed light on this?  I am 
using PHP 4.3.2 compiled under a unix environment.  Is this a bug in 
ereg or am I just not seeing something obvious in my foreach?

Thanks,

Kris



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


Re: [PHP] Bug in Ereg?

2003-08-15 Thread Kris Yates
Just an addendum..   My parser has $colors=""; right before the foreach 
loop.

Kris Yates wrote:

Hi,

I have a form with checkboxes that POSTs to a PHP script.

What is posted [ from phpinfo() ]:

_POST["color-1"] on
_POST["color-4"] on
_POST["color-6"] on
Parser:
   foreach($_POST as $ThisVar=>$ThisVal){
   if(ereg("color-", $ThisVar) AND $ThisVal=="on" OR $ThisVal==1){
   $newVarA=explode("-", $ThisVar);
   $colors.="$newVarA[1]:";
   }
   }
Expected Output:

$colors="1:4:6:";

Real Output:

$colors=":1:4:6:";

I can work with the output I am getting, however, I am curious why I 
am not getting the "expected output".  Can anyone shed light on this?  
I am using PHP 4.3.2 compiled under a unix environment.  Is this a bug 
in ereg or am I just not seeing something obvious in my foreach?

Thanks,

Kris





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


[PHP] php & qmail

2003-08-25 Thread Kris Reid
Hi

I'm trying to build a program using PHP to increase the performance of Qmail.

I'm trying to use PHP to send an email qmail-remote which connects directly to the 
recipients mail server.
If this fails it will then add it to the queue normally so it can retry later.

Here is what I have so far (Note this runs on the command line)

function sendMail($host, $to, $from, $message) {

 $prog = "/var/qmail/bin/qmail-remote $host $from $to";
 echo "Program = $prog \r\n";

 $handle = popen ($prog, "w");
// fwrite($handle, $message) ;
 pclose($handle);
 }

The problem I have is I don't know how to write the message.
When you manually run qmail-remote $host $from $to
You then have to type the message then press control + D
Just like the standard mail function in UNIX

How can I type "Message control + D" into the program ?

Thanks

Kris



Re: [PHP] Re: php & qmail

2003-08-25 Thread Kris Reid
Manuel

Thanks for the advice however I want to use qmail-remote as I believe it
will suit my needs better.

I have been reading a great deal about tweaking qmail. I run a newsletter
and the fastest way is to try remote deliveries and only add them to the
queue if this fails.

The function that I wrote works I just don't know how to insert the message
content.

Thanks

Kris

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



[PHP] url string

2002-06-10 Thread Kris Vose

I am looking for a way to pass two variables in a url string to a php script.  I 
originally was using java script to acomplish this because once the user is redirected 
they can not press the back button to get back to the original page.  It looks like 
this:
?>
 window.location = "somefile.php?user=<?username?>&pass=<?userpass?>"
 window.location = 
'somefile.php?user=$username&pass=$userpass'";

Unfortunately both ways do not work.  In the first instance the script jumps to the 
window location but does not pass php variables into the url string.  In the second 
instances the java script does not even compile.

Is there a way to do this with php?...html?...javascript?

...I think that window.location does not except url string variables or something.  
Anyway if anyone can help it would be appreciated.  Thanks.


Kris

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




[PHP] download

2002-06-11 Thread Kris Vose

are there any php functions that handle downloads.  For Instance I want to create a 
link that contains a url string.  In this string a variable is defined as a file.  
This file will be downloaded when the user clicks on the link.  How do you handle this 
file in php?  Is there a function that will do this.  I have tried the copy function 
but it does not seems to work.

Kris

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




[PHP] download link

2002-06-11 Thread Kris Vose

are there any php functions that handle downloads?  For Instance I want to create a 
link that contains a url string.  In this string a variable is defined as a file.  
This file will be downloaded when the user clicks on the link.  How do you handle this 
file in php?  Is there a function that will do this.  I have tried the copy function 
but it does not seems to work.

Kris

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




[PHP] form post

2002-06-12 Thread Kris Vose

Is there a way to post input types that are "hidden"  with out using a html form in 
php?  I know you can do it in java script with Form.submit().  

So... if I have three hidden fields can I "post" them without pressing a button that 
uses a form by using a php function?

Thanks in advance.

Kris

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




[PHP] server problems

2002-06-18 Thread Kris Vose

I just uploaded a php driven web site that use text files to archive data to a unix 
server.  When I went to try and add another archive the script fails without a 
warning.  It does not store the data in the text file and it does not add another 
archive.  I wrote this application about 4 months ago when I was just learning php and 
I have found since then that mysql is the best way to store data! duh...  Anyway I was 
wondering if my permissions are screwed up on the unix server, or if there is 
something that I am overlooking here!  I do not really want to rewrite the code!  I 
spoke with the administrator of the server and he has no idea.  They are using PHP 
4.0.2B and we are using PHP 4.1.2  Anyway...thanks in advance.

Kris 

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




[PHP] abreviating echo commands

2003-09-15 Thread Kris Yates
Hello..

I forget where but I found some source awhile back that abbreviated 
echo.  It was something like
 which worked the same as .  Maybe it was 
.. Obviously I dont remember.. which is why I am asking..  
:)  Does anyone have a link to something that talks about how to 
abbreviate commands in PHP?

Well.. not how to.. but just a list of abbreviations?

Is echo the only one that has an abbreviation?  I couldn't find anything 
in the manual.. any leads?

Thanks,

Kris

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


[PHP] Language filter

2003-09-15 Thread Kris Reid
Hi All

I have a website with a standard html form on it. Every now and then some jerk submits 
the form with some dirty words.
This is then seen by my clients which as you can imagine is very unprofessional.

I want to build a language filter but can't think of good way of doing in it.
The best idea I found on the net was to have a DB of dirty words.
Then when someone submits the form check their entree against the DB.
This seems a little labour intensive and won't work if someone submits something like 
youraf*&!head.

Any ideas?

Thanks

Kris



Re: [PHP] Dates

2003-10-03 Thread Kris Yates
Also, an option is to have that SQL field set as date.  With postgres, I 
can insert 09-12-1967 and the sql server auto converts it to 1967-09-12 
upon saving into date field.  However, another way is..


Jay Blanchard wrote:

[snip]
Ok, Mayve I need to be a little clear, I under the link below as showing
dates. What I need to know how can I take the input of 09-12-1967 and 
have enter into a mysql data using php as 1967-09-12?  Because 
everything that is past from my form to mysql is not the way it was 
enter. Would I need to create three fields month, day, year, then take 
those three into -mm-dd? If so how?
[/snip]

Aha.

$theOldDate = 09-12-1967;
$theNewDate = substr($theOldDate, 6, 4)."-".substr($theOldDate, 0,
2)."-".substr($theOldDate, 3, 2);
echo $theNewDate;
 

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


Re: [PHP] User Authentication Continued....

2003-10-03 Thread Kris Yates
I guess you would either need to make the vars global or else keep 
redeclaring them.  Obviously, redeclaring them in each function 
$var=$_GET["whatever"] is technically the more secure method.

Kris

Jeff McKeon wrote:

Ok,

I've got the user authentication thing down and now I'm continuing to
build my trouble ticket tracking system.
So from a "customer profile" page there is a link to "Open Ticket" which
brings up a page to open a trouble ticket.  

[html code]
HREF=./open_ticket.php?custid=$custid&custname=$custname
[html code]
The user is validated for permissions and timeout based on the $_SESSION
variables established before the "open ticket"" page is loaded.
I then have a form that they fill in with the minimum info to create a
new ticket.  Some info is passed to the open ticket page from the
customer profile page via a GET method and enterred into hidden form
fields. 

[html code]
HREF=./open_ticket.php?custid=$custid&custname=$custname
[html code]
On the "open ticket" page I have 2 functions, the first is a form for
entering in the ticket info, the second is a function to take the
information and update the database with it when the form is submitted,
then reload the page with a display of the ticket info.
The problem I'm having is with the $_GET variables.  I guess I'm not
declaring them correctly.  Do I need to set them as soon as the page
loads, and outside of any functions like so..
[code start]
$custid = $_GET['custid'];
$custname = $_GET['custname'];
[code end]
Or do I need to declare them in each funtion?

[code start]
Function blah(){
global $custname, $custid;
$custid = $_GET['custid'];
$custname = $_GET['custname'];
DO SOME STUFF
}
Function foo(){
global $custname, $custid;
$custid = $_GET['custid'];
$custname = $_GET['custname'];
DO SOME STUFF
}
[code end]
Or am I way off and there is another way of doing it?

Also I've noticed that when I do an mysql_query("select name from foo
where name='$somevariable'") I cannot use $_GET['somevariable'] or
$_POST['somevariable'] in the sql string, I find I need to do a $name =
$_GET['somevariable'] first and then use $name.  Why is this?
Thanks,

Jeff

 

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


[PHP] converting GET to POST

2003-10-16 Thread Kris Yates
Currently, I am posting via GET to third party server as seen below:

   $item=urlencode($item);
   header("Location: https://www.fake.com/fake.php?item=$item";);
I want to reconfigure my header calls to POST instead of using GET for 
sending $item to third party server.  Is this doable?

Thank you,

Kris

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


[PHP] smtp relay problem

2002-04-16 Thread Kris Vose

I am having problems with my mail server. šWhen I use the mail function in php it 
resets the domain of the from: address when the script is executed.
 
For example: when the from: address is set to [EMAIL PROTECTED] it resets it to the mail 
servers domain [EMAIL PROTECTED] šI believe this is due to smtp relaying being 
blocked.š Is there anyway around this problem in php or is the only solution to 
unblock smtp relaying? šAlso...this may not be the problem at all.
 
All input is appreciated.š Thanks
 
Kris Vose



[PHP] deleting line in a text field

2002-04-22 Thread Kris Vose

How would you go about deleting a specific line in a textfield via PHP?š For example,š 
I want to delete line 2 only and save the changes. šHow would I go about doing this 
using fread and fwrite?
 
Kris



[PHP] deleting lines in a textfield

2002-04-22 Thread Kris Vose

How would you go about deleting a specific line in a textfield via PHP?  For example, 
I want to delete line 2 only and save the changes.  How would I go about doing this 
using fopen and fwrite?
š
Kris



RE: [PHP] Mailing to numerous with mail()

2002-04-24 Thread Kris Vose

Do this:
 
$to = "[EMAIL PROTECTED], [EMAIL PROTECTED], jonmundur@ mail.is";
 
 
-Original Message-
From: David Orn Johannsson [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, April 24, 2002 10:31 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Mailing to numerous with mail()
 
I'm trying to send an email useing mutible email addresses, could any one tell me why 
this isn't working, it works when I only use one address ($to = [EMAIL PROTECTED] 
 ) 
but not when I use the following code.


 
$to  = "[EMAIL PROTECTED]", " ;
$to .= "[EMAIL PROTECTED]" . ", " ;
$to .= "jonmundur@ mail.is";
 
$subject = "Subject";
$body = "Body";

mail($to, $subject, $body, "From: [EMAIL PROTECTED] ");
 
 
Davíð Örn Jóhannssson
Vefforritari

Atómstöðin hf.
Garðastræti 37
101 Reykjavík

sími: 595-3643
fax: 595-3649
[EMAIL PROTECTED]  
http://www.atom.is  


 



[PHP] function over loading?

2002-05-06 Thread Kris Vose

Can you practice function over-loading in php?
 
Kris



[PHP] function over loading?

2002-05-06 Thread Kris Vose

Can you practice function over-loading in php?
 
Kris



[PHP] diplaying the path

2002-05-31 Thread Kris Vose

Is there a variable/function in php that will display the url location of the 
hyper-link that brought them to the current page.  Thanks in advance.
 
Kris Vose 



[PHP] value of an array into a sendmail function

2002-03-05 Thread Kris Vose

I want to take the value of an array and define it as $message.  This variable will be 
called in the sendmail function mail().  Here is what I have so far. (does not work!)

$automail = file("DOCUMENT_ROOT/BetterBus/1/AutoEmail.txt");
$number_of_lines = count($automail);

for ( $i=0; $i<$number_of_lines; $i++)
{
$auto = explode("\n", $automail[$i]);
echo $auto[0]."\n";
}

$to = $EMAILADDRESS
$subject = "Thank You for your submission!";
$message = eval($automail);
$fromaddress = "[EMAIL PROTECTED]";

mail($to, $subject, $message, $fromaddress);

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




[PHP] value of an array into a sendmail function

2002-03-05 Thread Kris Vose

I want to take the value of an array and define it as $message.  This variable will be 
called in the sendmail function mail().  Here is what I have so far. (does not work!) 
Can anyone help me with this problem?
 
$automail = file("DOCUMENT_ROOT/BetterBus/1/AutoEmail.txt");
$number_of_lines = count($automail);
 
for ( $i=0; $i<$number_of_lines; $i++)
{
$auto = explode("\n", $automail[$i]);
echo $auto[0]."\n";
}
 
$to = $EMAILADDRESS
$subject = "Thank You for your submission!";
$message = eval($automail);
$fromaddress = "[EMAIL PROTECTED]";
 
mail($to, $subject, $message, $fromaddress);
 
 



[PHP] contents of fetch array into a string

2002-03-06 Thread Kris Vose

I have a problem with reading the contents of $r[1] into a string called = $mail.  
Does anyone have any suggestions?  Any help is greatly appreciated.
 
Kris Vose
 
 
if ($czero != "")
{
 
$t = mysql_query("SELECT * FROM AddExisting");
 
$number_of_customers = count($t);
 
while($r = mysql_fetch_array($t))
{
extract($r);
 
  for ($i = 0; $i<$number_of_customers; $i++)
  {
echo $r[1].", ";
  }
 
}
 
$mail = ' ';
foreach($r[1] as $mailline)
{
$mail.=$mailline;
}
 
}
 



[PHP] regular expression

2002-03-19 Thread Kris Vose

How would you write a regular expression that defines a phone number:  ex. 
(123)123-1234.
 
In other words how would you check to see if there were three numerics surrounded by 
(), then three numerics with a "-", then four numerics.
 
 
This is what I have so far as a regular expression.
 
^[(000-999)]+[000-999\-]+[-]+$
 
I am using this in an if statement like this:
 
If (!eregi("^[(000-999)]+[000-999\-]+[-]+$", $PHONENUMBER)
{
echo "This phone number is not valid";
}
 
 
Any help is appreciated.
 
Kris Vose



[PHP] for loop problem

2002-03-20 Thread Kris Vose

I have a problem with a piece of code that uses the mail function in a for loop.  It 
sends out mail to all the users in the database but it has a problem with attaching 
their specific name into the message.  What happens is the first user in the database 
will get their name in the e-mail (Dear John,).  Then the second user in the database 
will get the last users name and their name in the e-mail (Dear John, Dear Mike) 
...and so on and so forth.
 
How do I fix this problem?  Your help is appreciated.
 
Here is the code:
 
If ($button != "")
{
$t = mysql_query("SELECT * from AddExisting");
$number_of_customers = mysql_num_rows($t);

for($i=0; $i<$number_of_customers;$i++)
{
$r = mysql_fetch_array($t);
$email = $r["EMAIL_ADDRESS"];
$cusname = $r["Name"];

$to = $email;
$subject = "hello";
$message = "Dear $cusname,".$message;
$fromaddress = "[EMAIL PROTECTED]";

mail($to, $subject, $message, $fromaddress);
}//end of for
}//end of if



[PHP] register session

2002-04-03 Thread Kris Vose

I am trying to register a session after verification of username and password.
 
It looks like this:
 
session_start();
If ($name = $aa) && ($username = $ab)
{
session_register("valid_user");
echo "window.location=\'admin_.php'\";
}
else
{
echo "Your username/password is incorrect";
}
 
On each page that I want secure I include a script that checks for the 
session_register().  It looks like this:
 
session_start();
global $valid_user;
 
if (session_is_registered("valid_user"))
{
echo "you are registered";
}
else
{
echo "you are not registered";
}
 
This code is not working and it sends a warning message like this: Warning: Cannot 
send session cache limiter - headers already sent (output started at 
/var/www/focus-capital/BetterBus/1/admin_.php:7) in 
/var/www/focus-capital/BetterBus/1/admin_.php on line 126
you are registered 1 - Send Mail
 
I have not used sessions before and I am wondering if I am doing some wrong with the 
syntax?
 



[PHP] refresh

2002-04-05 Thread Kris Vose

I want to be able to refresh my browser window after a submission to a database.  Is 
there a reliable function out there that can accomplish this?
 
Kris



[PHP] setcookie BUG w/ IE 5.5, 6.0 & Netscape!

2001-11-27 Thread Kris Wilkinson

Just recently I've noticed an issue with setcookie. My scripts which normall
ran :

setcookie ("myCookie","Blah","time()+7201");

Are killing the cookie immediately after you close the browser window, or
access another https:// site. It appears as though the life of the cookie is
actually not being set, and is based entirely around the life of the browser
window which it was originally called.

if you leave the window open, and attempt at access the cookie from another
window, the cookie does not exist.

IDEAS? PHP GODS? :)



-- 
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] Figuring out tree depth.

2001-09-26 Thread Kris Williams

Hiyas,

I've made the following script to build a tree style navigation from a 
table of sections for an image gallery. There are root nodes of the tree 
which can have children, and those children can have their own children and 
so on to an infinte depth. A root node has a parentID of 0 and a child node 
has a parentID of the row id you want the child to belong to. (I've faked 
the arrays that would be returned from MySQL for this example).

The script is rendering items in the correct order, but I can't keep track 
of how deep in the tree each item is so I can indent them properly. A root 
node should have a 0 depth, it's child should have 1, and it's child again 
should be 2, then the next child of the root should go back to 1.  It seems 
to be working right until it gets to "rusted" (see eg).

I can figure that I'm adding items to the lastNode array but not removing 
them properly nor am I decrementing $x which is what should be keeping 
partial track of how deep I am. I figure this is where I'm going wrong but 
can't for the life of me figure it out. The calling of huntChild within 
itself is killing me.

The script at the moment is:

" . $depth . " - " . $key[1] . "";
$lastNode = array();
array_unshift($lastNode,$key[0]);
huntChildren($children,$key[0]);
   }

  function huntChildren($childArray,$rootID) {
   global $depth;
   global $lastNode;
   $x = 0;

  for ($i = 0; $i < sizeof($childArray); $i++) {
   // Suck out the first child node into a new array.
$tmpChild = array_shift($childArray);

   // Check to see if the parentID in $tmpChild matches the id of the node 
passed ($rootID) when the function is called.
   // A match means that the child has the node as a parent.
if ($rootID == $tmpChild[2]) {
 if ($lastNode[0] != $tmpChild[2]) {
  $x++;
  array_unshift($lastNode,$tmpChild[2]);
 }

 if ($x > 1) {
  $depth = sizeof($lastNode) - $x;
 } else {
  $depth = sizeof($lastNode);
 }

 echo $depth . " - " . $tmpChild[1] . "";

 // Go see if this child has children.
  huntChildren($childArray,$tmpChild[0]);
} else {
 // If there are no children to the node passed, put $tmpChild array 
back into the passed array of children for the next iteration.
  array_push($childArray,$tmpChild);
}
   }
  }
?>

and should generate:

0 - skatey
1 - parks
2 - regular visits
3 - concrete
4 - chipped
3 - metal
4 - rusted
2 - regular stacks
3 - blood spills
3 - guts everywhere
2 - regular zzz
1 - equipment

0 - me
1 - 0-10 years old
1 - 10-20 years old
2 - skeg phase

0 - friends


Aside from the depth problem the script functions just the way I want it 
to, but if anyone wants to point out or fix any major problems as well as 
my depth one, it'd be much appreciated.

Apologies for any shoddy indenting and the massive post. Trying to give as 
much info as I can.

Thanks,
Kris.


-- 
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: Independent Contractor Suggestions

2010-10-20 Thread Kris Craig
Hi musicdev,

There are a couple issues I think need to be addressed with what youd
described.  First and foremost, $20/hr is considerably below the going
rate for PHP work, especially for projects as large as the one you're
talking about.

I used to do freelance PHP work for about 5 years before I went to
work for Microsoft, and when I originally started I was just charging
about 20 bucks an hour as well.  It proved to be a disaster.  Contrary
to what common sense might tell you, I've found that lower-budget
clients always produce the most drama, are the most demanding, and
least reliable when it comes to paying the invoices on-time.
Furthermore, larger clients will generally ignore you in favor of
developers who charge more, the mindset being that, if you're charging
such a low amount, the quality of your work probably isn't that good.

I did a lot better after I started charging $100/hr for my work.  A
*lot* better!  This was after my research showed that PHP development
firms generally charge a minimum of $80/hr for PHP work, and can go as
high as $200/hr.  So if you're going at $20/hr, the companies with
deep pockets probably won't take you seriously, and the clients you do
get will be the ones who want a ton of work done but don't have the
budget available to make it worth your while.  Those are the clients
who will take advantage of you if you're not careful.


With your specific dilemma, if you already quoted $20/hr then of
course you should honor that.  However, I would strongly suggest that
you do *not* allow the client to
determine the cost of the deliverables after the work has already been
done.  Nine times out of ten you will get taken advantage of, because
the client knows you already did the work which means they have all
the leverage.  After all, ten cents on the dollar is better than zero,
right?  You don't want to put yourself in that situation.

Instead, here's what I would suggest:  Work with the client to
determine a bare minimum of work that would need to be done for the
"first phase."  Based off the $20/hr you quoted, determine how many
hours that will take and give them a quote.  Then, develop a statement
of work document (that both you and the client will have to sign) for
that phase, outlining specifically what work will be done and break it
up into deliverable pieces.  Upon completion of each "chunk" of work,
a percentage of the total quote will be due.  This ensures that you
get paid for your work and that the client receives the work s/he is
paying for.  It also breaks-up the payment schedule so that it's a bit
easier on the client's budget.  If the client runs out of money midway
through or whatever, you simply suspend work until they get more funds
and then resume where you left off.  I've found this model to be the
most successful on projects like this.


I hope this helps.  If you like, I'd be happy to email you a sample
copy of the SOW/contract I've used with past clients.

--Kris

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



Re: [PHP] Re: Independent Contractor Suggestions

2010-10-21 Thread Kris Craig
I've had a few emails from people making the same request, so what I'm
gonna do is stick them up someplace public like SourceForge or
whatever in the public domain for anyone who wants them.

Legal disclaimer:  Please note that, though these have been reviewed
by the legal departments of my past clients, I myself am not a lawyer
and can offer no warranty regarding these documents.  If you have any
questions/concerns about any part of either of the documents, I would
strongly advise you to consult an attorney who specializes in contract
law.  There is no lifeguard on duty.  Batteries not included.  So
there.


Now that that's out of the way, I'll get those up either tomorrow or
Monday then post a link here.  I hope this helps.  =)

--Kris


On Wed, Oct 20, 2010 at 6:47 PM, Jason Pruim  wrote:
>
> On Oct 20, 2010, at 8:47 PM, Kris Craig wrote:
>>
>>
>> I hope this helps.  If you like, I'd be happy to email you a sample
>> copy of the SOW/contract I've used with past clients.
>
> Hey Kris,
>
> If you don't mind I would love a copy my self! I have started doing some
> freelance work and I'm always looking for info that I can use :)
>
> Jason Pruim
>
>

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



Re: [PHP] Re: Independent Contractor Suggestions

2010-10-22 Thread Kris Craig
Alrighty, thanks for waiting.  I've posted the files here:

http://freelancetools.sourceforge.net/


Currently, there are two documents there:  A general contract and a
statement of work (SOW) contract.  Typically, the general contract
would be signed first, essentially laying out the overall terms of the
business relationship.  Then, the SOW is signed, which outlines the
specifics of the project (work to be done, budget, payment schedule,
etc).

You'll want to read each document carefully.  At the top, you'll want
to replace the generic information with yours and your client's.
After the first paragraph of each document, both parties are referred
to as "Client" and "Provider," so you won't have to change names in a
whole bunch of places.  The SOW provided contains budget/work for a
hypothetical sample project; you will want to replace this with the
details of the actual project you're working on.

I may add more stuff later, like SEO scripts and whatnot I've created
over the years, but for now this should at least help you with your
current situation.  Everything uploaded to the project URL above is in
the public domain, which means you are free to do with it as you
please.  And, as always, use it at your own risk.


Please feel free to let me know if you have any
questions/feedback/etc.  I hope this helps.  =)


--Kris


On Thu, Oct 21, 2010 at 1:52 PM, Kris Craig  wrote:
> I've had a few emails from people making the same request, so what I'm
> gonna do is stick them up someplace public like SourceForge or
> whatever in the public domain for anyone who wants them.
>
> Legal disclaimer:  Please note that, though these have been reviewed
> by the legal departments of my past clients, I myself am not a lawyer
> and can offer no warranty regarding these documents.  If you have any
> questions/concerns about any part of either of the documents, I would
> strongly advise you to consult an attorney who specializes in contract
> law.  There is no lifeguard on duty.  Batteries not included.  So
> there.
>
>
> Now that that's out of the way, I'll get those up either tomorrow or
> Monday then post a link here.  I hope this helps.  =)
>
> --Kris
>
>
> On Wed, Oct 20, 2010 at 6:47 PM, Jason Pruim  
> wrote:
>>
>> On Oct 20, 2010, at 8:47 PM, Kris Craig wrote:
>>>
>>>
>>> I hope this helps.  If you like, I'd be happy to email you a sample
>>> copy of the SOW/contract I've used with past clients.
>>
>> Hey Kris,
>>
>> If you don't mind I would love a copy my self! I have started doing some
>> freelance work and I'm always looking for info that I can use :)
>>
>> Jason Pruim
>>
>>
>

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



[PHP] String passed to object constructor turning into an instance of that object?

2010-12-16 Thread Kris Deugau
I'm in the process of migrating customer websites off an old legacy 
server that's pushing EOL, and starting to show hardware failures.


One site is throwing errors on what, so far as I can tell, should be 
perfectly working code.


The original code works fine on both CentOS 3 (PHP 4.3.2) and CentOS 4 
(4.3.9);  the "new" server is still a bit outdated (Debian etch plus 
some backports and updates from lenny;  PHP 5.2.0).


The site was designed by staff at a previous hosting company and uses a 
combination of the Fusebox app framework (which seems to work OK, after 
a few relatively minor fixes) and a custom OOP structure.


I'm not really sure what the actual problem is, but I've reached the 
point where this:



  class SelectBoxOption extends Tag {
function SelectBoxOption($name, $value, $selected=false) {
  parent::Tag("option", $name);
  $this->addAttribute("value", $value);
  if($selected) {
$this->addAttribute("selected", '', false);
  }
if ($name == "") { echo "   missing name!\n"; }
//  else { print "   name $name\n"; }
if ($value == "") { echo "   missing value!\n"; }
}


will parse and execute, but:
- the page will contain "missing value!" for each  in the 
 this is generating

- it will *not* contain "missing name!"
- the  tags in the final output don't have content or value 
(they should have both).


If I uncomment that else, I get:


adding option  with 
name 

 Catchable fatal error: Object of class SelectBoxOption could not be 
converted to string in 
/includes/classes/core/display/form/input/SelectBoxOption.php 
on line 12



I found the place this object is created, and added some debugging 
output before *and* after that call:



echo "adding option ".$row->$nameField." with ".
  $row->$valueField."\n";
$this->add(new SelectBoxOption($row->$nameField,
$row->$valueField, $selected));
echo "added option ".$row->$nameField." with ".
  $row->$valueField."\n";


which behaves correctly and spits out the name and value (retrieved from 
a database - thankfully I haven't had to track *that* down... yet).


Can anyone explain why a string passed by value (apparently) would 
suddenly mutate into a SelectBoxOption object?  I've confirmed that this 
is exactly what happens by adding this:



if (is_a($name,'SelectBoxOption')) {
  print "name isn't a SelectBoxOption, silly rabbit!\n";
}


as the very next set of lines after "function SelectBoxOption(".

I wondered while typing this if $name and $value might have ended up as 
special variables somewhere, but renaming them with an opt_ prefix 
didn't change anything.


-kgd

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



Re: [PHP] String passed to object constructor turning into an instance of that object?

2010-12-16 Thread Kris Deugau

Tommy Pham wrote:

   class SelectBoxOption extends Tag {
 function SelectBoxOption($name, $value, $selected=false) {
   parent::Tag("option", $name);
   $this->addAttribute("value", $value);
   if($selected) {
 $this->addAttribute("selected", '', false);
   }
if ($name == "") { echo "   missing name!\n"; }
//  else { print "   name $name\n"; }
if ($value == "") { echo "   missing value!\n"; }
 }


will parse and execute, but:
- the page will contain "missing value!" for each  in the
 this is generating
- it will *not* contain "missing name!"
- the  tags in the final output don't have content or value
(they should have both).

If I uncomment that else, I get:


adding option  with 
 name 

  Catchable fatal error: Object of class SelectBoxOption could not be
converted to string in
/includes/classes/core/display/form/input/SelectBoxOption.php
on line 12



What's the actual line #12 in the file SelectBoxOption.php?  The
SelectBoxOption code you presented has 11 lines unless it's a CNP error.


Whups, thought I noted that.  I trimmed a couple of blank lines;  line 
12 in the file is that print in the else.


I found trying to print $name triggers the same error anywhere in that 
function, too;  as I noted further down it seems the string that's 
passed in is getting mutated into an object.  (Whose missing toString 
function is what led me here - but it works fine in PHP 4.3...)


-kgd

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



Re: [PHP] String passed to object constructor turning into aninstance of that object?

2010-12-16 Thread Kris Deugau

Nathan Nobbe wrote:

Why not test for the type of $name at each point of interest in the
SelectBoxOption
constructor?  If you're passing a string value to the constructor it almost
has to be getting changed by the Tag constructor, right ?

  class SelectBoxOption extends Tag {
   function SelectBoxOption($name, $value, $selected=false) {

var_dump(is_string($name));

 parent::Tag("option", $name);

var_dump(is_string($name));


Ah, that gives...  well, it slightly alters the confusion.

Using var_dump(is_string($name)) gives...  two results?

bool(true)
bool(false)

And dumping $name itself gives:

string(8) "Abegweit"
 object(SelectBoxOption)#65 (5) { ["attributes"]=> array(1) { [0]=> 
object(TagAttribute)#66 (3) { ["name"]=> string(5) "value" ["value"]=> 
string(1) "4" ["hasValue"]=> bool(true) } } ["tagContent"]=> string(8) 
"Abegweit" ["tag"]=> string(6) "option" ["showEndTag"]=> bool(false) 
["children"]=> array(0) { } }


O_o

Just to confirm, I checked a test instance of the site on CentOS 4, with 
PHP 4.3, and I get one "bool(true)" for each  - not two as is 
happening with PHP 5.2.


-kgd

(I haven't worked with PHP for quite a while, and I never really spent a 
lot of time getting deep into complex data structures and object 
hierarchies like this when I was using it.  But this behaviour does NOT 
match what I know of passing values and object references around in any 
other language.)


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



Re: [PHP] String passed to object constructor turning into an instance of that object?

2010-12-16 Thread Kris Deugau

Nathan Nobbe wrote:

probly something screwy going on w/ the old style of naming constructors.  2
things,

1. can you post the Tag constructor as it reads now?


function Tag($tag='', $tagContent='') {
  $this->tagContent = $tagContent;
  $this->tag = $tag;
  $this->showEndTag = false;

  $this->attributes = array();
  $this->children = array();
}


2. try modifying Tag & SelectBoxOption to have __construct() instead of
Tag() & SelectBoxOption(), then call parent::__construct() from inside
of SelectBoxOption::__construct(); see if that clears up your problem under
5.2 (read: this will only be a partial solution as it only addresses one
child of Tag).


Mmm.  I hoped this would help, but all it seems to have done was cascade 
errors across the rest of Tag's object children.  :(  Copying the old 
constructor back in resolved that, but I'm not sure whether that 
reintroduces the root problem.


Other objects derived from Tag seem to work just fine;  I came into this 
chunk of the code trying to find out why a SelectBoxOption didn't seem 
to have a toString function - and then why trying to access what should 
be the value and name the same way as with other objects derived at some 
level from Tag blew up instead of working happily.


I'll try converting all of the constructors to your recommendation as 
above, but given that the problem is only happening with this one class, 
I'm not sure that will do much.


(A "don't-break-crusty-old-code" option for php.ini would be handy...)

The class hierarchy I've dug up so far looks like this (and appears to 
have been entirely defined by the original developer):


Object
  Fieldset
  RadioButtonGroup
  Tag
Column
FormObject
  FormInput
CheckBox
DateSelector
Editor
FileField
FormButton
HiddenField
PasswordField
RadioButton
SelectBox
  PopulatedSelectBox
RecursiveSelectBox
TextArea
TextField
  Form
Row
Table
SelectBoxOption

-kgd

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



Re: [PHP] String passed to object constructor turning into aninstance of that object?

2010-12-17 Thread Kris Deugau

David Harkness wrote:

I've never used the old-style constructors, but perhaps the semantics of
"parent::" changed and you need to instead use "$this->" as in

$this->Tag("option", $name);

That's a total guess. I don't have 5.2 handy to try it out, but both work in
5.3 using a simple example. Can you post the constructor of one of the Tag
subclasses that work? Maybe we can find a common denominator.


The most similar is Column, but all of them do very similar things - 
it's just the one class that seems to take a string and mutate it into 
what looks like an array with a string at [0] and something closely 
resembling what the whole object instance *should* be at [1].


class Table extends Tag {
function Table() {
parent::Tag('table');

$this->addAttribute('cellspacing', 0);
$this->addAttribute('cellpadding', 0);
$this->addAttribute('border', 0);

$this->columns = array();
$this->rows = array();
}

class Row extends Tag {
function Row($table='') {
parent::Tag('tr');

$this->table = '';
}

class Column extends Tag {
function Column($data) {
parent::Tag('td', $data);

$this->tagContent = $data;
}

class FormObject extends Tag {
function FormObject($name='') {
parent::Tag();

$this->addAttribute("name", $name);
$this->name = $name;
}


-kgd

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



Re: [PHP] String passed to object constructor turning into aninstance of that object?

2010-12-17 Thread Kris Deugau

Nathan Nobbe wrote:

 2. try modifying Tag & SelectBoxOption to have __construct() instead of

Tag() & SelectBoxOption(), then call parent::__construct() from inside
of SelectBoxOption::__construct(); see if that clears up your problem
under
5.2 (read: this will only be a partial solution as it only addresses one
child of Tag).


Mmm.  I hoped this would help, but all it seems to have done was cascade
errors across the rest of Tag's object children.  :(



to be expected, but did it fix the problem w/ SelectBoxOption?


I'm not sure, but I don't think so;  the original symptom was "Object of 
class SelectBoxOption could not be converted to string" - the original 
code didn't include a toString() method in SelectBoxOption, and since 
the code works on an older PHP, it must be using the parent object's 
toString().  (Which some children of Tag do explicitly, but 
SelectBoxOption doesn't for whatever reason.)


In trying to add the toString() method, I found that the calls used by 
other tags to retrieve the HTML tag name, value, etc weren't working. 
So I looked up at the constructor to see if the pieces passed in were 
getting passed and stored correctly - and quite obviously they're not 
($name mutates into what looks like an array with a string at [0] and 
something closely resembling what the whole object instance *should* be 
at [1], and $value just seems to disappear).


Putting aside actually fixing the constructor correctly, after a bit of 
poking I found that $this->tagContent->.  works to retrieve the data 
and actually output the  tag correctly.


var_dump tells me that the real data is actually in there...  it's 
"just" not instantiated correctly.  $name apparently arrives at the 
constructor for SelectOptionBox like this:


string(8) "Abegweit"
object(SelectBoxOption)#65 (5) {
  ["attributes"]=>
  array(1) {
[0]=>
object(TagAttribute)#66 (3) {
  ["name"]=>
  string(5) "value"
  ["value"]=>
  string(1) "4"
  ["hasValue"]=>
  bool(true)
}
  }
  ["tagContent"]=>
  string(8) "Abegweit"
  ["tag"]=>
  string(6) "option"
  ["showEndTag"]=>
  bool(false)
  ["children"]=>
  array(0) {
  }
}


I'll try converting all of the constructors to your recommendation as
above, but given that the problem is only happening with this one class, I'm
not sure that will do much.



hopefully that clears it up ..


Well, I ran out of "Call to undefined ParentClass::parentclass in 
path/to/file/for/subclass.php" errors (at least on the page I'm testing 
with)  but $name is still going in on the calling side as a string, 
and coming out as a funky array.



and hopefully you're using version control :D


Bah!  Real man never make mistaaake!

... ooops.  

(I've got the live site, on the old server, as reference, plus the 
regular backups of that machine.)


-kgd

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



[PHP] The Cat Signal

2012-07-19 Thread Kris Craig
Hey guys,

I just became aware of this:

http://internetdefenseleague.org/


It's a site setup by Mozilla, Reddit, and others to defend internet freedom
in the wake of recent legislative events in the U.S. and elsewhere (full
members list here:  http://www.internetdefenseleague.org/members).

They've setup what they're calling the "cat signal," an invisible bit of
embeddable code you can put in your website that will activate (and display
the afore-mentioned signal/link/etc) if/when the next SOPA/PIPA/etc comes
along that threatens the open internet.

I'd like to propose that we integrate this into the PHP website.  This
issue directly affects our community and we already staked a claim in this
fight when we participated in the last great blackout.

In addition, I'd also l ike to propose that we officially join this group
as a member.  I'm not sure if we'd do this by vote or something similar to
the RFC process & etc, but if you'll grant me permission, I'd be happy to
do the legwork on this myself (make the HTML edits, contact the
organization on PHP's behalf, etc).


Thoughts?

--Kris


[PHP] Re: [PHP-WEBMASTER] Re: [PHP] The Cat Signal

2012-07-19 Thread Kris Craig
On Thu, Jul 19, 2012 at 12:36 PM, Ferenc Kovacs  wrote:

>
> 2012.07.19. 20:21, "Daniel Brown"  ezt írta:
>
> >
> > Forwarding to php-webmas...@lists.php.net, as it's not a "general
> > user" issue where it pertains to php.net.
> >
> > On Thu, Jul 19, 2012 at 2:02 PM, Kris Craig 
> wrote:
> > > Hey guys,
> > >
> > > I just became aware of this:
> > >
> > > http://internetdefenseleague.org/
> > >
> > >
> > > It's a site setup by Mozilla, Reddit, and others to defend internet
> freedom
> > > in the wake of recent legislative events in the U.S. and elsewhere
> (full
> > > members list here:  http://www.internetdefenseleague.org/members).
> > >
> > > They've setup what they're calling the "cat signal," an invisible bit
> of
> > > embeddable code you can put in your website that will activate (and
> display
> > > the afore-mentioned signal/link/etc) if/when the next SOPA/PIPA/etc
> comes
> > > along that threatens the open internet.
> > >
> > > I'd like to propose that we integrate this into the PHP website.  This
> > > issue directly affects our community and we already staked a claim in
> this
> > > fight when we participated in the last great blackout.
> > >
> > > In addition, I'd also l ike to propose that we officially join this
> group
> > > as a member.  I'm not sure if we'd do this by vote or something
> similar to
> > > the RFC process & etc, but if you'll grant me permission, I'd be happy
> to
> > > do the legwork on this myself (make the HTML edits, contact the
> > > organization on PHP's behalf, etc).
> > >
> > >
> > > Thoughts?
> > >
> > > --Kris
> >
> >
> >
> > --
> > 
> > Network Infrastructure Manager
> > http://www.php.net/
> >
> > --
> > PHP Webmaster List Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
>  Btw. we were asked by the to join the league as we were a big traffic
> source on the black out day.
> I don't know if Rasmus is on the webmaster list or not, but we should cc
> him, as he was the driving force behind us joining the anti SOPA movement.
>
I heard back from the webmaster saying that we're already participating
with the cat signal on our website.  Given this and no objections, I went
ahead and contacted them and asked that they list us on their participating
members page.

--Kris


[PHP] Re: [PHP-WEBMASTER] Re: [PHP] The Cat Signal

2012-07-19 Thread Kris Craig
On Thu, Jul 19, 2012 at 1:52 PM, Ferenc Kovacs  wrote:

>
>> > Btw. we were asked by the to join the league as we were a big traffic
>> > source on the black out day.
>> > I don't know if Rasmus is on the webmaster list or not, but we should cc
>> > him, as he was the driving force behind us joining the anti SOPA
>> movement.
>>
>> He is everywhere.
>>
>> But I thought we were already 'members'?
>> See also http://php.markmail.org/message/7e4uqo73fmtlgjeo
>>
>> -Hannes
>>
>
> Thanks, that was the mail that I was referring to.
> I didn't see anybody reply on that thread, so except we replied in private
> (why would we do that?) I guess we never officially accepted that
> invitation.
>
> --
> Ferenc Kovács
> @Tyr43l - http://tyrael.hu
>

Can we "officially" accept it now?  It sounds like everyone is all for
this.  We're already technically a member anyway with the cat signal code
implemented, plus I've already reached out to them based on this thread and
the response I got from our webmaster.  Do we have any procedure or secret
handshake or whatever for this, or can we just say, "Yep we're down with
this" and be done with it?  =)

--Kris


[PHP] Re: [PHP-WEBMASTER] Re: [PHP] The Cat Signal

2012-07-19 Thread Kris Craig
On Thu, Jul 19, 2012 at 2:11 PM, Hannes Magnusson <
hannes.magnus...@gmail.com> wrote:

> On Thu, Jul 19, 2012 at 10:01 PM, Kris Craig  wrote:
> >
> >
> > On Thu, Jul 19, 2012 at 1:52 PM, Ferenc Kovacs  wrote:
> >>>
> >>>
> >>> > Btw. we were asked by the to join the league as we were a big traffic
> >>> > source on the black out day.
> >>> > I don't know if Rasmus is on the webmaster list or not, but we should
> >>> > cc
> >>> > him, as he was the driving force behind us joining the anti SOPA
> >>> > movement.
> >>>
> >>> He is everywhere.
> >>>
> >>> But I thought we were already 'members'?
> >>> See also http://php.markmail.org/message/7e4uqo73fmtlgjeo
> >>>
> >>> -Hannes
> >>
> >>
> >> Thanks, that was the mail that I was referring to.
> >> I didn't see anybody reply on that thread, so except we replied in
> private
> >> (why would we do that?) I guess we never officially accepted that
> >> invitation.
> >>
> >> --
> >> Ferenc Kovács
> >> @Tyr43l - http://tyrael.hu
> >
> >
> > Can we "officially" accept it now?  It sounds like everyone is all for
> this.
> > We're already technically a member anyway with the cat signal code
> > implemented, plus I've already reached out to them based on this thread
> and
> > the response I got from our webmaster.  Do we have any procedure or
> secret
> > handshake or whatever for this, or can we just say, "Yep we're down with
> > this" and be done with it?  =)
>
> You need to write an RFC, run one round around a church, submit a call
> for open discussion for the request for comment, run backwards around
> a church, spit on the grave of your first born, then vote.
>
> Or in other words; What exactly are you looking to do here?
> If we are already pencilled down as members, great!
> Is there anything else left then?
>
> -Hannes
>

I don't think so, no.  I just wanted to double-check and make sure I'm
being kosher in asking them to list us and our logo on their top members
page.  =)

--Kris

P.S. I don't have any dead kids yet, so can I substitute someone else's
dead kid to spit on?


[PHP] FilesystemIterator issue with smb/cifs mounts

2012-12-28 Thread Kris Spencer
I am writing a simple file system iterator which seems to work fine on
local filesystems but methods such as FilesystemIterator::isDir and
isFile fail to properly evaluate if the directory are smb/cifs mounted.
 Does anyone know a workaround or alternative?

Thanks

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



[PHP] Re: FilesystemIterator issue with smb/cifs mounts

2012-12-28 Thread Kris Spencer
On 12/28/2012 9:32 AM, Kris Spencer wrote:
> I am writing a simple file system iterator which seems to work fine on
> local filesystems but methods such as FilesystemIterator::isDir and
> isFile fail to properly evaluate if the directory are smb/cifs mounted.
>  Does anyone know a workaround or alternative?
>
> Thanks
Just an update to my own post since I did not get any response.  After
more digging, I found a solution and thought I should share it in case
anyone else has a similar issue.

The solution was to add the noserverino option to my mount command.  Now
FilesystemIterator::isDir, isFile (and probably other similar PHP
functions) correctly report the expected response.

example:
# mount -t smbfs "//192.168.1.2/my/folder" /mount -o noserverino,user=me

references:
original point to solution:
http://web.archiveorange.com/archive/v/WEFLnZlDdIdO5Jl7wies
view comment 1 for detailed explanation of cause:
https://bugzilla.samba.org/show_bug.cgi?id=7707

see also "not a php bug":
https://bugs.php.net/bug.php?id=51404
https://bugs.php.net/bug.php?id=51266

Hope this helps someone out there in the future.

Regards

Kris

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



[PHP] Re: [PHP-DB] Re: foreach

2012-04-05 Thread Kris Carlson
Send the code around line 198, say 170 to 210.

On Apr 5, 2012, at 8:42 PM, Al wrote:

> 
> 
> On 4/5/2012 4:15 PM, Ethan Rosenberg wrote:
>> Dear Lists -
>> 
>> I know I am missing something fundamental - but I have no idea where to 
>> start to
>> look.
>> 
>> Here are code snippets:
>> 
>> I have truncated the allowed_fields to make it easier to debug.
>> 
>> $allowed_fields = array( 'Site' =>'POST[Site]', 'MedRec' => '$_POST[MedRec]',
>> 'Fname' => '$_POST[Fname]' );
>> echo "post #1\n";
>> print_r($_POST);
>> 
>> RESPONSE:
>> 
>> post #1
>> Array
>> (
>> [Site] => AA
>> [MedRec] => 10002
>> [Fname] =>
>> [Lname] =>
>> [Phone] =>
>> [Height] =>
>> [welcome_already_seen] => already_seen
>> [next_step] => step10
>> )
>> 
>> 
>> 
>> // $allowed_fields = array("Site", "MedRec", "Fname", "Lname", // previous
>> statement of $allowed_fields
>> // "Phone", "Sex", "Height");
>> 
>> 
>> 
>> Key Site, Value POST[Site]
>> Key MedRec, Value $_POST[MedRec]
>> Key Fname, Value $_POST[Fname]
>> 
>> 
>> 
>> foreach ($allowed_fields as $key => $val) {
>> print "Key $key, Value $val\n";
>> }
>> 
>> 
>> if(isset($_Request['Sex'])&& trim($_POST['Sex']) != '' )
>> {
>> if ($_REQUEST['Sex'] === "0")
>> {
>> $sex = 'Male';
>> }
>> else
>> {
>> $sex = 'Female';
>> }
>> }
>> }
>> echo "Post#2";
>> print_r($_POST);
>> if(empty($allowed_fields))
>> //RESPONSE
>> 
>> Post#2Array
>> (
>> [Site] => AA
>> [MedRec] => 10002
>> [Fname] =>
>> [Lname] =>
>> [Phone] =>
>> [Height] =>
>> [welcome_already_seen] => already_seen
>> [next_step] => step10
>> )
>> 
>> 
>> 
>> {
>> echo "ouch";
>> }
>> 
>> foreach ( $allowed_fields as $key => $val ) //This is line 198
>> {
>> if ( ! empty( $_POST['val'] ) )
>> {
>> print "Key $key, Value $val\n";
>> $cxn = mysqli_connect($host,$user,$password,$db);
>> $value = mysql_real_escape_string( $_POST[$fld] );
>> $query .= " AND $fld = '$_POST[value]' ";
>> echo "#1 $query"; //never echos the query
>> }
>> }
>> 
>> These are the messages I receive on execution of the script:
>> 
>> Notice: Undefined variable: allowed_fields in /var/www/srchrhsptl5.php on 
>> line 198
>> Warning: Invalid argument supplied for foreach() in /var/www/srchrhsptl5.php 
>> on
>> line 198
>> 
>> Advice and help, please.
>> 
>> Thank you.
>> 
>> Ethan Rosenberg
>> 
> 
> Break down you code into workable segments and test each one individually. If 
> you have a problem with a small segment, ask for help about it specifically.
> 
> Folks don't have time to digest and critique your whole code.
> 
> 
> -- 
> PHP Database 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] 301 redirect returning 302 instead

2006-11-01 Thread Kris Leech

I think Stut is right, you only need the one header!

Stut wrote:

[EMAIL PROTECTED] wrote:

Having a problem here trying to redirect some old pages.

I've recently noticed using a server header check that my 301 
redirects in

PHP are returning 302 instead.

I'm using the following code:

header('HTTP/1.1 301 Moved Permanently');
header('Location: newurl');
exit();

Any reason why we're getting a 302 instead of a 301? This is keeping the
pages in Google instead of removing them and using the new location.
  


Just a shot in the dark, but it's possible that providing a "Location" 
header resets the status response. Try swapping your two header calls.


-Stut



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



[PHP] Join table with clashing fieldnames

2006-11-08 Thread Kris Leech
I have an SQL query which has a simple join, this works and is fine the 
fields from the secondary table are added to the returned array. But 
what happens if I add another JOIN to a table which has fields which are 
the same name? Is there any way to have PHP prefix the key's 
(fieldnames) of the joined fields?


Many thanks, Kris.

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



[PHP] PHP SQL Builder with JOIN support

2006-12-06 Thread Kris Leech
Does anyone know of a PHP class/function(s) which will generate SQL with 
support for JOIN's to other tables.


I have used SQL Query Builder by David Regla Demaree, which is great for 
simple SQL but lacks support for JOIN's.


Many thanks in advance, Kris.

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



Re: [PHP] Beginner Question

2004-04-09 Thread Kris J. Hagel
On Thu, 2004-04-08 at 22:30, rob wrote:
> I am a newcomer to PHP and I am looking for an intsallation package similar
> to to FoxPro for MAC OSX 10.2.(Ie intsall appache, MY SQL and Latest version
> of PHP) Does anyone know where I may find one?
> Thanks RB

Try http://www.serverlogistics.com

They have packaged installers for Apache, MySQL and PHP with Preference
Panes you can drop in to control the Apache and MySQL processes if you
want them.

Kris

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