php-general Digest 28 Oct 2008 16:28:39 -0000 Issue 5760

Topics (messages 282520 through 282532):

clean data
        282520 by: blackwater dev
        282522 by: Micah Gersten
        282523 by: blackwater dev
        282524 by: Micah Gersten
        282531 by: Bastien Koert

ImageMagick functions
        282521 by: pichoscosama
        282528 by: Martijn Korse

Parsing URLs
        282525 by: Ron Piggott
        282526 by: Eric Butera
        282530 by: Yeti

Re: Replacing with f*ck and f*cking
        282527 by: Ryan S

Re: PHP XSLT caching
        282529 by: Aschwin Wesselius

Re: clear a mysql table
        282532 by: Lupus Michaelis

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
I have a project now where we would like to properly remove unwanted data
before it goes into the db such as ` and of course slashes.  The problem is
I have tons of pages.  Is there an easy way to add in a clean up routine on
the db side to clean it going in and coming out without having to touch each
page that inserts it into the db and each page that presents it?

I'm using a MySQL db.


Thanks!

--- End Message ---
--- Begin Message ---
Are you using MySQL abstraction?  That's the easiest way to control what
data goes into your DB in a central place.

Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com



blackwater dev wrote:
> I have a project now where we would like to properly remove unwanted data
> before it goes into the db such as ` and of course slashes.  The problem is
> I have tons of pages.  Is there an easy way to add in a clean up routine on
> the db side to clean it going in and coming out without having to touch each
> page that inserts it into the db and each page that presents it?
>
> I'm using a MySQL db.
>
>
> Thanks!
>
>   

--- End Message ---
--- Begin Message ---
Yes, I agree but the code I am inheriting doesn't use abstraction
unfortunately.

On Mon, Oct 27, 2008 at 9:38 PM, Micah Gersten <[EMAIL PROTECTED]> wrote:

> Are you using MySQL abstraction?  That's the easiest way to control what
> data goes into your DB in a central place.
>
> Thank you,
> Micah Gersten
> onShore Networks
> Internal Developer
> http://www.onshore.com
>
>
>
> blackwater dev wrote:
> > I have a project now where we would like to properly remove unwanted data
> > before it goes into the db such as ` and of course slashes.  The problem
> is
> > I have tons of pages.  Is there an easy way to add in a clean up routine
> on
> > the db side to clean it going in and coming out without having to touch
> each
> > page that inserts it into the db and each page that presents it?
> >
> > I'm using a MySQL db.
> >
> >
> > Thanks!
> >
> >
>

--- End Message ---
--- Begin Message ---
In that case, I suggest you look to the MySQL lists for tips on handling
data coming in.

Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com



blackwater dev wrote:
> Yes, I agree but the code I am inheriting doesn't use abstraction
> unfortunately.
>
> On Mon, Oct 27, 2008 at 9:38 PM, Micah Gersten <[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>> wrote:
>
>     Are you using MySQL abstraction?  That's the easiest way to
>     control what
>     data goes into your DB in a central place.
>
>     Thank you,
>     Micah Gersten <http://www.onshore.com>
>
>
>
>     blackwater dev wrote:
>     > I have a project now where we would like to properly remove
>     unwanted data
>     > before it goes into the db such as ` and of course slashes.  The
>     problem is
>     > I have tons of pages.  Is there an easy way to add in a clean up
>     routine on
>     > the db side to clean it going in and coming out without having
>     to touch each
>     > page that inserts it into the db and each page that presents it?
>     >
>     > I'm using a MySQL db.
>     >
>     >
>     > Thanks!
>     >
>     >
>
>

--- End Message ---
--- Begin Message ---
On Mon, Oct 27, 2008 at 9:53 PM, Micah Gersten <[EMAIL PROTECTED]> wrote:

> In that case, I suggest you look to the MySQL lists for tips on handling
> data coming in.
>
> Thank you,
> Micah Gersten
> onShore Networks
> Internal Developer
> http://www.onshore.com
>
>
>
> blackwater dev wrote:
> > Yes, I agree but the code I am inheriting doesn't use abstraction
> > unfortunately.
> >
> > On Mon, Oct 27, 2008 at 9:38 PM, Micah Gersten <[EMAIL PROTECTED]
> > <mailto:[EMAIL PROTECTED]>> wrote:
> >
> >     Are you using MySQL abstraction?  That's the easiest way to
> >     control what
> >     data goes into your DB in a central place.
> >
> >     Thank you,
> >     Micah Gersten <http://www.onshore.com>
> >
> >
> >
> >     blackwater dev wrote:
> >     > I have a project now where we would like to properly remove
> >     unwanted data
> >     > before it goes into the db such as ` and of course slashes.  The
> >     problem is
> >     > I have tons of pages.  Is there an easy way to add in a clean up
> >     routine on
> >     > the db side to clean it going in and coming out without having
> >     to touch each
> >     > page that inserts it into the db and each page that presents it?
> >     >
> >     > I'm using a MySQL db.
> >     >
> >     >
> >     > Thanks!
> >     >
> >     >
> >
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
I would take this as an opportunity to rewrite the db code by adding a
validation/cleansing/filtering code and then a single core place to interact
with the db. Start by doing this for maybe the most touched page for your
data and any new pages being created. Then slowly retrofit other pages as
you go in to make changes to them. Pretty soon you'll have a much simpler
system to support and making further changes to manipulate the data before
db interaction will be tons easier

-- 

Bastien

Cat, the other other white meat

--- End Message ---
--- Begin Message ---
When I look at online documentations of PHP I can not see ImageMagick 
functions. Only classes. What happened?

-- 
Allah varsa çocuklar neden ölüyor ki?

--- End Message ---
--- Begin Message ---
These classes contain methods which are just normal functions only residing
in a class.....


pichoscosama wrote:
> 
> When I look at online documentations of PHP I can not see ImageMagick 
> functions. Only classes. What happened?
> 
> -- 
> Allah varsa çocuklar neden ölüyor ki?
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 


-----
http://devshed.excudo.net http://devshed.excudo.net 
-- 
View this message in context: 
http://www.nabble.com/ImageMagick-functions-tp20199962p20201449.html
Sent from the PHP - General mailing list archive at Nabble.com.


--- End Message ---
--- Begin Message ---
I would like to parse the URLs in the values after the domain name.  

The URLs are the results of mod re-write statements.  

Example 1:

http://www.domain.com/page/file/

The desired results would be: 
$web_page_access[1] = "file"

Example 2:

http://www.domain.com/page/file/2/ 

The desired results would be:
$web_page_access[1] = "file"
$web_page_access[2] = "2"

Any help please?

Ron


--- End Message ---
--- Begin Message ---
On Mon, Oct 27, 2008 at 10:04 PM, Ron Piggott
<[EMAIL PROTECTED]> wrote:
> I would like to parse the URLs in the values after the domain name.
>
> The URLs are the results of mod re-write statements.
>
> Example 1:
>
> http://www.domain.com/page/file/
>
> The desired results would be:
> $web_page_access[1] = "file"
>
> Example 2:
>
> http://www.domain.com/page/file/2/
>
> The desired results would be:
> $web_page_access[1] = "file"
> $web_page_access[2] = "2"
>
> Any help please?
>
> Ron
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

// $uri = htmlspecialchars($SERVER['REQUEST_URI'], ENT_QUOTES, 'UTF-8');
$uri = htmlspecialchars('/page/file/2/', ENT_QUOTES, 'UTF-8');;
$uri = trim($uri, "/");
$parts = explode("/", $uri);
var_dump($parts);

or use parse_url to get down to the bits you need.

--- End Message ---
--- Begin Message ---
One could also abuse basename and pathinfo.
Works in PHP4+

<?php
$uri = 'http://www.domain.com/page/file/';
$pathinfo = pathinfo($uri);
$webpageaccess = array();
$webpageaccess[1] = $webpageaccess[2] = '';
if (isset($pathinfo['basename'])) $webpageaccess[1] = $pathinfo['basename'];
if (isset($pathinfo['dirname'])) $webpageaccess[2] =
basename($pathinfo['dirname']);
//var_dump($webpageaccess);
?>

--- End Message ---
--- Begin Message ---
Thanks for all your input guys!

> Scunthorpe

LOL!
Never heard of the place but ...f**k i think i am a geek for finding it funny!
Reminds me of quite  few people tho...

Cheers!
R

2008/10/26 Colin Guthrie <[EMAIL PROTECTED]>:
> Ashley Sheridan wrote:
>>
>> What you really need to watch out for is words which you're going to
>> censor which might be part of other names. Sex is an obvious one, as it
>> appeared in the borough name of my old address: Middlesex.
>
> I can't believe you didn't use the infamous "Scunthorpe" as your example :p
>
> Col

There was a post on Coding Horror not long ago that brought this one up:
http://google.com/search?q=consbreastution

http://www.codinghorror.com/blog/archives/001176.html

-- 
Dotan Cohen

http://what-is-what.com
http://gibberish.co.il
א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת

ä-ö-ü-ß-Ä-Ö-Ü





--- End Message ---
--- Begin Message ---
vladimirn wrote:
Hi all,
i was wondering whats the best approach to do next.
I have an xml file delivered from service of my partner. On my web server (windows) i have xslt files used for xml transformation. Those files are getting bigger, so i have request to cash them and use
cashed. I was thinkging about memcahce php(dunno if it will work on windows
server and tbh never used it before).
So i am sure that there must be several ways to cash xslt files. I google
for this, but i am not sure that i found any solution i can use.
What would be the best approach to solve this? I just would like to see more
ideas :)
LOL sure, if someone already have a good working solution i would appreciate
any link or code :0)
Greetings,
V
Hi,

I believe one of the two of the XSLT implementations in PHP, does (limited) caching in itself. But I'm not in the mood to find out which one.
--

Aschwin Wesselius

/'What you would like to be done to you, do that to the other....'/

--- End Message ---
--- Begin Message ---
Daniel P. Brown a écrit :
    In direct response to your question, you're looking for the
TRUNCATE command.

  I hope he doesn't have any foreign keys nor triggers.

--
Mickaël Wolff aka Lupus Michaelis
http://lupusmic.org

--- End Message ---

Reply via email to