Re: [PHP] NH05 to 5, NH07 to 7

2004-11-26 Thread Hidayet Dogan
echo str_replace(NH, , NH13);

 Hidayet Dogan
  [EMAIL PROTECTED]

Pleksus Bilisim Teknolojileri D.T.O. A.S.
--
caldiran sok. 14/6 06420 kolej ankara * www.pleksus.com.tr
tel : +90 312 4355343 * faks: +90 312 4354006

On Thu, 25 Nov 2004, Wiberg wrote:

 hi there!

 i guess you know a simple solution to convert the string

 NH01 into 1
 NH02 into 2
 ..
 ...
 NH13 into 13

 and so on

 /Gustav Wiberg
 ---
 Outgoing mail is certified Virus Free.
 Checked by AVG anti-virus system (http://www.grisoft.com).
 Version: 6.0.799 / Virus Database: 543 - Release Date: 2004-11-19

 --
 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] Getting static member for a class which name is stored in a variable

2004-11-26 Thread Simas Toleikis
Jake Press wrote:
Hi Francisco,
Your not alone, a number of other users have enountered this bug.
string get_class ( object obj )
Its not a bug...
You are getting class name as a string for output purposes etc..
Doing something like TestClass::some_static is ofcourse illegal wih 
strings.

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


[PHP] fedora core 3 mail() not working from web

2004-11-26 Thread Minuk Choi
hey gang, 

I have a fedora core 3, with standard PHP and MySQL included with the 
distribution.

I'm having a rather odd problem.

the following script(mailTest.php)

?PHP
$result = mail('[EMAIL PROTECTED]', 'test subject', 'test message');

if (!$result)
echo FAILURE;
else
echo SUCCESS;
?

does NOT work if I access it from the web 

BUT
 
if I were to execute it as root on the Command prompt

php mailTest.php

It executes correctly and I get mail.

This feels like the apache user is lacking access over sendmail or something... 
since as root I can execute the script from the CLI without a problem, but from 
the web, I get a failure.

Can anyone shed a light as to what settings I need to tweak PHP so mail() can 
work? 

Thanks

-Minuk

[PHP] Problem with recursion and FTP transfer

2004-11-26 Thread [EMAIL PROTECTED]
Hi all
I have create a script for FTP function.
When i have testing the script with little file and directory it's ok
The script read data in all folder with recursive function and the same 
path of data
like C:\backup\folder1\file.txt is the same on remolte folder 
/httpdcos/folder1/file.txt
The problem is that when i testing the script with MB of files
the recursion is much more speed of  transfer of a single file and a
file is copied to a path that is not the same of local folder.
How to fix the problem ?
Sorry for my bad language

?php
#Mode transfer data
$mode = FTP_ASCII;
#The base path of remote directory
$remote_folder = /httpdocs;
#Include data for the connection to the FTP server
include_once(./config.php);
function ftp_connection() {
  global $user, $pasw, $ftp_server;
  $conn = @ftp_connect($ftp_server);
  $login = @ftp_login($conn, $user, $pasw);
  if((!$conn)||(!$login)) {
 die(Cannot open connect with $ftp_server\n);
  }
  else {
 return $conn;
  }
}
$conn = ftp_connection();
if(!(@ftp_chdir($conn, $remote_folder)))
die(Cannot to change data folder\n);
function recursive_dir($dir){
   #Get ID connect ftp_mode and
   global $mode, $conn, $remote_folder;
   #Open resource to read data
   if (!($handle = @opendir($dir)))
die(Cannot open datadir\n);
   #Read data from local folder $default_dir
   while(false !==($item = @readdir($handle))){
if (is_dir($dir./.$item)) {
#Erase al . and .. to content of $item
if ($item != .  $item != ..){
   #Make directory on remote Server
   if (!(@ftp_mkdir($conn, $item)))
die(Cannot possible mkdir $item\n);
   #Get current directory for current session
   $pwd = @ftp_pwd($conn);
   if(!$pwd) die(Cannot get current Work Directory\n);
   if(!(@ftp_chdir($conn, $pwd./.$item)))
   die(Cannot change 
directory:.$pwd./.$item.\n);

   #Call recursive dir to
   recursive_dir($dir./.$item);
   if(!(@ftp_chdir($conn, $remote_folder)))
   die(Cannot change directory to 
$remote_folder);
  }
   }//End for first check of $item: if is_dir($item)
   else {
 $fp = @fopen($dir./.$item, r);
   $pwd = @ftp_pwd($conn);
   //echo $pwd.\n;
   if(@ftp_fput($conn, $item, $fp, $mode)){
 //$count++;
 //print $dir.\\.$item.\n;
  }//End for if uploaded file
  fclose($fp);
   }
   }//End for else

   closedir($handle);
}//End for recursive function
#Called to recursive function
recursive_dir($default_dir);
#Close the connect to FTP Data
ftp_close($conn);
?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] test

