[PHP] Apache 2.x and PHP

2003-07-22 Thread Miguel Angelo
Hi All,

Can anyone aswer this simple question, that i still have not found it 
anywhere...
Is PHP capable of running on Apache 2.x and if so what version ?
And is it stable ?


Thankxs for any reply

Miguel Angelo


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



[PHP] Building a save photo album

2003-06-17 Thread Miguel Angelo

Hi People

I need to build a secure photo album, in a way where only some autenticated 
users can see the images and the images thumbnails.

Some people have given idear to put the images/file directory outside of the 
web server documents, but how can i then insert the images thumbnails on 
html page...
similar toimage=/somepath/my_image_preview.jgp

How can i do this ?
or is there any other thing that i can do under php to prevent this ?

Thankx people
Miguel Angelo



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



[PHP] Building a save photo album

2003-06-17 Thread Miguel Angelo
Hi Again,

I forgot to informe you, i already have the user autentication part working 
ok, i know if the user has permissions to view/user something via one 
serialized variable which defines is running permissions, and the user is 
autenticated using a mysql database

Thankx again


Hi People

I need to build a secure photo album, in a way where only some autenticated 
users can see the images and the images thumbnails.

Some people have given idear to put the images/file directory outside of the 
web server documents, but how can i then insert the images thumbnails on 
html page...
similar toimage=/somepath/my_image_preview.jgp

How can i do this ?
or is there any other thing that i can do under php to prevent this ?

Thankx people
Miguel Angelo

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



[PHP] interact with .htaccess

2003-06-16 Thread Miguel Angelo
Hi People

That is a very good idea, i was thinking about using something similar on a 
file sharing area...

But James, do you know how can we use this to build pages
i mean include images on a html pages on a restricted way

kind like

image=/somewhere/mysecretfile.jpg

Do you know how i can safely restrict file acess and still link this files 
into a html page,  this would for example allow showing a album of photos to 
some users but not all site users.

By the way i'm building a new personal web page and will share the code in a 
open source i think it would be good for newbies like me

Thankx any way
Miguel



From: James Hicks  [EMAIL PROTECTED]
To:   Peter Berglund  [EMAIL PROTECTED]
Date: Sun, 15 Jun 2003 10:55:33 -0400
CC: [EMAIL PROTECTED]
Subject: Re: [PHP] Re: interact with .htaccess  
I think what you really want to do is place your downloadable files in a 
directory that is not in your httpd's document root and use a password 
protected PHP script to access these files and send them to the user after 
authentication. I think you could accomplish this with the fpassthru() 
function and the correct header. htaccess is just going to get in your way.

?
include(authentication.php);
$filename=/path/to/directory/not/in/httpd/doc/root/mysecretpicture.jpg;
$fp=fopen($filename,  rb); 
header(  Content-type: image/jpeg\nContent-Disposition: inline; 
filename=\mypic.jpg\\nContent-length:  .(string)(filesize($filename)) ); 
fpassthru($fp); 
? 




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



[PHP] Scandir Question

2003-06-02 Thread Miguel Angelo
Hi All,

 I have a little question, i would like to load up a array with the file 
list of a virtual directory...
example http://my_server/my_directory

I have seen the scandir function and it looks great, but i would prefer load 
the thing using the virtual directory not the real directory

Is there any way to do this ?, or must i use the fisical directory ???



THankx for reading

Stay happy
Miguel Angelo


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



[PHP] detect proxy

2003-05-29 Thread Miguel Angelo
Hi Sonjaya,

   Here is how i detect a proxy / user external ip and internal ip

   I use the global variable catched by PHP from the web server,
   the web server that i use is Apache i don't know about your's but it might
   work.
   There are tonns of available information here is some that i have debugged 
If you get a 

   User Browser :$GLOBALS[HTTP_USER_AGENT]
   External IP : $GLOBALS[REMOTE_ADDR]
   Internal IP : $GLOBALS[HTTP_X_FORWARDED_FOR]

   Proxy :   $GLOBALS[HTTP_VIA]

Please notice that you might get all, same or partial information from the user
i think the only one that you can trust 100% is the External IP since this is
basic TCP/IP all the rest might be empty or with invalid values. Microsoft ISA
proxy at my job for example does not foward the internal user IP.


try something  print_r($GLOBALS)to check out all the avaliable
informations

you could do something like this

if ( $GLOBALS[HTTP_VIA] ==  ) {
  echo User Proxy is Not Available br;
}
else {
  echo User Proxy: $GLOBALS[HTTP_VIA] br;
}

Hope this help you !

Stay happy
Miguel Angelo


From: sonjaya  [EMAIL PROTECTED]
To: php-general  [EMAIL PROTECTED]
Date: Wed, 28 May 2003 18:02:26 +0700
Subject: detect proxy
dear milist
any body now script to detect browser also ip  event using proxy public or
high anonymous .thank's



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



[PHP] Select DataBase Mysql Problem

2003-03-23 Thread Miguel Angelo
Hi everyone, 

FIRST THANKX FOR ANY HELP !!
and THANKX FOR READING :)

I'm a reall newbie on PHP and i'm build a php app to connect into a mysql
database.. but i cannot select the database

i have build the database, and created a user
with :

