Re: [PHP] Last Record INSERT

2013-06-26 Thread Samuel Lopes Grigolato
AFAIK "mysql_[...]" is deprecated in favor of "mysqli_[...]" correspondent functions, there's nothing to do specifically with mysql[i]_insert_id. On Wed, Jun 26, 2013 at 3:01 PM, Tedd Sperling wrote: > On Jun 26, 2013, at 1:56 PM, Stuart Dallas wrote: > > On Wednesday, 26 June 2013 at 18:39, Te

Re: [PHP] Reseting the auto-increment number in a MySQL database.

2013-06-26 Thread Samuel Lopes Grigolato
You can try this: *ALTER TABLE tbl AUTO_INCREMENT = 100;* * * *Source: *http://dev.mysql.com/doc/refman/5.0/en/example-auto-increment.html (never did it myself, though) On Wed, Jun 26, 2013 at 2:07 PM, Tedd Sperling wrote: > Hi gang: > > I have a client where their next auto-increment number j

Re: [PHP] Some Advice

2013-06-25 Thread Samuel Lopes Grigolato
Just be cautious if going to check IP, because: 1) The two users could be in the same house or cybercafé, which gives them the same IP. 2) The user could be traveling with a wireless card, his IP would change quite a lot in this scenario. On Tue, Jun 25, 2013 at 9:32 AM, wrote: > You should at

Re: [PHP] Some Advice

2013-06-25 Thread Samuel Lopes Grigolato
But please, PLEASE, read carefully: *If a user were to copy and paste the URL of the page they were on, and someone else were to click on it, they would both be using the same session.* On Tue, Jun 25, 2013 at 9:17 AM, Samuel Lopes Grigolato < samuel.grigol...@gmail.com> wrote: > Hope

Re: [PHP] Some Advice

2013-06-25 Thread Samuel Lopes Grigolato
Hope it helps: http://stackoverflow.com/questions/3740845/php-session-without-cookies (go directly to the answer) On Tue, Jun 25, 2013 at 9:15 AM, Floyd Resler wrote: > I use sessions to store login information. However, a particular user of > a site can only access it at the library which has

Re: [PHP] PHP is Zero

2013-06-13 Thread Samuel Lopes Grigolato
Just found out that MySQL uses the same implicit conversion precedence on SQL clauses. That shows me that possibly exists some "higher order" rule that states this consistency, and changing that is outside the scope of PHP. On Thu, Jun 13, 2013 at 9:20 AM, Stuart Dallas wrote: > On 13 Jun 2013,

Re: AW: [PHP] PHP is Zero

2013-06-13 Thread Samuel Lopes Grigolato
I agree with you that this is a confusing and error-prone behavior, but I also agree with Richard Gray, I wouldn't try to change this for the same reason that a "1+1=3" shouldn't be touched if it's "correct" on a huge amount of existing codebases... On Thu, Jun 13, 2013 at 8:49 AM, BUSCHKE Danie

Re: [PHP] Detecting massive web hits

2013-04-12 Thread Samuel Lopes Grigolato
I don't know exactly how search engine spiders work, but just be cautious to not block these "users", they aren't customers but they may bring you some =). Again, I don't know if this is your case, but the possibility sparked on my mind anyway. Cheers. On Fri, Apr 12, 2013 at 12:23 PM, Angela B

Re: [PHP] target question

2013-03-25 Thread Samuel Lopes Grigolato
pup window), instead he will need to open the downloaded file in his computer. On Mon, Mar 25, 2013 at 12:23 PM, Jim Giner wrote: > On 3/25/2013 10:13 AM, Samuel Lopes Grigolato wrote: >> >> Have you tried to set a Content-Disposition header in the PHP script that >> creates

Re: [PHP] target question

2013-03-25 Thread Samuel Lopes Grigolato
Have you tried to set a Content-Disposition header in the PHP script that creates the PDF, asking the browser to "attach" the download? This way you don't even need a new window. Example from php.net/manual: // It will be called downloaded.pdf header('Content-Disposition: attachment; filename="do

Re: [PHP] Re: application level variable file

2013-03-22 Thread Samuel Lopes Grigolato
I highly suggest you to read some begginers book or the php.net/manualbefore trying to implement other technologies concepts with PHP. That is because you WILL find some "tricks" to do what you want, and you'll think PHP is a big chunk of bad smelling code, a totally wrong concept. Forget momentar

Re: [PHP] variable type - conversion/checking

2013-03-18 Thread Samuel Lopes Grigolato
Sorry if I'm missing something, there's a lot of replies after my first post on this thread. Is there something wrong with the "floor()" approach? I liked the regex solution but isn't it more expensive and more verbose than just doing a well commented "is_numeric" plus "floor/ceil" math? Just try

