[PHP] Display mail

2002-05-11 Thread Uma Shankari T.



Hello,


  Can anyone please tell me is there any to display the mails like mailing
archieve, in one of the folder in Pine..



Regards,
Uma


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




Re: [PHP] Display mail

2002-05-11 Thread Miguel Cruz

On Sat, 11 May 2002, Uma Shankari T. wrote:
 Can anyone please tell me is there any to display the mails like mailing
 archieve, in one of the folder in Pine..

Open the file with fopen and read through it at your leisure. Every time
you come across a line that starts with From  (From followed by a
space), that's a new message.

miguel


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




Re: [PHP] Using function in PHP script n DOCROOT in PHP script insubfolder

2002-05-11 Thread Miguel Cruz

  http://php.net/ini_set

miguel

On Sat, 11 May 2002, Phil Powell wrote:
 I can't alter php.ini as this is occurring on a remote site (not on my own
 site).  :(
 
 Phil
 
 - Original Message -
 From: Miguel Cruz [EMAIL PROTECTED]
 To: Phil Powell [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Sent: Friday, May 10, 2002 11:08 PM
 Subject: Re: [PHP] Using function in PHP script n DOCROOT in PHP script in
 subfolder
 
 
  On Fri, 10 May 2002, Phil Powell wrote:
   How do I fix this problem? I do not want to duplicate the PHP script per
   folder as there will be an enormous amount of dynamically-created
 subfolders
   and I will have to copy a version per folder.  I want to be able to use
 the
   one PHP script in the DOCROOT for every PHP script in every subfolder,
 how
   is this done?
 
  Check out the include_path directive in php.ini (or .htaccess or
  whatever).
 
  miguel
 
 
 
 


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




[PHP] protecting downloads with php

2002-05-11 Thread Nick Wilson

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi all
I've been asked to protect an area containing 'course material' (pdf's
etc) and have just thought of a gaping hole in what I've done.

I use an class to handle all the auth stuff and each page checks the
value of $obj-logged_in :: No problem.

but what if someone links to www.thesite/theProtectedArea/file.tar.gz

that file cannot check if the downloader is logged in can it.

So, any suggestions or words of wisdom would be much appreciated :-)

- -- 
Nick Wilson //  www.explodingnet.com



-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)

iD8DBQE83N09HpvrrTa6L5oRAlSZAJwNVHXfeP3w8aaJTtRUmPH2v/nvNwCfaqp4
HpXVvWLn87rkhCQxnBtszAc=
=St/c
-END PGP SIGNATURE-

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




Re: [PHP] protecting downloads with php

2002-05-11 Thread Miguel Cruz

On Sat, 11 May 2002, Nick Wilson wrote:
 I've been asked to protect an area containing 'course material' (pdf's
 etc) and have just thought of a gaping hole in what I've done.
 
 I use an class to handle all the auth stuff and each page checks the
 value of $obj-logged_in :: No problem.
 
 but what if someone links to www.thesite/theProtectedArea/file.tar.gz
 
 that file cannot check if the downloader is logged in can it.

download.php:

  ?

  if (userIsAuthorized)
  {
 header('Content-Type: application/x-gzip');
 readfile('secret-name-of-file.tar.gz');
 exit;
  }
  else
  {
 print 'You are not authorized to download this file.';
  }

?

Season to taste with GET arguments such as an ID number or other hash
identifying which file to send.

miguel


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




Re: [PHP] protecting downloads with php

2002-05-11 Thread Nick Wilson

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


* and then Miguel Cruz declared
  I use an class to handle all the auth stuff and each page checks the
  value of $obj-logged_in :: No problem.
  
  but what if someone links to www.thesite/theProtectedArea/file.tar.gz
  
  that file cannot check if the downloader is logged in can it.
 
 download.php:
 
   ?
 
   if (userIsAuthorized)
   {
  header('Content-Type: application/x-gzip');
  readfile('secret-name-of-file.tar.gz');
  exit;
   }
   else
   {
  print 'You are not authorized to download this file.';
   }
 
 ?

Fantastic, so simple!
Does anyone know of somewhere that lists content-type's?

Many thanks :-)
- -- 
Nick Wilson //  www.explodingnet.com



-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)

iD8DBQE83OgUHpvrrTa6L5oRAkdEAJ4wwvkgfRAXYNqg+Cf4uuwZDz8mOACdE091
do6OoY5f2HoTiRM3sGGFSeQ=
=Cirg
-END PGP SIGNATURE-

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




Re: [PHP] Re: Debugger

2002-05-11 Thread Jose Leon

Hello:
 He said php -l will let you know where your syntax errors are.
And what this has to do with my question? I was asking for a debugger, 
not for an error report. I want a mechanism to debug php programs step 
by step, watch variables and so on.

Regards.


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




Re: [PHP] Re: Debugger

2002-05-11 Thread Jose Leon

Hello:
 I think the OP has already looked at it, and wanted something 
 better :)

Yes, that's right, but I'm not saying dbg isn't good, I just said is 
too much complicated (AFAIK):
-Must have a listener running
-Use COM to interface with it
-User installation too hard:
 Change php.ini to load the extension
 Keep track of the php version and the extension version

I really like the Komodo solution, just copy a dll and it changes the 
php.ini for you. But I still must keep track of the PHP version.

It would be nice that php itself incoporates a system to debug php 
programs, like in PHP 3, in that way a development tool for php would 
be enabled to debug modifying the php.ini with debug.enabled=true and 
listening to a port. The system will work on any php distribution 
because will be part of php itself. Why the debugger was removed from 
PHP 3?

Regards.



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




[PHP] Uploaded File OverWriting Old File

2002-05-11 Thread Thomas Edison Jr.

Hi,

If i have a filename room.jpg in my Upload
Directory, and someone else comes and uploads a file
by the same name, the previous room.jpg is
overwritten by the new one. Any suggestions?
This is the code i'm using :

?php

$db = mysql_connect(localhost,user,pwd);
mysql_select_db(dbname,$db);

if ($img1_name != ) {
$pic = yes; 
}
else {
$pic = no;
}

$date = date(l dS of F Y h:i:s A);

// if $img_name isn't empty, try to copy the file
if (($img1_name != ) and ($img1_size = 256000)
and ($img1_type == image/pjpeg) or ($img1_type ==
image/jpeg)) {
$sql = INSERT INTO tablename
(name,age,gender,country,email,date,profile,looking,pic_name,pic)
VALUES
('$name','$age','$gender','$country','$email','$date','$profile','$looking','$img1_name','$pic');
$result = mysql_query($sql) or die(You made a
mistake, please go back and try again);
copy($img1, mjpalpics/$img1_name)
or Die (Could not do);
} 
?

Thank you for adding you details. The following has
been added to the Database :brbr
big
?php

$profile = stripslashes($profile);
$looking = stripslashes($looking);

echo (
Name : $namebr
Age : $agebr
Gender : $genderbr
Country : $countrybr
Email : $emailbr
Your Profile : $profilebr
You are looking for : $lookingbr
);

if (($img1_size = 256000) and ($img1_type ==
image/pjpeg) or ($img1_type == image/jpeg)) {

echo 
Your Photo : iName - $img1_name | Size - $img1_size
| MIME Type - $img1_type/i br
; 

}
else {
echo No photograph uploaded, or wrong Type/Size
photograph;
}
?

Thanks a LOT!
T. Edison jr.




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

__
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com

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




Re: [PHP] File Type not working in Uploaded File

2002-05-11 Thread Thomas Edison Jr.

Hi,

Ok there were a lot of mistakes in that code. IN fact
i rubbed it off completely and am using a new code.. 

Everything works fine now, except that if the filename
exists, any new file with the same name overwrites the
old file.. What do i do about it?

Here is the code i'm using :

?php

$db = mysql_connect(localhost,user,pwd);
mysql_select_db(dbname,$db);

if ($img1_name != ) {
$pic = yes; 
}
else {
$pic = no;
}

$date = date(l dS of F Y h:i:s A);

// if $img_name isn't empty, try to copy the file
if (($img1_name != ) and ($img1_size = 256000)
and ($img1_type == image/pjpeg) or ($img1_type ==
image/jpeg)) {
$sql = INSERT INTO mjpals
(name,age,gender,country,email,date,profile,looking,pic_name,pic)
VALUES
('$name','$age','$gender','$country','$email','$date','$profile','$looking','$img1_name','$pic');
$result = mysql_query($sql) or die(You made a
mistake, please go back and try again);
copy($img1, mjpalpics/$img1_name)
or Die (Could not do);
} 
?

Thank you for adding you details. The following has
been added to the Database :brbr
big
?php

$profile = stripslashes($profile);
$looking = stripslashes($looking);

echo (
Name : $namebr
Age : $agebr
Gender : $genderbr
Country : $countrybr
Email : $emailbr
Your Profile : $profilebr
You are looking for : $lookingbr
);

if (($img1_size = 256000) and ($img1_type ==
image/pjpeg) or ($img1_type == image/jpeg)) {

echo 
Your Photo : iName - $img1_name | Size - $img1_size
| MIME Type - $img1_type/i br
; 

}
else {
echo No photograph uploaded, or wrong Type/Size
photograph;
}
?


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

__
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com

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




Re: [PHP] Uploaded File OverWriting Old File

2002-05-11 Thread Nick Wilson

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


* and then Thomas Edison Jr. declared
 Hi,
 
 If i have a filename room.jpg in my Upload
 Directory, and someone else comes and uploads a file
 by the same name, the previous room.jpg is
 overwritten by the new one. Any suggestions?

Well, I presume that you would like for this *not* to happen right?

if so, just add a if(file_exist($img)) { change name of img.

I expect you could add an 1 to the end or better still, have the user
choose another name?

- -- 
Nick Wilson //  www.explodingnet.com



-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)

iD8DBQE83PEnHpvrrTa6L5oRApJlAJ9n3/jsPvej8U1DwjDQnED7wwp4FQCgjjGh
SO2IqQydOwy9zA0Q7TCd9no=
=xxgQ
-END PGP SIGNATURE-

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




Re: [PHP] Uploaded File OverWriting Old File

2002-05-11 Thread Thomas Edison Jr.

Hmm...

Tried it, and this doesn't sound too good :

Fatal error: Call to undefined function: file_exist()
in d:\apache
group\apache\htdocs\mjimm\mjpals_added.php on line 37

Basically this is what i added in the appropriate
place :

if(file_exist($img1_name)) {
$img1_name = $img1_name+n;
}

And thanks a lot..

Thus Spake T. Edison Jr. !!

--- Nick Wilson [EMAIL PROTECTED] wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 
 * and then Thomas Edison Jr. declared
  Hi,
  
  If i have a filename room.jpg in my Upload
  Directory, and someone else comes and uploads a
 file
  by the same name, the previous room.jpg is
  overwritten by the new one. Any suggestions?
 
 Well, I presume that you would like for this *not*
 to happen right?
 
 if so, just add a if(file_exist($img)) { change name
 of img.
 
 I expect you could add an 1 to the end or better
 still, have the user
 choose another name?
 
 - -- 
 Nick Wilson //  www.explodingnet.com
 
 
 
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.0.6 (GNU/Linux)
 

iD8DBQE83PEnHpvrrTa6L5oRApJlAJ9n3/jsPvej8U1DwjDQnED7wwp4FQCgjjGh
 SO2IqQydOwy9zA0Q7TCd9no=
 =xxgQ
 -END PGP SIGNATURE-
 
 -- 
 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!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com

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




Re: [PHP] Uploaded File OverWriting Old File

2002-05-11 Thread Nick Wilson

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


* and then Thomas Edison Jr. declared
 Hmm...
 
 Tried it, and this doesn't sound too good :
 
 Fatal error: Call to undefined function: file_exist()
 in d:\apache
 group\apache\htdocs\mjimm\mjpals_added.php on line 37

Sorry, it was a typo: Should be file_exists() 
Check it out in the manual: 
http://www.php.net/manual/en/function.file-exists.php

- -- 
Nick Wilson //  www.explodingnet.com



-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)

iD8DBQE83Pa4HpvrrTa6L5oRAlOuAJ4meFuxunwzNIIfYnXxNAoqQuhjwwCfSwn9
LuCbATQVtzhllC7YbV9cML0=
=PkOX
-END PGP SIGNATURE-

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




Re: [PHP] Uploaded File OverWriting Old File

2002-05-11 Thread Thomas Edison Jr.

Glory  Power!

I'm using the following code now... the Error is gone,
but it's still overwriting the old file. It's not
changing the name.. not doing anything, just uploading
this new file and replacing the old one.. 


?php

$db = mysql_connect(localhost,use,pwd);
mysql_select_db(dbname,$db);

