Re: [PHP] $_POST value disappearing?

2011-08-02 Thread Jônatas Zechim
Hi..

You need to use $_FILES (
http://php.net/manual/pt_BR/reserved.variables.files.php)

Regards,

Jônatas Zechim
PHP  jQuery specialist

http://zechim.com
mob +55 11 7053 2239
skype ID zechim


On 2 August 2011 12:04, Donovan Brooke li...@euca.us wrote:

 Hello!,

 I must not be understanding something as I would expect 'f_file'
 to show up in the print_r below.:

 ---form--
 form action=index.php method=post enctype=multipart/form-data
  input type=hidden name=f_ap value=upload /
  input type=hidden name=f_action value=doit /
  input type=file  name=f_file /
  input type=submit value=Upload /
 /form
 ---endform--

 --index.php--
 ?php print_r($_POST); ?
 --/index.php--




 The result I get is:
 
 Array
 (
[f_ap] = upload
[f_action] = doit
 )
 ---

 Can someone enlighten me?

 Thanks,
 Donovan


 --
 D Brooke

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




RES: [PHP] PHP live chat

2009-12-15 Thread Jônatas Zechim
http://www.livezilla.net/

-Mensagem original-
De: Angelo Zanetti [mailto:ang...@zlogic.co.za] 
Enviada em: terça-feira, 15 de dezembro de 2009 09:59
Para: 'Ghodmode'; php-general@lists.php.net
Assunto: RE: [PHP] PHP live chat



-Original Message-
From: Ghodmode [mailto:ghodm...@ghodmode.com] 
Sent: 15 December 2009 09:41 AM
To: php-general@lists.php.net
Subject: Re: [PHP] PHP live chat

I've played around with CraftySyntax LiveHelp, but I haven't deployed it 
in a production environment.  It definitely looks like it's worth a try, 
though.

http://www.craftysyntax.com/



thanks Ghomode, I will have a look at it now.

Regards
Angelo

http://www.elemental.co.za
http://www.wapit.co.za




On 14/12/09 21:14, Angelo Zanetti wrote:
 Hi all,
 I know there are a lot of scripts that one can pay for, for live chat -
 website support.

 Are there are any free open source ones that work well?

 I found: www.phplivechat.com

 But still waiting to evaluate it.

 Please send you comments, good or bad and what you would recommend or not
 recommend and why

 Thanks in advance.

 Angelo


 http://www.wapit.co.za
 http://www.elemental.co.za


-- 
*Vince Aggrippino*
a.k.a. Ghodmode
www.ghodmode.com http://www.ghodmode.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] Extract links from strings

2009-09-21 Thread Jônatas Zechim
Hi there, i've the following strings:

$string1 = 'Lorem ipsum dolor http://site.com sit amet';
$string2 = 'Lorem ipsum dolor http://www.site.com/ sit amet';
$string3 = 'Lorem ipsum dolor http://www.site.net sit amet';

How can I extract the URL from these strings?
They can be [http:// + url] or [www. + url].

Zechim


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



RES: [PHP] Extract links from strings

2009-09-21 Thread Jônatas Zechim
I don't think so, but I've found this (from PT-BR LIST):

$string = 'Lorem ipsum dolor http://site.com sit amet lorem www.google.com
';

preg_match_all('!(?:http://|www)[^ ]*!',$string,$links);

print_r($links);

Zechim

-Mensagem original-
De: Mattias Thorslund [mailto:matt...@thorslund.us] 
Enviada em: segunda-feira, 21 de setembro de 2009 15:07
Para: 'PHP-General List'
Assunto: Re: [PHP] Extract links from strings

Jônatas Zechim wrote:
 Hi there, i've the following strings:

 $string1 = 'Lorem ipsum dolor http://site.com sit amet';
 $string2 = 'Lorem ipsum dolor http://www.site.com/ sit amet';
 $string3 = 'Lorem ipsum dolor http://www.site.net sit amet';

 How can I extract the URL from these strings?
 They can be [http:// + url] or [www. + url].

 Zechim

Simple:

function RemoveLorem($string)
{
return str_replace(array('Lorem ipsum dolor ', ' sit amet'), '', 
$string);
}

$url1 = RemoveLorem($string1);
$url2 = RemoveLorem($string2);
$url3 = RemoveLorem($string3);

Cheers :-)

Mattias

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



RES: [PHP] Login should not allow users to login if the application is logged in with the same login credentials

2009-08-27 Thread Jônatas Zechim
Use a DB session handler or save a time() on the user table every refresh,
when loggin verify this time().

Zechim

-Mensagem original-
De: Balasubramanyam A [mailto:knowledge.wea...@gmail.com] 
Enviada em: quinta-feira, 27 de agosto de 2009 08:24
Para: php-general@lists.php.net
Assunto: [PHP] Login should not allow users to login if the application is
logged in with the same login credentials

Hello,

I've written a simple application, where users need to login to access the
features of the application. I want to develop login system such that, if
user is already logged in, the application should not allow the users to
login with the same login credentials. How do I accomplish this?

Regards,
Balu


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



RES: [PHP] Case Conversion of US Person Names

2009-07-16 Thread Jônatas Zechim
U can try this:

function fNme($n){
$tN=count($n=explode(' ',strtolower($n)));
$nR='';

for($i=0;$i$tN;$i++){if($i==0){$nR.=strlen($n[$i])3?ucwords($n[$i]):$n[$i]
;}else{$nR.=strlen($n[$i])3?' '.ucwords($n[$i]):' '.$n[$i];}}
return $nR;
}

echo fNme('a aaa aa aa ');

And also make an array inside this function for exceptions like 'vander' or
other words which the srtlen is  3.

Zechim

-Mensagem original-
De: phphelp -- kbk [mailto:phph...@comcast.net] 
Enviada em: quinta-feira, 16 de julho de 2009 15:00
Para: PHP General List
Assunto: [PHP] Case Conversion of US Person Names

Hi, All -- -- - -

I occasionally find myself in need of a utility to do case conversion  
of people's names, especially when I am converting data from an old  
to a new system. This is the first such occasion in PHP.

I know about ucwords() and mb_convert_case(). They do not accommodate  
names with middle capitalization.

Does anybody have such a utility to share, or know of one posted by  
someone out there that you have used?

I am not looking for perfection -- I know that such is not possible.  
I just want to pick off the easy ones -- Mc, Mac, O', de, de la, van,  
vander, van der, d' and others like that. I see some novel attempts  
to do parts of this on the PHP ucwords() User Notes area, but I bet  
someone out there has something more comprehensive. I'd rather not  
roll my own as I have done in other languages.

I have Googled without success.

Many thanks,


Ken

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



RES: [PHP] phpMyAdmin, localhost, mysql overhead

2009-06-12 Thread Jônatas Zechim
I have other tables running but only this give me ‘overhead’.

 

I’d know why this table does this and if is bad for my MySQL Server?

Is there anyway to avoid it?

 

Zechim

 

De: nit...@binnun.co.il [mailto:nit...@binnun.co.il] Em nome de Nitsan
Bin-Nun
Enviada em: sexta-feira, 12 de junho de 2009 14:33
Para: Jônatas Zechim
Cc: php-general@lists.php.net
Assunto: Re: [PHP] phpMyAdmin, localhost, mysql overhead

 

I haven't read all your mail, I'm sorry for it in advance, but I think that
you should know that overheard is just a blasting phrase for something
which was made up by phpmyadmin.

Basically, when you run a lot of DELETE or UPDATE queries on a table an
overhead is created, generally speaking this overhead is a space between
rows in the database file, which will cause mysql engine to insert rows into
this space on future INSERT queries. 

You can imagine your table as a hard drive, every couple of months (some may
say weeks) you have to run a de-fragment on it, you can do the same with
your database table, look up the query OPTIMIZE TABLE which will do the
de-frag for you :)

If you have any further questions feel free to bring them up.

Regards,
Nitsan

On Fri, Jun 12, 2009 at 7:02 PM, Jônatas Zechim zechim@gmail.com
wrote:

Hi there, i have this table running on my localhost:

CREATE TABLE `caffecheckout_compra_itens` (
 `compra_key` varchar(23) NOT NULL,
 `item_id` int(5) NOT NULL,
 `item_valor` decimal(10,2) NOT NULL,
 `item_peso` decimal(5,3) NOT NULL,
 `item_qtd` int(3) NOT NULL,
 `item_data` int(10) NOT NULL,
 `item_obs` varchar(100) NOT NULL,
 PRIMARY KEY  (`item_id`),
 KEY `compra_key` (`compra_key`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;


It's on my Server, but when I add a row and after remove that I'd overhead
this table (58bytes/row), anyone know why is this happening?

I run this SQL:

INSERT INTO
   caffecheckout_compra_itens
   (compra_key,item_id,item_valor,item_peso,item_qtd,item_data)
VALUES
   ('12448259804a32897ce1116','2','19.90','0.250',1,'1244825980')
ON DUPLICATE KEY UPDATE
   item_qtd=item_qtd+1

And after:

DELETE FROM
   caffecheckout_compra_itens
WHERE
   compra_key='12448259804a32897ce1116'


Zechim


-Mensagem original-
De: Andrew Ballard [mailto:aball...@gmail.com]
Enviada em: sexta-feira, 12 de junho de 2009 09:38
Para: revDAVE
Cc: php-general@lists.php.net
Assunto: Re: [PHP] Field type for american money

On Thu, Jun 11, 2009 at 4:08 PM, revDAVEc...@hosting4days.com wrote:
 Php - MySQL - newbie question

 - Field type for american money - int(11) seems to work fine

 - but also I tried decimal(10,2)

 Is one a better choice than another for american money usage?


 --
 Thanks - RevDave
 Cool @ hosting4days . com
 [db-lists 09]

It depends on what you need to store, honestly. If all your dollar
amounts are integers, int would work fine. If you need decimals,
decimal(10, 2) would be fine for a lot of applications. However, a lot
of financial applications need a little more precision. SQL Server has
a money datatype that looks like it's about equivalent to decimal(19,
4) and a smallmoney type that looks like it's equivalent to
decimal(10, 4). That handles things like gas prices that always have
that extra 9/10 of a penny tacked onto them, or items that are 3 for a
dollar. If you enter a price of 0.33 in a decimal(10, 2) field,
multiplying that by 3 will result in 0.99, whereas three items priced
at 0. will come to 0., which when formatted to two digits will
round to 1.00.

Andrew

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

 



RES: [PHP] phpMyAdmin, localhost, mysql overhead

2009-06-12 Thread Jônatas Zechim
Thank u Nitsan. I’ll proceed with my app now.

 

Zechim

 

De: nit...@binnun.co.il [mailto:nit...@binnun.co.il] Em nome de Nitsan
Bin-Nun
Enviada em: sexta-feira, 12 de junho de 2009 15:01
Para: Jônatas Zechim
Cc: php-general@lists.php.net
Assunto: Re: [PHP] phpMyAdmin, localhost, mysql overhead

 

There is no way to avoid it since whenever you delete a row in a myisam
table you create a space in the order of the rows, this space is expressed
by a little bit of extra file size of the database.
This extra file size is called in phpmyadmin as overhead, you can kill
this over head either by running some INSERT queries which will fill the
space with the inserted rows or running an OPTIMISE query.

In general, I don't think that there is anything that you should do or take
care of, it is not rocket science and your tables will be good with or
without the overhead ;)

Nitsan

On Fri, Jun 12, 2009 at 7:41 PM, Jônatas Zechim zechim@gmail.com
wrote:

I have other tables running but only this give me ‘overhead’.



I’d know why this table does this and if is bad for my MySQL Server?

Is there anyway to avoid it?



Zechim



De: nit...@binnun.co.il [mailto:nit...@binnun.co.il] Em nome de Nitsan
Bin-Nun
Enviada em: sexta-feira, 12 de junho de 2009 14:33
Para: Jônatas Zechim

Cc: php-general@lists.php.net

Assunto: Re: [PHP] phpMyAdmin, localhost, mysql overhead




I haven't read all your mail, I'm sorry for it in advance, but I think that
you should know that overheard is just a blasting phrase for something
which was made up by phpmyadmin.

Basically, when you run a lot of DELETE or UPDATE queries on a table an
overhead is created, generally speaking this overhead is a space between
rows in the database file, which will cause mysql engine to insert rows into
this space on future INSERT queries.

You can imagine your table as a hard drive, every couple of months (some may
say weeks) you have to run a de-fragment on it, you can do the same with
your database table, look up the query OPTIMIZE TABLE which will do the
de-frag for you :)

