Re: [PHP] Weird problem with HTML form and $_POST

2008-11-05 Thread Oscar Gosdinski
On Wed, Nov 5, 2008 at 8:47 AM, Oscar Gosdinski [EMAIL PROTECTED] wrote:
 Name the select tag as sub_projects[], then in PHP you can read the
 $sub_project variable as an array.

Oops, my error... you have to use the $_POST['sub_projects'] variable
as an array.

-- 
Saludos
Oscar

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



Re: [PHP] Weird problem with HTML form and $_POST

2008-11-05 Thread Oscar Gosdinski
On Sat, Nov 1, 2008 at 6:20 PM, Michelle Konzack
[EMAIL PROTECTED] wrote:
select class=setupProjectAddSelect name=sub_projects 
 multiple=multiple size=10
   option value=6 selectedATX 120/option
   option value=4ATX 60/option
   option value=5ATX 90/option
   option value=11Device 2/option
   option value=12Device 4/option
   option value=13Lowvoltage/option
   option value=7P4 Module/option
   option value=8SATA 2/option
   option value=9 selectedSATA 4/option
   option value=10 selectedSATA 8/option
/select

 Hell, why is $_POST['sub_projects'] eating the  other  three  items  and
 take only the last one?

Name the select tag as sub_projects[], then in PHP you can read the
$sub_project variable as an array.

-- 
Saludos
Oscar

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



Re: [PHP] 2 successive commands in one shell_exec?

2008-10-21 Thread Oscar Gosdinski
On Mon, Oct 20, 2008 at 9:16 PM, Govinda [EMAIL PROTECTED] wrote:
 I mean I need to do that, and so with my very newbie level of understanding
 I think I need to have that shell_exec essentially do 2 things at once:
 -goto the right dir, and then
 -fire the script in that dir.
 like these 2 successive commands in terminal:
 cd $MyPath
 ./MyOtherCGI.cgi

cd $MyPath  ./MyOtherCGI.cgi

or you maybe using full path:

$MyPath/MyOtherCGI.cgi

-- 
Saludos
Oscar

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



Re: [PHP] Code Critique Please :)

2007-11-22 Thread Oscar Gosdinski
On Nov 21, 2007 2:05 PM, Simeon F. Willbanks [EMAIL PROTECTED] wrote:
 3. Object Oriented principles
I see that you tried to implement Singleton pattern in the DB class,
but you have a mistake. $dbConnection attribute is not a static
member, so every time you call the constructor $dbConnection won't be
initialized, so your code will always initialize this attribute.

There is something that i always wonder about Singleton pattern in
PHP, do you really have a benefit using this pattern in PHP? The idea
behind this pattern is that only one instance of the class is created,
it works great in Java because all requests are processed inside a JVM
and this instance created will really be the only one defined. Because
in PHP every request has its own environment, you will have several
instances of this class per request processed.

 4. Strategy Design Pattern
 - Interface used for column attribute parsing
I've checked the code in MySQLToXML.phps and i see a lot of
ParseDatabaseColumnAttributeXXX classes that implements
ParseDatabaseColumnAttribute interface. I think that those classes
should be methods of  a DatabaseColumnAttributeParser instead of
defining so many classes. Also the names of those classes suggest me
that they are methods not objects.

-- 
Saludos
Oscar

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



Re: [PHP] losing session variable

2007-05-07 Thread Oscar Gosdinski

On 5/6/07, Alain Roger [EMAIL PROTECTED] wrote:

if i check before header command what is the value of $_SESSION['username'],
i get the right value.
however, if i place on the first line of welcome.php file the following code
:

echo br1. Before session;
 session_start();
 echobrUsername : .$_SESSION['username'];
 echo br2. After session;


i get empty value for this session variable.
How is it possible ?


You have to execute the session_start method before any data have been
sent to the client. You are sending data to the browser with 'echo
br1. Befor Session;'

--
Saludos
Oscar

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



Re: [PHP] ibm universe database

2007-03-01 Thread Oscar Gosdinski

Do you mean IBM DB2 Universal Database?

I search on google with the following text: php db2 and the first result was:
http://www-128.ibm.com/developerworks/db2/library/techarticle/scott/0614_scott.html

I think this link will help you.

On 3/1/07, Fernando Viadero [EMAIL PROTECTED] wrote:

i have to take some data from a IBM universe database on a windows server
from my linux+php web server..