if ($img1_name != ) {
$pic = yes; 
}
else {
$pic = no;
}

$date = date(l dS of F Y h:i:s A);

// if $img_name isn't empty, try to copy the file
if (($img1_name != ) and ($img1_size = 256000)
and ($img1_type == image/pjpeg) or ($img1_type ==
image/jpeg)) {
if(file_exists($img1_name)) {
$img1_name = n+$img1_name;
}
$sql = INSERT INTO mjpals
(name,age,gender,country,email,date,profile,looking,pic_name,pic)
VALUES
('$name','$age','$gender','$country','$email','$date','$profile','$looking','$img1_name','$pic');
$result = mysql_query($sql) or die(You made a
mistake, please go back and try again);
copy($img1, mjpalpics/$img1_name)
or Die (Could not do);
} 
elseif (($img1_name == ) and ($img1_size  256000)
and ($img1_type != image/pjpeg) or ($img1_type !=
image/jpeg)) {
$sql = INSERT INTO mjpals
(name,age,gender,country,email,date,profile,looking,pic_name,pic)
VALUES
('$name','$age','$gender','$country','$email','$date','$profile','$looking','','no');
$result = mysql_query($sql) or die(You made a
mistake, please go back and try again);
}
?

Thank you for adding you details. The following has
been added to the Database :brbr
big
?php

$profile = stripslashes($profile);
$looking = stripslashes($looking);

echo (
Name : $namebr
Age : $agebr
Gender : $genderbr
Country : $countrybr
Email : $emailbr
Your Profile : $profilebr
You are looking for : $lookingbr
);

if (($img1_size = 256000) and ($img1_type ==
image/pjpeg) or ($img1_type == image/jpeg)) {

echo 
Your Photo : iName - $img1_name | Size - $img1_size
| MIME Type - $img1_type/i br
; 

}
else {
echo No photograph uploaded, or wrong Type/Size
photograph;
}
?

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

__
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com

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




[PHP] using header ();

2002-05-11 Thread baldey_uk

Hi all,

Can someone tell me how to use the header function? Can i use it with
relative URLs for example:

header (Location:index2.php);

If i have that line somewhere in my script will the browser be automatically
taken there or do i have to echo it or something of the like? Thanks for any
help in advance!

Cheers From

baldey_uk



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




Re: [PHP] Uploaded File OverWriting Old File

2002-05-11 Thread Nick Wilson

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


* and then Thomas Edison Jr. declared
 Glory  Power!
 
 I'm using the following code now... the Error is gone,
 but it's still overwriting the old file. It's not
 changing the name.. not doing anything, just uploading
 this new file and replacing the old one.. 
 

Well, I don't see any thing in your code that denotes the directory the
images are going in? The idea is to check if 'path/to/img/img.jpg'
exists and if so, name the upload img to something else. 

I also don't see anything in you php about the 'tmp_name' etc? are you 
sure you understand how to upload images? there is a very good section 
in the manual on file uploads. (i just learnt it myself for a project)
- -- 
Nick Wilson //  www.explodingnet.com



-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)

iD8DBQE83Pp5HpvrrTa6L5oRAhYDAJ4ibvcPhX55WJ3HTtiz3rT20qK5TACfaEJ5
LuJKsZCN8TFmUQJFIzVMM14=
=meFO
-END PGP SIGNATURE-

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




Re: [PHP] using header ();

2002-05-11 Thread Nick Wilson

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


* and then baldey_uk declared
 Can someone tell me how to use the header function? Can i use it with
 relative URLs for example:
 
 header (Location:index2.php);

Have you tested it?
Come on, took me all of a minute and a half to try it out :-)
- -- 
Nick Wilson //  www.explodingnet.com



-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)

iD8DBQE83Ps5HpvrrTa6L5oRAlHPAJ0cAmrYVkoKlUir9pfGAsZZu8hD0QCfXA7+
tNRCFd2jt2VU5YQblmuJluM=
=j0VL
-END PGP SIGNATURE-

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




Re: [PHP] Uploaded File OverWriting Old File

2002-05-11 Thread Thomas Edison Jr.

Glory!

 Well, I don't see any thing in your code that
 denotes the directory the images are going in?

What about this :

copy($img1, mjpalpics/$img1_name) or Die (Could
not do);

Sends the images to the mjpalpics Directory!


 'path/to/img/img.jpg'
 exists and if so, name the upload img to something
 else. 

Hmm... possibly when i say
if(file_exists($img1_name)), he's looking for the file
name in the Directory where the Images initially go..
but then since i copy them elsewhere, they won't be in
the initial place.. and so he overwrites while
copying..Possibly! Don't know for sure. 

T. Edison Jr.






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

__
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com

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




RE: [PHP] using header ();

2002-05-11 Thread baldey_uk

Yes i have tested it thats why i am asking, as it is not working either way
for me, it just stays on the same screen but blanks the previous output to
the page.

Baldey_uk

-Original Message-
From: Nick Wilson [mailto:[EMAIL PROTECTED]]
Sent: 11 May 2002 12:07
To: Php-General
Subject: Re: [PHP] using header ();


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


* and then baldey_uk declared
 Can someone tell me how to use the header function? Can i use it with
 relative URLs for example:

 header (Location:index2.php);

Have you tested it?
Come on, took me all of a minute and a half to try it out :-)
- --
Nick Wilson //  www.explodingnet.com



-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)

iD8DBQE83Ps5HpvrrTa6L5oRAlHPAJ0cAmrYVkoKlUir9pfGAsZZu8hD0QCfXA7+
tNRCFd2jt2VU5YQblmuJluM=
=j0VL
-END PGP SIGNATURE-

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


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




Re: [PHP] using header ();

2002-05-11 Thread Nick Wilson

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


* and then baldey_uk declared
 Yes i have tested it thats why i am asking, as it is not working either way
 for me, it just stays on the same screen but blanks the previous output to
 the page.

Weird, works fine for me. Let's see the code.

- -- 
Nick Wilson // www.tioka.com



-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)

iD8DBQE83P06HpvrrTa6L5oRAg70AKCjl4NlTqVt0lBV9TChHXOP5blMOwCeKpDW
WDkFT7yFhGykBAozd0TKirY=
=LI4h
-END PGP SIGNATURE-

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




Re: [PHP] Uploaded File OverWriting Old File

2002-05-11 Thread Nick Wilson

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


* and then Thomas Edison Jr. declared
 Hmm... possibly when i say
 if(file_exists($img1_name)), he's looking for the file
 name in the Directory where the Images initially go..
 but then since i copy them elsewhere, they won't be in
 the initial place.. and so he overwrites while
 copying..Possibly! Don't know for sure. 

Well, check out the manual, you'll find good stuff there. and dot your
code with print($whatevers) to see whats going on.

- -- 
Nick Wilson // www.tioka.com



-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)

iD8DBQE83Pz7HpvrrTa6L5oRAi87AJ0aqEBYw/ii3CiBjZ6h/oFlRseWuQCeKkTG
NA6OVtmTrVU841aLkqnZwFI=
=k4Rg
-END PGP SIGNATURE-

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




Re: [PHP] Uploaded File OverWriting Old File

2002-05-11 Thread Thomas Edison Jr.

Well thanks a bunch!

--- Nick Wilson [EMAIL PROTECTED] wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 
 * and then Thomas Edison Jr. declared
  Hmm... possibly when i say
  if(file_exists($img1_name)), he's looking for the
 file
  name in the Directory where the Images initially
 go..
  but then since i copy them elsewhere, they won't
 be in
  the initial place.. and so he overwrites while
  copying..Possibly! Don't know for sure. 
 
 Well, check out the manual, you'll find good stuff
 there. and dot your
 code with print($whatevers) to see whats going on.
 
 - -- 
 Nick Wilson // www.tioka.com
 
 
 
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.0.6 (GNU/Linux)
 

iD8DBQE83Pz7HpvrrTa6L5oRAi87AJ0aqEBYw/ii3CiBjZ6h/oFlRseWuQCeKkTG
 NA6OVtmTrVU841aLkqnZwFI=
 =k4Rg
 -END PGP SIGNATURE-
 
 -- 
 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!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com

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




Re: [PHP] using header ();

2002-05-11 Thread Jason Wong

On Saturday 11 May 2002 19:10, baldey_uk wrote:
 Yes i have tested it thats why i am asking, as it is not working either way
 for me, it just stays on the same screen but blanks the previous output to
 the page.

 Baldey_uk

 -Original Message-
 From: Nick Wilson [mailto:[EMAIL PROTECTED]]
 Sent: 11 May 2002 12:07
 To: Php-General
 Subject: Re: [PHP] using header ();



 * and then baldey_uk declared

  Can someone tell me how to use the header function? Can i use it with
  relative URLs for example:
 
  header (Location:index2.php);

 Have you tested it?
 Come on, took me all of a minute and a half to try it out :-)

You need a space after the colon:

  header (Location: index2.php);

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

/*
Kennedy's Market Theorem:
Given enough inside information and unlimited credit,
you've got to go broke.
*/

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




RE: [PHP] using header ();

2002-05-11 Thread baldey_uk

Here ya go:

Basically im trying to update details in a database, after the new details
are put into a form they are printed to the screen with a 'are the details
correct' scenario. From there if they click 'no' i want them to be put back
to the updateaddress.php page but also pass two php variables back to that
page for use later on. If they say yes i will do mysql query calls and
update the database but also need to forward them to another php page and
pass varaible values to that new page
?

echo 'form method=postinput type=submit name=choice
value=yesnbsp;input type=submit name=choice value=no/form ';
switch($_POST['choice'])
{
case yes :
#somethin will happen here ;
break;

#if not we need to keep the customer_id and quantity and start again
case no :
echo 'INPUT type=hidden name=txtJars value='.$quantity.'INPUT
type=hidden name=txtCustomer_id value='.$customer_id.'';
header(Location: updateaddress.php);
exit;
}
?

Cheers

Baldey_uk


-Original Message-
From: Nick Wilson [mailto:[EMAIL PROTECTED]]
Sent: 11 May 2002 12:15
To: PHP-General
Subject: Re: [PHP] using header ();


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


* and then baldey_uk declared
 Yes i have tested it thats why i am asking, as it is not working either
way
 for me, it just stays on the same screen but blanks the previous output to
 the page.

Weird, works fine for me. Let's see the code.

- --
Nick Wilson // www.tioka.com



-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)

iD8DBQE83P06HpvrrTa6L5oRAg70AKCjl4NlTqVt0lBV9TChHXOP5blMOwCeKpDW
WDkFT7yFhGykBAozd0TKirY=
=LI4h
-END PGP SIGNATURE-

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


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




[PHP] Cookies

2002-05-11 Thread Nookie

Hi.

Is there any way to check is it cookies enabled browser?

Regards,
Szymon Kosok

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




Re: [PHP] Uploaded File OverWriting Old File

2002-05-11 Thread Jason Wong

On Saturday 11 May 2002 19:05, Thomas Edison Jr. wrote:
 Glory!

  Well, I don't see any thing in your code that
  denotes the directory the images are going in?

 What about this :

 copy($img1, mjpalpics/$img1_name) or Die (Could
 not do);

 Sends the images to the mjpalpics Directory!

  'path/to/img/img.jpg'
  exists and if so, name the upload img to something
  else.

 Hmm... possibly when i say
 if(file_exists($img1_name)), he's looking for the file
 name in the Directory where the Images initially go..
 but then since i copy them elsewhere, they won't be in
 the initial place.. and so he overwrites while
 copying..Possibly! Don't know for sure.

Possibly. But one thing that is definitely a problem is:

  if(file_exists($img1_name)) {
$img1_name = n+$img1_name;
  }

should be:

  if(file_exists($img1_name)) {
$img1_name = n . $img1_name;
  }

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

/*
I had the rare misfortune of being one of the first people to try and
implement a PL/1 compiler.
-- T. Cheatham
*/

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




Re: [PHP] using header ();

2002-05-11 Thread Jason Wong