2004-11-26 Thread franco bevilacqua
éàélàél
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] NH05 to 5, NH07 to 7

2004-11-26 Thread Ford, Mike
To view the terms under which this email is distributed, please go to 
http://disclaimer.leedsmet.ac.uk/email.htm



On 25 November 2004 22:11, Wiberg wrote:

 i guess you know a simple solution to convert the string
 
 NH01 into 1

I can think of several.



Oh, you want one?  How about:

   $x = NH01;
   $n = (int)substr($x, 2);

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning  Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Headingley Campus, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

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



Re: [PHP] fedora core 3 mail() not working from web

2004-11-26 Thread Angelo Zanetti
Hi, 

It could have something to do with your PHP.ini file??
Can you post the error message, as it will give us a better idea of
what could be wrong.

Angelo

 Minuk Choi [EMAIL PROTECTED] 11/26/2004 10:31:59 AM 
hey gang, 

I have a fedora core 3, with standard PHP and MySQL included with the
distribution.

I'm having a rather odd problem.

the following script(mailTest.php)

?PHP
$result = mail('[EMAIL PROTECTED]', 'test subject', 'test message');

if (!$result)
echo FAILURE;
else
echo SUCCESS;
?

does NOT work if I access it from the web 

BUT
 
if I were to execute it as root on the Command prompt

php mailTest.php

It executes correctly and I get mail.

This feels like the apache user is lacking access over sendmail or
something... since as root I can execute the script from the CLI without
a problem, but from the web, I get a failure.

Can anyone shed a light as to what settings I need to tweak PHP so
mail() can work? 

Thanks

-Minuk

Disclaimer 
This e-mail transmission contains confidential information,
which is the property of the sender.
The information in this e-mail or attachments thereto is 
intended for the attention and use only of the addressee. 
Should you have received this e-mail in error, please delete 
and destroy it and any attachments thereto immediately. 
Under no circumstances will the Cape Technikon or the sender 
of this e-mail be liable to any party for any direct, indirect, 
special or other consequential damages for any use of this e-mail.
For the detailed e-mail disclaimer please refer to 
http://www.ctech.ac.za/polic or call +27 (0)21 460 3911

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



Re: [PHP] Problem with recursion and FTP transfer

2004-11-26 Thread Raditha Dissanayake
[EMAIL PROTECTED] wrote:
Hi all
I have create a script for FTP function.
When i have testing the script with little file and directory it's ok
The script read data in all folder with recursive function and the 
same path of data
like C:\backup\folder1\file.txt is the same on remolte folder 
/httpdcos/folder1/file.txt
The problem is that when i testing the script with MB of files
the recursion is much more speed of  transfer of a single file and a
file is copied to a path that is not the same of local folder.
How to fix the problem ?
Sorry for my bad language
Though i don't generally bother with long code samples i decided to make 
an excemption:
i believe calling @ftp_chdir($conn, $remote_folder) in your recursive 
function is wrong instead you should do a CDUP (call the corresponding 
function for that).

btw: get rid of the @ symbols and configure your php.ini so that all 
errors are written to the log file, you will then find it a lot easier 
to debug.

--
Raditha Dissanayake.
--
http://www.radinks.com/print/card-designer/ | Card Designer Applet
http://www.radinks.com/upload/  | Drag and Drop Upload 

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


[PHP] Sending text file to users

2004-11-26 Thread Rosen
Hi,
How can I send 3 text files to user generated from PHP script?
Should I must to generate them first and then to send them to user?
Is there a way to send 3 text files to user in just one PHP script ?

Thanks in advance !

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



[PHP] rounding down

