Re: [PHP] Storing passwords in session variables

2012-12-11 Thread Paul Halliday
On Tue, Dec 11, 2012 at 9:12 AM, Ashley Sheridan wrote: > ** > On Tue, 2012-12-11 at 08:58 -0400, Paul Halliday wrote: > > On Tue, Dec 11, 2012 at 9:02 AM, Ashley Sheridan > wrote: > > On Tue, 2012-12-11 at 08:46 -0400, Paul Halliday wrote: > > Hi, > > I

Re: [PHP] Storing passwords in session variables

2012-12-11 Thread Paul Halliday
On Tue, Dec 11, 2012 at 9:02 AM, Ashley Sheridan wrote: > ** > On Tue, 2012-12-11 at 08:46 -0400, Paul Halliday wrote: > > Hi, > > I have a form that has username and password fields. While the form > exists and contains various other fields the most common mode of > opera

[PHP] Storing passwords in session variables

2012-12-11 Thread Paul Halliday
ach time a request is made. Thanks. -- Paul Halliday http://www.pintumbler.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Array help.

2012-10-24 Thread Paul Halliday
On Wed, Oct 24, 2012 at 2:40 PM, Samuel Lopes Grigolato wrote: > Could you try changing this: > > if($groupTest != FALSE) { > > to this: > > if($groupTest !== FALSE) { > > ? Hah. Perfect! Thanks. > > -Mensagem original- > De: Paul Halliday [mailto:p

Re: [PHP] Awkward time processing

2012-08-02 Thread Paul Halliday
:) Perfect! Thank you. On Thu, Aug 2, 2012 at 1:25 PM, Robert Williams wrote: > On 8/2/12 05:51, "Paul Halliday" wrote: > > >>What I have is an array of values and timestamps: >> >>17 15:31 >>16 15:32 >>27 15:33 >>14 15:34 >>11

Re: [PHP] Awkward time processing

2012-08-02 Thread Paul Halliday
On Thu, Aug 2, 2012 at 12:27 PM, Ashley Sheridan wrote: > > > Paul Halliday wrote: > >>This is hideous, can anyone think of a more novel approach? >> >>What I have is an array of values and timestamps: >> >>17 15:31 >>16 15:32 >>27 15:33

[PHP] Awkward time processing

2012-08-02 Thread Paul Halliday
; case 03: $c03 += $c; break; case 04: $c04 += $c; break; . } } Works but wow is it ugly.. Thoughts? -- Paul Halliday http://www.pintumbler.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Can I do this in a single match/replace?

2012-06-27 Thread Paul Halliday
in/view/Main/2002068 now what I would like to do is replace inline adding "http://"; . $matches[n] . ">" . $matches[n] . "" Can this be done or do I need to say loop through matches (there can be none or many) and do a str_replace. Thoughts? Other ideas? Thanks.

Re: [PHP] Re: php form action breaks script

2012-06-14 Thread Paul Halliday
oing on. But I'd appreciate any advice you may have. >> >> >> Best, >> tim >> > If you check your apache log you'll probably see an error message. But the > problem seems to be that your string you are trying to echo is enclosed in > single quotes

Re: [PHP] Need Part-time Coder

2011-12-27 Thread Paul Halliday
;hello world"; >> ?> >> >> Reply to list with a few more details for a more detailed reply ;) >> >> > -- Paul Halliday http://www.squertproject.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: mysql_fetch_array() vs mysql_fetch_assoc() WAS: Re: [PHP] Why does this script run out of memory?

2011-10-28 Thread Paul Halliday
On Fri, Oct 28, 2011 at 7:19 PM, Daniel Brown wrote: > On Fri, Oct 28, 2011 at 18:13, Paul Halliday wrote: >> >> Whats the difference between fetch_assoc and fetch_row? >> >> I use: >> while ($row = mysql_fetch_row($theQuery)) { >>    doCartwheel; >&g

Re: [PHP] Why does this script run out of memory?

2011-10-28 Thread Paul Halliday
On Fri, Oct 28, 2011 at 1:38 PM, Jim Long wrote: > I'm running PHP 5.3.8 on FreeBSD 8.2 with MySQL 5.1.55. > > The script below is designed to be able to WHILE it's way through > a MySQL query result set, and process each row. > > However, it runs out of memory a little after a quarter million > r

[PHP] What is wrong with this preg_match?

2011-10-27 Thread Paul Halliday
27;Y-m-d'); } When I run it: $ ./process_patches.php 201-01-01 Usage: ./process_patches.php patches@innm2 ~/Code/Oculi $ ./process_patches.php 2011-011-01 Usage: ./process_patches.php patches@innm2 ~/Code/Oculi $ ./process_patches.php 2011-01-011 Works.. What am I doing wrong?

Re: [PHP] Any free online tests to test my PHP knowledge?

2011-09-22 Thread Paul Halliday
They are through a vendor whom the recruiter probably pays to administer > the test. > > Incidentally, despite having written an awful lot of working PHP code, I > don't do well on those tests. Helps my confidence a lot, as you can > imagine. > > Paul > Geez, closed boo

[PHP] Path question.

2011-07-28 Thread Paul Halliday
I have a few scripts that use "../location/file" Is this interpreted differently on some systems? Thanks. -- Paul Halliday http://www.squertproject.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Session question

2011-05-17 Thread Paul Halliday
$_REQUEST['id'])) { $id = 0; } else { $id = $_REQUEST['id'];} // Kill the session if the ids dont match. if ($id != $_SESSION['id']) { sKill(); } // Kill the session if timeout is exceeded. if (isset($_SESSION['LAST_ACTIVITY']) && (time() - $_SESS