On Saturday 11 May 2002 19:20, baldey_uk wrote:
 Here ya go:

 Basically im trying to update details in a database, after the new details
 are put into a form they are printed to the screen with a 'are the details
 correct' scenario. From there if they click 'no' i want them to be put back
 to the updateaddress.php page but also pass two php variables back to that
 page for use later on. If they say yes i will do mysql query calls and
 update the database but also need to forward them to another php page and
 pass varaible values to that new page
 ?

 echo 'form method=postinput type=submit name=choice
 value=yesnbsp;input type=submit name=choice value=no/form ';
   switch($_POST['choice'])
   {
   case yes :
   #somethin will happen here ;
   break;

   #if not we need to keep the customer_id and quantity and start again
   case no :
   echo 'INPUT type=hidden name=txtJars value='.$quantity.'INPUT
 type=hidden name=txtCustomer_id value='.$customer_id.'';

No point having the above echo()s ...

   header(Location: updateaddress.php);

... if you use a header() you cannot output anything beforehand. See manual. 
You need to change the flow of your script so that it makes the decisions 
then output or redirect as necessary.

To pass the variables back to the updateaddress.php page do:

header(Location: 
updateaddress.php?txtJars=$quantitytxtCustomer_id=$customer_id);

if $quantity and $customer_id contain some funny chars you should run it 
through urlencode().

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

/*
QOTD:
I am not sure what this is, but an 'F' would only dignify it.
*/

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




Re: [PHP] Cookies

2002-05-11 Thread Jason Wong

On Saturday 11 May 2002 19:20, Nookie wrote:
 Hi.

 Is there any way to check is it cookies enabled browser?

Set a cookie then try to read it, if it fails then cookies are disabled. This 
needs to be done using 2 pages, one to set, the 2nd to read. Or you can use 
the same page, first time to set, then refresh to read.

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

/*
Nuclear war would really set back cable.
-- Ted Turner
*/

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




[PHP] Best way for date/time

2002-05-11 Thread John Fishworld

Due to the large variety of MySQL and PHP date time formats
I'd like to have a couple of opinions from people out there !

Building a job database - and one of my fields is of course date time !
Which I want to be able to use latter in show all from last week, last month
etc !

Also I want to show the date later in the european from
ie day/month/year !


What is the best format to use ??

Thanks in advance
reagrds
John



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




Re: [PHP] using header ();

2002-05-11 Thread Nick Wilson

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


* and then baldey_uk declared
   #if not we need to keep the customer_id and quantity and start again
   case no :
   echo 'INPUT type=hidden name=txtJars value='.$quantity.'INPUT
 type=hidden name=txtCustomer_id value='.$customer_id.'';
   header(Location: updateaddress.php);
   exit;
   }

Can't see any problem there, check you're not leaving out the space as
Jason said and all should be groovy.
- -- 
Nick Wilson //  www.explodingnet.com



-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)

iD8DBQE83QQnHpvrrTa6L5oRApelAKCFG09T6Jf1c0+kkwwl3+BFElMLuwCfSWXH
rJIykuyo8GTTNVLlcph0wpI=
=fA3H
-END PGP SIGNATURE-

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




Re: [PHP] Best way for date/time

2002-05-11 Thread Jason Wong

On Saturday 11 May 2002 19:42, John Fishworld wrote:
 Due to the large variety of MySQL and PHP date time formats
 I'd like to have a couple of opinions from people out there !

 Building a job database - and one of my fields is of course date time !
 Which I want to be able to use latter in show all from last week, last
 month etc !

 Also I want to show the date later in the european from
 ie day/month/year !


 What is the best format to use ??

IMHO the best is /MM/DD, should (hopefully) be obvious to anyone.

Using DD/MM/ would confuse the poor yanks :)

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

/*
The PINK SOCKS were ORIGINALLY from 1952!!  But they went to MARS
around 1953!!
*/

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




Re: [PHP] using header ();

2002-05-11 Thread Nick Wilson

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


* and then Jason Wong declared
 ... if you use a header() you cannot output anything beforehand. See manual. 

Oh, yeah, missed that one :-)
- -- 
Nick Wilson //  www.explodingnet.com



-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)

iD8DBQE83QVTHpvrrTa6L5oRAswDAJ9yrKlNBiJYeyF0jjEu6/B1cLh6wACeNICT
UPNLjYrQIzmvi1HmssgUw+Q=
=WnJN
-END PGP SIGNATURE-

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




Re: [PHP] Best way for date/time

2002-05-11 Thread John Fishworld

lol ! no thats not what I meant !
what's best to put into MySQL
datetime from MySQL
now()
or from php date !

Regarding the format - its a german site so not expecting many yanks there !
:-))


 On Saturday 11 May 2002 19:42, John Fishworld wrote:
  Due to the large variety of MySQL and PHP date time formats
  I'd like to have a couple of opinions from people out there !
 
  Building a job database - and one of my fields is of course date time !
  Which I want to be able to use latter in show all from last week, last
  month etc !
 
  Also I want to show the date later in the european from
  ie day/month/year !
 
 
  What is the best format to use ??

 IMHO the best is /MM/DD, should (hopefully) be obvious to anyone.

 Using DD/MM/ would confuse the poor yanks :)

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

 /*
 The PINK SOCKS were ORIGINALLY from 1952!!  But they went to MARS
 around 1953!!
 */

 --
 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] Best way for date/time

2002-05-11 Thread Jason Wong

On Saturday 11 May 2002 19:55, John Fishworld wrote:
 lol ! no thats not what I meant !
 what's best to put into MySQL
 datetime from MySQL
 now()
 or from php date !

 Regarding the format - its a german site so not expecting many yanks there
 !

Sorry :)

In that case it's best to stick to mysql's native format.

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

/*
I use not only all the brains I have, but all those I can borrow as well.
-- Woodrow Wilson
*/

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




Re: [PHP] Best way for date/time

2002-05-11 Thread John Fishworld

Okay so I've then got

2002-05-08
and whats then the best way to manipulate it regarding
plus 3 days or plus 4 weeks ?




  lol ! no thats not what I meant !
  what's best to put into MySQL
  datetime from MySQL
  now()
  or from php date !
 
  Regarding the format - its a german site so not expecting many yanks
there
  !

 Sorry :)

 In that case it's best to stick to mysql's native format.

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

 /*
 I use not only all the brains I have, but all those I can borrow as well.
 -- Woodrow Wilson
 */

 --
 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: Best way for date/time

2002-05-11 Thread Manuel Lemos

Hello,

On 05/11/2002 08:42 AM, John Fishworld wrote:
 Due to the large variety of MySQL and PHP date time formats
 I'd like to have a couple of opinions from people out there !
 
 Building a job database - and one of my fields is of course date time !
 Which I want to be able to use latter in show all from last week, last month
 etc !
 
 Also I want to show the date later in the european from
 ie day/month/year !
 
 
 What is the best format to use ??

ISO 9601: -MM-DD HH:MM:SS

This is the format that was adopted by Metabase PHP database abstraction 
package. Metabase is meant to provide true portability to database 
applications, so this format was choose because it is the one that most 
databases support.

http://www.phpclasses.org/metabase

Even those that support multiple format support this one even if it 
requires that you set some configuration option before you retrieve 
date/time fields values from the database, so no format conversion is 
necessary to assure that Metabase based applications do not need to 
handle in the application eventual differences of date/time formats that 
databases use.



-- 

Regards,
Manuel Lemos


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




[PHP] Problme with PHPMyAdmin.

2002-05-11 Thread vins

My phpMyAdmin keeps caching it'self.

How do i disable it.

I'm using apache 2 and php4.2



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




[PHP] setcookie() in 4.2.0

2002-05-11 Thread Olexandr Vynnychenko

The following code doesn't work properly on PHP 4.1:

?php
echo pBlah, blah/p;
setcookie(kuku, abc);
setcookie(lala, def);
setcookie(zuzu, ghi);
?

Because I wrote echo statement before setcookie. But it works on PHP
4.2. Is it due to output_buffering=4096 directive in php.ini?

-- 
Best regards,
 Olexandr  mailto:[EMAIL PROTECTED]


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




[PHP] Newbie question to everybody....PHP

2002-05-11 Thread r

Greetings people,
Special greetings to all of you who have helped me in the past.

As most of you know i am a newbie, I learned a bit of PHP via webmonkey and
a few other places, seeing the power of PHP i decided to convert from Java
servlets and JSP (JSP coz its expensive to host and not many hosting
opportunities) so I baught a book called The PHP black book.
Anyway, now that the background is done heres my questions:

1)How many of you have seriously dug into arrays and has it been important
in your programming?
1.1)Do you think you could have done the same thing you did with arrays
WITHOUT arrays?
(The reason i ask this is theres a whole chapter dedicated to arrays in the
book  its pretty frustrating)
Last question:
Is ther any function to make the program sleep for 10 seconds or so? or
does anybody have a function that does this?

ANY replies good,bad,flames will be welcome.
Cheers,
-Ryan.

/* You cannot get to the top by sitting on your bottom. */





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




[PHP] access denied error

2002-05-11 Thread Nick Wilson

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi all
I'm pulling out hair here. this snippet of code seems to work just great
but when I use it in the method 'change_password()' it gives me access
denied errors. I see nothing wrong with the php but maybe someone can
help me?

Here is the connect code:

function _db_connect() {

$con=mysql_connect($this-host, $this-user, 
$this-pass) or die(Could not connect. Please try later);

if(!$con) {
return FALSE;
} 

$db=mysql_select_db($this-db) or die (can't select db);
return TRUE;
}



and here is the method it fails in:

function change_password($email, $new_password) {

$new_password=md5($new_password);   // encryption

$qry=UPDATE $this-table SET pass = '$new_password' ;
$qry.=WHERE email = '$email';

if(!$this-_db_connect()) {
return FALSE;
}


if(!($result=mysql_query($qry))) {
return FALSE;
} else {

if(mysql_affected_rows()==0) {
return FALSE;
} else {
$this-set_pass($new_password);
}

}

return TRUE;

}
 


many thanks...

- -- 
Nick Wilson //  www.explodingnet.com



-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)

iD8DBQE83RXqHpvrrTa6L5oRAlcYAKCbmu0AsKiWDCAKAKZ5apgFOWTu5ACfVNET
mdPCeea2Nt8oEzoQ+onBCXo=
=OHBS
-END PGP SIGNATURE-

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




[PHP] Email updates

2002-05-11 Thread Randum Ian

Hi all,

I want to be able to allow certain people the ability to email news directly
onto a page using the address [[EMAIL PROTECTED]] but only if they are
verified on a db. Please can someone explain what I need to do or where I
need to look so that I can grab the email as it comes in and add it to a
file so that it appears on the website.

Kind Regards, Ian.
---
Randum Ian
DJ / Reviewer / Webmaster, DancePortal (UK) Limited
[EMAIL PROTECTED]
http://www.danceportal.co.uk
DancePortal.co.uk - Global dance music media



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




[PHP] Re: Email updates

2002-05-11 Thread Manuel Lemos

Hello,

On 05/11/2002 10:20 AM, Randum Ian wrote:
 Hi all,
 
 I want to be able to allow certain people the ability to email news directly
 onto a page using the address [[EMAIL PROTECTED]] but only if they are
 verified on a db. Please can someone explain what I need to do or where I
 need to look so that I can grab the email as it comes in and add it to a
 file so that it appears on the website.

Create a POP3 mailbox for that address and use for instance a class like 
this to fetch and process the messages that come in:


http://www.phpclasses.org/pop3class

-- 

Regards,
Manuel Lemos


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




Re: [PHP] Newbie question to everybody....PHP

2002-05-11 Thread Neil Highley

Why would you want a scripting language to sleep, there is no such thing as
a loop in a web page (yes, I know it would be possible, but it would lock up
a users machine).

I know you can set up the apache daemon to run on-demand to conserver
resources, but I think you are getting mixed up between compiled and
interpreted (aka scripting) languages.

[EMAIL PROTECTED]
---
Life must be lived as play.
- Plato (427 - 347 BC)

- Original Message -
From: r [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, May 12, 2002 2:25 AM
Subject: [PHP] Newbie question to everybodyPHP


 Greetings people,
 Special greetings to all of you who have helped me in the past.

 As most of you know i am a newbie, I learned a bit of PHP via webmonkey
and
 a few other places, seeing the power of PHP i decided to convert from Java
 servlets and JSP (JSP coz its expensive to host and not many hosting
 opportunities) so I baught a book called The PHP black book.
 Anyway, now that the background is done heres my questions:

 1)How many of you have seriously dug into arrays and has it been important
 in your programming?
 1.1)Do you think you could have done the same thing you did with arrays
 WITHOUT arrays?
 (The reason i ask this is theres a whole chapter dedicated to arrays in
the
 book  its pretty frustrating)
 Last question:
 Is ther any function to make the program sleep for 10 seconds or so? or
 does anybody have a function that does this?

 ANY replies good,bad,flames will be welcome.
 Cheers,
 -Ryan.

 /* You cannot get to the top by sitting on your bottom. */





 --
 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] Newbie question to everybody....PHP

2002-05-11 Thread Bogdan Stancescu

Hi!

1. I believe every serious programmer out there uses arrays on a regular 
basis...
1.1. ...exactly because there are so many problems virtually unsolvable 
without them. Take for instance the case of a product page where people 
would fill in ordering quantitites.