If you have any further questions feel free to bring them up.

Regards,
Nitsan

On Fri, Jun 12, 2009 at 7:02 PM, Jônatas Zechim zechim@gmail.com
wrote:

Hi there, i have this table running on my localhost:

CREATE TABLE `caffecheckout_compra_itens` (
 `compra_key` varchar(23) NOT NULL,
 `item_id` int(5) NOT NULL,
 `item_valor` decimal(10,2) NOT NULL,
 `item_peso` decimal(5,3) NOT NULL,
 `item_qtd` int(3) NOT NULL,
 `item_data` int(10) NOT NULL,
 `item_obs` varchar(100) NOT NULL,
 PRIMARY KEY  (`item_id`),
 KEY `compra_key` (`compra_key`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;


It's on my Server, but when I add a row and after remove that I'd overhead
this table (58bytes/row), anyone know why is this happening?

I run this SQL:

INSERT INTO
  caffecheckout_compra_itens
  (compra_key,item_id,item_valor,item_peso,item_qtd,item_data)
VALUES
  ('12448259804a32897ce1116','2','19.90','0.250',1,'1244825980')
ON DUPLICATE KEY UPDATE
  item_qtd=item_qtd+1

And after:

DELETE FROM
  caffecheckout_compra_itens
WHERE
  compra_key='12448259804a32897ce1116'


Zechim


-Mensagem original-
De: Andrew Ballard [mailto:aball...@gmail.com]
Enviada em: sexta-feira, 12 de junho de 2009 09:38
Para: revDAVE
Cc: php-general@lists.php.net
Assunto: Re: [PHP] Field type for american money

On Thu, Jun 11, 2009 at 4:08 PM, revDAVEc...@hosting4days.com wrote:
 Php - MySQL - newbie question

 - Field type for american money - int(11) seems to work fine

 - but also I tried decimal(10,2)

 Is one a better choice than another for american money usage?


 --
 Thanks - RevDave
 Cool @ hosting4days . com
 [db-lists 09]

It depends on what you need to store, honestly. If all your dollar
amounts are integers, int would work fine. If you need decimals,
decimal(10, 2) would be fine for a lot of applications. However, a lot
of financial applications need a little more precision. SQL Server has
a money datatype that looks like it's about equivalent to decimal(19,
4) and a smallmoney type that looks like it's equivalent to
decimal(10, 4). That handles things like gas prices that always have
that extra 9/10 of a penny tacked onto them, or items that are 3 for a
dollar. If you enter a price of 0.33 in a decimal(10, 2) field,
multiplying that by 3 will result in 0.99, whereas three items priced
at 0. will come to 0., which when formatted to two digits will
round to 1.00.

Andrew

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




 



RES: [PHP] phpMyAdmin, localhost, mysql overhead

2009-06-12 Thread Jônatas Zechim
I really don’t know the differences betwen MyISAM and InnoDB yet but I’ll
google for it right now.

 

Thank u.

 

Zechim

 

De: Eddie Drapkin [mailto:oorza...@gmail.com] 
Enviada em: sexta-feira, 12 de junho de 2009 15:05
Para: Nitsan Bin-Nun
Cc: Jônatas Zechim; php-general@lists.php.net
Assunto: Re: [PHP] phpMyAdmin, localhost, mysql overhead

 

The better question is why are you using MyISAM tables?  Unless there's a
legitimate reason to prefer MyISAM over InnoDB, you should be using InnoDB.

On Fri, Jun 12, 2009 at 2:01 PM, Nitsan Bin-Nun nitsa...@gmail.com wrote:

There is no way to avoid it since whenever you delete a row in a myisam
table you create a space in the order of the rows, this space is expressed
by a little bit of extra file size of the database.
This extra file size is called in phpmyadmin as overhead, you can kill
this over head either by running some INSERT queries which will fill the
space with the inserted rows or running an OPTIMISE query.

In general, I don't think that there is anything that you should do or take
care of, it is not rocket science and your tables will be good with or
without the overhead ;)