2004-11-26 Thread Brad Ciszewski
hi everyone, i am looking for a snipplet to round down a number. i was 
wondering if you could put a negative number in the round() statement to do 
this, i want it to round down even if its at something.9, as long as its not a 
whole number, if needs to be rounded down. can anyone help me?

Re: [PHP] rounding down

2004-11-26 Thread John Nichel
Brad Ciszewski wrote:
hi everyone, i am looking for a snipplet to round down a number. i was wondering if you could put a negative number in the round() statement to do this, i want it to round down even if its at something.9, as long as its not a whole number, if needs to be rounded down. can anyone help me?
http://us4.php.net/floor
--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] rounding down

2004-11-26 Thread David Bevan
On November 26, 2004 08:58, Brad Ciszewski wrote:
 hi everyone, i am looking for a snipplet to round down a number. i was
 wondering if you could put a negative number in the round() statement to do
 this, i want it to round down even if its at something.9, as long as its
 not a whole number, if needs to be rounded down. can anyone help me?

Searching on the php.net site in the manual is/can be your friend.

You want the floor() function.

Take a look at:
http://ca3.php.net/manual/en/function.floor.php

-- 
Regards,
David Bevan

We could learn a lot from crayons: 
some are sharp, some are pretty, some are dull, some have weird names, 
and all are different colorsbut they all exist very nicely in the same 
box. 

http://www.getanyideas.com

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



Re: [PHP] rounding down

2004-11-26 Thread Marek Kilimajer
Brad Ciszewski wrote:
hi everyone, i am looking for a snipplet to round down a number. i was wondering if you could put a negative number in the round() statement to do this, i want it to round down even if its at something.9, as long as its not a whole number, if needs to be rounded down. can anyone help me?
floor()
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Script Name

2004-11-26 Thread Jerry Swanson
What variable(parameter) in PHP stores file name?

TH

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



Re: [PHP] Script Name

2004-11-26 Thread John Nichel
Jerry Swanson wrote:
What variable(parameter) in PHP stores file name?
TH
Stores what filename?  The name of the file being executed?
$_SERVER['SCRIPT_NAME']
--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Script Name

2004-11-26 Thread Robert Cummings
On Fri, 2004-11-26 at 09:46, John Nichel wrote:
 Jerry Swanson wrote:
  What variable(parameter) in PHP stores file name?
  
  TH
 
 Stores what filename?  The name of the file being executed?
 
 $_SERVER['SCRIPT_NAME']

Or if you want the name of the file included or whatnot...

__FILE__

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



[PHP] Re: Getting static member for a class which name is stored in a variable

2004-11-26 Thread Daniel Schierbeck
Daniel Schierbeck wrote:
public static function getData ()
Ooops, the method shouldn't have been static :)
--
Daniel Schierbeck
Help spread Firefox (www.getfirefox.com): 
http://www.spreadfirefox.com/?q=user/registerr=6584

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


Re: [PHP] Read PDF files with Php

2004-11-26 Thread Jacob Friis
Do I need PDFlib in order to read PDF files?
Is there another way?
 There is a nifty tutorial on this subject over at zends.com
Can I read PDF files with that?
Thanks,
Jacob
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Installing PHP5 on Red Hat

2004-11-26 Thread Sandy Keathley
Has anyone come across this problem?

PHP5 on Red Hat Linux (Enterprise version)

Can't locate API module structure `php5_module' in file 
/usr/local/lib/libphp5.so: /usr/lib/libapr-0.so.0: undefined symbol: 
php5_module


Thanks.

Sandy Keathley

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



[PHP] Running PHP as CGI

2004-11-26 Thread Tim Traver
Hi all,
In the quest to secure php script running, I am starting to think about 
running php as a cgi instead of through the module.

I generally set the open_basedir directory within the apache 
configuration file for individual hosts. If I ran php as a CGI, would 
that directive still be in effect ? or do I have to set that in a 
php.ini file that is specific for that virtual host ?

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


Re: [PHP] Read PDF files with Php

2004-11-26 Thread Brad Ciszewski
i am not sure if this uses PDFlib but, this is a wonderful script which
helps create a PDF file. http://sourceforge.net/projects/pdf-php/