My recommendation would be not to study arrays, but rather try solving 
problems using them - that way you'll have a better chance to remember 
what you've learned. But then again, that's me - maybe you learn better 
in other ways.

If you want to sleep, you can use sleep($seconds). But why in God's name 
would you want to do that?

Bogdan

r wrote:

Greetings people,
Special greetings to all of you who have helped me in the past.

As most of you know i am a newbie, I learned a bit of PHP via webmonkey and
a few other places, seeing the power of PHP i decided to convert from Java
servlets and JSP (JSP coz its expensive to host and not many hosting
opportunities) so I baught a book called The PHP black book.
Anyway, now that the background is done heres my questions:

1)How many of you have seriously dug into arrays and has it been important
in your programming?
1.1)Do you think you could have done the same thing you did with arrays
WITHOUT arrays?
(The reason i ask this is theres a whole chapter dedicated to arrays in the
book  its pretty frustrating)
Last question:
Is ther any function to make the program sleep for 10 seconds or so? or
does anybody have a function that does this?

ANY replies good,bad,flames will be welcome.
Cheers,
-Ryan.

/* You cannot get to the top by sitting on your bottom. */









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




Re: [PHP] Email updates

2002-05-11 Thread Bogdan Stancescu

You can use Mr. Lemos' suggestion, or go with an alias instead. You can 
check out an example of setting this up by downloading 
http://sourceforge.net/projects/outreach/ (the full version) - read 
INSTALL.email and check out opt/include/mail_retrieve.pl. Then check 
out opt/include/email.php to see how that works with php.

HTH

Bogdan

Randum Ian wrote:

Hi all,

I want to be able to allow certain people the ability to email news directly
onto a page using the address [[EMAIL PROTECTED]] but only if they are
verified on a db. Please can someone explain what I need to do or where I
need to look so that I can grab the email as it comes in and add it to a
file so that it appears on the website.

Kind Regards, Ian.
---
Randum Ian
DJ / Reviewer / Webmaster, DancePortal (UK) Limited
[EMAIL PROTECTED]
http://www.danceportal.co.uk
DancePortal.co.uk - Global dance music media







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




Re: [PHP] Email updates

2002-05-11 Thread Rasmus Lerdorf

Have a look at procmail (http://www.procmail.org/)

-Rasmus

On Sat, 11 May 2002, Randum Ian wrote:

 Hi all,

 I want to be able to allow certain people the ability to email news directly
 onto a page using the address [[EMAIL PROTECTED]] but only if they are
 verified on a db. Please can someone explain what I need to do or where I
 need to look so that I can grab the email as it comes in and add it to a
 file so that it appears on the website.

 Kind Regards, Ian.
 ---
 Randum Ian
 DJ / Reviewer / Webmaster, DancePortal (UK) Limited
 [EMAIL PROTECTED]
 http://www.danceportal.co.uk
 DancePortal.co.uk - Global dance music media



 --
 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] Newbie question to everybody....PHP

2002-05-11 Thread Matthew Walker

1. I have dug deeper into arrays than I care to remember.

2. Absolutely not.

3. See http://www.php.net/sleep and http://www.php.net/usleep

Glad to hear you're converting to PHP! It's an amazing language, and I
don't see it going away any time in the near future. Hope you have fun,
and be sure to ask if you have any more questions. I always try and
answer questions on the list if I have the time, and know the answer.

Matthew Walker
Senior Software Engineer
ePliant Marketing
 

-Original Message-
From: r [mailto:[EMAIL PROTECTED]] 
Sent: Saturday, May 11, 2002 7:26 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Newbie question to everybodyPHP

Greetings people,
Special greetings to all of you who have helped me in the past.

As most of you know i am a newbie, I learned a bit of PHP via webmonkey
and
a few other places, seeing the power of PHP i decided to convert from
Java
servlets and JSP (JSP coz its expensive to host and not many hosting
opportunities) so I baught a book called The PHP black book.
Anyway, now that the background is done heres my questions:

1)How many of you have seriously dug into arrays and has it been
important
in your programming?
1.1)Do you think you could have done the same thing you did with arrays
WITHOUT arrays?
(The reason i ask this is theres a whole chapter dedicated to arrays in
the
book  its pretty frustrating)
Last question:
Is ther any function to make the program sleep for 10 seconds or so?
or
does anybody have a function that does this?

ANY replies good,bad,flames will be welcome.
Cheers,
-Ryan.

/* You cannot get to the top by sitting on your bottom. */





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



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002
 

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




[PHP] Search Engine With Boolean Support --Please help

2002-05-11 Thread SpamSucks86

I need to have an internal search engine for my site. It needs to
support Boolean (not, or, and). Are there any fairly simple scripts out
there that will help me with this? Even if it's just to give me an idea
of where to start. I'm using mySQL, and Boolean support isn't
implemented until v4.0. Thanks for any and all help! =)



[PHP] ::::: PHPMYADMIN ERRORS-REFRESH. PHP4 or Apache 2?? :::::::

2002-05-11 Thread vins

My phpmyadmin scripts doesn't want to refresh.

what could be the problem



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




RE: [PHP] Best way for date/time

2002-05-11 Thread David Freeman



  Okay so I've then got
  
  2002-05-08
  and whats then the best way to manipulate it regarding
  plus 3 days or plus 4 weeks ?

Do it in your sql query - check out the date manipulation stuff in the
sql manual - it's quite comprehensive and tells you what you need to
know.

CYA, Dave



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




RE: [PHP] setcookie() in 4.2.0

2002-05-11 Thread Matthew Walker

Yes. Output buffering is good.

Some people will say that you shouldn't use it, but should make sure to
write all your code so that there can't be any output before any headers
need to be sent. I disagree with this. While a good idea in principle,
in practice it is all but impossible to keep going. 

(Or maybe I'm just too lazy to take the tremendous amount of time it
would take to rewrite our code to not send output before headers...)

Matthew Walker
Senior Software Engineer
ePliant Marketing
 

-Original Message-
From: Olexandr Vynnychenko [mailto:[EMAIL PROTECTED]] 
Sent: Saturday, May 11, 2002 6:35 AM
To: [EMAIL PROTECTED]
Subject: [PHP] setcookie() in 4.2.0

The following code doesn't work properly on PHP 4.1:

?php
echo pBlah, blah/p;
setcookie(kuku, abc);
setcookie(lala, def);
setcookie(zuzu, ghi);
?

Because I wrote echo statement before setcookie. But it works on PHP
4.2. Is it due to output_buffering=4096 directive in php.ini?

-- 
Best regards,
 Olexandr  mailto:[EMAIL PROTECTED]


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



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002
 

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




RE: [PHP] Any difference between these 2 forms of syntax?

2002-05-11 Thread John Holmes

 I am wondering if there is any tangible difference between the
following
 two
 commands:
 
 $x = $foo[status];
 $x = $foo['status'];

The only difference to any strings enclosed in ' or  is that strings
enclosed in  may have variables embedded within them. Strings enclosed
with ' will not have variables evaluated within them. 

$name = John;
Echo My name is $name;
Echo 'My name is $name;

The first echo will output John as the name, the second one will
output a literal $name.

---John Holmes...


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




RE: [PHP] protecting downloads with php

2002-05-11 Thread John Holmes

Store your files outside of the webroot if you use this method. Then
they can't type in the address directly (otherwise this doesn't fix
anything). 

---John Holmes...

 -Original Message-
 From: Miguel Cruz [mailto:[EMAIL PROTECTED]]
 Sent: Saturday, May 11, 2002 2:23 AM
 To: PHP-General
 Subject: Re: [PHP] protecting downloads with php
 
 On Sat, 11 May 2002, Nick Wilson wrote:
  I've been asked to protect an area containing 'course material'
(pdf's
  etc) and have just thought of a gaping hole in what I've done.
 
  I use an class to handle all the auth stuff and each page checks the
  value of $obj-logged_in :: No problem.
 
  but what if someone links to
www.thesite/theProtectedArea/file.tar.gz
 
  that file cannot check if the downloader is logged in can it.
 
 download.php:
 
   ?
 
   if (userIsAuthorized)
   {
  header('Content-Type: application/x-gzip');
  readfile('secret-name-of-file.tar.gz');
  exit;
   }
   else
   {
  print 'You are not authorized to download this file.';
   }
 
 ?
 
 Season to taste with GET arguments such as an ID number or other hash
 identifying which file to send.
 
 miguel
 
 
 --
 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] Cookies

2002-05-11 Thread John Holmes

Set a cookie, redirect to same page, and see if cookie is sent to you.

---John Holmes...

 -Original Message-
 From: Nookie [mailto:[EMAIL PROTECTED]]
 Sent: Saturday, May 11, 2002 4:21 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Cookies
 
 Hi.
 
 Is there any way to check is it cookies enabled browser?
 
 Regards,
 Szymon Kosok
 
 --
 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] Newbie question to everybody....PHP

2002-05-11 Thread John Holmes

 1)How many of you have seriously dug into arrays and has it been
important
 in your programming?
 1.1)Do you think you could have done the same thing you did with
arrays
 WITHOUT arrays?
 (The reason i ask this is theres a whole chapter dedicated to arrays
in
 the
 book  its pretty frustrating)
 Last question:
 Is ther any function to make the program sleep for 10 seconds or so?
or
 does anybody have a function that does this?

You should be ashamed of yourself... www.php.net/sleep :)

As for arrays, they are invaluable and not that hard to understand.
Don't skip over them, read the chapter a couple times if you have to...

---John Holmes...


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




[PHP] PhpMyAdmin

2002-05-11 Thread Michigan Connect, LLC

I am using the latest phpMyAdmin and MySQL 2.23.37.   I have installed and
compiled it on a Sun Cobalt RAQ4r.  I need to have it set up so that
customers with different websites cannot see or work on other cutomers DB's,
but each virtual site has its one phpMyAdmin

So each user needs to have his own phpMyAdmin to work in with his own DB's.

Can anyone please explain how this is done.  If this is the wrong list I
apologize but I did not know which one to post to.  If it si the wrong list
does any one know of a phpMyAdmin list.

Any help would be really great.  I'll even throw in a free web hosting
account.

Bernie--


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002



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




RE: [PHP] Best way for date/time

2002-05-11 Thread John Holmes

 Okay so I've then got
 
 2002-05-08
 and whats then the best way to manipulate it regarding
 plus 3 days or plus 4 weeks ?

I definitely agree to use the MySQL format for your dates. It makes it
easier to use the built in functions. You can convert the timestamp to a
unix style if you have to, also. Read the manual on the date and time
functions, there are a ton of them.

As for your question, you can do things like that quite easily.

SELECT * FROM table WHERE datetime_column BETWEEN CURDATE() AND
CURDATE() + INTERVAL 3 DAY;

A query like that will select all rows that have a datetime_column value
between the current date and three days from now. Substitute DAY for
MONTH, YEAR, etc...and it's easy to get whatever you want out of the
query. 

Use DATE_FORMAT() in your query to format the date from -MM-DD
HH:MM:SS to whatever format you want...similar to date() in PHP.

---John Holmes...


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




RE: [PHP] Uploaded File OverWriting Old File

2002-05-11 Thread John Holmes

  copy($img1, mjpalpics/$img1_name) or Die (Could
  not do);
 
  Sends the images to the mjpalpics Directory!
 Possibly. But one thing that is definitely a problem is:
 
   if(file_exists($img1_name)) {
 $img1_name = n+$img1_name;
   }
 
 should be:
 
   if(file_exists($img1_name)) {
 $img1_name = n . $img1_name;
   }

Umm...wouldn't you want to use file_exists(mjpalpics/$img1_name)
instead? Otherwise you're not checking for it existing in the same place
you are copying it to...

---John Holmes...


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




[PHP] Re: Newbie question to everybody....PHP

2002-05-11 Thread Austin Marshall

R wrote:
 Greetings people,
 Special greetings to all of you who have helped me in the past.
 
 As most of you know i am a newbie, I learned a bit of PHP via webmonkey and
 a few other places, seeing the power of PHP i decided to convert from Java
 servlets and JSP (JSP coz its expensive to host and not many hosting
 opportunities) so I baught a book called The PHP black book.
 Anyway, now that the background is done heres my questions:
 
 1)How many of you have seriously dug into arrays and has it been important
 in your programming?
 1.1)Do you think you could have done the same thing you did with arrays
 WITHOUT arrays?
 (The reason i ask this is theres a whole chapter dedicated to arrays in the
 book  its pretty frustrating)
 Last question:
 Is ther any function to make the program sleep for 10 seconds or so? or
 does anybody have a function that does this?
 
 ANY replies good,bad,flames will be welcome.
 Cheers,
 -Ryan.
 
 /* You cannot get to the top by sitting on your bottom. */
 
 
 
 