Nitsan

On Fri, Jun 12, 2009 at 7:41 PM, Jônatas Zechim zechim@gmail.comwrote:


 I have other tables running but only this give me ‘overhead’.



 I’d know why this table does this and if is bad for my MySQL Server?

 Is there anyway to avoid it?



 Zechim



 De: nit...@binnun.co.il [mailto:nit...@binnun.co.il] Em nome de Nitsan
 Bin-Nun
 Enviada em: sexta-feira, 12 de junho de 2009 14:33
 Para: Jônatas Zechim
 Cc: php-general@lists.php.net
 Assunto: Re: [PHP] phpMyAdmin, localhost, mysql overhead



 I haven't read all your mail, I'm sorry for it in advance, but I think
that
 you should know that overheard is just a blasting phrase for something
 which was made up by phpmyadmin.

 Basically, when you run a lot of DELETE or UPDATE queries on a table an
 overhead is created, generally speaking this overhead is a space
 between
 rows in the database file, which will cause mysql engine to insert rows
 into
 this space on future INSERT queries.

 You can imagine your table as a hard drive, every couple of months (some
 may
 say weeks) you have to run a de-fragment on it, you can do the same with
 your database table, look up the query OPTIMIZE TABLE which will do the
 de-frag for you :)

 If you have any further questions feel free to bring them up.

 Regards,
 Nitsan

 On Fri, Jun 12, 2009 at 7:02 PM, Jônatas Zechim zechim@gmail.com
 wrote:

 Hi there, i have this table running on my localhost:

 CREATE TABLE `caffecheckout_compra_itens` (
  `compra_key` varchar(23) NOT NULL,
  `item_id` int(5) NOT NULL,
  `item_valor` decimal(10,2) NOT NULL,
  `item_peso` decimal(5,3) NOT NULL,
  `item_qtd` int(3) NOT NULL,
  `item_data` int(10) NOT NULL,
  `item_obs` varchar(100) NOT NULL,
  PRIMARY KEY  (`item_id`),
  KEY `compra_key` (`compra_key`)
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;


 It's on my Server, but when I add a row and after remove that I'd overhead
 this table (58bytes/row), anyone know why is this happening?

 I run this SQL:

 INSERT INTO
   caffecheckout_compra_itens
   (compra_key,item_id,item_valor,item_peso,item_qtd,item_data)
 VALUES
   ('12448259804a32897ce1116','2','19.90','0.250',1,'1244825980')
 ON DUPLICATE KEY UPDATE
   item_qtd=item_qtd+1

 And after:

 DELETE FROM
   caffecheckout_compra_itens
 WHERE
   compra_key='12448259804a32897ce1116'


 Zechim


 -Mensagem original-
 De: Andrew Ballard [mailto:aball...@gmail.com]
 Enviada em: sexta-feira, 12 de junho de 2009 09:38
 Para: revDAVE
 Cc: php-general@lists.php.net
 Assunto: Re: [PHP] Field type for american money

 On Thu, Jun 11, 2009 at 4:08 PM, revDAVEc...@hosting4days.com wrote:
  Php - MySQL - newbie question
 
  - Field type for american money - int(11) seems to work fine
 
  - but also I tried decimal(10,2)
 
  Is one a better choice than another for american money usage?
 
 
  --
  Thanks - RevDave
  Cool @ hosting4days . com
  [db-lists 09]

 It depends on what you need to store, honestly. If all your dollar
 amounts are integers, int would work fine. If you need decimals,
 decimal(10, 2) would be fine for a lot of applications. However, a lot
 of financial applications need a little more precision. SQL Server has
 a money datatype that looks like it's about equivalent to decimal(19,
 4) and a smallmoney type that looks like it's equivalent to
 decimal(10, 4). That handles things like gas prices that always have
 that extra 9/10 of a penny tacked onto them, or items that are 3 for a
 dollar. If you enter a price of 0.33 in a decimal(10, 2) field,
 multiplying that by 3 will result in 0.99, whereas three items priced
 at 0. will come to 0., which when formatted to two digits will
 round to 1.00.

 Andrew

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


 --
 PHP General Mailing List (http

RES: RES: [PHP] CURL problems still

2009-05-12 Thread Jônatas Zechim
Hi Terion,

I thing the problems is the time limit on your Server.

Try this now:

Test the var before insert into db:
If(!isset($crime)){$crime=''}

After u remove from the db the unwanted lines.

On the end of the file u do this:

$letters=array();
for($i='A';$i='Z';$i++){$letters[$i]=$i;if($i=='Z'){break;}}
$tL=count($letters);
$letters=array_keys($letters);

if(isset($_GET['L'])){if(trim($_GET['L'])!==''){if($_GET['L']+1$tL){$next=0
;$final=1;}else{$next=$_GET['L'];}}else{$next=0;}}else{$next=0;}

$nextLetter=$letters[$next];

if(!isset($final)){

//do the task


//on the end of the file u put this:


for($i=0;$i$tL;$i++){if($nextLetter==$letters[$i]){if($i+1==$tL){$nextLette
r=0;$file='A';}else{$nextLetter=$i+1;$file=$letters[$i+1];}break;}}
#header('Location:'.$file.'.php?L='.$nextLetter);
}

U'll need to make A.php, B.php, C.php, D.php, etc... file, with the same
content., did u get it?
 
Zechim


-Mensagem original-
De: Miller, Terion [mailto:tmil...@springfi.gannett.com] 
Enviada em: terça-feira, 12 de maio de 2009 10:24
Para: Phpster; Miller, Terion
Cc: Jônatas Zechim; PHP-General List
Assunto: Re: RES: [PHP] CURL problems still



 Bastien, could you give me an example of what you mean?
 would it be $Name = 

 like that?

 Thanks for the ideas everyone!


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


 Try Imitliazing the variables at the top of the loop to empty strings
 or zeros

 Bastien



Yep, that's it

$_thing = '';


Bastien


Well I tried it and still it stopped at the C's maybe I put them in the
wrong spot?  I tried something yesterday where I commented out the C's
url, and it ran through the F's could a setting somewhere be restricting
how many files it can run...I am just stumped, the script runs fine, inserts
the data I'm wanting etc, just can't get it to run all 26 pagesargh.

Code--
foreach($html-find('table') as $table) {foreach($table-find('tr') as
$tr){  //set variables to nada ? $name = ''; $age = '';
$warrant = ''; $bond = ''; $wnumber = ''; $crime = '';
// Grab children   $cells = $tr-children();
if($cells[0]-plaintext != Name){for ($i = 0;
$i  count($cells); $i++){
switch ($i){ case 0: // Name $name =
$cells[$i]-plaintext; echo $cells[$i]-plaintext;
break; case 1: // Age $age =
$cells[$i]-plaintext; break; case 2: //
Warrant type $warrant = $cells[$i]-plaintext;
break; case 3: // Bond amount $bond =
$cells[$i]-plaintext; break; case 4: //
Warrant number $wnumber = $cells[$i]-plaintext;
break;  case 5: // Offence description
$crime = $cells[$i]-plaintext; break;
Default: echo Uh-ohbr /; }
}   }// Build your
INSERT statement here  $query = INSERT into `warrants` (name,
age, warrant, bond, wnumber, crime) VALUES (;$query .=  '$name',
'$age', '$warrant', '$bond', '$wnumber', '$crime' );$wid =
mysql_insert_id();echo $query;// run query
mysql_query($query) or die (mysql_error());

-end code---


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



RES: [PHP] CURL problems still

2009-05-11 Thread Jônatas Zechim
Hey Guy, try to change the 'max_execution_time'

ini_set('max_execution_time','1800');



-Mensagem original-
De: Miller, Terion [mailto:tmil...@springfi.gannett.com] 
Enviada em: segunda-feira, 11 de maio de 2009 16:41
Para: PHP-General List
Assunto: [PHP] CURL problems still 

I'm back.  I thought I had this script working but it seems to always stop
at the end of the C's, so I can get it to go thru pages A-C then it stops, I
have tried setting the time-out to a very large amount but it never
continues to run past the same spot, it gathers all records to the end of C,
then quits...any ideas?

Script: 

?php

ini_set('display_errors',
1);
include(inc/dbconn_open.php);

include(inc/dom.php);

error_reportin
g(E_ALL);

$TESTING = TRUE;


 $targets[a] =
http://www.greenecountymo.org/sheriff/warrants.php?search=A;;

$targets[b] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=B;;

$targets[c] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=C;;

$targets[d] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=D;;

$targets[e] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=E;;

$targets[f] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=F;;

$targets[g] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=G;;

$targets[h] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=H;;

$targets[i] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=I;;

$targets[j] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=J;;

$targets[k] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=K;;

$targets[l] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=L;;

$targets[m] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=M;;

$targets[n] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=N;;

$targets[o] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=O;;

$targets[p] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=P;;

$targets[q] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=Q;;

$targets[r] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=R;;

$targets[s] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=S;;

$targets[t] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=T;;

$targets[u] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=U;;

$targets[v] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=V;;

$targets[w] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=W;;

$targets[x] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=X;;

$targets[y] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=Y;;

$targets[z] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=Z;;
 
 foreach
($targets as $target_url){

echo $target_url;

$userAgent = 'Googlebot/2.1
(http://www.googlebot.com/bot.html)';


$ch = curl_init();
curl_setopt($ch,
CURLOPT_USERAGENT, $userAgent);
curl_setopt($ch,
CURLOPT_URL,$target_url);
curl_setopt($ch, CURLOPT_FAILONERROR,
true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);
curl_setopt($ch,
CURLOPT_AUTOREFERER, true);
curl_setopt($ch,
CURLOPT_RETURNTRANSFER,true);
curl_setopt($ch, CURLOPT_TIMEOUT,
6000);

$html = curl_exec($ch);

if (!$html) {
echo br /cURL error
number: .curl_errno($ch);
echo br /cURL error: . curl_error($ch);

exit;
}


// Create DOM from URL or file
$html =
file_get_html($target_url);

// Find table
foreach($html-find('table') as
$table)
{
foreach($table-find('tr') as $tr)
{
   
   

// Grab children
   $cells = $tr-children();
  

if($cells[0]-plaintext != Name)
{

for ($i =
0; $i  count($cells); $i++)
{
 

switch ($i){
 case 0: // Name
 $name =
$cells[$i]-plaintext;
 echo $cells[$i]-plaintext;

break;
 case 1: // Age
 $age =
$cells[$i]-plaintext;
 break;
 case 2:
// Warrant type
 $warrant = $cells[$i]-plaintext;

break;
 case 3: // Bond amount
 $bond =
$cells[$i]-plaintext;
 break;
 case 4:
// Warrant number
 $wnumber = $cells[$i]-plaintext;

break;
 case 5: // Offence description

$crime = $cells[$i]-plaintext;
 break;

Default:
 echo Uh-ohbr /;
 }

 
 
}

   

}
   

 // Build your INSERT statement here

// Build your INSERT statement here
  
$query = INSERT
into warrants (wid, name, age, warrant, bond, wnumber, crime) VALUES (;

$query .=  '$wid', '$name', '$age', '$warrant', '$bond', '$wnumber',
'$crime' );
//$wid = mysql_insert_id();

echo
$query;

// run 

RES: [PHP] CURL error help

2009-05-08 Thread Jônatas Zechim
Try to change this:

curl_setopt($ch,CURLOPT_URL,$targets);

to:

curl_setopt($ch,CURLOPT_URL, $target_url);

Zechim
zechim.com
São Paulo/Brazil


-Mensagem original-
De: Miller, Terion [mailto:tmil...@springfi.gannett.com] 
Enviada em: sexta-feira, 8 de maio de 2009 09:50
Para: PHP-General List
Assunto: [PHP] CURL error help

Trying to run a script on several different pages within the same site by
making the url's an array...anyone see a better way to do this?

Trying to resolve some curl errors and need some help, here are the errors:


Notice: Array to string conversion in
/var/www/vhosts/getpublished.news-leader.com/httpdocs/Warrants/loopScrape1.p
hp on line 34

Warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot
be activated when in safe_mode or an open_basedir is set in
/var/www/vhosts/getpublished.news-leader.com/httpdocs/Warrants/loopScrape1.p
hp on line 36

cURL error number:6
cURL error:Couldn't resolve host 'Array'

And here is the code:
?php

ini_set('display_errors',
1);
include(inc/dbconn_open.php);

include(inc/dom.php);

error_reportin
g(E_ALL);

$TESTING = TRUE;


 $targets[a] =
http://www.greenecountymo.org/sheriff/warrants.php?search=A;;

$targets[b] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=B;;

$targets[c] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=C;;

$targets[d] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=D;;

$targets[e] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=E;;

$targets[f] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=F;;

$targets[g] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=G;;

$targets[h] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=H;;

$targets[i] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=I;;

$targets[j] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=J;;

$targets[k] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=K;;

$targets[l] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=L;;
 
 
 foreach
($targets as $target_url){

$userAgent = 'Googlebot/2.1
(http://www.googlebot.com/bot.html)';


$ch = curl_init();
curl_setopt($ch,
CURLOPT_USERAGENT, $userAgent);
curl_setopt($ch,
CURLOPT_URL,$targets);
curl_setopt($ch, CURLOPT_FAILONERROR,
true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch,
CURLOPT_AUTOREFERER, true);
curl_setopt($ch,
CURLOPT_RETURNTRANSFER,true);
curl_setopt($ch, CURLOPT_TIMEOUT, 300);
$html
= curl_exec($ch);
if (!$html) {
echo br /cURL error number:
.curl_errno($ch);
echo br /cURL error: . curl_error($ch);

exit;
}


// Create DOM from URL or file
$html =
file_get_html('$target_url');

// Find table
foreach($html-find('table') as
$table)
{
foreach($table-find('tr') as $tr)
{


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



RES: RES: [PHP] CURL error help

2009-05-08 Thread Jônatas Zechim
Try to echo the $target_url var. What's on it?

 

 

Try to echo the $args var. What's on it?

 

 

How do you pass the $args?

 

 

 

Zechim

zechim.com

São Paulo/Brazil

 

 

-Mensagem original-
De: Miller, Terion [mailto:tmil...@springfi.gannett.com] 
Enviada em: sexta-feira, 8 de maio de 2009 10:27
Para: Jônatas Zechim; Miller, Terion; PHP-General List
Assunto: Re: RES: [PHP] CURL error help

 

 

 

 

On 5/8/09 8:04 AM, Jônatas Zechim zechim@gmail.com wrote:

 

Try to change this:

 

curl_setopt($ch,CURLOPT_URL,$targets);

 

to:

 

curl_setopt($ch,CURLOPT_URL, $target_url);

 

Zechim

zechim.com

São Paulo/Brazil

 

Thanks for the suggestion:

Tried it and get this error now:

 

Warning: file_get_contents($target_url) [function.file-get-contents]: failed
to open stream: No such file or directory in
/var/www/vhosts/getpublished.news-leader.com/httpdocs/Warrants/inc/dom.php
on line 39

 

On line #39 from my dom.php file is this :

// get html dom form file

function file_get_html() {

   $dom = new simple_html_dom;

   $args = func_get_args();

   $dom-load(call_user_func_array('file_get_contents', $args), true);

   return $dom;

}

 

I think somehow the array is not being read or it's trying to pass the full
array of url's as one url? Therefore saying it does not exist? My best
guess, am I making the array wrong?

 



RES: [PHP] help with explode()

2009-04-24 Thread Jônatas Zechim
$var = John \Jill\ \Judy Smith\;

echo $var;

$var2=explode(\,$var);

echo 'pre';
print_r($var2);
echo '/pre';

$tVar=count($var2);

for($i=0;$i$tVar;$i++){if(strlen($var2[$i])2){unset($var2[$i]);}else{$var2
[$i]=trim($var2[$i]);}}
$var2=array_values($var2);

echo 'pre';
print_r($var2);
echo '/pre';

Is that u want?

Zechim
SP/Brazil

-Mensagem original-
De: Adam Williams [mailto:awill...@mdah.state.ms.us] 
Enviada em: sexta-feira, 24 de abril de 2009 12:41
Para: PHP General list
Assunto: [PHP] help with explode()

I have a form where users submit search terms and it explodes the terms 
into an array based upon spaces.  But, how can I have explode() keep 
words in quotation marks together?  For example, if someone enters on 
the form:

John Jill Judy Smith

and I run $termsarray = explode( , $_POST[terms]);

it explodes into:

Array ( [0] = John [1] = Jill [2] = Judy [3] = Smith )

but I'd like it to explode into:

Array ( [0] = John [1] = Jill [2] = Judy Smith )


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



RES: [PHP] inexplicable behaviour

2009-04-24 Thread Jônatas Zechim
Is the $Count++..

-Mensagem original-
De: PJ [mailto:af.gour...@videotron.ca] 
Enviada em: sexta-feira, 24 de abril de 2009 21:14
Para: php-general@lists.php.net
Assunto: [PHP] inexplicable behaviour

Frankly, I don't know what to look for or why something so weird would
happen:
I have pagination set up and the number for pages next has a link but
the next does not. I have experimented with all sorts of
configurations of the code but the only thing that works (and this is
totally off the wall) is to do this
$Count = mysql_num_rows($results);
$Count1=$Count++; // without this, the next does not do the link---
but there is no other $Count1 in the code either in the original page or
the include page.
And this phenomenon was apparent in a similar page.
I'd be curious to understand how this could happen. I could post the
whole code, but that would be some 300 lines...

-- 
unheralded genius: A clean desk is the sign of a dull mind. 
-
Phil Jourdan --- p...@ptahhotep.com
   http://www.ptahhotep.com
   http://www.chiccantine.com/andypantry.php


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


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



RES: [PHP] paging

2009-02-10 Thread Jônatas Zechim
MySql or MsSql or other dB?

-Mensagem original-
De: tedd [mailto:tedd.sperl...@gmail.com] 
Enviada em: terça-feira, 10 de fevereiro de 2009 11:26
Para: Jim Douglas; php-general@lists.php.net
Assunto: Re: [PHP] paging

At 3:26 AM + 2/10/09, Jim Douglas wrote:
Does anyone have a link to any examples of paging?


Jim:

Sure.

http://webbytedd.com/bbb/paging/  -- the code is there

different examples here:

http://webbytedd.com/ccc/pagination

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



RES: [PHP] maybe we could all?

2009-02-09 Thread Jônatas Zechim
Me too..

Zechim from Brazil.

-Mensagem original-
De: Marcus Gnaß [mailto:gona...@gmx.de] 
Enviada em: segunda-feira, 9 de fevereiro de 2009 19:59
Para: nrix...@gmail.com
Cc: PHP-General; Paul M Foster
Assunto: Re: [PHP] maybe we could all?

Nathan Rixham wrote:
 Marcus Gnaß wrote:
 Nathan Rixham wrote:
 Project: PHP Common Objects and Datatypes

 Has anything been setup for project COD-pieces yet? I like this name! ;)

 Actually, yes it has - the project, well working group, has been 
 called voom.
Sounds fine too! ;)
 If you're interested just let me know and we'll get you introduced and 
 set-up.
Yes please! I'm an intermediate PHP programmer who is lurking this list 
since october 06 and wrote a small CMS for my own (and a couple of 
friends) use so far.
I'm quite comfortable with (classical ... sigh) ASP so far which I use 
now for about 10 years and recently I began to get along with Java.

Your ideas sounded really great and I would like to join this group.

-- 
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] Read a XML (not a file)

2009-02-06 Thread Jônatas Zechim
Hi there, i want do read a XML like this:

Server.php
?php

  header (content-type: text/xml);

echo ?xml version=\1.0\ encoding=\iso-5718\ ? images  image
  ID1/ID
   albumtestealbum
   path/images/teste.jpg/path
 /image
/images;
?

How can do this?

zechim


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



RES: [PHP] Read a XML (not a file)

2009-02-06 Thread Jônatas Zechim
But the 'server.php' is on another Server, i did this and is ok now.

function ctalk_fopen($u){
$b=parse_url($u);
$h=$b['host'];
$p=(isset($b['query']))?$b['path'].?.$b['query']:$b['path'];
$s=socket_create(AF_INET,SOCK_STREAM,0);
socket_set_block($s);
$r=socket_connect($s,gethostbyname($h),getservbyname('www','tcp'));
$i=GET $p HTTP/1.1\r\nHost: $h\r\nConnection: close\r\n\r\n;
socket_write($s,$i,strlen($i));
$r='';
while($o=socket_read($s,4096)){$r=$r.$o;}
socket_close($s);
$c=preg_split(/\r?\n\r?\n/, $r,2);
return $c[1];
}

$u = http://localhost/xml/server.php;;

function ctalk_se($xp,$a){global $f;}
function ctalk_ee($xp,$n){global $f,$i;$k=$n;$f[$k]=$i;$i=;}
function ctalk_dt($xp,$d){global $i;$i.=$d;}

$xp=xml_parser_create();
xml_set_element_handler($xp,ctalk_se,ctalk_ee);
xml_set_character_data_handler($xp,ctalk_dt);
xml_parse($xp,ctalk_fopen($u),true);

print_r($f);
returns an array of the XML that server.php had output.

Zechim



-Mensagem original-
De: Jim Lucas [mailto:li...@cmsws.com] 
Enviada em: sexta-feira, 6 de fevereiro de 2009 14:39
Para: Jônatas Zechim
Cc: php-general@lists.php.net
Assunto: Re: [PHP] Read a XML (not a file)

Jônatas Zechim wrote:
 Hi there, i want do read a XML like this:
 
 Server.php
 ?php
 
   header (content-type: text/xml);
 
 echo ?xml version=\1.0\ encoding=\iso-5718\ ? images  image
   ID1/ID
albumtestealbum
path/images/teste.jpg/path
  /image
 /images;
 ?
 
 How can do this?
 
 zechim
 
 

test.php
?php

# Capture original content-type
$contentType = ini_get('default_mimetype');

ob_start();
include 'server.php';
$xml = ob_get_contents();
ob_end_clean();

# Reset content-type of previous type
header(content-type: .$contentType);

echo $xml;

?

mind you that the header() call within the include is going to change the 
default headers(), so be sure to reset the content-type one you come out of
the include file.


-- 
Jim Lucas

   Some men are born to greatness, some achieve greatness,
   and some have greatness thrust upon them.

Twelfth Night, Act II, Scene V
by William Shakespeare


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



[PHP] Connect local app to a web app

2009-02-05 Thread Jônatas Zechim
Hi there, i'm here again, but now with another doubt.

What's the best way to connect a local app write in php or php-gtk to a web
app writen in php.
The database is MySql, and i need to do this connection every 3s to check
data, get the data back and save into localhost database.


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



RES: [PHP] Connect local app to a web app

2009-02-05 Thread Jônatas Zechim
Ok, i have a app running on a website writen in php that insert data into a 
database(web) every 3s all day long, and I need to get this data(every 3s too) 
and save into local database, both are mysql database, but I don't know the 
best way to do it, with socks, XML, XML-RPC.

Thanks

Zechim.

-Mensagem original-
De: Jim Lucas [mailto:li...@cmsws.com] 
Enviada em: quinta-feira, 5 de fevereiro de 2009 18:13
Para: Alpár Török
Cc: Paul M Foster; php-general@lists.php.net
Assunto: Re: [PHP] Connect local app to a web app

Alpár Török wrote:
 2009/2/5 Alpár Török torokal...@gmail.com
 

 2009/2/5 Paul M Foster pa...@quillandmouse.com

 On Thu, Feb 05, 2009 at 05:24:45PM -0200, Jônatas Zechim wrote:
 Hi there, i'm here again, but now with another doubt.

 What's the best way to connect a local app write in php or php-gtk to a
 web
 app writen in php.
 The database is MySql, and i need to do this connection every 3s to
 check
 data, get the data back and save into localhost database.

 If you have control of the server, you can just set this up in a bash
 script, using mysql commands, which connect to the remote and then then
 local databases. I'm talking about cron running the script periodically.

 Paul

 --
 Paul M. Foster

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


 You can set up a web service using XML-RPC or JSON-RPC , you don't
 necessarily need a db

 PS: I meant you don't need the db locally
 

except for the fact that the op said he wanted to *save* it to a *localhost 
database*.

 --
 Alpar Torok

 
 
 


-- 
Jim Lucas

   Some men are born to greatness, some achieve greatness,
   and some have greatness thrust upon them.

Twelfth Night, Act II, Scene V
by William Shakespeare

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



RES: [PHP] Mutiple SQL request

2009-02-04 Thread Jônatas Zechim
For example i’ve this query:

 

SELECT admin_nome FROM ctalk_admin WHERE admin_lastping = '1233762658' AND
admin_lastping = '1233762608' AND admin_id='1'

 

I ran explain, the result for extra is ‘Impossible WHERE noticed after
reading const table...’

How can i optimize this query?

Is there some tutorial on the net?

 

Thanks, 

Zechim

 

De: Bastien Koert [mailto:phps...@gmail.com] 
Enviada em: quarta-feira, 4 de fevereiro de 2009 12:46
Para: Jônatas Zechim
Cc: php-general@lists.php.net
Assunto: Re: [PHP] Mutiple SQL request

 

 

On Wed, Feb 4, 2009 at 9:43 AM, Jônatas Zechim zechim@gmail.com wrote:

Hi there, i've a system that do a query each 3s, does it impact on mysql
Server?
I mean, can this slow my Server?

zechim



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


It impacts system recources if this same query is run constantly for each
user. Example: if this runs a logon and you have 100 or 1000 users logging
on at roughly the same time, then you will have contention for the
resources. 

Can you check your indeces and run explain plans on the queries to see if
any of them can be optimised to run quicker?

-- 

Bastien

Cat, the other other white meat



RES: [PHP] Is it possible to send POST vars through a header redirect?

2009-02-04 Thread Jônatas Zechim
Try curl

-Mensagem original-
De: Stuart [mailto:stut...@gmail.com] 
Enviada em: quarta-feira, 4 de fevereiro de 2009 07:52
Para: TS
Cc: php-general@lists.php.net
Assunto: Re: [PHP] Is it possible to send POST vars through a header redirect?

2009/2/3 TS sunnrun...@gmail.com:
 I'm trying to send vars via POST somehow. Is this possible?

 Currently I'm doing

 header(Location: http://domain/index.php?var=3;);

 but, want to send POST or some other method that doesn't stick with the 
 session.

I'm not sure what you mean by stick with the session. What exactly
are you trying to achieve?

-Stuart

-- 
http://stut.net/

-- 
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] Mutiple SQL request

2009-02-04 Thread Jônatas Zechim
Hi there, i've a system that do a query each 3s, does it impact on mysql Server?
I mean, can this slow my Server?

zechim



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



RES: [PHP] Mutiple SQL request

2009-02-04 Thread Jônatas Zechim
Can you dump the table structure to show us how you've set it up?
 
Bastien

Cat, the other other white meat

 

Yeah, that’s it:

 

CREATE TABLE `ctalk_admin` (

  `admin_id` int(9) NOT NULL auto_increment,

  `admin_nome` varchar(50) NOT NULL,

  `admin_login_nome` varchar(32) NOT NULL,

  `admin_pass` varchar(32) NOT NULL,

  `admin_login` int(10) NOT NULL,

  `admin_lastping` int(10) NOT NULL,

  PRIMARY KEY  (`admin_id`),

  KEY `admin_lastping` (`admin_lastping`)

) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

 

CREATE TABLE `ctalk_chat` (

  `id` int(4) NOT NULL auto_increment,

  `id_admin` int(4) NOT NULL,

  `id_cliente` int(4) NOT NULL,

  `start_time` int(10) NOT NULL,

  PRIMARY KEY  (`id`)

) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

 

CREATE TABLE `ctalk_chat_mensagem` (

  `id` int(4) NOT NULL auto_increment,

  `mensagem` varchar(400) NOT NULL,

  `hora` int(10) NOT NULL,

  `id_chat` int(4) NOT NULL,

  PRIMARY KEY  (`id`),

  KEY `id_chat` (`id_chat`)

) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

 

CREATE TABLE `ctalk_cliente` (

  `cliente_id` int(4) NOT NULL auto_increment,

  `cliente_nome` varchar(50) NOT NULL,

  `cliente_email` varchar(50) NOT NULL,

  `cliente_cpf` varchar(14) NOT NULL,

  `cliente_login` int(10) NOT NULL,

  `cliente_key` varchar(32) NOT NULL,

  `cliente_lastping` int(10) NOT NULL,

  `cliente_inchat` int(1) NOT NULL,

  PRIMARY KEY  (`cliente_id`),

  KEY `cliente_lastping` (`cliente_lastping`)

) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

 







RES: [PHP] Is it possible to send POST vars through a header redirect?

2009-02-04 Thread Jônatas Zechim
U can do it by using a session, or using a XML request via JS to save the
vars.

-Mensagem original-
De: Morris [mailto:morris...@gmail.com] 
Enviada em: quarta-feira, 4 de fevereiro de 2009 16:00
Para: tedd
Cc: Mike Roberts; php-general@lists.php.net
Assunto: Re: [PHP] Is it possible to send POST vars through a header
redirect?

Not possible to send POST in header if your aim is to hide vars from users.

Could think about dynamically send POST using Javascript. form.send();

This requires some JS knowledge about how to exchange data between PHP and
JS

2009/2/4 tedd tedd.sperl...@gmail.com

 At 9:47 AM -0500 2/4/09, Mike Roberts wrote:

 Ladies and Gentlemen.
  I am a recruiter who joined this list to understand a little about PHP.
I
 respected the boundaries, and never tried to recruit you. Now I am asking
 for a courtesy in return. I have tried several ways and several times to
be
 excluded from the list, but I still get emails. Can somebody who is 'in
 charge' please remove me from the list. Thank you.

  Michael Roberts



 Have you tried?

 To unsubscribe, visit: http://www.php.net/unsub.php



 It's at the bottom of every post.

 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



RES: RES: [PHP] Mutiple SQL request

2009-02-04 Thread Jônatas Zechim
Thank i'll try these to see the perfomance..

Thanks

Zechim

-Mensagem original-
De: Jim Lucas [mailto:li...@cmsws.com] 
Enviada em: quarta-feira, 4 de fevereiro de 2009 16:11
Para: Jônatas Zechim
Cc: 'Bastien Koert'; php-general@lists.php.net
Assunto: Re: RES: [PHP] Mutiple SQL request

Jônatas Zechim wrote:
 Can you dump the table structure to show us how you've set it up?
  
 Bastien
 
 Cat, the other other white meat
 
  
 
 Yeah, that’s it:
 
  
 
 CREATE TABLE `ctalk_admin` (
 
   `admin_id` int(9) NOT NULL auto_increment,
 
   `admin_nome` varchar(50) NOT NULL,
 
   `admin_login_nome` varchar(32) NOT NULL,
 
   `admin_pass` varchar(32) NOT NULL,
 
   `admin_login` int(10) NOT NULL,
 
   `admin_lastping` int(10) NOT NULL,
 
   PRIMARY KEY  (`admin_id`),
 
   KEY `admin_lastping` (`admin_lastping`)
 
 ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
 
  

I would add a second column to that admin_lastping KEY

KEY `admin_lastping` (`admin_lastping`, `admin_id`)

Since you are using both columns in your where clause, they both need to be 
specified /in the same/ index for and index to be used.

Otherwise, some random index might be used.  But you will get the best 
performance if both are listed in the same index.

-- 
Jim Lucas

   Some men are born to greatness, some achieve greatness,
   and some have greatness thrust upon them.

Twelfth Night, Act II, Scene V
by William Shakespeare


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



[PHP] Bad words [SQL, database, txt, whatever]

2009-02-04 Thread Jônatas Zechim
Hi there I don't know how to say 'palavrões'(i mean bad words, like f***
you, your bi***, as*) in English, but I need that.

Anyone has or know where I can get a database, txt, whatever of 'bad words
or 'palavrões''

zechim


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



RES: [PHP] Bad words [SQL, database, txt, whatever]

2009-02-04 Thread Jônatas Zechim
Thank you, but i thought one of you had the .sql or .txt, .xls, etc.
I had already find that results.

But it's ok now..

zechim

-Mensagem original-
De: Andrew Ballard [mailto:aball...@gmail.com] 
Enviada em: quarta-feira, 4 de fevereiro de 2009 18:19
Para: Jônatas Zechim
Cc: PHP-General List
Assunto: Re: [PHP] Bad words [SQL, database, txt, whatever]

On Wed, Feb 4, 2009 at 2:48 PM, Jônatas Zechim zechim@gmail.com wrote:
 Hi there I don't know how to say 'palavrões'(i mean bad words, like f***
 you, your bi***, as*) in English, but I need that.

 Anyone has or know where I can get a database, txt, whatever of 'bad words
 or 'palavrões''

 zechim


http://www.google.com/search?hl=enq=bad+word+dictionarybtnG=Google+Search

http://www.google.com/search?hl=enq=bad+word+listbtnG=Searchaq=foq=

http://www.google.com/search?hl=enq=bad+word+databasebtnG=Searchaq=foq=

Andrew


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



RES: [PHP] calculate the time that day ends

2009-02-03 Thread Jônatas Zechim
Try:

echo date(H:i:s, mktime(23-date(H), 59-date(i), 59-date(s));

-Mensagem original-
De: Thodoris [mailto:t...@kinetix.gr] 
Enviada em: terça-feira, 3 de fevereiro de 2009 14:38
Para: Stuart
Cc: php-general@lists.php.net
Assunto: Re: [PHP] calculate the time that day ends


 2009/2/3 Thodoris t...@kinetix.gr:
   
   I was wondering if there is way to find out what is the time that every
 day ends?  I am planning to add this to the first page on an interface I am
 developing.
 

 Most days end at midnight, but there may be some exceptions ;-)

 Seriously though, not really sure what you're asking.

 -Stuart

   

:-) 
Sorry Stuart I should have made it more clear. I meant the time that the 
sun goes down and the dark night finally comes.
The time that a vampire can safely go for a pizza without burning himself.
Of course Blade is an exception thrown out of the blue.

-- 
Thodoris



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



[PHP] IP to location / XML

2009-02-02 Thread Jônatas Zechim
Hi there,

I want do discover the location from a IP, I use this url '
http://www.onflex.org/geo/xml/ ', that's does a XML file, it's ok on my
browser, but when i try to read this file with php:

$myxml = simplexml_load_file ('http://www.onflex.org/geo/xml/');

That's gives a error:

Warning: simplexml_load_file() [function.simplexml-load-file]:
http://www.onflex.org/geo/xml/:8: parser error : Input is not proper UTF-8,
indicate encoding ! Bytes: 0xE3 0x6F 0x20 0x50 *


Anyone Who might help me with this?

zechim



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



[PHP] RES: IP to location / XML

2009-02-02 Thread Jônatas Zechim
Hi Nathan, i'll try max minds geo ip, that's what i want.

-Mensagem original-
De: Nathan Rixham [mailto:nat...@gmail.com] 
Enviada em: segunda-feira, 2 de fevereiro de 2009 16:13
Para: php-general@lists.php.net; Jônatas Zechim
Cc: 'PHP General'
Assunto: Re: IP to location / XML

Jônatas Zechim wrote:
 Hi there,
 
 I want do discover the location from a IP, I use this url '
 http://www.onflex.org/geo/xml/ ', that's does a XML file, it's ok on my
 browser, but when i try to read this file with php:
 
 $myxml = simplexml_load_file ('http://www.onflex.org/geo/xml/');
 
 That's gives a error:
 
 Warning: simplexml_load_file() [function.simplexml-load-file]:
 http://www.onflex.org/geo/xml/:8: parser error : Input is not proper
UTF-8,
 indicate encoding ! Bytes: 0xE3 0x6F 0x20 0x50 *
 
 
 Anyone Who might help me with this?
 
 zechim
 
 

try this:
$file = get_file_contents('http://www.onflex.org/geo/xml/');
$file = utf8_decode($file);
$myxml = simplexml_load_string($file);

the above assumes the problem is because the file is really latin-1

quick note, using the service at onflex.org will always return you're 
servers ip address not the end users (as you're calling from server not 
clients browser) if this is what you want great, if not then you may 
want to try max minds geo ip.

regards!


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



[PHP] Rounded rectangle in php

2009-01-29 Thread Jônatas Zechim
Hi there, is it possible do make a rounded rectangle in php, i can do a
ellipse, but i need a space between the corners, i need to make something
like this:

http://superbrush.files.wordpress.com/2008/03/086.jpg

not the color and the shadows, only the form.


zechim


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



RES: [PHP] Rounded rectangle in php

2009-01-29 Thread Jônatas Zechim
Hi Tedd, i cant imagine doing that pic i've show to u, follow me, 
I must do 4 ellipse and 1 rectangle and union all to make a rounded
rectangle?
My problem now is the geometry.

*--* 
|  |
*--*

It can be this?

zechim

-Mensagem original-
De: tedd [mailto:tedd.sperl...@gmail.com] 
Enviada em: quinta-feira, 29 de janeiro de 2009 13:21
Para: Jônatas Zechim; php-general@lists.php.net
Assunto: Re: [PHP] Rounded rectangle in php

At 11:36 AM -0200 1/29/09, Jônatas Zechim wrote:
Hi there, is it possible do make a rounded rectangle in php, i can do a
ellipse, but i need a space between the corners, i need to make something
like this:

http://superbrush.files.wordpress.com/2008/03/086.jpg

not the color and the shadows, only the form.

zechim

zechim:

You can draw anything you want, as long as you can describe it via
statements.

Here's a simple example:

http://www.webbytedd.com/b4/draw/

Here's rotated text:

http://www.webbytedd.com/b/rotate-text/

Here are some charts:

http://webbytedd.com/ccc/charts/

Keep in mind that these are very simple examples of what can be done.

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



RES: [PHP] Rounded rectangle in php

2009-01-29 Thread Jônatas Zechim
Thank u, i'll try, when I do, i'll post here.

zechim

-Mensagem original-
De: c...@l-i-e.com [mailto:c...@l-i-e.com] 
Enviada em: quinta-feira, 29 de janeiro de 2009 13:52
Para: php-general@lists.php.net
Assunto: Re: [PHP] Rounded rectangle in php


Yes, you will need four ellipses, arcs, or similar shapes -- but they'll all
be the SAME except for the center, so make that a function probably.


-- 
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] Create $var with some function

2009-01-22 Thread Jônatas Zechim
Hi there, 

Someone know if can (if possible, how) i create a $var on my script like this:

function createvar($var) {
$var = 'foo';
global $var;
//or global $$var, i don't know it yet.
}

so i'd call, 

createvar('myvar');

so i'd could call $myvar, like this:

echo $myvar; // prints 'foo'

is it possible?




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



RES: [PHP] Create $var with some function

2009-01-22 Thread Jônatas Zechim
No, that's not the point yet.

-Mensagem original-
De: Robert Stankiewicz [mailto:robe...@belfabriek.nl] 
Enviada em: quinta-feira, 22 de janeiro de 2009 10:49
Para: Jônatas Zechim; php-general@lists.php.net
Assunto: Re: [PHP] Create $var with some function


   function createvar($var) {
   ${$var} = 'foo';
   global ${$var};
   //or global $$var, i don't know it yet.
   }
   
This should work.


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



RES: [PHP] Finger

2009-01-15 Thread Jônatas Zechim
U can find sometinhg on http://www.phpclasses.org/,
http://www.phpclasses.org/browse/package/1519.html, there's a lot of
sugestions there

zechim

-Mensagem original-
De: Sándor Tamás (HostWare Kft.) [mailto:sandorta...@hostware.hu] 
Enviada em: quinta-feira, 15 de janeiro de 2009 09:30
Para: php-general@lists.php.net
Assunto: [PHP] Finger

Hi,

My problem is that how I can know that a valid e-mail address is exists on
the mail server?
Is there some PHP function, or protocol, or something?

Thanks,
SanTa


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



RES: [PHP] Quotes in querys

2009-01-14 Thread Jônatas Zechim
Try

session_start();

$sql = SELECT Netid FROM User WHERE
Netid='.$_SESSION['phpCAS']['user'].';


-Mensagem original-
De: MikeP [mailto:mpel...@princeton.edu] 
Enviada em: quarta-feira, 14 de janeiro de 2009 14:17
Para: php-general@lists.php.net
Assunto: [PHP] Quotes in querys

Hello,
I am trying to get the following to work:
Select Netid from Users where Netid = '$_SESSION[phpCAS][user]'
Netid is a string type.
No matter where of if I put the quotes, I still get array[phpCAS] not the 
value.
If there is anything I still have trouble with after all these years its 
quoting variables.
Help?
Thanks
Mike 



-- 
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] Query string question

2009-01-13 Thread Jônatas Zechim
I have something like this on my site:

mysite.com/índex.php?msg=Transa%25E7%25E3o+n%25E3o+autorizada

i need to convert  Transa%25E7%25E3o+n%25E3o+autorizada to Transação não 
autorizada.

The letters ç ã, and others (é, í, ...).

Someone can help me?



-Mensagem original-
De: Eric Butera [mailto:eric.but...@gmail.com] 
Enviada em: terça-feira, 13 de janeiro de 2009 17:09
Para: Dan Shirah
Cc: PHP-General list
Assunto: Re: [PHP] Suggestions?

On Tue, Jan 13, 2009 at 2:00 PM, Dan Shirah mrsqua...@gmail.com wrote:
 Hello all!

 I have written some code that will calculate all static and floating
 holidays.

 I have also written some code that will act as a business day counter.

 My application currently determines a set number of business days to count.
 (2 business days and 7 business days from today)

 This part works great and gives the results I want.

 What I need to do is tie in my pre dertermined static and floating holidays
 and factor those into the busniess day counter.

 I was thinking of putting the holidays into an array and then doing a check
 to determine if any date in the array equaled today's date through the
 ending date.

 But I'm drawing a blank on how to create the array.

 // Create an empty array
 $holidays = array();

 But then how do I put each holiday value into the array as it is
 calculated?  Can I assign it that way?

 Or should I calculate all of the values and then build the array at the end?

 Or should I not even use an array?

 Thanks,
 Dan


Are you asking how to do

$holidays[] = date;
array_push($holidays, date); ?

If you were generating dates to compare against today tho, you could
just return upon a match at that point and not even store them.  No
point in creating some big array in a loop only to loop through it
again when you could have done it the first time around.  I'd put this
into a function though so that I could return out upon a match.

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