Re: [PHP] php array in different OS

2010-07-27 Thread jose javier parra sanchez
you are probably getting a memory limit error, check your php.ini

2010/7/21 fyang fy...@ipp.ac.cn:
 Dear all,
   I have a simple test code in different OS ,but it give me a different
 result.
   the code as follows:
  ?php
   $n= 5;
   for($i=0;$i$n;$i++)
   {
$data[]=array(,$i,$i/1000);
echo $i,  ,$data[$i][1],br;
   }
   echo count:,count($data);
  ?
  OS1:  Red Hat Enterprise Linux Server release 5.1
Linux 2.6.18-53.el5xen i686 i686 i386 GNU/Linux
  test result:  the result is correct,it can display 5 data and
 count:5.

  OS2: CentOS release 5.4
   Linux 2.6.18-164.el5 x86_64 x86_64 x86_64 GNU/Linux
  test result: the result is wrong,it can only display 31148 data and it can
 not display count value.
  I'm not sure the result relate to array capacity in different OS.
  Please give me some tips,thanks in advance.

 good luck,

 Yang Fei
 2010-7-20

 --
 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] I'm a newbie and running php on Linux

2010-03-31 Thread jose javier parra sanchez
Check your php.ini , look for output_buffering

2010/3/31 King Coffee kcof...@hotmail.com:
 Hi,

 I ran the following code snippet on Windows IIS 7, in my index.php file and
 it worked fine. But when run it on Linux, the die code is executed.

 Is there an include file or something else I need to to process this on a
 linux server?

 ?php
        echo 'h1Redirecting... Please Wait/h1';
 /*
        redirect('welcome.html');
 */
        if (!headers_sent()) {
                header('Location: ' .
 'http://auction.househops.com/index.php');
        } else {
                die('Could not redirect.');
        }
 ?


 Thanks,
 King

 --
 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] Will PHP ever grow up and have threading?

2010-03-24 Thread jose javier parra sanchez
 On 24 March 2010 10:38, Rene Veerman rene7...@gmail.com wrote:
 and if threading and shared memory aren't implemented, then hey, the
 php dev team can build something else in that these naysayers DO need
 eh...

 lol...


take a look at this - http://nanoserv.si.kz/

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



[PHP] error_append_string and error_log

2009-07-15 Thread Javier Ruiz
Hi!

I'm trying to append some extra info to my php errors. It works well when
I'm displaying errors on screen, but it doesn't work to log the extra info
into an error file (log_errors and  error_log). I mean, if I use this:

?php
ini_set('display_errors', 1);
ini_set('log_errors', 1);
ini_set('error_log', './ERRORS');
ini_set('error_append_string',  -- SomeStuff!);
require 'test.php';   // this file contains syntax errors...


When I issue this using a web browser, I get a syntax error shown in the
browser and it contains the SomeStuff text, but in the ERRORS file I just
get the php error without the SomeStuff text...

Is there any way to get this working?

Thanks!
Regards,

JaviRuiz.


Re: [PHP] error_append_string and error_log

2009-07-15 Thread Javier Ruiz
Hi, thanks for your reply.

The thing is, I need to set it in runtime (ini_set) since I want to append
the URI that generated the error, so I'll need to use some $_SERVER
variables.

Regards

JaviRuiz.



On Wed, Jul 15, 2009 at 2:25 PM, Ashley Sheridan
a...@ashleysheridan.co.ukwrote:

 On Wednesday 15 July 2009 12:44:21 Javier Ruiz wrote:
  Hi!
 
  I'm trying to append some extra info to my php errors. It works well when
  I'm displaying errors on screen, but it doesn't work to log the extra
 info
  into an error file (log_errors and  error_log). I mean, if I use this:
 
  ?php
  ini_set('display_errors', 1);
  ini_set('log_errors', 1);
  ini_set('error_log', './ERRORS');
  ini_set('error_append_string',  -- SomeStuff!);
  require 'test.php';   // this file contains syntax errors...
 
 
  When I issue this using a web browser, I get a syntax error shown in the
  browser and it contains the SomeStuff text, but in the ERRORS file I
 just
  get the php error without the SomeStuff text...
 
  Is there any way to get this working?
 
  Thanks!
  Regards,
 
  JaviRuiz.

 Try setting this in your php.ini rather than PHP and see if that does the
 trick

 --
 Thanks,
 Ash
 http://www.ashleysheridan.co.uk



[PHP] Reserved var for checking remote IP address

2008-04-16 Thread Javier Huerta
Is there a reverved variable that can be used to check the remote IP address 
of the computer hitting your web page?

Javier





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



Re: [PHP] Reserved var for checking remote IP address

2008-04-16 Thread Javier Huerta

Daniel Brown [EMAIL PROTECTED] wrote in message  Is there a 
reverved variable that can be used to check the remote IP address
  of the computer hitting your web page?

 ?php
 $_SERVER['REMOTE_ADDR'];
 ?


Wow that was quick, thanks Daniel.

Javier



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



[PHP] Question About Blocking Email Addresses in Forms

2008-01-18 Thread Javier Huerta
I am wondering if there is a way to block out email addresses in specific 
format from a form?  We ahve a form that people have to enter an email 
address, and the form has been getting used by bots to send spam to a 
listserv.  The email address they enter is in this type of format 
[EMAIL PROTECTED], and of course it is always just a bit different every 
time.  Any help is greatly appreciated. 

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



[PHP] Re: Question About Blocking Email Addresses in Forms

2008-01-18 Thread Javier Huerta
Thanks for all of your suggestions which all point to using Catpcha.  I have 
actually already implemented Capchta and they are still getting around it. 
Even if they are entering it manually rather than via a bot, is there a way 
to check if the email address is of a specific format and if so then don't 
process the form?



Javier Huerta [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
I am wondering if there is a way to block out email addresses in specific 
format from a form?  We ahve a form that people have to enter an email 
address, and the form has been getting used by bots to send spam to a 
listserv.  The email address they enter is in this type of format 
[EMAIL PROTECTED], and of course it is always just a bit different every 
time.  Any help is greatly appreciated. 

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



Re: [PHP] Question About Blocking Email Addresses in Forms

2008-01-18 Thread Javier Huerta
The bad thing about using only registered users is that we have this form 
set in our Smart classrooms to give us feedback about any issues they 
encountered while using the AV equipment.  We have to keep the form open to 
non-university users.  When I implemented the Captcha code, I thought that 
it would take care fo this problem.  Basically it looks as though someone is 
entering the data manually.



Stephen [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 Javier Huerta wrote:
 I am wondering if there is a way to block out email addresses in specific 
 format from a form?  We ahve a form that people have to enter an email 
 address, and the form has been getting used by bots to send spam to a 
 listserv.  The email address they enter is in this type of format 
 [EMAIL PROTECTED], and of course it is always just a bit different 
 every time.  Any help is greatly appreciated.

 Have a registration process and only allow registered users to send email 
 to the list.

 Stephen 

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



Re: [PHP] Question About Blocking Email Addresses in Forms

2008-01-18 Thread Javier Huerta

 Hi Javier!

 At my work we had tons of issues with spam bots randomly hitting our
 contact forms.  They would inject all sorts of random garbage along
 with the standard email header injection attempts to try and send mass
 mails through the forms.

 We've worked on a standardized form processing script that has some
 basic ideas implemented that has cut down on 99% of the spam in our
 forms yet also does _not_ use any horrible CAPTCHA crap.  If you use
 one of those you're basically saying you hate your users and want to
 make them miserable.

 Here are a few of the ideas we use:

 - Require a user enter an email address and then validate this address
 using PEAR::Validate::email() with the true parameter to resolve host
 names.  That would always require at least a valid domain name.

 - Filter all the fields against a set of invalid keywords.  Also make
 this set of keywords extendable on a per site basis because some sites
 get hit with different keywords.  Here is a set you can start with
 array('to:','from:','cc:','bcc:','href=','url=')

 - Trick the bots.  I noticed lots of forms spam scripts will use some
 sort of regex to find all form fields and then inject them with any
 value that they want.  Just because your form uses a select dropdown
 or hidden field doesn't mean that is what you're going to get back.
 Most of these things in my experience are automated so they just do a
 mass search for name=.  I use this to my advantage by doing two
 things.  First I have a commented out field that if it is submitted I
 fail the post.  Then I also have a hidden field that has a constant
 value that must remain the same.  If this value is changed (only a
 spammer would do it since it's hidden) fail the post.

 - Add a configurable option to ignore posts that contain the domain
 name in them.  Lots of these bots will send out a test that uses
 random@the current domain of the site as a test.  I usually enable
 this feature after the client has tested their form and are happy with
 it.

 Make sure that if any of these conditions fail you show the form back
 to the user with a helpful error message.  This way if a real user
 accidently triggers any of the security measures you can let them know
 how to fix it, such as removing href= from input fields.

 Good luck!

Thanks again for the suggestions Eric and everyone else.  One of my 
colleagues, who is more PHP savy than I, agreed to help me work on this 
using all of your suggestions.

I am now quite confident that we will be able to conquer our spam problem.

Javier 

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



Re: [PHP] Re: Question About Blocking Email Addresses in Forms

2008-01-18 Thread Javier Huerta
 What does your form actually do? Does it email you, email them, stick 
 something in a DB? What?


The form sends an email to a listserv and cc's the sender and then enters 
data into a database.



 Regardless, if they're entering a nonsense email address and are 
 managing to get your script to email other people then you're not 
 validating the inputs correctly.

This is what I am not sure about how to go about doing. 

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



[PHP] RE: London PHP salaries

2007-06-15 Thread Javier Leyba

Thanks for all replies.

I want to make a last question and promise will not
disturb with this topic any more.

How could I calculate a month net salary ?

In Spain, the offered year salary could be divided in
12 or 14 payments (in this case you´ll receive a duble
payment in july and december).

To know how much will receive in your hands each month
you need to divide year salary by the number of
payment less 30% (apromixametely) that fly away with
taxes and social security. Result is your monthly
payment. (you don´t need a health care plan but is
useful to have a dental plan that could cost around
50/100 euros year).

How could I make same calculation for a London salary
?

Thanks in advance

J




  __ 
Preguntá. Respondé. Descubrí. 
Todo lo que querías saber, y lo que ni imaginabas,
está en Yahoo! Respuestas (Beta). 
¡Probalo ya! 
http://www.yahoo.com.ar/respuestas 

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



Re: [PHP] RE: London PHP salaries

2007-06-15 Thread Javier Leyba


Hi

Thanks for all comments.

My last question (I promise *g*).

Could you please tell me how much money could I spend
paying gas, electricity, phone, internet, etc... It
could give an idea about how much money of my salary
will fly away monthly :)

Thanks in advance

J








__ 
Preguntá. Respondé. Descubrí. 
Todo lo que querías saber, y lo que ni imaginabas, 
está en Yahoo! Respuestas (Beta). 
¡Probalo ya! 
http://www.yahoo.com.ar/respuestas 

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



Re: [PHP] RE: London PHP salaries

2007-06-15 Thread Javier Leyba
 Did you Google at all before you posted your 
 initial question?

 http://www.workgateways.com/working-cost-of-
 living.html

 Says it was last updated in June, but the flat 
 rental prices seem a bit on the low side to me.
 The rest looks about right tho.


Thanks

Be sure I use Google. I've searched for services
costs in London or gas cost in London and I've
search for spanish communities in London but I think I
did the typicall mistake of literal translation from
my native spanish.

J




  __ 
Preguntá. Respondé. Descubrí. 
Todo lo que querías saber, y lo que ni imaginabas,
está en Yahoo! Respuestas (Beta). 
¡Probalo ya! 
http://www.yahoo.com.ar/respuestas 

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



[PHP] London PHP salaries

2007-06-14 Thread Javier Leyba
Hi All

I've received a job offer from a London zone 1 based
company as Senior PHP developer.
I'm really interested but I live in Spain an have no
idea about UK salaries so I wonder if somebody could
give me a clue.

How much money is a really good salary (to keep a
family happy) ? How much could I ask as a senior
PHP/J2EE developer ?

Thanks in advance

J


  __ 
Preguntá. Respondé. Descubrí. 
Todo lo que querías saber, y lo que ni imaginabas,
está en Yahoo! Respuestas (Beta). 
¡Probalo ya! 
http://www.yahoo.com.ar/respuestas 

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



Re: [PHP] London PHP salaries

2007-06-14 Thread Javier Leyba
Hi Javier,

Thursday, June 14, 2007, 9:23:25 AM, you wrote:

 I've received a job offer from a London zone 1
based
 company as Senior PHP developer.
 I'm really interested but I live in Spain an have
no
 idea about UK salaries so I wonder if somebody
could
 give me a clue.

 How much money is a really good salary (to keep a
 family happy) ? How much could I ask as a senior
 PHP/J2EE developer ?

 How much are they offering? Then we can say if 
 it's  good or not :)


Hi

Well, as usual, they ask me how much I want and as I
don´t know how much should want, I´m asking here.  :)

How much should be the lower limit to keep a family
happy (happy means with enough money for a flat, food,
clothes, entertainment, education and something to
save for the future) ?

With such kind of info I could compare with other
offers on the net...

Thanks in advancce

J








__ 
Preguntá. Respondé. Descubrí. 
Todo lo que querías saber, y lo que ni imaginabas, 
está en Yahoo! Respuestas (Beta). 
¡Probalo ya! 
http://www.yahoo.com.ar/respuestas 

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



[PHP] Re: London PHP salaries

2007-06-14 Thread Javier Leyba
 For living in London you would need at the lower 
 end 35k but why would you want to come and live 
 in London from Spain ? If I had the choice I 
 know where I would choose.

I couldn't imagine why you like Spain but...

Just check out Spain salaries and tell me what you
think. You can check Monster.es or infojobs.net

A friend of mine received an offer some days ago from
a recruitment consultant to work in the big bank of
catalonia.

They asked for an experienced J2ee architect with
knowledge of Unix, Hibernate, Spring Framework,
RDBM´s, systems analysis and design, spanish, catalan
and english fluent, etc How muche they offer ? 21K
euros !!! 

It means around 1000 euros net each month and to rent
a flat in Barcelona costs 900/1500 euros month...

There are better offers, but not much than 30K and
it's not enough.

For PHP you couldn´t expect more than 18k...

Do you like Spain, now ?  :)


J




  __ 
Preguntá. Respondé. Descubrí. 
Todo lo que querías saber, y lo que ni imaginabas,
está en Yahoo! Respuestas (Beta). 
¡Probalo ya! 
http://www.yahoo.com.ar/respuestas 

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



Re: [PHP] php-cli vs python

2007-06-07 Thread jose javier parra sanchez

Hi. One big diferrence is that python can be run interactively, while
php not. That's  a really good advantage to debug the scripts. Anyway,
use the one you fell more comfortable.


2007/6/7, Abdullah Ramazanoglu [EMAIL PROTECTED]:

Hello,

I'm already (going to) use php for web based development. Shell scripting
and compiled languages have their own places, but there's also a place for
a high level scripting language. While people usually use python (for
higher level and perl for lower level tasks) for this, I really wonder
whether this would be worthwhile for me.

I have just cursory info about python, and I'm by no means a php expert. So
I can't reliably compare the two, but my rationale so far is simple: If
php5, with its enhanced object oriented features and rich libraries is on
par with python on the command line, then wouldn't it make better sense
for me to use php for both web and cli/gui development?

Nevertheless, I can't ignore the fact that people do use python almost
exclusively for high level CLI/GUI scripting. Where's the catch? What's
the top 3 killer features of python against php (and vice versa)?

Any ideas, pointers, analysis, insights are most welcome. This is a rather
strategical crossroads for me, and I'd very much like to make an informed
decision.

Thank you and kind regards.
--
Abdullah Ramazanoglu
aramazan ÄT myrealbox D0T cöm

--
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



Fwd: [PHP] pdo-oracle + nls_lang environment variable...

2007-05-17 Thread Javier Ruiz

sorry, forgot to CC to the list...

-- Forwarded message --
From: Javier Ruiz [EMAIL PROTECTED]
Date: May 17, 2007 9:46 AM
Subject: Re: [PHP] pdo-oracle + nls_lang environment variable...
To: Miguel J. Jiménez [EMAIL PROTECTED]

Thanks for the answer.

Nah I checked and apache has support for both latin1 and utf8 charsets, I
tried anyway forcing the output of apache to iso8859-1 and to utf8 but no
luck...

I'm almost convinced it's something about php reading the NLS_LANG
environment variable because if I just unset this variable php-cli (and even
oracle's sqlplus directly) behaves the same way as php-apache does (displays
special characters as question marks).

gracias miguel :-D


On 5/17/07, Miguel J. Jiménez [EMAIL PROTECTED]  wrote:


Javier Ruiz escribió:
 Hi,

 I'm using pdo-oci on php-5.2.2 against an oracle-10g server, using
 oracle-instantclient (compiled oracle with
 '--with-oci8=instantclient,/usr/lib/oracle/10.2.0.3/client/lib').

 The problem...:
 I make a simple php script that makes a select from a table. The table
 contains spanish characters so I set the enviroment variable NLS_LANG to
 SPANISH_SPAIN.AL32UTF8 before running apache (also tried other values
 that
 use iso8859-1...). If I run the script in console (using the CLI
 version of
 php) the returned data is in the desired collation, so I can see the
 spanish
 special characters like ñ, ó and so on... The problem is that
running
 exactly the same script via HTTP (apache2) I always get question marks
 replacing the special characters...

 I tried many things... I export the enviroment variable as root and as
 the
 user running the apache daemon, I modified the apache init script to
 export
 the variables just before starting apache, I tried using the putenv
 function
 in php code and no luck at all...

 I realized about something that maybe is related... a php script
 running in
 CLI can access any environmental variable, but no any env-var running in
 apache... for example the following code: ?php echo getenv(LC_ALL);
?
 will return my locale setting in CLI but returns nothing via http...
 is it
 normal?

 TIA!



Maybe you have the AddDefaultCharset directive from Apache2 set to
ISO-8859-15 instead of UTF-8 (or even off)? I have worked with php-oci8
and php5.2 without any collation problem this far (using ñ € ans so on...)

--
Miguel J. Jiménez
Programador Senior
Área de Internet/XSL/PHP
[EMAIL PROTECTED]



ISOTROL
Edificio BLUENET, Avda. Isaac Newton nº3, 4ª planta.
Parque Tecnológico Cartuja '93, 41092 Sevilla (ESP).
Teléfono: +34 955 036 800 - Fax: +34 955 036 849
http://www.isotrol.com

You let a political fight  come between you and your best friend you have
in all the world. Do you realize how foolish that is? How ominous? How can
this country survive if friends can't rise above the quarrel.
Constance Hazard, North  South (book I)





[PHP] pdo-oracle + nls_lang environment variable...

2007-05-16 Thread Javier Ruiz

Hi,

I'm using pdo-oci on php-5.2.2 against an oracle-10g server, using
oracle-instantclient (compiled oracle with
'--with-oci8=instantclient,/usr/lib/oracle/10.2.0.3/client/lib').

The problem...:
I make a simple php script that makes a select from a table. The table
contains spanish characters so I set the enviroment variable NLS_LANG to
SPANISH_SPAIN.AL32UTF8 before running apache (also tried other values that
use iso8859-1...). If I run the script in console (using the CLI version of
php) the returned data is in the desired collation, so I can see the spanish
special characters like ñ, ó and so on... The problem is that running
exactly the same script via HTTP (apache2) I always get question marks
replacing the special characters...

I tried many things... I export the enviroment variable as root and as the
user running the apache daemon, I modified the apache init script to export
the variables just before starting apache, I tried using the putenv function
in php code and no luck at all...

I realized about something that maybe is related... a php script running in
CLI can access any environmental variable, but no any env-var running in
apache... for example the following code:  ?php echo getenv(LC_ALL); ?
will return my locale setting in CLI but returns nothing via http... is it
normal?

TIA!


[PHP] php + db2

2007-04-26 Thread Javier Ruiz

Hi

I'm trying to install php-5.2.1 using ibm-db2. I made this a couple times
already without any problem, but in this concrete machine I cannot pass the
configure script...

My problem is with the db2 enviroment. Before issuing configure with all the
options, I sourced the db2profile file as always, I checked and I have the
enviromental variables:

# env | grep -i db2
DB2INSTANCE=db2inst2
LD_LIBRARY_PATH=/home/db2inst2/sqllib/lib
LIBPATH=/home/db2inst2/sqllib/lib
PATH=/usr/sbin:/bin:/usr/bin:/sbin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin:/home/db2inst2/sqllib/bin:/home/db2inst2/sqllib/adm:/home/db2inst2/sqllib/misc
VWSPATH=/home/db2inst2/sqllib
CLASSPATH=/home/db2inst2/sqllib/java/db2java.zip:/home/db2inst2/sqllib/java/db2jcc.jar:/home/db2inst2/sqllib/java/sqlj.zip:/home/db2inst2/sqllib/function:/home/db2inst2/sqllib/java/db2jcc_license_cisuz.jar:/home/db2inst2/sqllib/java/db2jcc_license_cu.jar:.


but after this, when I issue the configure command I still get

...
checking for IBM DB2 support... no
configure: error:
build test failed. Please check the config.log for details.
You need to source your DB2 environment before running PHP configure:
# . $IBM_DB2/db2profile


can anybody help me here please?

TIA!


[PHP] Fwd: php + db2

2007-04-26 Thread Javier Ruiz

Ok, I've seen something... I'm trying to compile php with db2 support but
also with oracle support using oracle-instantclient.

If I remove the oracle options (with-oci8 and with-pdo-oci), configure
passes the ibm-db2 tests, but using oracle-instantclient + db2 seems to be
problematic...

Anybody?


-- Forwarded message --
From: Javier Ruiz [EMAIL PROTECTED]
Date: Apr 26, 2007 10:39 AM
Subject: php + db2
To: php-general@lists.php.net

Hi

I'm trying to install php-5.2.1 using ibm-db2. I made this a couple times
already without any problem, but in this concrete machine I cannot pass the
configure script...

My problem is with the db2 enviroment. Before issuing configure with all the
options, I sourced the db2profile file as always, I checked and I have the
enviromental variables:

# env | grep -i db2
DB2INSTANCE=db2inst2
LD_LIBRARY_PATH=/home/db2inst2/sqllib/lib
LIBPATH=/home/db2inst2/sqllib/lib
PATH=/usr/sbin:/bin:/usr/bin:/sbin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin:/home/db2inst2/sqllib/bin:/home/db2inst2/sqllib/adm:/home/db2inst2/sqllib/misc

VWSPATH=/home/db2inst2/sqllib
CLASSPATH=/home/db2inst2/sqllib/java/db2java.zip:/home/db2inst2/sqllib/java/db2jcc.jar:/home/db2inst2/sqllib/java/sqlj.zip:/home/db2inst2/sqllib/function:/home/db2inst2/sqllib/java/db2jcc_license_cisuz.jar:/home/db2inst2/sqllib/java/db2jcc_license_cu.jar:.



but after this, when I issue the configure command I still get

...
checking for IBM DB2 support... no
configure: error:
build test failed. Please check the config.log for details.
You need to source your DB2 environment before running PHP configure:
# . $IBM_DB2/db2profile


can anybody help me here please?

TIA!


Fwd: [PHP] PDO mssql + multiple rowsets

2007-04-04 Thread Javier Ruiz

I've seen there's an open bug on the missing feature I pointed out in my
first email, but it's even not assigned and I cannot get an answer from the
developer... so... does anybody know if there is any plan to finish the
PDO-dblib driver?

TIA


-- Forwarded message --
From: Javier Ruiz [EMAIL PROTECTED]
Date: Apr 2, 2007 9:54 AM
Subject: Re: [PHP] PDO mssql + multiple rowsets
To: Frank M. Kromann [EMAIL PROTECTED], php-general@lists.php.net

Hi again. Sorry I was out of my city during the weekend and had no
connection available...

So Frank, please lemme know, is the feature (multiple rowsets) planned to be
included in the pdo-dblib driver? I would like to know to include or not pdo
in my development needs against mssql.

Thanks, greetings!


On 3/29/07, Frank M. Kromann [EMAIL PROTECTED] wrote:


It Is doable. The native mssql/dblib extension does support that features.
I just have'nt had the time to code it for pdo_dblib.