I couldn't imagine a world without arrays.  But even if you don't 
understand the creation of arrays, you should at least get familiar with 
the $_POST,$_GET,$_SERVER,etc... arrays as you probably won't be able to 
write any useful scripts without them.  Not to mention the fact that you 
will probably never be able interface with a database without using arrays.


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




[PHP] variables attached to url

2002-05-11 Thread jyrgen

a few weeks ago there was a discussion about how 
to get
variables attached to a url like
http://server.com/script.php?var1=value1var2=val
ue2var3=value3

the easiest way to do this is possibly:

$vars  = explode(, $argv[0]);
parse_str($vars);


with these two lines you will have the variables
defined in your script and can refer to them by
$var1, $var2 etc.

jyrgen

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




Re: [PHP] Problme with PHPMyAdmin.

2002-05-11 Thread Rasmus Lerdorf

Apache2+PHP has a number of issues.  At this point it is only suitable for
testing purposes.  I suggest using Apache 1.3.x if you want a stable
working server.

-Rasmus

On Sat, 11 May 2002, vins wrote:

 My phpMyAdmin keeps caching it'self.

 How do i disable it.

 I'm using apache 2 and php4.2



 --
 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] To all who replied to :Newbie question to everybody...PHP

2002-05-11 Thread r

Hey Guys,
I thank each and everyone one of you who replied, yeah, i got flamed a
couple of times from some of you for the sleep bit but need i remind you
that i am a newbie?
Hey, dont get me wrong i thank you too even though you flamed me, coz you
read the post and replied to me.
As for the people who sent me details and some URLs, examples / example
code thanking you is not enough, may you meet a SEXY nympho to keep you
happy!
Thanks again guys and have a great day.
Cheers,
-Ryan.

/* What's the difference between the Pope and your boss? The Pope only
expects you to kiss his ring. */




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




[PHP] Remote Hosting: Trouble shooting

2002-05-11 Thread David J Jackson

Let's see if I can keep this short and simple.
I'm  having to problems with a hosting service.
1. index.php isn't being read as default index.
2. Form aren't working (see a below mail_call.php).
2A.The mail_call.php works on my localbox (apache-2.0.36 +PHP4.2.0)
2B. Hosting company,for reason they didn't make clear are running 
apche.2.0.35 and PHP4.2.0?RC4?

The SA at the hosting company assured me that DirectoryIndex was 
correctly configured for both the top level site index and VirturalHost?

My question is what can I do from a PHP scripting standpoint to *help*
the hosting company troubleshoot this issue? This has been going on
now for almost a month.

TIA,
David Jackson

-- Mail_call.php -

html
headtitleMailCall: Don't forget the stamp!/title/head
body

pre
?php
print pre;
print $_POST['from'];
print $_POST['mail_to'];
print $_POST['sub_ject'];
print $_POST['comments'];
print /pre;
?
?php mail(
$_POST['mail_to'],$_POST['sub_ject'],$_POST['comments'],
From:$_POST[from]\r\n.
X-Mailer: PHP/ . phpversion()
  ) ?
/pre
/body
/html


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




Re: [PHP] Newbie question to everybody....PHP

2002-05-11 Thread Olexandr Vynnychenko

Hello r,

Sunday, May 12, 2002, 4:25:37 AM, you wrote:

r Greetings people,
r Special greetings to all of you who have helped me in the past.

r As most of you know i am a newbie, I learned a bit of PHP via webmonkey and
r a few other places, seeing the power of PHP i decided to convert from Java
r servlets and JSP (JSP coz its expensive to host and not many hosting
r opportunities) so I baught a book called The PHP black book.
r Anyway, now that the background is done heres my questions:

r 1)How many of you have seriously dug into arrays and has it been important
r in your programming?
r 1.1)Do you think you could have done the same thing you did with arrays
r WITHOUT arrays?
r (The reason i ask this is theres a whole chapter dedicated to arrays in the
r book  its pretty frustrating)

Arrays in PHP are very useful and easy to use. I had no problem. And I
have no book about PHP :). I use manual, because it's the best book. I
looked through some books and find that the PHP manual is MUCH better.

r Last question:
r Is ther any function to make the program sleep for 10 seconds or so? or
r does anybody have a function that does this?

It's called sleep() :)
Once again, use manual. Espacially if you work on Windows. Then just
download the manual in CHM.It includes index and search capabilities.

-- 
Best regards,
 Olexandrmailto:[EMAIL PROTECTED]


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




Re: [PHP] protecting downloads with php

2002-05-11 Thread Steve Overall

Nick:

As John H. suggested earlier, storing files outside (above) the webroot makes those 
files inaccessible directly from the user's
browser-- a good thing-- in which case the script serves as a gateway to these files-- 
also a good thing.

I have a similar need. Here's one way to do it in two steps. This is written without 
classes in mind-- I'm sure my code could be
made more elegant (I'm learning, too).

Step 1: Present the user (who's being authenticated throughout the process) a web page 
listing the files with links to each. To
prepare the links, the script reads through the files in the protected directory 
placed above the webroot.

// open directory (which is placed above the webroot)   read files into an array 
/

// Set $course_content_path to the desired directory outside the webroot

$myDirectory = opendir($course_content_path/download);

 // get each entry
while ($file = readdir($myDirectory))
if ($file != .  $file != ..  $file != index.htm  $file != index.html) // 
strip ., ..,  index files from dir listing
  {
$dirList[count($dirList)] = $file; // assign each file to the array
  }
 //Clean up and sort
 closedir($myDirectory);
 sort($dirList);

// process $dirList to get to the file names and file extensions 
///
$num_elements = count($dirList);

for ($i = 0; $i  $num_elements; ++$i){ // loop through $dirList

$str = $dirList[$i];
$pattern = .;
$filename_parts = explode(., $str); // split file name into a two-element array

// this intermediary step probably not necessary-- If I'd had more time, I'd have 
written a shorter letter
$file_name[] = $filename_parts[0];
$file_extension[] = $filename_parts[1];

$file_info[$i][0] = $file_name[$i];
$file_info[$i][1] = $file_extension[$i];
}

// Now we can loop through $file_info array to build the filenames and file types into 
the links. Clicking on a link calls the
following function show_file().

~~
// Step 2: When a user clicks on a link to a file, the function show_file() sends the 
file to the browser.

function show_file(){
// whatever globals
// $f = the filename.fileextension user wants. $f built into URL link.

if(!$f){
print Error: This page called incorrrectly.\n;
}

elseif($f){
$pattern = .;
$filename_parts = explode(., $f);
$file_name = trim($filename_parts[0]);
$file_extension = trim($filename_parts[1]);

// limit the valid file types

if($file_extension != 'doc'  $file_extension != 'htm'  $file_extension != 'html' 
 $file_extension != 'wps'  $file_extension
!= 'rtf'  $file_extension != 'gif'  $file_extension != 'jpg'){
print Error: $file_name.$file_extension file type called incorrrectly.\n;
exit;
}

// validate for alphanumeric file name or whatever file naming convention you use

if(!eregi(^[a-zA-Z0-9_]+$,$file_name)){ // is file name non-alphanumeric?
print Error: Incorrect file name.\n;
exit;
}

// read file into variable $file_output

$file_output = fopen($course_content_path/download/$f,r);
if(!$file_output) die(Cannot open $fbr);

// use fpassthru to pass file to the browser. Test for file type to send appropriate 
header.

if($file_extension == 'doc' || $file_extension == 'rtf'){
header(Content-type: application/msword);
header(Content-Disposition: attachment; filename=$f);
fpassthru($file_output);
}

if($file_extension == 'htm' || $file_extension == 'html' || $file_extension == 'gif' 
|| $file_extension == 'jpg'){
header(Content-type: text/html);
header(Content-Disposition: inline; filename=$f);
fpassthru($file_output);
}

if($file_extension == 'wps'){
header(Content-type: application/msworks);
header(Content-Disposition: attachment; filename=$f);
fpassthru($file_output);
}

}
}  // end function show_file() //

If you're tracking the user through his or her session, then passing the file through 
the script lets you track which users are
viewing or downloading which files as well as regulating access to those files.

For whatever all this is worth

All the best,

Steve Overall



- A Previous Reply to Original Message -
Store your files outside of the webroot if you use this method. Then
they can't type in the address directly (otherwise this doesn't fix
anything).

---John Holmes...

- Original Message -
From: Nick Wilson [EMAIL PROTECTED]
To: php-general [EMAIL PROTECTED]
Sent: Saturday, May 11, 2002 1:58 AM
Subject: [PHP] protecting downloads with php


 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Hi all
 I've been asked to protect an area containing 'course material' (pdf's
 etc) and have just thought of a gaping hole in what I've done.

 I use an class to handle all the auth stuff and each page checks the
 value of $obj-logged_in :: No problem.

 but what if someone links to www.thesite/theProtectedArea/file.tar.gz

 that file cannot check if the downloader is logged in can it.

 So, any suggestions or words of wisdom would be much appreciated :-)

 - --
 Nick Wilson //  www.explodingnet.com



 -BEGIN PGP SIGNATURE-

[PHP] changing language on fly

2002-05-11 Thread Yura

I'm looking for possibility to change language of my site on fly you 
may take a look at http://body-builders.org and see yourself - now 
when I press language button I can get to the main page in sertain 
language but what I want it to do is if I'm for example at 'Links' 
page and click on language button (or text link) I get to 'Links' 
page on different language. It can be reached by changing one 
charachter in the name of the file Let's say I'm on links page in 
English:

http://www.body-builders.org/index.php?links=1

I want to go to russian page which would be:

http://www.body-builders.org/indexr.php?links=1

So I want do make a script to do this change

Youri

God is our provider 
http://www.body-builders.org/


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




Re: [PHP] protecting downloads with php

2002-05-11 Thread Steve Overall

Nick Wilson wrote:
 Does anyone know of somewhere that lists content-type's?
 
 Many thanks :-)
 - -- 
 Nick Wilson //  www.explodingnet.com
 

See http://www.ietf.org/rfc/rfc2183.txt for handling file types in headers.

Also see the PHP manual http://www.php.net/manual/en/function.header.php
and http://www.php.net/manual/fi/function.fpassthru.php

You can download your own copy of the PHP manual from 
http://www.php.net/download-docs.php
and a Windows help version from http://weblabor.hu/php-doc-chm/

All the best, 

Steve Overall



- Original Message - 
From: Nick Wilson [EMAIL PROTECTED]
To: PHP-General [EMAIL PROTECTED]
Sent: Saturday, May 11, 2002 2:44 AM
Subject: Re: [PHP] protecting downloads with php


 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 
 * and then Miguel Cruz declared
   I use an class to handle all the auth stuff and each page checks the
   value of $obj-logged_in :: No problem.
   
   but what if someone links to www.thesite/theProtectedArea/file.tar.gz
   
   that file cannot check if the downloader is logged in can it.
  
  download.php:
  
?
  
if (userIsAuthorized)
{
   header('Content-Type: application/x-gzip');
   readfile('secret-name-of-file.tar.gz');
   exit;
}
else
{
   print 'You are not authorized to download this file.';
}
  
  ?
 
 Fantastic, so simple!
 Does anyone know of somewhere that lists content-type's?
 
 Many thanks :-)
 - -- 
 Nick Wilson //  www.explodingnet.com
 
 
 
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.0.6 (GNU/Linux)
 
 iD8DBQE83OgUHpvrrTa6L5oRAkdEAJ4wwvkgfRAXYNqg+Cf4uuwZDz8mOACdE091
 do6OoY5f2HoTiRM3sGGFSeQ=
 =Cirg
 -END PGP SIGNATURE-
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 
 


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




RE: [PHP] protecting downloads with php

2002-05-11 Thread Miguel Cruz

If you don't tell anyone what the secret path is, it's as good as a 
password.

miguel

On Sat, 11 May 2002, John Holmes wrote:
 Store your files outside of the webroot if you use this method. Then
 they can't type in the address directly (otherwise this doesn't fix
 anything). 
 
 ---John Holmes...
 
  -Original Message-
  From: Miguel Cruz [mailto:[EMAIL PROTECTED]]
  Sent: Saturday, May 11, 2002 2:23 AM
  To: PHP-General
  Subject: Re: [PHP] protecting downloads with php
  
  download.php:
  
?
  