- Original Message - 
From: Jacob Friis [EMAIL PROTECTED]
To: Christopher Way [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Friday, November 26, 2004 9:58 AM
Subject: Re: [PHP] Read PDF files with Php


  Do I need PDFlib in order to read PDF files?
  Is there another way?
   There is a nifty tutorial on this subject over at zends.com
 
 Can I read PDF files with that?
 
 Thanks,
 Jacob
 
 -- 
 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] automatic responder

2004-11-26 Thread Alessandro Rosa
How about coding an automatic responder via PHP ?

Alessandro Rosa


[PHP] proxy - detect

2004-11-26 Thread Brad Ciszewski
does anyone know the function to get the IP address before the proxy-IP?

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



Re: [PHP] proxy - detect

2004-11-26 Thread Jason Wong
On Saturday 27 November 2004 02:10, Brad Ciszewski wrote:
 does anyone know the function to get the IP address before the proxy-IP?

  print_r($_SERVER)

If it's there it's there. If not change proxy(!)

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
A commune is where people join together to share their lack of wealth.
  -- R. Stallman
*/

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



[PHP] Passing Parameters

2004-11-26 Thread David Blackburn
Hi

I used to pass parameters to my scripts like this

shellphp myscript.php dog=maxcat=jess

Since I have upgraded to PHP5 I dont seem to have this functionality
any more, has anyone else noticed this ? or know of a way to get this
working again ?

Thanks
Dave

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



[PHP] mysql_connect vs mysql_pconnect

2004-11-26 Thread fabien champel
hello,
I do not know when I must use mysql_pconnect instead of the mysql_connect :(

what are the real advantages of persistent connections, please ?

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



Re: [PHP] proxy - detect

2004-11-26 Thread Rens Admiraal
Is only possible with proxy servers which support it (transparant 
proxy's)... otherwise it won't work...

Brad Ciszewski wrote:
does anyone know the function to get the IP address before the proxy-IP?
 



[PHP] unlink images

2004-11-26 Thread Julian
Hello,
I would like to delete a set of images right after they are displayed on the 
page using unlink. Unfortunately, with unlink the images are deleted before 
they display on the user's browser. Is there a way to do this?

Thank you! 

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



[PHP] Re: automatic responder

2004-11-26 Thread Manuel Lemos
Hello,
On 11/26/2004 03:58 PM, Alessandro Rosa wrote:
How about coding an automatic responder via PHP ?
The most portable solution is to have a POP3 mailbox associated with the 
  e-mail address to which the messages are received and use a POP3 
client to access and process the message replying to it if that is the case.

You may want to try this POP3 client class to do that.
http://www.phpclasses.org/pop3class
--
Regards,
Manuel Lemos
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/
Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] unlink images

2004-11-26 Thread Vail, Warren
PHP has wonderful capabilities to generate images on the fly, such that they
are never stored on disk, perhaps you should look into that as an option,
you could even make the code decide who should be able to see the image and
who should not.

http://www.php.net/manual/en/ref.image.php

Warren Vail


 -Original Message-
 From: Julian [mailto:[EMAIL PROTECTED] 
 Sent: Friday, November 26, 2004 11:14 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] unlink images
 
 
 Hello,
 I would like to delete a set of images right after they are 
 displayed on the 
 page using unlink. Unfortunately, with unlink the images are 
 deleted before 
 they display on the user's browser. Is there a way to do this?
 
 Thank you! 
 
 -- 
 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] unlink images

2004-11-26 Thread Mike
What you may want to try doing is when the script is ran, it goes through a
clean-up function and deletes everything that it doesn't need for the
current execution.

Though, realize that if two people hit a page within a few seconds, you may
end up deleting some images that the first user is trying to get rid of.
You'll have to judge the traffic for yourself and figure out if this is a
viable option.

Other solutions that I can think of is after the page is ran you update a
text file with the names of the images that are to get deleted and just run
a cronjob to read this file and delete the files in there. Similarly, you
could add the names to a db table with a timestamp and delete all files that
are older than a particular time.

Many options, but you have to figure out what works best for you.

-M

 -Original Message-
 From: Julian [mailto:[EMAIL PROTECTED] 
 Sent: Friday, November 26, 2004 2:14 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] unlink images
 
 Hello,
 I would like to delete a set of images right after they are 
 displayed on the page using unlink. Unfortunately, with 
 unlink the images are deleted before they display on the 
 user's browser. Is there a way to do this?
 
 Thank you! 
 
 --
 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] unlink images