--
Saludos
Oscar

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



Re: [PHP] Pasar varialbe sin GET

2007-02-11 Thread Oscar Gosdinski

Revisa las directivas RewriteEngine, RewriteRule de Apache.
Por cierto, esta es una lista en inglés.

Review the Apache directives: RewriteEngine, RewriteRule.
BTW, this is an english list.

On 2/11/07, Anuack Luna [EMAIL PROTECTED] wrote:

Hola a todos. PHP

Bueno, mi consulta es complicada

Normalmente se pasa una variable así:

nombredelarchivo.php?valor=variable
nombredelarchivo.php?id=x

La pagina nombredelarchivo.php recibe la variable de la otra Web page

Hasta hay nop broblem

He visto en los portales como por ejemplo crean un solo archivo para
imprimir un valor como si fuera una carpeta.

Ejemplo:

pagina/usuari_1
pagina/usuari_2
pagina/anuack
pagina/lolita.

Para mi seria lógico que en donde dice anuack es una carpeta... NO???

He visto nombre de archivos {name}.php pero no encuentro como lleva un valor
y convierte a {name}.php en anuack, lolita, usuario... etc.

Como envía un valor o variable a {name}.php  y como la recibe {name}.php  si
por método GET no funciona

También he probado en variable de formulario, cookie, variable de sección
Algo ilógico pero lo probé, variable de servidor y valor introducido y
nada de nada

Claro, puedo hacer que me imprima por ejemplo 18.php, pero no encuentra el
archivo.



--
Saludos
Oscar

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



Re: [PHP] _GET('name') truncates

2007-02-05 Thread Oscar Gosdinski

When you send GET all the parameters are sent in the HTTP header and
this header has a limited length. If you want to send large parameters
in a form you have to use POST which send this data on the HTTP body
and it has no limit.

On 2/5/07, Ramon [EMAIL PROTECTED] wrote:

Hi all,

I've written a php script, called test.php, consisting of the following
statements:

?php
error_reporting(E_ALL);
$query = $_GET['sql'];
echo $query;
?
Using the script with 'small' values for the parameter sql works fine.
Although, using the script with the sql query as specified below


--
Saludos
Oscar

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



Re: [PHP] md5

2007-01-17 Thread Oscar Gosdinski

Instead of hashing the password, i prefer to use the following procedure:

$user = ...
$password = ...
$hash = md5($user . $password);

Using this method, it will be very dificult guess the password if you
get the hash because it depends also on the user name.

When you are going to login a user you have to check the hash stored
in the database against the result of applying the md5 function on the
result of concatenating the user name and the password provided by the
user.

if ($db_hash == md5($user . $password)) {
 // logged
} else {
 //error
}

On 1/17/07, tedd [EMAIL PROTECTED] wrote:

That's also the way hackers break it, namely take the hash and use a
reverse dictionary to look-up the password. While the MD5 hash is
non-reversible, it produces a unique string.

If people use simple passwords, then the hash is pretty simple to
break. As people become more aware of how simple it is to break their
passwords, their passwords will become more complex. However, reverse
dictionaries will also become larger as processing speeds increase --
and the cycle continues.

So, the amount of security that MD5 provides is really dependant upon the user.


--
Saludos
Oscar

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



Re: [PHP] Format of Encrypted Password

2006-09-07 Thread Oscar Gosdinski

On 9/5/06, Kevin Murphy [EMAIL PROTECTED] wrote:

The only thing I can find anywhere in the code is this:

$auth_user = $_SERVER['PHP_AUTH_USER'];
$auth_pw = $_SERVER['PHP_AUTH_PW'];
$query = select name from table where name = '$authuser' and
password = password('$auth_pw');



You are using the password() function of mysql to 'encrypt' the password.

--
Saludos
Oscar

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



Re: [PHP] Is this unsecure?

2006-09-05 Thread Oscar Gosdinski

On 9/5/06, tedd [EMAIL PROTECTED] wrote:

At 4:48 PM +0200 9/5/06, Satyam wrote:
It's my understanding that while MD5 has cannot be decrypted some
encryption can be cracked by matching matching results. They don't
have to work the code backwards.

For example, if I MD5 apple -- it will produces a corresponding
code (1f3870be274f6c49b3e31a0c6728957f). If a cracker has a library
of dictionary hash codes, it's a simple matter to compare all those
hash codes with my code to find a corresponding match, thus exposing
apple as the encrypted word.

