[PHP] Problems sending mails with PHP

2001-10-29 Thread Bruno

Yesterday everything was working fine, but today I got to my office and my
PHP couldn't send mails anymore. I get the next message in the apache log :

sh: sendmail -t -i: command not found

I've tried to change the php.ini mail section to point to the exact sendmail
path, but I get the same message.

Does anyone know what this problem is about?

Thank you!

Bruno



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




[PHP] Re: Problems sending mails with PHP

2001-10-29 Thread Bruno

Yes, I restarted the apache web server. ¿I suppose this is enough, no?

Bruno

"Cc Zona" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> In article <[EMAIL PROTECTED]>,
>  [EMAIL PROTECTED] (Bruno) wrote:
>
> > Yesterday everything was working fine, but today I got to my office and
my
> > PHP couldn't send mails anymore. I get the next message in the apache
log :
> >
> > sh: sendmail -t -i: command not found
> >
> > I've tried to change the php.ini mail section to point to the exact
sendmail
> > path, but I get the same message.
>
> You did restart the server after making the changes to php.ini, right?
>
> From <http://php.net/configuration>: "The configuration file (called
> php3.ini in PHP 3.0, and simply php.ini as of PHP 4.0) is read when PHP
> starts up. For the server module versions of PHP, this happens only once
> when the web server is started."
>
> --
> CC



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




[PHP] Datasets

2001-01-19 Thread Bruno Freire

Hi My name is Bruno, I'm in Brazil and I'm new in PHP...


I wanna know how can I roll in the records in a dataset.
Like...
Move First
Move last
Move next.os something like this

Thanks..



[PHP] ENC: Datasets

2001-01-19 Thread Bruno Freire


Hi My name is Bruno, I'm in Brazil and I'm new in PHP...


I wanna know how can I roll in the records of a dataset.
Like...
Move First
Move last
Move next.os something like this
Move previous

Thanks..



[PHP] Help!!! MY ODBC!!!!

2001-01-22 Thread Bruno Freire

Hi everyone!!
My name is BRUNO, and I'm in Brazil

I dont know how to configure my_odbc!!!

What I wanna do:

I wanna make a report using The Crystal reports.
My Mysql database is placed in a pc with LINUX. Then i have instaled Myodbc
in may pc with Win98 but just install the MYODBC doesn't work!!!

Please, If somebody knows that..HEEP!

Thanks.



[PHP] HELP! REVOKE COMMAND!!!!

2001-01-22 Thread Bruno Freire

>From Bruno: Brazil

How is the sintaxe of this command

Thanks...



[PHP] help!!! (PHP)

2001-01-23 Thread Bruno Freire

Hi ... 
I'm having some problem's here
I'm need to know  if my apache server is able to run scripts in a specific
date and hour.

For example: 

Every month, in the 15th day, I need to run a script PHP that check my Mysql
database for some cause.
Is that possible???

I'm realy thanks!!!


Bruno  de F. F

City: Belo Horizonte
Estate: Minas Gerais
Country: Brazil



[PHP] apache doubt!!!!

2001-01-23 Thread Bruno Freire

Hi ... 
I'm having some problem's here
I'm need to know  if my apache server is able to run scripts in a specific
date and hour.

For example: 

Every month, in the 15th day, I need to run a script PHP that check my Mysql
database for some cause.
Is that possible???

I'm realy thanks!!!


Bruno  de F. F

City: Belo Horizonte
Estate: Minas Gerais
Country: Brazil



[PHP] HELP!!! $PHP_AUTH_USER!!!!!!

2001-01-23 Thread Bruno Freire

Look

I justs wanna make that password box show up in the screen

But without a protected directory...

Thanks


Bruno



[PHP] PHP and PDF!!!!!

2001-01-24 Thread Bruno Freire

I Know that PHP can make PDF files.

But Some body PLEASE can pass to me a Binary instalation of this library??

Or tell me where i can find it


THANKS



[PHP] HELP!!! PDFLIB FOR PHP!!!!!

2001-01-24 Thread Bruno Freire

I need learn how to install this library to create pdf files dinamicaly.!!!



[PHP] How do I to declare a function or procedure in PHP???

2001-01-25 Thread Bruno Freire

Please ,
I don't know how to declare a functionhow is the scope??

In C++ is for example...

Void test(int a, int b)
{
.

}

But...

In php HOW DO I DECLARE A FUNCTION OR PROCEDURE????

BrunoBrazil



[PHP] Form Variables!!!!!

2001-02-21 Thread Bruno Freire

Hi! It's me again
Bruno From Brazil!!

My problem is:

I wanna know the names of the variables that my actual page recives from the
last page (using the POST method).

Thanks!!

Bruno.



[PHP] HELP!!! FTP!!!!

2001-03-05 Thread Bruno Freire

Hi my name is bruno from Brazil.

I have a linux server with Apache and PHP 4 running.
What i wanna do is upload a file.

Look the problem:
I have a lan.(local Network)
Consider this:
   Network server running apache : 6.6.6.6
   Network client station : 6.6.6.5
If The apache server executes the php code when a client station requires a
php page to make ftp conection, the remote host is the apache server and
local host is th apache server.

I think this for this cause:
Look my code:







WHAT IS WRONG???



[PHP] HELP!!! Upload files!!!!

2001-03-06 Thread Bruno Freire

Look the message:

Warning: Rename failed (Invalid cross-device link) in
/usr/local/etc/httpd/htdocs/intranet/upload.php on line 26

What i'm doing wrong???

My code:





function nomearq()
{
   teste.nome.value=teste.arquivo.value;
}


";
?>



Nome do Arquivo 








[PHP] HELP!!! Date time problems!!!!

2001-03-08 Thread Bruno Freire

Hi, My name is Bruno, From Brazil.

Yes...it's me again...hehehe

Look...my problem is..

I wanna make something like this:

(10 november 2001) - (5 November 2001) = 5 days

(10 november 2001) - (10 December 2001) = 30 days

How can i do this


Thanks for any help

Your friend, Bruno From   !



[PHP] TXT files

2001-03-13 Thread Bruno Freire

Hey Everybody!
Its me...Bruno From Brazil.

Look,
How can i read txt files with php

Thanks
See ya!



[PHP] Day of Week??

2001-03-14 Thread Bruno Freire

Hi It's me again!
Bruno...From Brazil...

Hi wanna know How can i take the day of week of aany date...

Example:

How to know that 14 of march of 2001 is a Wednesday??

Thanks...
Bruno.



[PHP] Mail help!!!!!

2001-04-17 Thread Bruno Freire

Hi! My name is Bruno.

Somebody can tell me how to send the same message to more than one recipient
without repeat de code??

something like

  $corpo.="\n";
  $corpo.="\tData de Saída:\t\t$dt_saida\n\n\n";
  $corpo.="\tClique no link abaixo para visualização da Folha de
Cotação:\n\n";
  $corpo.="\t";
  $remetente="From: [EMAIL PROTECTED]";
  mail(email_one and email_two,$assunto,$corpo,$remetente);


and not 

  $corpo.="\n";
  $corpo.="\tData de Saída:\t\t$dt_saida\n\n\n";
  $corpo.="\tClique no link abaixo para visualização da Folha de
Cotação:\n\n";
  $corpo.="\t";
  $remetente="From: [EMAIL PROTECTED]";
  mail($email_ONE,$assunto,$corpo,$remetente);

  $corpo.="\n";
  $corpo.="\tData de Saída:\t\t$dt_saida\n\n\n";
  $corpo.="\tClique no link abaixo para visualização da Folha de
Cotação:\n\n";
  $corpo.="\t";
  $remetente="From: [EMAIL PROTECTED]";
  mail($email_TWO,$assunto,$corpo,$remetente);



[PHP] Session Problems....HELP!!!!

2001-05-03 Thread Bruno Freire

Hi! my name is bruno, from Brazil and i'm having some problems with
sessions.
Look my code:

   
   ...
   
   
  
   
   

The message returned in my browser is:

Warning: Cannot send session cookie - headers already sent by (output
started at /home/httpd/html/intranet/teste.php:11) in
/home/httpd/html/intranet/teste.php on line 12

Warning: Cannot send session cache limiter - headers already sent (output
started at /home/httpd/html/intranet/teste.php:11) in
/home/httpd/html/intranet/teste.php on line 12

What's wrong???
Maybe the PHP's configuration file... Or some command is needed first

Please, if somebody  know the solution...help me.
Thanks.

Bruno



[PHP] HELP, problems with sessions.....

2001-05-09 Thread Bruno Boettcher

hello,

i have a problem with sessions. on the host where i want to install
the prog i developed on my laptop the sessions doesn't seem to work

investigating on the laptop where the system works, i allready have some
understanding problems with how sessions work.

i suppose that at the end of a session active page a session_encode is
called and the result stored on the server side session file

so i tryed session encode, at the end of my page i issue the result of
that method and print out all session vars:
session:user|s:6:"bboett";!|!groups|

debug, after the run: num of sess vars:3
Sesvar 'user' = 'bboett'
Sesvar 'bookid' = '2'
Sesvar 'groups' = '2 3 4 1'

i wonder. i have 3 session vars, with values, but i cna't find them
all in the encoded string.

and on the server that deosn't work, i see no values at all in the
eoncoded string, so on the next call on another session aware page, not
a single session var is transferred.

so what aren'T i understanding here? shouldn't all the vars and values
be in the encoded string??? and what could cause the loss of the session
vars on my server, what can i do to debug this?

-- 
ciao bboett
==
[EMAIL PROTECTED]
http://inforezo.u-strasbg.fr/~bboett http://erm1.u-strasbg.fr/~bboett
===
the total amount of intelligence on earth is constant.
human population is growing

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




Re: [PHP] HELP, problems with sessions.....

2001-05-09 Thread Bruno Boettcher

On Wed, May 09, 2001 at 09:30:27AM -0600, Johnson, Kirk wrote:
> You should not have to call session_encode() to get sessions to work. Make
uhm, i used session_encode to print out the things for debugging

> session_start(); the first line on each page where you want to use session
> variables. Use session_register() on each variable you want to be a session
that's what i do

> variable. If you still have problems, please post your code so we can look
> for bugs. Good luck!
uhm, the problem is that the code works on one machine but not on
another one, so i suppose its a setup problem and not a coding
problem

but here that's whats not going:
";

 ... rest of the page that has nothing to do with this session ...
  echo "\nsession:";
  echo session_encode();
echo "debug, after the run: num of sess
vars:".count($HTTP_SESSION_VARS)."\n";
reset ($HTTP_SESSION_VARS);
while (list ($key, $val) = each ($HTTP_SESSION_VARS ))
{
  echo "Sesvar '$key' = '$val'\n";
}//while (list ($key, $val) = each ($HTTP_SESSION_VARS )
?> 

this is basicly what i have, and that is working on one machine and not on
another

-- 
ciao bboett
==
[EMAIL PROTECTED]
http://inforezo.u-strasbg.fr/~bboett http://erm1.u-strasbg.fr/~bboett
===
the total amount of intelligence on earth is constant.
human population is growing

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




Re: [PHP] Session deletion on window close?

2002-01-22 Thread Bruno Baketaric

Uhhh? Closing a browser window, does definetly NOT delete the session.
Closing a Browser Window simply does nothing on the Server-Side, so there's
no command to delete a session executed. If someone manages to grab the
sessionid (or the cookie) and opens the Page again, the session is still
active. Neil is completely right, if he tries to generate a new GET-Request
to a special log-out page on the server that uses session_destroy().
Well, I've no experence in using the window.onclose or document.onunload
events with Netscape Javascript, but something like that should be the right
way, if you need to be really save that a session is destroyed.

Bruno

"Nick Wilson" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
>
> * On 22-01-02 at 11:30
> * Neil Freeman said
>
> > Does anyone have any suggestions as to how I could achieve the
> > following:
> > a) Browser window closed by user clicking on [X]
>
> No but I'm sure someone will.
>
> > b) 'Logging out' page opened (which handles the PHP session deletion).
>
> When a user closes the browser (any browser) the session is ended. You
> don't need to manually terminate it.
>
> HTH
> - --
>
> Nick Wilson
>
> Tel: +45 3325 0688
> Fax: +45 3325 0677
> Web: www.explodingnet.com
>
>
>
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.0.6 (GNU/Linux)
>
> iD8DBQE8TUBSHpvrrTa6L5oRAn45AJ4kltU6UKb+JCSamfgUfQ+e1CPIKACff0Xn
> NlVo2ttprA1xjdLz6lB3DWg=
> =BOV1
> -END PGP SIGNATURE-



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




