Re: [PHP] Warning at PDO:Firebird driver manual page removed.

2012-09-21 Thread Davi Marcondes Moreira
Dear Lester,


Thank you very much for your attention. You gave me the exact explanation
which solved all my doubts about using PDO:Firebird.
Actually I'm building step by step a abstract layer file for general use on
these projects, and it works fine for us, using the php_interbase extension
functions. Unfortunately I can't share the code here, due to ethics
contract. But I'll stay in touch in the discussion group you've sent and
keep informed. Certainly I'll find more PHP/Firebird developers there.


Sincerely,


2012/9/21 Lester Caine les...@lsces.co.uk

 Davi Marcondes Moreira wrote:

 The question is: why the warning message was removed, and now this
 extension is safe for use, without risks of being discontinued or
 depreciated?


 Davi
 The current version of the extension is stable and a number of the initial
 bugs have been cleared up. If you use it you will find that it does work
 fine, but most PHP/Firebird users - like myself - stay with the
 php_interbase driver on it's own simply because some function are not
 available via the PDO driver. That only replaces the 'data' interface and
 does not address some of the control stuff. This is the case with many of
 the PDO drivers since it is not easy to provide a 'compatible' version of
 this across all database engines.

 I've still got FB1.5 on a number of sites mainly because of legacy apps
 that can no longer be recompiled, but PHP provides an additional interface
 to fill the gaps.

 http://groups.yahoo.com/group/**firebird-php/http://groups.yahoo.com/group/firebird-php/is
  the home for a more in depth discussion and assistance :)

 --
 Lester Caine - G8HFL
 -
 Contact - 
 http://lsces.co.uk/wiki/?page=**contacthttp://lsces.co.uk/wiki/?page=contact
 L.S.Caine Electronic Services - http://lsces.co.uk
 EnquirySolve - http://enquirysolve.com/
 Model Engineers Digital Workshop - http://medw.co.uk
 Rainbow Digital Media - 
 http://rainbowdigitalmedia.co.**ukhttp://rainbowdigitalmedia.co.uk

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




-- 
*Davi Marcondes Moreira*
+ Info: http://about.me/davi.m.moreira


[PHP] Warning at PDO:Firebird driver manual page removed.

2012-09-20 Thread Davi Marcondes Moreira
Hi, good evening!

I'm working with an database from and older application (Firebird 1.5) and
I need some help to implement the PDO:Firebird in our projects at work. If
anybody could give me some light in this case, I would be very happy to
implement PDO with Firebird from now on.

Until last month, the manual page about PDO:Firebird driver (
http://php.net/manual/en/ref.pdo-firebird.php) had a Warning message (
http://twitpic.com/awrqdx/full , 'Aviso' in portuguese) alerting about the
risks of using this extension: Warning: This module is EXPERIMENTAL. The
behaviour of this extension - including function names and any other
documentation about this extension - can change without advice in future
versions of PHP. This extension should be used at your own risk. and that
was the reason I didn't implemented this extension before, I didn't felt
safe enough to use it in our projects. But at the beggining of september
(nearly day 7) the warning message was removed (
http://twitpic.com/awrw8k/full) and no comments were posted on the page,
leaving unexplained the reasons of this update.

I've got help from Rafael Dohms on twitter which sent links (
http://www.gn0s1s.nl/?p=108 and http://www.firebirdnews.org/?p=6619)
explaining that between may and december 2011 some members of gn0s1s.nl and
firebirdnews.org had plans to fix bugs to set this extension safe for
general use, but I didn't got any response that proved with 100% that this
extension is now secure for project needs.

The question is: why the warning message was removed, and now this
extension is safe for use, without risks of being discontinued or
depreciated?

Sincerely,

-- 
Davi Marcondes Moreira
+ Info: http://about.me/davi.m.moreira


Re: [PHP] how to make multiple sql run faster

2009-03-22 Thread Davi Vidal

On 03/21/2009 10:19 AM, Andrea Giammarchi wrote:

Hi all,

I am inserting more than 5000 rows into sql database but its taking more
than 30 mins  to get it all the data inserted. I use union to insert
multiple rows of 20 at a time.

What is the best way to make insert sql statement run faster


Usually a single transaction is faster than an insert a time (with or without 
union)



What do you mean?

START TRANSACTION;
INSERT;
INSERT;
INSERT;
COMMIT;

Is that?

Thank you very much

davi

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



[PHP] Re: if elseif elseif elseif....

2009-03-05 Thread Davi Ramos
I tought you forgot to initializae the $obligatoryFieldNotPresent variable,
as PHP create variables when they are initialized, the
$obligatoryFieldNotPresent variable is created inside the if.

$obligatoryFieldNotPresent = 0;

if (strlen($_POST[titleIN]) == 0 ) {
   $obligatoryFieldNotPresent = 1;
   }
   elseif (strlen($_POST[first_nameIN]) == 0 ) {
   $obligatoryFieldNotPresent = 1;
   }
   elseif (strlen($_POST[publisherIN]) == 0 ) {
   $obligatoryFieldNotPresent = 1;
   }
   elseif (strlen($_POST[copyrightIN]) ==  ) {
   $obligatoryFieldNotPresent = 1;
   }
   elseif (strlen($_POST[ISBNIN]) == 0 ) {
   $obligatoryFieldNotPresent = 1;
   }
   elseif (strlen($_POST[languageIN]) == 0 ) {
   $obligatoryFieldNotPresent = 1;
   }
   elseif (!empty($_POST['categoriesIN'])) {
   $obligatoryFieldNotPresent = 0;
}

-- 
Davi R. Tavares


[PHP] Best error handling

2009-02-27 Thread Davi Ramos
Hi. I have a kind of webserver that certain applications communicate with.
The problem is that the script (named peer.php) must output data as xml.
Thats ok (thanks to XMLWriter). The problem is that when some error occurs
(those note catchable by set_error_handler) I have no control on data being
outputed.

I would like to output xml even on fatal errors (in that case, telling that
something gone wrong). I tried using register_shutdown_function but it is
crashing (as the nature of fatal errors that make the envirionment
unstable).

Any idea?

Thanks!

-- 
Davi R. Tavares


[PHP] Re: Best error handling

2009-02-27 Thread Davi Ramos
No luck with your solution... I think that the only way is (as you said) to
make sure that there will be no fatal errors :)
I'll will implement the error handler as well (to catch some minor errors)
and uncaught exceptions.

The method for catch all errors using a shutdown function appears to work,
but it crashes when using my php stream mock implementation (that I use to
simulate calls to the script).

Thanks anyway Nathan!

PS. Is there some plan to make PHP full exception-ready, dropping the usual
way of return values?

Davi

On Fri, Feb 27, 2009 at 9:51 PM, Nathan Rixham nrix...@gmail.com wrote:

 Davi Ramos wrote:

 Hi. I have a kind of webserver that certain applications communicate with.
 The problem is that the script (named peer.php) must output data as xml.
 Thats ok (thanks to XMLWriter). The problem is that when some error occurs
 (those note catchable by set_error_handler) I have no control on data
 being
 outputed.

 I would like to output xml even on fatal errors (in that case, telling
 that
 something gone wrong). I tried using register_shutdown_function but it is
 crashing (as the nature of fatal errors that make the envirionment
 unstable).

 Any idea?

 Thanks!


 not a nice answer but make sure you're application has no fatal errors - a
 fatal error halts the compiler as it's fatal, thus there is no way to
 implement anything else afterwards or turn it in to an exception or
 suchlike.

 further, for live servers you really should have display errors set to off
 in you're php.ini - at which point nothing will be returned

 try: (not tested or particularly thought about)
 1: move all the code from peer.php in to an include file
 2: make you're main peer.php file contain only
 ?php
 try {
  require_once 'include_file.php';
 } catch($e) {
 echo 'some xml error';
 }
 ?

 can't promise that'll work though, to test quickly just add all that to a
 php file and run it (as you don't have the required file so a fatal will get
 raised)

 regards and good luck - nathan

 ps: may check this one out myself, sure I've done it years ago when i still
 made sites




-- 
Davi R. Tavares


[PHP] Help with a potential bug

2009-02-27 Thread Davi Ramos
Can someone help me find the smallest block of code that is making Apache
SEGV? Actually the code is about 30 lines and actually depends with Doctrine
(which I think it is not causing the crash as well, but it is combined with
something else). I also make use of user defined stream wrappers. These
combined cause PHP crash Apache when it is freeing resources (the last
called function was stream_close, when I removed that method from my
user-defined stream, it doesn't crashes anymore).

The code makes use of register_shutdown_function to try to detect an E_ERROR
(or other fatal error) and them output gracefully to the user. Removing
Doctrine (that is actually just initialized) or my user-defined stream,
there is no crash.

PHP 5.2.6 (also tested with PHP 5.2.8)
Apache 2.2

I am beginner on finding bugs on PHP, this one is really boring me because
it makes an important part of my software not work.

I have the backtrace and a ready to debug environment (PHP 5.2.6 and Apache
2.2) with GDB.

-- 
Davi R. Tavares


Re: [PHP] Top/bottom posting holy war *cringe* (was: New to PHP)

2008-10-13 Thread Davi Vidal
On Monday 13 October 2008 13:44:27 TG wrote:
 I concede only that the PHP list has a requested style (bottom posting).  I
 disagree on it's usefulness OVER top posting.


So, this is the only list that you read.

-- 
Davi Vidal
--
E-mail: davividal at siscompar dot com dot br
MSN   : davividal at msn dot com
GTalk : davividal at gmail dot com
Skype : davividal
YIM   : davi_vidal
ICQ   : 138815296


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



Re: [PHP] Re: PHP editor for linux

2008-08-15 Thread Davi Vidal
Em Friday 15 August 2008, Robert Cummings escreveu:
 On Fri, 2008-08-15 at 10:43 -0600, Nathan Nobbe wrote:
  On Fri, Aug 15, 2008 at 10:40 AM, Richard Heyes [EMAIL PROTECTED] wrote:
What do you think is the best php editor for linux.
  
   pico :-)
 
  ed baby; its all about ed!

 hexedit /dev/sda1

 ;)


Butterflies. :-)

http://xkcd.com/378/

-- 
Davi Vidal
--
E-mail: [EMAIL PROTECTED]
MSN   : [EMAIL PROTECTED]
GTalk : [EMAIL PROTECTED]
Skype : davi vidal
YIM   : davi_vidal
ICQ   : 138815296

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



Re: [PHP] Validating Email Conditional