2004-11-26 Thread Jason Wong
On Saturday 27 November 2004 03:13, Julian wrote:

 I would like to delete a set of images right after they are displayed on
 the page using unlink. 

I'm curious to know why you want this.

 Unfortunately, with unlink the images are deleted 
 before they display on the user's browser. Is there a way to do this?

Channel your image requests to a php script that:

  fopen()
  fpassthru()
  unlink()

Haven't tried it, but in theory it looks like it should work.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Talkers are no good doers.
  -- William Shakespeare, Henry VI
*/

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



[PHP] PHP arrays and javascript

2004-11-26 Thread Nick Peters
Hey,

i know this probally a simple question, but it has been stumping me for
quite some time now. How do i pass a php array to a javascript?

i tryed:
script language=javascript
var myarray = new Array(?PHP echo $myarray; ?);
/script

but it didn't work. Anybody got any ideas?

thanks in advance.
-- 
-Nick Peters

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



Re: [PHP] remember me cookie

2004-11-26 Thread Curt Zirzow
* Thus wrote Justin French:
 I've done these plenty of times, but today i've decided to take a 
 serious look at how I do it, and do it the right way.  My current 
 method is just to store the username and an md5 of the password in a 
 couple of cookies.

I'd avoid storing username and expecially any sort of password
(even md5 hashed).  If your athentication uses those values to
validate the user, and those values are accessable, your security
is very low.

If you have a basic authentication system that once the user logs
in you establish some sort of session var that flags the user as
authenticated. I would simply stick with that model, and just
adjust the time that that session is valid.


By default, php only keeps a session that will last for some value
of in-active minutes or until the user closes the browser. All you
need to do is set the ini setting session.cookie_lifetime to a
value (in seconds) for how long you want to remember this session.

I've never tested the above but in theory the idea is to retain the
session until a certain time, if that time has passed forget the
session and start a new one, forcing a new login.

I would avoid supplying a 'remember me' option excpecially if the
information that your application provides is sensitive data.

 
 Is there anything else I should be doing, or an article I should be 
 reading, etc???
 
 Shiflett???  :)

Hopefully he's on a plane to northern california for a good talk I can
attend.


Curt
-- 
Quoth the Raven, Nevermore.

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



Re: [PHP] fedora core 3 mail() not working from web

2004-11-26 Thread Curt Zirzow
* Thus wrote Minuk Choi:
 hey gang, 
 
 I have a fedora core 3, with standard PHP and MySQL included with the 
 distribution.
 
 I'm having a rather odd problem.
 
 the following script(mailTest.php)
 
 ?PHP
 $result = mail('[EMAIL PROTECTED]', 'test subject', 'test message');
 
 if (!$result)
 echo FAILURE;
 else
 echo SUCCESS;
 ?
 
 does NOT work if I access it from the web 
 
 BUT
  
 if I were to execute it as root on the Command prompt
 
 php mailTest.php
 
 It executes correctly and I get mail.
 
 This feels like the apache user is lacking access over sendmail or 
 something... since as root I can execute the script from the CLI without a 
 problem, but from the web, I get a failure.

You're probably on the right track with this.

Check your php.ini settings for sendmail_path. 

Also.. the default setting for sendmail_path is 'sendmail -t -i' so
if sendmail isn't in the path for your webuser then it wont get
executed. To fix this, specifiy in you php.ini with the
sendmail_path the absolute sendmail executable. ie:

  sendmail_path = /usr/sbin/sendmail -t -i

HTH,


Curt
-- 
Quoth the Raven, Nevermore.

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



RE: [PHP] PHP arrays and javascript

2004-11-26 Thread Pablo Gosse
snip
i know this probally a simple question, but it has been stumping me for
quite some time now. How do i pass a php array to a javascript?

i tryed:
script language=javascript
var myarray = new Array(?PHP echo $myarray; ?);
/script

but it didn't work. Anybody got any ideas?
/snip

You need to generate the javascript array from your PHP array.

Example:

In your script create a php array of the values you wish to use.  Using
indeces is not essential.  If you do not use them, you can just use a
counter var when you loop through the array to create the indeces for
the JS array.