Re: [PHP] matches problem ("preg_match")

2001-11-14 Thread Bruno Grab

Thank you for your answer.
However our real problem is to solve it with preg_match.
we want to rather analyse more complicated structures than the one
in our example. Well, let me reformulate it:
How can we (with preg_match) s a v e  each subpattern  into an array
element, that is, also e a c h  m a t c h  o f  a  r e p e a t e d  s u b p
a t t e r n  (e.g "(...)*" and "(...)+") ??
Thanks a lot (again)
Bruno
"Valentin V. Petruchek" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
028f01c16c5b$c87b1da0$[EMAIL PROTECTED]">news:028f01c16c5b$c87b1da0$[EMAIL PROTECTED]...
> Try this code:
>
> $str="eins zwei drei vier fünf sechs";
> $Wort = explode (' ',$str);
>
> $n=count($Wort);
> for($i=0;$i<$n;$i++){echo "$i: $Wort[$i]";}
>
> It should works
>
> Zliy Pes [EMAIL PROTECTED]
>
>
>
>



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




[PHP] matches problem: refinement of the question

2001-11-14 Thread Bruno Grab


Von: "Bruno Grab" <[EMAIL PROTECTED]>
An: <[EMAIL PROTECTED]>
Betreff: Re: [PHP] matches problem ("preg_match")
Datum: Mittwoch, 14. November 2001 12:41

Thank you for your answer.
However our real problem is to solve it with preg_match.
we want to rather analyse more complicated structures than the one
in our example. Well, let me reformulate it:
How can we (with preg_match) s a v e  each subpattern  into an array
element, that is, also e a c h  m a t c h  o f  a  r e p e a t e d  s u b -
p a t t e r n  (e.g "(...)*" and "(...)+") ??
    Thanks a lot (again)
Bruno
"Valentin V. Petruchek" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
028f01c16c5b$c87b1da0$[EMAIL PROTECTED]">news:028f01c16c5b$c87b1da0$[EMAIL PROTECTED]...
> Try this code:
>
> $str="eins zwei drei vier fünf sechs";
> $Wort = explode (' ',$str);
>
> $n=count($Wort);
> for($i=0;$i<$n;$i++){echo "$i: $Wort[$i]";}
>
> It should works
>
> Zliy Pes [EMAIL PROTECTED]
>
>
>
>





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




[PHP] P3P Implementation and PHP-Sessions

2001-12-03 Thread Bruno Baketaric

Hi,

I assume everyone has heard of P3P (Platform for Privacy Preferences), so
I'll skip explaining in detail what it is. If you don't know, just skip this
message *g*.

I've got one Problem with this, and PHP may solve it:

P3P has absolutely no Application-Server/Scripting support. It's just a
simple XML-File that tells the User what (personal) data the Website
collects, and is Requested with "hard-coded" relative URL's.
Assume a PHP Website with URL-based Session's. A User Request the Homepage
(/index.phtml) - he's anonymous, collected data is anonymous. The (static)
P3P File tells the User that the collected data is anon. Well, now the User
logs-in via a Form-Submit and reloads the Page (/index.phtml). The
information is set in the PHP-Session, the User is shown other
(personalized) Content, but the P3P-File is still the same, telling the
user, that the collected data is still anonymous - this is (or may be) wrong
now.
P3P has no mechanism to handle this case, in P3P you can only set a
different policy for (sub-)folders (differrent URI's). The problem is, that
the GET Request is absolutely the same, it doesn't matter if the user is
logged-in or anonymous (well, it would be a security hole, if someone is
able to find out, if a user is logged-in when (s)he takes a look at the URL,
hm?).

Sure, it's possible to copy all "templates" to another subfolder and link
logged-in users to this one, but why should I do so? The advantage of using
templates (a I define them) is that they just show any content. They don't
care if this content is personalized or not. The content is "prepared" by
the "business logic" - programmed in PHP - and stored in a database. This
way, I'm able to use the same "templates" for logged-in and anonymous
users - well, half the work to do...

I already talked to some P3P-Members, they think, it is no Problem, but
didn't provide a solution - at least none I was able to understand *g*.

I think, P3P should (must!!) be supported by the Application-Server or
Scripting Language. It should be possible to catch a request for a P3P file
from the Webserver, match Information from the Session, and generate the
correct XML-contents on the fly or assign a matching P3P-File.


Links:
P3P - http://www.w3.org/P3P/
One of our Website's that will have the described problem. (Not coded in
PHP - we do quite the same thing with PHP and the BroadVision Application
Server): http://www.siemens.de/solutionprovider/dialog


Bruno Baketaric
Development Director

WOB Interactive AG
Werner-Heisenberg-Strasse 6a
68519 Viernheim
Fon +49 (0)6204.970-274
Fax +49 (0)6204.970-211
E-Mail: [EMAIL PROTECTED]
ICQ: 818981
http://www.wob.ag
http://www.bbn-advertising.com
Part of: BBN The multicultural agency



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




[PHP] Re: call_user_func problem

2001-12-03 Thread Bruno Baketaric

Hi,

just do it like this - the result will be the same, and $bar is still passed
by reference:

$result = call_user_func("foo", $bar);

function foo( &$bar ) {
$bar .= 'foobar';
return 1;
}
_

This error just tells you, that you have to declare "pass-by-reference" in
your functions, and cannot use a "generic" function, that sometimes takes
parameters by reference and sometimes by value. This problem has nothing to
do with "call_user_func()".

"C" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Prior to 4.0.6 it worked fine, however, now when I try:
>
> $result = call_user_func("foo", &$bar);
>
> function foo( &$bar ) {
>$bar .= 'foobar';
>return 1;
> }
>
> I get this:
>
> Warning: Call-time pass-by-reference has been deprecated - argument passed
> by value; If you would like to pass it by reference, modify the
declaration
> of call_user_func(). If you would like to enable call-time
> pass-by-reference, you can set allow_call_time_pass_reference to true in
> your INI file. However, future versions may not support this any longer.
>
> Does that mean I can't pass by reference anymore? I kinda need to (the two
> functions above are not my actual functions btw)
>
> Thanks.
>
>



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




[PHP] Include files????

2001-04-02 Thread Bruno Freire

Hi! My name is Bruno.


Anybody can tell me how can i do Include files?
I mean,   Write a function in a file and after this just include this file
in the code, like 
<#include file.h>  of C++?? 

Thanks !!!



[PHP] ADD a user in linux using PHP

2001-06-29 Thread Bruno Freire
Title: ADD a user in linux using PHP





Hi! I'm Bruno, from brazil


Somebody knows how to create a new user in LINUX (not http server) using PHP?


Something like useradd and passwd


Thanks,


Bruno.





[PHP] ENC: ADD a user in linux using PHP

2001-06-29 Thread Bruno Freire
Title: ENC: ADD a user in linux using PHP







-Mensagem original-
De: Bruno Freire 
Enviada em: quinta-feira, 28 de junho de 2001 11:31
Para:   '[EMAIL PROTECTED]'
Cc: '[EMAIL PROTECTED]'
Assunto:    ADD a user in linux using PHP


Hi! I'm Bruno, from brazil


Somebody knows how to create a new user in LINUX (not http server) using PHP?


Something like useradd and passwd


Thanks,


Bruno.





[PHP] passwd in php....

2001-06-29 Thread Bruno Freire
Title: passwd in php





Hi...


My name is Bruno.


Somebody Knows how to use passwd in php?
I mean, create linux users on my httpd server using a php page.


I already try the EXEC(), but i had no sucess..


Any help will be needed


Thanks everyone





Re: [PHP] totally new to PHP

2004-07-27 Thread Bruno Santos
Paul Kain wrote:
I have never programmed anything
I know html and really want to know php
where is the best place to go for some really basic tutorials to start with ?
Thank in advance
 

Hello.
There are a lots of tutorials around the net.
www.phpbuilder.com <--- Very nice site for developers
www.php.net <--- PHP official site. Look in the manual, every function 
(or almost any) has a description and comments from people around the 
globe with improvements and tips.

Since you never programmed before, i recomend you to buy some PHP 
beginner books, cause always cover programing from the begining. but, if 
you can affort it, buy some programing books, with no relation to any 
programing language. It would be best for you to understande the basics 
without knowing any programing language... almost of them starts with C 
language, witch is very nice to start !

by the way, its nice for you to start programming with PHP. you will 
love it !!

--
[EMAIL PROTECTED]
--
Divisao de Informatica
[EMAIL PROTECTED]
Tel: +351 272 000 155
Fax: +351 272 000 257
--
Hospital Amato Lusitano
Av. Pedro Alvares Cabral
6000-085 Castelo Branco
[EMAIL PROTECTED]
Tel: +351 272 000 272
Fax: +351 272 000 257
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] submission before

2004-10-13 Thread Bruno Santos
hello all.
I've a question that i might think is not much related with PHP, even 
the pages are PHP and everything is working with PHP.

I've a FORM in my site to be written by the user, but, i need to know 
before the value of a field to fill another field in the form depending 
with the
value of the previous field.

i could put just the field i need filed and then, the user submit the 
value and i can after that fill the next field becase of  the 
information from the previous field.
example:

FIELD 1: some text - the user press enter, and the next field is filled 
regarding the information from these field.
how can i accomplish this ??

FIELD 2:
Another FIELD:
submit button
cheers
--
[EMAIL PROTECTED]
--
Divisao de Informatica
[EMAIL PROTECTED]
Tel: +351 272 000 155
Fax: +351 272 000 257
--
Hospital Amato Lusitano
Av. Pedro Alvares Cabral
6000-085 Castelo Branco
[EMAIL PROTECTED]
Tel: +351 272 000 272
Fax: +351 272 000 257
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] URL verification

2004-10-08 Thread Bruno Santos
Hello all.
I have a login page  where users have to authenticate themselves to 
access some site areas.
Apache is configured to use https.

the user when is typing the URL in the browser, i know that it will not 
put the https protocol.

how can i check in the page if the user is accessing the the site via SSL ??
or i have to put a redirect in the page anyway, whether the user is 
alredy accessing the page via SSL?

cheers
Bruno Santos
--
[EMAIL PROTECTED]
--
Divisao de Informatica
[EMAIL PROTECTED]
Tel: +351 272 000 155
Fax: +351 272 000 257
--
Hospital Amato Lusitano
Av. Pedro Alvares Cabral
6000-085 Castelo Branco
[EMAIL PROTECTED]
Tel: +351 272 000 272
Fax: +351 272 000 257
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Blank page of hell..what to look for

2009-02-05 Thread Bruno Fajardo
Maybe X-Debug (http://www.xdebug.org/) could help you find bugs in
your code, and
for development environments it's recommended to use the most
sensitive level of messages
(turn on E_STRICT and E_NOTIVE, for example).

2009/2/5 Ashley Sheridan 
>
> On Thu, 2009-02-05 at 12:22 -0500, Paul M Foster wrote:
> > On Thu, Feb 05, 2009 at 11:11:03AM -0600, Terion Miller wrote:
> >
> > >
> > > Speaking of IDE, which do people on here prefer, I have been using
> > > Dreamweaver CS3 just because as originally a designer I was/am used to 
> > > it...
> > > I did finally find the problem but moving an echo("damnit"); from line to
> > > line commenting out everything below it...Oi ...is this ever going to get
> > > easier for me I often wonder...
> >
> > Use Vim. ;-}
> >
> > Paul
> > --
> > Paul M. Foster
> >
> Any editor with coloured syntax highlighting will help. Just scanning
> through the script visually should let you spot the obvious errors, and
> then breaking the script down into chunks with echo statements is the
> next step. You don't need to break it down line by line, that takes
> ages! Instead, put one halfway through your code, that will let you know
> if the error is in the top or bottom half, then just keep breaking it
> down half at a time and soon you'll have the part the error is in. It's
> just a typical trial-and-error algorithm.
>
>
> Ash
> www.ashleysheridan.co.uk
>
>
> --
> 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] long echo statement performance question