2007-08-01 Thread Davi
Em Quarta 01 Agosto 2007 19:56, Robin Vickery escreveu:
 On 01/08/07, CK [EMAIL PROTECTED] wrote:
  Hi,
 
  My script is working,

 [...]

  $regexp = ^([_a-z0-9-]+)(\.[_a-z0-9-]+)*@([a-z0-9-]+)(\.[a-z0-9-]
  +)*(\.[a-z]{2,4})$;

 If your script is using that regular expression to validate email addresses
 then your script is most definitely not working.

 -robin

 (who is fed up with websites that reject perfectly good email
 addresses for no good reason)

I'm wrong or if I try to use my mail address ([EMAIL PROTECTED]) it 
will be rejected?
My e-mail address isn't in format [EMAIL PROTECTED]
-- 
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--

Por favor não faça top-posting, coloque a sua resposta abaixo desta linha.
Eu não respondo top-post/HTML post. Obrigado.
Please don't do top-posting, put your reply below the following line.
I don't reply to top-post/HTML post. Thank you.



pgpiV6gyO987G.pgp
Description: PGP signature


Re: [PHP] About PHP CMS

2007-07-06 Thread Davi
Em Sexta 06 Julho 2007 21:24, Kelvin Park escreveu:
 Is it possible to have PHP code completely separate from the HTML page that
 needs to be completely dynamic? (That's how ASP.NET sort of works I think).
 If this is possible, HTML CODE, PHP CODE, AND THE CSS CODE can be
 completely separate, increasing the clarity of all the source code.

Yes.
Take a look at Smarty. :-)

http://smarty.php.net

 My second question is:
 Is it more efficient to always code OOP PHP then just simple functions here
 and there?

How big is your project?
If you're talking about a personal visit counter, run away OOP.
If you're talking about a really big project (And yes, CMS _is_ a big 
project), go ahead and use OOP.

OOP is better to mantain... :-)

HTH

-- 
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--
Religion, ideology, resources, land,
spite, love or just because...
No matter how pathetic the reason,
it's enough to start a war. 

Por favor não faça top-posting, coloque a sua resposta abaixo desta linha.
Please don't do top-posting, put your reply below the following line.



pgpY7R2wfIzAk.pgp
Description: PGP signature


Re: [PHP] explode string at new line

2007-06-06 Thread Davi
Em Quarta 06 Junho 2007 02:50, Jim Lucas escreveu:
 Chris wrote:
  Davi wrote:
  Em Terça 05 Junho 2007 23:52, [EMAIL PROTECTED] escreveu:
  That's exactly correct. Except I /think/ you should use \n instead of
  '\n'.
 
  array explode ( string $delimiter, string $string [, int $limit] )
 
  So, I was wrong...
  The right way, probaly, is:
 
  $str=explode(\n,$_POST[my_text]);
 
  If it's coming from a textarea you'll want to use \r\n because a
  textarea uses both a carriage return (\r) and newline (\n) to separate.
 
  Otherwise each element of the array will have a \r on the end which may
  end up causing you some issues later on.

 I was wondering about this, I seem to recall that window/mac/*nix all do
 it differently.

 http://www.sitepoint.com/forums/printthread.php?t=54074

 Line breaks
 People want to know how they can retain textarea line breaks in HTML.
 You should store text in the database in its original format (e.g. with
 just newlines) and then use nl2br() to convert newlines to HTML br /
 tags on display (thanks to the people here for teaching me that :)).
 That's all good, except for one problem with nl2br(): it doesn't seem to
 convert \r newlines (edit: this has now been fixed in PHP 4.2.0).

 PHP Code:
 $txt = preg_replace('/\r\n|\r/', \n, $txt);


Helped... =)

But... Why does it happen:

[code]

$object=mysql_fetch_object($result);

$texto = $object-texto;

$texto=preg_replace(/\r|\n/,,stripslashes($texto));
echo $texto;

[/code]

[output]

Teste
\r\nde formatação!
\r\nTudo funcionando...
\r\n

[/output]


I'm using stripslashse 'cause I'm getting the values from a DB.

Any kind of tip?

TIA


-- 
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--
Religion, ideology, resources, land,
spite, love or just because...
No matter how pathetic the reason,
it's enough to start a war. 

Por favor não faça top-posting, coloque a sua resposta abaixo desta linha.
Please don't do top-posting, put your reply below the following line.



pgpXKjnY1odxa.pgp
Description: PGP signature


Re: [PHP] explode string at new line

2007-06-06 Thread Davi
Em Quarta 06 Junho 2007 10:54, Davi escreveu:
 But... Why does it happen:

 [code]

 $object=mysql_fetch_object($result);

 $texto = $object-texto;

 $texto=preg_replace(/\r|\n/,,stripslashes($texto));
 echo $texto;

 [/code]

 [output]

 Teste
 \r\nde formatação!
 \r\nTudo funcionando...
 \r\n

 [/output]


 I'm using stripslashse 'cause I'm getting the values from a DB.

 Any kind of tip?

 TIA

If I do:

[code]

echo \r\nJust testing... \r\n again...;

[/code]

The output is:

[output]

Just testing... again...

[/output]

And the source code (in browser) is:

[output]

Just testing...
again...

[/output]


Am I missing anything?

TIA

-- 
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--
Religion, ideology, resources, land,
spite, love or just because...
No matter how pathetic the reason,
it's enough to start a war. 

Por favor não faça top-posting, coloque a sua resposta abaixo desta linha.
Please don't do top-posting, put your reply below the following line.



pgpCbBEc0rmeF.pgp
Description: PGP signature


Re: [PHP] explode string at new line

2007-06-06 Thread Davi
Em Quarta 06 Junho 2007 13:20, Jim Lucas escreveu:
 Davi wrote:
  Em Quarta 06 Junho 2007 10:54, Davi escreveu:
  But... Why does it happen:
 
  [code]
 
  $object=mysql_fetch_object($result);
 
  $texto = $object-texto;
 
  $texto=preg_replace(/\r|\n/,,stripslashes($texto));
  echo $texto;
 
  [/code]
 
  [output]
 
  Teste
  \r\nde formatação!
  \r\nTudo funcionando...
  \r\n
 
  [/output]
 
 
  I'm using stripslashse 'cause I'm getting the values from a DB.
 
 
  If I do:
 
  [code]
 
  echo \r\nJust testing... \r\n again...;
 
  [/code]
 
  The output is:

 how and where are you outputting this to?


How: echo
Where: Firefox 2.0.0.3

  [output]
 
  Just testing... again...
 
  [/output]
 
  And the source code (in browser) is:

 What OS?


SuSE 9.3 (Server)

Gentoo Linux 1.12.9 [2007.0] (Desktop/Development)

  [output]
 
  Just testing...
  again...
 
  [/output]
 
 

-- 
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--
Religion, ideology, resources, land,
spite, love or just because...
No matter how pathetic the reason,
it's enough to start a war. 

Por favor não faça top-posting, coloque a sua resposta abaixo desta linha.
Please don't do top-posting, put your reply below the following line.



pgpKvupfZO86S.pgp
Description: PGP signature


[PHP] explode string at new line

2007-06-05 Thread Davi

Hi all.

I've the fowlling string:

$_POST[my_text]=hi...\nthis is my multi-line\ntext;

Can I use explode to have something like:

$str[0]=hi...;
$str[1]=this is my multi-line;
$str[2]=text;

$str=explode($_POST[my_text],'\n');


TIA and sorry the *very* poor english.


-- 
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--
Religion, ideology, resources, land,
spite, love or just because...
No matter how pathetic the reason,
it's enough to start a war. 

Por favor não faça top-posting, coloque a sua resposta abaixo desta linha.
Please don't do top-posting, put your reply below the following line.



pgpwspUVrKaj0.pgp
Description: PGP signature


Re: [PHP] explode string at new line

2007-06-05 Thread Davi
Em Terça 05 Junho 2007 23:52, [EMAIL PROTECTED] escreveu:
 That's exactly correct. Except I /think/ you should use \n instead of
 '\n'.


Thank you for the reply... =)

I'll check this... BTW:

array explode ( string $delimiter, string $string [, int $limit] )

So, I was wrong...
The right way, probaly, is:

$str=explode(\n,$_POST[my_text]);


Thank you very much.


-- 
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--
Religion, ideology, resources, land,
spite, love or just because...
No matter how pathetic the reason,
it's enough to start a war. 

Por favor não faça top-posting, coloque a sua resposta abaixo desta linha.
Please don't do top-posting, put your reply below the following line.



pgpS3oEAG6jIw.pgp
Description: PGP signature


Re: [PHP] explode string at new line

2007-06-05 Thread Davi
Em Quarta 06 Junho 2007 00:18, Chris escreveu:
 Davi wrote:
  Em Terça 05 Junho 2007 23:52, [EMAIL PROTECTED] escreveu:
  That's exactly correct. Except I /think/ you should use \n instead of
  '\n'.
 
  So, I was wrong...
  The right way, probaly, is:
 
  $str=explode(\n,$_POST[my_text]);

 If it's coming from a textarea you'll want to use \r\n because a
 textarea uses both a carriage return (\r) and newline (\n) to separate.

 Otherwise each element of the array will have a \r on the end which may
 end up causing you some issues later on.


Yes. Is a textarea. Thank you very much! =D


-- 
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--
Religion, ideology, resources, land,
spite, love or just because...
No matter how pathetic the reason,
it's enough to start a war. 

Por favor não faça top-posting, coloque a sua resposta abaixo desta linha.
Please don't do top-posting, put your reply below the following line.



pgpctEzLbMQgx.pgp
Description: PGP signature


Re: [PHP] Attempting to search a MySQL database from PHP not working

2007-05-31 Thread Davi
Em Quinta 31 Maio 2007 16:25, Jason Pruim escreveu:
 Hi Everyone, I am attempting to setup a search field on a database
 application I'm dinking around with and running into problems that
 I'm hoping someone might be able to shed some light on.

 Here is the code I am using to display the results of the search:

 echo ('table border=1');
 echo trthFirst Name/ththAuthor/ththPages/th/tr;

 $result_row[] = mysql_query($query) or die(mysql_error());
 echo Result_row dump: $result_row BR;
 $num=mysql_numrows($result);
 echo Num dump: $num BR;
 $i= 0;

/*
 while($i  $num) {
*/

$result=$result_row[0];