?php
$arrayVar = array('first index'='item 1', 'second index'='item 2',
'third index'='item 3');

$jsVar = var myArray = new Array();\n;

foreach ($arrayVar as $idx=$val) {
$jsVar .= myArray['{$idx}'] = {$val}\n;
}
?

The final output of this will be:

var myArray = new Array();
myArray['first index'] = 'item 1';
myArray['second index'] = 'item 2';
myArray['third index'] = 'item 3';

HTH,

Pablo

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



Re: [PHP] Script Name

2004-11-26 Thread Jerry Swanson
I meant, file that are being executed.



On Fri, 26 Nov 2004 09:46:05 -0500, John Nichel [EMAIL PROTECTED] wrote:
 Jerry Swanson wrote:
 
 
  What variable(parameter) in PHP stores file name?
 
  TH
 
 Stores what filename?  The name of the file being executed?
 
 $_SERVER['SCRIPT_NAME']
 
 --
 John C. Nichel
 ÜberGeek
 KegWorks.com
 716.856.9675
 [EMAIL PROTECTED]
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


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



Re: [PHP] PHP arrays and javascript

2004-11-26 Thread Marek Kilimajer
Nick Peters wrote:
Hey,
i know this probally a simple question, but it has been stumping me for
quite some time now. How do i pass a php array to a javascript?
i tryed:
script language=javascript
var myarray = new Array(?PHP echo $myarray; ?);
/script
but it didn't work. Anybody got any ideas?
thanks in advance.
For integers and floats:
var myarray = new Array(?PHP echo implode(', ', $myarray); ?);
For strings:
var myarray = new Array(?PHP echo ''. implode(', ', $myarray) .''; ?);
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: automatic responder

2004-11-26 Thread Curt Zirzow
* Thus wrote Manuel Lemos:
 Hello,
 
 On 11/26/2004 03:58 PM, Alessandro Rosa wrote:
 How about coding an automatic responder via PHP ?
 
 The most portable solution is to have a POP3 mailbox associated with the 
   e-mail address to which the messages are received and use a POP3 
 client to access and process the message replying to it if that is the case.
 
 You may want to try this POP3 client class to do that.

/me ponders how pop3 has to dow with auto respoders

/me then thinks spam.


Curt
-- 
Quoth the Raven, Nevermore.

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



Re: [PHP] help with html through php

2004-11-26 Thread Curt Zirzow
* Thus wrote Todd Alexander:
 Hello all,
 I am a complete newbie to php so apologies for what I'm sure is a
 simple/dumb question.  I want to use php to include another html doc in
 an existing set of documents.  In other words 123.html will use php to
 call on abc.html so I can make changes to abc.html and have it update
 on all my pages.   

I'm not sure what your asking. But by default .html files will
*not* get parsed by php, unless you modifyy how your webserver
treats .html files



Curt
-- 
Quoth the Raven, Nevermore.

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



Re: [PHP] Running PHP as CGI

2004-11-26 Thread Curt Zirzow
* Thus wrote Tim Traver:
 Hi all,
 
 In the quest to secure php script running, I am starting to think about 
 running php as a cgi instead of through the module.
 
 I generally set the open_basedir directory within the apache 
 configuration file for individual hosts. If I ran php as a CGI, would 
 that directive still be in effect ? or do I have to set that in a 
 php.ini file that is specific for that virtual host ?

The directive will be effectve for which ever apache's Directory
direcve applies, other wise the setting to the default directory
will be used.

php in general, has  no clue about virtual hosts. This is rather a
appache issue.


Curt
-- 
Quoth the Raven, Nevermore.

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



[PHP] Re: automatic responder

2004-11-26 Thread Matthew Weier O'Phinney
* Manuel Lemos [EMAIL PROTECTED]:
 Hello,

 On 11/26/2004 03:58 PM, Alessandro Rosa wrote:
  How about coding an automatic responder via PHP ?

 The most portable solution is to have a POP3 mailbox associated with
 the e-mail address to which the messages are received and use a POP3
 client to access and process the message replying to it if that is the
 case.

or IMAP... or use something like procmail or maildrop to pipe an
incoming message to a PHP script that then processes and responds to it
(my preferred method).

 You may want to try this POP3 client class to do that.

