Re: [PHP] Re: Binary Files :: They Keep Adding Blocks

2002-07-18 Thread Jason Wong

On Thursday 18 July 2002 13:14, vins wrote:
 How do i debug.
 Thats why i asked

echo/print out key variables at strategic points in the code. Ensure that they 
contain what you expect them to contain.

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
Q:  Heard about the ethnic who couldn't spell?
A:  He spent the night in a warehouse.
*/


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




Re: [PHP] how to access javascipt variables in PHP

2002-07-18 Thread Police Trainee

one method that i have found works for me (albeit not
so pretty, neat, or concise) is to pass js variables
through a url request. Ok follow me for a little if
you will (it's bulky, but it works!)

1) user loads a page (e.g.
your-domain.com/index.phtml)
that page contains the javascript which determines the
user's browser width and height. 
2) the page automatically refreshes immediately to
another page along with the variables (e.g.
/index2.phtml?h=xyzw=abc).
3) on the new page, php can use the variables passed
via the URL as if it were posted with the GET method
from a form.

ok, i admit it's messy, not ideal, and lame, but it
works.

Since I don't know a fraction of what the php gurus
here know, the programming on my site may be messy,
bulky, and more complicated than it needs to be- but
at least it gets the job done : )

hope it helps




I can't think of a way to do it in the page itself...
Unfortunately 
(there
could be a way, I just can't think of it - frazzled
after a day of 
work),
but if you're using forms on your page, then set the
values of some 
hidden
form elements to the JS variables you want to use, and
pass them along. 
You
could have the page refresh itself to give you the
variables, too.
I'm sure there's a better way, though.
Good luck,
-- 
Chris Garaffa
#!/usr/local/lib/php
$contact_info[Name]   = Chris Garaffa;
$contact_info[Email]  = [EMAIL PROTECTED];
$contact_info[Work]   = [EMAIL PROTECTED];
$contact_info[cell]   = 203.803.9066;


Seppo Laukkanen (from [EMAIL PROTECTED])
wrote on 7/17/02 
3:06
PM:

 Can anybody help?
  I have javascript code to find out browsers width
and height, but 
they
 are stored in javascript variables. How can I access
them from PHP? 
Or
 is there a method to do same in PHP straightly?
  Thanks,
 Seppo
  -- 



__
Do You Yahoo!?
Yahoo! Autos - Get free new car price quotes
http://autos.yahoo.com

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




[PHP] PHP HASP

2002-07-18 Thread Christine Philip

I am planning to setup a web server of using RedHat Linux. The purpose
of the web server is to provide product information for only registered
customers.
I plan to send the HASP parallel port keylock to the registered
customers.
Can I use PHP to monitor the status HASP parallel port keylock in the
client side?
Is there any idea for ensuring the website piracy?
Thanks!

Christine


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




[PHP] Re: imap_mail_move and imap_mail_copy

2002-07-18 Thread val petruchek

 Has anyone had experience with imap_mail_move or imap_mail_copy?

 Can they copy or move a message from one mail server to another or only
 into a subfolder on the same server?

Same server - it has parameter $imapcon which can be assumed as
connection to one server only.

Imap functions is just interface for IMAP protocol.

--
Sincerely, val petruchek



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




Re: [PHP] why my php can not get values from Form?

2002-07-18 Thread Thomas Edison Jr.

Simple.. just edit your php.ini file in your windows
directory. Search for register_globals .. it will
have Off in front of it.. switch it to On

T. Edison jr.


--- ram friend [EMAIL PROTECTED] wrote:
 hello,
 I have just installed apache+php4, but my php can
 not get values from form?
 what's wrong?
 following is the code in php named file
 welcome.php
 ?php
 echo( Welcome to our Web site, $usernm $passwd! );
 ?
 
 I called it with
 http://localhost/welcome?username=passwd=bbb
 i get nothing, what's wrong?
 
 
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


=
Rahul S. Johari (Director)
**
Abraxas Technologies Inc.
Homepage : http://www.abraxastech.com
Email : [EMAIL PROTECTED]
Tel : 91-4546512/4522124
***

__
Do You Yahoo!?
Yahoo! Autos - Get free new car price quotes
http://autos.yahoo.com

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




Re: [PHP] Re: Binary Files :: They Keep Adding Blocks

2002-07-18 Thread Vincent Kruger

yeah but your check i get this funny little square in note pad.
it's a line carier... but if i take it out then everything is one line which
i don't want.
and if i take it out and then put it in again i'm back to sqaure one.

- Original Message -
From: Jason Wong [EMAIL PROTECTED]
Newsgroups: php.general
To: [EMAIL PROTECTED]
Sent: Thursday, July 18, 2002 8:56 AM
Subject: Re: [PHP] Re: Binary Files :: They Keep Adding Blocks


On Thursday 18 July 2002 13:14, vins wrote:
 How do i debug.
 Thats why i asked

echo/print out key variables at strategic points in the code. Ensure that
they
contain what you expect them to contain.

--
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
Q: Heard about the ethnic who couldn't spell?
A: He spent the night in a warehouse.
*/



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




[PHP] Upload File Problem

2002-07-18 Thread Mark Colvin

I have a simple script that attempts to upload a file and save it on the
server. When I click send file I get this error message 'Warning: Unable to
open '' for reading: No such file or directory in /var/www/html/upload.php
on line 5
Couldn't copy the file!'. The file is being uploaded from a Win 2000 machine
and the php script live on an apache web server on a linux box. I have chmod
777 the 'image' directory. Any ideas?
Here's the code -

-- upload.html --
html
head
titleUpload a File/title
/head

body

h1Upload a File/h1

form enctype=multipart/form-data method=post action=upload.php

pstrongFile to Upload:/strongbr
input type=file name=img1 size=30/p

Pinput type=submit name=submit value=Upload File/p

/form
/body

/html

-- upload.php --
?php