while($result_row = mysql_fetch_array($result) {

   echo trtd;
   echo $result_row[0] . '/tdtd';
   echo $result_row[1] . '/tdtd';
   echo $result_row[2] . '/td/tr';
   $i++;
   }

 echo (/table);


 the problem is instead of printing out the actual results it prints
 out 6 fields that say: Resource id #5

 the query I'm using is: SELECT FName, LName, Add1, Add2 FROM current
 WHERE FName like '%jason%' which works in MySQL

 I can't find any errors in my log files to even give me a hint as to
 what is going on.

 If someone could take a look I would greatly appreciate it.


HTH

-- 
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--
Religion, ideology, resources, land,
spite, love or just because...
No matter how pathetic the reason,
it's enough to start a war. 

Por favor não faça top-posting, coloque a sua resposta abaixo desta linha.
Please don't do top-posting, put your reply below the following line.



pgpoZaZKvtBnT.pgp
Description: PGP signature


Re: [PHP] Attempting to search a MySQL database from PHP not working

2007-05-31 Thread Davi
Em Quinta 31 Maio 2007 16:38, Jason Pruim escreveu:
 
  while($result_row = mysql_fetch_array($result) {

 Worked perfectly after adding a closing ) Thanks for the tip!


Forgive me for that!!! #'_'#
I *always* forget the closing )... =P


-- 
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--
Religion, ideology, resources, land,
spite, love or just because...
No matter how pathetic the reason,
it's enough to start a war. 

Por favor não faça top-posting, coloque a sua resposta abaixo desta linha.
Please don't do top-posting, put your reply below the following line.



pgpH2cHUfJswa.pgp
Description: PGP signature


Re: [PHP] problems in WHERE statment

2007-05-23 Thread Davi
Em Segunda 21 Maio 2007 16:46, Mike Ryan escreveu:
 I get this error message when I try to run a query

 Connected successfullyCould not successfully run query () from DB: Unknown
 column '$today' in 'where clause'

 this is the query command
  $query = 'SELECT *
 FROM `job listing`
 WHERE open =$today
 LIMIT 0 , 30 ';

 I have assigned $today this way $today=date(Y-m-d);

 Can you tell me what I did wrong??


Sure! =)

You must scape your PHP variables in any SQL query...

Try this:

$query=SELECT *
FROM `joblisting`
WHERE open = '$today'
LIMIT 0,30;

HTH
-- 
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--
Religion, ideology, resources, land,
spite, love or just because...
No matter how pathetic the reason,
it's enough to start a war. 


pgpBld9Ikeqgh.pgp
Description: PGP signature


Re: [PHP] convert numerical day of week

2007-05-22 Thread Davi
Em Terça 22 Maio 2007 22:39, Robert Cummings escreveu:
 On Tue, 2007-05-22 at 21:13 -0400, [EMAIL PROTECTED] wrote:
  Mom!  Dad!  Stop fighting!

 In case anyone is wondering... I'm the Dad!! :)


Just read my sig... =)

Time to sleep... Good bye! =)


-- 
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--
Religion, ideology, resources, land,
spite, love or just because...
No matter how pathetic the reason,
it's enough to start a war. 


pgpBX8Yi1XQK7.pgp
Description: PGP signature


Re: [PHP] Adserver programming with php

2007-05-19 Thread Davi
Em Sábado 19 Maio 2007 21:15, Merlin escreveu:
 I am thinking about creating a kind of adserver which is customized for
 my needs. As I would be most confident in doing this with php, I am
 asking myself if this is the right choice or if it would be wiser to
 take a C++ aproach for example to get a higher performance just in case
 the site grows fast.
 Do you guys think that a php build webserver would be able to scale and
 perform well enough for serving millions of adimpressions daily?


IIRC, AFAIK, using PHP or C or Java or C++ or anything else, your webserver 
will do all the dirty work...

If you'd portuguese skills, read [1], otherwise, I'll recomend you to build 
careful your server... And just put Web server (i.e. Apache) on it... DB 
server, mail server and other server must be in other machines...
Build careful means: use a _good_ Linux distro... If you can use Gentoo [2], 
you'll get better results...

[1] - http://archives.gentoo.org/gentoo-user-br/msg_11719.xml
[2] - www.gentoo.org

HTH


-- 
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--
Religion, ideology, resources, land,
spite, love or just because...
No matter how pathetic the reason,
it's enough to start a war. 


pgpdsYkCHDWsy.pgp
Description: PGP signature


Re: [PHP] Ajax Developer

2007-05-09 Thread Davi
Em Quarta 09 Maio 2007 12:12, Stut escreveu:
 Efrain Sarmiento wrote:
  AJAX Developer  (Web Designer / Developer).  MUST HAVE:  1 year AJAX
  Experience, HTML, CSS, DHTML, OOJS, XML, JAVASCRIRPT, J2EE, and at lease
  an IDE like Photoshop, Dreamweaver, Eclipse or similar.  Jersey City,
  NJ, 6 months ongoing.  $560/day C2C.

 Hands up everyone who uses the Photoshop IDE...


=P

_o/

hehehe

How can I do an while loop in Photoshop CS 3?? =]
Using the pen tool? On which layer?

thanks! =]

-- 
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--
Religion, ideology, resources, land,
spite, love or just because...
No matter how pathetic the reason,
it's enough to start a war. 


pgpWAyX29KtcQ.pgp
Description: PGP signature


Re: [PHP] Ajax Developer

2007-05-09 Thread Davi
Em Quarta 09 Maio 2007 12:41, Robert Cummings escreveu:
 On Wed, 2007-05-09 at 10:23 -0500, Edward Vermillion wrote:
  On May 9, 2007, at 10:12 AM, Stut wrote:
   Efrain Sarmiento wrote:
   AJAX Developer  (Web Designer / Developer).  MUST HAVE:  1 year AJAX
   Experience, HTML, CSS, DHTML, OOJS, XML, JAVASCRIRPT, J2EE, and at
   lease
   an IDE like Photoshop, Dreamweaver, Eclipse or similar.  Jersey City,
   NJ, 6 months ongoing.  $560/day C2C.
  
   Hands up everyone who uses the Photoshop IDE...
 
  Ohh! That's in CS3 right?!? Cool! I've gotta get me one of those!

 I'm much more partial to the Gimp IDE :)


MS Paint or Xpaint sounds little better to me... =]


-- 
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--
Religion, ideology, resources, land,
spite, love or just because...
No matter how pathetic the reason,
it's enough to start a war. 


pgpwVNnRgmJnk.pgp
Description: PGP signature


Re: [PHP] PHP 5.2.2 - Undefined Function mysql_connect()

2007-05-07 Thread Davi
Em Segunda 07 Maio 2007 08:12, Jason Paschal escreveu:
 I use this setup locally for testing/playing.  I recently installed the
 latest and greatest of the AMP collection.

 Apache 2.2.4
 PHP 5.2.2
 MySQL 5.0.37

 Apache and PHP work fine together, but I wanted to hook it up to a local
 test database, so  I installed MySQL.

 In php.ini, i have:

 ; Directory in which the loadable extensions (modules) reside.
 extension_dir = C:\PHP

 i made sure that i moved the dll to that folder, just like i did with the
 gd dll.

 And then i uncommented this line:

 extension=php_mysql.dll

 I restarted Apache, and ran a simple test script:

 ?php
 ini_set(display_errors,1);
 $cn = mysql_connect(localhost,root,password);
 ?

 and I get the error:

 *Fatal error*: Call to undefined function mysql_connect()

 any ideas?


First: have you tried mysql-cli?
Second: have you take a look at phpinfo()?

HTH

-- 
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--
Religion, ideology, resources, land,
spite, love or just because...
No matter how pathetic the reason,
it's enough to start a war. 


pgpqTKyP488jG.pgp
Description: PGP signature


Re: [PHP] PHP 5.2.2 - Undefined Function mysql_connect()

2007-05-07 Thread Davi
Em Segunda 07 Maio 2007 09:03, Jason Paschal escreveu:
 thank you for responding.

 phpinfo shows that it is finding the correct file:

 Loaded Configuration File: C:\PHP\php.ini

 that is the correct file with the correct settings.

 i renamed it and phpinfo showed (none).  i set it back to the correct name,
 php.ini, and now phpinfo shows C:\PHP\php.ini

 so i know it's finding the right file.

 still the same problem, though.


Yeah... But you must look at mysql section in phpinfo()...

If it's there, all must work fine... Otherwise, you must check your php.ini...



-- 
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--
Religion, ideology, resources, land,
spite, love or just because...
No matter how pathetic the reason,
it's enough to start a war. 


pgpD6oFhyNR4X.pgp
Description: PGP signature


Re: [PHP] PHP 5.2.2 - Undefined Function mysql_connect()

2007-05-07 Thread Davi
Em Segunda 07 Maio 2007 09:37, você escreveu:
 I FOUND THE SOLUTION:

 i copied libmysql.dll and php_mysql.dll to my c:\windows\ folder

 suddenly my script connects.  that's all it took.

 thank you for taking the time to help.  maybe this info can help you or
 someone you know.


Sure! =]

But... Consider reply to list next time... =]


-- 
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--
Religion, ideology, resources, land,
spite, love or just because...
No matter how pathetic the reason,
it's enough to start a war. 


pgplrhIY4ZYw1.pgp
Description: PGP signature


Re: [PHP] Blocking the direct download of a file