Re: [PHP] variable type - conversion/checking

2013-03-14 Thread Samuel Lopes Grigolato
Something like "if (is_numeric($var) && $var == floor($var))" will do the trick. I don't know if there's a better (more elegant) way. On Thu, Mar 14, 2013 at 3:09 PM, Matijn Woudt wrote: > On Thu, Mar 14, 2013 at 7:02 PM, georg wrote: > > > Hi, > > > > I have tried to find a way to check if a

Re: [PHP] Re: Generating CRUD code for normalized db

2013-03-11 Thread Samuel Lopes Grigolato
If you don't appreciate Open Source "solutions", why are you losing time on a Open Source Project Mailing List? Go pay (a lot) for a handholding framework and be happy =), just don't demotivate the ones who bring free software to reality, even if the free software is not as good as you would like.

RES: [PHP] Array help.

2012-10-24 Thread Samuel Lopes Grigolato
Could you try changing this: if($groupTest != FALSE) { to this: if($groupTest !== FALSE) { ? -Mensagem original- De: Paul Halliday [mailto:paul.halli...@gmail.com] Enviada em: quarta-feira, 24 de outubro de 2012 15:38 Para: PHP-General Assunto: [PHP] Array help. I am processing v4IP'

RES: [PHP] Re: User Timezone

2012-10-21 Thread Samuel Lopes Grigolato
Coincidentally, TODAY I had to adjust my clock one hour forward because of DST (poor sleep =[). No so easy-to-solve problem, after all... -Mensagem original- De: Matijn Woudt [mailto:tijn...@gmail.com] Enviada em: domingo, 21 de outubro de 2012 10:30 Para: Maciek Sokolewicz Cc: Karl DeSa

Re: [PHP] Re: User Timezone

2012-10-21 Thread Samuel Lopes Grigolato
Sorry if it's to dumb or hacky solution, but can't you just create a Date with JavaScript and send it with your request in a hidden field? You could guess the timezone with this date and the server's one. I don't know what you're going to do with this info, just be aware that if the users clock is

RES: [PHP] Re: User Timezone

2012-10-20 Thread Samuel Lopes Grigolato
Have you tried Google Timezone API? (https://developers.google.com/maps/documentation/timezone/) I don't know if it's free to use, probably not. You may note that you need user's longitude/latitude to query this API. A solution is to query Google Places API (https://developers.google.com/places/)

RES: [PHP] foreach

2012-10-16 Thread Samuel Lopes Grigolato
There is some cases that more code (and more cycles) is a good thing. For example, a multi-layer architecture (like presentation, business and data access) is more cpu-intensive than a single page doing everything in an entangled procedural style, but is far more easy to evolve! As Steven said, yo

RES: [PHP] Re: limiting

2012-10-09 Thread Samuel Lopes Grigolato
I don't know if it has any value, but here's my 2 cents: People here expect tricky questions. Of course "to be tricky" is subjective and is based on your knowledge level. When posting, please try to write every bit of effort you had so far trying to solve your problem. Besides that, please, don

RES: [PHP] Re: {ATTENTION} Re: [PHP] base64_decode

2012-10-02 Thread Samuel Lopes Grigolato
Another way to decode and inspect such data is to use utilities like: http://www.motobit.com/util/base64-decoder-encoder.asp By the way, never saw before this kind of sloppy irritating malicious "obfuscation" =). Does your server allow execution of the "eval" function? I consider this a security

RES: [PHP] Re: problem with my login script

2012-10-02 Thread Samuel Lopes Grigolato
I follow this rule of thumb: small blocks of highly understandable code. If this demands ternary conditionals or breaks, so be it! -Mensagem original- De: Tim Streater [mailto:t...@clothears.org.uk] Enviada em: terça-feira, 2 de outubro de 2012 08:37 Para: PHP General List Assunto: [PHP]

RES: [PHP] Re: Joining a team, where no wiki or docs are available

2012-09-24 Thread Samuel Lopes Grigolato
What about using visual code coverage instead of callstacks? I think the big picture is easier to digest. Maybe a combination of both, as code coverage won't provide the "time" axis of the monster. Something like http://phpcoverage.sourceforge.net/ -Mensagem original- De: Mihamina Rakot

RES: [PHP] Joining a team, where no wiki or docs are available

2012-09-24 Thread Samuel Lopes Grigolato
I would recommend reading this article: http://www.infoq.com/articles/tips-to-developers-starting-on-large-apps It's targeted to Java developers, but the concepts are valid to any language. Hope it helps. Cheers, Samuel. -Mensagem original- De: AmirBehzad Eslami [mailto:behzad.esl...@g

RES: [PHP] Day after Friday

2012-09-23 Thread Samuel Lopes Grigolato
Independent of programming language, good teaching skills will lead to self-taught developers with a bunch of best practices under the hood. I hope you are such a good teacher =). We need not PHP or Java developers, we need good and creative designers that can adapt to new tools. One language i

RES: RES: RES: [PHP] Re: Need help to understand a code

2012-09-22 Thread Samuel Lopes Grigolato
setembro de 2012 12:35 Para: Samuel Lopes Grigolato Cc: 'PHP List' Assunto: Re: RES: RES: [PHP] Re: Need help to understand a code On Sat, 2012-09-22 at 12:12 -0300, Samuel Lopes Grigolato wrote: I disagree with you Ashley, some arguments can be found here: http://sqlblog.com/blogs/aaro

RES: RES: [PHP] Re: Need help to understand a code

2012-09-22 Thread Samuel Lopes Grigolato
requested to the database layer. +1 to Maciek's suggestion, had totally forgotten this one. Cheers. -Mensagem original- De: Ashley Sheridan [mailto:a...@ashleysheridan.co.uk] Enviada em: sábado, 22 de setembro de 2012 11:52 Para: Samuel Lopes Grigolato; 'PHP List' Assunto: Re

RES: [PHP] Re: Need help to understand a code

2012-09-22 Thread Samuel Lopes Grigolato
+1 to bad maintainability of the code. As a suggestion, one better solution could be something like: [...] class Entity { public $id; public $name; } [...] $entity = new Entity(); foreach [...] $entity->$$key = $value; [...] And, of course, never ever use "*" in SQL queries. Samue

RES: [PHP] Risks involved in MyISAM to Innodb

2012-09-21 Thread Samuel Lopes Grigolato
Sure, the address you're looking for is: <http://lists.mysql.com/> http://lists.mysql.com/ Good hunting =) De: Girish Talluru [mailto:girish.dev1...@gmail.com] Enviada em: sexta-feira, 21 de setembro de 2012 10:15 Para: Samuel Lopes Grigolato Cc: php-general@lists.php.net

RES: [PHP] Risks involved in MyISAM to Innodb

2012-09-21 Thread Samuel Lopes Grigolato
I would start trying my DBMS user list. Or maybe you're afraid of impacts on PHP code? Cheers. -Mensagem original- De: Girish Talluru [mailto:girish.dev1...@gmail.com] Enviada em: sexta-feira, 21 de setembro de 2012 10:04 Para: php-general@lists.php.net Assunto: [PHP] Risks involved in M

RES: [PHP] Highlight Search Results

2012-09-18 Thread Samuel Lopes Grigolato
If you're dealing with a high amount of search data, I highly advise you to use something like SOLR. Match highlighting and a lot of other awesome things is easy breeze with it. -Mensagem original- De: Floyd Resler [mailto:fres...@adex-intl.com] Enviada em: terça-feira, 18 de setembro de

RES: [PHP] fets() escaping some characters

2012-09-11 Thread Samuel Lopes Grigolato
This issue has to do with HTML markup. You need to properly "escape" characters before sending them as text to the browser. Try to use this PHP function to escape your string: echo htmlspecialchars($yourstringhere); Regards, Samuel. -Mensagem original- De: sunil meena [mailto:sunil.extc2.

Re: [PHP] syntax error breaking in and out of php into html code

2012-08-26 Thread Samuel Lopes Grigolato
Maybe you have a "wrote: > On Sun, 2012-08-26 at 11:02 +0100, Stuart Dallas wrote: > > > On 26 Aug 2012, at 03:56, Ashley Sheridan > wrote: > > > > > Through the browser I get: > > > > > > Parse error: syntax error, unexpected $end > > > in /var/www/html/siteinquestion/index.php on line 356 > > >

RES: [PHP] Dynamic Content thoughts

2012-08-24 Thread Samuel Lopes Grigolato
Do you mean the ">" quotation marks? Have you tried to create a simple Notepad++ macro? I do this for things like formatting SQL from SQL Editor to SQL String in code, and vice versa. Cheers. -Mensagem original- De: tamouse mailing lists [mailto:tamouse.li...@gmail.com] Enviada em: sex

[PHP] PHP OpenSSL - Problem with "openssl_pkcs7_verify"

2012-07-21 Thread Samuel Lopes Grigolato
Hello, I'm having some trouble trying to put the "openssl_pkcs7_verify" function to work. I have a file signed with a valid certificate with this software: http://www.signfiles.com/p7s-signer/ What I'm trying to achieve is to extract the contents o