php-general Digest 22 Jan 2011 11:17:37 -0000 Issue 7146

Topics (messages 310960 through 310971):

Re: Organisational question: surely someone has implemented many Boolean values 
(tags) and a solution exist
        310960 by: David Harkness

Re: array to var - with different name
        310961 by: Donovan Brooke
        310963 by: Donovan Brooke

Re: email address syntax checker
        310962 by: Marc Guay

Script mysteriously restarting
        310964 by: Richard S. Crawford
        310965 by: Jim Lucas
        310966 by: Richard S. Crawford

Parse question
        310967 by: Ron Piggott
        310968 by: Joshua Kehn
        310969 by: Nicholas Kell
        310970 by: Ron Piggott

JunkBox - File Download Analytics
        310971 by: Lukasz Cepowski

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-gene...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
On Fri, Jan 21, 2011 at 4:44 AM, Dotan Cohen <dotanco...@gmail.com> wrote:

> Then I would have to check what values are available when inserting,
> and possibly normalise every so often. I'll think about that, and when
> I have enough data in the database I'll set up a test system to play
> with the possibility.
>

Yes, it's a much more complicated process, and one that I wouldn't enter
into without verifying there was a performance problem. The neat thing is
you could do this at any point as you can renumber the left and right values
at will--as long as you don't *reorder* them.


> I see, thanks. Good point about making sure that the problem exists
>
before trying to fix it, I've seen people optimise away where there is
> no bottleneck.
>

People who love to work on complicated problems often fall victim to
premature optimization because it's fun to do. I was guilty of this myself
earlier in my career, but as CPUs and memory and disk speeds increased over
the decades, it's harder to justify it. At least back then the optimization
that wasn't *necessary* still had a good payoff. Nowadays you can waste days
shaving 10ms off of an operation that takes 1s. Congratulations, you've just
poured $$ down the drain. But boy wasn't that fun! :)

Good luck with the implementation. I'd love to hear how it pans out once
you're done, and I'm sure the list would find it useful as well.

David

--- End Message ---
--- Begin Message ---
Paul M Foster wrote:
[snip]
Shawn, I don't know if I have a good reason, other than I rather like
working with string vars instead of array vars from $_REQUEST for
(sticky forms and conditionals). I can check/verify them as well in the
process.

You should probably get used to dealing with the array variables.
However, you can also look at the extract() function. It won't do
exactly what you want, but it will pull the array keys/values into the
current symbol table. Use with caution (note the second parameter to the
function).

Paul


Well, It occurs to me that you can't code in PHP without getting use to dealing with arrays. ;-)

I just much rather like typing:
<input name="f_email" value="<?PHP if (isset($t_email)) { print htmlspecialchars($t_email);} ?>" />

Instead of:
<input name="f_email" value="<?PHP if (isset($_GET['f_email'])) { print htmlspecialchars($_GET['f_email']);} ?>" />

or

if ($t_ok) {

}

instead of:
if ($_GET['f_ok']) {

}

Save's a lot of typing time as far as I can tell.

Donovan





--
D Brooke

--- End Message ---
--- Begin Message ---
Donovan Brooke wrote:
[snip]
if ($t_ok) {

}


Small correction.. with my established naming convention.. the above ideally would be:
> if ($b_ok) {
>
> }


D

--
D Brooke

--- End Message ---
--- Begin Message ---
> In fact I'm wondering why the OP doesn't just do what every other site
> seems to do - accept the registering user's input as valid, and ask them
> to validate it by sending them an email address to that address.

It still makes sense to validate the format of the address as soon as
possible.  The way you describe it the problem will have to be dealt
with further down the pipe when email is sent to "haha your form
doesn't have@validation!".  Why not grab it before it gets that far?

--- End Message ---
--- Begin Message ---
I've got a massive PHP script which takes nearly an hour to run. Sometimes,
when it comes close to the end, it mysterious restarts itself and I have to
wait for another hour for it to complete.

Is there any reason why a PHP script would restart itself like this?

FWIW, I'm running PHP5 with Apache 2 on a Linux server.

-- 
Sláinte,
Richard S. Crawford (rich...@underpope.com)
http://www.underpope.com

--- End Message ---
--- Begin Message ---
On 1/21/2011 12:37 PM, Richard S. Crawford wrote:
> I've got a massive PHP script which takes nearly an hour to run. Sometimes,
> when it comes close to the end, it mysterious restarts itself and I have to
> wait for another hour for it to complete.
> 
> Is there any reason why a PHP script would restart itself like this?
> 
> FWIW, I'm running PHP5 with Apache 2 on a Linux server.
> 

Clarification please.

Is this cli or browser based?

Jim

--- End Message ---
--- Begin Message ---
Ah, sorry. It's a browser-based script.


On Fri, Jan 21, 2011 at 1:28 PM, Jim Lucas <li...@cmsws.com> wrote:

> On 1/21/2011 12:37 PM, Richard S. Crawford wrote:
> > I've got a massive PHP script which takes nearly an hour to run.
> Sometimes,
> > when it comes close to the end, it mysterious restarts itself and I have
> to
> > wait for another hour for it to complete.
> >
> > Is there any reason why a PHP script would restart itself like this?
> >
> > FWIW, I'm running PHP5 with Apache 2 on a Linux server.
> >
>
> Clarification please.
>
> Is this cli or browser based?
>
> Jim
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Sláinte,
Richard S. Crawford (rich...@underpope.com)
http://www.underpope.com

--- End Message ---
--- Begin Message ---
Would someone write me a syntax so all the web site addresses in $data turn 
into links