2007-05-07 Thread Davi
Em Segunda 07 Maio 2007 12:36, pw escreveu:
 ?php
  $referrer=$_SERVER['HTTP_REFERRER'];
  if(strcmp($referrer,http://www.myweb.com/index.phtml;)==0)
 {

  header(Location: ./primary.jar);
 }
 else
 {
  header(Location: ./secondary.jar);
 }
 ?


 The problem is I get a java.lang.ClassNotFoundException.

 Is there a way to change a reference like this
 'on-the-fly' so to speak?

 Is my code wrong and this method can be modified
 to work?


Change the content-type?

I don't known how to do it... But I would try it... =]

HTH
-- 
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--
Religion, ideology, resources, land,
spite, love or just because...
No matter how pathetic the reason,
it's enough to start a war. 


pgplWVNgnpSCv.pgp
Description: PGP signature


Re: [PHP] CMS Systems

2007-05-07 Thread Davi
Em Segunda 07 Maio 2007 16:46, Joey escreveu:
 Does anyone know of any good open source CMS system? ( content management
 system )


XOOPS is a good one...


-- 
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--
Religion, ideology, resources, land,
spite, love or just because...
No matter how pathetic the reason,
it's enough to start a war. 


pgpM40hSwSTzH.pgp
Description: PGP signature


Re: [PHP] Feisty Fawn and apt-get

2007-05-05 Thread Davi
Em Sábado 05 Maio 2007 18:01, Skip Evans escreveu:
 Hey all,

 I've installed Feisty Fawn on the curmudgeon
 barber's machine, but it won't get any of the
 outside packages I've tried to get. I've tried an

 apt-get install {package}

 ...on digikam, kate, gftp, and others. All stuff I
 had no trouble getting with Edgy.

 I checked the sources.list file and it has both
 universe and multiverse enabled.

 Is there something with the FF repositories or
 something I'm missing?

 Thanks,
 Skip

First: use aptitude instead apt-get... =]
Second: use an debian-list to debian's questions instead an php-list... =]

HTH

-- 
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--
Religion, ideology, resources, land,
spite, love or just because...
No matter how pathetic the reason,
it's enough to start a war. 


pgp5RWUxpURPp.pgp
Description: PGP signature


Re: [PHP] Find MAC Address in PHP

2007-04-24 Thread Davi
Em Terça 24 Abril 2007 10:07, Tijnema ! escreveu:
 On 4/23/07, Davi [EMAIL PROTECTED] wrote:
  Em Domingo 22 Abril 2007 03:12, Richard Lynch escreveu:
   On Fri, April 20, 2007 3:00 pm, Nathaniel Hall wrote:
?php $MAC = system(arp 192.168.200.254); echo $MAC; ?
does not give me any
output. I have copied arp to a place that the apache user can execute
from and ensured arp is executable.
  
   Use exec and the extra args to get error codes.
 
  ARP is a root-command... =]

 Ok, maybe it's because i've builded my own Linux, and didn't wanted to
 have any security, but /sbin/arp has chmod value 755 on my system, and
 so, i can execute it with any user.


cheatter... =P

   Can you run 'arp' and get what you want from command line?
 
  As web-user? No.

 i can :)

cheatter... =P

   Can you 'su' to PHP user and *then* run it and get what you want?
 
  Hum... Not at all... You need to enter the root password... How can you
  do that?
  sudo sounds a little better... But... How about security?

 Hmm, that would mean that you have to store your root password in your
 PHP script ... I don't prefer that, maybe you could use it on a
 development server, but don't use it on production server ;)


Yes... You store your root pwd in your script then:

?php

$root_pwd=123456;

echo system(su - -c arp);

?

$ su - -c arp
Password:

How you'll type your root pwd? =P

   If not, you can't do that.
 
  And with a shell-script outputting the MAC to a .txt temp file, reading
  it from the PHP script?

#!/bin/bash

if [ ! $# -eq 1 ]; then
echo Usage: $0 target_ip;
exit;
fi;

MAC_ADDR=`sudo arp | grep $1 | cut -d  -f18`

echo ${MAC_ADDR}  /your/html/pub/dir/mac_temp.txt


?php

$mac=file(mac_temp.txt);

foreach($mac_addr as $mac){
echo $mac_addr;
}

?

 
  BTW, have a look at suPHP [1]... =]
 
  [1] - http://www.howtoforge.com/suphp_debian_etch_ispconfig

 That's really a big job to install :(

Yeah!! =P


-- 
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--
Religion, ideology, resources, land,
spite, love or just because...
No matter how pathetic the reason,
it's enough to start a war. 


pgpwZwDXPVazK.pgp
Description: PGP signature


Re: [PHP] Find MAC Address in PHP

2007-04-24 Thread Davi
Em Terça 24 Abril 2007 10:49, Tijnema ! escreveu:
 On 4/24/07, Davi [EMAIL PROTECTED] wrote:
  How you'll type your root pwd? =P

 Something with the proc_* functions as you need bi-directional streams
 (input/output). Something like this: (not tested, partly copied form
 example 1926)
 ?php

 $root_pwd=123456;

 $descriptorspec = array(
0 = array(pipe, r),  // stdin is a pipe that the child will read
 from 1 = array(pipe, w),  // stdout is a pipe that the child will
 write to 2 = array(file, /tmp/error-output.txt, a) // stderr is a
 file to write to
 );

 $process = proc_open('su - -c arp', $descriptorspec, $pipes);

 if (is_resource($process)) {
 fwrite($pipes[0], $root_pwd.\r\n);
 fclose($pipes[0]);

 echo stream_get_contents($pipes[1]);
 fclose($pipes[1]);

 proc_close($process);
 }
 ?


sounds cool... =]
I'll search for it...

 If not, you can't do that.
   
And with a shell-script outputting the MAC to a .txt temp file,
reading it from the PHP script?
 
  #!/bin/bash
 
  if [ ! $# -eq 1 ]; then
 echo Usage: $0 target_ip;
 exit;
  fi;
 
  MAC_ADDR=`sudo arp | grep $1 | cut -d  -f18`
 
  echo ${MAC_ADDR}  /your/html/pub/dir/mac_temp.txt

 Where's the root password? I guess you need it too when using sudo?

trick... =P
correctly configured, sudo doesn't need pwd for some commands...

see Ubuntu... ;)


  ?php
 
  $mac=file(mac_temp.txt);
 
  foreach($mac_addr as $mac){
 echo $mac_addr;
  }
 
  ?

 Uhm, this is really weird code, i guess you meant this:

 ?php

 $mac=file(mac_temp.txt);

 foreach($mac as $mac_addr){
echo $mac_addr;
 }

 ?


Yes... Sorry! =]

 But well, when you have root access to the server, it might be better
 to just cheat like i did, and make arp available to the PHP user :)

I'm some paranoic... =X
I wouldn't do it... =P


-- 
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--
Religion, ideology, resources, land,
spite, love or just because...
No matter how pathetic the reason,
it's enough to start a war. 


pgp9WHLICjbd1.pgp
Description: PGP signature


Re: [PHP] Find MAC Address in PHP

2007-04-23 Thread Davi
Em Domingo 22 Abril 2007 03:12, Richard Lynch escreveu:
 On Fri, April 20, 2007 3:00 pm, Nathaniel Hall wrote:
  ?php $MAC = system(arp 192.168.200.254); echo $MAC; ?
  does not give me any 
  output.  I have copied arp to a place that the apache user can execute
  from and ensured arp is executable.

 Use exec and the extra args to get error codes.

ARP is a root-command... =]


 Can you run 'arp' and get what you want from command line?

As web-user? No.


 Can you 'su' to PHP user and *then* run it and get what you want?

Hum... Not at all... You need to enter the root password... How can you do 
that?
sudo sounds a little better... But... How about security?


 If not, you can't do that.

And with a shell-script outputting the MAC to a .txt temp file, reading it 
from the PHP script?

BTW, have a look at suPHP [1]... =]

[1] - http://www.howtoforge.com/suphp_debian_etch_ispconfig

-- 
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--

Agora com fortune:
Most people will listen to your unreasonable demands, if you'll consider
their unacceptable offer.


pgp7magXR3qDc.pgp
Description: PGP signature


Re: [PHP] Best practices to ensure compatibility with PHP 6

2007-04-22 Thread Davi
Em Domingo 22 Abril 2007 18:54, [EMAIL PROTECTED] escreveu:
 Hi

 I'm would like to avoid PHP usages that are deprecated with
 regard to PHP 6.  I would also like to code according to
 what is regarded as best practice.  Are there any web
 resources that I can read to keep up to date?


Have a look at PHP metting [1] and PHP-wiki [2]... =]

[1] - http://www.php.net/~derick/meeting-notes.html
[2] - http://oss.backendmedia.com/PhP60
-- 
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--

Agora com fortune:
Many have marked the speed with which Muad'Dib learned the necessities of 
Arrakis. The Bene Gesserit, of course, know the basis of this speed. For the 
others, we can say that Muad'Dib learned rapidly because his first training 
was 
in how to learn. And the first lesson of all was the basic trust that he could 
learn. It is shocking to find how many people do not believe they can learn, 
and how many more believe learning to be difficult. Muad'Dib knew that every 
experience carries its lesson.

  -- from The Humanity of Muad'Dib by the Princess Irulan


pgplSUchqFENp.pgp
Description: PGP signature


Re: [PHP] Problem with characters

2007-04-20 Thread Davi
Em Sexta 20 Abril 2007 14:19, enediel gonzalez escreveu:
 Hello.
 using phpmyadmin I can read that in one register of the database exists the
 string
 Vérifie que le service

 reading the registry in php code
 $description = $row[$description_field]);
 exec(echo '$description'  /tmp/ttt.txt);

 inside of /tmp/ttt.txt I can see
 Vérifie que le service


Charset issue?? =P

What's the charset of your DB?
What's the charset of your Debian sys?


-- 
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--

Agora com fortune:

Carpal Tunnel Syndrome?  No.  Lumber Lung?  No.  Jugglers despair?
No.  Achy-Breaky Pelvis?  No.  Oh, I'm never going to be disabled.
I'm sick of being so healthy!  Hey wait -- Hyper-Obesity.  If you
weigh more than 300 pounds, you qualify as disabled.

-- Homer Simpson
   King-Size Homer


pgpJbRMTpTqe6.pgp
Description: PGP signature


Re: [PHP] How to detect charset encoding with PHP and command line?

2007-04-17 Thread Davi
Em Terça 17 Abril 2007 18:18, William Lovaton escreveu:
 Any idea with this one?  please??

 El lun, 02-04-2007 a las 07:51 -0500, William Lovaton escribió:
  Hi there,
 
  I'd like to know a way to detect the file encoding from PHP and Linux
  command line too.
 
  In PHP I tried mb_detect_encoding() but it doesn't work reliable, first
  I have to specify a list of posible encodings and second it always
  returns the first encoding I put in the list no matter what.
 
  Thanks for your help,
 
 
  -William

You can use the file command:

[EMAIL PROTECTED] ~/documentos/txt $ file mac.txt
mac.txt: ASCII text
[EMAIL PROTECTED] ~/documentos/txt $ file noob.txt
noob.txt: UTF-8 Unicode text
[EMAIL PROTECTED] ~/documentos/txt $ file endereços.txt
endereços.txt: ASCII text
[EMAIL PROTECTED] ~/documentos/txt $ file coisas.txt
coisas.txt: UTF-8 Unicode English text



-- 
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--

Agora com fortune:
If you see an onion ring -- answer it!


pgpOz8zJQat5e.pgp
Description: PGP signature


Re: [PHP] location of the PHP executable