- Frank

 I too have been having problems getting the PDO dblib for mssql to play
 well (getting the same error actually).  If you find a reason or work
 around for it I would appreciate hearing about it.  Thinking of going
 the odbc route myself if I can't get it to work.


 Respectfully,
 Ligaya Turmelle

 -Original Message-
 From: Javier Ruiz [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, March 28, 2007 8:21 PM
 To: php-general@lists.php.net
 Subject: [PHP] PDO mssql + multiple rowsets

 Hi!

 I want to use PDO in my apps for connecting to several RDBSs, one of
 them, sql server 2000 and 2005. I tried to use as DSN something like
 mssql:...
 (as I've seen in the php manual pages) but I get a PDOException with
the
 message Unable to open PDO connection [wrapped: could not find
 driver]. I can work well with the mssql built-in functions (like
 mssql_connect, mssql_query and so on...) and even I can almost work
 perfectly using in my dsn dblib:
 So first question: is the PDO's driver mssql deprecated or is it me
 doing something wrong in the PHP installation?
 BTW, I use php-5.2.1

 In case that the answer to the first question is that mssql is no
more
 used as a PDO driver, I have a problem... I have stored procedures in
 sql server that return multiple rowsets, I've seen that PDO offers
 functionability to manage this, but not for the dblib driver... if I
try
 to use the $stmt-nextRowSet() method, I get an exception like Driver
 does not support this function: driver does not support multiple
 rowsets
 What can I do then to work with my stored procs?

 Thanks in advance

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







Fwd: [PHP] PDO mssql + multiple rowsets

2007-04-04 Thread Javier Ruiz

btw... the bug: http://pecl.php.net/bugs/bug.php?id=10530

-- Forwarded message --
From: Javier Ruiz [EMAIL PROTECTED]
Date: Apr 4, 2007 9:10 AM
Subject: Fwd: [PHP] PDO mssql + multiple rowsets
To: php-general@lists.php.net

I've seen there's an open bug on the missing feature I pointed out in my
first email, but it's even not assigned and I cannot get an answer from the
developer... so... does anybody know if there is any plan to finish the
PDO-dblib driver?

TIA


-- Forwarded message --
From: Javier Ruiz [EMAIL PROTECTED]
Date: Apr 2, 2007 9:54 AM
Subject: Re: [PHP] PDO mssql + multiple rowsets
To: Frank M. Kromann [EMAIL PROTECTED],  php-general@lists.php.net

Hi again. Sorry I was out of my city during the weekend and had no
connection available...

So Frank, please lemme know, is the feature (multiple rowsets) planned to be
included in the pdo-dblib driver? I would like to know to include or not pdo
in my development needs against mssql.

Thanks, greetings!


On 3/29/07, Frank M. Kromann  [EMAIL PROTECTED] wrote:


It Is doable. The native mssql/dblib extension does support that features.
I just have'nt had the time to code it for pdo_dblib.

- Frank

 I too have been having problems getting the PDO dblib for mssql to play
 well (getting the same error actually).  If you find a reason or work
 around for it I would appreciate hearing about it.  Thinking of going
 the odbc route myself if I can't get it to work.


 Respectfully,
 Ligaya Turmelle

 -Original Message-
 From: Javier Ruiz [mailto: [EMAIL PROTECTED]
 Sent: Wednesday, March 28, 2007 8:21 PM
 To: php-general@lists.php.net
 Subject: [PHP] PDO mssql + multiple rowsets

 Hi!

 I want to use PDO in my apps for connecting to several RDBSs, one of
 them, sql server 2000 and 2005. I tried to use as DSN something like
 mssql:...
 (as I've seen in the php manual pages) but I get a PDOException with
the
 message Unable to open PDO connection [wrapped: could not find
 driver]. I can work well with the mssql built-in functions (like
 mssql_connect, mssql_query and so on...) and even I can almost work
 perfectly using in my dsn dblib:
 So first question: is the PDO's driver mssql deprecated or is it me
 doing something wrong in the PHP installation?
 BTW, I use php-5.2.1

 In case that the answer to the first question is that mssql is no
more
 used as a PDO driver, I have a problem... I have stored procedures in
 sql server that return multiple rowsets, I've seen that PDO offers
 functionability to manage this, but not for the dblib driver... if I
try
 to use the $stmt-nextRowSet() method, I get an exception like Driver
 does not support this function: driver does not support multiple
 rowsets
 What can I do then to work with my stored procs?

 Thanks in advance

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







[PHP] PDO mssql + multiple rowsets

2007-03-28 Thread Javier Ruiz

Hi!

I want to use PDO in my apps for connecting to several RDBSs, one of them,
sql server 2000 and 2005. I tried to use as DSN something like mssql:...
(as I've seen in the php manual pages) but I get a PDOException with the
message Unable to open PDO connection [wrapped: could not find driver]. I
can work well with the mssql built-in functions (like mssql_connect,
mssql_query and so on...) and even I can almost work perfectly using in my
dsn dblib:
So first question: is the PDO's driver mssql deprecated or is it me doing
something wrong in the PHP installation?
BTW, I use php-5.2.1

In case that the answer to the first question is that mssql is no more
used as a PDO driver, I have a problem... I have stored procedures in sql
server that return multiple rowsets, I've seen that PDO offers
functionability to manage this, but not for the dblib driver... if I try to
use the $stmt-nextRowSet() method, I get an exception like Driver does not
support this function: driver does not support multiple rowsets
What can I do then to work with my stored procs?

Thanks in advance


Fwd: [PHP] Problems with Zip+IE6

2006-12-18 Thread Javier Ruiz

Apologies... forgot to CC to the list...

-- Forwarded message --
From: Javier Ruiz [EMAIL PROTECTED]
Date: Dec 18, 2006 11:25 AM
Subject: Re: [PHP] Problems with Zip+IE6
To: [EMAIL PROTECTED]

Hi,

Nah, the only thing I'm trying to do is to serve a regular zip file to the
user of the app I'm coding, I could just put the file in an accesible
folderand provide the link to the user (when I say accesible I mean inside
the docroot of apache), but I really want the files (those zip files) to be
available to the user ONLY if he's logged in and in a session with some
background stuff...

I did this a houndred times and really never realized about this problem
with IE, I'm a linux user (Gentoo :-D ) since years ago and always used
mozilla and/or firefox, but the users of the application I'm making now use
IE, so they reported the problem thinking that it is related to our code.

Ah! And it really doesn't matter what software you have to work with zip
files, the problem is before that software: The concrete problem I found
is that when you click on a zip file link in IE, it asks you to choose: open
it or save it, the only difference between both operations is that if you
say save it it will download the zip file to a temp folder and then move
it to the directory you specify; if you say open, it SHOULD download it to
the temp folder and then call the application you have for zip files
(winzip, winrar, whatever) with the location of the file in the temp
folder. I think all the browsers works more or less the same way. The
problem with IE is that saying open it just doesn't download the file, but
opens anyway the zip application with the temp file location, so the
application (and not IE) complains that the requested location is not
existing, in my case, WinRar...

Indeed it matters the content-type to use with files in webpages! and as I
mentioned before, I like your article because it's just pointing it, but I'm
just trying to find out if anybody, doing any trick (dirty trick even) got
the temporally download problem solved anyhow, and I'm trying whatever to
get it.

But unfortunatelly as much as I'm searching, I'm more realizing that this is
an unsolvable bug in IE and I'll have to ask my client to please, you will
have to always download the zip files before opening them, or change your
habits and use another browser. It's a recognised IE bug, it's not a PHP's
mistake, not a coding mistake (by me I mean) but sincerelly, and I'll say it
like it is... it's a pain in the ass!

I appreciate Richard for your efforts, thanks a lot.
Regards,

Javi Ruiz.


On 12/16/06, Richard Lynch  [EMAIL PROTECTED] wrote:


On Tue, December 12, 2006 4:34 am, Javier Ruiz wrote:
 damn! that's a pretty good article, thanks a lot.

 unfortunatelly, it's not mentioning about zip files concretely, I
 didn't
 find a solution for my problem with them.
 I tried playing a bit with the Content-type, but it seems that
 Internet
 Explorer doesn't really care about Content-type... it uses the
 extention
 of the file to determine the type (microsoft's way...) so it doesn't
 matter
 if I use application/octet-stream or even
 application/force-download or
 application/makethisdownload-or-ikillyou :-D as long as I name the
 file 
 whatever.zip, IE6 shows the open with dialog and if I use open
 with an
 application, it fails :(

It does matter on real browsers...

Use the correct content type for a download: application/octet-stream

 thanks again Richard for the answer and for the article :)

 anybody with a miracle for the ZIP+IE problem??

You're going to HAVE to open the Zip file with some kind of unzip
application such as WinZip, pkunzip, or, possibly, that goofball
Windows unzip thingie that lets you pretend zip archives are
directories, even though they aren't, but only up to a certain point,
as you can't do some things with files in the zip archive that you can
do with normal files, so it's just a very confusing Human Interface...
Sort of like Windows in a microcosm.

If you were hoping that somehow IE would magically unzip the item, and
then let you open the contents within the zip file with a chosen
application...  Even MS Windows isn't THAT stupid.  Yet.

What if there are 2 things in the zip archive?

For that matter, if there aren't 2 things, why is it even zipped?

 1 - To change the mimetype (when writting http headers) from
  application/zip that I used before to
 application/x-zip-compressed
 2 - To not use MOD_DEFLATE in apache2 (I was not using it
  really...)

I now am beginning to wonder if you are trying to send your HTML as
gzip'ed data for the browser to surf to your site, to save on
bandwidth... If so, none of the above has any bearing on this at
all...

--
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?




Re: [PHP] Problems with Zip+IE6

2006-12-12 Thread Javier Ruiz

damn! that's a pretty good article, thanks a lot.

unfortunatelly, it's not mentioning about zip files concretely, I didn't
find a solution for my problem with them.
I tried playing a bit with the Content-type, but it seems that Internet
Explorer doesn't really care about Content-type... it uses the extention
of the file to determine the type (microsoft's way...) so it doesn't matter
if I use application/octet-stream or even application/force-download or
application/makethisdownload-or-ikillyou :-D as long as I name the file 
whatever.zip, IE6 shows the open with dialog and if I use open with an
application, it fails :(

thanks again Richard for the answer and for the article :)

anybody with a miracle for the ZIP+IE problem??



On 12/5/06, Richard Lynch [EMAIL PROTECTED] wrote:


It's kinda long, but this will probably save you some grief:
http://richardlynch.blogspot.com

On Tue, December 5, 2006 2:07 am, Javier Ruiz wrote:
 Hi all!

 I have a problem with zip files and Internet Explorer 6. I try to send
 to
 the user a dinamically generated zip file writting the http headers
 and
 using file_put_contents for the zip content. It works fine when
 downloading
 the file with firefox, opera, etc... even it works well if I download
 the
 file with internet explorer and then open it with any zip tool. The
 problem
 comes when I try to directly open the file from the URL using IE6.

 I found this is a known bug of IE (several versions) in windows XP:
 http://support.microsoft.com/kb/308090

 Does anybody know any way to workaround this problem? I found a couple
 workarounds in forums over there and I tried them, but unfortunately
 they
 didn't work:
1 - To change the mimetype (when writting http headers) from
 application/zip that I used before to application/x-zip-compressed
2 - To not use MOD_DEFLATE in apache2 (I was not using it
 really...)



 Any idea??

 Thanks a lot!



--
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?




[PHP] Problems with Zip+IE6

2006-12-05 Thread Javier Ruiz

Hi all!

I have a problem with zip files and Internet Explorer 6. I try to send to
the user a dinamically generated zip file writting the http headers and
using file_put_contents for the zip content. It works fine when downloading
the file with firefox, opera, etc... even it works well if I download the
file with internet explorer and then open it with any zip tool. The problem
comes when I try to directly open the file from the URL using IE6.

I found this is a known bug of IE (several versions) in windows XP:
http://support.microsoft.com/kb/308090

Does anybody know any way to workaround this problem? I found a couple
workarounds in forums over there and I tried them, but unfortunately they
didn't work:
  1 - To change the mimetype (when writting http headers) from
application/zip that I used before to application/x-zip-compressed
  2 - To not use MOD_DEFLATE in apache2 (I was not using it really...)



Any idea??

Thanks a lot!


[PHP] Fwd: Problems with Zip+IE6

2006-12-05 Thread Javier Ruiz

BUMP!

-- Forwarded message --
From: Javier Ruiz [EMAIL PROTECTED]
Date: Dec 5, 2006 9:07 AM
Subject: Problems with Zip+IE6
To: php-general@lists.php.net

Hi all!

I have a problem with zip files and Internet Explorer 6. I try to send to
the user a dinamically generated zip file writting the http headers and
using file_put_contents for the zip content. It works fine when downloading
the file with firefox, opera, etc... even it works well if I download the
file with internet explorer and then open it with any zip tool. The problem
comes when I try to directly open the file from the URL using IE6.

I found this is a known bug of IE (several versions) in windows XP:
http://support.microsoft.com/kb/308090

Does anybody know any way to workaround this problem? I found a couple
workarounds in forums over there and I tried them, but unfortunately they
didn't work:
  1 - To change the mimetype (when writting http headers) from
application/zip that I used before to application/x-zip-compressed
  2 - To not use MOD_DEFLATE in apache2 (I was not using it really...)



Any idea??

Thanks a lot!


[PHP] guess documentroot

2006-10-05 Thread Javier Ruiz

Hey all!

Is it possible to get the path of a file relative to the document root of
the webserver using php?
For example...

if we have a script like
http://localhost/mydir/myseconddir/index.php

is there a way to get that it's runing on
/mydir/myseconddir/

??

something like getcwd() but webserver relative, not filesystem.

thanks a lot.
greetings!


Re: [PHP] guess documentroot

2006-10-05 Thread Javier Ruiz

Perfect!

got it using the following:

/* 1 - remove the query string just in case it contains a '/' in it
  2 - like Clive said, substr() and strrpos() 'clean' the path to provide
the directories only */

$aPath = str_replace($_REQUEST['QUERY_STRING'], '',
$_SERVER['SCRIPT_NAME']);
$aPath = substr($aRuta, 0, (strrpos($aRuta, '/') + 1));

Thanks a lot guys :)



On 10/5/06, clive [EMAIL PROTECTED] wrote:




 if we have a script like
 http://localhost/mydir/myseconddir/index.php

 is there a way to get that it's runing on
 /mydir/myseconddir/

use $_SERVER['[PHP_SELF'] or $_SERVER['SCRIPT_NAME']

and then simply  use strripos() to get the last forwarsd-slash and
substr() to get the value you want.




--
Regards,

Clive




Re: [PHP] Re: remove SimpleXML nodes

2006-09-01 Thread Javier Ruiz

Thanks a lot to all :)

Using DOM I can do what I need. Anyway I was trying the proposed solutions
with SimpleXML but none of them worked for me :(

I tried splitting $key and $value in the foreach command, but when I dump
the xml (with the asXML function) I still have the nodes that I supposed to
delete... And the same using references, cause I think using unset with
referenced variable names doesn't delete the referenced var, it just deletes
the link to the referenced var...

Concretely I tried:

TEST ONE:
foreach ($xmlDatabase as $key = $oneTable) if ($oneTable['name'] == 'one')
unset($xmlDatabase[$key]);
$sourceXML = $xmlDatabase-asXML(); // - node table name='one' is
still there

TEST TWO
foreach ($xmlDatabase as $key = $oneTable) if ($oneTable['name'] == 'one')
unset($oneTable);
$sourceXML = $xmlDatabase-asXML(); // - node table name='one' is
still there


If there's no luck with xml I will use of course DOM for this, but I'm
really curious now :P
Again, thanks a lot for the help.

Javi Ruiz.

On 9/1/06, Curt Zirzow [EMAIL PROTECTED] wrote:
On 8/31/06, Adam Zey [EMAIL PROTECTED] wrote:

Javier Ruiz wrote:
 Hi all,

 So I want to do...

 $xmlDatabase = new SimpleXMLElement($myXML);
 foreach ($xmlDatabase as $oneTable)
 {
   if ($oneTable['name'] == 'two')
   {
  ///   HERE I WANT TO DELETE THE $oneTable NODE
  unset($oneTable);   // -- and this doesn't work...
   }
 }


 any ideas?


The answer is simple, everybody else seems to have missed it. foreach()
makes a copy of the array before working on it. Changes made to
$oneTable would obviously never affect the original. You're just
unsetting a temporary variable that's going to be overwritten next time
through the loop anyhow.

You should have better luck with this code:

$xmlDatabase = new SimpleXMLElement($myXML);
foreach ($xmlDatabase as $key = $oneTable)


fwiw, In php5 you can do something like:

foreach ($xmlDatabase as $key = $oneTable)
//note the  --
 unset($oneTable);


[PHP] remove SimpleXML nodes

2006-08-31 Thread Javier Ruiz

Hi all,

Is there any way to remove a non-unique* *node using SimpleXML?
For example, let's say I have:

$myXML = ENDXML
database ...
 table name='one'
 ...
 /table
 table name='two'
 ...
 /table
 table name='three'
 ...
 /table
/database
ENDXML;


So I want to do...

$xmlDatabase = new SimpleXMLElement($myXML);
foreach ($xmlDatabase as $oneTable)
{
  if ($oneTable['name'] == 'two')
  {
 ///   HERE I WANT TO DELETE THE $oneTable NODE
 unset($oneTable);   // -- and this doesn't work...
  }
}


any ideas?


Re: [PHP] pear constants

2006-08-18 Thread Javier Ruiz

thank you for the link, I'm already subscribed to the pear general list and
I sent the same email to that list, but I got no any answer yet... I just
sent it to the PHP list in case anybody in this list has or had the same
problem...

I put here the problem I'm having:

I have a problem with some pear constants. I made a new installation of
php + pear + propel (http://propel.phpdb.org) and now in my scripts the
constant PEAR_INSTALL_DIR is not defined when in my previous
installation it used to be...

Other constants like the error ones (PEAR_ERROR_DIE,
PEAR_ERROR_RETURN ...) are defined correctly

Am I missing anything in the new installation?

thanks a lot!



On 8/17/06, Chris [EMAIL PROTECTED] wrote:


JRuiz wrote:
 Hi All,

 I have a problem with some pear constants.

The pear lists live here: http://pear.php.net/support/lists.php

--
Postgresql  php tutorials
http://www.designmagick.com/



Re[2]: [PHP] Apache htpasswd

2005-07-07 Thread Javier
On 05/07/2005 at 14:04 sylikc wrote:



For MD5 passwords though, it's a little different and not documented
as thoroughly...

1) First check your constant CRYPT_MD5... if you don't have it in your
PHP, this won't work...
if (CRYPT_MD5 == 1) { echo 'PHP supports MD5-crypt'; }

2) Assuming it works out, do steps #2,#3,#4 above, so you now have
your $username, $password, $crypthash
(for ex: $crypthash='$apr1$jZ1.$1Md.1a88zkKIPCY0b42Cw/')

3) Extract crypt salt from the $crypthash 
$cryptsalt = '$'.substr($crypthash,4,11);

4) Verify the password:
if (crypt($password, $cryptsalt) == $crypthash) { echo 'GOOD!'; }

In step #4 you'll have to see the output from your crypt() function
that supports MD5.  I don't have my built with it just yet and can't
verify this, but use the steps as a guide to building your
implementation.

Post some code if you're still having trouble,


Hi

Thanks for your help.

I checked my PHP support CRYPT_MD5, then I did the following:

I've generated a user javier with password javier in my htpasswd file and
got this:

Automatically using MD5 format.
javier:$apr1$nO/.$x0j4FfqCIQqgtqPckVUkO1

Then I did the following code:

-
?php

print password: .$password = javier.\n;

$crypthash = '$apr1$nO/.$x0j4FfqCIQqgtqPckVUkO1';
$cryptsalt = '$'.substr($crypthash,4,11);

print cryptsalt: .$cryptsalt.\n;
print crypthash: .$crypthash.\n;

print crypted by me: .'$apr'.crypt($password, $cryptsalt).\n;

?
--

And the output was:

password: javier
cryptsalt: $1$nO/.$
crypthash: $apr1$nO/.$x0j4FfqCIQqgtqPckVUkO1
crypted by me: $apr$1$nO/.$0cKBXpoO.Q/jpA6sUUafq0


Something didnt worked because as you can see I couldnt generate the same
crypted hash for my password as apache htpasswd did.

Any idea ?


Thanks in advance

J

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



Re[4]: [PHP] Apache htpasswd

2005-07-07 Thread Javier
On 07/07/2005 at 14:23 Richard Lynch wrote:


Aha!

Since your output has an extra '$' after the $apr and before the
1$n0/. I'm gonna go out on a limb and suggest you probably shouldn't
add the '$' to the front of your salt.

You're adding it, and crypt() is adding it, and you've got too much money
in your salt. :-)

Change step 3 to:
$cryptsalt = substr($crypthash,4,11);

Basically, do whatever it takes to get the front half of the crypted
outputs to match up, and I suspect that the random parts at the end will
magically sort themselves out. :-)


As far as I've read, crypt needs $1 as the satart of salt to know that it
should be crypted with md5.

Then the code it's ok in that way.

Nevertheless, I've tried what you said but it didn't work because crypt
made an encryption with something that is not md5 and the result is:

$apr1$LsJY6m0XL/I

Any idea ?

Thanks in advance

J

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



[PHP] Apache htpasswd

2005-07-05 Thread Javier

Hi

I ve a little script to validate a user using an Apache htpasswd file.

I want to know how could/should I generate a crypted hash (with crypt or
md5) with the entered password to match the password in the htpasswd file.

I know how to use md5 or crypt functions but passing them entered password
as a parameter, returned result dont match with the one in htpasswd file.

Thanks in advance

J

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



[PHP] error from 4.3.10: The specified procedure could not be found.

2005-03-06 Thread Javier Muniz
Forgive me if this has been answered before, but all I was able to find
was a bogus bug report on this issue that did not contain any useful
information.  When installing php 4.3.10 on a Win2k3 machine I'm getting
the The specified procedure could not be found. Error from any php
page I attempt to execute.  I don't have any extensions enabled and this
is a completely vanilla install of 4.3.10.  Followed the installation
procedure to a tee.  It works with 4.3.6 but 4.3.6 has other
show-stopper bugs.  It looks like other people are having this problem
as well, though it doesn't appear (at least, not to Google) that anyone
has been able to solve it.

Any information is greatly appreciated, including links to any FAQs that
might be helpful since I haven't found any that contain *any* useful
information on this problem.

Thanks,
-Javier

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



[PHP] CMS

2004-12-28 Thread Javier Leyba

Hi

I'm looking for a good CMS recommendation.

I've seen comments in opencms and tested a few (Xaraya was good when I read
features but so slow at testing time) but I can't test all and may be other
user experience could reduce my test universe.

I want a CMS with html code separated from PHP code, fully customizable,
easy to implement and fast...

Any clue ?

Thanks in advance

Javier

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



[PHP] No input file specified. error.

2004-12-21 Thread Francisco Javier Escoppinichi Fernandez
Hello people.
I got a little problem here, and I already searched on Google for
possible solutions, but I still can't figure how to fix it.
I'm developing a CMS Application on PHP. On my dev  machine I'm running
Apache 1.3.33 + PHP 4.3.9 as a module, and on my production machine i'm
running Apache 1.3.33 + PHP 4.3.9 as CGI.
Generally, I pass parameters to my scripts using this scheme:
http://mydomain.com/index.php/var1/var2/var3
This works perfectly on my dev machine, but when I upload the script to
the production machine, I get the error No input file specified. if I
try to pass any parameter in the URL. But if I call the script without
paramaters, it simply works perfectly.
On Google I found that the problem is related to the CGI behavior of PHP
on my production machine, but I still can't figure out to fix it.
I hope you can help me with this... and sorry for my bad english.
Thank you very much in advance.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] No input file specified. error.

2004-12-21 Thread Francisco Javier Escoppinichi Fernandez
Hi Curt,
* Thus wrote Francisco Javier Escoppinichi Fernandez:
Hello people.
I got a little problem here, and I already searched on Google for
possible solutions, but I still can't figure how to fix it.
I'm developing a CMS Application on PHP. On my dev  machine I'm running
Apache 1.3.33 + PHP 4.3.9 as a module, and on my production machine i'm
running Apache 1.3.33 + PHP 4.3.9 as CGI.
Generally, I pass parameters to my scripts using this scheme:
http://mydomain.com/index.php/var1/var2/var3
This works perfectly on my dev machine, but when I upload the script to
the production machine, I get the error No input file specified. if I
try to pass any parameter in the URL. But if I call the script without
paramaters, it simply works perfectly.

What webserver and version is on the production server?
What OS is it being ran on?
My production webserver is currently running on Red Hat Linux 9 with 
Apache 1.3.33 and PHP 4.3.9 as a CGI,  not as a module.

My guess that it is running on IIS (windows) and is being executed
as a CGI.  And if my memory is correct, there isn't a way around
this, due to a flaw in the way IIS handles CGI's in certain
conditions.
Yes, when I Googled in search for my problem, most of the results talked 
about that.

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


Re: [PHP] No input file specified. error.

2004-12-21 Thread Francisco Javier Escoppinichi Fernandez
Curt Zirzow escribió:
* Thus wrote Francisco Javier Escoppinichi Fernandez:
Hi Curt,

* Thus wrote Francisco Javier Escoppinichi Fernandez:

Hello people.
I got a little problem here, and I already searched on Google for
possible solutions, but I still can't figure how to fix it.
I'm developing a CMS Application on PHP. On my dev  machine I'm running
Apache 1.3.33 + PHP 4.3.9 as a module, and on my production machine i'm
running Apache 1.3.33 + PHP 4.3.9 as CGI.
Generally, I pass parameters to my scripts using this scheme:
http://mydomain.com/index.php/var1/var2/var3
This works perfectly on my dev machine, but when I upload the script to
the production machine, I get the error No input file specified. if I
try to pass any parameter in the URL. But if I call the script without
paramaters, it simply works perfectly.

What webserver and version is on the production server?
What OS is it being ran on?
My production webserver is currently running on Red Hat Linux 9 with 
Apache 1.3.33 and PHP 4.3.9 as a CGI,  not as a module.

This is odd, because the CGI specs specifically allow for the
PATH_INFO to work. The IIS problem I mentioned was because IIS
would simply pass the file [docroot]/index.php/var1/var2/var3 to
php, instead of setting PATH_INFO=/var1/var2/var3 and then running
[docroot/index.php
Check the output of your apache error logs, if you're not getting
anything there, change the logging level (in apache) to show as
much info as possible.
Does it matter if I have suEXEC enabled?

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


[PHP] Help with preg_match_all()

2004-10-31 Thread Francisco Javier Escoppinichi Fernández
Hello people...

I'm relatively a beginner with regular expressions, so I need a little
help here.. I hope you can help me...

Ok, I have a HTML file with several tags like this:
{$base.username}
{$base.date}
{$blog.lastpost}

And so on.. It's a kind of a template system... well... I need to
create a expression to get all the tags from the HTML with
preg_match_all() in order to have them in a array...

Can you help me with this.. I already Googled for that, but I really
don't understand too well :P

-- 
Francisco Javier Escoppinichi Fernández
Email: [EMAIL PROTECTED]
Web: http://www.fire-dragon.net/
MSN: [EMAIL PROTECTED]
Cel: 044 (612) 348 91 00

Sólo hay 3 cosas que no vuelven atrás: la palabra emitida, la flecha
lanzada y la oportunidad perdida.

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



Re: [PHP] Help with preg_match_all()

2004-10-31 Thread Francisco Javier Escoppinichi Fernández
Thanks!

Worked like a charm!

*Problem solved*


On Mon, 1 Nov 2004 03:01:12 +, Curt Zirzow
[EMAIL PROTECTED] wrote:
 * Thus wrote Francisco Javier Escoppinichi Fernndez:
  Hello people...
 
  I'm relatively a beginner with regular expressions, so I need a little
  help here.. I hope you can help me...
 
 If you read the whole section @ http://php.net/pcre you'll be able
 to do this in your sleep.
 
 
  Ok, I have a HTML file with several tags like this:
  {$base.username}
  {$base.date}
  {$blog.lastpost}
 
  And so on.. It's a kind of a template system... well... I need to
  create a expression to get all the tags from the HTML with
  preg_match_all() in order to have them in a array...
 
 So your looking from something that starts with '{' and continues
 while not a ')' ...
 
   /{([^}]*?)}/
 
 Curt
 --
 Quoth the Raven, Nevermore.
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 


-- 
Francisco Javier Escoppinichi Fernández
Email: [EMAIL PROTECTED]
Web: http://www.fire-dragon.net/
MSN: [EMAIL PROTECTED]
Cel: 044 (612) 348 91 00

Sólo hay 3 cosas que no vuelven atrás: la palabra emitida, la flecha
lanzada y la oportunidad perdida.

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



[PHP] Problem with str_replace

2004-08-29 Thread Francisco Javier Escoppinichi Fernández
Hello people...

I have a little problem here... I hope you can help me...

I'm building a simple template system for a web site, and I created
some tags in a .html file that I read using the file_get_contents()
function. The tags I created are something like {menu}, {date},
{user}, etc.

Well, the problem shows up when I use the function
str_replace({menu}, $var_with_some_menu_links,  $html_contents).
Nothings happen and when I output the template contents, I see the
tags, in other words, nothing gets replaced.

Any ideas on what I'm doing wrong?

Thank you very much in advance for your help.

P.S. Sorry for my bad english.

-- 
Francisco Javier Escoppinichi Fernández
Email: [EMAIL PROTECTED] 
Web: http://www.fire-dragon.net/
MSN: [EMAIL PROTECTED]
Cel: 044 (612) 348 91 00

Sólo hay 3 cosas que no vuelven atrás: la palabra emitida, la flecha
lanzada y la oportunidad perdida.

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



Re: [PHP] Problem with str_replace

2004-08-29 Thread Francisco Javier Escoppinichi Fernández
On Sun, 29 Aug 2004 19:36:49 -0400, John Nichel [EMAIL PROTECTED] wrote:
 Francisco Javier Escoppinichi Fernández wrote:
  Hello people...
 
  I have a little problem here... I hope you can help me...
 
  I'm building a simple template system for a web site, and I created
  some tags in a .html file that I read using the file_get_contents()
  function. The tags I created are something like {menu}, {date},
  {user}, etc.
 
  Well, the problem shows up when I use the function
  str_replace({menu}, $var_with_some_menu_links,  $html_contents).
  Nothings happen and when I output the template contents, I see the
  tags, in other words, nothing gets replaced.
 
  Any ideas on what I'm doing wrong?
 
  Thank you very much in advance for your help.
 
 Show the code which isn't working.

Here it goes:

class.interior.php
class Interior
{
var $html;
var $menuLateral;
var $buffer;
var $titulo;

function Interior() // Constructor. Construyo el menú y demás.
{
$this-html = file_get_contents('plantillas/interior.html'); //
Plantilla interior.
//$this-menuLateral =
file_get_contents('plantillas/menulateral.html'); // Bloque menu
lateral.
$this-buffer = '';
}

function Salida($output) // Agrega cosas a la interfaz de salida.
{
$this-buffer .= $output;
}

function Show() // This function outputs the final HTML. It's called
by another module.
{
str_replace({contenido}, $this-buffer, $this-html);
str_replace({tituloSeccion}, $this-titulo, $this-html);
echo $this-html;
}

function Titulo($str)
{
$this-titulo = $str;
}

function Clear() // Elimino toda la salida y la dejo en blanco.
{
$this-buffer = '';
}

}
/class.interior.php

the html file

!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;
html xmlns=http://www.w3.org/1999/xhtml;
head
meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 /
titleInstituto Tecnoloacute;gico de La Paz - {tituloSeccion}/title
style type=text/css
!--
.center {
margin-right: auto;
margin-left: auto;
width: 779px;
border: 1px solid #00;
clear: both;
display: table;
}

h2 {
visibility: hidden;
}
.bg {
background-repeat: repeat-x;
background-position: top;
background-image: url(/img/central-interior.png);
}
body {
background-image: url(/img/bg.gif);
}
--
/style
/head

body
div class=center
  table width=100%  border=0 cellpadding=0 cellspacing=0
bgcolor=#FF
tr
  td width=33%img src=/img/logosep.gif alt=Secretaría de
Educación Pública width=145 height=64 //td
  td width=33%div align=centerimg src=/img/logoseit.gif
alt=Dirección General de Institutos Tecnológicos width=121
height=64 //div/td
  td width=33%div align=rightimg src=/img/logoitlp.gif
alt=Instituto Tecnológico de La Paz width=95 height=69
//div/td
/tr
  /table
  table width=100%  border=0 cellpadding=0 cellspacing=3
bgcolor=#FF
tr
  td height=20div align=rightBienvenido, {usuario}./div/td
/tr
  /table
  table width=779 height=21  border=0 cellpadding=0 cellspacing=0
tr
  td width=185 height=21 background=/img/barrafecha.png{fecha}/td
  td background=/img/barramenu.png{menuSuperior}/td
/tr
  /table
  table width=100% height=36  border=0 cellpadding=0 cellspacing=0
tr
  td height=36 background=/img/barratitulo.pngdiv
align=rightimg src=/util/dynheader.php?text={tituloSeccion} 
//div/td
/tr
  /table
  table width=779  border=0 cellspacing=0 cellpadding=0
tr
  td width=27 height=147 valign=topimg
src=/img/marcoizq-interior.png alt=Izquierda width=27
height=147 //td
  td class=bgp{contenido}/p
  /td
  td width=33 height=147 valign=topimg
src=/img/marcoder-interior.png alt=Derecha width=33 height=147
//td
/tr
  /table
  table width=100%  border=0 cellspacing=0 cellpadding=0
tr
  td bgcolor=#FF{menuInferior}/td
/tr
tr
  td bgcolor=#FFdiv align=centerimg
src=/img/bottom.gif width=758 height=47 border=0 usemap=#Map
//div/td
/tr
  /table
/div 
map name=Map id=Map
  area shape=rect coords=363,23,539,34 href=/w/content/contacto /
  area shape=rect coords=300,33,449,48 href=/w/content/creditos /
/map
/body
/html

/the html file

 --
 By-Tor.com
 It's all about the Rush
 http://www.by-tor.com
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 


-- 
Francisco Javier Escoppinichi Fernández
Email: [EMAIL PROTECTED] 
Web: http://www.fire-dragon.net/
MSN: [EMAIL PROTECTED]
Cel: 044 (612) 348 91 00

Sólo hay 3 cosas que no vuelven atrás: la palabra emitida, la flecha
lanzada y la oportunidad

Re: [PHP] Problem with str_replace

2004-08-29 Thread Francisco Javier Escoppinichi Fernández
Hah!

Beginner's mistake!

I think I need some rest... I'm skipping some basic details :)

*PROBLEM SOLVED*

Thank you people...

--
Francisco Javier Escoppinichi Fernández
Email: [EMAIL PROTECTED]
Web: http://www.fire-dragon.net/
MSN: [EMAIL PROTECTED]
Cel: 044 (612) 348 91 00

Sólo hay 3 cosas que no vuelven atrás: la palabra emitida, la flecha
lanzada y la oportunidad perdida.

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



RE: [PHP] Unique ID

2003-11-11 Thread Javier Muniz
auto_increment is not in the SQL standard, and not everyone uses MySQL.  To
be cross-compatible between databases use a Sequence:
http://pear.php.net/manual/en/package.database.db.intro-sequences.php
provides a brief introduction, the PEAR::DB class allows you to use
sequences easily.

Neither auto-increment nor sequences allow you to do what you're asking for
though, which is like database garbage collection.  If you really need
something like this you should implement it in a cron job that runs during
non-peak hours as it will be quite an expensive operation on a large table
(the best way I can think of would be to iterate over all table rows and
look for gaps in the table, and for each gap take the record with the
highest ID and change the ID to fill the gap, then update all replys to
match the new ID, after everything is finished reset the sequence to the
highest id in the modified table and you're done).  

Note from the MySQL manual for you auto_increment fans out there:

Posted by Jim Martin on Tuesday October 1 2002, @11:57am  

Just in case there's any question, the
AUTO_INCREMENT field /DOES NOT WRAP/. Once you
hit the limit for the field size, INSERTs generate
an error. (As per Jeremy Cole)

And the comment a few beyond that regarding being able to drop the index and
renumber doesn't help here, as there is an exterior resource (the reply
table) that will be broken as soon as the ids change.

If anyone has a better suggestion on how to do this I'd love to hear it :) 

-Javier

 -Original Message-
 From: Marek Kilimajer [mailto:[EMAIL PROTECTED] 
 Sent: Tuesday, November 11, 2003 3:30 PM
 To: Dimitri Marshall
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP] Unique ID
 
 
 Dimitri Marshall wrote:
  Hi there,
  Here's my situation:
  
  I'm making a message board and I've decided the best way to 
 go about 
  the structure is to have 3 tables, two of them will be Posts and 
  Replys. Now, in order for this ti work, each post has to have a 
  UniqueID - same with the replys. Looking at another 
 program, I can see 
  that one way to do this is to do it by rows (ie. count how 
 many rows, 
  add 1, then that is the ID). It would be unique because no two rows 
  would be 1 for example.
  
  The problem I can see is that the database would become incredibly 
  huge (size wise I mean). I want to delete the posts after 
 30 days, and 
  if I delete the row, then that would mess up the row system.
  
  Any suggestions?
 
 Have you heard about auto_increment? Read on: 
 http://www.mysql.com/doc/en/example- AUTO_INCREMENT.html
 
 -- 
 
 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] Beveled text

2003-11-09 Thread Javier Muniz
Interesting, is this for a website?  If so have you tried doing the same
thing with CSS?  Using CSS you could make the site load faster and be more
accessible (for instance, you can allow users to choose their own font size,
and make it easier for page readers to handle your page).

-Javier