2009-02-06 Thread Bruno Fajardo
In my opinion, you would achieve better results using a template
engine, like Smarty (http://www.smarty.net/). In addition, your code
would be entirely separated from presentation in a elegant way.

2009/2/6 Frank Stanovcak :
> I'm in the process of seperating logic from display in a section of code,
> and wanted to make sure I wasn't treading on a performance landmine here, so
> I ask you wizened masters of the dark arts this...
>
> is there a serious performance hit, or reason not to use long, ie more than
> 30 - 40 lines, comma conjoined echo statments...
>
> echo 'blah', $var, 'blah', $var2,...ad nauseum
>
> ... to output mixed html and php var values?  If so could you refer me to a
> work around, or better way?
>
> Frank
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



-- 
Bruno Fajardo - Desenvolvimento
bruno.faja...@dinamize.com - www.dinamize.com
Dinamize RS - Porto Alegre-RS - CEP 90420-111
Fones (51) 3027 7158 / 8209 4181 - Fax (51) 3027 7150

Dinamize BA - Lauro de Freitas - Fone 71 3379.7830
Dinamize SC - Joinville - Fone 47 3025.1182
Dinamize DF - Asa Norte - Brasília - Fone 61 3274.1172
Dinamize SP - São Paulo - Fone 11 6824.6250
Dinamize PR - Curitiba - Fone 41 3306.4388
Dinamize RS - Caxias do Sul - Fone 54 3533.4333
Dinamize RJ - Rio de Janeiro - Fone 21 2169.6311

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



Re: [PHP] long echo statement performance question

2009-02-06 Thread Bruno Fajardo
Well, Smarty's caching layer is very fast. Maybe not as fast as an
echo statement, but apparentely Frank was also interested in separate
logic from presentation, and a series of echo's is not the best
solution in my opinion. :-)
But the best solution depends of the context of the application, i agree.

2009/2/6 Eric Butera :
> On Fri, Feb 6, 2009 at 12:15 PM, Bruno Fajardo  wrote:
>> In my opinion, you would achieve better results using a template
>> engine, like Smarty (http://www.smarty.net/). In addition, your code
>> would be entirely separated from presentation in a elegant way.
>>
>> 2009/2/6 Frank Stanovcak :
>>> I'm in the process of seperating logic from display in a section of code,
>>> and wanted to make sure I wasn't treading on a performance landmine here, so
>>> I ask you wizened masters of the dark arts this...
>>>
>>> is there a serious performance hit, or reason not to use long, ie more than
>>> 30 - 40 lines, comma conjoined echo statments...
>>>
>>> echo 'blah', $var, 'blah', $var2,...ad nauseum
>>>
>>> ... to output mixed html and php var values?  If so could you refer me to a
>>> work around, or better way?
>>>
>>> Frank
>>>
>>>
>>>
>>> --
>>> 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
>>
>>
>
> In a thread about performance you suggest Smarty?  Really?  :D
>
> --
> http://www.voom.me | EFnet: #voom
>

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



Re: [PHP] long echo statement performance question

2009-02-06 Thread Bruno Fajardo
I am so stick to Smarty that I never tried other solutions, like
Savant. Thanks for the tip, I'll try it right away.

Cheers.

2009/2/6 Eric Butera :
> On Fri, Feb 6, 2009 at 1:43 PM, Bruno Fajardo  wrote:
>> Well, Smarty's caching layer is very fast. Maybe not as fast as an
>> echo statement, but apparentely Frank was also interested in separate
>> logic from presentation, and a series of echo's is not the best
>> solution in my opinion. :-)
>> But the best solution depends of the context of the application, i agree.
>
> Right on.  I was just playing anyways.  I'm a strong supporter of
> things like Savant & Zend_View.  Use PHP, but for read only type of
> things with no logic.
>
> --
> http://www.voom.me | EFnet: #voom
>



-- 
Bruno Fajardo - Desenvolvimento
bruno.faja...@dinamize.com - www.dinamize.com
Dinamize RS - Porto Alegre-RS - CEP 90420-111
Fones (51) 3027 7158 / 8209 4181 - Fax (51) 3027 7150

Dinamize BA - Lauro de Freitas - Fone 71 3379.7830
Dinamize SC - Joinville - Fone 47 3025.1182
Dinamize DF - Asa Norte - Brasília - Fone 61 3274.1172
Dinamize SP - São Paulo - Fone 11 6824.6250
Dinamize PR - Curitiba - Fone 41 3306.4388
Dinamize RS - Caxias do Sul - Fone 54 3533.4333
Dinamize RJ - Rio de Janeiro - Fone 21 2169.6311

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



Re: [PHP] php validate user password

2009-02-09 Thread Bruno Fajardo
tedd,

I think that the problem of the "duplicated hashes" in the database
(in the case of two users using the same password) persists with a
constant prefix in the passwords. Although the random salt portion get
stored in the database concatenated to the hash, the attacker don't
know the string length of the salt, making the attack very difficult.

Cheers

2009/2/9 tedd :
> At 2:02 PM + 2/9/09, Stuart wrote:
>>
>> 2009/2/9 Michael Kubler :
>>>
>>>  These days SHA should really be used instead of MD5, and you should be
>>>  SALTing the password as well.
>>>  Here's a great guide :
>>> http://phpsec.org/articles/2005/password-hashing.html
>>
>> Good advice. I would also advise against stripping and trimming
>> anything from passwords. By removing characters you're significantly
>> reducing the number of possible passwords.
>
> I read the article and didn't find any objection to it, but before we all
> jump on the SHA bus, why can't we do this:
>
> 1. Allow the user to pick whatever password they want.
>
> 2. After entry, add a token string to it, such as 'a14fmw9'.
>
> 3. Do a M5() hash and store the hash the dB.
>
> When the user wants to log back in:
>
> 1. They enter their password.
>
> 2. We add the token string ('a14fmw9') to it.
>
> 3. Then we M5() the string and compare that hash with what's stored. That
> will work.
>
> Furthermore, if the token string is stored in the script, or in a
> configuration file, and not in the database (as suggested by the author),
> then if someone obtains access to the database, all the dictionary and other
> such brute force attacks will be more difficult because the hashes are more
> complex than one would normally expect, right?
>
> If not so, then where am I wrong?
>
> Another scheme would be simply to use the user's password and generate a
> hash. Then reverse the users password and generate another hash. Then
> shuffle the two hashes, or take pairs, or quads, or any number of other
> techniques to obscure the hash. As long at the process can be reversed, it
> will work.
>
> From my limited view, a minor amount of work can throw a major monkey wrench
> in any method of trying to crack a hash -- am I wrong?
>
> Cheers,
>
> tedd
>
> --
> ---
> http://sperling.com  http://ancientstones.com  http://earthstones.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] php validate user password

2009-02-09 Thread Bruno Fajardo
Or, like the article suggested, a random portion for the hash... I
agree with you, Micah. The hash collision is a problem, and must be
avoided.
Same password hashes for different users are very good candidates for
a dictionary attack. Probably, in most of this cases, users picked
"easy" passwords, like "1234" or "admin".

Cheers

2009/2/9 Micah Gersten 
>
> onlist this time...
>
> tedd wrote:
>
> > > 
> > >
> > > I think the MD5() hash is a pretty good way and if the weakness is the
> > > user's lack of uniqueness in determining their passwords, then we can
> > > focus on that problem instead of looking to another hash. And besides,
> > > the solution presented was to create a salt and use that -- that's
> > > just another step in the algorithm process not much different than
> > > what I propose.
> > >
> > > Cheers,
> > >
> > > tedd
> > >
> >
>
> The MD5 hash IS the problem.  The problem isn't the uniqueness of the
> passwords, but rather the uniqueness of the hash. The solution is to use
> another hash that does not have the same collision issues.
>
> Thank you,
> Micah Gersten
> onShore Networks
> Internal Developer
> http://www.onshore.com
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>



--
Bruno Fajardo - Desenvolvimento
bruno.faja...@dinamize.com - www.dinamize.com
Dinamize RS - Porto Alegre-RS - CEP 90420-111
Fones (51) 3027 7158 / 8209 4181 - Fax (51) 3027 7150

Dinamize BA - Lauro de Freitas - Fone 71 3379.7830
Dinamize SC - Joinville - Fone 47 3025.1182
Dinamize DF - Asa Norte - Brasília - Fone 61 3274.1172
Dinamize SP - São Paulo - Fone 11 6824.6250
Dinamize PR - Curitiba - Fone 41 3306.4388
Dinamize RS - Caxias do Sul - Fone 54 3533.4333
Dinamize RJ - Rio de Janeiro - Fone 21 2169.6311

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



Re: [PHP] sprintf thousand separator.

2009-02-11 Thread Bruno Fajardo
Can you extend the JPGraph class, intercepting the desired method,
formatting the output the way you need?

2009/2/11 João Cândido de Souza Neto 
>
> No, I can´t, because if I do it how can jpgrhph render without numeric data?
> hehehe
>
> "Richard Heyes"  escreveu na mensagem
> news:af8726440902110523x63ce5485p6534d10063eb4...@mail.gmail.com...
> >> Thanks for your answer, but my real problem is to get thousand separator
> >> in
> >> jpgraph class which uses sprintf to display almost everithing;
> >
> > Can you format it first, and then pass it to JPGraph ?
> >
> > --
> > Richard Heyes
> >
> > HTML5 Canvas graphing for Firefox, Chrome, Opera and Safari:
> > http://www.rgraph.org (Updated January 31st)
>
>
>
> --
> 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] Re: Extract result from a https remote server response

2009-02-13 Thread Bruno Fajardo
Assigning the return of file_get_contents to a variable?
Didn't get your point...

2009/2/13 m a r k u s 
>
> Shawn McKenzie wrote:
>>
>> Shawn McKenzie wrote:
>>>
>>> m a r k u s wrote:

 Hi all,

 Example : 
 https://www.moneybookers.com/app/email_check.pl?email=t...@toto.com&cust_id=123546&password=123
 The MB server response displayed is : Illegal operation.
 We would like to put the result below in a php variable and process it .
 An idea ?

 PS: The server is secured. The php functions like file(), 
 file_get_contents(), readfile(), fopen() has been tested.
 Regards

 --

 m a r  k u s
>
>
>> allow_url_fopen = On
>
>
> We have no control of the MB remote server configuration.
>
> --
> m a r k u s
>
> --
> 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] RE: AJAX with POST

2009-04-04 Thread Bruno Fajardo
Ajax is asynchronous. The option of asynchronous or synchronous can be set
in the XMLHTTPRequest object (used by Ajax), but a synchronous call is not
Ajax.

Cheers,
Bruno.

2009/4/5 Phpster 

> Ajax can be both async and sync. Itsbthe fourth param in the open call and
> I believe by default it's a sync call not async
>
> Bastien
>
> Sent from my iPod
>
> On Apr 4, 2009, at 21:33, Skip Evans  wrote:
>
>  But my function using GET does seem to wait.
>>
>> Granted I cobbled it together from various samples and didn't author it
>> from my own deep understanding of the exact process, but here's the snippet
>> that does the real work.
>>
>> req.open('GET', url, false);
>> req.send(null);
>>
>> if(req.responseText) {
>>  if(req.responseText.substring(0,7) == 'debug!!') {
>>  alert(req.responseText.substring(7));
>>  }
>> }
>>
>> return(req.responseText);
>>
>> It seems to wait until it has data to return, because it works perfectly.
>> I can send it a URL from another function and get the data back from server
>> to the function as expected.
>>
>> The only part of it I'm unsure of is this:
>>
>> req.send(null);
>>
>> What does that do? As I said, I cobbled this function from examples, got
>> it working, and presto, was off and running.
>>
>> Skip
>>
>>
>> Brad Broerman wrote:
>>
>>> Well, as the "A" in Ajax is asynchronous, there's no real way to make it
>>> wait. What you would normally do is use a callback:
>>>   function createXHRObject( )
>>>   {
>>>   if (typeof XMLHttpRequest != "undefined")
>>>   {
>>>   return new XMLHttpRequest();
>>>   }
>>>   else if (typeof ActiveXObject != "undefined")
>>>   {
>>>   return new ActiveXObject("Microsoft.XMLHTTP");
>>>   }
>>>   else
>>>   {
>>>   throw new Error("XMLHttpRequest not supported");
>>>   }
>>>   }
>>>   function sendAjaxRequest( websvcurl , params, callbackFn )
>>>   {
>>>   var xhrObject = createXHRObject();
>>>   xhrObject.open("POST", websvcurl, true);
>>>   xhrObject.onreadystatechange = function()
>>>   {
>>>   if (xhrObject.readyState == 4)
>>>   {
>>>   if( xhrObject.responseXML != null )
>>>   {
>>>   callbackFn (xhrObject.responseXML);
>>>   }
>>>   }
>>>   }
>>>   xhrObject.setRequestHeader("Content-type",
>>> "application/x-www-form-urlencoded");
>>>   xhrObject.setRequestHeader("Content-length", params.length);
>>>   xhrObject.setRequestHeader("Connection", "close");
>>>   xhrObject.send(params);
>>>
>>>   }
>>> -Original Message-
>>> From: Skip Evans [mailto:s...@bigskypenguin.com]
>>> Sent: Saturday, April 04, 2009 5:30 PM
>>> To: php-general@lists.php.net
>>> Subject: AJAX with POST
>>> Hey all,
>>> At the risk of being told this is a PHP and not a JS list, but
>>> also knowing the discussions on this list, to the benefit of
>>> all I believe, very wildly, I'm posting this JS code snippet
>>> for some advice.
>>> As I posted earlier, my AJAX app that uses a GET to post to
>>> the server (and get a response), fails on IE with larger data,
>>> so I thought I'd take a shot at writing a POST function, but
>>> so far I can get it to get the data back, but the problem is
>>> by the time the data has come back the function has already
>>> returned null back to the calling function. What I need this
>>> function to do is wait for the data to come back and then send
>>> it back to caller. Here's the function. Any advice would be
>>> greatly appreciated. (The code to get the appropriate object
>>> per browser has been omitted.)
>>> http.open("POST", url, true);
>>> //Send the proper header information along with the request
>>> http.setRequestHeader("Content-type",
>>> "application/x-www-form-urlencoded");
>>> http.setRequestHeader("Content-length", url.length);
>>> http.setRequestHeader("Connection", "close");
>>> http.send(url);
>>> http