2007-04-12 Thread Davi
Em Quarta 11 Abril 2007 19:38, Buesching, Logan J escreveu:
   IF db not exists THEN
 locate -u
   END-IF

 I'd hate to see the time it'd take to create a first-time database...
 this could take awhile to run.


_maybe_ locate -u is faster than ls / -Rv... Need to test before said 
anything... =P

# df -h
Sist. Arq.Tam   Usad Disp  Uso% Montado em
/dev/hda3  18G   16G  473M  98% /
udev  506M  752K  506M   1% /dev
cachedir   18G   16G  473M  98% /lib/splash/cache
shm   506M 0  506M   0% /dev/shm
/dev/sda1 112G  112G  249M 100% /mnt/win2
/dev/sdb1 150G  132G   18G  89% /mnt/win3
/dev/hdb1  75G   37G   39G  49% /mnt/win1

maybe I test both here... XD

# time locate -u  time locate combate.php

real23m19.453s
user0m6.600s
sys 0m20.200s
/mnt/win1/Documents and Settings/Davi/Desktop/stellar/codigo/php/combate.php
/mnt/win1/Documents and Settings/Davi/Meus 
documentos/stellar/codigo/php/combate.php
/mnt/win3/backup 021106/Desktop/jogos/combate.php
/mnt/win3/backup 021106/Desktop/stellar/combate.php
/mnt/win3/backup 021106/Desktop/stellar/stellar/combate.php
/mnt/win3/backup 021106/Desktop/stellar/stellar/site/combate.php
/home/davi/stellar/codigo/php/combate.php

real0m1.680s
user0m0.520s
sys 0m0.060s


I'm trying to find anything using ls...

ls / -Rv | grep -iE combate.php$

But I can't retrieve the entire path yet... u.u'
But time seen to be the same...


Sorry poor english...

[]s

-- 
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--

Agora com fortune:
Never trust an operating system you don't have sources for.

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



Re: [PHP] location of the PHP executable

2007-04-11 Thread Davi
Em Quarta 11 Abril 2007 18:50, Jarrel Cobb escreveu:
 Don't you have to run locate -u first to generate the database before using
 locate?  You can't just assume a database exists already can you?


If you can use locate, you can use which... =P

BTW, do something to check OS then:

IF OS == *nix THEN
  IF exists /usr/bin/which THEN
which php
  ELSE
IF exists /usr/bin/locate THEN
  IF db not exists THEN
locate -u 
  END-IF
  locate php | grep -iE php$
ELSE
  IF exists /usr/bin/find THEN
find / -name php | grep -iE php$
  ELSE
 cd /  ls php -Rv
  END-IF
   END-IF
  END-IF
ELSE
  cd \
  dir php*.exe /s
END-IF


Check if I don't miss any END-IF... =P

[]s

-- 
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--

Agora com fortune:
rugged, adj.:
Too heavy to lift.

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



Re: [PHP] Oputting Forms Within a Class

2007-04-10 Thread Davi
Em Terça 10 Abril 2007 14:49, CK escreveu:
 Hi All,

 Experimenting with OOP PHP,please be gentle. Attempting to output a
 form within a class:

  From calculator.php:

 !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
 http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;
 html xmlns=http://www.w3.org/1999/xhtml;
 head
 meta http-equiv=Content-Type content=text/html; charset=UTF-8 /
 titleCalculator OOP PHP/title
 /head

 body
 ?php
 include class.calculator.php;

 ?
 /body
 /html


  From class.calculator.php:
 ?php
 class Calculator{
 //variable declaration
 //constuctor function
 function __construct(){//calls all methods
   $this-buildInt();
 }


 private function buildInt(){
 !--Script 10.1- calculator.php--

 form action=calculator.php method=post
   //Form elements omitted for brevity

 /form
   }
 }
 ?

 This is returned to the browser:

 Parse error: syntax error, unexpected '' in /Users/chris/Sites/php/
 oop/class.calculator.php on line 20

 What concept did I miss, if some online reference is available please
 pass along?

You can have a look at echo docs [1]. You'll found intersting things there... 
=]

What about:

 private function buildInt(){
echo MY_FORM
 !--Script 10.1- calculator.php--

 form action=calculator.php method=post
//Form elements omitted for brevity

 /form
MY_FORM;
   }


Enjoy!! =]



[1] - http://www.php.net/manual/en/function.echo.php


-- 
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--

Agora com fortune:
NOTICE:

-- THE ELEVATORS WILL BE OUT OF ORDER TODAY --

(The nearest working elevator is in the building across the street.)

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



Re: [PHP] Re: MySQL exceptions

2007-04-10 Thread Davi
Em Terça 10 Abril 2007 19:26, Richard Lynch escreveu:

 I don't think MySQL or even mysqli have any kind of exception throwing
 yet, if ever.

Googling a bit more, I think that MySQL already have some exceptions [1], the 
question, now, is: how to catch them with PHP? =]

I think that just using the exceptions name I can do that... So... Let's make 
some testes... =]


  i.e.: with if-then-else:
 
  $connect=mysql_connect(...);
 
  if($connect)
  {
  if(!(mysql_select_db(...,$connect)))
  {
  echo Impossible select db.;
  }
  }
  else
  {
  echo Impossible connect to server.;
  }

 If you didn't connect to the server, doing the select_db is rather
 pointless, so I'd check the $connect FIRST, and deal with that
 completely before trying to use a dead connection.

If I don't connect to server, I'll echo an error... Otherwise, I'll select 
DB...


 You don't put more money into the phone if the line is dead, do you?

 :-)
 :

 There is nothing you'd be able to get from a thrown exception that you
 can't get with mysql_errno() and vice versa, in theory.

Sure!
But with try-catch, I get some advantages [2]... It's a _big_ project... So, I 
_need_ OOP structure...


 In reality, it will probably be some time before every possile MySQL
 error code number (and they are legion) would be encapsulated as an
 Exception.

 So for maxiumu customization, short-term, mysql_errno() is probably
 the way to go.

 I often, for example, simply want to IGNORE mysql_errno($connection)
 == 1062 becaue it's just a duplicate key insert, and that means I've
 already dealt with whatever I was trying to insert, and just don't
 care.

 --


BTW, thanks a lot... =]


[1] - http://ehuss.org/mysql/api/mysql.exceptions-module.html
[2] - 
http://java.sun.com/docs/books/tutorial/essential/exceptions/advantages.html

-- 
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--

Agora com fortune:
You know you're using the computer too much when:
when your life becomes routine enough to write a script to do it for you.
-- smonijhay1

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



Re: [PHP] keeping credit card info in session

2007-04-09 Thread Davi
Em Segunda 09 Abril 2007 01:12, [EMAIL PROTECTED] escreveu:
 Thanks a lot every one. These are great replies.

You're welcome! ^^


 I guess I should have explained a bit more about what I'm doing.

 first of all, this is not my site, it's for a client of mine.

Things going to be better... =]


 second, I did suggest using a paypal API or a paid site to take care of
 this, but my client said no. She has a credit card processing account and
 how she works with it right now, is that interested users email her, she
 calls them, gets their credit card info and charges their card manually
 without the card present.

Ops... But... You can't solve death... All other you *can* do anything... =]


 so, this is not really my problem, it's what she's been doing before and
 wants to continue doing. All she asked me to do is that as part of the form
 that people send their requests through, now she wants their credit card
 info as well. So that she doesn't have to call them.

 And the reason I'm keeping cc info in the session for a few steps, is to
 take them to confirmation page, and then the reciept page. and after wards,
 I want to keep it in there untill the client logs in to the admin page and
 sees new requests, charges them and then deletes them for ever.

 So now I've got two different responses, some people say do it, but use
 encryption/decryption methods, and some people say don't do it. But if I
 don't do it, that means I tell my client that I can't do it and I lose the
 job.

Well... Last month I configured a mail server... Or I must say: a SPAM server?
But it's illegal!!!
Yes... I known... But it was my job... If I don't do it, I would lose money 
and... Another do that!!!

Simple: do a license agreement that isents you about *any* legal implication 
about the PHP solution... And use the max security you can and charge for 
security updates!! =P

It's what *I* would do, at least...

 Thanks again,
 Siavash


Well... Sorry my poor english and let me known if you don't understand 
*anything*...


-- 
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--

Agora com fortune:
   During a visit to America, Winston Churchill was invited to a buffet
luncheon at which cold fried chicken was served.  Returning for a second
helping, he asked politely, May I have some breast?
Mr. Churchill, replied the hostess, in this country we ask for
white meat or dark meat.  Churchill apologized profusely.
The following morning, the lady received a magnificent orchid from
her guest of honor.  The accompanying card read: I would be most obliged if
you would pin this on your white meat.

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



Re: [PHP] Session Authentication

2007-04-09 Thread Davi
Em Segunda 09 Abril 2007 10:04, Stut escreveu:
 Ólafur Waage wrote:
  Lets say i have a login system. This system authenticates the user via
  mysql, when the user is authenticated, i set a session variable to let
  the system know the user is authenticated. ie. $_SESSION[authenticated]
  = true;
 
  Lets also say i know that's how the system works, that a session variable
  within my browser is set to true. Could i do this if i knew all this info
  and authenticate myself by setting the variable from the client side?
 
  If it is possible, what can i do to prevent this or increase security?

 No. You're teminology indicates a major lack of understanding regarding
 how sessions work. Session variables are not within [your] browser.
 The only thing stored in the browser (usually as a cookie) is the
 session ID. The contents of the session are stored on the server.

 So, given that, the answer to your question is... not unless your code
 is exploitable to allow the user to arbitratily set session variables.

 -Stut

Sessions are stored in the temporary's server folder... So... If I known my 
session ID and where it's stored, I can do something...

-- 
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--

Agora com fortune:
Welcome to alt.os.linux.slackwre. We hope you will enjoy your stay.
Your answer is here: URL:http://www.catb.org/~esr/faqs/smart-questions.html 
 -- Faux Pseudo

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



Re: [PHP] Session Authentication

2007-04-09 Thread Davi
Em Segunda 09 Abril 2007 12:37, Tijnema ! escreveu:
 On 4/9/07, Martin Marques martin@bugs.unl.edu.ar wrote:
  Tijnema ! escribió:
   On 4/9/07, Martin Marques martin@bugs.unl.edu.ar wrote:
   Yes:
  
   Don't use transparent session id, or even better, save the
   authentication in a cookie on the client (seperated from the session
   array).
  
   And then the user would crack the cookie 
   I know they are encrypted, but trust me, cookies can be edited.
 
  So what? The user authenticated himself, so what is he gonna crack?

 Yes, but i guess you're not only storing if the user has
 authenticated, also storing a username?

 And if that's not the case, then you could authenticate by creating a
 cookie where it says authenticated = yes, and you're authenticated...

 Tijnema

