[PHP] PHP Auth problem

2001-09-15 Thread Alex Sofronie

Hi all

I have a rather strange problem with php auth:

i want to authenticate a user through php and validate it through
imap_open function (to access his email).
I send WWW-Authenticate header like this:

header(WWW-Authenticate: Basic Realm=\Private\);


After, i check for isset($PHP_AUTH_USER) and validate it through PHP.

Can anyone tell me why, for a real user (it really exists), the
authentication simply fails and asks me again for a username and password,
without even leaving the authenticate intrinsic routine (the script just
keeps telling me that the auth is failed, but WITHOUT running imap_open or
any other part of the script).

Why is that?

If anyone has the time and the understanding, i can post the code
fragment.
Thanks

-
   Alexandru SOFRONIE
 [EMAIL PROTECTED]
-
IT Software Dept.
  Omega-Tehnoton GROUP
 +40-93-670773
-



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




[PHP] user auth

2001-09-14 Thread Alex Sofronie


Hello all! I a relatively newbie in PHP, so my question may appear silly:

Please tell me if anyone has knowledge of
authenticating a user based on his username and password
from Linux system (shadow or anything).
I want to make a php WebMail. Also, i want to make
a ssh virtual web client for the registered user.

Any help would be appreciated.
Thanks,

-- 
-
   Alexandru SOFRONIE
 [EMAIL PROTECTED]
-
IT Software Dept.
  Omega-Tehnoton GROUP
 +40-93-670773
-



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




[PHP] PHP and MySQL auth?

2001-08-28 Thread Alex Sofronie

Hello, all.
What is the difference between:
Case 1: I auth with header('WWW-Auth...') and validate the user from a
plain file. Next, i do something like
mysql_connect($the_db_host,$the_db_username,$the_db_pass);
mysql_select_db($the_db_name);
mysql_query(select * from table);
- and it works fine.

Case 2. Without any form of auth, I read the text file and do
   mysql_connect($the_db_host,$the_db_username,$the_db_pass);
mysql_select_db($the_db_name);
mysql_query(select * from table);

and the server response is:
Error 2002: Can't connect to local MySQL server through socket
'/var/lib/mysql/mysql.sock; (111)

What does this auth do with the rights on mysql?
Thanks.

Alex Sofronie
[EMAIL PROTECTED]


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




Re: [PHP] MySQL Database backup

2001-08-27 Thread Alex Sofronie

Thanks a lot.

- Original Message -
From: Augusto Cesar Castoldi [EMAIL PROTECTED]
To: Alex Sofronie [EMAIL PROTECTED]
Sent: Monday, August 27, 2001 6:22 PM
Subject: Re: [PHP] MySQL Database backup


 Alex,

 i'm using the crontab of linux to run a php script:

 in crontab: wget -q
 http://localhost/backup/backup.php.

 This script uses the MyPHPAdmin
 (http://phpwizard.net/projects/phpMyAdmin/) dump, he
 fopen the php script of MyAdmin (tbl_dump.php) and
 write to a file the result. This is the script

 
 function backup($url, $file)
 {
   if (file_exists($file))
 unlink($file);
   if ($fd = fopen($url, r))
   {
 $aux = fread($fd, 1000);
 fclose($fd);
 $fd = fopen($file, aw );
 fwrite($fd, $aux);
 fclose($fd);
   } else {
 $fd = fopen(logs.txt, aw);
 fwrite($fd, \n\nErro na URL: $url\n\n);
 fclose($fd);
   }
 }
 $file = fiesc.sql;
 $url =

http://$vendaval/libs/phpadmin2/tbl_dump.php?drop=1showcolumns=yesuse_bac
kquotes=1what=dataserver=1lang=pt-brdb=fiesc;
 backup($url, $file);
 --

 see you,

 Augusto




  --- Alex Sofronie [EMAIL PROTECTED] escreveu:  I
 tried find a solution to backup a mysql database
  using php but i didn't
  find anything but the binary file transfer solution
  (just open and binary
  copy all the files in my database directory). But
  this is not a desired
  solution because it involves some security holes
  that I cannot afford.
  Can anyone tell me where can i learn more about
  this? Or some simple :) and
  security holes free solution?
 
  Thanks all.
  Alex Sofronie
  [EMAIL PROTECTED]
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail:
  [EMAIL PROTECTED]
  For additional commands, e-mail:
  [EMAIL PROTECTED]
  To contact the list administrators, e-mail:
  [EMAIL PROTECTED]
 