[PHP] Protecting against session hijacking.

2011-03-23 Thread Paul Halliday
I am not sure I am doing this right, I have login.php which does: $ua = $_SERVER['HTTP_USER_AGENT']; $ua .= rand(0,4200); $ua = md5($ua); and upon successful auth, I push them to the main program: header ("Location: squert.php?id=$ua"); at the beginning of squert.php I have: if(!isset($_SESSI

[PHP] 2 submit buttons.

2011-02-14 Thread Paul Halliday
I have 2 buttons on a page: if (isset($_POST['botton1'])) {dothing1();} if (isset($_POST['button2'])) {dothing2();} They both work as intended when I click on them. If however I click within a text box and hit enter, they both fire. Is there a way to stop this? Thanks. --

Re: [PHP] 95th percentile of an array.

2011-01-29 Thread Paul Halliday
On Sat, Jan 29, 2011 at 2:28 PM, Adam Richardson wrote: > For the nearest rank computation, you could use the following: > > $arr = > array(12,89,65,23,90,99,9,15,56,67,3,52,78,12,10,88,77,77,77,77,77,77,77); > sort($arr); > $score_representing_95th_percentile = $arr[round((95/100) * count($arr) -

[PHP] 95th percentile of an array.

2011-01-29 Thread Paul Halliday
What is the quickest way to do this? Will stats_stat_percentile work? If so, does anyone have examples of its operation? Keep in mind that my math is terrible. Use small words :) Thanks. -- Paul Halliday http://www.pintumbler.org -- PHP General Mailing List (http://www.php.net/) To

[PHP] Global or include?

2011-01-05 Thread Paul Halliday
'global' within each script/function? Thanks! -- Paul Halliday http://www.pintumbler.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] timezone math problem.

2010-09-16 Thread Paul Halliday
ot; Aside from upgrading the second box, is there some other logic that is wrong? Thanks. -- Paul Halliday Ideation | Individualization | Learner | Achiever | Analytical http://www.pintumbler.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Reformat array result.

2010-09-08 Thread Paul Halliday
though. I think I know what needs to happen, I just cant come up with the logic. Any push in the right direction would be appreciated. -- Paul Halliday Ideation | Individualization | Learner | Achiever | Analytical http://www.pintumbler.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] problem retrieving variables.

2010-09-02 Thread Paul Halliday
On Thu, Sep 2, 2010 at 5:43 PM, Jim Lucas wrote: > Paul Halliday wrote: >> I think I just might be missing the logic here. >> >> I have a page that is created and within this page, I include an >> iframe like this: >> >> $qp = urlencode("

[PHP] problem retrieving variables.

2010-09-02 Thread Paul Halliday
REQUEST['qp']; What am I missing? Thanks. -- Paul Halliday Ideation | Individualization | Learner | Achiever | Analytical http://www.pintumbler.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Array help.

2010-07-30 Thread Paul Halliday
On Fri, Jul 30, 2010 at 3:44 PM, Joshua Kehn wrote: > > On Jul 30, 2010, at 2:36 PM, Paul Halliday wrote: > >> I have a query that may not always return a result for a value, I need >> to reflect this with a "0". I am trying to overcome this by doing this >> (

[PHP] Array help.

2010-07-30 Thread Paul Halliday
nly return 2 rows: 15 | 30 0 | 15547 What am I doing wrong? Is there a more elegant way to achieve what I want? Thanks. -- Paul Halliday Ideation | Individualization | Learner | Achiever | Analytical http://www.pintumbler.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] MSSQL failing.

2010-07-09 Thread Paul Halliday
On Fri, Jul 9, 2010 at 7:12 AM, Paul Halliday wrote: >>> >>> What am I missing? >>> >> >> Is the slash before the domain name above just a typo in your e-mail? >> It took a while to get mssql configured to where I could test it here >> since we

Re: [PHP] MSSQL failing.

2010-07-09 Thread Paul Halliday
>> >> What am I missing? >> > > Is the slash before the domain name above just a typo in your e-mail? > It took a while to get mssql configured to where I could test it here > since we're using Microsoft's SQL Server Driver for PHP (if you are > running PHP under Windows, I'd strongly recommend thi

[PHP] MSSQL failing.

2010-07-08 Thread Paul Halliday
Is there something that needs to be tweaked or added to get this to work? I am trying to connect to server 2008 w/ MS SQL 2008. I can see the connections fail in the servers event logs if I take away \domain from \domain\username (mixed auth is turned off) so the communication is somewhat working.

[PHP] Pagination?

2010-06-08 Thread Paul Halliday
I just spent the last 1/2 hour looking at many different solutions for this. Is there a universal favorite? Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Array group and sum values.

2010-05-11 Thread Paul Halliday
On Tue, May 11, 2010 at 4:03 PM, Jim Lucas wrote: > Paul Halliday wrote: >> On Tue, May 11, 2010 at 2:25 PM, Jim Lucas wrote: >>> Paul Halliday wrote: >>>> I have this: >>>> >>>> while ($row = mysql_fetch_array($theData[0])) { >>>

Re: [PHP] Array group and sum values.

2010-05-11 Thread Paul Halliday
On Tue, May 11, 2010 at 2:25 PM, Jim Lucas wrote: > Paul Halliday wrote: >> I have this: >> >> while ($row = mysql_fetch_array($theData[0])) { >> >>     $col1[] = $row[0]; >>     $col2[] = lookup($row[1]); // this goes off and gets the country name. >

[PHP] Array group and sum values.

2010-05-11 Thread Paul Halliday
I have this: while ($row = mysql_fetch_array($theData[0])) { $col1[] = $row[0]; $col2[] = lookup($row[1]); // this goes off and gets the country name. I then loop through col1 and col2 to produce something like this: 52 ARMENIA 215 CANADA 57 CANADA 261 COLOMBIA 53

[PHP] upload directly into a resource?

2010-05-03 Thread Paul Halliday
I have some code that is currently static. It runs via Cron, generating images which can then be viewed via some other PHP. What I want to do is allow a user to upload data which I can then pipe directly into the existing program to produce on the fly images. I am looking at this: http://www.php.

[PHP] Replace a space with a newline every 2 spaces

2010-04-22 Thread Paul Halliday
Ex: "This is the string and it is this long" This is the string and it is this long I found some long functions to achieve this but I couldn't help but think that it could be done in a couple lines. Possible? Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: ht

[PHP] A cleaner way to do this?

2010-03-25 Thread Paul Halliday
I am working on a parser for logs from a spam firewall. The format is predictable until it reaches a certain point. It then varies greatly. There are 2 things I want to grab from this area; the size of the message (if it exists) and the subject (if it exists) The line might look something like th

Re: [PHP] Re: Help with exec.

2010-03-03 Thread Paul Halliday
proc_close($process); } thanks. On Wed, Mar 3, 2010 at 10:08 AM, Ian wrote: > On 03/03/2010 13:01, Paul Halliday wrote: >> I need to pipe some data to an external application. >> >> I have this: >> >> while ($row = mysql_fetch_array($theData[0])) { >>

Re: [PHP] Help with exec.

2010-03-03 Thread Paul Halliday
2010 at 9:04 AM, Richard Quadling wrote: > On 3 March 2010 13:01, Paul Halliday wrote: >> I need to pipe some data to an external application. >> >> I have this: >> >> while ($row = mysql_fetch_array($theData[0])) { >>    $src_ip[] = $row[0]; >&

[PHP] Help with exec.

2010-03-03 Thread Paul Halliday
I need to pipe some data to an external application. I have this: while ($row = mysql_fetch_array($theData[0])) { $src_ip[] = $row[0]; $dst_ip[] = $row[1]; $sig_desc[] = $row[2]; $rec ++; if ( $rec == $recCount ) { break; } } for ($i = 0; $i < sizeof($src_ip)

Re: [PHP] ip-to-country

2009-10-19 Thread Paul Halliday
You might find this useful: http://sites.google.com/site/interrupt0x13h/code/ip2c On Sun, Oct 18, 2009 at 4:03 PM, SED wrote: > Hi, > > How can I access an index for IP to a country (or a more detailed location)? > I have not yet found a function for that in PHP nor a free to use website > that

[PHP] What is the best way to process live data?

2009-08-29 Thread Paul Halliday
For those of you that remember (not likely but anyway) I am working on some code that splits CLF records and feeds them into a database. What I need to do now is automate it. So what I have is a program (urlsnarf) that redirects its output (simple "cmd > file.txt") to a file. The script currently

Re: [PHP] Re: Clean break.

2009-07-31 Thread Paul Halliday
know what you are doing :). My coding is limited to hammering away at the search box on php.net until I get a push in the right direction. It's just a hack from there. Using phpster's substr suggestion has already sped this up considerably. 2009/7/31 Ollisso : > On Sat, 01 Aug 2009 00

[PHP] Clean break.

2009-07-31 Thread Paul Halliday
Whats the cleanest (I have a really ugly) way to break this: [21/Jul/2009:00:00:47 -0300] into: date=21/jul/2009 time=00:00:47 Caveats: 1) if the day is < 10 the beginning of the string will look like "[1/... 2) the "-0300" will differ depending on DST or TZ. I don't need it though, it just ha