$data = “Visit our web site http://www.site.com, http://www.secondsite.org and 
http://www.thirdsite.info.”;

My desired results for what I am asking for help turn $data into:

$output =“Visit our web site <a 
href=”http://www.site.com”>http://www.site.com</a>, <a 
href=”http://www.secondsite.org”>http://www.secondsite.org</a> and <a 
href=”http://www.thirdsite.info”>http://www.thirdsite.info</a>.”;

Please make provision for .net web sites as well.

Ron

The Verse of the Day
“Encouragement from God’s Word”
http://www.TheVerseOfTheDay.info 

--- End Message ---
--- Begin Message ---
On Jan 21, 2011, at 7:52 PM, Ron Piggott wrote:

> 
> Would someone write me a syntax so all the web site addresses in $data turn 
> into links
> 
> $data = “Visit our web site http://www.site.com, http://www.secondsite.org 
> and http://www.thirdsite.info.”;
> 
> My desired results for what I am asking for help turn $data into:
> 
> $output =“Visit our web site <a 
> href=”http://www.site.com”>http://www.site.com</a>, <a 
> href=”http://www.secondsite.org”>http://www.secondsite.org</a> and <a 
> href=”http://www.thirdsite.info”>http://www.thirdsite.info</a>.”;
> 
> Please make provision for .net web sites as well.
> 
> Ron

I would check for url regex patterns and build a solution off of that.

Regards,

-Josh
____________________________________
Joshua Kehn | josh.k...@gmail.com
http://joshuakehn.com


--- End Message ---
--- Begin Message ---
On Jan 21, 2011, at 6:52 PM, Ron Piggott wrote:

> 
> Would someone write me a syntax so all the web site addresses in $data turn 
> into links
> 
> $data = “Visit our web site http://www.site.com, http://www.secondsite.org 
> and http://www.thirdsite.info.”;
> 
> My desired results for what I am asking for help turn $data into:
> 
> $output =“Visit our web site <a 
> href=”http://www.site.com”>http://www.site.com</a>, <a 
> href=”http://www.secondsite.org”>http://www.secondsite.org</a> and <a 
> href=”http://www.thirdsite.info”>http://www.thirdsite.info</a>.”;
> 
> Please make provision for .net web sites as well.
> 
> Ron
> 
> The Verse of the Day
> “Encouragement from God’s Word”
> http://www.TheVerseOfTheDay.info 

"Would someone write me a syntax" hummm...

If you need help, we can do that, but if you want someone to write it for you, 
go here:

http://www.google.com/#sclient=psy&hl=en&site=&source=hp&q=hire+freelance+PHP+web+developer&aq=f&aqi=&aql=&oq=&pbx=1&fp=d87fcfdb2e6b7745

--- End Message ---
--- Begin Message ---
On Jan 21, 2011, at 6:52 PM, Ron Piggott wrote:



  Would someone write me a syntax so all the web site addresses in $data turn 
into links

  $data = “Visit our web site http://www.site.com, http://www.secondsite.org 
and http://www.thirdsite.info.”;

  My desired results for what I am asking for help turn $data into:

  $output =“Visit our web site <a 
href=”http://www.site.com”>http://www.site.com</a>, <a 
href=”http://www.secondsite.org”>http://www.secondsite.org</a> and <a 
href=”http://www.thirdsite.info”>http://www.thirdsite.info</a>.”;

  Please make provision for .net web sites as well.

  Ron

  The Verse of the Day
  “Encouragement from God’s Word”
  http://www.TheVerseOfTheDay.info 


"Would someone write me a syntax" hummm...

If you need help, we can do that, but if you want someone to write it for you, 
go here:

http://www.google.com/#sclient=psy&hl=en&site=&source=hp&q=hire+freelance+PHP+web+developer&aq=f&aqi=&aql=&oq=&pbx=1&fp=d87fcfdb2e6b7745

===

Now that I have seen some examples I will work on this and may ask a specific 
question tomorrow.  I know how to program in PHP --- I am just not strong in 
the string manipulation commands.  Thanks for these valuable links.  Ron 

--- End Message ---
--- Begin Message ---
Hello,

recently I had a trouble with tracking how many downloads of files I get, that is why I have decided to write my own simple solution and now I would like to share with product that can be usefull for many of You!

JunkBox :: File Download Analytics

http://junkbox.ognisco.com

JunkBox is a lightweight web application that can track your files and record every single click. You can get the total number of hits and statistics on who downloaded your files and how and when. Moreover it is completely transparent so every link looks like an ordinary link to an ordinary file.

For example this looks like an ordinary link to an ordinary file:

http://files.ognisco.com/junkbox/junkbox-0.2-r93-20110120.zip

but, just add '?stats' at the end:

http://files.ognisco.com/junkbox/junkbox-0.2-r93-20110120.zip?stats

and here you can get statistics of how many hits per day this particular file has.

What's more you can go and list files in the directory where you can see hits counter for every file inside.

http://files.ognisco.com/junkbox/

And at the end you can get the list of the most popular files:

http://files.ognisco.com/?top

Also you can create your own custom theme.

JunkBox is distributed under terms of GNU GPL license.

Home page: http://junkbox.ognisco.com
Online demo: http://junkbox.ognisco.com/demo

Feel free to download, test and use JunkBox.
Any feedback highly appreciated.

Thanks,

Lukasz (cepa) Cepowski
Krakow, Poland
+48 502 670 711
www.ognisco.com


--- End Message ---

Reply via email to