___
 Yahoo! GeoCities
 Tenha seu lugar na Web. Construa hoje mesmo sua home page no Yahoo!
GeoCities. É fácil e grátis!
 http://br.geocities.yahoo.com/



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




Re: [PHP] MySQL Database backup

2001-08-27 Thread Alex Sofronie

I didn't want to cron the backup, just when the admin does :). Thanks anyway
and here is the solution i came up with: It's based on a prior answer
(thanks, Chris L.) and a pror discussion about forcing download in IE 5.5:


?

$result=`mysqldump -hmy.host.com -u username -ppassword dbname`;

header(Content-Type: application/x-octet-stream);

header(Content-Description: MySQLDatabaseBackup File);

echo $result;

?

This will work with IE 5.0, 5.5, NN6, NN4 (PC-Windows98/Me/2000) and NN4
(PC-RH Linux). But I don't think the platform or browser is guilty about
trying to open without asking first, just the applications it recognizes
(the web plugins installed), right?


- Original Message -
From: Alex Sofronie [EMAIL PROTECTED]
To: PHP General [EMAIL PROTECTED]; Augusto Cesar Castoldi
[EMAIL PROTECTED]
Sent: Monday, August 27, 2001 7:40 PM
Subject: Re: [PHP] MySQL Database backup



  This script uses the MyPHPAdmin
  (http://phpwizard.net/projects/phpMyAdmin/) dump, he
  fopen the php script of MyAdmin (tbl_dump.php) and
  write to a file the result. This is the script
 
  
  function backup($url, $file)
  {
if (file_exists($file))
  unlink($file);
if ($fd = fopen($url, r))
{
  $aux = fread($fd, 1000);
  fclose($fd);
  $fd = fopen($file, aw );
  fwrite($fd, $aux);
  fclose($fd);
} else {
  $fd = fopen(logs.txt, aw);
  fwrite($fd, \n\nErro na URL: $url\n\n);
  fclose($fd);
}
  }
  $file = fiesc.sql;
  $url =
 

http://$vendaval/libs/phpadmin2/tbl_dump.php?drop=1showcolumns=yesuse_bac
 kquotes=1what=dataserver=1lang=pt-brdb=fiesc;
  backup($url, $file);
  --
 
  see you,
 
  Augusto
 
 
 
 
   --- Alex Sofronie [EMAIL PROTECTED] escreveu:  I
  tried find a solution to backup a mysql database
   using php but i didn't
   find anything but the binary file transfer solution
   (just open and binary
   copy all the files in my database directory). But
   this is not a desired
   solution because it involves some security holes
   that I cannot afford.
   Can anyone tell me where can i learn more about
   this? Or some simple :) and
   security holes free solution?
  
   Thanks all.
   Alex Sofronie
   [EMAIL PROTECTED]
  
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, e-mail:
   [EMAIL PROTECTED]
   For additional commands, e-mail:
   [EMAIL PROTECTED]
   To contact the list administrators, e-mail:
   [EMAIL PROTECTED]
  
 
 


 ___
  Yahoo! GeoCities
  Tenha seu lugar na Web. Construa hoje mesmo sua home page no Yahoo!
 GeoCities. É fácil e grátis!
  http://br.geocities.yahoo.com/
 


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



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




[PHP] header()

2001-08-27 Thread Alex Sofronie

Hi all!

Anybody knows where i can find a complete list with headers? A list with
what i can send with the header() function? And what thy mean?
Thanks

Alex Sofronie
[EMAIL PROTECTED]



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




[PHP] PHP auth logout

2001-08-26 Thread Alex Sofronie