Re: [PHP] SQL Injection - Solution

2009-05-06 Thread Bruno Fajardo
Hi there!

2009/5/6 Igor Escobar 
>
> Hi folks,
> Someone know how i can improve this function to protect my envairounment
> vars of sql injection attacks.
>
> that is the function i use to do this, but, some people think is not enough:
>
>  * @uses $_REQUEST= _antiSqlInjection($_REQUEST);
>  * @uses $_POST = _antiSqlInjection($_POST);
>  * @uses $_GET = _antiSqlInjection($_GET);
>  *
>  * @author Igor Escobar
>  * @email blog [at] igorescobar [dot] com
>  *
>  */
>
> function _antiSqlInjection($Target){
>        $sanitizeRules =
> array('OR','FROM,'SELECT','INSERT','DELETE','WHERE','DROP TABLE','SHOW
> TABLES','*','--','=');
>        foreach($Target as $key => $value):
>                if(is_array($value)): $arraSanitized[$key] = 
> _antiSqlInjection($value);
>                else:
>                        $arraSanitized[$key] =
> addslashes(strip_tags(trim(str_replace($sanitizeRules,"",$value;
>                endif;
>        endforeach;
>        return $arraSanitized;
>
>
> }
>
> You can help me to improve them?

What if someone posts, in any form of your app, a message containing
"or", "from" or "where"? Those are very common words, and eliminate
them is not the best solution, IMO.
Use mysql_real_escape_string() like Shawn said, possibly something
like this would do the trick (from
http://br2.php.net/manual/en/function.mysql-query.php):

$query = sprintf("SELECT firstname, lastname, address, age FROM
friends WHERE firstname='%s' AND lastname='%s'",
mysql_real_escape_string($firstname),
mysql_real_escape_string($lastname));

Cheers,
Bruno.

>
>
>
> Regards,
> Igor Escobar
> Systems Analyst & Interface Designer
>
> --
>
> Personal Blog
> ~ blog.igorescobar.com
> Online Portifolio
> ~ www.igorescobar.com
> Twitter
> ~ @igorescobar

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



Re: [PHP] Re: SQL Injection - Solution

2009-05-06 Thread Bruno Fajardo
2009/5/6 Igor Escobar :
> hun...by the way I forgot to mention, I am Brazilian and here in Brazil
> these words are not common ...

Igor,

I'm brazilian too, but that is not the point. Deny the use of *any*
word as input in your app is unnecessary. The problem that you're
trying to solve, has been solved a long time ago.

Bruno.

>
> That is a recursive function and i can use array_map becouse i some cases we
> obtain arrays of arrays and that will generate a error.
>
>
> Regards,
> Igor Escobar
> Systems Analyst & Interface Designer
>
> --
>
> Personal Blog
> ~ blog.igorescobar.com
> Online Portifolio
> ~ www.igorescobar.com
> Twitter
> ~ @igorescobar
>
>
>
>
>
> On Wed, May 6, 2009 at 2:36 PM, Shawn McKenzie  wrote:
>
>> Igor Escobar wrote:
>> > Hunnn...
>> >
>> > So, what do you think now?
>> >
>> > function _antiSqlInjection($Target){
>> >     $sanitizeRules =
>> > array('OR','FROM','SELECT','INSERT','DELETE','WHERE','DROP
>> > TABLE','SHOW TABLES','*','--','=');
>> >     foreach($Target as $key => $value):
>> >         if(is_array($value)): $arraSanitized[$key] =
>> > _antiSqlInjection($value);
>> >         else:
>> >             $arraSanitized[$key] = (!get_magic_quotes_gpc()) ?
>> > addslashes(str_ireplace(trim($sanitizeRules,"",$value))) :
>> > str_ireplace(trim($sanitizeRules,"",$value));
>> >         endif;
>> >     endforeach;
>> >     return $arraSanitized;
>> > }
>> >
>> Stay on list please.  I don't like the ternary or the brace omissions
>> (alternate syntax) :-) however
>>
>> My point was that in my opinion you don't need the replace at all.
>> Also, do you really want to strip all 'or', * and = from all fields?
>> These may be perfectly valid in your app.  Or is a very, very common
>> word, so is from and come to think of it, where, select, insert and delete.
>>
>> For any of the SQL injections to work in your query, there will need to
>> be quotes or the backtick ` in the user supplied content.  The quotes
>> are escaped by mysql_real_escape_string().
>>
>> I don't see any way for a SQL injection without the user input
>> containing quotes or the backtick to break out of your query or
>> prematurely terminate an expression.  Some examples here, however they
>> don't mention the backtick:
>> http://us2.php.net/manual/en/security.database.sql-injection.php
>>
>> This might be more useful:
>>
>> ||function _antiSqlInjection($Target)
>> {
>>    if(is_array($Target)) {
>>        $Value = array_map('_antiSqlInjection', $Target);
>>    } else {
>>         if(get_magic_quotes_gpc()) {
>>             $Target = stripslashes($Target);
>>        }
>>         // replace backtick with single quote or whatever
>>        $Target = str_replace("`", "'", $Target);
>>        $Value = mysql_real_escape_string($Target);
>>    }
>>    return $Value;
>> }
>>
>> Thanks!
>> -Shawn
>>
>>
>>
>

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



Re: [PHP] Variables not initialized. Is it possible to...

2009-05-18 Thread Bruno Fajardo
This kind of tip is raised in form of notices. So, to enable that, use the
following function on top of your scripts:

error_reporting(E_ALL | E_NOTICE);

Best regards,
Bruno.

2009/5/18 Paul M Foster 

> On Mon, May 18, 2009 at 05:38:37PM +0200, Cesco wrote:
>
> > Is it possible to set a parameter in PHP 5 to ask the interpreter to
> > raise an error every time I try to use a variable that wasn't
> > initialized before ?
> >
> > For example, I've write this piece of code in Python:
> >
> >
> > print(DonaldDuck)
> >
> >
> >  I get this error:
> >
> > Traceback (most recent call last):
> >   File "/Users/Cesco/Desktop/prova.py", line 3, in 
> > print(DonaldDuck);
> > NameError: name 'DonaldDuck' is not defined
> >
> >
> > Until now I've seen that when I write this PHP equivalent:
> >
> >
> > echo($DonaldDuck);
> >
> >
> > When I try to run it, the PHP writes a blank string, because the
> > variable is not yet initialized and PHP assumes that its value is an
> > empty string (I guess)
> >
> >
> > I'd like to have the same behaviour of Python in PHP, do you think
> > that it is possible?
>
> Set your error reporting higher:
>
> error_reporting(E_ALL);
>
> at the top of your script.
>
> Paul
> --
> Paul M. Foster
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


Re: [PHP] MYSQL 5 auto increment not working

2009-05-21 Thread Bruno Fajardo
2009/5/21 Leidago !Noabeb 

> Hi All
>
>
> I know this is not strictly a PHP question, but i have a problem whenever i
> insert a record using PHP. Basically the auto increment field does not work
> at all. Here's the structure of the table that i'm using:
>
> CREATE TABLE `children` (
>  `cid` int(4) NOT NULL auto_increment,
>  `cname` char(50) default NULL,
>  `csname` char(50) default NULL,
>  PRIMARY KEY  (`cid`)
> ) ENGINE=InnoDB
>
> I use PHP 5.1 and MYSQL 5
>
> I'm pretty sure the code i use to insert the data is sound since i've
> tested
> it with older versions of MYSQL.
>
> Has anyone else had similar problems?


Did you left empty the field `cid` (PK) in your INSERT statement?


Re: [PHP] Best Encryption Algorithm

2009-06-03 Thread Bruno Fajardo
Hi there!

Try out AES.
http://en.wikipedia.org/wiki/Advanced_Encryption_Standard

Bruno.

2009/6/3 Hemant Patel 
>
> Hello Everyone,
>                      Hope you all are doing great.
>                      Now we are creating a application which has high level
> of security so its obvious that we will require a algorithm for
> encryption/decrytpion.So Can anybody suggest me the best algorithm for
> encryption(irrespective of any languageJust a Algorithm).
>
>
> With Regards,
> Hemant Patel

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



[PHP] Dual PHP installation and session sharing

2009-07-17 Thread Bruno Fajardo
Hi all,

I'm using Apache/2.2.3 (Linux/SUSE), running PHP 4.4.7 in CGI mode, in a
dual installation with PHP 5.1.2 running as an Apache module.
Scripts with .php5 extension are executed by PHP 5, and those with .php are
executed by PHP 4, and everything runs as expected.
My question is: is it possible to share session data between .php and .php5
scripts in this environment? All my tests failed.

Thanks in advance!


Re: [PHP] Dual PHP installation and session sharing

2009-07-20 Thread Bruno Fajardo
Hi, Zareef.

I have not tried storing session in a database, and I think it's not
an option in my case, since I'm working on a legacy software that uses
distributed databases across several servers.

Actually, I guess it would be easier to setup a new webserver, running
PHP 5 only, and discontinue the current one. But if there's a chance
to share session in the actual environment, I would certainly prefer
that.

Thanks for the reply!

2009/7/19 Zareef Ahmed 
>
>
> On Sat, Jul 18, 2009 at 1:34 AM, Bruno Fajardo  wrote:
>>
>> Hi all,
>>
>> I'm using Apache/2.2.3 (Linux/SUSE), running PHP 4.4.7 in CGI mode, in a
>> dual installation with PHP 5.1.2 running as an Apache module.
>> Scripts with .php5 extension are executed by PHP 5, and those with .php are
>> executed by PHP 4, and everything runs as expected.
>> My question is: is it possible to share session data between .php and .php5
>> scripts in this environment? All my tests failed.
>
> have you tried using database as session storage and setting session id 
> manually in your application.
>>
>>
>> Thanks in advance!
>
>
>
> --
> Zareef Ahmed :: A PHP Developer in India ( Delhi )
> Homepage :: http://www.zareef.net

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



Re: [PHP] SVG and PHP

2010-01-05 Thread Bruno Fajardo
2010/1/5 Alice Wei 

>
> Hi,
>
>  Just went online and saw an SVG generated from Python, and wanted to do
> the similar thing by loading the SVG into an PHP script. Here is the script
> that I have:
>
> 
> #Load the Map
> $ourFileName= "USA_Counties_with_FIPS_and_names.svg";
> $fh = fopen($ourFileName, "r") or die("Can't open file");
> fclose($fh);
>
> ?>
>
> The problem is that my screen appears as blank even though I could open up
> USA_Counties_with_FIPS_and_names.svg and see the entire US Map. Does anyone
> know what I might have done wrong here?
>

Aren't you just opening the file? I think that you need to print it in some
way suitable to your application.
Try using fread() or other function to read the contents of the file.


>
> Thanks in advance.
>
> Alice
>
> _
> Hotmail: Trusted email with Microsoft’s powerful SPAM protection.
> http://clk.atdmt.com/GBL/go/177141664/direct/01/


Re: [PHP] header("Location:...") fails

2010-01-13 Thread Bruno Fajardo
2010/1/13 Richard S. Crawford 
>
> Here is a snippet of code that is going to be the death of me:
>
> 
> //  Create a new project
> $projectcode = strtoupper(addslashes($_POST['projectcode']));   //  project
> code
>
> //  Make sure the project code is unique
> if (!$existingproject = mysql_query("select * from pb_versions where
> projectcode like '".strtoupper($projectcode)."'")) {
>    die ("Could not check for existing project code!".mysql_error());
> }
>
> $numprojects = mysql_num_rows($existingproject);
>
> if ($numprojects > 0) {
>    $pid = mysql_result($existingproject,0,"versionID");
>    header("Location:managebudget.php?e=1&pid=$pid");
> }
> 
>
> Now, even if $numprojects is 1, 2, 3, etc., the header() command is not
> executed. Strangely, a header("Location") command later on in the script
> *is* executed. I've output the value of $numprojects, so I know that it's
> greater than 0, so the command
> header("Location:managebudget.php?e=1&pid=$pid"); *should* be executed...
> but it isn't. (Weirdly, if I put a die() command *after* this header()
> command, it works... but it seems pathologically inelegant to do so.)

There's nothing in wrong in putting a die command after the
header("Location"). In fact, it is common. The header() command by
itself don't imply in the send of the request. You can have many
header() commands in sequence, and the header will be sent only in the
end of the process.

Cheers,
Bruno.

>
> Obviously, I'm missing something incredibly basic. Can anyone help me figure
> this out?
>
>
> --
> Richard S. Crawford (rscrawf...@mossroot.com)
> http://www.mossroot.com
> Publisher and Editor in Chief, Daikaijuzine (http://www.daikaijuzine.com)

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



Re: [PHP] What's the best way to extract HTML out of $var?

2010-01-15 Thread Bruno Fajardo
2010/1/15 alexus :
> What's the best way to extract HTML out of $var?
>
> example of $var
>
> $var = "http://http://stackoverflow.com/"Stack Overflow"
> I want
>
> $var2 = "http://starckoverflow.com/";
> example: preg_match();
>
> what else?

Hi,
If you simply wants to remove all tags from the string, try using the
strip_tags function (http://php.net/strip_tags).

>
> --
> http://alexus.org/
>
> --
> 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] Cookies & sessions

2010-01-19 Thread Bruno Fajardo
2010/1/19  :
> I am trying for the first time to use cookies. The manual contains the 
> statement "Cookies
> are part of the HTTP header, so setcookie() must be called before any output 
> is sent to
> the browser."
>
> When I first started using sessions, I was alarmed to read a very similar 
> statement about
> sessions, but I soon found that if I started my program with the statement
> "session_start();" I could then set up, access, modify or clear any session 
> variable at
> any time in my program. This is enormously useful, as I can put the session 
> handling at
> any convenient point in my program, and can precede them with diagnostics if 
> I need to.
>
> However I have almost immediately found that while I appear to be able to 
> read cookies at
> any time, I cannot set them when I would like to. Is there any similar trick 
> which will
> work with cookies?

The only trick is that you have to call setcookie() before any output
is sent to the browser, just like the session_start() behavior.

> If I really have to work out what they should be, and then set them up,
> before issuing any diagnostics, etc, it will make life decidely more 
> complicated. (I
> assume that I can set several cookies using successive calls to setcookie()?)

Yes, each one with a differente name.

>
> I was also somewhat surprised to find that a cookie is used to implement 
> sessions. Does
> this place any limitations on using both sessions and cookies in the same 
> program?
>

No. The cookie in PHP that implements session is by default called
PHPSESSID. As long as your other cookies are named differently, you
should be fine.

>
> --
> 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] Cookies & sessions

2010-01-20 Thread Bruno Fajardo
2010/1/20  :
> When you are working with sessions, provided you start your program with 
> session_id(), you
> can then do anything you like with session variables at any point in your 
> program.

Hi,

You meant session_start() instead of session_id(), right? But yes,
once you started a session (before any output is sent to the browser,
that includes echo and print statements, empty space chars, etc) you
can do anything you like with the $_SESSION array, being able to read
the stored values in other requests / scripts of your app, as long as
the session is started.

> In my
> original question I asked if there was a cookie equivalent.

As far as I know, yes, there is. You set a cookie using the
setcookie() function. This function, in the same way as
session_start(), must be called before any output is sent to the
browser. Once a cookie is set in the client, you can read the $_COOKIE
array in any subsequent request of your client, in any point of your
app, just like session.

>
> Someone said there was, but the above is simply demonstrating that their 
> suggested
> solution doesn't work. It appears there is no solution, but that the 
> workaround is to turn
> on output buffering, at least until you finish setting cookies, so that you 
> can be certain
> that no output is generated before this point.

You don't need to use output buffering at all. You only need this
mechanism if your script needs to output stuff before the
session_start() or setcookie() functions get executed.

Well, I hope this information is helpful.

Cheers,
Bruno.

>
> --
> 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 to get the 'return type' of a function?

2010-02-23 Thread Bruno Fajardo
2010/2/23 Daniel Egeberg 
>
> 2010/2/23 Dasn :
> > Hello guys, I try to use 'ReflectionFunction' to retrieve the info of a
> > function.
> > For example:
> >  >
> > $rf = new ReflectionFunction('strstr');
> > echo $rf;
> > ?>
> > === output ==
> >
> > Function [  function strstr ] {
> >
> >  - Parameters [3] {
> >    Parameter #0 [  $haystack ]
> >    Parameter #1 [  $needle ]
> >    Parameter #2 [  $part ]
> >  }
> > }
> >
> > The problem is there's no 'return type' (i.e. 'string' in this example)
> > info about the function.
> >
> > Could you tell me how to retrieve the 'return type'?
> > Thanks.
> >
> >
> > --
> > Dasn
>
> That's not possible. Consider this function:
>
> function foo()
> {
>        switch (rand(0, 1)) {
>                case 0: return 42;
>                case 1: return 'bar';
>        }
> }
>
> What should the return type be?

Mixed? 
http://www.php.net/manual/en/language.pseudo-types.php#language.types.mixed

>
> --
> Daniel Egeberg
>
> --
> 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] Execution order of PHP

2010-03-10 Thread Bruno Fajardo
2010/3/10 Auke van Slooten 
>
> Hi,
>
> In a hobby project I'm relying on the order in which the following piece of 
> PHP code is executed:
>
> $client->system->multiCall(
>  $client->methodOne(),
>  $client->methodTwo()
> );
>
> Currently PHP always resolves $client->system (and executes the __get on 
> $client) before resolving the arguments to the multiCall() method call.

Hi!

Can't you call the methods $client->methodOne() and
$client->methodTwo() before the call to $client->system->multiCall()?
That way, you could store they values in local variables, and then
pass them to the $client->system->multiCall(), assuring that those
methods are executed before the multiCall(). Something like:

$methodOne = $client->methodOne();
$methodTwo = $client->methodTwo();
$client->system->multiCall($methodOne, $methodTwo);

Cheers,
Bruno.

>
> Is this order something that is specified by PHP and so can be relied upon to 
> stay the same in the future or is it just how it currently works.
>
> If it cannot be relied upon to stay this way, I will have to rewrite the 
> multiCall method and API...
>
> regards,
> Auke van Slooten
> Muze
>
> --
> 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] Execution order of PHP

2010-03-10 Thread Bruno Fajardo
2010/3/10 Auke van Slooten :
> Bruno Fajardo wrote:
>>
>> 2010/3/10 Auke van Slooten 
>>>
>>> Hi,
>>>
>>> In a hobby project I'm relying on the order in which the following piece
>>> of PHP code is executed:
>>>
>>> $client->system->multiCall(
>>>  $client->methodOne(),
>>>  $client->methodTwo()
>>> );
>>
>> Can't you call the methods $client->methodOne() and
>> $client->methodTwo() before the call to $client->system->multiCall()?
>> That way, you could store they values in local variables, and then
>> pass them to the $client->system->multiCall(), assuring that those
>> methods are executed before the multiCall(). Something like:
>>
>> $methodOne = $client->methodOne();
>> $methodTwo = $client->methodTwo();
>> $client->system->multiCall($methodOne, $methodTwo);
>
> Hi,
>
> This is not what I meant. I should perhaps mention that it's an xml-rpc
> client and the method calls are remote method calls. The multiCall method
> gathers multiple method calls into a single request.
>
> The trick I'm using now is to set a private property in the $client->__get()
> method when the property you're accessing is 'system'. From then untill you
> call the method 'multiCall', instead of calling the methods (in this case
> methodOne and methodTwo) the client creates a new object with the call
> information (method name and arguments) and returns that. In multiCall all
> arguments are therefor call information objects and multicall creates a
> single request based on that information.

Hmm, you cleared that to me now... If you need to first create the
property "system" and then call a method in that object "system",
can't you do something like:

$client->system = null;
$client->system->multiCall(
$client->methodOne(),
$client->methodTwo()
);

I'm not testing these snippets of code, so sorry if I'm getting something wrong.

Cheers,
Bruno.

>
> So in your example the client would simply call methodOne and methodTwo and
> return the results. Then it would try to do a multiCall with whatever the
> previous methods have returned.
>
> regards,
> Auke van Slooten
> Muze
>

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



Re: [PHP] Execution order of PHP

2010-03-10 Thread Bruno Fajardo
2010/3/10 Andrew Ballard :
> On Wed, Mar 10, 2010 at 9:54 AM, Bruno Fajardo  wrote:
> [snip]
>> 2010/3/10 Auke van Slooten :
>>> This is not what I meant. I should perhaps mention that it's an xml-rpc
>>> client and the method calls are remote method calls. The multiCall method
>>> gathers multiple method calls into a single request.
>>>
>>> The trick I'm using now is to set a private property in the $client->__get()
>>> method when the property you're accessing is 'system'. From then untill you
>>> call the method 'multiCall', instead of calling the methods (in this case
>>> methodOne and methodTwo) the client creates a new object with the call
>>> information (method name and arguments) and returns that. In multiCall all
>>> arguments are therefor call information objects and multicall creates a
>>> single request based on that information.
>>
>> Hmm, you cleared that to me now... If you need to first create the
>> property "system" and then call a method in that object "system",
>> can't you do something like:
>>
>> $client->system = null;
>> $client->system->multiCall(
>>    $client->methodOne(),
>>    $client->methodTwo()
>> );
>>
>> I'm not testing these snippets of code, so sorry if I'm getting something 
>> wrong.
>>
>> Cheers,
>> Bruno.
>>
> [snip]
>
> I'm not sure you would want to assign null to $client->system. After
> all, __set() might not be defined.

Yes, you're right, Andrew. Setting the property to null is not the
best choice in this case.

>
> I agree with Rob here. If order is really crucial, then call the
> statements in the correct order:
>
> 
> /**
>  * causes $client to call __get() in order to resolve
>  * 'system'
>  */
> $system = $client->system;
>

This was my point too, to create the object before the call to
multiCall(), I just messed my example with the null assignment... :-)
The code you suggested must solve the OP issue.

Cheers,
Bruno.

>
> /**
>  * You should add some handling here to make sure that
>  * $system is really an object that implements your
>  * multiCall() method, and not something else (like null).
>  */
>
>
> $system->multiCall(
>    $client->methodOne(),
>    $client->methodTwo()
> );
>
> ?>
>
>
>
> Andrew
>

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



Re: [PHP] PHP MySQL Insert Statements

2010-03-11 Thread Bruno Fajardo
2010/3/11 Martine Osias :
> Hi,
>
> My insert statements on this web page don't execute. The select statements
> do work. This tells me that the database connection is working. The username
> and password are the administrator's. What else could prevent the insert
> statements from executing?

Would you mind giving us some hints about how the INSERT statements looks like?

Thanks.

>
> Thank you.
>
>
> Martine
>
> --
> 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] Greate day for you,