... and we get a security crater... =]


-- 
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--

Agora com fortune:
Crito, I owe a cock to Asclepius; will you remember to pay the debt?
-- Socrates' last words

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



Re: [PHP] Session Authentication

2007-04-09 Thread Davi
Em Segunda 09 Abril 2007 13:05, Robert Cummings escreveu:
 (...) Hasn't anyone here had a boring
 day (yeears ago) when they created an auto vote bot for some stupid
 poll? :B

I never do this!!! =P
But I changed a cookie of an browser game XD



-- 
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--

Agora com fortune:
Scintillation is not always identification for an auric substance.

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



Re: [PHP] Session Authentication

2007-04-09 Thread Davi
Em Segunda 09 Abril 2007 13:47, Martin Marques escreveu:
 Davi escribió:
  Sessions are stored in the temporary's server folder... So... If I known
  my session ID and where it's stored, I can do something...

 Have you tried it? I mean, as a non-root, non-apache user. :-P


No. And I known that is _impossible_... But... Don't expect it... ;-)



-- 
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--

Agora com fortune:
Asshole I'm talking to you.

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



Re: [PHP] mysql if empty

2007-04-09 Thread Davi
Em Segunda 09 Abril 2007 18:27, Lori Lay escreveu:
 [EMAIL PROTECTED] wrote:
  If I search for something in mysql that returns an empty result I cant
  get it to return
  No result found always returns Found even though the recoed does
  not exist...
 
 
  $sql = SELECT Client FROM booked WHERE Name = 'larry';
 
  $result = mysql_query($sql);
 
  if ($result == )
  {
  echo No result found;
  }
  echo Found;

 Use isset.

 if (!isset($result)) {
 echo No result found;
 }...

 Lori

$result is set ($result = mysql_query($query))...
compare to 0 is satisfatory:

$result=mysql_query($query)
$results=mysql_num_rows($result)

if($results==0)
{
echo no result found;
}
elseif($results0)
{
echo Some error? .mysql_error();
}
else
{
//your code here
}


-- 
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--

Agora com fortune:
   I imagine bugs and girls have a dim perception that nature played a cruel
trick on them, but they lack the intelligence to really comprehend the
magnitude of it.  -- Calvin

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



[PHP] MySQL exceptions

2007-04-09 Thread Davi

Hi all!

I'm developing an OOP app using PHP 5.
I want to use try-catch with mysql functions.

So, the question is: what are the exceptions classes of MySQL?
Where can I found it?

TIA


-- 
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--

Agora com fortune:
BOFH Excuse #426:

internet is needed to catch the etherbunny

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



Re: [PHP] Re: MySQL exceptions

2007-04-09 Thread Davi
Em Segunda 09 Abril 2007 21:21, itoctopus escreveu:
 Use the @ in front of the statement and then check the result if it's
 valid.

 --
 itoctopus - http://www.itoctopus.com


I already use it, but I believe that try-catch would be _more_ useful...
With try-cath I can _get_ more errors instead with a if-then-else clasule...

i.e.: with if-then-else:

$connect=mysql_connect(...);

if($connect)
{
if(!(mysql_select_db(...,$connect)))
{
echo Impossible select db.;
}
}
else
{
echo Impossible connect to server.;
}

If I want to get some debug info, I put some mysql_error() and I get the error 
string and error code (mysql_errno()), but I believe that with exception I 
can get some useful error message without... hum... *critical* infos...

try
{
$connect=mysql_connect(...);
mysql_select_db(...,$connect);
}
catch (CONNECTION_EXCEPTION $e)
{
echo Impossible connect: .$e-get_message();
}
catch (SELECT_EXCEPTION $e)
{
echo Impossible select db: .$e-get_message();
}
catch (ANOTHER_USEFUL_EXCEPTION $e)
{
echo another error: .$e-get_message();
}
catch (Exception $e)
{
echo Unknown error: .$e-get_message();
}


I'm right?

TIA


-- 
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--

Agora com fortune:
Stanford women are responsible for the success of many Stanford men:
they give them just one more reason to stay in and study every night.

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



Re: [PHP] Question on Portfoilo's

2007-04-09 Thread Davi
Em Segunda 09 Abril 2007 22:36, Larry Garfield escreveu:
 This is why one should work on an open source project.  Much easier to show
 off legally. :-)


You can't live for and from only open source projects...

_I_ develop web sites and show them to my clients... Well... I'm an 
empoyler... =p

What about you develop your personal web log?
Later, you can develop your own personal calendar, to schelude that importante 
meeting...
And going to make your own portfoilo... =]



-- 
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--

Agora com fortune:
Al, there are plenty of good people in this newsgroup, and I would go
so far as to count myself among them.  Take a moment to really ponder
why they don't come to your defence ...  No, I meant REALLY ponder ...
From: Sylvain Robitaille

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



Re: [PHP] keeping credit card info in session

2007-04-08 Thread Davi
Em Domingo 08 Abril 2007 15:26, [EMAIL PROTECTED] escreveu:
 Hi All,

 I've got quite a bit or php experience, but I've never had to deal with
 credit card info before. Now for a property rental site, I'm adding a way
 for users to be able to fill out a form which also has some credit card
 info in it.

 After they submit the form, there are a couple of more steps and to pass
 credit card info to the last page, I'm storing all the info in my session.
 Now, I did go and bought an SSL certificate, so the booking section of the
 site is on SSL (https). I'm just wondering if this is secure enough. as far
 as I know, SSL means connection to server is secured, so session variables
 should be secured too. no?

 Also after I get credit card info, I'm storing them in a mysql table until
 an admin would log in to the site, see new reservations, charge them
 manually and contact the customer, and then that entry will be removed from
 my database for ever. Is this ok? or is it a really bad idea? originally
 the plan was to send an email to the admin with credit card info, but then
 I realized that emails are very unsecure. so I decided to keep the info on
 the SSL section of the site.

 just because I'm dealing with credit cards, I'm so afraid of doing anything
 now. Any suggestions? or perhaps any links to how to make it all more
 secure?

 Thanks a lot in advance,
 Siavash

Just one thing: how about cript the DB data with base64 or anything else?
Some PGP key... Whatever...

JMO...

BTW, I liked your solution (store in DB)... I would use it...

[]s


-- 
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--

Agora com fortune:
If a nation values anything more than freedom, it will lose its freedom;
and the irony of it is that if it is comfort or money it values more, it
will lose that, too.
-- W. Somerset Maugham

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



Re: [PHP] keeping credit card info in session

2007-04-08 Thread Davi
Em Domingo 08 Abril 2007 18:37, Jochem Maas escreveu:
 unless you are a payment gateway or a bank don't touch credit card numbers.
 there are plenty of threads in the archive of this list that give good
 reasons not to e.g. being sued out of existence.

 get a payment provider and let them handle the transaction automatically,
 the site admin could be given a system whereby he/she can fire off email to
 customers that give them a url to (and instruct them to) complete a
 payment at your choose payment provider if a manual check needs to occur
 before a payment is initiated.

 storing CC numbers on your machine is rather like walking around carrying
 hot coals ... sooner or later you will be burned.


So... What about PayPal or another similar service?? =]

Here, on Brazil, I'm using PayPal [1] and F2B [2].

It's better than assume the riscs... =]

[]s

[1] - www.paypal.com
[2] - www.f2b.com.br

-- 
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--

Agora com fortune:
FORTUNE'S RANDOM QUOTES FROM MATCH GAME 75, NO. 1:

 Gene Rayburn: We'd like to close with a thought for the day, friends ---
   something ...

  Someone: (interrupting) Uh-oh
 
 Gene Rayburn: ...pithy, full of wisdom --- and we call on the Poet
   Laureate, Lipsy Russell

Lipsy Russell: The young people are very different today, and there is
   one sure way to know: Kids to use to ask where they came
   from, now they'll tell you where you can go.

  All: (laughter)

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



Re: [PHP] keeping credit card info in session

2007-04-08 Thread Davi
Em Domingo 08 Abril 2007 18:54, Jochem Maas escreveu:
  So... What about PayPal or another similar service?? =]

 well:

 a, your not paypal or F2B.
 b, they are both payment providers.


Sorry... I didn't understand! =x

[]s

-- 
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--

Agora com fortune:
/*
 *   Should be panic but... (Why are BSD people panic obsessed ??)
 */
linux-2.0.38/net/ipv4/ip_fw.c

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



Re: [PHP] storing functions

2007-04-04 Thread Davi
Em Quarta 04 Abril 2007 10:19, Ross escreveu:
 I am wondering how you store and recall your functions.

 I have an external file - functions.php, this includes all the functions
 for the site. It is included in the pages head and then I just use the
 functions when I need them.

 Does anyone have a better way to store/recall functions?

 R.

For my projects, I'm using OOP... =]
But if your projects are just contact forms, you don't need OOP.

I believe that just split your files is a good way! =]

[]s

-- 
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--

Agora com fortune:
Fortune finishes the great quotations, #6

But, soft!  What light through yonder window breaks?
It's nothing, honey.  Go back to sleep.

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



Re: [PHP] Ide help needed

2007-04-01 Thread Davi
Em Sexta 30 Março 2007 14:39, [EMAIL PROTECTED] escreveu:
 I am a beginer with php and i need to know which IDE is best suited
 under windows and linux both

 i have seen dreamweaver working and have heard about GoLive too but don't
 know whichone to go for

 can you please help me decide
 and also
 tell me some other IDE's if possible

Does anyone knows any IDE for PHP like VisualStudio.net?

TIA

-- 
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--

Agora com fortune:
Beneath this stone lies Murphy,
They buried him today,
He lived the life of Riley,
While Riley was away.

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



Re: [PHP] simple page not found 404 script - PHP

2007-03-30 Thread Davi
Em Sexta 30 Março 2007 13:17, Dwayne Heronimo escreveu:
 where getting there .. now i have this.. but now it will only show the 404
 page. I think somehow that the firstpart is not working? the include part?
 http://arubaguide.org/arubaguide/categories.php?catcode=activities


 ?php require_once('../Connections/arubaguide.php'); ?

 ?php

 $cat_item = $_GET['catcode'];
  if(file_exists($cat_item)) {
   include $cat_item;
  }
   else {
   include 404.php;
   exit;
 }


include exploit:

arq_inc.htm:

script
window.location=www.mypage.com;
/script

then:

www.yourpage.com/script.php?catcode=http://www.mypage.com/arc_inc.htm


o/


-- 
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--

Agora com fortune:
The government is not the surplus's money, Vice President.

George W. Bush
November 5, 2000
From The Washington Post.

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



Re: [PHP] simple page not found 404 script - PHP

2007-03-30 Thread Davi
Em Sexta 30 Março 2007 13:42, Dwayne Heronimo escreveu:
 Yes but this file does not exist. It is just to use for my queries. so I
 think I cannot use the file_exists function. Which other function I would
 use to do this?
 I already have setup the .htaccess file to point also to a 404 page. but
 this works only if the URL is totally wrong. like www.arubaguide.org/blabla
 but not www.arubaguide.org/categories.php?catcode=blabla



Try something like that:

?php

define(HTML,html/);

define(INC,inc/);

$ext = array (php,html,htm);

$exists = false;

foreach($ext as $file_ext) {

if ( file_exists ( HTML.$_GET[catcode]...$file_ext ) )
{
$exists = true;
break;
}
}

if ( ! ( $exists ) ){
include ( 404.php );
}
else {
include ( HTML.$_GET[catcode]...$file_ext );
}

?


-- 
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--

Agora com fortune:
[Peter and his friends have formed a rock band and are performing at a 
prison] 
Peter Griffin:  [shouting into microphone] Hello, Cleveland! 
Cleveland:  Hello, Peter. 
Quagmire:  [clapping drum sticks together] One, two, three, *four*! 
Peter Griffin:  [small amount of time passes] Oh, my God. We don't know any 
songs. [prisoners get mad] 

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



Re: [PHP] simple page not found 404 script - PHP

2007-03-30 Thread Davi
Em Sexta 30 Março 2007 14:01, Dwayne Heronimo escreveu:
 wierd.. your code is behaving exactly the same as mine did.
 it will display the error and the page.. but both at the same time :S

 it is working but somehow it continues to execute.

 http://arubaguide.org/arubaguide/categories.php?catcode=art

 http://arubaguide.org/arubaguide/categories.php?catcode=blabla


Well... Check some typing issue... =P
This code is working for me... =]

http://www.turbineseusite.com.br/index.php?cat=contate-nos
http://www.turbineseusite.com.br/index.php?cat=blablabla

[]s


-- 
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--

Agora com fortune:
It's not just a computer -- it's your ass.
-- Cal Keegan

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



Re: [PHP] Ide help needed

2007-03-30 Thread Davi
Em Sexta 30 Março 2007 14:39, [EMAIL PROTECTED] escreveu:
 I am a beginer with php and i need to know which IDE is best suited
 under windows and linux both

 i have seen dreamweaver working and have heard about GoLive too but don't
 know whichone to go for

 can you please help me decide
 and also
 tell me some other IDE's if possible

Zend Studio.

http://www.zend.com

[]s

-- 
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--

Agora com fortune:
I did this 'cause Linux gives me a woody.  It doesn't generate revenue.
-- Dave '-ddt-` Taylor, announcing DOOM for Linux

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



Re: [PHP] simple page not found 404 script - PHP

2007-03-30 Thread Davi
Em Sexta 30 Março 2007 14:35, Dwayne Heronimo escreveu:
 I have included some code but have to do it a little different because if
 the query construct. but this shows only the 404. is this correct?

 ?php
 if (!function_exists(GetSQLValueString)) {
 function GetSQLValueString($theValue, $theType, $theDefinedValue = ,
 $theNotDefinedValue = )
 {
   $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

   $theValue = function_exists(mysql_real_escape_string) ?
 mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

   switch ($theType) {
 case text:
   $theValue = ($theValue != ) ? ' . $theValue . ' : NULL;
   break;
 case long:
 case int:
   $theValue = ($theValue != ) ? intval($theValue) : NULL;
   break;
 case double:
   $theValue = ($theValue != ) ? ' . doubleval($theValue) . ' :
 NULL;
   break;
 case date:
   $theValue = ($theValue != ) ? ' . $theValue . ' : NULL;
   break;
 case defined:
   $theValue = ($theValue != ) ? $theDefinedValue :
 $theNotDefinedValue;
   break;
   }
   return $theValue;
 }
 }

 $colname_show_cat = -1;
 if (isset($_GET['catcode'])) {
   $colname_show_cat = (get_magic_quotes_gpc()) ? $_GET['catcode'] :
 addslashes($_GET['catcode']);
 }
 mysql_select_db($database_arubaguide, $arubaguide);
 $query_show_cat = sprintf(SELECT id, catcode, category_name, name, text,
 slogan, main_img FROM items WHERE catcode = %s ORDER BY name ASC,
 GetSQLValueString($colname_show_cat, text));
 $show_cat = mysql_query($query_show_cat, $arubaguide) or
 die(mysql_error()); $row_show_cat = mysql_fetch_assoc($show_cat);
 $totalRows_show_cat = mysql_num_rows($show_cat);

 $found_catcode = $show_cat['catcode'];

 if(!$found_catcode) {
 include('404.php');
 exit;
 }

 ?



Try
$found_catcode=$row_show_cat['catdode'];

instead

$found_catcode = $show_cat['catcode'];


-- 
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--

Agora com fortune:

Marge:  You will not be getting a tattoo for Christmas.

Homer:  Yeah.  If you want one, you'll have to pay for it out of your
own allowance.

   Simpsons Roasting on an Open Fire

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



Re: [PHP] simple page not found 404 script - PHP

2007-03-30 Thread Davi
My mistake:

 Try
 $found_catcode=$row_show_cat['catcode'];

-- 
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--

Agora com fortune:
Thus mathematics may be defined as the subject in which we never know
what we are talking about, nor whether what we are saying is true.
-- Bertrand Russell

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



Re: [PHP] Parse error help.., thanks..

2007-03-30 Thread Davi
Em Sexta 30 Março 2007 18:55, Ian escreveu:
 Parse error: syntax error, unexpected ';' in
 /hxxx/x/domains/x.com/public_html/blog/labels.php on line 15

 ul class=labels
 ?php
1 define('PREFIX', 'http://.x.com/labels');
2 
define('SEARCH_DIR','//x/domains/x.com/public_html/blog/labels');
3 define('THIS_FILE', 'cloud.php');
4 if(file_exists(SEARCH_DIR.'_cloud_include_cache.html') 
5 filemtime(SEARCH_DIR.'_cloud_include_cache.html')(time()-(60*60)))
6 echo file_get_contents(SEARCH_DIR.'_cloud_include_cache.html');
7 else
8 {
9 $output = '';
10 $files = array();
11 $dir = opendir(SEARCH_DIR);
12 while($file = readdir($dir))
13 if($file != '.'  $file != '..'  $file != THIS_FILE
14 amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;am
15 p;amp;amp; $file != CACHE_FILE)
16 {
17 $files[] = $file;
18 }

Try remove the amp;s...

[]s


-- 
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--

Agora com fortune:
Toothpaste never hurts the taste of good scotch.

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



[PHP] PHP Upgrade: 5 or 6

2007-03-28 Thread Davi

Hi all.

I've reading on some sites [1,2] that PHP 6 is comming soon...

What should I do?
Migrate my server and apps to PHP 5 now and, later to PHP 6, or wait some more 
time and migrate all to PHP 6?

TIA

-- 
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--

Agora com fortune:
The main thing is the play itself.  I swear that greed for money has nothing
to do with it, although heaven knows I am sorely in need of money.
- Feodor Dostoyevsky

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



Re: [PHP] PHP Session variable

2007-03-27 Thread Davi
Em Terça 27 Março 2007 11:17, Chris Carter escreveu:
 Hi,

 I have retrieved 4 values from database. Out of which 3 are displayed on
 the same page and one variable, which is email address, needs to be carried
 to the next page through a hyper link, the next page is actually a web
 form. I can do this by either transferring that variable through query
 string or through session.

 Now the next page which is a web form is connected to a file that sends
 email using php email functionality.

 The problem I am having is just sending this $email variable from page one
 to the web form. Once it reaches the web form, I need to again pass it to
 the file that has php email functionality. How to send the variable across
 these pages.

 I tried:
 On Page 1:

 ?
 $query=SELECT val1, val2, val3, email FROM table WHERE no= '$no';

 $result=mysql_query($query);
 $num=mysql_numrows($result);

 mysql_close();
 $1=mysql_result($result,$i,1);
 $2=mysql_result($result,$i,2);
 $3=mysql_result($result,$i,3);
 $email=mysql_result($result,$i,email);
 session_start();
 session_register (tamma);
 $HTTP_SESSION_VARS [tamma] = $email;
 ?



 On the webform:

 ?
   $HTTP_SESSION_VARS [email] = $email;

 ?


 on the php email page it's like this:

 ?
   $name = $_REQUEST['name'] ;
   $emailid = $_REQUEST['emailid'] ;
   $subject = $_REQUEST['subject'] ;
   $message = $_REQUEST['message'] ;
   $email = $_REQUEST['email'] ;

   mail( $email, $name, $message, From: $emailid );
   header( Location: thankYouContact.php );
 ?


 Please advice a work around for this if I am doing it wrong. I know I am.

 Chris
 --
 View this message in context:
 http://www.nabble.com/PHP-Session-variable-tf3473378.html#a9693267 Sent
 from the PHP - General mailing list archive at Nabble.com.

I would try $_SESSION, $_GET and $_POST instead $_HTTP_SESSION_VARS and 
$_REQUEST...

best regards,

-- 
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--

Agora com fortune:
A young girl once committed suicide because her mother refused her a new
bonnet.  Coroner's verdict: Death from excessive spunk.
-- Sacramento Daily Union, September 13, 1860

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



Re: [PHP] POST + QUERY

2007-03-27 Thread Davi
Em Terça 27 Março 2007 17:02, Dave Goodchild escreveu:
 use: $_POST['max_id'] ==

 or even better:

 if (empty($_POST['max_id']))

Why not:

if (!(isset($_POST[max_id)))

?

-- 
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--

Agora com fortune:
Around computers it is difficult to find the correct unit of time to
measure progress.  Some cathedrals took a century to complete.  Can you
imagine the grandeur and scope of a program that would take as long?
-- Epigrams in Programming, ACM SIGPLAN Sept. 1982

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



Re: [PHP] Language detection with PHP

2007-03-27 Thread Davi
Em Terça 27 Março 2007 17:33, Zoltán Németh escreveu:
 2007. 03. 27, kedd keltezéssel 15.06-kor William Lovaton ezt írta:
  Hi there,
 
  I am trying to implement language detection with PHP for a web site I am
  trying to build.  The idea is to take a piece of text and try to guess
  the language it is written in.
 
  I have two options but I'd like to know if you guys have a better idea.
 
  1) I implemented a detector using spell checking, so if I run the text
  through many spell checkers the one with less errors is probably the
  right language for that text.  It works quite well and I am pleased with
  it.  The only thing I don't like is that loading many spell checkers is
  a bit of a waste, it may require a lot of CPU and a lot of memory
  depending on the dictionary and the number of dictionaries you load.
  Besides, it adds one extra module dependency (pspell).
 
  2) The other option is implemented in PEAR and it's called
  Text_LanguageDetect:
  [] http://pear.php.net/package/Text_LanguageDetect
 
  It seems to use a very different technique called N-Gram-Based Text
  Categorization, I haven't tested it yet but I will very soon and see how
  good it works, it says it's in alpha state but I guess it doesn't
  requiere pspell, doesn't consume a lot of memory and it should be fast.
  The only thing I am worried about is how accurate is it... I'll check
  soon and post my comments later.
 
  3) Insert a very good idea here, please
 
  I'd really like to hear what different alternatives all of you have for
  this problem.

 I've definitely no experience with this problem, just guessing ;)

 what if you build some arrays of language specific stuff and check for
 that. I mean you could store stuff like if it contains 's, 've, 'm many
 times it's probably english... I don't really know how to store those
 rules, and I'm not sure they are good enough (or are there good enough
 rules) to tell several languages apart...

 greets
 Zoltán Németh

  Thanks a lot,
 
 
  -William