Or use PEAR's NET::POP3 classes, or mysql's native imap classes ( which
cover much more than IMAP).

-- 
Matthew Weier O'Phinney   | mailto:[EMAIL PROTECTED]
Webmaster and IT Specialist   | http://www.garden.org
National Gardening Association| http://www.kidsgardening.com
802-863-5251 x156 | http://nationalgardenmonth.org

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



[PHP] Go Back Problem

2004-11-26 Thread Cyrus
Dear All,

I have a problem of back to the previous page in php.
I need to create a form let people to fill in .It can let user to preview the 
form, if information is not correct , user can back to previous page and 
correct it,
I have used the javascript  :  OnClick='history.go(-1)'   and  
OnClick='history.back()'  in php , but it can not workspls help me.

Thanks and Regards,

Cyrus Chan

RE: [PHP] Re: automatic responder

2004-11-26 Thread Michael Sims
Matthew Weier O'Phinney wrote:
 * Manuel Lemos [EMAIL PROTECTED]:
 On 11/26/2004 03:58 PM, Alessandro Rosa wrote:
 How about coding an automatic responder via PHP ?
 
 The most portable solution is to have a POP3 mailbox associated with
 the e-mail address to which the messages are received and use a POP3
 client to access and process the message replying to it if that is
 the case.
 
 or IMAP... or use something like procmail or maildrop to pipe an
 incoming message to a PHP script that then processes and responds to
 it (my preferred method).

Or if using sendmail alias an address to a php script:

username: |/usr/local/bin/your_script.php

I'm sure other MTA's support this as well...

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



Re: [PHP] mysql_connect vs mysql_pconnect

2004-11-26 Thread Robby Russell
On Fri, 2004-11-26 at 19:55 +0100, fabien champel wrote:
 hello,
 I do not know when I must use mysql_pconnect instead of the mysql_connect :(
 
 what are the real advantages of persistent connections, please ?
 

http://www.google.com/search?q=advantages+of+persistent+connection


-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting  Development
*--- Now supporting PHP5 ---
/


signature.asc
Description: This is a digitally signed message part


[PHP] Reg Jpgraph...

2004-11-26 Thread Sagar C Nannapaneni
Hi all,

I think I shouldnt post this here...but i didnt find proper support at the 
jpgraph
forums.

I'm using PHP 4.3.9 with GDK precompiled on apache2 using win2k.

When i open any of the jpgraph example files its giving me an error saying
IE cannot find the site your are requesting. But when i remove some code
in the example file and refresh the page its working and when i put the deleted
code again back in that file and refresh its displaying the graph. When i close
and open a fresh browser the same problem persisting. Couldnt find what might
be the problem.

Again ...i'm sorry for posting this topic here...

/sagar


Re: [PHP] Go Back Problem

2004-11-26 Thread StDog
27  2004 04:59 Cyrus (a):
 Dear All,

 I have a problem of back to the previous page in php.
 I need to create a form let people to fill in .It can let user to preview
 the form, if information is not correct , user can back to previous page
 and correct it, I have used the javascript  :  OnClick='history.go(-1)'  
 and  OnClick='history.back()'  in php , but it can not workspls help
 me.

 Thanks and Regards,

 Cyrus Chan


you must store return point samewhere.
f.e. in hidden area in your form, or in $_SESSION array

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



[PHP] just for test

2004-11-26 Thread StDog
testing

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



Re: [PHP] Running PHP as CGI

2004-11-26 Thread Tim Traver
I guess what I'm really asking is do the php_admin environment variables 
that can get set in Apache get passed to the CGI version of php when 
called as a CGI ?

Tim.
Curt Zirzow wrote:
* Thus wrote Tim Traver:
 

Hi all,
In the quest to secure php script running, I am starting to think about 
running php as a cgi instead of through the module.

I generally set the open_basedir directory within the apache 
configuration file for individual hosts. If I ran php as a CGI, would 
that directive still be in effect ? or do I have to set that in a 
php.ini file that is specific for that virtual host ?
   

The directive will be effectve for which ever apache's Directory
direcve applies, other wise the setting to the default directory
will be used.
php in general, has  no clue about virtual hosts. This is rather a
appache issue.
Curt