2010-04-07 Thread Bruno Fajardo
2010/4/7 Nilesh Govindarajan :
> On 04/07/10 21:41, Chris G wrote:
>>
>> http://sites.google.com/site/vfgbyuhoi6/kewe2w
>>
>
> Bloody asshole spammer.
> Is there no spam filter at lists.php.net ?

It was probably a virus or a trojahn, not intentionally sent to the
list by the OP...

>
> --
> Nilesh Govindarajan
> Site & Server Administrator
> www.itech7.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] Updating to 5.3.6

2011-06-20 Thread Bruno Coelho

I realize this is a basic matter, but I've installed PHP 5.3.1 with XAMPP for 
Mac OS. 
How can I update my PHP version now? 


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



Re: [PHP] Updating to 5.3.6

2011-06-20 Thread Bruno Coelho

I've installed through XAMPP. The latest version of XAMPP still has PHP 5.3.1


A 2011/06/20, às 18:50, Sean Greenslade escreveu:

> How did you install it? Why can't you just uninstall it and reinstall with 
> the new version?
> 
> On Jun 20, 2011 12:52 PM, "Bruno Coelho"  wrote:
> > 
> > I realize this is a basic matter, but I've installed PHP 5.3.1 with XAMPP 
> > for Mac OS. 
> > How can I update my PHP version now? 
> > 
> > 
> > Thanks. 
> > -- 
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> > 



