[PHP] $_SELF[PHP_SELF] not working anymore

2003-09-16 Thread Maria Garcia Suarez
Hi there!

I'm currently developing some pages where I use
$_SELF[PHP_SELF], always without any kind of problem
(until some days ago).

Some days ago, as I said, I formated my hard disk,
installed everything again and from that day on
$_SELF[PHP_SELF] stopped working, same goes for
$_SERVER[REQUEST_URI] or $_GET[location] (which are
the solution I tried to find, without success). The
page says:

Notice: Undefined index

(for $_GET) or it just says nothing (the other ones
above, no error reported, it just displays nothing).

Inside PHP.ini I have globals set to On, but if I set
them to Off nothing changes...

Can anyone help me? At PHP.net I saw If PHP is
running as a command-line processor, this variable is
not available, but I am running it from a web page on
Windows 2000 + Xitami.

Thanks a lot for your help and sorry if I asked
something stupid, but I couldn't find any solution

Kisses,
Maria

__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

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



[PHP] RE: $_SELF[PHP_SELF] not working anymore

2003-09-16 Thread Maria Garcia Suarez
Hi there!

--- Javier Tacon [EMAIL PROTECTED] wrote:

 Try with $_SERVER[PHP_SELF]

Then I get:

Parse error: parse error, unexpected
T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or
T_VARIABLE or T_NUM_STRING in

This is how I use it:
$currentAddress=$_SERVER[HTTP_HOST]$_SERVER[PHP_SELF];

Thanks for your reply anyway.

Kisses,
Maria

__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

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



[PHP] Re: $_SELF[PHP_SELF] not working anymore

2003-09-16 Thread Maria Garcia Suarez
Hi there!

First, thanks for your reply...

--- Curt Zirzow [EMAIL PROTECTED] wrote:
 * Thus wrote Maria Garcia Suarez
 ([EMAIL PROTECTED]):
   Try with $_SERVER[PHP_SELF]
  Then I get:
  Parse error: parse error, unexpected
  T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or
  T_VARIABLE or T_NUM_STRING in
  This is how I use it:
$currentAddress=$_SERVER[HTTP_HOST]$_SERVER[PHP_SELF];
 You should always quote your array keys (cept if all
 the keys are
 numeric.  Also when inside a string, enclose your
 variables with
 {}.
$currentAddress={$_SERVER['HTTP_HOST']}{$_SERVER['PHP_SELF']};
 php wont be so confused as what you're trying to do.

I also tried with $_SERVER[PHP_SELF] alone (echo
$_SERVER[PHP_SELF]; or echo
$_SERVER['PHP_SELF'];), and it doesn't work. I
personally don't think PHP is confused about what I'm
trying to do...

Thanks anyway.

Do you have any other idea? I already ran out of
them... :-(

Kisses,
Maria

__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

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



[PHP] Re: $_SELF[PHP_SELF] not working anymore *** SOLVED!

2003-09-16 Thread Maria Garcia Suarez
Hi there!

First I would like to send a big THANKS to all the
people who tried to help me.

And after that, the solution It was a problem of
the server (Xitami), browsing around the PHP.net
server I found the following comment:

---CUT---

Using the CGI (c:\php[version]\php.exe) with Xitami
since PHP version 4.3.2 requires the following setting
in php.ini before the $_SERVER['PHP_SELF'] call will
return a value:

cgi.fix_pathinfo=1

Note that $_SERVER['SCRIPT_NAME'] still works.

---CUT---

With that change and after some hours of search my
pages started to work again...

Kisses for everybody,
Maria


--- Maria Garcia Suarez [EMAIL PROTECTED]
wrote:
 Hi there!
 
 I'm currently developing some pages where I use
 $_SELF[PHP_SELF], always without any kind of problem
 (until some days ago).
 
 Some days ago, as I said, I formated my hard disk,
 installed everything again and from that day on
 $_SELF[PHP_SELF] stopped working, same goes for
 $_SERVER[REQUEST_URI] or $_GET[location] (which are
 the solution I tried to find, without success). The
 page says:
 
 Notice: Undefined index
 
 (for $_GET) or it just says nothing (the other ones
 above, no error reported, it just displays nothing).
 
 Inside PHP.ini I have globals set to On, but if I
 set
 them to Off nothing changes...
 
 Can anyone help me? At PHP.net I saw If PHP is
 running as a command-line processor, this variable
 is
 not available, but I am running it from a web page
 on
 Windows 2000 + Xitami.
 
 Thanks a lot for your help and sorry if I asked
 something stupid, but I couldn't find any
 solution
 
 Kisses,
 Maria
 
 __
 Do you Yahoo!?
 Yahoo! SiteBuilder - Free, easy-to-use web site
 design software
 http://sitebuilder.yahoo.com
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

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



[PHP] Protecting files with PHP

2003-07-17 Thread Maria Garcia Suarez
Hi there!

I'm developing an application to which you can upload
files. Right now the destination folder of those files
is at /public_html/files which makes them visible from
the internet.

I thought of putting that ./files/ folder outside the
./public_html/ folder and make those files be only
accessible via PHP pages (if the pages doesn't display
a link to that folder there's no way to download the
file). But, there's any way to keep on having the
./files/ folder inside ./public_html/ and have those
files protected? Right now to identify users
(authenticate them) I use session variables... it
should be a protection that could be used together
with session variables

Thanks a lot.

Kisses,
Maria

__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

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



Re: [PHP] fake .php extension

2003-07-15 Thread Maria Garcia Suarez
Hi there!

--- Nabil [EMAIL PROTECTED] wrote:
 How can confugure Apache to execute a real php files
 but with fake extention
 like .foo  or .pl or even .html?

I don't have any Apache around right now but you have
to search inside httpd.conf for the php string, one
of the entries is the one defining which files should
be processed by php before giving the results to
Apache. Just add .html, .whatever to the .php that is
already listed there.

Kisses,
Maria

__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

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



[PHP] mail() sending mails twice to the e-mails addresses at BCC

2003-07-15 Thread Maria Garcia Suarez
Hi there!

As I explained yesterday I am developing a group of
pages to let users send mails from them. For that I am
using the mail() function.

The problem I face is that the addresses I write at
the BCC field receive mails twice (not the one at the
To: field, just the ones at the BCC:).

It only happens when I use mail(). Following the
advice of the people on the list I installed
phpmailer. Using it I don't have that problem, it only
happens when I use mail() alone And it only
happens with the addresses at BCC.

I've checked the logs of the mail server and I see how
the pages send the RCPT TO so many times... so it's
not a problem of the mail server.

I am using Windows ME with PHP Version 4.3.1. Do you
know if it's a bug of that version?

Also, is there any way to keep track of what PHP is
doing? To make it display on the pages or somewhere
else what on earth is it doing to send those mails
twice Thanks..

Kisses,
Maria

__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

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



[PHP] Send mail using external server

2003-07-14 Thread Maria Garcia Suarez
Hi there!

I'm developing a program that has a kind of mail
client from where users can send mails and get a blind
copy in their e-mail boxes. The program uses mail() in
those servers having a SMTP installed in the very same
server. I would like to let people send mails even if
the server is not able to handle them.

To do that I've googled around and found the following
script (see below). The problem is that blind copies
don't reach destination, mails in the To: field arrive
well, mails in the BCC: desappear and never reach the
mailbox (nor get back :-?

Does anyone know what's going wrong? Thanks.

?
/*
pipemail v.0.1

PHP-script to send mails via socket, e.g. using
an external smtp-server

(c) Robert Strouhal 2002
http://www.strouhal.de

Feel free to use, copy and modify this script.
PLEASE REMIND: IT COMES WITH ABSOLUTELY NO GUARANTEE!

How to use:
---
Integrate the file to your own sripts by using
require or inlude
Modify the setting in line 30-32
gosmtp($from,$to,$subject,$cc,$bcc,$message);
Example: gostmtp([EMAIL PROTECTED],
[EMAIL PROTECTED],
This is my subject, ,, This is my message to
you);
*/


// settings, please modify for your own website
global $server, $port, $logsmtp;
$server = $mailServer;   //domain of your
smtp-server
$port = 25;//SMTP-Port, usually 25
$logsmtp = 1;  //set 1 if the smtp
communication should be logged to the file smtp.log in
the same folder

// don't edit the code below as long as you don't know
what to do...

function listen2server() {

global $log;
  global $server;
  global $socket;
  global $logsmtp;

  $antwort = fgets($socket, 1500);

  if ($logsmtp=='1') {
  $log = SERVER: .$antwort;
$datei = fopen(smtp.log, a);
fputs($datei, $log);
fclose($datei);
  }

  $code = substr($antwort, 0, 3);
  return $code;

}


function talk2server($commands) {
  
global $log;
  global $server;
  global $socket;
  global $logsmtp;

  fputs($socket,$commands);

  if ($logsmtp=='1') {
$log = CLIENT: .$commands;
$datei = fopen(smtp.log, a);
fputs($datei, $log);
fclose($datei);
  }
}


function gosmtp($from,$to,$subject,$cc,$bcc,$message)
{

global $server;
global $socket;
global $port;
global $logsmtp;

if ($socket = fsockopen($server,$port))
{
//set_socket_timeout($socket, 30);
if (listen2server() == 220)
talk2server(HELO .getenv('HTTP_HOST').\n);
if (listen2server() == 250)
   talk2server(MAIL FROM: .$from.\n);
   if (listen2server() == 250)
  talk2server(RCPT TO: .$to.\n);
  if (listen2server() == 250)
talk2server(DATA\n);
 if (listen2server() == 354)
{
$content  = Subject: $subject\r\n;
$content .= From: $from\r\n;
$content .= To: $to\r\n;
if ($cc!=) {
$content .= Cc: $cc\r\n;
}
if ($bcc!=) {
$content .= Bcc: $bcc\r\n;
}
$content .= Reply-To: $from\r\n;
$content .= Errors-To:
$from\r\n;
$content .= Bounce-To:
$from\r\n;
$content .= X-Mailer: sent via
PipeMail v0.1, check www.strouhal.de for the PHP
script\r\n;
$content .= X-Please_remind: I am
not responsible for the misuse (spam...) of this
script!\r\n;
$content .=
\r\n.$message.\r\n;
$content .= .\r\n;
echo PRE$content/PRE;
talk2server($content);
if (listen2server() == 250)
{//listen2server();
 $mailsent = true;}
else
{$mailsent = false;
//listen2server();
}

   }
   talk2server(QUIT\n);
   listen2server();

  if ($mailsent) {
  echo PMail sent/P;
return true;
} else {
  echo ttfont color='red'Couldn't deliver
mail to $to!/b/font/ttbr\n;
  return false;
}
}

else
{
echo ttfont color='red'Wasn't able to connect to
$server:$port!/b/font/ttbr;
return false;
}
}

?

__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

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



Re: [PHP] Send mail using external server

2003-07-14 Thread Maria Garcia Suarez
Hola Juan!

Thanks for your help Juan :-)

A simple but must-be-asked question...

--- Juan Nin [EMAIL PROTECTED] wrote:
 From: Maria Garcia Suarez
 [EMAIL PROTECTED]
 
  The problem is that blind copies
  don't reach destination, mails in the To: field
 arrive
  well, mails in the BCC: desappear and never reach
 the
  mailbox (nor get back :-?
 [...]
 talk2server(MAIL FROM: .$from.\n);
 if (listen2server() == 250)
talk2server(RCPT TO: .$to.\n);
if (listen2server() == 250)
  talk2server(DATA\n);
   if (listen2server() == 354)
  {
  $content  = Subject: $subject\r\n;
  $content .= From: $from\r\n;
  $content .= To: $to\r\n;
  if ($cc!=) {
  $content .= Cc: $cc\r\n;
  }
  if ($bcc!=) {
  $content .= Bcc: $bcc\r\n;
  }
 the problem is that the script should send a RCPT
 TO for every recipient,
 and it only send it for $to
 so this script only works with the $to field,
 neither the $cc nor $bcc will
 work...
 moreover, the $content .= Bcc: $bcc\r\n; line
 should not go!!!
 if not you are putting the info about the BCC in the
 mail headers and
 everyone will be able to see it..

What should I change in the script in order to make it
work?

Thanks a lot for your help.

Besos,
Maria

__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

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



Re: [PHP] Send mail using external server

2003-07-14 Thread Maria Garcia Suarez
Hi there!

--- Curt Zirzow [EMAIL PROTECTED] wrote:
 Juan Nin [EMAIL PROTECTED] wrote:
  From: Maria Garcia Suarez
 [EMAIL PROTECTED]
  [...]
 
  but, IMHO, that script isn't well coded as you
  have already seen, and I also
  don't like the way it's programmed, it's very
  rudimentary... I would use
  phpmailer as someone told you before instead..
 Agreed! :D

Ok, thanks Pete, Juan  Curt for your help :-)  I'll
try that :-)

Kisses for you guys :-*

Maria


__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

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



Re: [PHP] Send mail using external server

2003-07-14 Thread Maria Garcia Suarez
Hi there!

--- Juan Nin [EMAIL PROTECTED] wrote:
 From: Curt Zirzow [EMAIL PROTECTED]
  You must send the rctp to's bfore you start
 sending the data. To be
  a more stable smtp client there should be more
 sanity checking before
  blindy doing this:
 
  if ($cc != ) {
$CC = split(',', $cc);
foreach ($CC as $ccemal) {
  talk2server(RCPT TO: $ccemail\n);
}
  }
  Then repeat for BCC's
 good!! you also included the code for her  :)

With the proposed changes does it become something
usable? I wouldn't like to start using a huge
(somehow, compared to this little script) script just
to send a very simple mail...

Thanks!

Kisses,
Maria

__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

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