if (userIsAuthorized)
{
   header('Content-Type: application/x-gzip');
   readfile('secret-name-of-file.tar.gz');
   exit;
}
else
{
   print 'You are not authorized to download this file.';
}
  
  ?
  
  Season to taste with GET arguments such as an ID number or other hash
  identifying which file to send.
  
  miguel
  
  
  --
  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] protecting downloads with php

2002-05-11 Thread Miguel Cruz

On Sat, 11 May 2002, Nick Wilson wrote:
 Does anyone know of somewhere that lists content-type's?

Apache comes with a file in conf/mime.types that lists a lot of standard
ones.

miguel


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




Re: [PHP] Uploaded File OverWriting Old File

2002-05-11 Thread Miguel Cruz

On Sat, 11 May 2002, Thomas Edison Jr. wrote:
 If i have a filename room.jpg in my Upload
 Directory, and someone else comes and uploads a file
 by the same name, the previous room.jpg is
 overwritten by the new one. Any suggestions?

In the long run, I think the best plan is to name your files after the 
unique database ID.

Store the names ('room.jpg') in the database.

If you expect getting more than a thousand files or so, split them into 
directories. If you use a numeric key, just take the last digit or two and 
use that for the directory (for instance, '4745' would go in '5/4745'). 

Then write a simple readfile script to process downloads (see today's 
thread about protecting downloads).

You can look in the database and construct URLs like:

  img src=image.php/4745/room.jpg

and your download script can look at the number to figure out which
directory it's in, and look at the file name to figure out the mime type
to send. The browser's happy because it thinks it's getting a file called
room.jpg no matter how many of them you have, the server is happy because
the files are spread nicely across a few directories, you're happy because
you got your work done, and I'm happy because you sent me a British
Airways gift certificate out in gratitude.

miguel


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




[PHP] I just wanted to thank everyone.. :) (Kinda long...)

2002-05-11 Thread Glenn Sieb

Hey everyone!

After some futzing about, and using techniques you guys all helped out 
with, I now have a nice, portable, fully-commented-for-future-maintenance 
script for doing *all* of my SQL queries to our MSSQL server, and 
outputting a nice, easy-to-read table. I only have to change one comment at 
the beginning, then the variables at the top of the script. Quite a bit 
easier to maintain that my old script (which most of you saw some of the 
other day). The script has been Sanitized, Homogenized, as well as 
Pasteurized and Anonymized For Your Protection (feel free to break the 
paper seal...) as well as mine. :)))

Now my next trick is to have the same query output to a 
downloaded-to-the-client-PC CSV file, but I just need to read more on 
that.. I have the CSV output, just have to tuck it into a plain/text CSV 
stream.. it will be fun to figure out!!!  : As I said to one of my 
coworkers last night when I got this done, There is now much joy in 
Lumetaville... :) hehe

In gratitude to the community who helped me build it, here's my script, 
which was originally snagged from a php-coding website that I visited 
somewhere in my travels, and unfortunately forgot which one. The script 
kept the SelectQuery function name and parameters from the original 
script. Since then, it has been mangled and coded and recoded and such by 
myself, with the help of the people here and at my office.

The script now:
 1) Automagically figures out how many fields are in the query,
 2) Feeds the header information from those fields into the table,
 3) Checks to see if any data cells are blank, and if so, throws in 
a nbsp;,
 4) Alternates the colors by company name.
 5) Produces pretty HTML source.

The whole thing is orders of magnitude more efficient than the original 
script was, and orders of magnitude easier for me to use to create new 
pages with!

In addition, if you have certain variables set, it will:
 1) Only print each company name once,
 2) Format any Price fields as being in dollars as well as 
right-aligned,
 3) Gives you a link to a similarly-named page that will have a 
CSV-formatted file (this is coming soon.. not done yet! hehe) downloaded to 
your PC with the data from the table.

I hope people find this useful. It's a good way of being able to query a DB 
and just dump the data into a table. I've learned a lot in this exercise, 
not the least of which was the fact that associative arrays are handled 
differently than regular arrays (and here I thought the mssql_fetch_assoc 
just didn't work LOL...), as well as when it's more right to use if 
clauses instead of ternary operators, for the sake of ease of reading. Feel 
free to use, abuse, gut, trash it, whatever you'd like :)

Again, thanks, everyone :)

Sincerely,
Glenn

(note... breaking the php tag so it'll show... instead of executing (I hope))

 ? php
/*
  *  This script performs a query on the MS SQL Server, against a database.
  *
  *  This will show us put what this script is showing us here!
  *
  *  Version 1.12 5/11/02
  *  ges with the help of ryan/hburch/bunches of people on php-general!
  *
  *  Here we set up variables that change for the page
  *
  *  Query Parms:
  *  $fields - comma separated list of field names or *.
  *  $tables - comma separated list of table names.
  *  $where - SQL Where clause (e.g. id=2).
  *  $groupBy - SQL Group clause (e.g. name).
  *  $orderBy - SQL Order clause (e.g. name).
  *  $show_debug - If true then print SQL query.
  *  $filter_company - If true, then only shows the first 
instance of a company's name
  *  $filter_dollars - If true, then formats any price colums 
to be $'s and such.
  *
  *  Page Parms:
  *  $title - What the name of this page is. Echoed in title 
and h3 below.
  *  $subtitle - Further information regarding the page. Echoed 
in h3 below.
  *  $csv_page - If true, prints the line that offers the user 
a CSV version of the page.
  *  $page_name - Set to the filename of this page, minus the .php
  *  Returns:
  *  2d array of rows and columns on success.
  *  Error String on failure.
  */
$fields = Enter the fields to query ;
$tables = From which tables ;
$where = conditions on match ;
$groupBy = grouping by ;
$orderBy = sorting by ;
$show_debug = False; # True or False
$filter_company = False; # True or False
$filter_dollars = False; # True or False
/*
  * Page Parms
  */
$title = Title of page here;
$subtitle  =Subtitle of page here;
$csv_page = True; # True or False
$page_name = pre-extension portion of the name of the php file here; # 
example Testing instead of Testing.php
/*
  *  Here we set up the page...
  */
print
 HTML\n\n.
 HEAD\n\n.
 TITLE$title/TITLE\n\n.
 /HEAD\n\n.

RE: [PHP] using header ();

2002-05-11 Thread Miguel Cruz

On Sat, 11 May 2002, baldey_uk wrote:
 Basically im trying to update details in a database, after the new details
 are put into a form they are printed to the screen with a 'are the details
 correct' scenario. From there if they click 'no' i want them to be put back
 to the updateaddress.php page but also pass two php variables back to that
 page for use later on. If they say yes i will do mysql query calls and
 update the database but also need to forward them to another php page and
 pass varaible values to that new page
 ?
 
 echo 'form method=postinput type=submit name=choice
 value=yesnbsp;input type=submit name=choice value=no/form ';
   switch($_POST['choice'])
   {
   case yes :
   #somethin will happen here ;
   break;
 
   #if not we need to keep the customer_id and quantity and start again
   case no :
   echo 'INPUT type=hidden name=txtJars value='.$quantity.'INPUT
 type=hidden name=txtCustomer_id value='.$customer_id.'';
   header(Location: updateaddress.php);
   exit;
   }
 ?

You want to use include() instead of header() here. Change 
updateaddress.php so it doesn't output HTMLHEAD etc if it's being 
included from another file (use a global or whatever).

header() can't be used after other output has been sent. And 
header(Location:) doesn't make any sense after other output has been sent, 
because it tells the browser that you didn't want this page, you want some
other page INSTEAD. Instead means that everything on this page should 
never have happened. And that's not what you're doing here, because you 
are generating useful output on this page.

miguel


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




Re: [PHP] Remote Hosting: Trouble shooting

2002-05-11 Thread Dennis Moore

If it is a unix/linux box use the .htaccess file and define the settings
yourself.Please this file in the document root for your site... Assuming
the system will allow you to do so...

/dkm

- Original Message -
From: David J Jackson [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, May 11, 2002 12:12 PM
Subject: [PHP] Remote Hosting: Trouble shooting


 Let's see if I can keep this short and simple.
 I'm  having to problems with a hosting service.
 1. index.php isn't being read as default index.
 2. Form aren't working (see a below mail_call.php).
 2A.The mail_call.php works on my localbox (apache-2.0.36 +PHP4.2.0)
 2B. Hosting company,for reason they didn't make clear are running
 apche.2.0.35 and PHP4.2.0?RC4?

 The SA at the hosting company assured me that DirectoryIndex was
 correctly configured for both the top level site index and VirturalHost?

 My question is what can I do from a PHP scripting standpoint to *help*
 the hosting company troubleshoot this issue? This has been going on
 now for almost a month.

 TIA,
 David Jackson

 -- Mail_call.php -

 html
 headtitleMailCall: Don't forget the stamp!/title/head
 body

 pre
 ?php
 print pre;
 print $_POST['from'];
 print $_POST['mail_to'];
 print $_POST['sub_ject'];
 print $_POST['comments'];
 print /pre;
 ?
 ?php mail(
 $_POST['mail_to'],$_POST['sub_ject'],$_POST['comments'],
 From:$_POST[from]\r\n.
 X-Mailer: PHP/ . phpversion()
   ) ?
 /pre
 /body
 /html


 --
 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] Remote Hosting: Trouble shooting

2002-05-11 Thread Jason Wong

On Sunday 12 May 2002 00:12, David J Jackson wrote:
 Let's see if I can keep this short and simple.
 I'm  having to problems with a hosting service.
 1. index.php isn't being read as default index.
 2. Form aren't working (see a below mail_call.php).
 2A.The mail_call.php works on my localbox (apache-2.0.36 +PHP4.2.0)
 2B. Hosting company,for reason they didn't make clear are running
 apche.2.0.35 and PHP4.2.0?RC4?

 The SA at the hosting company assured me that DirectoryIndex was
 correctly configured for both the top level site index and VirturalHost?

 My question is what can I do from a PHP scripting standpoint to *help*
 the hosting company troubleshoot this issue? This has been going on
 now for almost a month.

If it has been going on for a month now then either the hosting company is 
completely incompetent or you haven't been pushing for a resolution as 
vigorously as you should have. If the former then witholding payment of your 
hosting fees might 'help' them :)

Did you know before you signed up that they were using cutting technology  -- 
Apache 2.0.X and PHP 4.2.X -- which apparently don't play well together (yet).

Your best bet is to stick to the tried and tested Apache 1.3.X series, maybe 
you can persuade them to downgrade?

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

/*
The better part of valor is discretion.
-- William Shakespeare, Henry IV
*/

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




RE: [PHP] Uploaded File OverWriting Old File

2002-05-11 Thread Thomas Edison Jr.

WOOO.. i did not know this was possible :
file_exists(mjpalpics/$img1_name)

And this might actually solve the whole issue!! Let me
try this.. 

Thanks a BUNCH!
T. Edison Jr.


--- John Holmes [EMAIL PROTECTED] wrote:
   copy($img1, mjpalpics/$img1_name) or Die
 (Could
   not do);
  
   Sends the images to the mjpalpics Directory!
  Possibly. But one thing that is definitely a
 problem is:
  
if(file_exists($img1_name)) {
  $img1_name = n+$img1_name;
}
  
  should be:
  
if(file_exists($img1_name)) {
  $img1_name = n . $img1_name;
}
 
 Umm...wouldn't you want to use
 file_exists(mjpalpics/$img1_name)
 instead? Otherwise you're not checking for it
 existing in the same place
 you are copying it to...
 
 ---John Holmes...
 
 
 -- 
 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!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com

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




Re: [PHP] Uploaded File OverWriting Old File

2002-05-11 Thread Thomas Edison Jr.

Hmm..

You gave me a lot to think about, and a whole lot of
work to do. I definately love your idea and logic, and
yes, it would make everyone happy.

well i guess by the time i figure the coding and
process out, i'll keep in mind to arrange for your
British Airways Gift Certificate too.

Glory!
T. Edison jr.

--- Miguel Cruz [EMAIL PROTECTED] wrote:
 On Sat, 11 May 2002, Thomas Edison Jr. wrote:
  If i have a filename room.jpg in my Upload
  Directory, and someone else comes and uploads a
 file
  by the same name, the previous room.jpg is
  overwritten by the new one. Any suggestions?
 
 In the long run, I think the best plan is to name
 your files after the 
 unique database ID.
 
 Store the names ('room.jpg') in the database.
 
 If you expect getting more than a thousand files or
 so, split them into 
 directories. If you use a numeric key, just take the
 last digit or two and 
 use that for the directory (for instance, '4745'
 would go in '5/4745'). 
 
 Then write a simple readfile script to process
 downloads (see today's 
 thread about protecting downloads).
 
 You can look in the database and construct URLs
 like:
 
   img src=image.php/4745/room.jpg
 
 and your download script can look at the number to
 figure out which
 directory it's in, and look at the file name to
 figure out the mime type
 to send. The browser's happy because it thinks it's
 getting a file called
 room.jpg no matter how many of them you have, the
 server is happy because
 the files are spread nicely across a few
 directories, you're happy because
 you got your work done, and I'm happy because you
 sent me a British
 Airways gift certificate out in gratitude.
 
 miguel
 
 
 -- 
 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!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com

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




