Slow search code

Coding Critique is the place to post source code for peer review by other members of DevNetwork. Any kind of code can be posted. Code posted does not have to be limited to PHP. All members are invited to contribute constructive criticism with the goal of improving the code. Posted code should include some background information about it and what areas you specifically would like help with.

Popular code excerpts may be moved to "Code Snippets" by the moderators.

Moderator: General Moderators

jvnane
Forum Newbie
Posts: 10
Joined: Fri Jul 10, 2009 1:45 am

Re: Slow search code

Post by jvnane »

VladSun wrote:Is it faster than your PHP tool?
Soooo much faster... it's actually useful now... and to think my original search function was much more complex than the one i posted up above and this final solution is like a 10th of the code, just from that one line u showed me... also something that's confusing me now is passing the $path variable. I have this input on the page before the search that has this in it <input type="hidden" name="Path" value="\\Odcsrv\share1\ODC\FMS_FMF_IMET"></input>. When i go to the search page the variable $path is created like this $path = $_POST[Path]. When I echo this $path it shows this \\\\Odcsrv\\share1\\ODC\\FMS_FMF_IMET. It basically doubles the backslashes. The only thing i can think of, which would be quite annoying, is to change the value back to forward slashes and then use ereg_replace once the search.php has been pulled up... what do you think.
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: Slow search code

Post by VladSun »

It basically doubles the backslashes.
http://bg2.php.net/magic_quotes

And ...
$path = $_POST[Path];
should be

Code: Select all

$path = $_POST['Path'];
There are 10 types of people in this world, those who understand binary and those who don't
jvnane
Forum Newbie
Posts: 10
Joined: Fri Jul 10, 2009 1:45 am

Re: Slow search code

Post by jvnane »

Still doesn't work...
jvnane
Forum Newbie
Posts: 10
Joined: Fri Jul 10, 2009 1:45 am

Re: Slow search code

Post by jvnane »

never mind... used stripslashes() and it works... thanks for all the help.
Post Reply