Thanks for all the answers to this question but hitting the back button will
work, no authorization required to see the pages all over.
Repost problem:
I'm having a PHP based auth. It seems that unset($PHP_AUTH_USER) or
unset($PHP_AUTH_PW) doesn't work. Also, 401 Unauthorized header does not
work also.
Is there a way to logout and no back button or the user just have to close
his browser in order to accomplish this?

Thanks all, Alex
[EMAIL PROTECTED]



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




[PHP] MySQL Database backup

2001-08-26 Thread Alex Sofronie

I tried find a solution to backup a mysql database using php but i didn't
find anything but the binary file transfer solution (just open and binary
copy all the files in my database directory). But this is not a desired
solution because it involves some security holes that I cannot afford.
Can anyone tell me where can i learn more about this? Or some simple :) and
security holes free solution?

Thanks all.
Alex Sofronie
[EMAIL PROTECTED]


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




[PHP] Re: Need help to create HTML table with 2 columns.

2001-08-26 Thread Alex Sofronie

Try this:
printf(TABLE);
while($row=...fetch()) {
printf(TRTD%s/TDTD%s/TD/TR,$string_variable1,
$string_variable2);
}


- Original Message -
From: John Bass [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, August 23, 2001 6:29 PM
Subject: Re: [PHP] Need help to create HTML table with 2 columns.


 second column should print next record that was returned from the query.

 Thanks.

 John

 From: Jeff Lewis [EMAIL PROTECTED]
 Reply-To: Jeff Lewis [EMAIL PROTECTED]
 To: John Bass [EMAIL PROTECTED], [EMAIL PROTECTED]
 Subject: Re: [PHP] Need help to create HTML table with 2 columns.
 Date: Thu, 23 Aug 2001 11:29:36 -0400
 
 What did you want in the second column?  I was just going by what you had
 listed below:  $row-image_link,
 $row-web_url,$row-image_link, $row-web_url);
 
 
 Jeff
 - Original Message -
 From: John Bass [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Thursday, August 23, 2001 11:16 AM
 Subject: Re: [PHP] Need help to create HTML table with 2 columns.
 
 
   Hi,
  
   Thank you for the email.  I tried your code, but first column is
 printing
   image_link  web_url fields correctly and second column is repeating
 values
   of the first column.
  
   Other records or rows are printing same way.
  
   Regards,
  
   John Bass
  
   From: Jeff Lewis [EMAIL PROTECTED]
   Reply-To: Jeff Lewis [EMAIL PROTECTED]
   To: John Bass [EMAIL PROTECTED],
[EMAIL PROTECTED]
   Subject: Re: [PHP] Need help to create HTML table with 2 columns.
   Date: Thu, 23 Aug 2001 10:41:08 -0400
   
   John,
   
   Try this:
   
   TABLE
   ?php
   $query = SELECT image_link, web_url FROM testdata;
   $result = mysql_query ($query) or die (Query Failed);
   while ($row = mysql_fetch_object ($result))
 {
 printf (trTD.$row-image_links.br.$row-web_url./TD
   TD.$row-image_link.br.$row-web_url./tr\n);
 }
 ?
 /TABLE
   
   - Original Message -
   From: John Bass [EMAIL PROTECTED]
   To: [EMAIL PROTECTED]
   Sent: Thursday, August 23, 2001 10:30 AM
   Subject: [PHP] Need help to create HTML table with 2 columns.
   
   
 Hi All,

 I am trying to generate a table with two columns.  Each column
 should
   print
 2 fields named image_link and web_url.  Have spent over week
looking
 documentations and trying different coding but nothing is working.
 Any
   help
 will be greatly appreciated.

 TABLE
 ?php
 $query = SELECT image_link, web_url FROM testdata;
 $result = mysql_query ($query) or die (Query Failed);
 while ($row = mysql_fetch_object ($result))
 {
 printf (trTD%sbr%s/TD TD%sbr%s/tr\n,
 $row-image_link,
 $row-web_url,$row-image_link, $row-web_url);
 }
 ?
 /TABLE

 Regards,

 John Bass

 _
 Get your FREE download of MSN Explorer at
   http://explorer.msn.com/intl.asp


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



   
   
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
   To contact the list administrators, e-mail:
 [EMAIL PROTECTED]
   
  
  
   _
   Get your FREE download of MSN Explorer at
 http://explorer.msn.com/intl.asp
  
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
   To contact the list administrators, e-mail:
[EMAIL PROTECTED]
  
  
  
 


 _
 Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


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






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




Re: [PHP] Re: PHP based auth -----------------

2001-08-22 Thread Alex Sofronie

Thanks a lot.
And sorry about  in my subject message but at a prior post on
this list I managed to skip some responses due to the volume of this list.
Thanks again,

Alex Sofronie
[EMAIL PROTECTED]
- Original Message -
From: Sheridan Saint-Michel [EMAIL PROTECTED]
To: Alex Sofronie [EMAIL PROTECTED]; php-general
[EMAIL PROTECTED]
Sent: Tuesday, August 21, 2001 4:53 PM
Subject: Re: [PHP] Re: PHP based auth -


 What you are trying to do is covered in the manual here:
 http://www.php.net/manual/en/features.http-auth.php

 I think you specifically was the section:
 Both Netscape Navigator and Internet Explorer will clear the local browser
 window's authentication cache for the realm upon receiving a server
response
 of 401. This can effectively log out a user, forcing them to re-enter
 their username and password. Some people use this to time out logins, or
 provide a log-out button.

 All the details of this are in the manual.

 Sheridan Saint-Michel
 Website Administrator
 FoxJet, an ITW Company
 www.foxjet.com


 - Original Message -
 From: Alex Sofronie [EMAIL PROTECTED]
 To: PHP General [EMAIL PROTECTED]
 Sent: Monday, August 20, 2001 4:12 PM
 Subject: [PHP] Re: PHP based auth -


  No, I'm just using PHP_AUTH_USER and PHP_AUTH PW and i am trying to
  logout... The session_destroy() is not working.
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]



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