Re: [PHP] Remote Hosting: Trouble shooting

2002-05-11 Thread David Jackson

Jason --
In actual fact the hosting company in question is used by a friend of 
mine, but not my me :)
And I agree he needs to draw a line in the sand, I mean the guy uses 
them for 2 sites and
his ISP?! It's time to say fix it by Monday at 08:00 or I'm canceling my 
accounts, but that's
just me and you.

My hosting company CQHost, is gettiing ready to put up 4.2.0  but as you 
suggested they
sticking with 1.3.x  for now, what's kind of nice is they message saying 
 Hey, there's been
some changes to 4.2.0, check you scripts.

Thanks for you reply,
David

If it has been going on for a month now then either the hosting company is 
completely incompetent or you haven't been pushing for a resolution as 
vigorously as you should have. If the former then witholding payment of your 
hosting fees might 'help' them :)

Did you know before you signed up that they were using cutting technology  -- 
Apache 2.0.X and PHP 4.2.X -- which apparently don't play well together (yet).

Your best bet is to stick to the tried and tested Apache 1.3.X series, maybe 
you can persuade them to downgrade?

  

Ja


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




Re: [PHP] Uploaded File OverWriting Old File

2002-05-11 Thread Jason Wong

On Sunday 12 May 2002 01:38, Thomas Edison Jr. wrote:
 WOOO.. i did not know this was possible :
 file_exists(mjpalpics/$img1_name)

 And this might actually solve the whole issue!! Let me
 try this..

You might find is_file() to be a 'more reliable' indicator because 
file_exists() works for both directories and files. Thus if for some reason 
$mg1_name was empty then your statement above would effectively be:

  file_exists(mjpalpics)

which, assuming that your directory always exists, would return true, which 
may not be what you want.

I was bitten by this 'feature' of file_exists() just today, had me stumped 
for a good hour or so.

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

/*
To avoid criticism, do nothing, say nothing, be nothing.
-- Elbert Hubbard
*/

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




Re: [PHP] Search Engine With Boolean Support --Please help

2002-05-11 Thread Miguel Cruz

On Sat, 11 May 2002, SpamSucks86 wrote:
 I need to have an internal search engine for my site. It needs to
 support Boolean (not, or, and). Are there any fairly simple scripts out
 there that will help me with this? Even if it's just to give me an idea
 of where to start. I'm using mySQL, and Boolean support isn't
 implemented until v4.0. Thanks for any and all help! =)

Have a look at http://mnogosearch.ru/

and the accompanying functions in the PHP manual.

miguel


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




Re: [PHP] changing language on fly

2002-05-11 Thread Miguel Cruz

You might want to use the format:

   http://www.body-builders.org/index.php.en?links=1
   http://www.body-builders.org/index.php.ru?links=1

so that you can take advantage of Apache's mod_mime features, and not have 
to do so much complicated guesswork to determine when you are displaying 
in an alternate language (what if you had pages called taste.php and 
taster.php already - how would you make the first one russian?)

miguel

On Sat, 11 May 2002, Yura wrote:

 I'm looking for possibility to change language of my site on fly you 
 may take a look at http://body-builders.org and see yourself - now 
 when I press language button I can get to the main page in sertain 
 language but what I want it to do is if I'm for example at 'Links' 
 page and click on language button (or text link) I get to 'Links' 
 page on different language. It can be reached by changing one 
 charachter in the name of the file Let's say I'm on links page in 
 English:
 
 http://www.body-builders.org/index.php?links=1
 
 I want to go to russian page which would be:
 
 http://www.body-builders.org/indexr.php?links=1
 
 So I want do make a script to do this change
 
 Youri
 
 God is our provider 
 http://www.body-builders.org/
 
 
 


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




Re: [PHP] Remote Hosting: Trouble shooting

2002-05-11 Thread Miguel Cruz

This probably isn't the cause of any of your troubles, but your From: 
header is malformatted; there should be a space after the colon.

miguel

On Sat, 11 May 2002, David J Jackson wrote:

 Let's see if I can keep this short and simple.
 I'm  having to problems with a hosting service.
 1. index.php isn't being read as default index.
 2. Form aren't working (see a below mail_call.php).
 2A.The mail_call.php works on my localbox (apache-2.0.36 +PHP4.2.0)
 2B. Hosting company,for reason they didn't make clear are running 
 apche.2.0.35 and PHP4.2.0?RC4?
 
 The SA at the hosting company assured me that DirectoryIndex was 
 correctly configured for both the top level site index and VirturalHost?
 
 My question is what can I do from a PHP scripting standpoint to *help*
 the hosting company troubleshoot this issue? This has been going on
 now for almost a month.
 
 TIA,
 David Jackson
 
 -- Mail_call.php -
 
 html
 headtitleMailCall: Don't forget the stamp!/title/head
 body
 
 pre
 ?php
 print pre;
 print $_POST['from'];
 print $_POST['mail_to'];
 print $_POST['sub_ject'];
 print $_POST['comments'];
 print /pre;
 ?
 ?php mail(
 $_POST['mail_to'],$_POST['sub_ject'],$_POST['comments'],
 From:$_POST[from]\r\n.
 X-Mailer: PHP/ . phpversion()
   ) ?
 /pre
 /body
 /html
 
 
 


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




[PHP] MySQL and RH 7.2

2002-05-11 Thread Todd Cary

I am completely new to MySQL and I just installed it on my RH 7.2 server and I
cannot determine where the MySQL admin program is located so that I can set my
password.

Sorry for the basic question...

Todd

--
Todd Cary
Ariste Software
2200 D Street Extension
Petaluma, CA 94952
707-773-4523
[EMAIL PROTECTED]



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




Re: [PHP] MySQL and RH 7.2

2002-05-11 Thread Jason Wong

On Sunday 12 May 2002 02:44, Todd Cary wrote:
 I am completely new to MySQL and I just installed it on my RH 7.2 server
 and I cannot determine where the MySQL admin program is located so that I
 can set my password.

 Sorry for the basic question...

mysqladmin

For further help please goto www.mysql.com or ask on the mysql mailing list.

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

/*
If ignorance is bliss, why aren't there more happy people?
*/

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




Re: [PHP] MySQL and RH 7.2

2002-05-11 Thread Todd Cary

I tried locate and find and both come up empty for mysqladmin.

Am I missing something stupid here?

Todd

--
Todd Cary
Ariste Software
2200 D Street Extension
Petaluma, CA 94952
707-773-4523
[EMAIL PROTECTED]



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




RE: [PHP] Newbie needs compile

2002-05-11 Thread hassan

hi

you can also use http://www.webcron.org

At 13:29 06/05/02, John Holmes wrote:
   He did say he did /not/ want to invoke it from a browser :)
  I didn't think that PHP could run w/o one though, so my idea was to
use a
  text browser, have it run the script, then exit out.  As I said, I was
  probably wrong ;)

Actually, that's exactly how it's typically done, using wget or lynx.
Yes, you can compile a standalone version of PHP and use it directly,
but most hosts do not have that. So, you add a line to your cron file
that calls up your PHP script through lynx. Your script shouldn't return
anything, just do what it has to do, or it should redirect output to a
file or email. You can use the -dump switch for lynx to dump any output
that does occur.

I know he said he did not want to invoke it from a browser, but I think
he meant that he didn't want to have to physically go to and load up the
page himself.

---John Holmes...


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

___
Hassan El Forkani
Founder And Mantainer of :
http://WarmAfrica.com EveryOne's Africa
Freelance Internet Consultant / Web Applications Developper.
Email: [EMAIL PROTECTED]
Tel : 0021671880014
___


[PHP] Re: Nitpicking - PHP 4.2.0 for windows says version is 4.1.2

2002-05-11 Thread Steve Magruder, D2 Director

Make sure that any PHP DLL's in your system32 directory are updated.  If
they were updated to the newest versions, then what you describe is
definitely a big problem, not a nit.

--

Steve (www.stevemagruder.com)

Garth Dahlstrom [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Anyone notice this... when you do a
 ?
 phpinfo();
 ?

 you get PHP Version 4.1.2, while my apache window
 says Apache/1.3.20 (Win32) PHP/4.2.0 running...

 -G





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




RE: [PHP] Search Engine With Boolean Support --Please help

2002-05-11 Thread SpamSucks86

I don't want to use a module though. I just want to take what a person
types and parse it so I can put it into a mysql query and search my
database of data. I share the server and I can't get mnoGoSearch
compiled in with PHP, so unless there's PHP code I can borrow from it, I
don't think it will help me.

-Original Message-
From: Miguel Cruz [mailto:[EMAIL PROTECTED]] 
Sent: Saturday, May 11, 2002 2:23 PM
To: SpamSucks86
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Search Engine With Boolean Support --Please help

On Sat, 11 May 2002, SpamSucks86 wrote:
 I need to have an internal search engine for my site. It needs to
 support Boolean (not, or, and). Are there any fairly simple scripts
out
 there that will help me with this? Even if it's just to give me an
idea
 of where to start. I'm using mySQL, and Boolean support isn't
 implemented until v4.0. Thanks for any and all help! =)

Have a look at http://mnogosearch.ru/

and the accompanying functions in the PHP manual.

miguel


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




[PHP] setcookie()

2002-05-11 Thread jtjohnston

This is a bug Feature/Change Request I made to:
http://bugs.php.net/bug.php?id=17158

setcookie() states cookies must be sent before any other headers
are sent (this is a restriction of cookies, not PHP).

I argue this is a restriction of PHP, not cookies.

Here is my proof:

http://www.collegeSherbrooke.qc.ca/languesmodernes/cookie.htm

I can do this any time in body :

script
   setCookie(TestCookie,first time,expdate);
   var DisplayData = getCookie(TestCookie);
   document.write(DisplayData);
   setCookie(TestCookie,second time,expdate);
   var DisplayData = getCookie(TestCookie);
   document.write(DisplayData);
 /script

I want to be able to setcookie() anytime I want, before and after I
declare any HTML.
This will never get changed, unless we ask for it.

I would appreciate your vote of support at:

http://bugs.php.net/bug.php?id=17158

before the bug people close this thread.


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




Re: [PHP] setcookie()

2002-05-11 Thread Rasmus Lerdorf

PHP is a server-side language and as such it deals with server-side
issues.  If you want to write javascript that sets a client-side
Javascript cookie, go ahead.  It has nothing to do with PHP and PHP will
certainly not get in your way.

-Rasmus

On Sat, 11 May 2002, jtjohnston wrote:

 This is a bug Feature/Change Request I made to:
 http://bugs.php.net/bug.php?id=17158

 setcookie() states cookies must be sent before any other headers
 are sent (this is a restriction of cookies, not PHP).

 I argue this is a restriction of PHP, not cookies.

 Here is my proof:

 http://www.collegeSherbrooke.qc.ca/languesmodernes/cookie.htm

 I can do this any time in body :

 script
setCookie(TestCookie,first time,expdate);
var DisplayData = getCookie(TestCookie);
document.write(DisplayData);
setCookie(TestCookie,second time,expdate);
var DisplayData = getCookie(TestCookie);
document.write(DisplayData);
  /script

 I want to be able to setcookie() anytime I want, before and after I
 declare any HTML.
 This will never get changed, unless we ask for it.

 I would appreciate your vote of support at:

 http://bugs.php.net/bug.php?id=17158

 before the bug people close this thread.


 --
 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] setcookie()

2002-05-11 Thread jtjohnston

Rasmus
server-side / client-side, that's not the point.

My point is PHP can, could and should be able to set a cookie after HTML is
set.
But of course, Jan has already closed the issue, as usual.
http://bugs.php.net/bug.php?id=17158




 PHP is a server-side language and as such it deals with server-side
 issues.  If you want to write javascript that sets a client-side
 Javascript cookie, go ahead.  It has nothing to do with PHP and PHP will
 certainly not get in your way.

 -Rasmus

 On Sat, 11 May 2002, jtjohnston wrote:

  This is a bug Feature/Change Request I made to:
  http://bugs.php.net/bug.php?id=17158
 
  setcookie() states cookies must be sent before any other headers
  are sent (this is a restriction of cookies, not PHP).
 
  I argue this is a restriction of PHP, not cookies.
 
  Here is my proof:
 
  http://www.collegeSherbrooke.qc.ca/languesmodernes/cookie.htm
 
  I can do this any time in body :
 
  script
 setCookie(TestCookie,first time,expdate);
 var DisplayData = getCookie(TestCookie);
 document.write(DisplayData);
 setCookie(TestCookie,second time,expdate);
 var DisplayData = getCookie(TestCookie);
 document.write(DisplayData);
   /script
 
  I want to be able to setcookie() anytime I want, before and after I
  declare any HTML.
  This will never get changed, unless we ask for it.
 
  I would appreciate your vote of support at:
 
  http://bugs.php.net/bug.php?id=17158
 
  before the bug people close this thread.
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 