That's one of the reasons why one shouldn't use a real word as a password.


If you are going to validate a e-mail address and a password i think
that is a better approach to generate the following hash:
$hash = md5($email . $password)

In this case, there is no way to get the clear password if you know
hash and have a database of hash codes.

--
Saludos
Oscar

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



Re: [PHP] shutting down a web app for maintenance

2006-06-22 Thread Oscar Gosdinski

On 6/20/06, Jon Anderson [EMAIL PROTECTED] wrote:

Assuming you're using a web server that supports htaccess files, you
could easily just pop in a .htaccess file that denies access to
everything. You could even add a PHP ini directive like:

php_value auto_prepend_file maintenance.php

where maintenance.php could contain something like:

htmlheadtitleDown for Maintenance/title/headbodySite down
for maintenance!/body/html ?php exit(0); ?


if this is the case, why don't you put clean session sentences in your
maintenance.php. With those sentences you are sure that anybody that
wants to access your application will be kicked off.

--
Saludos
Oscar

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



Re: [PHP] (Apache|php) Bug using modproxy

2006-04-26 Thread Oscar Gosdinski
I have the configuration you described:

browser -- https- mod_proxy - http - php

and i don't have any problem with it. Maybe it's an Apache
misconfiguration. Can you send a snap of your httpd.conf?

On 4/26/06, Lmwangi [EMAIL PROTECTED] wrote:
 Hi all,
  First time on the list... sorry for any errs.
  I am using mod_proxy to pass requests to an internal server in our
 lan. The setup looks like

 Enduser---INet_link-Mod_proxy_serverLan---PHP_script

 Now,

 this  does not work:

 Enduser---https---Apache_mod_proxy-http---Destination_server.

 * When a user submits a form (php) with a file upload and  $_POST
 vars, the $_POST array is mangled (missing) elements and the $_FILES
 array is empty


--
Saludos
Oscar

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



Re: [PHP] Is this password protection script secure?

2006-03-14 Thread Oscar Gosdinski
Instead of using a hash if the password string, i prefer to save the
following in the password field of my user's table:

md5($user . $password)

There are some md5 databases around that can be used to get the
cleartext password from the hash if your database is compromised, if
you use this method it's difficult to get the cleartext password
because it depends on the user and you are also validating if the user
exists.

However, i have a question. Which is better?, the md5 function
provided by PHP or MySQL? i used the MySQL function because i didn't
compile PHP with support for hash.

--
Saludos
Oscar

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



Re: [PHP] ODBC and DB2 functions (PDO_ODBC)

2005-09-28 Thread Oscar Gosdinski
Check this article, it will help you using PDO and DB2:
http://www-128.ibm.com/developerworks/db2/library/techarticle/dm-0505furlong/index.html

However, you can access a DB2 server using the unified ODBC extension
which actually i configured on a production enviroment.
http://www-128.ibm.com/developerworks/db2/library/techarticle/dm-0502scott/index.html

On 9/28/05, Dan McCullough [EMAIL PROTECTED] wrote:
 Anyone have any experience with DB2 over ODBC or JDBC from PHP on
 Linux?  Looking for some idea of what I will need to be able to
 connect to a DB2 server on our network.


--
Saludos
Oscar

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



[PHP] lib ssh2 functions

2005-05-13 Thread Oscar Gosdinski
Hello everybody:

I need my PHP application connects through SSH to other server for
getting some info to display and i tried the following code to test
lib ssh2:

$server = ...;
$user = ...;
$passwd = ...;

$con = ssh2_connect($server, 22);
if (ssh2_auth_password($con, $user, $passwd)) {
   $s = ssh2_exec($con, 'ls -l');
   $file = fopen(/tmp/test, w);
   while ($line = stream_get_line($s, 1024)) {
   fwrite($file, $line);
   fflush($file);
   }
   fclose($file);
} else {
   echo Authentication Error;
}

The file /tmp/test was created but it does not have any data. I can
connect to the server using a normal ssh session in my laptop and the
'ls -l' command returns me information.
I think that i installed correctly the ssh2 functions because if a put
an incorrect password i get the Authentication Error message.

I searched the web for info about similar problems and no results.
Please, anyone can help me with this problem because i have been
spending three days with this.

Thanks in advance for your answers.

-- 
Saludos / Regards
Oscar

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