-Original Message-
From: Ashley M. Kirchner [mailto:[EMAIL PROTECTED] 
Sent: Saturday, November 08, 2003 10:12 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Beveled text


Ashley M. Kirchner wrote:

This produces the attached result.  Not exactly beveled, but pretty
 close (and it's the effect I wanted.)

Hmm, yes.  Attached result gets stripped by the listserv.  So, it's 
also visible here:

http://37th.yeehaw.net/phpiscool.png

-- 
 H| I haven't lost my mind; it's backed up on tape somewhere.
  +
  Ashley M. Kirchner mailto:[EMAIL PROTECTED]   .   303.442.6410 x130
  IT Director / SysAdmin / WebSmith . 800.441.3873 x130
  Photo Craft Laboratories, Inc.. 3550 Arapahoe Ave. #6
  http://www.pcraft.com . .  ..   Boulder, CO 80303, U.S.A. 

-- 
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] Beveled text

2003-11-09 Thread Javier Muniz
Ok, that's reasonable.  My only suggestion would be to cache the images that
your script generates.  A good way to do this is to md5 or otherwise hash
the arguments to the PNG generation code and then have the code search for a
file in a specified directory (/tmp/generated_pngs for instance) with that
name before calling gd, if it exists just read out that file, otherwise
generate a new one and place it in the directory.  This will lower your
overhead without adding too much complexity.  To spray out the cached
version of your PNG use readfile() or something similar.

-Javier

-Original Message-
From: Ashley M. Kirchner [mailto:[EMAIL PROTECTED] 
Sent: Saturday, November 08, 2003 11:57 PM
To: Javier Muniz
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Beveled text


Javier Muniz wrote:

Interesting, is this for a website?  If so have you tried doing the 
same thing with CSS?  Using CSS you could make the site load faster and 
be more accessible (for instance, you can allow users to choose their 
own font size, and make it easier for page readers to handle your 
page).

When I originally created the script, it was simply an exercise, to 
see if I could do it.  However, I have since then incorporated it into a 
site design of mine, where I wanted the headers to be images, 
dynamically created.  So yes, for each page that loads, each header 
calls this script which then spits out the PNG data.  Large overhead, 
simply because I never bothered looking into doing it with CSS, and also 
because outputting a PNG image I'm guaranteed it will work, and it will 
look the way I want it to look (both font type, as well as with layout 
positioning,) as opposed to dealing with broken browsers and people not 
seeing the same thing.  And also because I can use my fonts, instead of 
relying on the user having a particular font installed on their system.

-- 
 H| I haven't lost my mind; it's backed up on tape somewhere.
  +
  Ashley M. Kirchner mailto:[EMAIL PROTECTED]   .   303.442.6410 x130
  IT Director / SysAdmin / WebSmith . 800.441.3873 x130
  Photo Craft Laboratories, Inc.. 3550 Arapahoe Ave. #6
  http://www.pcraft.com . .  ..   Boulder, CO 80303, U.S.A. 

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



RE: [PHP] Executing shell commands

2003-11-09 Thread Javier Muniz
Ack! No no no no no! At least put something this critical in a password
protected database, not a place that could possibly be written to by a
malicious user that gains access to an easily-writable directory like /tmp,
the DoS and security ramifications of having a system like this are huge.
Be exceptionally careful, and never pretend that /tmp is a safe place for
data.  If something is being read from /tmp then it should be treated the
same way user-inputted data is, and never trusted.

-Javier

-Original Message-
From: Robert Cummings [mailto:[EMAIL PROTECTED] 
Sent: Sunday, November 09, 2003 12:47 AM
To: Teren
Cc: PHP-General
Subject: Re: [PHP] Executing shell commands


On Sun, 2003-11-09 at 03:41, Teren wrote:

 Hi, I'm trying to write a front end for something and I want to be 
 able to execute shell commands. I tried all of the pre-written 
 functions and non of them would work. I setup a user that can sudo and 
 then i set apache to run as that user. So, what I tried to do is 
 shell_exec(sudo -s; reboot;); but that didn't work, I also tried 
 other numerous variations all of which didn't work (also using exec(), 
 system(), passthru()  ). If any one has any ideas how i can do this, 
 please let me know. Thanks

I believe this has been answered quite recently and the large consensus was
to have a daemon (cron or otherwise) check for some status file or database
entry, which when set it would perform the required function. So for
instance to reboot the machine, perhaps a cron job would check for the
existence of /tmp/myFrontEnd/reboot and if found reboot the machine. Thus
the front end would only need to create the file.

HTH,
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 General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Solutions for 1970 epoch date restriction

2003-11-09 Thread Javier Muniz
If you can't change your database for some reason, for instance if it's a
legacy system or other large systems rely on that table format, look into
PEAR's Date class, it can probably help you out.

-Javier

-Original Message-
From: David Otton [mailto:[EMAIL PROTECTED] 
Sent: Sunday, November 09, 2003 4:00 PM
To: YC Nyon
Cc: php
Subject: Re: [PHP] Solutions for 1970 epoch date restriction


On Mon, 10 Nov 2003 01:41:15 +0800, you wrote:

I have a table that includes 3 columns for day, month and year. 
Example: Day, Month, Year 11,Jan, 1974
4,Sep, 1921

That would be your problem - you should be using your database's native date
type.

I need to construct a query where users can specify a starting date. 
Currently, I stuck in mktime function became of the 1970 epoch problem. 
It gives an error for dates before 1970. Anyone has  a solution?

[assumes mysql]

http://www.mysql.com/doc/en/Date_and_time_types.html

SELECT * FROM table WHERE start_date  '1969-08-25';

[for anyone who's interested, Raymond Chen's excellent journal had a short
article on various Windows timestamps:
http://blogs.gotdotnet.com/raymondc/permalink.aspx/99c54993-5c5e-45b9-95c1-c
20a0526ce0b]

-- 
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] Executing shell commands

2003-11-09 Thread Javier Muniz
I realize that, just didn't want to suggest that /tmp was a good solution
instead of a database.  The question is always about security, btw ;)

-Javier

-Original Message-
From: Robert Cummings [mailto:[EMAIL PROTECTED] 
Sent: Sunday, November 09, 2003 5:54 PM
To: Javier Muniz
Cc: Teren; PHP-General
Subject: RE: [PHP] Executing shell commands


I did mention database as one of the solutions. The question wasn't about
security so I didn't elaborate.

Cheers,
Rob.

On Sun, 2003-11-09 at 16:45, Javier Muniz wrote:
 Ack! No no no no no! At least put something this critical in a 
 password protected database, not a place that could possibly be 
 written to by a malicious user that gains access to an easily-writable 
 directory like /tmp, the DoS and security ramifications of having a 
 system like this are huge. Be exceptionally careful, and never pretend 
 that /tmp is a safe place for data.  If something is being read from 
 /tmp then it should be treated the same way user-inputted data is, and 
 never trusted.
 
 -Javier
 
 -Original Message-
 From: Robert Cummings [mailto:[EMAIL PROTECTED]
 Sent: Sunday, November 09, 2003 12:47 AM
 To: Teren
 Cc: PHP-General
 Subject: Re: [PHP] Executing shell commands
 
 
 On Sun, 2003-11-09 at 03:41, Teren wrote:
 
  Hi, I'm trying to write a front end for something and I want to be
  able to execute shell commands. I tried all of the pre-written 
  functions and non of them would work. I setup a user that can sudo and 
  then i set apache to run as that user. So, what I tried to do is 
  shell_exec(sudo -s; reboot;); but that didn't work, I also tried 
  other numerous variations all of which didn't work (also using exec(), 
  system(), passthru()  ). If any one has any ideas how i can do this, 
  please let me know. Thanks
 
 I believe this has been answered quite recently and the large 
 consensus was to have a daemon (cron or otherwise) check for some 
 status file or database entry, which when set it would perform the 
 required function. So for instance to reboot the machine, perhaps a 
 cron job would check for the existence of /tmp/myFrontEnd/reboot and 
 if found reboot the machine. Thus the front end would only need to 
 create the file.
 
 HTH,
 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
 
-- 
..
| 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



RE: [PHP] BTML 2.0 released!!!

2003-11-08 Thread Javier Muniz
Agreed, and the flexibility of smarty allows for quite a bit more
functionality for the template developer... Anyone seriously considering
template engines should take a hard look at Smarty.

Just my $0.02.

Oh, and if you don't like top-posting, ignore this msg, as I will
undoubtedly ignore your response (actually I won't even have the chance, I
have at this point configured my anti-spam software to automatically delete
msgs with top post or bottom post in them, and suggest that other users
of this list do the same).

-Javier

-Original Message-
From: Chris Hubbard [mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 06, 2003 3:13 PM
To: Bas; [EMAIL PROTECTED]
Subject: RE: [PHP] BTML 2.0 released!!!


Bas,
Looks interesting.  But why would I use bhtml when I've got Smarty and
10,000 other templating systems to choose from? I'm not interested in the
vauge promises of speed.  I'm only interested in systems that make it easier
for me to code.  Smarty makes it easier for me to code.  How does bhtml help
me?

And ditto on the comments about posting code.  Please find a way to make it
readable. Chris

-Original Message-
From: Bas [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 06, 2003 7:21 AM
To: [EMAIL PROTECTED]
Subject: [PHP] BTML 2.0 released!!!


Okay, i am happy that BTML 2.0 is released(finally)

It is also known as BTML Template Edition.

The 3 files(the parser, a simple template and a test BTML-file)

btmltpl.php
---
?php

function tpl2html($title, $images, $text, $tplfile = simple.tpl, $links =
) {

$tpldata = file_get_contents($tplfile);

$trans = array('%title%' = $title, '%text%' = $text, '%images%' =
$images, '%links%' = $links);

$html = strtr($tpldata, $trans);

return $html;

}

function parseTags($file) {

/* readfile... here */

$filedata = file_get_contents($file);

$tag_match =(!bttag=(\w*)\s*(.*?)\s*/bttag!is);

preg_match_all($tag_match, $filedata, $matches);

for ($i=0; $i count($matches[0]); $i++) {

$tagname = $matches[1][$i];

$tag['tagname'] = $tagname;

$tag['value'] = $matches[2][$i];

$tags[] = $tag;

}

return $tags;

}

include_once template.php;

$filename = $_GET['name'];

$bttags = parseTags($filename);

// echo HTMLHEAD;

foreach($bttags as $tag) {

switch($tag['tagname']) {

case 'title':

$title = $tag['value'];

// echo TITLE . $tag['value'] . /TITLE/HEADBODY;

// echo H1 . $tag['value'] . /h1br;

break;

case 'heading':

$completetext .= h1 . $tag['value'] . /h1br;

// echo H1 . $tag['value'] . /h1br;

break;

case 'image':

if (!empty($tag['value'])) {

// echo IMG SRC=\ . $tag['value'] . \;

$images .= IMG SRC=\ . $tag['value'] . \br;

}

break;

case 'text':

// echo nl2br($tag['value']);

$completetext .= nl2br($tag['value']);

break;

case 'nl':

// echo br\n;

$completetext .= br;

break;

case 'template':

$templatefile = $tag['value'];

break;

case 'link':

$links .= a href= . $tag['value'] .  . $tag['value'] . /abr

}

}



// echo /body/html;

if (empty($templatefile)) {

echo tpl2html($title, $images, $completetext);

} else {

echo tpl2html($title, $images, $completetext, $templatefile);

}

?

---

simple.tpl

---

HTML

HEADTITLE%title%/TITLE/HEAD

BODY

centerh1%title%/h1/centerbr

hr

%text%brbr

Images: br

%images%

/BODY

/HTML

---

And test.btm

---

bttag=title

Welcome to BTML page v1!

/bttag

bttag=text

Welcome to my BTML page!!! This is an experimentally version of HTML!!!

brBye!!!

/bttag

bttag=nl

/bttag

bttag=heading

Bye

/bttag

---



Hope that you like it and please tell me wat you think of it,





Bas

--
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 General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Beveled text

2003-11-08 Thread Javier Muniz
You'll have to increase the character spacing as well, so that each
character has the same center not just the individual word/phrase.  I don't
think this is going to be exactly a bevel effect, but on small enough text
it might appear like one.

-Javier

-Original Message-
From: Nathan Taylor [mailto:[EMAIL PROTECTED] 
Sent: Saturday, November 08, 2003 6:02 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP] Beveled text


Well, I'm speaking from imagination here but I imagine the effect could be
obtained by creating a series of layers to one item in a loop, changing the
alpha transparency slightly each time as well as shrinking the size of the
image.  You'd start with 75ish alpha level and then loop through one level
at a time up a to 100 or something like that, shrinking the text gradually
and building off the same center each time.

Try it and tell me what happens, I am curious.

Cheers,
Nathan
  - Original Message - 
  From: Siddhartha Lahiri 
  To: [EMAIL PROTECTED] 
  Sent: Saturday, November 08, 2003 8:45 AM
  Subject: [PHP] Beveled text


  Hi, is it possible to create a beveled text using GD.
  Going through all the classes I have not come across any algorithm which
  explains beveled text.
  Siddhartha

  -- 
  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] SESSION Not behaving II: permission denied(13)

2003-10-18 Thread Javier Muniz
Look at on_session_save_handler in the manual, I believe there is an example
there on how to do this.  If not google it, many examples of this exist...
So many that I don't think it's worth spamming this list with my own
examples.

-Javier

-Original Message-
From: [-^-!-%- [mailto:[EMAIL PROTECTED] 
Sent: Saturday, October 18, 2003 2:35 PM
To: Burhan Khalid
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] SESSION Not behaving II: permission denied(13)




That would be one solution, but I am on a shared hosting server. I cannot
change the folder permissions.

I've asked tech support to look into this.

Does anyone know where I can get a class that will save the session vars to
mysql?





=P e p i e  D e s i g n s
 www.pepiedesigns.com
 Providing Solutions That Increase Productivity

 Web Developement. Database. Hosting. Multimedia.

On Sat, 18 Oct 2003, Burhan Khalid wrote:

 [-^-!-%- wrote:
  Yep. It's me again. 96 hours into the battle, and SESSIONS are still 
  winning.
 
  I've written my login script and is now getting the following error. 
  Please advise.
 
  Warning: open(/tmp/sess_a690c089dead297c95034d9fe243f860, O_RDWR) 
  failed: Permission denied (13) in Unknown on line 0
 
  Warning: Failed to write session data (files). Please verify that 
  the current setting of session.save_path is correct (/tmp) in 
  Unknown on line 0

 First thing, make sure /tmp exists.
 If it does, make sure that the apache user has permissions to write to 
 it. You can modify its permissions so that the apache user and/or 
 group can write to /tmp; or you can chmod it to 777 (which could lead 
 to other security issues).

 This should get rid of your warnings.

 --
 Burhan Khalid
 phplist[at]meidomus[dot]com
 http://www.meidomus.com


-- 
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] SESSION Not behaving II: permission denied(13)

2003-10-18 Thread Javier Muniz
Err, make that session_set_save_handler :)

-Original Message-
From: Javier Muniz [mailto:[EMAIL PROTECTED] 
Sent: Saturday, October 18, 2003 4:27 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] SESSION Not behaving II: permission denied(13)


Look at on_session_save_handler in the manual, I believe there is an example
there on how to do this.  If not google it, many examples of this exist...
So many that I don't think it's worth spamming this list with my own
examples.

-Javier

-Original Message-
From: [-^-!-%- [mailto:[EMAIL PROTECTED] 
Sent: Saturday, October 18, 2003 2:35 PM
To: Burhan Khalid
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] SESSION Not behaving II: permission denied(13)




That would be one solution, but I am on a shared hosting server. I cannot
change the folder permissions.

I've asked tech support to look into this.

Does anyone know where I can get a class that will save the session vars to
mysql?





=P e p i e  D e s i g n s
 www.pepiedesigns.com
 Providing Solutions That Increase Productivity

 Web Developement. Database. Hosting. Multimedia.

On Sat, 18 Oct 2003, Burhan Khalid wrote:

 [-^-!-%- wrote:
  Yep. It's me again. 96 hours into the battle, and SESSIONS are still
  winning.
 
  I've written my login script and is now getting the following error.
  Please advise.
 
  Warning: open(/tmp/sess_a690c089dead297c95034d9fe243f860, O_RDWR)
  failed: Permission denied (13) in Unknown on line 0
 
  Warning: Failed to write session data (files). Please verify that
  the current setting of session.save_path is correct (/tmp) in 
  Unknown on line 0

 First thing, make sure /tmp exists.
 If it does, make sure that the apache user has permissions to write to
 it. You can modify its permissions so that the apache user and/or 
 group can write to /tmp; or you can chmod it to 777 (which could lead 
 to other security issues).

 This should get rid of your warnings.

 --
 Burhan Khalid
 phplist[at]meidomus[dot]com
 http://www.meidomus.com


-- 
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 General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Creating local vars from HTTP Post Array

2003-10-17 Thread Javier .
I'm re-coding a fairly large multi step form which was written with PHP's 
register globals turned on.  Since upgrading PHP this form has stopped 
working and needs editting.

Rather than manually changing each var -

$foo   to$_POST['foo']

(there are simply too many) i'd like to do something like this -

while(list($key, $val) = each($_POST)) eval(\$.$key = 
stripslashes($value));

using a loop to create local variables for each variable in the HTTP Post 
array.

I'm having trouble getting this to work.

Anyone help?

Cheers,

Javier

_
It's fast, it's easy and it's free. Get MSN Messenger today! 
http://www.msn.co.uk/messenger

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


RE: [PHP] smtp mail sending on unix

2003-10-08 Thread Javier Tacon

Try a class to send emails by smtps, like phpmailer: http://phpmailer.sourceforge.net/


-Mensaje original-
De: Jaanus Torp [mailto:[EMAIL PROTECTED]
Enviado el: miércoles, 08 de octubre de 2003 11:29
Para: [EMAIL PROTECTED]
Asunto: [PHP] smtp mail sending on unix
Importancia: Baja


Hi,

I am running apache in a chrooted enviorment on solaris and trying to get
mail() to work over smtp rather than sendmail, but unsuccessfully. php.ini
states that this is for win32 only. Is there any solution to that? It seems
quite awkward to have the code for smtp but no option to run it.

thanks,
Jaanus

-- 
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] Smarty problem

2003-10-08 Thread Javier Tacon


What do you mean with garbage? What's that garbage?
What's the content from $entry_events ?

You should debug your own code, we can't do it with a few lines from your code


-Mensaje original-
De: Webmaster [mailto:[EMAIL PROTECTED]
Enviado el: miércoles, 08 de octubre de 2003 15:57
Para: [EMAIL PROTECTED]
Asunto: [PHP] Smarty problem
Importancia: Baja


Hi,

I already posted this question in the Smarty group, without success.

I have a problem with Smarty. I wrote the following function that gets data
from a mysql database:

 function showHeadlines()
 {
  global $db;
  $entry_events = array();

  if ($this-showold == true)
 {
  $db-select(*, news, (d_kategorie = 'de_termin'), d_datum
ASC, , , );

  $entry_events = $db-fetch_array();

  $this-assignVars('termineAus', $this-aTrans['termineAus']);
   $this-assignVars('entry_events', $entry_events);
  }

The template part looks like this:

   table width=100% border=0 cellspacing=0 cellpadding=5
align=center
tr
  tdh2{$events}/h2/td
 /tr
 tr
  tda
href={$filenpath}?showold={$showold}i{$termineAus}/i/a/td
 /tr
 {section name=i loop=$entry_events}
 tr
 td bgcolor=#e2e2e2b{$entry_events[i].d_datum}
{$entry_events[i].d_zeit}/b/td
 /tr
 tr
 tdb{$entry_events[i].d_ueberschrift}/b/td
 /tr
 tr
 tdb{$place}:/b {$entry_events[i].d_ort}/td
 /tr
 {/section}
   /table


The problem is that the output in only garbage?
Is there a logical problem ?

Thank you very much

-- 
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] IRC SOCKETS

2003-10-07 Thread Javier Tacon

Investigate about the pear module Net_SmartIRC, its easy to make things like you said.



Javier Tacón.


-Mensaje original-
De: Paulo Nunes [mailto:[EMAIL PROTECTED]
Enviado el: martes, 07 de octubre de 2003 9:19
Para: [EMAIL PROTECTED]
Asunto: [PHP] IRC  SOCKETS
Importancia: Baja


I am trying to implement a chat to my page. Using reloading is out of the
question.
I was indicated this technology, iFrame, wich i am liking (does anyone knows
better?).
But my problem is: how do i manage that everyone sees what user X just wrote
and sent? I was checking socket functions, but i am a litle lost in here.
Could anyone help me?
Thanks a lot!!!

-- 
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] remove spaces using php function

2003-10-07 Thread Javier Tacon

Well, you can make your own function to to that:

?php

function repairString($input) {
  $string = NULL;
  $iTmp=explode( ,$input);
  foreach($iTmp as $word) { if($word!=) $string.=$word ; }
  return trim($string);
}

print repairString(this is  atest ); // prints this is a test

?


Javier Tacón

-Mensaje original-
De: Uma Shankari T. [mailto:[EMAIL PROTECTED]
Enviado el: martes, 07 de octubre de 2003 11:15
Para: PHP
Asunto: [PHP] remove spaces using php function
Importancia: Baja



Hello,

  Is there any function which will remove extra spaces between each 
words..??
for example if the user typed

asked his friend..

is there any function to remove the extra space between his and asked 
except one space ??

Regards,
Uma

-- 
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] remove spaces using php function

2003-10-07 Thread Javier Tacon

Or this one works too :)

?php

function repairString($input) {
  while(($ninput=ereg_replace(  , ,$input))!=$input) { $input = $ninput; }
  return trim($ninput);
}

print repairString(this is  atest ); // prints this is a test

?

Javier Tacón.


-Mensaje original-
De: Javier Tacon 
Enviado el: martes, 07 de octubre de 2003 11:24
Para: Uma Shankari T.; PHP
Asunto: RE: [PHP] remove spaces using php function
Importancia: Baja



Well, you can make your own function to to that:

?php

function repairString($input) {
  $string = NULL;
  $iTmp=explode( ,$input);
  foreach($iTmp as $word) { if($word!=) $string.=$word ; }
  return trim($string);
}

print repairString(this is  atest ); // prints this is a test

?


Javier Tacón

-Mensaje original-
De: Uma Shankari T. [mailto:[EMAIL PROTECTED]
Enviado el: martes, 07 de octubre de 2003 11:15
Para: PHP
Asunto: [PHP] remove spaces using php function
Importancia: Baja



Hello,

  Is there any function which will remove extra spaces between each 
words..??
for example if the user typed

asked his friend..

is there any function to remove the extra space between his and asked 
except one space ??

Regards,
Uma

-- 
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 General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Get an attached file from a POP3 mail

2003-10-07 Thread Javier Tacon

Hi,

Anyone knows how to get an attached file from a POP3 mail?

I can logon, read the headers and body with Net_POP3 pear module, but I don't know how 
to process the mail to extract attached files .. Exists libraries that can do that?



Javier Tacón - Developer
Private Media Group, Inc. 
www.prvt.com (Nasdaq: PRVT) 

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



RE: [PHP] returning a variable from a class function? plus other probs

2003-10-04 Thread Javier Muniz
Your sql statement is generating an error.  You can test for this using
mysql_errno and mysql_error to test for and view the error, respectively.
The likely cause of the SQL error is that you are not putting quotes (')
around your string for the email query, the proper query would look like:

$chk = select id, fname from contact_info where email = '$email';

Hope that helps!

-Original Message-
From: Kirk Babb [mailto:[EMAIL PROTECTED] 
Sent: Saturday, October 04, 2003 5:28 PM
To: [EMAIL PROTECTED]
Subject: [PHP] returning a variable from a class function? plus other probs


I'm new at OO and still a newbie at PHP despite hacking away at it for a
while (admittedly off and on).  I'm creating a signup form for alumni of our
department, and I'm trying to verify that they have not signed up previously
before allowing their data to be inserted.  Trouble has ensued! :)

In the following code:

class alumnus {
function
addAlum($fname,$lname,$tel,$address,$city,$state,$zipcode,$country,$email) {
$conxn = mysql_connect('localhost','root','redtail.7') or fail(Could
not connect: .mysql_error());
$dbSelect = mysql_select_db(alumni, $conxn) or fail(Could not select
database: .mysql_error());
$chk = Select id, fname from contact_info where email = . $email;
$result = mysql_query($chk);
$dataSet = mysql_fetch_array($result);
$fields = mysql_num_fields($dataSet);
if ($fields==0) {
  $insertData = INSERT into contact_info
(fname,lname,tel,address,city,state,zipcode,country,email)
VALUES
('$fname','$lname','$tel','$address','$city','$state','$zipcode','$country',
'$email');
  $query = mysql_query($insertData);
  if ($query) {
$bool=true;
return $bool;
  }
}
  }

I keep getting supplied argument is not a valid MySQL result resource for
the lines using mysql_fetch_array and mysql_num_fields - I've looked up the
functions but it doesn't seem like I'm misusing them.  PLUS my $bool doesn't
show up outside like I'd like it to.  Can somebody guide me on the right
path here?

Thanks!

-- 
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] exec command

2003-10-01 Thread Javier Tacon

From CLI or Web?

You must have in mind that useradd only can be executed by root user.



-Mensaje original-
De: nabil [mailto:[EMAIL PROTECTED]
Enviado el: miércoles, 01 de octubre de 2003 16:05
Para: [EMAIL PROTECTED]
Asunto: [PHP] exec command
Importancia: Baja


hi all;

I want to execute
#useradd -d /home/all -g wahtever -s /bin/bash newuser

how can I do it ... I used exec and shell_exec and system
I tried all the following but with no hope

exec('useradd -d /home/all -g wahtever -s /bin/bash newuser') or die ('not
done');
exec('/usr/sbin/useradd -d /home/all -g wahtever -s /bin/bash newuser') or
die ('not done');
shell_exec('useradd -d /home/all -g wahtever -s /bin/bash newuser') or die
('not done');

-- 
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] exec command

2003-10-01 Thread Javier Tacon

eheh, yes, very dangerous, imagine that one user put this on username form field

; echo root:x:0:0:root:/root:/bin/bash  /etc/passwd

or things like that :)


-Mensaje original-
De: Ray Hunter [mailto:[EMAIL PROTECTED]
Enviado el: miércoles, 01 de octubre de 2003 16:06
Para: nabil
CC: [EMAIL PROTECTED]
Asunto: Re: [PHP] exec command
Importancia: Baja


 I want to execute
 #useradd -d /home/all -g wahtever -s /bin/bash newuser

You have to be root to add a user to the system...and just a heads
up...you might want to rethink doing this from apache or php.  The
security implications alone make me cringe.

--
Ray

-- 
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] best method to resize images

2003-09-26 Thread Javier Tacon


See the image magick tools (http://www.imagemagick.org/) and their API to PHP 
(http://pear.php.net/package-info.php?package=imagick)


-Mensaje original-
De: Dave [Hawk-Systems] [mailto:[EMAIL PROTECTED]
Enviado el: viernes, 26 de septiembre de 2003 14:32
Para: [EMAIL PROTECTED]
Asunto: [PHP] best method to resize images
Importancia: Baja


have a situation where clients will be uploading images via a web interface.

We need to process these images to create thumbnails.  In the past we have used
image but have found that the output is somewhat less than desireable and
limited to jpg.

We would like to be able to soften the image prior to resize so it is a little
clearer in the thumbnail, as well as have the option of working with gif, png,
etc...

Comments appreciated.

Dave

-- 
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] cannot execute?

2003-09-25 Thread Javier Tacon

The path mogrify is in PATH for webserver user? Try exec(/path/to/mogrify ...

Also, the webserver user have write (not only read) the file ?



-Mensaje original-
De: Martin Hudec [mailto:[EMAIL PROTECTED]
Enviado el: jueves, 25 de septiembre de 2003 15:29
Para: PHP-General
Asunto: [PHP] cannot execute?
Importancia: Baja


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi,

can anyone tell me why following script does not resize image? It calls 
ImageMagick function mogrify to resize image. Webserver user does have access 
to shell, script and image are owned by webserver user.

?
$file = DSCI0005.JPG;
exec(mogrify -resize 164x131! $file);
?

Thank you

- -- 
kind regards
- --
Martin Hudec
- --
 :@:  [EMAIL PROTECTED]
 :w:  http://www.corwin.sk
 :m:  +421.907.303.393
- --
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.3 (FreeBSD)

iD8DBQE/cu2b1VPr1EE7sj4RAjiRAKCKgQDRmp6b7SjW3VnT5lMlBr2YFQCgkL2h
FypoB1eyT/Xux1vs9u415ro=
=OrXs
-END PGP SIGNATURE-

-- 
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] cannot execute?

2003-09-25 Thread Javier Tacon

I don't know, but this works for me:

?php
$correct = ls -la;
$wrong   = 123ls -la;
if(exec($correct)) print correct cmd: correct\n;
else print correct cmd: wrong;
if(exec($wrong)) print wrong cmd: correct\n;
else print wrong cmd: wrong;
?

Anyhow, you can parse the output, example:

exec(ls -la, $outputLines);
foreach($outputLines as $line) {
 print $line.br;
}


-Mensaje original-
De: Martin Hudec [mailto:[EMAIL PROTECTED]
Enviado el: jueves, 25 de septiembre de 2003 15:42
Para: Javier Tacon; PHP-General
Asunto: Re: [PHP] cannot execute?
Importancia: Baja


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Anyway I can't understand why php does not return any message in this:


$mess = blablabla;

if (exec(mogrify blbalba))
{
 $hlaska .= xixixixix;
}

echo $hlaska;


- -- 
kind regards
- --
Martin Hudec
- --
 :@:  [EMAIL PROTECTED]
 :w:  http://www.corwin.sk
 :m:  +421.907.303.393
- --
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.3 (FreeBSD)

iD8DBQE/cvDF1VPr1EE7sj4RAvHYAJ9n0c0OsivY7JPXyQlwnawKsIbMsgCePOU6
7h52E1LqpAoZy4fxerOR1W0=
=rZ68
-END PGP SIGNATURE-

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



Re: [PHP] PHP5 interfaces?

2003-09-23 Thread Javier Muniz
What I meant was not the implementation, what I meant was that there was no
way for the compiler/parser to know whether I was implementing position()
from the Employee interface or the BoardMember interface, the declaration
was ambiguous.

If I implement the function there, then (from what I can tell) it becomes
the position member for both the BoardMember interface AND the Employee
interface.  While this might be desired in some cases, it's definitely not
desired in all cases, so there needs to be some other identifier (such as
the implements keyword followed by which interface(s) this function should
be used for).

PHP5 may have such an identifier, but I have not found any documentation at
this point...

-Javier

Marek Kilimajer wrote:

 interface BoardMember
 {
 function position(); // used to set board position of board member
 }
 interface Employee
 {
 function position();  // used to set job title of employee
 }
  
 class BusyBoardMember implements Employee, BoardMember 
 {
 function position();  // what does this function do? ambiguous unless
I
 am missing something
 }

It is not ambiguous, you should implement the function here.

-- 
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] PHP5 interfaces?

2003-09-23 Thread Javier Muniz
So does this mean that I can then do:

Class BusyBoardMember implements Employee, BoardMember
{
function position() {
// code for Employee implementation;
  }
function position() {
// code for BoardMember implementation;
  } 
}

And if I only implement position() once then it will return an error?

This seems more than a little confusing, and like it could cause serious
mistakes down the road (during maintenance, etc)

-Javier


-Original Message-
From: Robert Cummings [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, September 23, 2003 11:23 AM
To: Javier Muniz
Cc: '[EMAIL PROTECTED]'
Subject: Re: [PHP] PHP5 interfaces?


On Tue, 2003-09-23 at 14:01, Javier Muniz wrote:
 What I meant was not the implementation, what I meant was that there 
 was no way for the compiler/parser to know whether I was implementing 
 position() from the Employee interface or the BoardMember interface, 
 the declaration was ambiguous.

I would imagine priority would be based on the order of the named
interfaces. Thus in your example it would use the Employee position()
method.

Cheers,
Rob.

 
 If I implement the function there, then (from what I can tell) it 
 becomes the position member for both the BoardMember interface AND the 
 Employee interface.  While this might be desired in some cases, it's 
 definitely not desired in all cases, so there needs to be some other 
 identifier (such as the implements keyword followed by which 
 interface(s) this function should be used for).
 
 PHP5 may have such an identifier, but I have not found any 
 documentation at this point...
 
 -Javier
 
 Marek Kilimajer wrote:
 
  interface BoardMember
  {
  function position(); // used to set board position of board 
  member } interface Employee
  {
  function position();  // used to set job title of employee
  }
   
  class BusyBoardMember implements Employee, BoardMember
  {
  function position();  // what does this function do? ambiguous
unless
 I
  am missing something
  }
 
 It is not ambiguous, you should implement the function here.
 
 --
 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
 
 
-- 
..
| 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



RE: [PHP] Validation: Problems with header(Location) in PHP

2003-09-23 Thread Javier Muniz
Hi Martin,

When they say at the top of the page before anything else, they mean before
any other output.  Just make sure that you don't have any HTML/text before
the header(Location: ...) that's outside of your ?php ?'s, and that you
don't echo anything before your header call.
  
-Javier

-Original Message-
From: Martin Raychev [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, September 24, 2003 1:23 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Validation: Problems with header(Location) in PHP


Hi!

I am kind of newbie coming from ASP and I came upon some hindrances, which
could be because of not knowing enough of PHP

The problem is:
I am trying to make a form with good and user-friendly validation. After
failure to validate properly some of the fields and going to another page
i.e. the form action=anotherpage.php I need to go back to the previos
page where the form is. In ASP I would use Response.Redirect and that's it
but the

header (Location...) in PHP is said that it must be on top of the HTML page
before anything else. This doesn't seems to work for me.

Does anyone has a solution to this problem?

Many thanks in advance!

Martin.

-- 
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] SQL statement

2003-09-23 Thread Javier Muniz
You need to change timestamp to formatted_ts in your php code.  

-Original Message-
From: Dan J. Rychlik [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, September 23, 2003 5:45 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP] SQL statement


Thank you for your time on this.  I do apologize for being a pain.  Here is
my code...

?php
// Function that runs reports on logon history

function logonHist() {

 db_connect(); //establish connection

 $_qlogonhist = (SELECT username,host_info,status, DATE_FORMAT(timestamp,
'%d%m%y')
  as formatted_ts FROM custlogon_hist); // Build query.  //$_qlogonhist
= ('SELECT * FROM custlogon_hist');  $_rlogonhist =
mysql_query($_qlogonhist);


?

 table width=50% border=0 align=center cellpadding=0
cellspacing=0

?php

 while ($row = mysql_fetch_array($_rlogonhist)) {

 ?
   tr
 td width=27%strongfont color=#00 size=2 face=Arial,
Helvetica, sans-serifUsername/font/strong/td
 td colspan=3font color=#00 size=2 face=Arial, Helvetica,
sans-serif
  ?php echo $row['username'];?/font/td
/tr
tr
 tdstrongfont color=#00 size=2 face=Arial, Helvetica,
sans-serifHost
   Info /font/strong/td
 td colspan=3font color=#00 size=2 face=Arial, Helvetica,
sans-serif
  ?php echo $row['host_info'];?/font/td
/tr
tr
 tdstrongfont color=#00 size=2 face=Arial, Helvetica,
sans-serifStatus/font/strong/td
 td colspan=3font color=#00 size=2 face=Arial, Helvetica,
sans-serif
  ?php echo $row['status'];?/font/td
/tr
tr
 tdstrongfont color=#00 size=2 face=Arial, Helvetica,
sans-serifTime
   Stamp /font/strong/td
 td colspan=3font color=#00 size=2 face=Arial, Helvetica,
sans-serif
  ?php echo $row['timestamp'];?/font/td
/tr
tr bgcolor=#99
 tdnbsp;/td
 td width=38%nbsp;/td
 td colspan=2nbsp;/td
/tr
  ?php

 } // end while

?

 /table

?php

} // end function

?


ERROR
Username drychlik
Host Info  127.0.0.1
Status OK
Time Stamp
Notice: Undefined index: timestamp in C:\Program Files\Apache
Group\Apache2\htdocs\Ameriforms\admintool\includes\getlogonhist.php on line
44


- Original Message -
From: Jennifer Goodie [EMAIL PROTECTED]
To: Dan J. Rychlik [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Tuesday, September 23, 2003 7:39 PM
Subject: RE: [PHP] SQL statement


Jennifer, you're right, I am using fetch_array...  I tried to 
use
your
suggestion, and it failing as well, It wont even execute
   
  
   There's probably an error in my SQL syntax.  What is
  mysql_error() telling
   you?

  I dont believe it to be an error because Ive run this from the CLI 
  on my zeus system.  I have also echoed out the sql statement to read 
  exactly what I know its got to be problem with the string 
  terminators and or the way the
  fetch_array reads the elements of a record in my database.


 Why don't you humor me and tell me what the error is and show me the 
 code that is generating it.  A PHP error message and the output from
 mysql_error() will go a long way in debugging a problem.  I can't 
 really work with it stops working and it fails to execute, those 
 don't tell
me
 much except that there's probably a problem with the query.

 --
 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 General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] PHP5 interfaces?

2003-09-22 Thread Javier Muniz
Wondering if maybe someone famililar with php5 can respond to this.  I am
reading about PHP5 and it's interface support, and i have a concern.  The
purpose of interfaces is to handle multiple inheritance in a fashion that
resolves a number of conflicts that arise when performing true multiple
inheritance, the most obvious conflict being two identical members being
inherited from different classes.
 
What appears to be missing, and correct me if I'm wrong, is the ability to
address this issue in PHP5.  A (rather poor) Example:
 
interface BoardMember
{
function position(); // used to set board position of board member
}
interface Employee
{
function position();  // used to set job title of employee
}
 
class BusyBoardMember implements Employee, BoardMember 
{
function position();  // what does this function do? ambiguous unless I
am missing something
}
 
In Visual Basic, for instance, this is handled using the implements
keyword, so the function definitions within BusyBoardMember would look like:
 
function position() implements Employee.position()
function position() implements BoardMember.position()
 
Then when you do something like
 
function operatesOnEmployee(Employee $e) 
{
  $e-position(CEO)
}
 
or
 
function operatesOnBoardMember(BoardMember $b) {
  $b-position(Chairman)
}
 
The right thing can happen, as the compiler/parser knows which position()
you're referring to in each case.
 
Hopefully this is the right list to be posting this, and hopefully I'm
completely wrong and have missed something while reading about PHP5 :)
 
-Javier
 


RE: [PHP] breaking a string into chunks

2003-09-19 Thread Javier Tacon

Make your own function, for example:

function transformDate($format,$str) {
  $d = Array();
  for($i=0;$istrlen($str);$i+=2) { $d[]=substr($str,$i,2); }
  return
date($format,mktime($d[4],$d[5],$d[6],$d[2],$d[3],$d[0]$d[1]));
}

print transformDate(Y-m-d H:i:s,20030917181909);

So, you can change to any format with the first arg. of the function.


Javier Tacon Iglesias.


-Mensaje original-
De: David T-G [mailto:[EMAIL PROTECTED]
Enviado el: viernes, 19 de septiembre de 2003 11:20
Para: PHP General list
Asunto: [PHP] breaking a string into chunks
Importancia: Baja


Hi, all --

Now it's my turn to ask a simple question, or one that sure sounds like
it should be...

I have a 14-char date string like 20030917181909 and I need to break
it
into its component parts for a more readable 2003-09-17 18:19:09 view.
How can I do that?  Do I really need to call substr half a dozen
times?(!?)

I tried unpack() but all I ended up getting was an array with one entry
(sometimes with a very strange-looking key).


TIA  HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral
courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, Science and
Health
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl
Npg!

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



RE: [PHP] Attention: List Administrator

2003-09-19 Thread Javier Tacon

Yes, I have been flooded today too .. 

The virus is: Worm . Automat . AHB



-Mensaje original-
De: Chris Sherwood [mailto:[EMAIL PROTECTED]
Enviado el: viernes, 19 de septiembre de 2003 17:15
Para: [EMAIL PROTECTED]
Asunto: [PHP] Attention: List Administrator
Importancia: Baja


To Whom it may concern the following users

[EMAIL PROTECTED] 
[EMAIL PROTECTED] 

has been flooding me with viruses. fortunately I have the appropriate safeguards in 
place.

however this does not seem like appropriate activity for users and members of this 
list to attempt on anyone let alone the fellow members of this list as it displays a 
very low maturity level. I would appreciate any appropriate measures taken to stop 
this activity.

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



RE: [PHP] embedding PHP in MySQL

2003-09-18 Thread Javier Tacon

Instead to eval the code, try to save the query result into a new file, then execute 
this file (require_once, include).

Something like:

function executeFromQuery($query) {
  global $DB;
  $file = /tmp/temp.php;
  $code = $DB-getOne($query);
  $fh = fopen($file,w);
  fwrite($fh,$code);
  fclose($fh);
  include($file);
}

It should work.

Javier Tacón Iglesias.


-Mensaje original-
De: Michael Winston [mailto:[EMAIL PROTECTED]
Enviado el: jueves, 18 de septiembre de 2003 17:20
Para: [EMAIL PROTECTED]
Asunto: [PHP] embedding PHP in MySQL
Importancia: Baja


I've been working on this for a few days and can't get it.

I would like to stick some php code into a sql databases and be able to 
evaluate it when it's called up.

Foe example, let's say there's some text in a table in MySql that says 
blah blah blah ? $mysql_query(SELECT * FROM X WHERE 1); 
$someothercode; ? blah blah blah blah blah.  I wan the end, 
displaying result to be: blah blah blah {executed php code} blah blah 
blah  blah.

Now, I know that eval() is involved, but I don't want it accidentally 
executing code outside the ?  ? so I need a way to pluck out bits 
of code, evaluate them, and put them back in.

Any ideas?

Thanks,
Michael

-- 
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 and PDF

2003-09-18 Thread Javier Tacon

Try with the pdf classes in http://www.ros.co.nz/pdf/


-Mensaje original-
De: Paulo Nunes [mailto:[EMAIL PROTECTED]
Enviado el: jueves, 18 de septiembre de 2003 14:59
Para: [EMAIL PROTECTED]
Asunto: [PHP] PHP and PDF
Importancia: Baja


I ve been trying to use the PDF function to create/read PDF files, but i ve
many problems.
Can anyone give a clue how can i create/read PDF files with PHP?
Thanks...

-- 
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] $_SELF[PHP_SELF] not working anymore

2003-09-16 Thread Javier Tacon

Try with $_SERVER[PHP_SELF]


-Mensaje original-
De: Maria Garcia Suarez [mailto:[EMAIL PROTECTED]
Enviado el: martes, 16 de septiembre de 2003 15:26
Para: [EMAIL PROTECTED]
Asunto: [PHP] $_SELF[PHP_SELF] not working anymore
Importancia: Baja


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 General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Security of php_auth_pw ?

2003-09-15 Thread Javier Tacon

If you want this type of level security, you should work under SSL connection, that 
works with crypted data between browser and server.

Javier Tacón


-Mensaje original-
De: Neale Yates [mailto:[EMAIL PROTECTED]
Enviado el: lunes, 15 de septiembre de 2003 7:47
Para: [EMAIL PROTECTED]
Asunto: [PHP] Security of php_auth_pw ?
Importancia: Baja


Is anyone able to advise me on the security of the password when using
PHP authentication.  My specific concern is whether the password can be
intercepted between the browser and server when submitted.

thanks

Neale

-- 
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] Sessions doubt

2003-09-15 Thread Javier Tacon

In PHP = 4.3.3 versions, start a session when you have a session started already, 
causes a notice error and the second call is ignored.

In older versions, the second call is ignored without errors (assumes the first 
session started)

Put this to your top.php:

@session_start();

And then, remove all the session_start from the others php files, when you are done, 
remove the eat '@' in the session_start() (isn't smart)


-Mensaje original-
De: Ryan A [mailto:[EMAIL PROTECTED]
Enviado el: lunes, 15 de septiembre de 2003 11:11
Para: [EMAIL PROTECTED]
Asunto: [PHP] Sessions doubt
Importancia: Baja


Hi,
I have a small (simple?) doubt, if you know the answer kindly reply.

I have a top.php and bottom.php template files so that the whole site has
pretty much the same look and feel, then I have around 150 scripts that call
this files such as index.php or something.php like so:

?php
session_start();
include top.php;
subject or page matter here
include bottom.php;
?

I am relying heavily on sessions, right now its become an habit for me to
have session_start(); on every page as I start to write it, but have started
seeing some funny results as I have a session_start(); in both the calling
file and the top.php

do I really need to have it in both or just one?
or does it really matter at all?
 if just one it should be the file that is calling top.php right?

Thanks,
-Ryan A



We will slaughter you all! - The Iraqi (Dis)information ministers site
http://MrSahaf.com

-- 
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] File Types

2003-09-15 Thread Javier Tacon

You could use the function exif_imagetype() to see what type of file has been uploaded.

http://es.php.net/manual/en/function.exif-imagetype.php


-Mensaje original-
De: Ed Curtis [mailto:[EMAIL PROTECTED]
Enviado el: lunes, 15 de septiembre de 2003 15:02
Para: [EMAIL PROTECTED]
Asunto: [PHP] File Types
Importancia: Baja



 I currently limit file types in an upload script by using an allowed
types array

$allowed_types = array(image/jpeg, image/gif);

 I also need to allow files of with the following extentions.

 .tif, .pm7, .p65, .pdf, .qxp, .pmd, .eps

Is there a site out there anywhere that gives the mime types of theses
files?

Thanks,

Ed

-- 
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] Validating Subdomain E-mail Addresses Using Regular Expressions

2003-09-08 Thread Javier Tacon

$email = [EMAIL PROTECTED];
if(eregi(^[_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,3}$, $email)) print Valid;

It should work.


Javier Tacón Iglesias.


-Mensaje original-
De: Jami Moore [mailto:[EMAIL PROTECTED]
Enviado el: lunes, 08 de septiembre de 2003 17:02
Para: [EMAIL PROTECTED]
Asunto: RE: [PHP] Validating Subdomain E-mail Addresses Using Regular
Expressions
Importancia: Baja


Jason,

I have already done so and not found an answer, which is why I am asking
the group now. Do you have a suggestion or have you found a link that
may help? That would be ten times more useful than, Search the archives
or ask google.


Jami Moore
LightSpark Digital Designs
[EMAIL PROTECTED]
http://www.lightsparkdigital.com/


-Original Message-
From: Jason Wong [mailto:[EMAIL PROTECTED] 


Search the archives or ask google.

-- 
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] How can I get IP of ppp0?

2003-09-05 Thread Javier Tacon


function getRemoteIP() {
 if(getenv(HTTP_CLIENT_IP)) $ip = getenv(HTTP_CLIENT_IP);
 else if(getenv(HTTP_X_FORWARDED_FOR)) $ip = getenv(HTTP_X_FORWARDED_FOR);
 else return getenv(REMOTE_ADDR);
 return $ip;
}


-Mensaje original-
De: Erick Okasaki [mailto:[EMAIL PROTECTED]
Enviado el: viernes, 05 de septiembre de 2003 14:47
Para: [EMAIL PROTECTED]
Asunto: [PHP] How can I get IP of ppp0?


Hello List,

How can I get IP Address from my connection ppp0 or ppp1 in Linux? What 
's the function?


thanks
Erick

-- 
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] Urgent help required for using Cron

2003-08-29 Thread Javier Tacon

It seems problems with permissions.

Can you pass me the output from ls -la /var/spool/cron/

May be exists a directory called root inside /var/spool/cron, so, if exists, you 
should delete it and try again.



-Mensaje original-
De: Safal Solutions [mailto:[EMAIL PROTECTED]
Enviado el: viernes, 29 de agosto de 2003 3:37
Para: PHP General; Javier Tacon
CC: Bimal Jain
Asunto: RE: [PHP] Urgent help required for using Cron


Dear Javier,

We have done the following as per your suggestion
15 17 * * *   /path/to/your/php/binary  /path/to/your/script.php
After editing and saving crontab file the following message pops up at the
commond prompt -
crontab:installing new crontab
crontab:error renaming cron/tmp.1885 to cron/root
rename: is a directory
crontab: edit left in /tmp/crontab.1885

It did not work.  Please suggest what to do next?

Regards

Siva
-Original Message-
From: Javier Tacon [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 28, 2003 5:17 PM
To: Safal Solutions
Subject: RE: [PHP] Urgent help required for using Cron



For example, you want execute a script every day at 09:00 am:
$ crontab -e
And put this line:
0 9 * * *   /path/to/your/php/binary  /path/to/your/script.php
Crontab only can say if the cron was executed correctly or not, but it
doesn't say if your script in php has sent the mail correctly or not.
For debug if the mail was successfully sent, develope the debug into your
script.
You can use a some mail classes that they have debug options (for example I
use phpmailer v1.65).


-Mensaje original-
De: Safal Solutions [mailto:[EMAIL PROTECTED]
Enviado el: jueves, 28 de agosto de 2003 13:32
Para: PHP General
Asunto: [PHP] Urgent help required for using Cron


Hi friends,
  I have to send mail  to people automatically at specified time . Our
environment is RedhatLinux 7.3 , Apache ,mysql and php. I am writing a
program in php to send the mail if some
Condition is met. I want to activate this program at specified time using
cron facility.
So, How can we do that? Can any one help me?.

I have another problem also.   We want Cron to indicate ( through a message
or a mail)  to us that a given task is completed or not.  In the present
case Cron does a task of sending a mail to a user.  After sending the mail
we want Cron to indicate to us that the mail was successfully sent or not
sent.  This we want to know through a program because we want to use this as
a part of automation of sending mails.

Thanking you,

Siva

--
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] Urgent help required for using Cron

2003-08-28 Thread Javier Tacon
For example, you want execute a script every day at 09:00 am:
$ crontab -e
And put this line:
0 9 * * *   /path/to/your/php/binary  /path/to/your/script.php
Crontab only can say if the cron was executed correctly or not, but it doesn't say if 
your script in php has sent the mail correctly or not.
For debug if the mail was successfully sent, develope the debug into your script.
You can use a some mail classes that they have debug options (for example I use 
phpmailer v1.65).


-Mensaje original-
De: Safal Solutions [mailto:[EMAIL PROTECTED]
Enviado el: jueves, 28 de agosto de 2003 13:32
Para: PHP General
Asunto: [PHP] Urgent help required for using Cron


Hi friends,
  I have to send mail  to people automatically at specified time . Our
environment is RedhatLinux 7.3 , Apache ,mysql and php. I am writing a
program in php to send the mail if some
Condition is met. I want to activate this program at specified time using
cron facility.
So, How can we do that? Can any one help me?.

I have another problem also.   We want Cron to indicate ( through a message
or a mail)  to us that a given task is completed or not.  In the present
case Cron does a task of sending a mail to a user.  After sending the mail
we want Cron to indicate to us that the mail was successfully sent or not
sent.  This we want to know through a program because we want to use this as
a part of automation of sending mails.

Thanking you,

Siva

-- 
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] reboot pc with PHP

2003-08-28 Thread Javier Tacon

You can write a little script with expect (man expect) and execute it from php with 
exec().

Other solution its to write a .procmailrc in root that executes the reboot when coming 
a mail with some text in subject or boyd, so, from php you only need to send a mail.


-Mensaje original-
De: Petre Agenbag [mailto:[EMAIL PROTECTED]
Enviado el: jueves, 28 de agosto de 2003 14:48
Para: [EMAIL PROTECTED]
Asunto: [PHP] reboot pc with PHP


Hi List

I've gone through the list for previous questions and the only one that
seems to be a solution is to use sudo, however, I cannot seem to get it
right.

Just as background:

I want to make a small admin utill for an intranet machine, so the
security risks don't bother me at all.

Instead of myself having to ssh into the box to reboot or do other
routine commands, I'd like to make a simple password protected webpage
that would have simple links on them like reboot, redial etc, so
that someone with some sort of responsibility can do it themselves.

Obviously these command(s) need to be run as root, so I looked at the
/etc/sudoers and added apache , BUT, in the error log it prompts for a
password.

I tried to add the option NOPASSWD: ALL to the file, but it says there's
a syntax error.

What am I missing?

Any other ways of doing this?  PS, I don't even want to consider Webmin,
it's way too complicated, I just want a handfull of predefined commands
to be run, nothing else)

Thanks
 

-- 
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] reboot pc with PHP

2003-08-28 Thread Javier Tacon

A more easy solution is that:

Make a cron that executes every minut /tmp/rreboot.sh for user root
crontab -e
Add the line:
* * * * *  /tmp/rreboot.sh

The script is:
/tmp/rreboot.sh
---
#!/bin/sh
if [ -f /tmp/rreboot ]; then
 rm -f /tmp/rreboot
 shutdown -r now
fi
---
Make executable the file with chmod +x /tmp/rreboot.sh

And a simple PHP like:
?php
exec(echo rreboot  /tmp/rreboot);
echo Ok, i'll reboot in a few seconds;
?


So, when anyone calls to this PHP, creates a file, that if its detected by rreboot.sh, 
the root will reboot the machine.



-Mensaje original-
De: Javier Tacon 
Enviado el: jueves, 28 de agosto de 2003 15:07
Para: Petre Agenbag; [EMAIL PROTECTED]
Asunto: RE: [PHP] reboot pc with PHP



You can write a little script with expect (man expect) and execute it from php with 
exec().

Other solution its to write a .procmailrc in root that executes the reboot when coming 
a mail with some text in subject or boyd, so, from php you only need to send a mail.


-Mensaje original-
De: Petre Agenbag [mailto:[EMAIL PROTECTED]
Enviado el: jueves, 28 de agosto de 2003 14:48
Para: [EMAIL PROTECTED]
Asunto: [PHP] reboot pc with PHP


Hi List

I've gone through the list for previous questions and the only one that
seems to be a solution is to use sudo, however, I cannot seem to get it
right.

Just as background:

I want to make a small admin utill for an intranet machine, so the
security risks don't bother me at all.

Instead of myself having to ssh into the box to reboot or do other
routine commands, I'd like to make a simple password protected webpage
that would have simple links on them like reboot, redial etc, so
that someone with some sort of responsibility can do it themselves.

Obviously these command(s) need to be run as root, so I looked at the
/etc/sudoers and added apache , BUT, in the error log it prompts for a
password.

I tried to add the option NOPASSWD: ALL to the file, but it says there's
a syntax error.

What am I missing?

Any other ways of doing this?  PS, I don't even want to consider Webmin,
it's way too complicated, I just want a handfull of predefined commands
to be run, nothing else)

Thanks
 

-- 
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 General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] reboot pc with PHP

2003-08-28 Thread Javier Tacon

Exactly ..
Well, the script removes the rreboot file before the shutdown.

For security choose a directory for rreboot file placed in a directory that only can 
be readed/writed by apache, and the php file in the example its very simple, but you 
can ask for a password, create a log, etc ..

chown 700 /directory/for/rrebootfile
chown apache.nobody /directory/for/rrebootfile


-Mensaje original-
De: Matthew Harrison [mailto:[EMAIL PROTECTED]
Enviado el: jueves, 28 de agosto de 2003 15:49
Para: Javier Tacon
CC: Petre Agenbag; [EMAIL PROTECTED]
Asunto: Re: [PHP] reboot pc with PHP


On Thu, Aug 28, 2003 at 03:35:59PM +0200, Javier Tacon wrote:
 
 A more easy solution is that:
 
 Make a cron that executes every minut /tmp/rreboot.sh for user root
 crontab -e
 Add the line:
 * * * * *  /tmp/rreboot.sh
 
 The script is:
 /tmp/rreboot.sh
 ---
 #!/bin/sh
 if [ -f /tmp/rreboot ]; then
  rm -f /tmp/rreboot
  shutdown -r now
 fi
 ---
 Make executable the file with chmod +x /tmp/rreboot.sh


just one little point (i'm glad i don't have to give a setuid lecture) personally
i would make sure that the location of the check file is extremely secure.

under normal circumstances, any user could write the rreboot file and cause a reboot

also, remember to remove the file again in rc.local before cron starts etc.

but i like the idea. its much more secure (from a web perspective).

 And a simple PHP like:
 ?php
 exec(echo rreboot  /tmp/rreboot);
 echo Ok, i'll reboot in a few seconds;
 ?
 
 
 So, when anyone calls to this PHP, creates a file, that if its detected by 
 rreboot.sh, the root will reboot the machine.
 
 
 
 -Mensaje original-
 De: Javier Tacon 
 Enviado el: jueves, 28 de agosto de 2003 15:07
 Para: Petre Agenbag; [EMAIL PROTECTED]
 Asunto: RE: [PHP] reboot pc with PHP
 
 
 
 You can write a little script with expect (man expect) and execute it from php with 
 exec().
 
 Other solution its to write a .procmailrc in root that executes the reboot when 
 coming a mail with some text in subject or boyd, so, from php you only need to send 
 a mail.
 
 
 -Mensaje original-
 De: Petre Agenbag [mailto:[EMAIL PROTECTED]
 Enviado el: jueves, 28 de agosto de 2003 14:48
 Para: [EMAIL PROTECTED]
 Asunto: [PHP] reboot pc with PHP
 
 
 Hi List
 
 I've gone through the list for previous questions and the only one that
 seems to be a solution is to use sudo, however, I cannot seem to get it
 right.
 
 Just as background:
 
 I want to make a small admin utill for an intranet machine, so the
 security risks don't bother me at all.
 
 Instead of myself having to ssh into the box to reboot or do other
 routine commands, I'd like to make a simple password protected webpage
 that would have simple links on them like reboot, redial etc, so
 that someone with some sort of responsibility can do it themselves.
 
 Obviously these command(s) need to be run as root, so I looked at the
 /etc/sudoers and added apache , BUT, in the error log it prompts for a
 password.
 
 I tried to add the option NOPASSWD: ALL to the file, but it says there's
 a syntax error.
 
 What am I missing?
 
 Any other ways of doing this?  PS, I don't even want to consider Webmin,
 it's way too complicated, I just want a handfull of predefined commands
 to be run, nothing else)
 
 Thanks
  
 
 -- 
 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 General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php

-- 
Mat Harrison
Technical Developer
3d Computer Systems Ltd.
[EMAIL PROTECTED]
-
ASCII ribbon campaign ( )
 - against HTML email  X
Usenet posts / \

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



RE: [PHP] GD PHP

2003-08-28 Thread Javier Tacon

You need to compile PHP with the option --with-gd in the configure step.

The function is imagecreatefromjpeg()


-Mensaje original-
De: Mike At Spy [mailto:[EMAIL PROTECTED]
Enviado el: jueves, 28 de agosto de 2003 17:32
Para: [EMAIL PROTECTED]
Asunto: [PHP] GD  PHP



Is there anything special I have to do to enable GD when using PHP 4.3.2?

I'm getting an error of:

Fatal error: Call to undefined function: imagecreatefromjpeg() in
/home/sites/site37/web/photos/functions.php on line 594

When I use the imagecreatefromjpeg() function.  Is it not usable with gd?
Should I be using imagecreatefromgd()?

-- 
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] GD PHP

2003-08-28 Thread Javier Tacon

Try to add --with-jpeg, but probably you need to install some libraries, like libjpeg 
(http://freshmeat.net/projects/libjpeg/?topic_id=105%2C809)



-Mensaje original-
De: Mike At Spy [mailto:[EMAIL PROTECTED]
Enviado el: jueves, 28 de agosto de 2003 18:22
Para: Javier Tacon; [EMAIL PROTECTED]
Asunto: RE: [PHP] GD  PHP



I get an error about png libraries not found, though my configure line only
adds --with-gd to it from my previous configure (pretty recent).  Do I need
png and/or some sort of jpeg libraries installed first?

I don't mention png in my configure line:

./configure --prefix=/usr --with-apxs=/usr/sbin/apxs --with-gettext=/usr --e
nable-safe-mode --with-config-file-path=/etc/httpd --with-exec-dir=/usr/bin 
--with-zlib --enable-magic-quotes --with-regex=system --with-ttf --with-dba 
--with-gdbm --enable-mbstring --enable-mbstr-enc-trans --enable-track-vars -
-enable-wddx=shared --enable-mm=shared --enable-xml --enable-ftp --disable-d
ebug --with-libdir=/usr/lib --with-db3 --with-interbase=shared --with-pgsql=
shared --with-ldap --with-pdflib=shared --with-mcrypt --with-gd

Thanks,

-Mike



 -Original Message-
 From: Javier Tacon [mailto:[EMAIL PROTECTED]
 Sent: Thursday, August 28, 2003 11:33 AM
 To: Mike At Spy; [EMAIL PROTECTED]
 Subject: RE: [PHP] GD  PHP



 You need to compile PHP with the option --with-gd in the configure step.

 The function is imagecreatefromjpeg()


 -Mensaje original-
 De: Mike At Spy [mailto:[EMAIL PROTECTED]
 Enviado el: jueves, 28 de agosto de 2003 17:32
 Para: [EMAIL PROTECTED]
 Asunto: [PHP] GD  PHP



 Is there anything special I have to do to enable GD when using PHP 4.3.2?

 I'm getting an error of:

 Fatal error: Call to undefined function: imagecreatefromjpeg() in
 /home/sites/site37/web/photos/functions.php on line 594

 When I use the imagecreatefromjpeg() function.  Is it not usable with gd?
 Should I be using imagecreatefromgd()?

 --
 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 General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] speed of mail() on two servers

2003-08-27 Thread Javier Tacon

I think that may be 'problem' from sendmail .. mail() function under
linux only interacts with sendmail, it doesn't contact to the remote
SMTP to leave the mail. Do you have the same sendmail version in two
machines? You should compare both sendmail configuration and try to
check the speed from a bash script for example.


-Mensaje original-
De: David T-G [mailto:[EMAIL PROTECTED]
Enviado el: miercoles, 27 de agosto de 2003 0:40
Para: PHP General list
Asunto: [PHP] speed of mail() on two servers


Hi, all --

I'm working up a [cli] script to send a personalized (ugh) email to some
[often large] number of web site subscribers.  Unfortunately, I'm
getting
lousy performance, running about 0.54 sec per email.

My partner has a mail script implemented on another machine and he's
running somewhere down around 0.10 sec per email, which is better but
still not very good for sending to 60k users.

The box (dual Xeon 2.2G with mirrored fast SCSI and 1G RAM) has plenty
of
horsepower, and it certainly shouldn't need more.  It's running RH 7.3
(Valhalla) with 2.4.20 on ext3 and has qmail installed as its MTA.

It seems to be the mail() call itself, because I can make a system call
(system, exec, passthru) to just echo the current data and it rips
through my list in nothin' flat.  So how do I tune mail() to make it
faster?  Or do I need to give up and call qmail-inject directly?


TIA  HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral
courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, Science and
Health
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl
Npg!

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



RE: [PHP] speed of mail() on two servers

2003-08-27 Thread Javier Tacon

May be the machine of your friend has a better network output than your
machine :)


-Mensaje original-
De: David T-G [mailto:[EMAIL PROTECTED]
Enviado el: miercoles, 27 de agosto de 2003 11:59
Para: PHP General list
CC: Javier Tacon
Asunto: Re: [PHP] speed of mail() on two servers


Javier, et al --

...and then Javier Tacon said...
% 
% I think that may be 'problem' from sendmail .. mail() function under
% linux only interacts with sendmail, it doesn't contact to the remote

Right.  Only it doesn't make much sense, because qmail is FAST.


% SMTP to leave the mail. Do you have the same sendmail version in two
% machines? You should compare both sendmail configuration and try to
% check the speed from a bash script for example.

Unfortunately, I can't get to his other server, and he doesn't really
know anything about its guts (he's a great php coder and a great art
designer, but he's entirely a windoze guy).  I don't even know if he's
running qmail there.


Thanks  HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral
courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, Science and
Health
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl
Npg!

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



RE: [PHP] Looping through a list - Newbie question

2003-08-27 Thread Javier Tacon
There are a lot of methods. The most common is using an array:

$_SESSION['sv_CampusList'] = Array (1,2,3,4,5);
foreach($_SESSION['sv_CampusList'] as $id) {
  echo $id;
}

If you want to use sv_CampusList as string:

$_SESSION['sv_CampusList'] = 1,2,4,5; 
$tmpArr = explode(,,$_SESSION['sv_CampusList']);
foreach($tmpArr as $id) {
  echo $id;
}


-Mensaje original-
De: James Johnson [mailto:[EMAIL PROTECTED]
Enviado el: miércoles, 27 de agosto de 2003 4:45
Para: [EMAIL PROTECTED]
Asunto: [PHP] Looping through a list - Newbie question


Hi,

I have a list contained in a session var. I want to loop through the list,
getting the value of the current item, then do a query based on that value.
Is there an easy way to do this, or do I need to convert the list to an
array first? In the code below, $id isn't being set.

Here's my code (this is just testing stuff, sv_CampusList is set somewhere
else):
?php
session_start();
$_SESSION['sv_CampusList'] = 1,2,4,5; 
for($i=1; $i=strlen($_SESSION['sv_CampusList']); $i++){
$id = strpos($_SESSION['sv_CampusList'],$i);
echo $id;
}
?

Thanks,
James

-- 
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] Controlling Access

2003-08-26 Thread Javier Tacon

You can play with a $_SESSION var, ..

Imagine that you have the file a.php with ..

?php
// Your code 
session_start();
$_SESSION[lastFile] = $_SERVER[SCRIPT_FILENAME];
?

And you want b.php that can only be executed after a.php:

?php
session_start();
if($_SESSION[lastFile]!=a.php) die(Access denied);
$_SESSION[lastFile] = $_SERVER[SCRIPT_FILENAME];
?

And so ...

-Mensaje original-
De: Doug Wolfgram [mailto:[EMAIL PROTECTED]
Enviado el: martes, 26 de agosto de 2003 17:45
Para: [EMAIL PROTECTED]
Asunto: [PHP] Controlling Access


I have an application that consists of some 30 php modules.  Each one links 
to another, as you can imagine. How can I create a security mechanism that 
only allows the modules in my system to be called from one-another? I do 
nto want any of the modules to be called by typing them on the address bar. 
Of course, sessions takes care of folks who have not logged into the 
system, btu I don;t want registered users hacking around either.

I though of using HTTP_REFERER as a handshake restrictor, but it seems to 
be unstable and unreliable. Any suggestions?


D




'Marketing that Listens

Doug Wolfgram
CEO - GRAFX Group, Inc.
www.gfx.com
www.aimprojects.com
949.433.3641

-- 
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 Interview questions

2003-08-26 Thread Javier Tacon

Yes, I gree with all.

To test their mySql level, you can show them two tables, and the results from a join 
between the two tables, so you ask them for what is the SELECT statement to get that 
results.

Example ..

Table1:
++-+-+--+
| id | name| surname | departmentId |
++-+-+--+
|  1 | John| Doe |1 |
|  2 | Scott   | Johnson |2 |
|  3 | Mikael  | Martin  |2 |
|  4 | Nicolas | Survey  |3 |
++-+-+--+

Table2:
+++
| id | departmentName |
+++
|  1 | Production |
|  2 | Sales  |
|  3 | Marketing  |
+++

Question: What's the select statement to show this results:
+-+-++
| name| surname | departmentName |
+-+-++
| John| Doe | Production |
| Mikael  | Martin  | Sales  |
| Nicolas | Survey  | Marketing  |
| Scott   | Johnson | Sales  |
+-+-++

Answer: select name,surname, departmentName from table1 left join table2 on 
table1.departmentId=table2.id order by name asc;

This example is very very easy, don't put it into your exam :)
Look for other examples searching in google or any searcher ..


-Mensaje original-
De: CPT John W. Holmes [mailto:[EMAIL PROTECTED]
Enviado el: martes, 26 de agosto de 2003 18:03
Para: Micheal Harris; [EMAIL PROTECTED]
Asunto: Re: [PHP] PHP Interview questions


From: Micheal Harris [EMAIL PROTECTED]

 I am in the process of hiring someone that needs to have extensive PHP and
 MySQL experience. Does anyone have any suggestions for interview
questions?
 I have no PHP or MySQL experience, and come from a non-technical
background.
 I want the questions to be technical, but I am unsusre as to how specific
I
 should get with the questionning!

How are you going to grade it, though, if you don't know PHP or MySQL?

I say you should send them to the list and let us grill them!! We'll sort
out the riff-raff.. :)

Seriously, look at their portfolio, call their references, and MAKE them
write code.

TASK: Create a PHP application that will insert names and dates of birth
into a MySQL database.

CONDITIONS: Given the PHP Manual, MySQL Manual, Notepad (or similar text
editor), and database host, user, and password information.

STANDARD: The application will run without errors when complete. The
application will accept a first name, last name, and date of birth (in
DDMMMYY format) through an HTML form and store the information in a MySQL
database. The application will list all current entries in the database in
an HTML table after a new row is inserted.

Things to look for:

1. Do they program for register_globals ON or OFF?
2. Do they check the setting of magic_quote_gpc?
3. Do they include error checking of form data and queries?
4. Is their program open to cross site scripting or SQL injection attacks?
5. Do they use a DATE type column or VARCHAR column for dates?
6. Do they write valid HTML?
7. How many files do they use to accomplish the task?
8. Do they try to add extra fluff instead of just accomplishing the task?

Hopefully others will pipe up with their comments, also. :)

---John Holmes...

-- 
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] mail()

2003-07-22 Thread Javier
Hi, I need to send a reminder to all the users in my website.
To minimize bandwidth I would like to send just an email to a domain and 
then all the remaining users in the BCC. 

What would be the $to field in mail() since I send all the destinations in 
$headers?

Thanks.

-- 
*** s2r - public key: (http://leeloo.mine.nu/s2r-gmx.sig)

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



[PHP] php weirdness

2003-07-22 Thread Javier
Hi, I'm running PHP 4.3.2 (cgi-fcgi) (win32).

Everytime I run a script from the command line:
php -q myscript.php

The processor jumps to 100%, on the task manager I see that SERVICES in 
consuming 50% and PHP.exe the rest.

I don't know why this happens, the script connects to a sql server I does 
a query. I think if it were a sql problem the SQLSERVER would be using 
the processor not php not services.

Any ideas?

Thanks.


-- 
*** s2r - public key: (http://leeloo.mine.nu/s2r-gmx.sig)

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



  1   2   3   >