create database mydatabase;
use mydatabase;
create tb_users ( userid varchar(20), userpassword varchar(20 );

grant select, update, insert, delete on mydatabase.* to [EMAIL PROTECTED]
IDENTIFIED BY mypassword;

then flush priveliges...
I tested the user on mysql and it work correcly for my the pretended database


NOTES:
O.S. Linux
Mysql : compiled the most recent stable 4.0.12
Php was compiled by SuSe on SuSe 8.0
Php is connected into mysql via socks (configured on /etc/php.ini)

to test the set up i have used the php.net manual example to connect into the
mysql database i manage to connect into mysql but i cannot select the database
can this be my mistake or can it be a software problem ?

here is the php programa

?php
$DB_HOST = localhost;
$DB_USER = myuser;
$DB_PASSWORD = mypassword;
$DB_NAME = mydatabase;


/* Connecting, selecting database */
$link = mysql_connect($DB_HOST, $DB_USER, $DB_PASSWORD) or   
die(Could not connectbr);
print Connected successfullybr;
mysql_select_db($DB_NAME, $link) or die(Could not select
databasebr);

/* Performing SQL query */
$query = SELECT * FROM tb_users;
$result = mysql_query($query) or die(Query failedbr);

/* Printing results in HTML */
print table\n;
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
print \ttr\n;
foreach ($line as $col_value) {
print \t\ttd$col_value/td\n;
}
print \t/tr\n;
}
print /table\n;

/* Free resultset */
mysql_free_result($result);

/* Closing connection */
mysql_close($link);
?

Stay Happy
Miguel Angelo
--- End of Forwarded Message ---




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



Re: [PHP] Select DataBase Mysql Problem

2003-03-23 Thread Miguel Angelo
Thankx a million Tom, 

I used .mysql_error() and i found it right away.
Actualy i have a config.php file with the mysql user information and i was
forgeting to do a include(config.php); before i used mysql.
Really stupid error.

Thankx again.
Miguel Angelo

 Hi,
 
 Sunday, March 23, 2003, 1:26:04 PM, you wrote:
 MA Hi everyone, 
 
 MA FIRST THANKX FOR ANY HELP !!
 MA and THANKX FOR READING :)
 
 MA I'm a reall newbie on PHP and i'm build a php app to connect 
 into a mysql MA database.. but i cannot select the database
 
 MA i have build the database, and created a user
 MA with :
 
 MA create database mydatabase;
 MA use mydatabase;
 MA create tb_users ( userid varchar(20), userpassword varchar(20 );
 
 MA grant select, update, insert, delete on mydatabase.* to [EMAIL PROTECTED]
 MA IDENTIFIED BY mypassword;
 
 MA then flush priveliges...
 MA I tested the user on mysql and it work correcly for my the 
 pretended database
 
 MA NOTES:
 MA O.S. Linux
 MA Mysql : compiled the most recent stable 4.0.12
 MA Php was compiled by SuSe on SuSe 8.0
 MA Php is connected into mysql via socks (configured on /etc/php.ini)
 
 MA to test the set up i have used the php.net manual example to 
 connect into the MA mysql database i manage to connect into mysql 
 but i cannot select the database MA can this be my mistake or can 
 it be a software problem ?
 
 MA here is the php programa
 
 MA ?php
 MA $DB_HOST = localhost;
 MA $DB_USER = myuser;
 MA $DB_PASSWORD = mypassword;
 MA $DB_NAME = mydatabase;
 
 MA /* Connecting, selecting database */
 MA $link = mysql_connect($DB_HOST, $DB_USER, $DB_PASSWORD)
  or   MA die(Could not connectbr); MA print Connected
successfullybr;
 MA mysql_select_db($DB_NAME, $link) or die(Could not select
 MA databasebr);
 
 MA /* Performing SQL query */
 MA $query = SELECT * FROM tb_users;
 MA $result = mysql_query($query) or die(Query failedbr);
 
 MA /* Printing results in HTML */
 MA print table\n;
 MA while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
 MA print \ttr\n;
 MA foreach ($line as $col_value) {
 MA print \t\ttd$col_value/td\n;
 MA }
 MA print \t/tr\n;
 MA }
 MA print /table\n;
 
 MA /* Free resultset */
 MA mysql_free_result($result);
 
 MA /* Closing connection */
 MA mysql_close($link);
 ?
 
 MA Stay Happy
 MA Miguel Angelo
 MA --- End of Forwarded Message ---
 
 Add a call to mysql_error() to find out what mysql does not like.
 
 mysql_select_db($DB_NAME, $link) or die(Could not select 
 database: .mysql_error().br);
 
 -- 
 regards,
 Tom




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



[PHP] Newbie Security Questions...

2003-02-25 Thread Miguel Angelo
Hi all, 

   First thankx for reading this !.
   I'm a Newbie in PHP, previously i was doing web stuff in perl.

   I want to do a site were you login, and depending on the login account 
the user receives a given set of permissions.

   From what i have studid the session management, were you start a session 
id, and can put in several variables... My question is this, this variables 
remain were ? on the user browser (cookies, url enconding ?) or does the 
user just receive the single session id, and the rest remain on the server ?
This is a important security consideration for me.

Any help will be great

Stay well !
Miguel Angelo
e-mail: [EMAIL PROTECTED]
http://migas.mine.nu


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