[PHP] Users logins in Linux machine

2005-02-12 Thread Bruno Santos
Hello all.
I've a linux server that runs a mailserver for several users. I want to 
build a page where users can change their email password, that's their 
accounts password.

how can i with PHP manage to compare the password they type in a web 
form with the one they have in the system ?? (/etc/passwd) ??

can it be with LDAP ? or PAM ? or any other method ?
cheers !
Bruno Santos
--
Say no to software patents
www.nosoftwarepatents.com/
--
[EMAIL PROTECTED]
--
Divisao de Informatica
[EMAIL PROTECTED]
Tel: +351 272 000 155
Fax: +351 272 000 257
--
Hospital Amato Lusitano
[EMAIL PROTECTED]
Tel: +351 272 000 272
Fax: +351 272 000 257
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] memory error

2005-02-17 Thread Bruno Santos
Hello. I've developed a script to use in shell to resize several images, 
but, when i try to run it, i keep receiving this error:

Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to 
allocate 2048 bytes)

how can i solve it ?
PHP: 5.0.3
php.ini settings:
max_execution_time = 300
max_input_time = 60
memory_limit = 8M
by the way, is there any function that allows me to flush the memory ??
cheers
Bruno Santos
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] cannot remove cookies

2005-02-22 Thread Bruno Santos
Hello.
I'm using 2 cookies to control some user environmente.
every time the user logs in, the cookie is set, but when i try to change 
the value of that cookie,
deleting it firts and then setting a new one with another value, when i 
print the value of that cookie
the value is never the new one, but always the firts.

im setting the cookie with:
setcookie ("cookie_name",cookie_value,time()+time-to-expiration);
when deleting it, i do
setcookie ("cookie_name");
or
setcookie ("cookie_name","",time()-time-to-expiration);
but it never works
the browser im testing it is firefox (linux)
but in IE is not working either...
PHP version is PHP-5.0.3
Apache version is Apache-2.0.52
Cheers
Bruno Santos
--
Say no to software patents
www.nosoftwarepatents.com/
--
[EMAIL PROTECTED]
--
Divisao de Informatica
[EMAIL PROTECTED]
Tel: +351 272 000 155
Fax: +351 272 000 257
--
Hospital Amato Lusitano
[EMAIL PROTECTED]
Tel: +351 272 000 272
Fax: +351 272 000 257
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] URL encode

2005-02-23 Thread Bruno Santos
Hello.
Im having some trouble when getting a query from a $_GET method
the problem is, when using $_GET, i get some charaters decoded as html 
entities.

if i submit the word %sara% (example), is ok
but, if i submi the word %carlos%, i get Êrlos, witch is the translation 
of html entity %ca

how can i can resolve it ??
ive tryed with htmlentities, urlencode, urldecode, etc...
help ?
cheers
Bruno Santos
--
Say no to software patents
www.nosoftwarepatents.com/
--
[EMAIL PROTECTED]
--
Divisao de Informatica
[EMAIL PROTECTED]
Tel: +351 272 000 155
Fax: +351 272 000 257
--
Hospital Amato Lusitano
[EMAIL PROTECTED]
Tel: +351 272 000 272
Fax: +351 272 000 257
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Communication protocol of PHP and Mysql

2005-02-25 Thread Bruno Santos
Hello all.
Im developing an application as my final school project and for the 
report (administration manual) i need to specifie the protocol of 
communication between PHP and Mysql when accessing the mysql database 
using the functions within PHP.

PHP communicates with Mysql throw TCP/IP or any other protocol ?
cheers !
--
Say no to software patents
www.nosoftwarepatents.com/
--
[EMAIL PROTECTED]
--
Divisao de Informatica
[EMAIL PROTECTED]
Tel: +351 272 000 155
Fax: +351 272 000 257
--
Hospital Amato Lusitano
[EMAIL PROTECTED]
Tel: +351 272 000 272
Fax: +351 272 000 257
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] PHP and Access

2005-02-25 Thread Bruno Santos
Hello.
I need to to an application in PHP with graphics creation.
The database where i need to go and fetch the values is access.
is possible for PHP to fecth values from an access database ??
cheers
Bruno Santos
--
Say no to software patents
www.nosoftwarepatents.com/
--
[EMAIL PROTECTED]
--
Divisao de Informatica
[EMAIL PROTECTED]
Tel: +351 272 000 155
Fax: +351 272 000 257
--
Hospital Amato Lusitano
[EMAIL PROTECTED]
Tel: +351 272 000 272
Fax: +351 272 000 257
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: PHP and Access

2005-02-26 Thread Bruno Santos
pete M wrote:
Check this out
http://adodb.sourceforge.net/
http://phplens.com/adodb/code.initialization.html#init
have fun
Pete
Bruno Santos wrote:
Hello.
I need to to an application in PHP with graphics creation.
The database where i need to go and fetch the values is access.
is possible for PHP to fecth values from an access database ??
cheers
Bruno Santos

Hello all. Thanks for all the answeres but i have a small problem.
Im using Linux, not windows... Ive heard about unixODBC, can i used it
to connect to a access database ??
cheers
--
[EMAIL PROTECTED]
www.feiticeir0.no-ip.org
--
[EMAIL PROTECTED]
www.hal.min-saude.pt
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] line feed

2005-03-04 Thread Bruno Santos
Hello.
How do i print a line return using the echo command, for when i see the 
page source,
i get the code line by line and not all in the same line.

using double quotes ( " ), i can put \n at the end and i get the result 
i want,
but, using sinle quotes ( ' ), \n doesnt work.

if i use double quotes, in a simple html comand i need to use \"  and i 
dont want that.

is any way i could use single quotes, and getting the line feed ??
example:
Double quotes:
   echo "\n";
single quotes:
   echo '';
cheers
Bruno Santos
--
Say no to software patents
www.nosoftwarepatents.com/
--
[EMAIL PROTECTED]
--
Divisao de Informatica
[EMAIL PROTECTED]
Tel: +351 272 000 155
Fax: +351 272 000 257
--
Hospital Amato Lusitano
[EMAIL PROTECTED]
Tel: +351 272 000 272
Fax: +351 272 000 257
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] php and CSS

2004-06-14 Thread Bruno Santos
Hello all.

Im deleloping some PHP pages for school work, and now, im trying to put 
the pages nice, with some colors and images, etc...

I found a problem regarding CSS and PHP
The same page, with html extension, it works fine, but when the page 
becames with php extension, the CSS just dont work..

Someone has any idea why this is happening ??
Cheers
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] php and CSS

2004-06-14 Thread Bruno Santos
Robert Sossomon wrote:
Bruno,
Drop some code our way, it's just a guessing game for me without it.
Robert
-Original Message-
From: Bruno Santos [mailto:[EMAIL PROTECTED] 
Sent: Monday, June 14, 2004 3:28 PM
To: [EMAIL PROTECTED]
Subject: [PHP] php and CSS

Hello all.

Im deleloping some PHP pages for school work, and now, im trying to put 
the pages nice, with some colors and images, etc...

I found a problem regarding CSS and PHP
The same page, with html extension, it works fine, but when the page 
becames with php extension, the CSS just dont work..

Someone has any idea why this is happening ??
Cheers
Well, here is it:


Ajuda




	if (isset ($_GET['idhlp'])) {
		//abrir o ficheiro
		$fileName = HELP.'/'.$_GET['idhlp'].'.txt';
	
		$fp = fopen ($fileName,'r'); //abrir ficheiro de ajuda
		
		/*
		$contents = fread ($fp, filesize ($fileName));
		fclose ($fp); */
	
		//por questoes de seguranca, vamos retirar as tags html do ficheiro
		//$contents = strip_tags ($contents);
		//imprimir o html
			
		$titulo = fgets ($fp,1024);
		echo '';
		echo '';
			echo ''.$titulo.'';
		echo '';
		echo '';
		while (!feof($fp)) {
			$buffer = fgets ($fp,1024);
			echo $buffer;
		}
		echo '';
		echo '';
		echo '';
	}
	else {
	Header("Location: index.php");
	}
	echo '';
?>

has some coments in Portuguese, but, the essential is the first lines. 
I've always done this way, and always has work... till now... =:(

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


[PHP] URL

2004-07-21 Thread Bruno Santos
Hello All.
Im developing a couple of pages and i need to do some redirecting to 
another page depending
on the choice of a user.
The problem is, to go to another page, i need to send some parameters in 
the URL that are alredy present, but i need to make the redirecting 
independent of the page. 
if i use $_SERVER['PHP_SELF'], i have only http://some_domain/the_page
and what i want is 
http://some_domain/the_page?some_parameters=value&another_parameter=value
the ?some_parameters=value are alredy present and i need to redirect 
them again...

I know that are some fuctions to manage this, or not...
any solucion ??
thx in advance !
Bruno Santos
--
[EMAIL PROTECTED]
--
Divisao de Informatica
[EMAIL PROTECTED]
Tel: +351 272 000 155
Fax: +351 272 000 257
--
Hospital Amato Lusitano
Av. Pedro Alvares Cabral
6000-085 Castelo Branco
[EMAIL PROTECTED]
Tel: +351 272 000 272
Fax: +351 272 000 257
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] URL

2004-07-21 Thread Bruno Santos
Thx Robert.
How could i  miss that !! =:)
by the way, is any function in PHP that i can use to capture the current 
URL 

thx
 Original Message 
Subject:RE: [PHP] URL
Date:   Wed, 21 Jul 2004 11:12:33 -0400
From:   Robert Sossomon <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>


-Original Message-
From: Bruno Santos [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, July 21, 2004 11:05 AM
To: [EMAIL PROTECTED]
Subject: [PHP] URL

Hello All.
Im developing a couple of pages and i need to do some redirecting to 
another page depending on the choice of a user.


Since you are getting the information from the page anyways, just simply
do:
$_SERVER[PHP_SELF]?parameter1=$_GET[parameter1]¶meter2=$_GET[paramet
er2]¶meter3=$_GET[parameter3] etc...
HTH,
Robert
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--
[EMAIL PROTECTED]
--
Divisao de Informatica
[EMAIL PROTECTED]
Tel: +351 272 000 155
Fax: +351 272 000 257
--
Hospital Amato Lusitano
Av. Pedro Alvares Cabral
6000-085 Castelo Branco
[EMAIL PROTECTED]
Tel: +351 272 000 272
Fax: +351 272 000 257
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] parse error, unexpected $

2004-02-10 Thread Bruno Mattarollo
Hello,

I am having a strange problem with PHP and I can't really find a proper 
answer, maybe someone have seen this before and can give me a hint.

I have a series of files (originally developed by another colleague) 
installed on a server with PHP 4.2.2 and I get this error:

Parse error: parse error, unexpected $ in 
/var/www/html/donation/installations/gpi/form.inc on line 528

Line 528 is actually the last line on that file, it's an empty line. 
Tried removing, adding spaces, and the number of lines change, always 
pointing to the last line. Checking online, I get similar comments from 
people when braces are unbalanced, i.e. a "while" loop that doesn't 
have a closing "}". I have checked this file with Zend Studio for 
correctness and there is no problem, checked every block, all closed. 
Checked all the included files as well ...

The strange thing as well is that this runs on my laptop, running PHP 
4.3.4 and doesn't return any errors. Has anyone seen this? Where can I 
find the differences in syntax between these two PHP versions, maybe 
that's the cause...? I also looked at the possibility that it's the 
"short_open_tag" in the configuration file but it seems like the option 
is properly set in the httpd.conf file on pluto.greenpeace.com ... I am 
a bit lost now, any suggestions?

/B

--
Bruno Mattarollo <[EMAIL PROTECTED]>
Head of IT - Greenpeace International
[ http://www.greenpeace.org/ ]


PGP.sig
Description: This is a digitally signed message part


Re: [PHP] parse error, unexpected $

2004-02-11 Thread Bruno Mattarollo
Hello Raditha and all,

Thanks for the replies ... I reviewed all my code with Zend Studio and 
the syntax was correct everywhere ... so I tried running the 
application from the command line:

$ php donate.php

and it worked fine, so looking through the code we saw that there was a 
"short-tag" in one place and that was the problem since the 
"short-tags" is off on the server (Apache) as we also process 
(read/write/etc) XML files ...

Anyways, thanks for the replies :)