if ('img1' != ) {

copy($img1_tmp_name, images/.$img1_name)
or die(Couldn't copy the file!);

} else {

die(No input file specified);
}

?




This e-mail is intended for the recipient only and
may contain confidential information. If you are
not the intended recipient then you should reply
to the sender and take no further ation based
upon the content of the message.
Internet e-mails are not necessarily secure and
CCM Limited does not accept any responsibility
for changes made to this message. 
Although checks have been made to ensure this
message and any attchments are free from viruses
the recipient should ensure that this is the case.


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




Re: [PHP] Re: Binary Files :: They Keep Adding Blocks

2002-07-18 Thread Danny Shepherd

Try using just '\n' not '\r\n' as notepad doesn't understand carriage
returns, hence the funny little square.

- Original Message -
From: Vincent Kruger [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, July 18, 2002 9:11 AM
Subject: Re: [PHP] Re: Binary Files :: They Keep Adding Blocks


 yeah but your check i get this funny little square in note pad.
 it's a line carier... but if i take it out then everything is one line
which
 i don't want.
 and if i take it out and then put it in again i'm back to sqaure one.




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




Re: [PHP] ErrorDocument 404 Form

2002-07-18 Thread Fabien Penso


Michael a écrit : 

  Well it could have been it, but it doesn't work neither trying to set
  the ErrorDocument into a .htaccess file.
  
  The problem is I am not even sure where is the trouble, and if it should
  work or not (I guess it should), so I don't know exactly where to ask,
  the dev list maybe ?

  I seem to remember from when I was toying around with this that
  $_SERVER[REQUEST_URI] was still available.  Even if $_GET isn't
  populated you could manually parse the REQUEST_URI.  Of course I may
  be misremembering...  If it's not available on your install let me
  know and I'll setup a test case on my server...

Well it still is in GET method because the url does still exist with the
?plop=foobar but in case I want to use POST method (which I will as my
form has huge textarea) everything disappear.
Also this is a turn around I don't like, I would first understand why it
doesn't work, and if I can fix it.

-- 
Fabien Penso [EMAIL PROTECTED] | LinuxFr a toujours besoin de :
http://perso.LinuxFr.org/penso/  | http://linuxFr.org/dons/

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




[PHP] Sessions: watertight?

2002-07-18 Thread PHPCoder

Hi
I'm doing some reading on sessions and how it works etc, and have a 
concern (which is probably fed by my ignorance on the topic).
The couple of simple session examples I have found in the PHP/MySQL 
book by Luke Welling  Laura Thompson gives a simple 3 page session 
example where the session is started on the first page, a variable is 
registered as a session var and then has a link to the next page where 
the session_start() is called and the session_var is echoed to 
illustrate the workings of a session.
My understanding is that PHP will either use cookies to store the 
session ID on the client's pc, or send it via URL, so, assuming that 
cookies is a no-go, can I now assume that PHP will attach it's session 
ID to each and every URL located on my .php page?
The reason I'm asking is as follow:
I did the little excersise, and then deliberately rejected my browsers 
call to process the cookie, and then the script didn't return the 
variable as it did previously...
And now, assuming that I can assume that PHP will attach the SID to all 
URL's , how does it know to which URL's to attach, or am I supposed to 
manually attach them, leaving me with another question, If I have to 
manually code the SID into the URL, then the whole session coockies if 
possible approach doesn't seem to work???

Can someone explain it in more detail for me plz?
Thanks



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




RE: [PHP] Upload File Problem

2002-07-18 Thread joakim . andersson

 From: Mark Colvin [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, July 18, 2002 10:09 AM

   -- upload.php --
 ?php
 
 if ('img1' != ) {
This will allways be true! 'img1' is a string and will never be empty.
You probably mean if($img1 != )
However, I'm not sure this will work in this case.

Try this instead. (Taken straight from the PHP-manual. A real good
resource!)

?php
if (is_uploaded_file($_FILES['img1']['tmp_name']))
{
$filename = $_FILES['img1']['tmp_name'];
print $filename was uploaded successfuly;
$realname = $_FILES['img1']['name'];
print realname is $realname;
print copying file to uploads dir;
copy($_FILES['img1']['tmp_name'], /place/to/put/ . $realname);
}
else
{
echo Possible file upload attack: filename .
$_FILES['img1']['name'] . .;
}
?

If you use PHP  4.1.0 you must exchange $_FILES to $HTTP_POST_FILES

Regards
Joakim Andersson

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




[PHP] draw statistics

2002-07-18 Thread Jose Morales

Hi!

Im looking for some class that alow me to draw an histogram, or a piechar, for display 
statistics. 

thx!

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




RE: [PHP] draw statistics

2002-07-18 Thread joakim . andersson

 From: Jose Morales [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, July 18, 2002 11:34 AM
 
 Hi!
 
 Im looking for some class that alow me to draw an histogram, 
 or a piechar, for display statistics. 
 
 thx!

http://www.hotscripts.com/PHP/Scripts_and_Programs/Graphs_and_Charts/

Regards
Joakim Andersson

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




Re: [PHP] draw statistics

2002-07-18 Thread Jason Wong

On Thursday 18 July 2002 17:33, Jose Morales wrote:
 Hi!

 Im looking for some class that alow me to draw an histogram, or a piechar,
 for display statistics.

www.phpclasses.org

also jpgraph

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
You're not an alcoholic unless you go to the meetings.
*/


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




RE: [PHP] Sessions: watertight?

2002-07-18 Thread joakim . andersson

Taken straigh from the manual:
(http://www.php.net/manual/en/ref.session.php)

[quote]
There are two methods to propagate a session id: 

- Cookies 

- URL parameter 

The session module supports both methods. Cookies are optimal, but since
they are not reliable (clients are not bound to accept them), we cannot rely
on them. The second method embeds the session id directly into URLs. 

PHP is capable of doing this transparently when compiled with
--enable-trans-sid. If you enable this option, relative URIs will be changed
to contain the session id automatically. Alternatively, you can use the
constant SID which is defined, if the client did not send the appropriate
cookie. SID is either of the form session_name=session_id or is an empty
string. 
[/quote]

Regards
Joakim Andersson


 -Original Message-
 From: PHPCoder [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, July 18, 2002 11:17 AM
 To: php-general
 Subject: [PHP] Sessions: watertight?
 
 
 Hi
 I'm doing some reading on sessions and how it works etc, and have a 
 concern (which is probably fed by my ignorance on the topic).
 The couple of simple session examples I have found in the PHP/MySQL 
 book by Luke Welling  Laura Thompson gives a simple 3 page session 
 example where the session is started on the first page, a variable is 
 registered as a session var and then has a link to the next 
 page where 
 the session_start() is called and the session_var is echoed to 
 illustrate the workings of a session.
 My understanding is that PHP will either use cookies to store the 
 session ID on the client's pc, or send it via URL, so, assuming that 
 cookies is a no-go, can I now assume that PHP will attach 
 it's session 
 ID to each and every URL located on my .php page?
 The reason I'm asking is as follow:
 I did the little excersise, and then deliberately rejected my 
 browsers 
 call to process the cookie, and then the script didn't return the 
 variable as it did previously...
 And now, assuming that I can assume that PHP will attach the 
 SID to all 
 URL's , how does it know to which URL's to attach, or am I 
 supposed to 
 manually attach them, leaving me with another question, If I have to 
 manually code the SID into the URL, then the whole session 
 coockies if 
 possible approach doesn't seem to work???
 
 Can someone explain it in more detail for me plz?
 Thanks
 
 
 
 -- 
 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] PHP HASP

2002-07-18 Thread joakim . andersson

[Snip]
 Can I use PHP to monitor the status HASP parallel port keylock in the
 client side?
[/Snip]

No you can't. PHP is server-side and has no access to client machines. You
could _maybe_ do it with JavaScript and then pass on the info to PHP with a
redirect or something like that.

Regards
Joakim Andersson

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




php-general Digest 18 Jul 2002 09:48:10 -0000 Issue 1471

2002-07-18 Thread php-general-digest-help


php-general Digest 18 Jul 2002 09:48:10 - Issue 1471

Topics (messages 108172 through 108232):

Re: Classes Constructor syntax
108172 by: Rad0s-³aw Gajewski

Running a PHP Script from UNIX Command Line?
108173 by: Zach Curtis
108174 by: B i g D o g
108195 by: Michael Sims

Re: win32 mail()
108175 by: Manuel Lemos

Re: Classes vs. Functions
108176 by: Christopher J. Crane

Re: how many requests can php serve?
108177 by: Miguel Cruz

Binary Files :: They Keep Adding Blocks
108178 by: vins
108198 by: Jason Wong
108205 by: vins
108216 by: Jason Wong
108221 by: vins
108224 by: Danny Shepherd

ldap_add() - null values in fields produce an value #0 invalid per syntax error on 
ldap server
108179 by: Ian_Ball

Re: ErrorDocument 404  Form
108180 by: Fabien Penso
108185 by: David Robley
108190 by: Fabien Penso
108193 by: Michael Sims
108225 by: Fabien Penso

Installing 4.0.6 to 4.1.1 patch
108181 by: John Wulff
108182 by: Miguel Cruz

Re: Of Jobs and Certs
108183 by: Michael Hall

Re: Someone Help please
108184 by: David Robley

missing function? array_change_key_case()
108186 by: Jimmy  Brake
108187 by: John Holmes
108188 by: Jimmy  Brake

Re: how to access javascipt variables in PHP
108189 by: Chris Garaffa
108217 by: Police Trainee

Unexpected module init/shutdown behaviour
108191 by: Jong-won Choi

Format 24 hr time to 12 hr time
108192 by: Ryan
108199 by: Jason Wong

Re: Includes vs. Functions
108194 by: Michael Sims
108196 by: Martin Towell

Creating Dynamic Variables
108197 by: Anup
108200 by: Martin Towell
108201 by: Pushkar Pradhan
108202 by: Michael Sims

Re: Regular expression for correcting proper nouns
108203 by: CC Zona

Re: preg_replace_callback
108204 by: CC Zona

Re: Require some help about the date comparison
108206 by: Manisha

Importing CSV File : 10 Rows!
108207 by: Thomas Edison Jr.
108208 by: Jason Reid
108209 by: Thomas Edison Jr.
108211 by: Analysis  Solutions

Re: querying for one specific row number
108210 by: Justin French

why my php can not get values from Form?
108212 by: ram friend
108213 by: Jadiel Flores
108214 by: Balaji Ankem
108220 by: Thomas Edison Jr.

Re: Sessions / logins / cookies / security
108215 by: Peter James

PHP  HASP
108218 by: Christine  Philip
108232 by: joakim.andersson.cybercom.se

Re: imap_mail_move and imap_mail_copy
108219 by: val petruchek

Re: Good instruction for installing webserver using RPM and tar.gz files???
108222 by: Alberto Serra

Upload File Problem
108223 by: Mark Colvin
108227 by: joakim.andersson.cybercom.se

Sessions: watertight?
108226 by: PHPCoder
108231 by: joakim.andersson.cybercom.se

draw statistics
108228 by: Jose Morales
108229 by: joakim.andersson.cybercom.se
108230 by: Jason Wong

Administrivia:

To subscribe to the digest, e-mail:
[EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]

To post to the list, e-mail:
[EMAIL PROTECTED]


--

---BeginMessage---

++PHP does not support multiple constructors.
but you can easily evade this obstacle:
class A {
function A($parm1,$parm2=false) {
if (!$parm2) {
$this-OneArgConstructor($parm1);
} else {
$this-TwoArgConstructor($parm2);
}
}
function OneArgContructior($parm) {
//...
}
function TwoArgConstructior($parm1,$parm2) {
//...
}
}

Rados
++
++Michael
++
++On Wed, 17 Jul 2002, David Russell wrote:
++
++ Hi all,
++
++ I am finally spending some time converting a million and one functions
++ into a class - this is for a software issue tracking system.
++
++ I have:
++
++ class issue {
++var
++var
++...
++
++function issue() { //default constructor
++  //initialise all variables to defaults, and start getting the stuff
++ from forms
++}
++
++function issue($number) { //1 variable constructor
++  // Query database and populate variables accordingly
++}
++ }
++
++ My question is: will this work? does PHP OOP support more than one
++ constructor? If my syntax is wrong, please let me know the correct syntax.
++
++ Thanks
++
++ David R
++
++
++
++
++

-- 
--
 pozdr
Rad0s

Radek Gajewski [EMAIL PROTECTED] GG:694459 ICQ:110153822

Re: [PHP] Sessions: watertight?

2002-07-18 Thread Jason Wong

On Thursday 18 July 2002 17:39, [EMAIL PROTECTED] wrote:

Joakim, please don't take offence, I know you're being helpful but ...

 Taken straigh from the manual:
 (http://www.php.net/manual/en/ref.session.php)

 [quote]
 There are two methods to propagate a session id:

[snip]

... do we really need quotes from the manual? You've already given the pointer 
which is sufficient in itself for any interested parties to look up the 
relevant information.

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
Only people with names beginning with 'A' are getting mail this week (a la 
Microsoft)
*/


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




RE: [PHP] Sessions: watertight?

2002-07-18 Thread joakim . andersson

 From: Jason Wong [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, July 18, 2002 11:46 AM
 
 Joakim, please don't take offence, I know you're being helpful but ...

None taken.

 ... do we really need quotes from the manual? You've already 
 given the pointer 
 which is sufficient in itself for any interested parties to 
 look up the 
 relevant information.

You're right about this. Wont happen again... :-)

/Joakim

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




Re: [PHP] Sessions: watertight?

2002-07-18 Thread PHPCoder

Thanks
OK, I have checked my phpinfo(); and the  *session.use_trans_sid* = 1 ; 
*session.use_cookies =* On, so I'm not sure if I need to turn the 
cookies bit off, but I would think it not to be necessary. ; So, I can't 
see why the URL's aren't changed on my pages...
Now, something to contemplate so long; say I DO get the URL bit right, 
what method does PHP use to determine which URL's to append? Would this 
method have a considerable overhead on performance? ( given that there 
could be alot of session usage on my domains). I'm rather interested in 
the workings of this URL detection, as it basically means that PHP 
runs forward through all my pages to see where the session stops and and 
it's difficult for me to see how PHP can tell which pages have to do 
with which sessions. Arguably one can have two session threads that 
has some overlapping files, and my mind boggles as to how php can track 
the session vars, secially if the one session thread were to use the 
same session variable names ( which is surely possible right?)
I guess my question is very academic, but I'm trying to understand the 
workings of  sessions..
But for now, my main concern is getting PHP to work it's magic with my 
URL's.

Thanks



[EMAIL PROTECTED] wrote:

Taken straigh from the manual:
(http://www.php.net/manual/en/ref.session.php)

[quote]
There are two methods to propagate a session id: 

- Cookies 

- URL parameter 

The session module supports both methods. Cookies are optimal, but since
they are not reliable (clients are not bound to accept them), we cannot rely
on them. The second method embeds the session id directly into URLs. 

PHP is capable of doing this transparently when compiled with
--enable-trans-sid. If you enable this option, relative URIs will be changed
to contain the session id automatically. Alternatively, you can use the
constant SID which is defined, if the client did not send the appropriate
cookie. SID is either of the form session_name=session_id or is an empty
string. 
[/quote]

Regards
Joakim Andersson


-Original Message-
From: PHPCoder [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 18, 2002 11:17 AM
To: php-general
Subject: [PHP] Sessions: watertight?


Hi
I'm doing some reading on sessions and how it works etc, and have a 
concern (which is probably fed by my ignorance on the topic).
The couple of simple session examples I have found in the PHP/MySQL 
book by Luke Welling  Laura Thompson gives a simple 3 page session 
example where the session is started on the first page, a variable is 
registered as a session var and then has a link to the next 
page where 
the session_start() is called and the session_var is echoed to 
illustrate the workings of a session.
My understanding is that PHP will either use cookies to store the 
session ID on the client's pc, or send it via URL, so, assuming that 
cookies is a no-go, can I now assume that PHP will attach 
it's session 
ID to each and every URL located on my .php page?
The reason I'm asking is as follow:
I did the little excersise, and then deliberately rejected my 
browsers 
call to process the cookie, and then the script didn't return the 
variable as it did previously...
And now, assuming that I can assume that PHP will attach the 
SID to all 
URL's , how does it know to which URL's to attach, or am I 
supposed to 
manually attach them, leaving me with another question, If I have to 
manually code the SID into the URL, then the whole session 
coockies if 
possible approach doesn't seem to work???

Can someone explain it in more detail for me plz?
Thanks



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

2002-07-18 Thread Thomas \omega\ Henning

Hello,

Can i access my paralel or USB port with PHP server side?

Thomas omega Henning



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




[PHP] snmp / php / linux /error

2002-07-18 Thread MAAS

Iam trying to use my php file in a Linux machine.

#!/usr/local/bin/snmp_guard.php -q

?
$bat = snmpget(192.168.10.8, pub_likt, .1.3.6.1.4.1.2606.1.2.12.0);
$sum = snmpget(192.168.10.8, pub_likt, .1.3.6.1.4.1.2606.1.2.13.0);
$drift = snmpget(192.168.10.8, pub_likt, .1.3.6.1.4.1.2606.1.2.10.0);
$verk = snmpget(192.168.10.8, pub_likt, .1.3.6.1.4.1.2606.1.2.11.0);
echo $bat;
?

Then I start it with php snmp_guard.php

All I get is

Call to undefeind funcion snmpget()

WHY??



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




[PHP] Re: snmp / php / linux /error

2002-07-18 Thread David Robley

In article [EMAIL PROTECTED], [EMAIL PROTECTED] 
says...
 Iam trying to use my php file in a Linux machine.
 
 #!/usr/local/bin/snmp_guard.php -q
 
 ?
 $bat = snmpget(192.168.10.8, pub_likt, .1.3.6.1.4.1.2606.1.2.12.0);
 $sum = snmpget(192.168.10.8, pub_likt, .1.3.6.1.4.1.2606.1.2.13.0);
 $drift = snmpget(192.168.10.8, pub_likt, .1.3.6.1.4.1.2606.1.2.10.0);
 $verk = snmpget(192.168.10.8, pub_likt, .1.3.6.1.4.1.2606.1.2.11.0);
 echo $bat;
 ?
 
 Then I start it with php snmp_guard.php
 
 All I get is
 
 Call to undefeind funcion snmpget()
 
 WHY??

That error is usually an indication that the particular resource hasn't 
been included when php was compiled.

Use phpinfo() to see what capabilities your installation has.

-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

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




RE: [PHP] Upload File Problem

2002-07-18 Thread Mark Colvin

Joakim,

Thank you for your reply. I tried your example and get 'Possible file upload
attack: filename.' meaning that 'if
(is_uploaded_file($_FILES['img1']['tmp_name']))' returns false. I put a
couple of echo statements in before the if statement to check '$img1_name'
'$img1_size and '$img1_type' and these all returned the correct values. I
have my upload_tmp_dir in php.ini set to /var/www/html/img and this folder
has 777 permissions. Do you think the file is not getting to temp directory
and if so any idea why?




This e-mail is intended for the recipient only and
may contain confidential information. If you are
not the intended recipient then you should reply
to the sender and take no further ation based
upon the content of the message.
Internet e-mails are not necessarily secure and
CCM Limited does not accept any responsibility
for changes made to this message. 
Although checks have been made to ensure this
message and any attchments are free from viruses
the recipient should ensure that this is the case.


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




Re: [PHP] ErrorDocument 404 Form

2002-07-18 Thread Matt

 Well it still is in GET method because the url does still exist with the
 ?plop=foobar but in case I want to use POST method (which I will as my
 form has huge textarea) everything disappear.
 Also this is a turn around I don't like, I would first understand why it
 doesn't work, and if I can fix it.
I  browsed the the apache source, and it looks to me that the message body
is simply read and dumped into the bit bucket on a 404 with an ErrorDocument
(and thus isn't passed as part of the internal request to the ErrorDocument
itself).  Perhaps you ought to ask the apache list.




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




Re: [PHP] Sessions: watertight?

2002-07-18 Thread Justin French

on 18/07/02 7:39 PM, [EMAIL PROTECTED]
([EMAIL PROTECTED]) wrote:

 PHP is capable of doing this transparently when compiled with
 --enable-trans-sid. If you enable this option, relative URIs will be changed
 to contain the session id automatically.

It's worth pointing out that enable-trans-sid IS NOT bullet proof.  It
doesn't work on all javascripts (or any other client-side scripting, and I'm
sure there's some other scenario's that it skips.

It takes care of relative URLs within standard HTML.  I have a feeling it
doesn't work in IFRAME's, but does for FRAME's.

It worth doing some testing if you go down this road.


Justin French


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




Re: [PHP] ErrorDocument 404 Form

2002-07-18 Thread Fabien Penso


Matt a écrit : 

  Well it still is in GET method because the url does still exist with the
  ?plop=foobar but in case I want to use POST method (which I will as my
  form has huge textarea) everything disappear.
  Also this is a turn around I don't like, I would first understand why it
  doesn't work, and if I can fix it.

  I  browsed the the apache source, and it looks to me that the message body
  is simply read and dumped into the bit bucket on a 404 with an ErrorDocument
  (and thus isn't passed as part of the internal request to the ErrorDocument
  itself).  Perhaps you ought to ask the apache list.

Apparently, as I do read
http://www.geocrawler.com/archives/3/182/1999/4/0/1646542/, it's an
Apache problem.

Thanks, I move on an Apache user list :)

-- 
Fabien Penso [EMAIL PROTECTED] | LinuxFr a toujours besoin de :
http://perso.LinuxFr.org/penso/  | http://linuxFr.org/dons/

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




[PHP] Re: how to access javascipt variables in PHP

2002-07-18 Thread Kondwani Spike Mkandawire

Wouldnt this work?
form name=myForm action=sendPage.php action=post
script language = javascript
function myFunc(){
var myJavaScriptVar =  initialValue...
Do What Ever (manipulate myVar)...

document.myForm.fieldName.value = myJavaScriptVar;

/script

input type=hidden name=fieldName value=init

?php
//   If the function my Func has been executed you can do
//  the following...
echo input type=hidden name=fieldName value=$fieldName;
?

//  If you are not running apache (if running IIS) you may get an undefined
//  variable notice on running your script to rid yourself of
//  this do the following instead of the php above...
?php
if(isset($fieldName)){
echo input type=hidden name=fieldName value=$fieldName;
}
?

Hope this Helps...

Spike...



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




Re: [PHP] Accessing Ports

2002-07-18 Thread Marek Kilimajer

Only if you write your own module.

Thomas \omega\ Henning wrote:

Hello,

Can i access my paralel or USB port with PHP server side?

Thomas omega Henning



  




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




RE: [PHP] Re: Includes vs. Functions

2002-07-18 Thread Jay Blanchard

[snip]
Chris, thanks for describing your method. The reason I really dislike
Functions in PHP is because you have to pass every variable needed by a
function, even if that variable is global in the main script, which is a
pain in the ass when a function needs a long string of variables. It makes
it easier to forget a variable in the list and can make the code look messy.

So, that's why I prefer includes, because the code is operating on the same
level as the main script and can easily use variables set locally without
making them global.

I'll use a function if it only needs one or two variables passed to it, but,
I find myself using more Includes than Functions because of the variable
passing necessary.
[/snip]

Includes vs. Functions? How about includes that have functions, which a lot
of developers do. For instance, I have a function set up for database
connections. I use it by including it with pages that require database
connections. I think this probably should be Functions vs. Blocks of Code
(that might be placed in an included file). Actually I see this as being
potentially messier, IMHO. I will have to remember many variable names that
are used in the included file, rather than passing variables I am using
locally to functions with clearly thought out names. Example;

a. I need a variable to hold this standard deviation result. Since I do the
stdv calculation in the block I included I need to go see what the name of
the variable is and use that, so I don't muck up the code.

b. calcStdDev($myCurrentVariable); oh, I need one for here too so,
calcStdDev($anotherVariable);

I just think that you are selling yourself short, and ultimately your code
will be harder to document and maintain. Using blocks is OK, if that block
can be 'functionalized' I say do it.

For efficiency in processing it really will not make much difference in an
included file whether that file is blocks, or functions.

Jay

You’re just jealous because the voices are talking to me

*
* Want to meet other PHP developers *
* in your area? Check out:  *
* http://php.meetup.com/*
* No developer is an island ... *
*



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




RE: [PHP] Upload File Problem

2002-07-18 Thread joakim . andersson

 From: Mark Colvin [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, July 18, 2002 12:41 PM
 To: [EMAIL PROTECTED]
 
 Joakim,
 
 Thank you for your reply. I tried your example and get 
 'Possible file upload
 attack: filename.' meaning that 'if
 (is_uploaded_file($_FILES['img1']['tmp_name']))' returns 
 false. I put a
 couple of echo statements in before the if statement to check 
 '$img1_name'
 '$img1_size and '$img1_type' and these all returned the 
 correct values. I
 have my upload_tmp_dir in php.ini set to /var/www/html/img 
 and this folder
 has 777 permissions. Do you think the file is not getting to 
 temp directory
 and if so any idea why?

Have you tried echoing $_FILES['img1']['tmp_name'] or
$HTTP_POST_FILES['img1']['tmp_name']?
If the first doesn't work, you may have to exchange $_FILES to
$HTTP_POST_FILES or $_FILES['img1']['tmp_name'] to $img1_tmp_name etc.

/Joakim

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




RE: [PHP] Accessing Ports

2002-07-18 Thread Cal Evans

No. 

No. PHP runs on the server. It knows nothing of the client.

=C=

*
* Cal Evans
* The Virtual CIO
* http://www.calevans.com
*
 

-Original Message-
From: Thomas omega Henning [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 18, 2002 5:33 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Accessing Ports


Hello,

Can i access my paralel or USB port with PHP server side?

Thomas omega Henning



-- 
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] Upload File Problem

2002-07-18 Thread Mark Colvin

Joakim,

Thanks again. $HTTP_POST did the trick. I did look through the archives
before posting but didn't come across this solution. I obviously didn't look
hard enough!




This e-mail is intended for the recipient only and
may contain confidential information. If you are
not the intended recipient then you should reply
to the sender and take no further ation based
upon the content of the message.
Internet e-mails are not necessarily secure and
CCM Limited does not accept any responsibility
for changes made to this message. 
Although checks have been made to ensure this
message and any attchments are free from viruses
the recipient should ensure that this is the case.


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




[PHP] Any PHP editor for windows

2002-07-18 Thread Dasmeet Singh

Hey, does anyone knows of a good PHP editor for windows. I have also 
heard emacs is available for windows. Does anyone know where to download 
it from?
Dasmeet
http://www.einfotimes.com


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




RE: [PHP] Any PHP editor for windows

2002-07-18 Thread Jay Blanchard

[snip]
Hey, does anyone knows of a good PHP editor for windows. I have also
heard emacs is available for windows. Does anyone know where to download
it from?
Dasmeet
http://www.einfotimes.com
[/snip}

There are a few, but these two are the ones I see used most;

http://www.phpedit.com/ PHPEdit -- has some bugs, but not bad (free)
http://www.zend.com/store/products/zend-studio.php -- Zend Studio (version
2.0 is free)

HTH!

Jay

Why take life so seriously? It isn’t permanent.

*
* Want to meet other PHP developers *
* in your area? Check out:  *
* http://php.meetup.com/*
* No developer is an island ... *
*



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




[PHP] mod_rewrite problem

2002-07-18 Thread adrian murphy



Hi,
the following code redirects www.usersite.mysite.biz  to 
www.mysite.biz/users/sites/usersite

the problem is when the 'www' is left out it doesn't work.
could someone help me to fix this?
many thanks




RewriteEngine on
RewriteCond   %{HTTP_HOST} ^www\.[^.]+\.mysite\.biz$
RewriteRule   ^(.+)%{HTTP_HOST}$1  [C]
RewriteRule   ^www\.([^.]+)\.mysite\.biz(.*) http://www.mysite.biz/users/sites/$1
RewriteCond   %{HTTP_HOST} ^www\.[^.]+\.mysite\.ie$
RewriteRule   ^(.+)%{HTTP_HOST}$1  [C]
RewriteRule   ^www\.([^.]+)\.mysite\.ie(.*) http://www.mysite.biz/users/sites/$1


adrian.



RE: [PHP] Accessing Ports

2002-07-18 Thread Adam Voigt

If you mean the ports on the server, theoretically yes, if get the right
permissions set and figure out all the device settings.

Adam
[EMAIL PROTECTED]

On Thu, 2002-07-18 at 08:29, Cal Evans wrote:
 No. 
 
 No. PHP runs on the server. It knows nothing of the client.
 
 =C=
 
 *
 * Cal Evans
 * The Virtual CIO
 * http://www.calevans.com
 *
  
 
 -Original Message-
 From: Thomas omega Henning [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, July 18, 2002 5:33 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Accessing Ports
 
 
 Hello,
 
 Can i access my paralel or USB port with PHP server side?
 
 Thomas omega Henning
 
 
 
 -- 
 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] Cookies - good or bad???

2002-07-18 Thread PHPCoder

I'm really battling with this whole session thing.
My first impressions are that cookies are OK, and really helps to make 
sessions workable and efficient, YET, from a developers point of view, I 
always play devils advocate, and I'm wondering about those stubbourne 
individuals out there who outright refuse cookies; rendering my 
application useless unless I code a plan B into my code; meaning I can 
just as well NOT use cookies from the start...
catch 22 dejavu...
What are the general feeling out there amongst developers about the use 
of cookies?
I'm concerned about the following scenario specifically:
I develop my great application using session controll - which uses 
cookies by default, or alternatively adds the sid to the relative URL's 
on the page, YET, from responses to my previous posting, I gather that 
the alternative url method is not 100% the same as the cookie method 
inthat it doesn't work with IFRAMES etc. Leaving me to think that there 
will potentially be people out there that will NOT be able to use the 
application, that could lead to messy discussions between developer and 
client...

Before I started to read up on sessions, I simply used my own form of 
session management by sending all relevant variables either via URL or 
via form fields to the subsequent pages. Obviously this method leaves a 
bunch of holes as well, but I KNOW that my application is always pure 
and simple HTML, doesn't have browser issues, doesn't have cookie 
issues, so 100% of the internet community can use it.

Does anyone out there have a view/practise when it comes to 
session/cookies? - basically I am still not convinced that using 
sessions/cookies is a good idea, but I would love to be educated as to 
why I should...




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




[PHP] Re: Cookies - good or bad???

2002-07-18 Thread Kondwani Spike Mkandawire

 Before I started to read up on sessions, I simply used my own form of
 session management by sending all relevant variables either via URL or
 via form fields to the subsequent pages. Obviously this method leaves a
 bunch of holes as well, but I KNOW that my application is always pure
 and simple HTML, doesn't have browser issues, doesn't have cookie
 issues, so 100% of the internet community can use it.

 Does anyone out there have a view/practise when it comes to
 session/cookies? - basically I am still not convinced that using
 sessions/cookies is a good idea, but I would love to be educated as to
 why I should...

 The issue on Advantages and disadvantages of Cookies has been
discussed numerous amounts of times...  There was also debate on
using I.P vs Cookies, I see from your address that you are based in
S.A. meaning there is still numerous amounts of people set on dial up
hence allocating someone a specific id via dial up would be totally
out of the question (dial up IP changes)...  Through the discussions
I was convinced that Cookies are and ought to be the best way to go...
Most people use IE/Netscape which does not ask if you want to
accept or reject cookies like the browsers that are generic to Linux
namely Konqueror and Lynx...  Furthermore, I don't know too
many people that scrimmage through their hard drive searching for
Cookies to delete...  besides most people (unless they have done
a great deal of web programming) don't know what a Cookie is,
so if they actually do get prompted to accept or reject a Cookie the
odds of them Accepting are equal to the odds of them rejecting
(probably even higher considering most prompts require a Yes)...

I'd say Cookies and Sessions are quite reliable...  Well, they are
the safest method I know to go about the problem of monitoring
ones surfing habits...  If anyone can think of another please post
her up, I'd be curious to learn of it...

Regards,
Kondwani



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




[PHP] Test of GD

2002-07-18 Thread Jay Blanchard

Anyone know of a quick script I can run to test the GD setup on my servers?
I have multiple servers that I need to test where phpinfo() reveals various
versions of the GD library. I can hack something together quickly if need
be, but I was hoping that the gurus of the list would have a test that they
run.

Thanks!

Jay

Who me? I just wander from room to room ...

*
* Want to meet other PHP developers *
* in your area? Check out:  *
* http://php.meetup.com/*
* No developer is an island ... *
*



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




[PHP] Code errors

2002-07-18 Thread Chris Crane

I am trying some code and it works except I get the following errors...
Warning: Undefined offset: 5 in
c:\www\htdocs\demos\havasuinternet\havasuinternet-lib.php on line 247
Warning: Undefined offset: 4 in
c:\www\htdocs\demos\havasuinternet\havasuinternet-lib.php on line 247
Warning: Undefined offset: 3 in
c:\www\htdocs\demos\havasuinternet\havasuinternet-lib.php on line 247
Warning: Undefined offset: 2 in
c:\www\htdocs\demos\havasuinternet\havasuinternet-lib.php on line 247
Warning: Undefined offset: 1 in
c:\www\htdocs\demos\havasuinternet\havasuinternet-lib.php on line 247


Here is the code, could someone tell me what's wrong. I don't see anything
wrong...

function HistoricalStock($sym) {
 $LookupURL =
http://table.finance.yahoo.com/table.csv?a=7b=1c=2002d=7e=17f=2002s=$
symy=0g=dignore=.csv;
 $Results = implode('', file($LookupURL));
 $Data = explode(\n, $Results);
 print 'table width=100% border=0 cellspacing=1 cellpadding=0
bgcolor=#6699cctr bgcolor=#FF';
 foreach($Data as $Line) {
  list($H_Date, $H_Open, $H_High, $H_Low, $H_Close, $H_Volume) = split(,,
$Line);
  print tr bgcolor=\#FF\

td$H_Date/td\ntd$H_Open/td\ntd$H_High/td\ntd$H_Low/td\ntd$
H_Close/td\ntd$H_Volume/td\n/tr;
  }
 print '/table';
}



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




[PHP] Re: Code errors

2002-07-18 Thread Scott Fletcher

Which line in the script you had provided to us is line 247?

Chris Crane [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I am trying some code and it works except I get the following errors...
 Warning: Undefined offset: 5 in
 c:\www\htdocs\demos\havasuinternet\havasuinternet-lib.php on line 247
 Warning: Undefined offset: 4 in
 c:\www\htdocs\demos\havasuinternet\havasuinternet-lib.php on line 247
 Warning: Undefined offset: 3 in
 c:\www\htdocs\demos\havasuinternet\havasuinternet-lib.php on line 247
 Warning: Undefined offset: 2 in
 c:\www\htdocs\demos\havasuinternet\havasuinternet-lib.php on line 247
 Warning: Undefined offset: 1 in
 c:\www\htdocs\demos\havasuinternet\havasuinternet-lib.php on line 247


 Here is the code, could someone tell me what's wrong. I don't see anything
 wrong...

 function HistoricalStock($sym) {
  $LookupURL =

http://table.finance.yahoo.com/table.csv?a=7b=1c=2002d=7e=17f=2002s=$
 symy=0g=dignore=.csv;
  $Results = implode('', file($LookupURL));
  $Data = explode(\n, $Results);
  print 'table width=100% border=0 cellspacing=1 cellpadding=0
 bgcolor=#6699cctr bgcolor=#FF';
  foreach($Data as $Line) {
   list($H_Date, $H_Open, $H_High, $H_Low, $H_Close, $H_Volume) =
split(,,
 $Line);
   print tr bgcolor=\#FF\


td$H_Date/td\ntd$H_Open/td\ntd$H_High/td\ntd$H_Low/td\ntd$
 H_Close/td\ntd$H_Volume/td\n/tr;
   }
  print '/table';
 }





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




[PHP] Re: Code errors

2002-07-18 Thread Chris Crane

247:   list($H_Date, $H_Open, $H_High, $H_Low, $H_Close, $H_Volume) =
split(,, $Line);

Scott Fletcher [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Which line in the script you had provided to us is line 247?

 Chris Crane [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  I am trying some code and it works except I get the following errors...
  Warning: Undefined offset: 5 in
  c:\www\htdocs\demos\havasuinternet\havasuinternet-lib.php on line 247
  Warning: Undefined offset: 4 in
  c:\www\htdocs\demos\havasuinternet\havasuinternet-lib.php on line 247
  Warning: Undefined offset: 3 in
  c:\www\htdocs\demos\havasuinternet\havasuinternet-lib.php on line 247
  Warning: Undefined offset: 2 in
  c:\www\htdocs\demos\havasuinternet\havasuinternet-lib.php on line 247
  Warning: Undefined offset: 1 in
  c:\www\htdocs\demos\havasuinternet\havasuinternet-lib.php on line 247
 
 
  Here is the code, could someone tell me what's wrong. I don't see
anything
  wrong...
 
  function HistoricalStock($sym) {
   $LookupURL =
 

http://table.finance.yahoo.com/table.csv?a=7b=1c=2002d=7e=17f=2002s=$
  symy=0g=dignore=.csv;
   $Results = implode('', file($LookupURL));
   $Data = explode(\n, $Results);
   print 'table width=100% border=0 cellspacing=1 cellpadding=0
  bgcolor=#6699cctr bgcolor=#FF';
   foreach($Data as $Line) {
list($H_Date, $H_Open, $H_High, $H_Low, $H_Close, $H_Volume) =
 split(,,
  $Line);
print tr bgcolor=\#FF\
 
 

td$H_Date/td\ntd$H_Open/td\ntd$H_High/td\ntd$H_Low/td\ntd$
  H_Close/td\ntd$H_Volume/td\n/tr;
}
   print '/table';
  }
 
 





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




Re: [PHP] Re: Includes vs. Functions

2002-07-18 Thread Rick Widmer

At 09:20 PM 7/17/02 -0500, Michael Sims wrote:


$superglobals = array(var1, var2, var3, var4, var5, ...);

Now inside the function you can do this:

function somefunction ($somevar) {

   global $superglobals;
   foreach($superglobals as $varname) {
 global $$varname; //resolves to $var1, $var2, $var3, etc.
   }

   //Other stuff here

}


You're working too hard!


function somefunction( $somevar ) {

global $suberglobals;

extract( $superglobals );

//Other stuff here

}

Rick



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




Re: [PHP] Cookies - good or bad???

2002-07-18 Thread Analysis Solutions

On Thu, Jul 18, 2002 at 03:38:51PM +0200, PHPCoder wrote:

 What are the general feeling out there amongst developers about the use 
 of cookies?

Cookies rely on client side.  I never rely on the client for anything.

When it comes to examples of how to do things The Right Way, I say go 
take a look at amazon.com.  No cookies.  No Java'sCrap.  Works flawlessly.

--Dan

-- 
   PHP classes that make web design easier
SQL Solution  |   Layout Solution   |  Form Solution
sqlsolution.info  | layoutsolution.info |  formsolution.info
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

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




Re: [PHP] Cookies - good or bad???

2002-07-18 Thread Scott Fletcher

I don't use cookies either due to the fact that some web browser block the
cookies and some web browser's bug that affected the cookie.  For example,
if Internet Explorer have a bug with the cookie then it is gurantee that
you'll never find MS to have this bug fix in a few days.  It could take 6
months or a year.  So, what's the point with using hte cookie?

Analysis  Solutions [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 On Thu, Jul 18, 2002 at 03:38:51PM +0200, PHPCoder wrote:

  What are the general feeling out there amongst developers about the use
  of cookies?

 Cookies rely on client side.  I never rely on the client for anything.

 When it comes to examples of how to do things The Right Way, I say go
 take a look at amazon.com.  No cookies.  No Java'sCrap.  Works flawlessly.

 --Dan

 --
PHP classes that make web design easier
 SQL Solution  |   Layout Solution   |  Form Solution
 sqlsolution.info  | layoutsolution.info |  formsolution.info
  T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
  4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409



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




RE: [PHP] Test of GD - SOLVED

2002-07-18 Thread Jay Blanchard

[snip]
Anyone know of a quick script I can run to test the GD setup on my servers?
I have multiple servers that I need to test where phpinfo() reveals various
versions of the GD library. I can hack something together quickly if need
be, but I was hoping that the gurus of the list would have a test that they
run.
[/snip]

Thanks, I got it done.

Jay

Where there’s a will…I want to be in it

*
* Want to meet other PHP developers *
* in your area? Check out:  *
* http://php.meetup.com/*
* No developer is an island ... *
*



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




[PHP] XML with PHP cURL.

2002-07-18 Thread Scott Fletcher

Hi!  I find it to be mind-boggling to try to make xml work with php and
curl.  What do anyone here think of it?



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




RE: [PHP] XML with PHP cURL.

2002-07-18 Thread Jay Blanchard

[snip]
Hi!  I find it to be mind-boggling to try to make xml work with php and
curl.  What do anyone here think of it?
[/snip]

More details about the problem would be nice. How exactly do you want this
to work? I have had no problems with cURL and PHP.

Jay

What was the best thing before sliced bread?


*
* Want to meet other PHP developers *
* in your area? Check out:  *
* http://php.meetup.com/*
* No developer is an island ... *
*



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




[PHP] Warning: e-mails being harvested from PHP newsgroups

2002-07-18 Thread Cord Schneider

Hi all,

I just wanted to warn all those who post to the PHP newsgroups, and/or PHP
HTML forums, that spammers are harvesting email address from these groups.
If you want to avoid ending up on some spammers list, please consider using
a SpamTrap (throwaway email address) or maybe a service like Sneakemail
(http://sneakemail.com).

Kind regards,
Cord




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




Re: [PHP] Someone Help please

2002-07-18 Thread Chris Crane

Well, I posted it the first time and no one responded so I figured the
subject did not interest anyone. I changed it. I am not sure how the third
one started.

But hey thanks for watching and giving you unwanted opinion.

Analysis  Solutions [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Chris:

 Geez, this is your third thread on this today...  Lame.

 --Dan

 --
PHP classes that make web design easier
 SQL Solution  |   Layout Solution   |  Form Solution
 sqlsolution.info  | layoutsolution.info |  formsolution.info
  T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
  4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409



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




Re: [PHP] XML with PHP cURL.

2002-07-18 Thread Analysis Solutions

On Thu, Jul 18, 2002 at 11:03:10AM -0400, Scott Fletcher wrote:
 Hi!  I find it to be mind-boggling to try to make xml work with php and
 curl.  What do anyone here think of it?

Well, I can offer help on the XML:
   http://www.analysisandsolutions.com/code/phpxml.htm

--Dan

-- 
   PHP classes that make web design easier
SQL Solution  |   Layout Solution   |  Form Solution
sqlsolution.info  | layoutsolution.info |  formsolution.info
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

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




Re: [PHP] Re: Code errors

2002-07-18 Thread Marek Kilimajer

My guess is that there is no ',' in $Line, so split returns an array 
with one variable, so list() warns you
parameter No. 1, 2 ,3 4 and 5 are not asigned any value.

Chris Crane wrote:

247:   list($H_Date, $H_Open, $H_High, $H_Low, $H_Close, $H_Volume) =
split(,, $Line);

Scott Fletcher [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  

Which line in the script you had provided to us is line 247?

Chris Crane [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...


I am trying some code and it works except I get the following errors...
Warning: Undefined offset: 5 in
c:\www\htdocs\demos\havasuinternet\havasuinternet-lib.php on line 247
Warning: Undefined offset: 4 in
c:\www\htdocs\demos\havasuinternet\havasuinternet-lib.php on line 247
Warning: Undefined offset: 3 in
c:\www\htdocs\demos\havasuinternet\havasuinternet-lib.php on line 247
Warning: Undefined offset: 2 in
c:\www\htdocs\demos\havasuinternet\havasuinternet-lib.php on line 247
Warning: Undefined offset: 1 in
c:\www\htdocs\demos\havasuinternet\havasuinternet-lib.php on line 247


Here is the code, could someone tell me what's wrong. I don't see
  

anything
  

wrong...

function HistoricalStock($sym) {
 $LookupURL =

  

http://table.finance.yahoo.com/table.csv?a=7b=1c=2002d=7e=17f=2002s=$
  

symy=0g=dignore=.csv;
 $Results = implode('', file($LookupURL));
 $Data = explode(\n, $Results);
 print 'table width=100% border=0 cellspacing=1 cellpadding=0
bgcolor=#6699cctr bgcolor=#FF';
 foreach($Data as $Line) {
  list($H_Date, $H_Open, $H_High, $H_Low, $H_Close, $H_Volume) =
  

split(,,


$Line);
  print tr bgcolor=\#FF\


  

td$H_Date/td\ntd$H_Open/td\ntd$H_High/td\ntd$H_Low/td\ntd$
  

H_Close/td\ntd$H_Volume/td\n/tr;
  }
 print '/table';
}


  






  




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




[PHP] Re: mod_rewrite problem

2002-07-18 Thread CC Zona

In article 003d01c22e58$dcb45240$6601a8c0@yourwrjlo8t8dt,
 [EMAIL PROTECTED] (Adrian Murphy) wrote:

 the following code redirects www.usersite.mysite.biz  to 
 www.mysite.biz/users/sites/usersite
 
 the problem is when the 'www' is left out it doesn't work.
snip
 RewriteEngine on
 RewriteCond   %{HTTP HOST} ^www\.[^.]+\.mysite\.biz$
 RewriteRule   ^(.+)%{HTTP HOST}$1  [C]
 RewriteRule   ^www\.([^.]+)\.mysite\.biz(.*) 
 http://www.mysite.biz/users/sites/$1
 RewriteCond   %{HTTP HOST} ^www\.[^.]+\.mysite\.ie$
 RewriteRule   ^(.+)%{HTTP HOST}$1  [C]
 RewriteRule   ^www\.([^.]+)\.mysite\.ie(.*) 
 http://www.mysite.biz/users/sites/$1

Change each of those instances of ^www\. to ^(www\.)?

-- 
CC

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




[PHP] Re: Cookies - good or bad???

2002-07-18 Thread Cord Schneider

Phpcoder [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I'm really battling with this whole session thing.
 My first impressions are that cookies are OK, and really helps to make
 sessions workable and efficient, YET, from a developers point of view, I
[..snip..]
 Does anyone out there have a view/practise when it comes to
 session/cookies? - basically I am still not convinced that using
 sessions/cookies is a good idea, but I would love to be educated as to
 why I should...

A number of people have offered their opinion why cookies are a bad idea. As
a developer new to PHP, if cookies are such a big a big no-no, how does one
do effective session management without storing anything client-side?? Bear
in mind that the browser is stateless and, the user can disconnect and
reconnect in between fetching pages from your site.

Regards,
Cord




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




Re: [PHP] Someone Help please

2002-07-18 Thread Analysis Solutions

On Thu, Jul 18, 2002 at 11:06:11AM -0400, Chris Crane wrote:
 Well, I posted it the first time and no one responded so I figured the
 subject did not interest anyone. I changed it. I am not sure how the third
 one started.

We're all here volunteering, trying to help each other out.  If you want
an instant response, hire someone.  Otherwise, you need to be patient.

Sure, if you don't get a reply in a few days, your request probably
slipped through the cracks, post again.  But, in this case, you're being
unreasonable:  First post was at 10:00.  Second at 11:58.  Third at 13:16.

Posting to the list multiple times makes the list less pleasant for the
people trying to help and those trying to learn.

--Dan

-- 
   PHP classes that make web design easier
SQL Solution  |   Layout Solution   |  Form Solution
sqlsolution.info  | layoutsolution.info |  formsolution.info
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

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




Re: [PHP] XML with PHP cURL.

2002-07-18 Thread Scott Fletcher

Cool!  I'm just getting started on XML.  I read the documentation about XML
and it doesn't look too hard.  Unfortunately, it is written for the client
side script.  So, I barely am starting writing the test script for the
server side and have it work with php and curl.  At least, I know how to use
curl and php without a problem.  Just trying to figure out to slide the xml
data through curl to somewhere and vice versa.  It involve 2 seperate URL
address.  The 1st for authentication and the 2nd for transmitting datas.
Sigh!

Alright!  I'll read the post,
http://www.analysisandsolutions.com/code/phpxml.htm and see what I can learn
from.

Thanks,
 FletchSOD

Analysis  Solutions [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 On Thu, Jul 18, 2002 at 11:03:10AM -0400, Scott Fletcher wrote:
  Hi!  I find it to be mind-boggling to try to make xml work with php and
  curl.  What do anyone here think of it?

 Well, I can offer help on the XML:
http://www.analysisandsolutions.com/code/phpxml.htm

 --Dan

 --
PHP classes that make web design easier
 SQL Solution  |   Layout Solution   |  Form Solution
 sqlsolution.info  | layoutsolution.info |  formsolution.info
  T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
  4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409



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




Re: [PHP] XML with PHP cURL.

2002-07-18 Thread Scott Fletcher

More detail?  I have successfully make the data transmission work through
php and curl without xml.  I just barely gotten started on xml.  I read the
documentation about how it work, but it is only for the client side.  I'm
going to have to read some documentation and figure out how to use xml in
php then figure out how to use curl for xml transmission.  It is not just
setting up curl is the issue here since xml and transmit through and back
without the problem as I read on the cURL website.  I have two URLs to deal
with.  The 1st for authentication and the 2nd, a completely different URL
address for transmitting data.  The odd thing is I don't need to have the
encryption packages since the letter said all I need to do is to issue the
key to that website and it will provide the encryption to me.  Must be
related to the authentication stuffs.

Thanks,
 FletchSOD

Going to have to find
Jay Blanchard [EMAIL PROTECTED] wrote in message
001401c22e6c$4843be20$8102a8c0@niigziuo4ohhdt">news:001401c22e6c$4843be20$8102a8c0@niigziuo4ohhdt...
 [snip]
 Hi!  I find it to be mind-boggling to try to make xml work with php and
 curl.  What do anyone here think of it?
 [/snip]

 More details about the problem would be nice. How exactly do you want this
 to work? I have had no problems with cURL and PHP.

 Jay

 What was the best thing before sliced bread?


 *
 * Want to meet other PHP developers *
 * in your area? Check out:  *
 * http://php.meetup.com/*
 * No developer is an island ... *
 *





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




RE: [PHP] Any PHP editor for windows

2002-07-18 Thread Andrew Chase

ftp://ftp.gnu.org/gnu/windows/emacs/latest

A helpful Emacs resource:
http://www.emacswiki.org/cgi-bin/wiki.pl

Be sure to download php-mode for Emacs, too!
http://sourceforge.net/projects/php-mode/

And PSGML if you do much with HTML/XHTML/XML:
http://www.lysator.liu.se/projects/about_psgml.html

-Andy

 -Original Message-
 From: Dasmeet Singh [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, July 18, 2002 2:59 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Any PHP editor for windows
 
 
 Hey, does anyone knows of a good PHP editor for windows. I have also 
 heard emacs is available for windows. Does anyone know where to download 
 it from?
 Dasmeet
 http://www.einfotimes.com 

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




Re: [PHP] Code errors

2002-07-18 Thread Chris Crane

Hey thank Dan, I will try this.
Does List waste lots of time and memory?

Normally, I create a function and global a bunch of variables to be used
later on the HTML/PHP file. After I global the variables I split the string
using the List function. I do that for stock quotes from YAHOO so I can code
the layout in like Dreamweaver and place the varaibles where I would like
instead of the function writing out the html for me. Is that bad?



Analysis  Solutions [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 On Thu, Jul 18, 2002 at 10:14:25AM -0400, Chris Crane wrote:

  Warning: Undefined offset: 5 in

 Means your array doesn't have that key in it.  I bet you're running into
 blank lines in your file.


  $Results = implode('', file($LookupURL));
  $Data = explode(\n, $Results);

 Uh, you do realize that you're flip flopping the data around here for no
 reason.  file() already creates an array.  But you go through the
 unnecessary steps of compressing that array into a string and then
 recreating a new array.  Just do this:

$Data = file($LookupURL);

 That will eliminate your errors by not adding extra blank lines.


   foreach($Data as $Line) {
list($H_Date, $H_Open, $H_High, $H_Low, $H_Close, $H_Volume) =
split(,,
  $Line);
print tr bgcolor=\#FF\
 
td$H_Date/td\ntd$H_Open/td\ntd$H_High/td\ntd$H_Low/td\ntd$
  H_Close/td\ntd$H_Volume/td\n/tr;
}

 But, your whole approach is wasteful.  As I said yesterday, use fopen()
 and then fgetcsv().  Forget the file() and split() calls.

 Then, you're wasting time and memory with the list().  Use the resulting
 array directly.

while ( $Line = fgetcsv($fp, 500) ) {
   echo tr td$Line[0]/td td$Line[1]/td ... etc ...;
}

 Or, since you're pringing everything out, you could just do this:

while ( $Line = fgetcsv($fp, 500) ) {
   echo 'trtd' . implode('/tdtd', $Line) . '/td/tr'
}

 --Dan

 --
PHP classes that make web design easier
 SQL Solution  |   Layout Solution   |  Form Solution
 sqlsolution.info  | layoutsolution.info |  formsolution.info
  T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
  4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409



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




Re: [PHP] Warning: e-mails being harvested from PHP newsgroups

2002-07-18 Thread Bret L Conard

Ha!
They can have at it! If they are stupid enough to spam a bunch of
programmers and network people they deserve what they get.

Now it's *against the law* to harass spammers by tracking their malicious
activity back to it's source and sending virus after virus : ), or hacking
into their servers to delete things : ).

So I would *never* recommend that course of action.

But tempers do flare from time to time. and there's no telling what
a bunch of aggravated programmers can/would do...


Bret

- Original Message -
From: Cord Schneider [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, July 18, 2002 11:04 AM
Subject: [PHP] Warning: e-mails being harvested from PHP newsgroups


 Hi all,

 I just wanted to warn all those who post to the PHP newsgroups, and/or PHP
 HTML forums, that spammers are harvesting email address from these groups.
 If you want to avoid ending up on some spammers list, please consider
using
 a SpamTrap (throwaway email address) or maybe a service like Sneakemail
 (http://sneakemail.com).

 Kind regards,
 Cord




 --
 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] apache.conf for php

2002-07-18 Thread Scott Fletcher

I recently upgraded Apache to 1.3.26 and am currently configurating hte
httpd.conf.  I noticed that

--snip--
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
--snip--

does not exist in this version as it does in the older version.

Is it now automatic with the newer version??

Thanks,
 FletchSOD



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




[PHP] php.ini problem

2002-07-18 Thread Andre


Apache 1.3.26
PHP 4.2.1 staticly built as a module.

The configuration in php.ini seems not to be used by httpd.
I've traced my httpd process and it opens the php.ini file in the expected 
directory, but variables set in there don't take effect (e.g. engine=On, 
display_errors=Off, etc.).
I had PHP 4.1.1 running here before, and it used to work, PHP 4.2.1 has been 
built with exactly the same options that I used to build PHP 4.1.1.
What could have I missed?


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




[PHP] Re: Cookies - good or bad???

2002-07-18 Thread Scott Fletcher

Instead of Cookies, I use Sessions which is run on hte server side.  So, I
use the

--snip--
  $salt = strtoupper(md5(uniqid(rand(;
  session_id($salt);
  session_start();
  header(Location: https://xxx.yyy.zzz/index.php?.SID.init_login=TRUE;);
--snip--

to create the identifer for an unique person.  Then use the php script that
take care of the session management such as logging the user out when time
is up as an example.  Another script was used to prevent the direct access
attempt.  Another script was used to detect whether the server have the
user's identifier in the server, if not exist then would force the web
browser to the login page.

As for the newbie, well, sometime they had to learn it from the pro.
Although it would be nice if there is documentation somewhere.


Cord Schneider [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Phpcoder [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  I'm really battling with this whole session thing.
  My first impressions are that cookies are OK, and really helps to make
  sessions workable and efficient, YET, from a developers point of view, I
 [..snip..]
  Does anyone out there have a view/practise when it comes to
  session/cookies? - basically I am still not convinced that using
  sessions/cookies is a good idea, but I would love to be educated as to
  why I should...

 A number of people have offered their opinion why cookies are a bad idea.
As
 a developer new to PHP, if cookies are such a big a big no-no, how does
one
 do effective session management without storing anything client-side??
Bear
 in mind that the browser is stateless and, the user can disconnect and
 reconnect in between fetching pages from your site.

 Regards,
 Cord






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




Re: [PHP] Code errors

2002-07-18 Thread Chris Crane

ok here is what I came up with:
How's this?
function HistoricalStock($sym) {
 $row = 1;
 $Data =
fopen(http://table.finance.yahoo.com/table.csv?a=7b=1c=2002d=7e=17f=20
02s=$symy=0g=dignore=.csv,r);
 print 'table width=100% border=0 cellspacing=1 cellpadding=0
bgcolor=#6699cctr bgcolor=#FF';

 while ($Line = fgetcsv ($Data, 1000, ,)) {
  if($row == 1) {
   echo tr bgcolor=\#FF\ tdb$Line[0]/b/td
tdb$Line[1]/b/td tdb$Line[2]/b/td
 tdb$Line[3]/b/td tdb$Line[4]/b/td
tdb$Line[5]/b/td/tr;
   }
  else {
   echo tr bgcolor=\#FF\ td$Line[0]/td tdLine[1]/td
td$Line[2]/td
   td$Line[3]/td td$Line[4]/td td$Line[5]/td/tr;
}
  $row++;
  }

 print '/table';
 fclose($Data);
}

Analysis  Solutions [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 On Thu, Jul 18, 2002 at 10:14:25AM -0400, Chris Crane wrote:

  Warning: Undefined offset: 5 in

 Means your array doesn't have that key in it.  I bet you're running into
 blank lines in your file.


  $Results = implode('', file($LookupURL));
  $Data = explode(\n, $Results);

 Uh, you do realize that you're flip flopping the data around here for no
 reason.  file() already creates an array.  But you go through the
 unnecessary steps of compressing that array into a string and then
 recreating a new array.  Just do this:

$Data = file($LookupURL);

 That will eliminate your errors by not adding extra blank lines.


   foreach($Data as $Line) {
list($H_Date, $H_Open, $H_High, $H_Low, $H_Close, $H_Volume) =
split(,,
  $Line);
print tr bgcolor=\#FF\
 
td$H_Date/td\ntd$H_Open/td\ntd$H_High/td\ntd$H_Low/td\ntd$
  H_Close/td\ntd$H_Volume/td\n/tr;
}

 But, your whole approach is wasteful.  As I said yesterday, use fopen()
 and then fgetcsv().  Forget the file() and split() calls.

 Then, you're wasting time and memory with the list().  Use the resulting
 array directly.

while ( $Line = fgetcsv($fp, 500) ) {
   echo tr td$Line[0]/td td$Line[1]/td ... etc ...;
}

 Or, since you're pringing everything out, you could just do this:

while ( $Line = fgetcsv($fp, 500) ) {
   echo 'trtd' . implode('/tdtd', $Line) . '/td/tr'
}

 --Dan

 --
PHP classes that make web design easier
 SQL Solution  |   Layout Solution   |  Form Solution
 sqlsolution.info  | layoutsolution.info |  formsolution.info
  T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
  4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409



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




[PHP] PHP and Date()

2002-07-18 Thread Chris Crane

How can I look back Business Days.
I would like to go back from a certain date, like 7 business days. Is there
a simple way other then looping and checking for the day of the week?



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




[PHP] Re: mod_rewrite problem

2002-07-18 Thread Sameh Attia

Adrian Murphy wrote:
 
 Hi,
 the following code redirects www.usersite.mysite.biz  to 
www.mysite.biz/users/sites/usersite
 
 the problem is when the 'www' is left out it doesn't work.
 could someone help me to fix this?
 many thanks
 
 
 
 
 RewriteEngine on
 RewriteCond   %{HTTP_HOST} ^www\.[^.]+\.mysite\.biz$
 RewriteRule   ^(.+)%{HTTP_HOST}$1  [C]
 RewriteRule   ^www\.([^.]+)\.mysite\.biz(.*) http://www.mysite.biz/users/sites/$1
 RewriteCond   %{HTTP_HOST} ^www\.[^.]+\.mysite\.ie$
 RewriteRule   ^(.+)%{HTTP_HOST}$1  [C]
 RewriteRule   ^www\.([^.]+)\.mysite\.ie(.*) http://www.mysite.biz/users/sites/$1
 
 
 adrian.
 

Hi,
According to your rewrites the following line makes no sense
RewriteRule ^(.+) %{HTTP_HOST}$1 [C]
so remove itthis does not solve your problem
also modify your rewrite conds to read ^(www\.)?[^.]+mysite\.biz$
This also applies to www.username.mysite.ie
Regards
-- 
Sameh Attia
Senior System Engineer
T.E. Data
--
__  __  _
_ _/ /_/ /_(_)___ _
   / ___/ __ `/ __/ __/ / __ `/
  (__  ) /_/ / /_/ /_/ / /_/ /
//\__,_/\__/\__/_/\__,_/


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




[PHP] Re: php.ini problem

2002-07-18 Thread Sameh Attia

Andre wrote:
 Apache 1.3.26
 PHP 4.2.1 staticly built as a module.
 
 The configuration in php.ini seems not to be used by httpd.
 I've traced my httpd process and it opens the php.ini file in the expected 
 directory, but variables set in there don't take effect (e.g. engine=On, 
 display_errors=Off, etc.).
 I had PHP 4.1.1 running here before, and it used to work, PHP 4.2.1 has been 
 built with exactly the same options that I used to build PHP 4.1.1.
 What could have I missed?
 

I have a problem similar to urs but with engine only. I used to set 
engine=off in php.ini and in httpd.conf as per vhost I add the following 
php_flag engine on. Since I upgraded to Apache 2.0.36 and php 4.2.1 it 
breaks the apache and complains that there is type mistake. I changed it 
from php_flag to php_value but no help at all.
My workaround was to comment the lines in conf.d/php.conf that handle the 
php files through the php module and to add them per vhost and it 
worked. Also I tested the old AddType and it is working too.
Regards

-- 
Sameh Attia
Senior System Engineer
T.E. Data
--
__  __  _
_ _/ /_/ /_(_)___ _
   / ___/ __ `/ __/ __/ / __ `/
  (__  ) /_/ / /_/ /_/ / /_/ /
//\__,_/\__/\__/_/\__,_/


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




RE: [PHP] PHP and Date()

2002-07-18 Thread Jay Blanchard

[snip]
How can I look back Business Days.
I would like to go back from a certain date, like 7 business days. Is there
a simple way other then looping and checking for the day of the week?
[/snip]

$sevendaysago = date(Y-m-d, mktime(date(h)-168));

This will give you the date exactly seven days ago, then you can test what
day (Mon - Fri). If it is Saturday then you could subtract 24 more hours, if
Sunday, 48 more hours.

HTH!

Jay

Of all the things I’ve lost, I miss my mind the most

*
* Want to meet other PHP developers *
* in your area? Check out:  *
* http://php.meetup.com/*
* No developer is an island ... *
*



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




[PHP] Re: Cookies - good or bad???

2002-07-18 Thread Kondwani Spike Mkandawire

Awesome Scott...  That's some wicked code...
Scott Fletcher [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Instead of Cookies, I use Sessions which is run on hte server side.  So, I
 use the

 --snip--
   $salt = strtoupper(md5(uniqid(rand(;
   session_id($salt);
   session_start();
   header(Location:
https://xxx.yyy.zzz/index.php?.SID.init_login=TRUE;);
 --snip--

 to create the identifer for an unique person.  Then use the php script
that
 take care of the session management such as logging the user out when time
 is up as an example.  Another script was used to prevent the direct access
 attempt.  Another script was used to detect whether the server have the
 user's identifier in the server, if not exist then would force the web
 browser to the login page.

 As for the newbie, well, sometime they had to learn it from the pro.
 Although it would be nice if there is documentation somewhere.


 Cord Schneider [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Phpcoder [EMAIL PROTECTED] wrote in message
  [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
   I'm really battling with this whole session thing.
   My first impressions are that cookies are OK, and really helps to make
   sessions workable and efficient, YET, from a developers point of view,
I
  [..snip..]
   Does anyone out there have a view/practise when it comes to
   session/cookies? - basically I am still not convinced that using
   sessions/cookies is a good idea, but I would love to be educated as to
   why I should...
 
  A number of people have offered their opinion why cookies are a bad
idea.
 As
  a developer new to PHP, if cookies are such a big a big no-no, how does
 one
  do effective session management without storing anything client-side??
 Bear
  in mind that the browser is stateless and, the user can disconnect and
  reconnect in between fetching pages from your site.
 
  Regards,
  Cord
 
 
 





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




[PHP] Cannot parse html pages in php

2002-07-18 Thread Keith Roberts

I am running into a situation where I need some serious help.  My
environment is:

Workstation - W2k, Frontpage
Server - Cobalt RaQ4i, Linux, Apache

Problem:  I need to access MySQL to display inventory information on the web
page.  When I have modified the httpd.conf file to parse html files through
php, the embedded php code works.  However, FrontPage no longer works and a
Web statisics application will not work (Webalizer).  I know I am not
setting something correctly, but dang if I know what it is.

I really need some help on this.  Please realize that I am relatively new to
internet programming, linux, php, etc.  I have done okay so far, but this is
beyond me at this point.  Any help will be greatly appreciated.



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




[PHP] Cannot parse html pages in php

2002-07-18 Thread Keith Roberts

I am running into a situation where I need some serious help.  My
environment is:

Workstation - W2k, Frontpage
Server - Cobalt RaQ4i, Linux, Apache

Problem:  I need to access MySQL to display inventory information on the web
page.  When I have modified the httpd.conf file to parse html files through
php, the embedded php code works.  However, FrontPage no longer works and a
Web statisics application will not work (Webalizer).  I know I am not
setting something correctly, but dang if I know what it is.

I really need some help on this.  Please realize that I am relatively new to
internet programming, linux, php, etc.  I have done okay so far, but this is
beyond me at this point.  Any help will be greatly appreciated.





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




[PHP] php and html

2002-07-18 Thread Keith Roberts

I am running into a situation where I need some serious help.  My
environment is:

Workstation - W2k, Frontpage
Server - Cobalt RaQ4i, Linux, Apache

Problem:  I need to access MySQL to display inventory information on the web
page.  When I have modified the httpd.conf file to parse html files through
php, the embedded php code works.  However, FrontPage no longer works and a
Web statisics application will not work (Webalizer).  I know I am not
setting something correctly, but dang if I know what it is.

I really need some help on this.  Please realize that I am relatively new to
internet programming, linux, php, etc.  I have done okay so far, but this is
beyond me at this point.  Any help will be greatly appreciated.






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




[PHP] php and html

2002-07-18 Thread Keith Roberts

I am running into a situation where I need some serious help.  My
environment is:

Workstation - W2k, Frontpage
Server - Cobalt RaQ4i, Linux, Apache

Problem:  I need to access MySQL to display inventory information on the web
page.  When I have modified the httpd.conf file to parse html files through
php, the embedded php code works.  However, FrontPage no longer works and a
Web statisics application will not work (Webalizer).  I know I am not
setting something correctly, but dang if I know what it is.

I really need some help on this.  Please realize that I am relatively new to
internet programming, linux, php, etc.  I have done okay so far, but this is
beyond me at this point.  Any help will be greatly appreciated.








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




RE: [PHP] php and html

2002-07-18 Thread Jay Blanchard

[snip]
I am running into a situation where I need some serious help.  My
environment is:

Workstation - W2k, Frontpage
Server - Cobalt RaQ4i, Linux, Apache

Problem:  I need to access MySQL to display inventory information on the web
page.  When I have modified the httpd.conf file to parse html files through
php, the embedded php code works.  However, FrontPage no longer works and a
Web statisics application will not work (Webalizer).  I know I am not
setting something correctly, but dang if I know what it is.

I really need some help on this.  Please realize that I am relatively new to
internet programming, linux, php, etc.  I have done okay so far, but this is
beyond me at this point.  Any help will be greatly appreciated.
[/snip]

Ahem ... we got it the first time... :^]

What exactly did you modify in httpd.conf?

Jay

Vegetarian: primitive word for lousy hunter 

*
* Want to meet other PHP developers *
* in your area? Check out:  *
* http://php.meetup.com/*
* No developer is an island ... *
*





--
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: Cookies - good or bad???

2002-07-18 Thread Scott Fletcher

Well, I have to have to it becuase my company is a credit report reseller.
I can't image if someone can easily break in.  :-)  As long as I don't work
for CIA or FBI then I'll be fine!

Kondwani Spike Mkandawire [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Awesome Scott...  That's some wicked code...
 Scott Fletcher [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Instead of Cookies, I use Sessions which is run on hte server side.  So,
I
  use the
 
  --snip--
$salt = strtoupper(md5(uniqid(rand(;
session_id($salt);
session_start();
header(Location:
 https://xxx.yyy.zzz/index.php?.SID.init_login=TRUE;);
  --snip--
 
  to create the identifer for an unique person.  Then use the php script
 that
  take care of the session management such as logging the user out when
time
  is up as an example.  Another script was used to prevent the direct
access
  attempt.  Another script was used to detect whether the server have the
  user's identifier in the server, if not exist then would force the web
  browser to the login page.
 
  As for the newbie, well, sometime they had to learn it from the pro.
  Although it would be nice if there is documentation somewhere.
 
 
  Cord Schneider [EMAIL PROTECTED] wrote in message
  [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
   Phpcoder [EMAIL PROTECTED] wrote in message
   [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
I'm really battling with this whole session thing.
My first impressions are that cookies are OK, and really helps to
make
sessions workable and efficient, YET, from a developers point of
view,
 I
   [..snip..]
Does anyone out there have a view/practise when it comes to
session/cookies? - basically I am still not convinced that using
sessions/cookies is a good idea, but I would love to be educated as
to
why I should...
  
   A number of people have offered their opinion why cookies are a bad
 idea.
  As
   a developer new to PHP, if cookies are such a big a big no-no, how
does
  one
   do effective session management without storing anything client-side??
  Bear
   in mind that the browser is stateless and, the user can disconnect and
   reconnect in between fetching pages from your site.
  
   Regards,
   Cord
  
  
  
 
 





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




RE: [PHP] why my php can not get values from Form?

2002-07-18 Thread skeller

 I have just installed apache+php4, but my php can not get
 values from form?
 what's wrong?

Before you can use the variables, you have to make the accessible to PHP.
Try putting this at the top of your welcome.php file:


 ?
extract($HTTP_POST_VARS);
 ?






--
The Health TV Channel, Inc.
(a non - profit organization)
3820 Lake Otis Pkwy.
Anchorage, AK 99508
907.770.6200 ext.220
907.336.6205 (fax)
Web: www.healthtvchannel.org


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




Re: [PHP] PHP and Date()

2002-07-18 Thread Chris Crane

sorry about last message
I want to get a list of the last 7 business days so I would have to loop
through this and get each day correct?


Jay Blanchard [EMAIL PROTECTED] wrote in message
001701c22e78$4494c970$8102a8c0@niigziuo4ohhdt">news:001701c22e78$4494c970$8102a8c0@niigziuo4ohhdt...
 [snip]
 How can I look back Business Days.
 I would like to go back from a certain date, like 7 business days. Is
there
 a simple way other then looping and checking for the day of the week?
 [/snip]

 $sevendaysago = date(Y-m-d, mktime(date(h)-168));

 This will give you the date exactly seven days ago, then you can test what
 day (Mon - Fri). If it is Saturday then you could subtract 24 more hours,
if
 Sunday, 48 more hours.

 HTH!

 Jay

 Of all the things I've lost, I miss my mind the most

 *
 * Want to meet other PHP developers *
 * in your area? Check out:  *
 * http://php.meetup.com/*
 * No developer is an island ... *
 *





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




Re: [PHP] Cookies - good or bad???

2002-07-18 Thread Justin French

on 18/07/02 11:38 PM, PHPCoder ([EMAIL PROTECTED]) wrote:

 What are the general feeling out there amongst developers about the use
 of cookies?

If you want to assure that you maintain session across the whole site,
appealing to the lowest common denominator, then hard code the SID to all
relative URLs across the whole site, or write a URL function which you can
just pass variables:

A HREF=?=link('page.php?stuff=things')?Click here/a


 I'm concerned about the following scenario specifically:
 I develop my great application using session controll - which uses
 cookies by default, or alternatively adds the sid to the relative URL's
 on the page, YET, from responses to my previous posting, I gather that
 the alternative url method is not 100% the same as the cookie method
 inthat it doesn't work with IFRAMES etc.

I should've clarified that statement a bit... I had a dig through the PHP
source, trying to figure out what they were doing, and amongst the tags I
*think* they were searching for, I couldn't see IFRAMEs... perhaps what they
were doing with FRAME covered it -- I didn't dig deep enough, and haven't
recompiled to test.


 Leaving me to think that there
 will potentially be people out there that will NOT be able to use the
 application, that could lead to messy discussions between developer and
 client...

Yup.  Developer should perhaps offer the two alternatives, clearly outline
the difference, and make an estimate of the difference in cost.  Let THEM
decide if losing 1% (or 5%, or 10% -- whatever) of their users is
acceptable, rather than resting it upon your shoulders.

Same argument stands for relying on javascript, IFRAMEs, FRAMEs, whatever.


 Before I started to read up on sessions, I simply used my own form of
 session management by sending all relevant variables either via URL or
 via form fields to the subsequent pages. Obviously this method leaves a
 bunch of holes as well, but I KNOW that my application is always pure
 and simple HTML, doesn't have browser issues, doesn't have cookie
 issues, so 100% of the internet community can use it.

Well, if you're used to passing stuff around in a URL, then why not:

a) run some tests with enable-trans-sid
b) develop a method you're comfortable with for passing SIDs around in the
URL

 Does anyone out there have a view/practise when it comes to
 session/cookies? - basically I am still not convinced that using
 sessions/cookies is a good idea, but I would love to be educated as to
 why I should...

If you want 100% accessability, forget cookies were ever invented :)
While you're erasing stuff from your brain, throw out javascript too :D


Justin French

Creative Director
http://Indent.com.au



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




[PHP] Re: Cannot parse html pages in php

2002-07-18 Thread Kondwani Spike Mkandawire

Keith Roberts [EMAIL PROTECTED] wrote in message
006401c22e78$a71723e0$48b5913f@Operator1">news:006401c22e78$a71723e0$48b5913f@Operator1...
 I am running into a situation where I need some serious help.  My
 environment is:

 Workstation - W2k, Frontpage
 Server - Cobalt RaQ4i, Linux, Apache

 Problem:  I need to access MySQL to display inventory information on the
web
 page.  When I have modified the httpd.conf file to parse html files
through
 php, the embedded php code works.  However, FrontPage no longer works and
a
 Web statisics application will not work (Webalizer).  I know I am not
 setting something correctly, but dang if I know what it is.

 I really need some help on this.  Please realize that I am relatively new
to
 internet programming, linux, php, etc.  I have done okay so far, but this
is
 beyond me at this point.  Any help will be greatly appreciated.

Do you have access to the Server Settings i.e. were you doing this yourself?
If so it might be wise to install PHP as an Apache Module (if you haven't
already done so) - things tend to work much smoother...  Secondly
- not trying to offend you or be conceited but I have to ask this coz no one
on these groups can guess the others comptency level in a particular
aspect -
are you using Front Page simply as an easy non-programmer-type style to
create
your pages or are you using the coding aspect to it (with line number list
and
all), if you are using it the former this won't work...  You may also want
to
check whether files with extension php are set to viewable in Front Page,
I believe this is under Tools...  I personally wouldn't recommend using
Front Page to create PHP ran Web Applications (but that might be coz
I am slow to pickup on how MS products operate)...

Good Luck...
Spike




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




[PHP] Check for Associative Array

2002-07-18 Thread Henning Sittler

What's the best way to check for an Associative Array?  There is no
is_assoc() or similiar function listed in the manual (I don't think anyway).

I'm using mysql_fetch_array() and I want to foreach only the assoc. part of
the array without using mysql_fetch_assoc():

foreach ($arr as $key=$value) { 
echo $key:$value;
}

But of course it show both the indexed array and the assoc array contents.
Is there an existing function to check this, or should I do one of these
things inside the foreach loop:

A) set $last=value and just check if $value = $lastval

B) check if the $key is just a number or just a string

C) $key += 1


?? Thanks,


Henning Sittler
www.inscriber.com

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




Re: [PHP] Code errors

2002-07-18 Thread Analysis Solutions

On Thu, Jul 18, 2002 at 11:35:55AM -0400, Chris Crane wrote:
 Hey thank Dan, I will try this.
 Does List waste lots of time and memory?

It does if you don't need to do it.

Just put the data you really need into memory.  Forget about the rest.

If you already have something in memory, don't duplicate it.


 Normally, I create a function and global a bunch of variables to be used
 later on the HTML/PHP file.

If you're globaling the variables, why not just write the code without
enclosing it in a function?


 After I global the variables I split the string
 using the List function. I do that for stock quotes from YAHOO so I can code
 the layout in like Dreamweaver and place the varaibles where I would like
 instead of the function writing out the html for me. Is that bad?

In general, it makes sense, but, does it make the most sense.  Depends on 
the situation.

But, in this situation, you're printing out a whole table of the data, so
your way doesn't make sense.

A: No.
Q: Is okay to top post and/or quote the entirety of the a post?

--Dan

-- 
   PHP classes that make web design easier
SQL Solution  |   Layout Solution   |  Form Solution
sqlsolution.info  | layoutsolution.info |  formsolution.info
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

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




RE: [PHP] PHP and Date()

2002-07-18 Thread Jay Blanchard

[snip]
sorry about last message
I want to get a list of the last 7 business days so I would have to loop
through this and get each day correct?
[/snip]

Yes, testing for Saturday and Sunday ...

Jay

Vampires Suck 

*
* Want to meet other PHP developers *
* in your area? Check out:  *
* http://php.meetup.com/*
* No developer is an island ... *
*


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




Re: [PHP] php.ini problem

2002-07-18 Thread Analysis Solutions

On Thu, Jul 18, 2002 at 12:55:34PM -0300, Andre wrote:

 The configuration in php.ini seems not to be used by httpd.

Make a script with phpinfo() in it and examine which php.ini file is being 
used.  Sounds like you may be accessing the wrong file, even though you're 
saying you're not.


 I've traced my httpd process and it opens the php.ini file in the expected 
 directory, but variables set in there don't take effect (e.g. engine=On, 
 display_errors=Off, etc.).

Are you making the changes in php.ini and _then_ restarting Apache?  If 
not, you need to.

--Dan

-- 
   PHP classes that make web design easier
SQL Solution  |   Layout Solution   |  Form Solution
sqlsolution.info  | layoutsolution.info |  formsolution.info
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

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




Re: [PHP] Re: Cookies - good or bad???

2002-07-18 Thread Justin French

on 19/07/02 1:19 AM, Cord Schneider ([EMAIL PROTECTED]) wrote:

 A number of people have offered their opinion why cookies are a bad idea. As
 a developer new to PHP, if cookies are such a big a big no-no, how does one
 do effective session management without storing anything client-side?? Bear
 in mind that the browser is stateless and, the user can disconnect and
 reconnect in between fetching pages from your site.

You pass the session around in the URL

Something like A HREF=page.php?SIDclick here/a, or you might build a
wrapper function that does it for you:

A HREF=?=link('page.php')?click here/a.


Yes, that's every internal (relative) URL on your whole site :)


It becomes a trade-off between the convent but unreliable cookies, versus
the 100% accessible, but perhaps time consuming/tricky URL method.


As has been said on this list MANY times, just have a look at the big sites
like amazon.com -- no cookies, no javascript, no reliance on client-side for
anything.  Take care of it all server-side, where you have a controlled
environment.


Justin French


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




Re: [PHP] Check for Associative Array

2002-07-18 Thread Martin Clifford

Try this:

while($row = mysql_fetch_assoc($result)) {
// code here
}

This way, the resulting array will ONLY be associative.

HTH!

Martin Clifford
Homepage: http://www.completesource.net
Developer's Forums: http://www.completesource.net/forums/


 Henning Sittler [EMAIL PROTECTED] 07/18/02 12:57PM 
What's the best way to check for an Associative Array?  There is no
is_assoc() or similiar function listed in the manual (I don't think anyway).

I'm using mysql_fetch_array() and I want to foreach only the assoc. part of
the array without using mysql_fetch_assoc():

foreach ($arr as $key=$value) { 
echo $key:$value;
}

But of course it show both the indexed array and the assoc array contents.
Is there an existing function to check this, or should I do one of these
things inside the foreach loop:

A) set $last=value and just check if $value = $lastval

B) check if the $key is just a number or just a string

C) $key += 1


?? Thanks,


Henning Sittler
www.inscriber.com 

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



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




Re: [PHP] apache.conf for php

2002-07-18 Thread Jason Wong

On Thursday 18 July 2002 23:58, Scott Fletcher wrote:
 I recently upgraded Apache to 1.3.26 and am currently configurating hte
 httpd.conf.  I noticed that

 --snip--
 AddType application/x-httpd-php .php
 AddType application/x-httpd-php-source .phps
 --snip--

 does not exist in this version as it does in the older version.

Because someone or something inserted those lines in the older version.

 Is it now automatic with the newer version??

You still need those lines in the newer version if you want PHP to work.

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
Insomnia isn't anything to lose sleep over.
*/


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




RE: [PHP] Check for Associative Array

2002-07-18 Thread Henning Sittler

Ya, except I want the whole array to exist (index and assoc. array), not
just the assoc. array.  So, for the time being, I'll just do this:

foreach ($arr as $key=$value) { 
  if ( !is_int($key) ) { echo $key:$value; }
}

What is HTH ??

Henning Sittler
www.inscriber.com



Try this:

while($row = mysql_fetch_assoc($result)) {
// code here
}

This way, the resulting array will ONLY be associative.

HTH!

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




Re: [PHP] Check for Associative Array

2002-07-18 Thread Jason Wong

On Friday 19 July 2002 01:19, Martin Clifford wrote:
 Try this:

 while($row = mysql_fetch_assoc($result)) {
 // code here
 }

 This way, the resulting array will ONLY be associative.

For some unknown reason the OP specifically does not want to use 
mysql_fetch_assoc()!

 I'm using mysql_fetch_array() and I want to foreach only the assoc. part of
 the array without using mysql_fetch_assoc():


-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
People are beginning to notice you.  Try dressing before you leave the house.
*/


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




Re: [PHP] Check for Associative Array

2002-07-18 Thread Martin Clifford

Oh well.  And HTH means Hope to Help.

 For some unknown reason the OP specifically does not want to use 
 mysql_fetch_assoc()!

Martin Clifford
Homepage: http://www.completesource.net
Developer's Forums: http://www.completesource.net/forums/



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




Fwd: [PHP] php.ini problem

2002-07-18 Thread Andre


Thank you for everyone who helped me.
The problem was a php.ini file in the root (/) directory, PHP 4.2.1 was using 
that file instead of the one configured 
(--with-config-file-path=/usr/local/apache/conf).

--  Forwarding  --

Subject: [PHP] php.ini problem
Date: Thu, 18 Jul 2002 12:55:34 -0300
From: Andre [EMAIL PROTECTED]
To: [EMAIL PROTECTED]

Apache 1.3.26
PHP 4.2.1 staticly built as a module.

The configuration in php.ini seems not to be used by httpd.
I've traced my httpd process and it opens the php.ini file in the expected
directory, but variables set in there don't take effect (e.g. engine=On,
display_errors=Off, etc.).
I had PHP 4.1.1 running here before, and it used to work, PHP 4.2.1 has been
built with exactly the same options that I used to build PHP 4.1.1.
What could have I missed?


--
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] Check for Associative Array

2002-07-18 Thread Kevin Stone

foreach ($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
//...
}

Is this what you need?
http://www.php.net/manual/en/function.mysql-fetch-array.php

-Kevin

- Original Message -
From: Henning Sittler [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, July 18, 2002 10:57 AM
Subject: [PHP] Check for Associative Array


 What's the best way to check for an Associative Array?  There is no
 is_assoc() or similiar function listed in the manual (I don't think
anyway).

 I'm using mysql_fetch_array() and I want to foreach only the assoc. part
of
 the array without using mysql_fetch_assoc():

 foreach ($arr as $key=$value) {
 echo $key:$value;
 }

 But of course it show both the indexed array and the assoc array contents.
 Is there an existing function to check this, or should I do one of these
 things inside the foreach loop:

 A) set $last=value and just check if $value = $lastval

 B) check if the $key is just a number or just a string

 C) $key += 1


 ?? Thanks,


 Henning Sittler
 www.inscriber.com

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



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




Re: [PHP] ErrorDocument 404 Form

2002-07-18 Thread Peter

If you removed the
ErrorDocument 404 /phpinfo.php
from the apache conf (or reset it to original value), what happens? Do you
get a standard 404 not found error page?


Fabien Penso [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

 Matt a écrit :

   Well it still is in GET method because the url does still exist with
the
   ?plop=foobar but in case I want to use POST method (which I will as my
   form has huge textarea) everything disappear.
   Also this is a turn around I don't like, I would first understand why
it
   doesn't work, and if I can fix it.

   I  browsed the the apache source, and it looks to me that the message
body
   is simply read and dumped into the bit bucket on a 404 with an
ErrorDocument
   (and thus isn't passed as part of the internal request to the
ErrorDocument
   itself).  Perhaps you ought to ask the apache list.

 Apparently, as I do read
 http://www.geocrawler.com/archives/3/182/1999/4/0/1646542/, it's an
 Apache problem.

 Thanks, I move on an Apache user list :)

 --
 Fabien Penso [EMAIL PROTECTED] | LinuxFr a toujours besoin de :
 http://perso.LinuxFr.org/penso/  | http://linuxFr.org/dons/



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




Re: [PHP] Cookies - good or bad???

2002-07-18 Thread Alberto Serra

ðÒÉ×ÅÔ!

PHPCoder wrote:
 application useless unless I code a plan B into my code; meaning I can 
 just as well NOT use cookies from the start...
 catch 22 dejavu...
 What are the general feeling out there amongst developers about the use 
 of cookies?
--snip--
 I gather that 
 the alternative url method is not 100% the same as the cookie method 
 inthat it doesn't work with IFRAMES etc. Leaving me to think that there 
 will potentially be people out there that will NOT be able to use the 
 application, that could lead to messy discussions between developer and 
 client...

We use but one cookie, for returning user recognition. That is, the sort 
of info your soft can survive without. As for passing values on the GET 
channel to iframes, we do it all the time and have never seen a single 
problem.

Problems with iframes are in that you consciously loose all users 
working on Netscape 4 (once you have 7 interrelated iframes on a window 
you cannot really expect to have 7 indipendent windows open *and* your 
site still usable. Lynx people are cut out too. If you want to support 
*everybody* you should work one one single page.

It's a customer's choice, obviously. Most customers do not give a damn 
about minorities (and so do not want to increase budgets to develop an 
alternate solution that will address a minor community).

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×


-_=}{=_-@-_=}{=_--_=}{=_-@-_=}{=_--_=}{=_-@-_=}{=_--_=}{=_-

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] Check for Associative Array

2002-07-18 Thread Steve Edberg

At 12:57 PM -0400 7/18/02, Henning Sittler wrote:
What's the best way to check for an Associative Array?  There is no
is_assoc() or similiar function listed in the manual (I don't think anyway).


No, because AFAIK all PHP arrays are associative; there is no 
distinction between arrays  hashes as in Perl.


I'm using mysql_fetch_array() and I want to foreach only the assoc. part of
the array without using mysql_fetch_assoc():

foreach ($arr as $key=$value) {
   echo $key:$value;
}


If you really don't want to use mysql_fetch_assoc(), you can use the 
second parameter of mysql_fetch_array():

$arr = mysql_fetch_array($ResultHandle, MYSQL_FETCH_ASSOC);

This functions exactly like mysql_fetch_assoc(), and is available in 
PHP = 3.0.7.

See

http://www.php.net/manual/en/function.mysql-fetch-array.php

for more info.


But of course it show both the indexed array and the assoc array contents.
Is there an existing function to check this, or should I do one of these
things inside the foreach loop:

A) set $last=value and just check if $value = $lastval

B) check if the $key is just a number or just a string

C) $key += 1


Lastly, you _could_ just step through the array using each() in a 
loop, and use only every OTHER array entry...but this is really funky 
and you shouldn't do it this way anymore.

-steve



?? Thanks,


Henning Sittler
www.inscriber.com



-- 
++
| Steve Edberg  [EMAIL PROTECTED] |
| University of California, Davis  (530)754-9127 |
| Programming/Database/SysAdmin   http://pgfsun.ucdavis.edu/ |
++
| The end to politics as usual:  |
| The Monster Raving Loony Party (http://www.omrlp.com/) |
++

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




[PHP] rebooting linux using php

2002-07-18 Thread Harpreet Kaur


Can we reboot a linux server using a php page? And is it recommended?

Regards,
Harpreet Kaur


_
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com


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




Re: [PHP] rebooting linux using php

2002-07-18 Thread John S. Huggins

On Thu, 18 Jul 2002, Harpreet Kaur wrote:

-
-Can we reboot a linux server using a php page?

Yes.

-And is it recommended?

No.

-
-Regards,
-Harpreet Kaur
-
-
-_
-Join the world’s largest e-mail service with MSN Hotmail. 
-http://www.hotmail.com
-
-
--- 
-PHP General Mailing List (http://www.php.net/)
-To unsubscribe, visit: http://www.php.net/unsub.php
-

**

John Huggins
VANet

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

**


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




Re: [PHP] Re: Cookies - good or bad???

2002-07-18 Thread Scott Fletcher

I never heard of this php function, link().  Sound like a good function,
I'm going to have to look it up!

Thanks,
 FletchSOD
Justin French [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 on 19/07/02 1:19 AM, Cord Schneider ([EMAIL PROTECTED]) wrote:

  A number of people have offered their opinion why cookies are a bad
idea. As
  a developer new to PHP, if cookies are such a big a big no-no, how does
one
  do effective session management without storing anything client-side??
Bear
  in mind that the browser is stateless and, the user can disconnect and
  reconnect in between fetching pages from your site.

 You pass the session around in the URL

 Something like A HREF=page.php?SIDclick here/a, or you might build a
 wrapper function that does it for you:

 A HREF=?=link('page.php')?click here/a.


 Yes, that's every internal (relative) URL on your whole site :)


 It becomes a trade-off between the convent but unreliable cookies, versus
 the 100% accessible, but perhaps time consuming/tricky URL method.


 As has been said on this list MANY times, just have a look at the big
sites
 like amazon.com -- no cookies, no javascript, no reliance on client-side
for
 anything.  Take care of it all server-side, where you have a controlled
 environment.


 Justin French




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




Re: [PHP] rebooting linux using php

2002-07-18 Thread Scott Fletcher

This can be done using the exec() function, the php.net doc will explain how
it work.  There are a few known problem as I can see if someone try to
reboot the Linux/Unix.

1) If the hacker break-in and take control of hte script.  Who know what
could have happen.

2) If using encryption and use passphrase to start up Apache, it is a
darn problem getting the passphrase be entered automatically.

3) If people are online to that one website and the machine reboot,
everyone would get cut off of that website.

FletchSOD

John S. Huggins [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
On Thu, 18 Jul 2002, Harpreet Kaur wrote:

-
-Can we reboot a linux server using a php page?

Yes.

-And is it recommended?

No.

-
-Regards,
-Harpreet Kaur
-
-
-_
-Join the world's largest e-mail service with MSN Hotmail.
-http://www.hotmail.com
-
-
---
-PHP General Mailing List (http://www.php.net/)
-To unsubscribe, visit: http://www.php.net/unsub.php
-

**

John Huggins
VANet

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

**




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




[PHP] spawning scripts to different graphical targets

2002-07-18 Thread Alberto Serra

ðÒÉ×ÅÔ!

Is there a way I can decide where to target my output from server side?

suppose my page has two iframes

+---++---+
! A !! b !
+---++---+

while executing a script that is called by A can I spawn another script 
that will output to b? And no, I cant' use any Jscript, but I do know 
from server side what my target names are (A and b, that is).

Bear in mind that A and b might be even different windows, but I'd more 
than happy even if it worked with iframes on a single window.

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×

-_=}{=_-@-_=}{=_--_=}{=_-@-_=}{=_--_=}{=_-@-_=}{=_--_=}{=_-

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




  1   2   3   >