--
John Taylor-Johnston
-

  ' ' '   Collège de Sherbrooke:
 ô¿ô   http://www.collegesherbrooke.qc.ca/languesmodernes/
   - Université de Sherbrooke:
  http://compcanlit.ca/
  819-569-2064



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




Re: [PHP] setcookie()

2002-05-11 Thread jtjohnston

If the issue has pissed you off in tha past,
complain. Vote: http://bugs.php.net/bug.php?id=17158


 Rasmus
 server-side / client-side, that's not the point.

 My point is PHP can, could and should be able to set a cookie after HTML is
 set.
 But of course, Jan has already closed the issue, as usual.
 http://bugs.php.net/bug.php?id=17158

  PHP is a server-side language and as such it deals with server-side
  issues.  If you want to write javascript that sets a client-side
  Javascript cookie, go ahead.  It has nothing to do with PHP and PHP will
  certainly not get in your way.
 
  -Rasmus
 
  On Sat, 11 May 2002, jtjohnston wrote:
 
   This is a bug Feature/Change Request I made to:
   http://bugs.php.net/bug.php?id=17158
  
   setcookie() states cookies must be sent before any other headers
   are sent (this is a restriction of cookies, not PHP).
  
   I argue this is a restriction of PHP, not cookies.
  
   Here is my proof:
  
   http://www.collegeSherbrooke.qc.ca/languesmodernes/cookie.htm
  
   I can do this any time in body :
  
   script
  setCookie(TestCookie,first time,expdate);
  var DisplayData = getCookie(TestCookie);
  document.write(DisplayData);
  setCookie(TestCookie,second time,expdate);
  var DisplayData = getCookie(TestCookie);
  document.write(DisplayData);
/script
  
   I want to be able to setcookie() anytime I want, before and after I
   declare any HTML.
   This will never get changed, unless we ask for it.
  
   I would appreciate your vote of support at:
  
   http://bugs.php.net/bug.php?id=17158
  
   before the bug people close this thread.
  
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, visit: http://www.php.net/unsub.php
  

 --
 John Taylor-Johnston
 -

   ' ' '   Collège de Sherbrooke:
  ô¿ô   http://www.collegesherbrooke.qc.ca/languesmodernes/
- Université de Sherbrooke:
   http://compcanlit.ca/
   819-569-2064

--
John Taylor-Johnston
-
  ' ' '   Collège de Sherbrooke:
 ô¿ô   http://www.collegesherbrooke.qc.ca/languesmodernes/
   - Université de Sherbrooke:
  http://compcanlit.ca/
  819-569-2064



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




Re: [PHP] setcookie()

2002-05-11 Thread Rasmus Lerdorf

And you can do so if you turn on output buffering.  Having PHP send off
JavaScript to do this is a massive hack that has no place in PHP.  Write
your own setcookie wrapper function if that is what you want.

-Rasmus

On Sat, 11 May 2002, jtjohnston wrote:

 Rasmus
 server-side / client-side, that's not the point.

 My point is PHP can, could and should be able to set a cookie after HTML is
 set.
 But of course, Jan has already closed the issue, as usual.
 http://bugs.php.net/bug.php?id=17158




  PHP is a server-side language and as such it deals with server-side
  issues.  If you want to write javascript that sets a client-side
  Javascript cookie, go ahead.  It has nothing to do with PHP and PHP will
  certainly not get in your way.
 
  -Rasmus
 
  On Sat, 11 May 2002, jtjohnston wrote:
 
   This is a bug Feature/Change Request I made to:
   http://bugs.php.net/bug.php?id=17158
  
   setcookie() states cookies must be sent before any other headers
   are sent (this is a restriction of cookies, not PHP).
  
   I argue this is a restriction of PHP, not cookies.
  
   Here is my proof:
  
   http://www.collegeSherbrooke.qc.ca/languesmodernes/cookie.htm
  
   I can do this any time in body :
  
   script
  setCookie(TestCookie,first time,expdate);
  var DisplayData = getCookie(TestCookie);
  document.write(DisplayData);
  setCookie(TestCookie,second time,expdate);
  var DisplayData = getCookie(TestCookie);
  document.write(DisplayData);
/script
  
   I want to be able to setcookie() anytime I want, before and after I
   declare any HTML.
   This will never get changed, unless we ask for it.
  
   I would appreciate your vote of support at:
  
   http://bugs.php.net/bug.php?id=17158
  
   before the bug people close this thread.
  
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, visit: http://www.php.net/unsub.php
  

 --
 John Taylor-Johnston
 -

   ' ' '   Collège de Sherbrooke:
  ô¿ô   http://www.collegesherbrooke.qc.ca/languesmodernes/
- Université de Sherbrooke:
   http://compcanlit.ca/
   819-569-2064



 --
 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] setcookie()

2002-05-11 Thread Mark Charette

You've just pointed out that you're a clueless newbie, that's' all, and
can't read a spec worth a whit.

-Original Message-
From: jtjohnston [mailto:[EMAIL PROTECTED]]
Sent: Saturday, May 11, 2002 4:50 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] setcookie()


Rasmus
server-side / client-side, that's not the point.

My point is PHP can, could and should be able to set a cookie after HTML is
set.
But of course, Jan has already closed the issue, as usual.
http://bugs.php.net/bug.php?id=17158




 PHP is a server-side language and as such it deals with server-side
 issues.  If you want to write javascript that sets a client-side
 Javascript cookie, go ahead.  It has nothing to do with PHP and PHP will
 certainly not get in your way.

 -Rasmus

 On Sat, 11 May 2002, jtjohnston wrote:

  This is a bug Feature/Change Request I made to:
  http://bugs.php.net/bug.php?id=17158
 
  setcookie() states cookies must be sent before any other headers
  are sent (this is a restriction of cookies, not PHP).
 
  I argue this is a restriction of PHP, not cookies.
 
  Here is my proof:
 
  http://www.collegeSherbrooke.qc.ca/languesmodernes/cookie.htm
 
  I can do this any time in body :
 
  script
 setCookie(TestCookie,first time,expdate);
 var DisplayData = getCookie(TestCookie);
 document.write(DisplayData);
 setCookie(TestCookie,second time,expdate);
 var DisplayData = getCookie(TestCookie);
 document.write(DisplayData);
   /script
 
  I want to be able to setcookie() anytime I want, before and after I
  declare any HTML.
  This will never get changed, unless we ask for it.
 
  I would appreciate your vote of support at:
 
  http://bugs.php.net/bug.php?id=17158
 
  before the bug people close this thread.
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 

--
John Taylor-Johnston

-

  ' ' '   Collège de Sherbrooke:
 ô¿ô   http://www.collegesherbrooke.qc.ca/languesmodernes/
   - Université de Sherbrooke:
  http://compcanlit.ca/
  819-569-2064



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

2002-05-11 Thread http://www.promoozz.org [*]

i'm sweating on this one :

function sql_fetch_row($res, $nr)
{
global $dbtype;  
switch ($dbtype) {   
 
case MySQL:
$row = mysql_fetch_row($res);
return $row;
break;;
...
}

it iz used in a php_layer.php from phpnuke, but somehow it gives errors... if i put a 
 like this:

$row = mysql_fetch_row($res);

i get no errors, but no result either. Where stands the  for? I can't find any info 
on thizz, what's wrong?

   [ProMoozz signature script initiated]
 [Sharon equalzz Hitler]
[msg written - msg read]
  [ProMoozz signature script terminated]
http://www.kotbelasting.be - http://www.kotbelasting.be



[PHP] PHP Hosting ...

2002-05-11 Thread Tim Thorburn

Hi,

I've about had it with my current hosting company as they've turned off SSH 
for the past month due to security reasons which means I can no longer 
add/remove tables from my MySQL database.  Looking at two other hosting 
companies - SBC Webhosting - www.webhosting.com and Verio - www.verio.com

Does anyone here use either of these companies?  If so, could you please 
let me know your opinions of each?

Thanks
-Tim



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




[PHP] PHP 5??

2002-05-11 Thread Tim Thorburn

Hi,

In my seemingly never ending search for a decent hosting company, I've 
contacted some customer service people from Verio who tell me a very 
interesting story ... they're currently upgrading their PHP to version 5 
... which I find odd as there's only mention of 4.2.0 on php.net ...

So my question is, was the guy I was talking to knowledgeable of inside 
things, or did he not have a clue what he was talking about?

Thanks
-Tim



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




Re: [PHP] PHP 5??

2002-05-11 Thread Rasmus Lerdorf

He has no clue.  There is no PHP 5.  The next version will be 4.2.1 next
week and probably 4.3 after that.

-Rasmus

On Sat, 11 May 2002, Tim Thorburn wrote:

 Hi,

 In my seemingly never ending search for a decent hosting company, I've
 contacted some customer service people from Verio who tell me a very
 interesting story ... they're currently upgrading their PHP to version 5
 ... which I find odd as there's only mention of 4.2.0 on php.net ...

 So my question is, was the guy I was talking to knowledgeable of inside
 things, or did he not have a clue what he was talking about?

 Thanks
 -Tim



 --
 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:[PHP]PHP Hosting....

2002-05-11 Thread r

Hey Tim,
I'm using 321go.biz for my hosting needs.
Not a single problem so far and around 30-90 minutes for each support
question to be solved which i think is pretty good. They are slightly
expensive though but i joined for the Java part, got PHP free!
Now that i'm into PHP I see they also offer PHP Jpeg support
Anyway, hope that was helpful.
Cheers.
-R.


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




[PHP] Re: an sql_layer

2002-05-11 Thread Austin Marshall

Http://Www.Promoozz.Org wrote:
 i'm sweating on this one :
 
 function sql_fetch_row($res, $nr)
 {
 global $dbtype;  
 switch ($dbtype) {   
  
 case MySQL:
 $row = mysql_fetch_row($res);
 return $row;
 break;;
 ...
 }
 
 it iz used in a php_layer.php from phpnuke, but somehow it gives errors... if i put 
a  like this:
 
 $row = mysql_fetch_row($res);
 
 i get no errors, but no result either. Where stands the  for? I can't find any info 
on thizz, what's wrong?
 
[ProMoozz signature script initiated]
  [Sharon equalzz Hitler]
 [msg written - msg read]
   [ProMoozz signature script terminated]
 http://www.kotbelasting.be - http://www.kotbelasting.be
 

First off, anyone using phpnuke is on their own, try phpnuke.org for 
help.  But an  before a function suppresses error messages, it doesn't 
make errors go away, so it's doing precisely what it is supposed to.  I 
also see two ;'s in a row, perhaps that is the problem, or perhaps the 
query was bad and that renders fetch_row useless.

We or anyone would have a far better chance of helping out if you 
explained what the error is... it will be alot easier than debunking the 
  code of phpnuke on our own.




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




Re: [PHP] Using function in PHP script n DOCROOT in PHP script in subfolder

2002-05-11 Thread Phil Powell

Found a MUCH MUCH simpler solution that works across the board.. change
$HTTP_HOST to $DOCUMENT_ROOT and it works!

Phil

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

 On Fri, May 10, 2002 at 08:01:46PM -0400, Phil Powell wrote:
 
  How do I fix this problem? I do not want to duplicate the PHP script per
  folder as there will be an enormous amount of dynamically-created
subfolders
  and I will have to copy a version per folder.  I want to be able to use
the
  one PHP script in the DOCROOT for every PHP script in every subfolder,
how
  is this done?

 Have a file in each directory called, for the sake of example,
 directory.inc  In that file, set a variable called, $root  The
 value of it should be the relative path used to find the root
 directory, eg ../../.  This will vary depending on the directory
 depth.  Each script on your site then should have
 require('./directory.inc'); at the top.  Now, you'll always know
 where to find the root.  This also makes things easy to move from one
 server to another in the future.

 Another way to do this is to use the auto_prepend_file setting to
 include your file that has the function in it.
 http://www.php.net/manual/en/configuration.php#ini.auto-prepend-file

 Enjoy,

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




  1   2   >