Good tip!! =]

Portuguese-Brazilian: ç, ã, õ, á, é, í, ó, ú, à, è, ì, ò, ù, ü

-- 
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--

Agora com fortune:
Take a lesson from the whale; the only time he gets speared is when he
raises to spout.

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



Re: [PHP] POST + QUERY

2007-03-27 Thread Davi
Em Terça 27 Março 2007 17:40, Dan Shirah escreveu:
 I have echoed something out after virtually every line of code :)

 When I echo out my result ($result_info) it returns Resource id#2
 When I echo out my row ($row_info) it returns Array

 When I try to echo out a field from my array($my_info) it returns nothing
 at all.


How about:

print_r($row_info);

??


-- 
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--

Agora com fortune:
agaffney I want to be so bleeding edge that I cut myself!
robbat2 agaffney, no, that's just emo
agaffney Gentoo is emo :P

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



Re: [PHP] POST + QUERY

2007-03-27 Thread Davi

Have you tried use number instead name?

Something like:

echo $row_info[0];

On mysql, you've mysql_fetch_object... Does has anything like this on MS Sql 
Server?

best regards...

Em Terça 27 Março 2007 18:17, Dan Shirah escreveu:
 echo $row_info['first_name']; returns nothing.

 However I have verified the correct spelling both in the database and in
 the PHP code and they are identical and when I print_r it shows that there
 is a value in the first_name column of the record.

 On 3/27/07, Zoltán Németh [EMAIL PROTECTED] wrote:
  2007. 03. 27, kedd keltezéssel 16.56-kor Dan Shirah ezt írta:
   Sorry, had a typo.
  
   *$cc_first = $row_info['first_name'];
   echo $cc_first;*
this echo returns nothing.
 
  and what does
  echo $row_info['first_name'];
  print out?
 
  if still nothing, then probably
  1) you misspelled the field name and it's not called first_name
  2) the field first_name is empty in the row
 
  greets
  Zoltán Németh
 
   On 3/27/07, Dan Shirah [EMAIL PROTECTED] wrote:
print_r($row_info) display the entire column contents of the select
id
   
However,
   
*$first = $row_info['first_name'];
echo $cc_first;*
   
the above echo still returns nothing.
   
On 3/27/07, Davi [EMAIL PROTECTED] wrote:
 Em Terça 27 Março 2007 17:40, Dan Shirah escreveu:
  I have echoed something out after virtually every line of code :)
 
  When I echo out my result ($result_info) it returns Resource id#2
  When I echo out my row ($row_info) it returns Array
 
  When I try to echo out a field from my array($my_info) it returns

 nothing

  at all.

 How about:

 print_r($row_info);

 ??


 --
 Davi Vidal
 [EMAIL PROTECTED]
 [EMAIL PROTECTED]
 --

 Agora com fortune:
 agaffney I want to be so bleeding edge that I cut myself!
 robbat2 agaffney, no, that's just emo
 agaffney Gentoo is emo :P

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

-- 
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--

Agora com fortune:
[during a fishing trip] 
Peter Griffin:  Man, some trip this turned out to be. All we caught is a tire, 
a boot, a tin can and this book of clich�s.

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



Re: [PHP] POST + QUERY

2007-03-27 Thread Davi

I would try an
echo $my_info[7];

[]s


Em Terça 27 Março 2007 18:28, Dan Shirah escreveu:
 Here are the results of my print_r

 Array ( [0] = 121 [1] = Y [2] = DS [3] =  [4] = {03}
 [5] = 500 [6] = *** *[7] = John* [8] = Mark [9] = Doe [10] = 123 My
 Way [11] = 456 Your Place [12] = Smithville [13] = 12345 [14] = 5432
 [15] = 123555 [16] = 1235550011 [17] = [EMAIL PROTECTED] [18] = Y 
 [19] =
 These are the comments [20] = Mar 27 2007 5:26PM [21] = Dan Create [22]
 = Mar 27 2007 5:26PM [23] = Dan Research [24] = Mar 27 2007 5:26PM [25]
 = Dan Submit [26] = C [27] = TN )

 Bold and in red is the first_name column result.

 On 3/27/07, Brad Bonkoski [EMAIL PROTECTED] wrote:
  Send us the output of print_r($row_info)
  feel free to mask out any data values you may wish.
 
  Dan Shirah wrote:
   echo $row_info['first_name']; returns nothing.
  
   However I have verified the correct spelling both in the database and
   in the
   PHP code and they are identical and when I print_r it shows that there
   is a
   value in the first_name column of the record.
  
   On 3/27/07, Zoltán Németh [EMAIL PROTECTED] wrote:
   2007. 03. 27, kedd keltezéssel 16.56-kor Dan Shirah ezt írta:
Sorry, had a typo.
   
*$cc_first = $row_info['first_name'];
echo $cc_first;*
 this echo returns nothing.
  
   and what does
   echo $row_info['first_name'];
   print out?
  
   if still nothing, then probably
   1) you misspelled the field name and it's not called first_name
   2) the field first_name is empty in the row
  
   greets
   Zoltán Németh
  
On 3/27/07, Dan Shirah [EMAIL PROTECTED] wrote:
 print_r($row_info) display the entire column contents of the
  
   select id
  
 However,

 *$first = $row_info['first_name'];
 echo $cc_first;*

 the above echo still returns nothing.

 On 3/27/07, Davi [EMAIL PROTECTED] wrote:
  Em Terça 27 Março 2007 17:40, Dan Shirah escreveu:
   I have echoed something out after virtually every line of
  
   code :)
  
   When I echo out my result ($result_info) it returns Resource
  
   id#2
  
   When I echo out my row ($row_info) it returns Array
  
   When I try to echo out a field from my array($my_info) it
  
   returns
  
  nothing
 
   at all.
 
  How about:
 
  print_r($row_info);
 
  ??
 
 
  --
  Davi Vidal
  [EMAIL PROTECTED]
  [EMAIL PROTECTED]
  --
 
  Agora com fortune:
  agaffney I want to be so bleeding edge that I cut myself!
  robbat2 agaffney, no, that's just emo
  agaffney Gentoo is emo :P
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php

-- 
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--

Agora com fortune:
Unless hours were cups of sack, and minutes capons, and clocks the tongues
of bawds, and dials the signs of leaping houses, and the blessed sun himself
a fair, hot wench in flame-colored taffeta, I see no reason why thou shouldst
be so superfluous to demand the time of the day.  I wasted time and now doth
time waste me.
-- William Shakespeare

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



[PHP] INFORMIX (PLEASE)

2003-08-18 Thread Davi José Faria Costa
Hello Everybody, 
I wait that somebody can help me, therefore already I depleted my possibilities. 
I need to develop a site in PHP with access to the Data base Informix. 
The such of the data base alone functions with NTFS (W2k, WNT). 
I installed the W2K Advanced Server in my house... and installed INFORMIX IDS 7.31. 
Now the problems start. 
 
IN THE INFORMIX 
- It does not obtain to initiate a ISM. service. (Informix Storage Manager). 
I do not know if this influences in some thing. 
 
- When time to create a new DATABASE... it is in the RUNNING... message and stops
 Now it becomes a big problem! What´s happening? 
 
- Good... for creating database I was not obtaining success... but.. in databases that 
already 
they were created I obtained to make select, etc.. (this in the DBACCESS). 
So..I asked myself: If I to obtain to connect to this database and to create a table 
inside already the created database
, could help me.. Correct? Theoretically yes. however in the time that I go to create 
database comes the message of the RUNNING...
and again.. freezee in this message.
 
IN THE PHP 
- Exactly that the bank does not make nothing. I tried to make the connection for the 
PHP. 
We have 2 ways: 
a) Functions IFX of php I take off the commentary of line EXTENSIONS in the PHP.ini 
where I meet DLL PHP_IFX.DLL. 
The DLL is exactly in the way that I passed, however gets an error (unable you load 
dynamic library) 
Piece o cake ah? 
Obs. I also have client in the INFORMIX installed certinho in mine máquinha. 
 
b) ODBC In the time that I thought about these solutions I had the certainty that my 
problems would go to finish. 
I was missed again..(smiles)
 i have create the ODBC correct and such. I called the function connection to the ODBC 
passing the DSN, USER, PASSWORD. 
And i got an error message. 
Warning: Error SQL: [ Informix][Odbc Informix Driver]Unable you load translation DLL, 
SQL state IM009 in SQLConnect in 
d:\inetpub\wwwroot\teste.php on line 3 
Now... my possibilities if had depleted... 
I do not know more what to make this to function... 
Somebody please, help me. 
 
My environment is the following one: 
- COMPUTER K6-2 500 
- HD 10GB, MEM RAM 64 MB 
- WINDOWS 2000 ADVANCED SERVER 
- INFORMIX NT 7.31 
 
Thanks!
 
Davi Costa