[PHP] Re: PHP based auth -----------------

2001-08-20 Thread Alex Sofronie

No, I'm just using PHP_AUTH_USER and PHP_AUTH PW and i am trying to
logout... The session_destroy() is not working.



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




[PHP] PHP based authentification -----------

2001-08-19 Thread Alex Sofronie

Hi all!

How can I logout from a PHP based auth (with PHP_AUTH_USER and PHP_AUTH_PW
and appropriate headers sent at the beginning)?
It seems like unset($PHP_AUTH_USER) does not wotk in this case...

Any help would be appreciated!

Alex Sofronie
[EMAIL PROTECTED]



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




[PHP] Reload - erase ------------- please help!

2001-08-17 Thread Alex Sofronie

Hi all!

Please help me with this problem:

SHORT: how can I erase the content of a page currently displayed in client's
browser? Or other solutions (see LONG)


LONG:
I have a form generated with a php script that looks like:
?
if(!isset($submit)) {
do_form(0);
}
if($real_name==  isset($submit)) {
do_form(1);
}
...

function do_form($err_msg) {
.
if($err_msg==1) {
printf(font color=red);
printf(Real name (*) :);
printf(/font);
}
else {
printf(Real name:);
}
.
}

The script keeps writing forms each time something is wrong... Should I send
a header? With what? Or please tell me where I can find what headers can I
send from inside my php script?


Thanks all,
[EMAIL PROTECTED]



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




[PHP] Session preserve

2001-08-14 Thread Alex Sofronie

Hello!

I am VERY new to php and i have a question (maybe it's pretty simple, but i
couldn't get it work):

I have a form page where i start a session. I cannot use php auth because
the server does not run php as a module. Supposing the client has cookies
disabled, please tell me how to propagate my session variables from the form
page to another (i found that SID can be used in url to preserve session
id) but when i get to the other page (with header(Location:
http://theserver/result.php?SID=$SID;), nothing is there but the SID
variable.
As you could probably figured out, i cannot allow to see the information
entered in the form listed in url.

So, please help me!

thanks, Maxx
[EMAIL PROTECTED]



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