/B

On Feb 10, 2004, at 16:38, Raditha Dissanayake wrote:

The line number is misleading the error is generally above the line 
that's reffered to. try commenting out sections of the code. If you 
have an IDE it will be able to point out the error. If you don't have 
an IDE some text editor that is capable of syntax highlighting will 
also help.

--
Bruno Mattarollo <[EMAIL PROTECTED]>
Head of IT - Greenpeace International
[ http://www.greenpeace.org/ ]


PGP.sig
Description: This is a digitally signed message part


[PHP] $_FILE

2004-03-16 Thread Bruno Santos
Hello.

   I've read in a book that we can access several file properties (when 
uploading a file) in two ways:

1st with the array $_FILE
2nd with $HTTP_POST_FILES
i've used the 1st, but my program give many erros, and when using the 
2nd, everything was fine.

the 1st is avaiable from PHP 4.1.0, and im using PHP 4.3.4.
Can someone tell me why does not work ???
cheers

--
-
   .-'''''-.
.' `.
   : :
  :   :
  :  _/|  :   Bruno Santos
   :   =/_/  : [EMAIL PROTECTED]
`._/ | .'
 (   /  ,|...-'Pagina Pessoal
  \_/^\/||__   http://feiticeir0.no-ip.org
   _/~  `""~`"` \_
__/  -'/  `-._ `\_\__
  /jgs  /-'`  `\   \  \-.\
  "Written very small on the back poket of a girl's jeans
  - 'If you can read this, you're WAY too close.'"
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] File Upload problems

2004-03-16 Thread Bruno Santos
Can someone tell me why this is happening ?

i've tryed everything, since changing file, directory permissions, 
owner, etc 

i upload a file and, i give this erros

someone has any ideia ???

File Type: text/plain

*Warning*: move_uploaded_file(teste.txt): failed to open stream: 
Permission denied in 
*/usr/local/apache2/htdocs/projecto/examples/upload.php* on line *51*

*Warning*: move_uploaded_file(): Unable to move '/tmp/phpXBWdts' to 
'teste.txt' in */usr/local/apache2/htdocs/projecto/examples/upload.php* 
on line *51*
Could not move file to destination directory

Cheers,

Bruno Santos

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


Re: [PHP] creating a confirm page

2004-03-21 Thread Bruno Santos
Andy B wrote:

hi

was needing to know how to create a confirm page.
I have a form that needs to be submitted to a confirm page before it is dropped into a 
mysql db. was not sure how to do this without losing the content of the form 
variables...
 

Hi. Well, you have several solutions for that.

or u use sessions and u register every single variable as a session 
variable ( $_SESSION['variable'] ), or using forms, from one page to another
and pass the contents, then, recover every one with 
$_POST['variable_name'] or $_GET['variable_name'], depending on wich 
method u've used.

cheers...
there are several other ways: in the same page, using functions and 
conditional statements, etc
remember: best way is how its above (using sessions or forms) , because 
will work in most php installations that dont have register_globals on.

--
-
   .-'''''-.
.' `.
   : :
  :   :
  :  _/|  :   Bruno Santos
   :   =/_/  : [EMAIL PROTECTED]
`._/ | .'
 (   /  ,|...-'Pagina Pessoal
  \_/^\/||__   http://feiticeir0.no-ip.org
   _/~  `""~`"` \_
__/  -'/  `-._ `\_\__
  /jgs  /-'`  `\   \  \-.\
  "Written very small on the back poket of a girl's jeans
  - 'If you can read this, you're WAY too close.'"
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] imagecreatefromjpeg

2004-03-30 Thread Bruno Santos
Hello all.

Im developing a page, and need to create a thumb of some images.

i've compiled PHP 4.3.5 with the built-in support of GD, even having 
installed the GD library.

the problem is that i call the imagecreatefromjpeg function, and PHP 
returns a fatal error
when in run time

i've even call the phpinfo function to see the php variables, and there 
shows that the support of GD is avaiable

can someone tell me why this is hapening ?

here's the error 


*Fatal error*: Call to undefined function: imagecreatefromjpeg() in 
*/usr/local/apache2/htdocs/projecto/examples/uploadimg.php

regards
*
--
-
   .-'''''-.
.' `.
   : :
  :   :
  :  _/|  :   Bruno Santos
   :   =/_/  : [EMAIL PROTECTED]
`._/ | .'
 (   /  ,|...-'Pagina Pessoal
  \_/^\/||__   http://feiticeir0.no-ip.org
   _/~  `""~`"` \_
__/  -'/  `-._ `\_\__
  /jgs  /-'`  `\   \  \-.\
  "Written very small on the back poket of a girl's jeans
  - 'If you can read this, you're WAY too close.'"
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] file super global and functions

2004-03-31 Thread Bruno Santos
hello all

i've a problem, serious one.

how can i pass the name of a file upload to a function ?

i need to do the upload of 1 file, but want to use a function, so that 
the main file stays small

the problem is, when passing the file name, throw the $_FILES super 
global , is not recognized in the function...

here is the code:

 the function (or part of it)

function uploadfile ($userfile, $name2file,$uploadir) {
//userfile is where file went on webserver
echo 'inside'; <<<  debuging purpose
$userfile = $_FILES['userfile']['tmp_name'];
//userfile_name is original file name
$userfile_name = $_FILES['userfile']['name'];
	echo 'User File name: '.$userfile_name; <<< --- debuging purpose

## main program ##33

uploadfile 
($_FILES['user_picture'],$_SESSION['valid_user'].'_picture',$USERPICS);

this is the call to the function above

the problem is that inside the function, the file name is not recognized...
when i try to print the filename, is empty 
any ideas 

it only works if $_FILSE['user_picture'] is $userfile ..

should i pass the values by reference ?i mean, putting some sort of & ??

cheers and best regars

Bruno
--
-
   .-'''''-.
 .' `.
: :
   :   :
   :  _/|  :   Bruno Santos
:   =/_/  : [EMAIL PROTECTED]
 `._/ | .'
  (   /  ,|...-'Pagina Pessoal
   \_/^\/||__   http://feiticeir0.no-ip.org
_/~  `""~`"` \_
 __/  -'/  `-._ `\_\__
   /jgs  /-'`  `\   \  \-.\
   "Written very small on the back poket of a girl's jeans
   - 'If you can read this, you're WAY too close.'"
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Global $_FILEs

2004-04-02 Thread Bruno Santos
Hello all.

I'm developing a script that requires the user to upload 2 files.

i want to put all the lines that takes care of the uploading of the file 
in a function.

i've tried to pass the global array $_FILES to a function, but still no 
sucess...

can someone help me ??

regards

Bruno

--
-
   .-'''''-.
 .' `.
: :
   :   :
   :  _/|  :   Bruno Santos
:   =/_/  : [EMAIL PROTECTED]
 `._/ | .'
  (   /  ,|...-'Pagina Pessoal
   \_/^\/||__   http://feiticeir0.no-ip.org
_/~  `""~`"` \_
 __/  -'/  `-._ `\_\__
   /jgs  /-'`  `\   \  \-.\
   "Written very small on the back poket of a girl's jeans
   - 'If you can read this, you're WAY too close.'"
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] scripting with php

2004-12-14 Thread Bruno Santos
Hello all.
i'm working with php for about 3 years and i must say: i cant get tired 
of it !! :-)

since my first page, ive used php as a server side language, embebed in 
html pages. now, i need to develop a small script to run as stand alone. 
how can i do it ?

just like bourn shell, ive used #!/usr/bin/php -q, but it apears is not 
working ...

can someone tell me how to i use php stand alone ?
chears !!!
Bruno Santos
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] client information

2005-01-11 Thread Bruno Santos
Hello all.
   I have a problem that i hope to solve with php. i know that, using 
$_SERVER['xxx'] is possible to find some information about the client 
who is accessing the script.
what i need to know if its possible to find out more information about 
the client, like in linux the DISPLAY variable of the client ?
if i make a system call, i get the server information and thats not what 
i want ?
if not with php, is possible to do it with javascript ?

thanx in advance
Bruno Santos
--
Say no to Software patents
www.nosoftwarepatents.com
--
[EMAIL PROTECTED]
--
Divisão de Informática
[EMAIL PROTECTED]
Tel: +272 000 155
Fax: +272 000 257
--
Hospital Amato Lusitano
[EMAIL PROTECTED]
Tel: 272 000 272
Fax: 272 000 257
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] _construct() problem

2005-06-09 Thread Stéphane Bruno
Hello,

I designed a player class with the following properties and constructor:

class player {
  private $properties = array('firstname' => NULL, 'lastname' => NULL);
  function _construct($first, $last) {
$this->properties['firstname'] = $first;
$this->properties['lastname'] = $last;
  }
}

Then I have other methods that allow me to set and get the properties.
However, when I issue a:

$myplayer = new player('Laurent', 'Blanc');

it seems that the constructor is not taken into account: the properties
are not initialized. I have to explicitly initialize them with the
setter methods in order for the initialization to take place.

What did I do wrong?

I am running PHP 5.0.4 with Apache 2.0.54.

Stéphane

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



[PHP] _construct() problem

2005-06-09 Thread Stéphane Bruno
Hello,

I designed a "player" class with the following properties and
constructor:

class player {
  private $properties = array('firstname' => NULL, 'lastname' => NULL);

  function _construct($first, $last) {
$this->properties['firstname'] = $first;
$this->properties['lastname'] = $last;
  }
}

Then I have other methods that allow me to set and get the properties.
However, when I issue a:

$myplayer = new player('Laurent', 'Blanc');

it seems that the constructor is not taken into account: the properties
are not initialized. I have to explicitly initialize them with the
setter methods in order for the initialization to take place.

What did I do wrong?

I am running PHP 5.0.4 with Apache 2.0.54 on Fedora Core 1.

Stéphane

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



Re: [PHP] _construct() problem

2005-06-09 Thread Stéphane Bruno
Thanks, Richard

It now works. It was not obvious in the book I was using. The author
should have put a side note stating it is two underscores instead of
one.

Stéphane

On Thu, 2005-06-09 at 08:42, Richard Davey wrote:
> Hello Stéphane,
> 
> Wednesday, June 8, 2005, 10:23:22 PM, you wrote:
> 
> SB>   function _construct($first, $last) {
> 
> SB> What did I do wrong?
> 
> It's __construct()
> 
> Best regards,
> 
> Richard Davey
> -- 
>  http://www.launchcode.co.uk - PHP Development Services
>  "I do not fear computers. I fear the lack of them." - Isaac Asimov

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



Re: Re[2]: [PHP] PHP vs. ColdFusion

2005-07-01 Thread Stéphane Bruno
Hello,

I followed the discussions closely. I wanted to reply to some questions
I saw in the discussions.

I am using both PHP and Coldfusion, but both on Linux platforms. So, I
am not bound to Microsoft technologies, and CF runs faster on Linux/Unix
than on Windows.

Like PHP, there is no need for a dedicated IDE to code/script on CF. You
may use Macromedia software to build web pages only if you want, except
if you want to make Flash movies/animations.

You can edit files manually to configure CF (XML files) with a ssh
access on the server (at least the Linux version I am used to), or use a
web interface to manage it.

Both languages have pros and cons, and I cannot say that one is superior
to the other. It is a matter of taste. I know that someone coming from a
programming background will be more comfortable with PHP, while someone
coming from a web design background may be more comfortable with CF, but
even that is changing. Once you get to do very advanced things, you need
to code using Object Oriented approaches, modular programming, web
services, etc. which both products allow you to do.

It is true that Coldfusion offers a lot of functionality 'out of the
box', and sometimes you need to look around to find equivalent
functionality, extensions for PHP. These functionalities are more geared
towards displaying data, managing forms, etc. PHP also offers a lot of
functionalities out of the box also. For example, PHP is really flexible
about how you want to retrieve a query, in what format, etc. The
functionalities are more geared towards programming utilities.

You can extend Coldfusion functionalities easily by creating 'custom
tags' in Perl, C, C++ or Java without having to recompile the product.
You can also instantiate any classes in Java because Coldfusion is based
on Java since version 5.

So, it's really a matter of personal taste and the background of each
one. I personally take pleasure developing applications on both
Coldfusion and PHP.

Stéphane

On Fri, 2005-07-01 at 09:50, Richard Davey wrote:
> Hello Andrew,
> 
> Friday, July 1, 2005, 3:06:49 PM, you wrote:
> 
> AS> You know for a php developer your really don't know your own product to
> AS> well (blah blah blah)
> 
> Isn't it time to run off and write another check to Adobe or
> something? Rather than personally attacking other list members.
> 
> Best regards,
> 
> Richard Davey
> -- 
>  http://www.launchcode.co.uk - PHP Development Services
>  "I do not fear computers. I fear the lack of them." - Isaac Asimov

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



Re: [PHP] PHP vs. ColdFusion

2005-07-04 Thread Stéphane Bruno
On Fri, 2005-07-01 at 19:01, Mark Charette wrote:
> It is always funny to read that one needs OO approches to do anything 
> useful. What one needs is a modular approach, re-factoring, and knowing 

I never said that you NEED OO approach to do anything. I found some
problems where an OO approach helped me better than a linear approach,
and the inverse is also true.

My point was that a language that gives you the choice of programming
style is interesting. Both CF and PHP give you the choice to use OOP or
not.

Today, everyone agrees that procedural languages are an evolution from
BASIC-style linear programming.

Also, one can agree that OOP is an evolution from procedural
programming. Now, one can choose to stick with linear programming,
procedural programming or OOP. This is a matter of personal taste,
trade-offs that have a different meaning from one individual to another.

You can achieve modularity with procedural coding. But, you need to do
it yourself, while modularity is at the heart of OOP. You may prefer
linear or procedural coding over OOP, but surely not for modularity.

Stéphane

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



[PHP] Imap, reading the email-body

2005-10-19 Thread Bruno Gola

Hi guys,

I need some help with the imap_body function and how to work with the 
string that this function returns...


Im working on a mailing list archive website and i'm using the imap_* 
functions to handle this, the header works fine (and other things too) 
but the Body of the message dont work as expected. It came as one-line 
string, the "\n" character (or  in html) is simple ignored. I dont 
know how to make the function translate the "\n" to .



You can understand better what i'm saying looking:

http://www.brunogola.com.br/testeimap.php

Look the main page and try to read any message... I dont know what can i 
do to fix it...


Thanks for any help and sorry any mistakes about my english...

Bruno Gola

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



[PHP] Help!! IP functions!!!

2001-02-19 Thread Bruno Freire

Hi!! 

My name is Bruno, From Brazil!!!

I need to know how can i discovery the ip address when somebody access my
home page

What function can I use

Thanks!!
Bruno.



[PHP] MyODBC and Crystal Reports

2001-02-20 Thread Bruno Freire

Hi, everybody!

It's me again Bruno, from Brazil.

Now i'm having some problems with MyODBC and Crystal.
 I have an ODBC named MyCOMERCIAL. 
I did make a report in the Crystal linked at this ODBC.
When I call this report or update the data in the report from crystal
reports, everythink is OK.
When I call from the browser, the report comes with the last saved data. But
when I update this data, the Crystal Reports ask me for database login and
password. I did enter my passwords but the Crystal ask me again.

Somebody have any idea what can this be???

Thanks!!

Bruno



[PHP] Re: SSL use

2005-04-23 Thread Bruno Wolff III
On Fri, Apr 22, 2005 at 16:38:29 -0400,
  "ruel.cima" <[EMAIL PROTECTED]> wrote:
>  hi,
> 
>  im handling some important information that needs to be stored in my
>  postgresql database via a php script. i´ve been reading the mails sent on
>  this mailing list on SSL use. my postgresql server allows SSL connections
>  but im not sure how to make use of this.id like to know more about ssl and
>  how to take advantage of its security features. any references?
> 
>   from my php script, do i need to make a special connection to the database
>  or is the same e.g pg_connect(host= localhost dbname=test user=p
>  password=p)?

If postgres is running on the same machine as php there isn't much point
in using encryption of the connection. You are probably better off using
domain sockets instead of a network connection in this case.

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



php-general@lists.php.net

2001-02-26 Thread Bruno Mário Amaral Almeida

Hi everyone,
Can anyone tell me where can i find a place where to put my PHP/MySQL applications for 
free?
Many thanks
Bye
Bruno



[PHP] unsubscribe me

2001-04-19 Thread Bruno Mário Amaral Almeida





[PHP] Reverse (or backward?) Infinity Loop

2004-10-19 Thread Bruno B B Magalhães
Hi guys,
I have a normal categories table:
catId
catParentId
catName
catStatus
But I want when a user enters on:
http://hostname/site/products/catId1/catId7/catId13/../../contentId.html
A listing should apear like that:
• Category 1
 • Category 7
  • Category 13
• Category 2
• Category 3
• Category 4
• Category 5
A reverse (or backward) loop! We need to get the last category and then 
follow the ParentId until the 0 ParentId. Have anybody made this before 
(I hope so)?

Many Thanks,
Bruno B B Magalhaes
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Mixing classes

2004-10-20 Thread Bruno B B Magalhães
Hi Tomy,
I did the same thing!
I´ve used a class called framework to encapsulate everything... here is 
what looks like:

framework.inc.php
http://www.bbbm.com.br/
* @copyright 2004 Bruno B B Magalhaes
* @author Bruno B B Magalhaes <[EMAIL PROTECTED]>
* @package BBBM Framework
* @version 0.5-dev
*/
session_start();
/**
* Include Core Classes
*/
require_once(FRAMEWORK_DIR.'core/framework.class.php');
require_once(FRAMEWORK_DIR.'core/preferences.class.php');
require_once(FRAMEWORK_DIR.'core/languages.class.php');
require_once(FRAMEWORK_DIR.'core/database.class.php');
require_once(FRAMEWORK_DIR.'core/authentication.class.php');
require_once(FRAMEWORK_DIR.'core/input.class.php');
require_once(FRAMEWORK_DIR.'smarty/smarty.class.php');
require_once(FRAMEWORK_DIR.'core/output.class.php');
require_once(FRAMEWORK_DIR.'core/modules.class.php');
require_once(FRAMEWORK_DIR.'core/validation.class.php');
require_once(FRAMEWORK_DIR.'core/filters.class.php');
/**
* Include Shared Classes
*/
include_once(FRAMEWORK_DIR.'shared/categories.class.php');
?>
framework.class.php

/**
* Project: BBBM Framework
* File: framework.class.php
*
* @desc Main Framework Class
* @link http://www.bbbm.com.br/
* @copyright 2004 Bruno B B Magalhaes
* @author Bruno B B Magalhaes <[EMAIL PROTECTED]>
* @package BBBM Framework
* @version 0.5-dev
*/
class framework
{
	var $preferences;
	var $database;
	var $authentication;
	var $input;
	var $output;
	var $modules;
	var $validation;
	var $filters;
	var $languages;
	
	var $controller;
	
	/**
	* PHP 4 Constructor
	*/
	function framework()
	{
		$this->preferences = new preferences();// Preferences Layer
		$this->languages = new languages();	// Language Layer
		$this->database = new database($this->preferences);		// Database Layer
		$this->input = new input();		// Input Layer		
		$this->modules = new modules($this->database);			// Modules Layer
		$this->authentication = new authentication($this->database);	// 
Authentication Layer
		$this->output = new output($this->preferences,$this->languages);	// 
Ouput Layer
		$this->validation = new validation();	// Validation functions
		$this->filters = new filters();		// Filters Functions
	}
	
	function is_valid_controller($contoller='')
	{
		if($contoller != '')
		{
			$contoller = addslashes(strip_tags($contoller));
			$this->database->build_table(array('controllers'));
			
			$query = 'SELECT
	controllerStatus
FROM
	'.$this->database->table['controllers'].'
WHERE
	controllerPath=\''.$contoller.'\'
';
			
			$this->database->query($query);
			
			if($this->database->num_rows() > 0)
			{
$this->database->fetch_array();

if($this->database->row['controllerStatus'] > 0)
{
	$this->controller = $contoller;
	return true;
}
else
{
	$this->controller = false;
	return false;
}
			}
			else
			{
$this->controller = false;
return false;
			}
		}
		else
		{
			return false;
		}
	}
}
?>

Regards,
Bruno B B Magalhães
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Mixing classes

2004-10-20 Thread Bruno B B Magalhães
Hi Tomy,
I did the same thing!
I´ve used a class called framework to encapsulate everything... here is 
what looks like:

framework.inc.php
http://www.bbbm.com.br/
* @copyright 2004 Bruno B B Magalhaes
* @author Bruno B B Magalhaes <[EMAIL PROTECTED]>
* @package BBBM Framework
* @version 0.5-dev
*/
session_start();
/**
* Include Core Classes
*/
require_once(FRAMEWORK_DIR.'core/framework.class.php');
require_once(FRAMEWORK_DIR.'core/preferences.class.php');
require_once(FRAMEWORK_DIR.'core/languages.class.php');
require_once(FRAMEWORK_DIR.'core/database.class.php');
require_once(FRAMEWORK_DIR.'core/authentication.class.php');
require_once(FRAMEWORK_DIR.'core/input.class.php');
require_once(FRAMEWORK_DIR.'smarty/smarty.class.php');
require_once(FRAMEWORK_DIR.'core/output.class.php');
require_once(FRAMEWORK_DIR.'core/modules.class.php');
require_once(FRAMEWORK_DIR.'core/validation.class.php');
require_once(FRAMEWORK_DIR.'core/filters.class.php');
/**
* Include Shared Classes
*/
include_once(FRAMEWORK_DIR.'shared/categories.class.php');
?>
framework.class.php

/**
* Project: BBBM Framework
* File: framework.class.php
*
* @desc Main Framework Class
* @link http://www.bbbm.com.br/
* @copyright 2004 Bruno B B Magalhaes
* @author Bruno B B Magalhaes <[EMAIL PROTECTED]>
* @package BBBM Framework
* @version 0.5-dev
*/
class framework
{
	var $preferences;
	var $database;
	var $authentication;
	var $input;
	var $output;
	var $modules;
	var $validation;
	var $filters;
	var $languages;
	
	var $controller;
	
	/**
	* PHP 4 Constructor
	*/
	function framework()
	{
		$this->preferences = new preferences();// Preferences Layer
		$this->languages = new languages();	// Language Layer
		$this->database = new database($this->preferences);		// Database Layer
		$this->input = new input();		// Input Layer		
		$this->modules = new modules($this->database);			// Modules Layer
		$this->authentication = new authentication($this->database);	// 
Authentication Layer
		$this->output = new output($this->preferences,$this->languages);	// 
Ouput Layer
		$this->validation = new validation();	// Validation functions
		$this->filters = new filters();		// Filters Functions
	}
	
	function is_valid_controller($contoller='')
	{
		if($contoller != '')
		{
			$contoller = addslashes(strip_tags($contoller));
			$this->database->build_table(array('controllers'));
			
			$query = 'SELECT
	controllerStatus
FROM
	'.$this->database->table['controllers'].'
WHERE
	controllerPath=\''.$contoller.'\'
';
			
			$this->database->query($query);
			
			if($this->database->num_rows() > 0)
			{
$this->database->fetch_array();

if($this->database->row['controllerStatus'] > 0)
{
	$this->controller = $contoller;
	return true;
}
else
{
	$this->controller = false;
	return false;
}
			}
			else
			{
$this->controller = false;
return false;
			}
		}
		else
		{
			return false;
		}
	}
}
?>

Regards,
Bruno B B Magalhães
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] PHP framework

2004-10-23 Thread Bruno B B Magalhães
Igor,
the problem on using a framework is that you have to learn it before 
you take advantage of its features, I mean you must consider the 
learning curve in your time schedule.
There are pretty good frameworks out there, but each one with your pros 
and cons, and with your own goals, I mean, a strong and reliable 
framework doesn´t mean it is extensible or even template driven, or 
also even easy to learn.

I developed my own framework, witch I am using on almost all my 
projects (course I won´t kill a fly with a hammer!) for one year and 
half, and still on version 0.5dev! :)

Some of then:
http://www.zope.org
http://www.fusebox.org
http://www.mojavi.org
http://www.binarycloud.com
http://www.eZpublish.com
http://amb.sourceforge.net
http://www.phpmvc.net
http://phrame.itsd.ttu.edu
http://www.horde.org
Best Regards,
Bruno B B Magalhães
On Oct 23, 2004, at 4:04 PM, Igor wrote:
I need to develop an PHP/MySql application (about 20 db tables and 70
screens).  I was wandering if there is a solid framework out there that
could help development.
Also, I would appreciate any recommendations for books/docs on good
development practices and php app. architecture.
Thanks!
Igor
--
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


  1   2   >