Search found 41 matches

by abeall
Tue Mar 06, 2007 8:56 pm
Forum: PHP - Code
Topic: Easiest way to fetch filename
Replies: 4
Views: 642

feyd | Please use , and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color] Here's wh...
by abeall
Tue Mar 06, 2007 8:13 pm
Forum: PHP - Code
Topic: Easiest way to fetch filename
Replies: 4
Views: 642

Easiest way to fetch filename

Strangely I can't seem to find an easy way to determine the filename of the currently running script. I don't want the pathname, just the filename itself. Example, for a file in http://www.foo.com/bar/blah.php, I would want blah.php . Basically, I have a series of php files which draw together multi...
by abeall
Sat Feb 10, 2007 9:32 pm
Forum: PHP - Code
Topic: [Solved]XML document saved with bad formatting
Replies: 17
Views: 4510

Solution: foreach ($_POST as $key => $val) $_POST[$key] = str_replace("\r",'',$_POST[$key]); Apparently, the parser converts \r to $#xD; but leaves \n alone. Since I was posting from a Windows machine, the data has \r\n at the end of each line, and the parser encoded \r but left \n alone. ...
by abeall
Fri Feb 09, 2007 10:54 am
Forum: PHP - Code
Topic: [Solved]XML document saved with bad formatting
Replies: 17
Views: 4510

Fair enough. And great idea, I'll head over to xmlsoft and see if they can help me solve my problem. I'll report back if I find anything.

Thanks, all!
by abeall
Fri Feb 09, 2007 10:17 am
Forum: PHP - Code
Topic: [Solved]XML document saved with bad formatting
Replies: 17
Views: 4510

Sorry, I'm not disagreeing, I just don't understand, there's obviously something I'm missing. I guess I don't understand why \n is being converted to &#xD;, when, as you said, neither will appear in HTML without the <pre> tag. In that vein they seem the same to me, only \n actually display corre...
by abeall
Fri Feb 09, 2007 9:08 am
Forum: PHP - Code
Topic: SQL query question: Searching for multiple key words
Replies: 3
Views: 552

If I understand correctly about your reference to SQL injection, I believe I'm safe by using: $terms = sqlite_escape_string($_GET['searchquery']); Or were you referring to that fact that, in my current code, a user could input a million search terms and PHP would create a massive overloaded query? T...
by abeall
Fri Feb 09, 2007 9:03 am
Forum: PHP - Code
Topic: [Solved]XML document saved with bad formatting
Replies: 17
Views: 4510

In that case, if I wanted to display it in HTML, I'd have to convert successive spaces to &nbsp;. With linebreaks, I'd have to convert \n to <br/>, like you mentioned. The problem is:
1) &#xD; does not display as a linebreak in HTML
2) I am not trying to display my data in HTML
by abeall
Fri Feb 09, 2007 1:38 am
Forum: PHP - Code
Topic: [Solved]XML document saved with bad formatting
Replies: 17
Views: 4510

I don't understand what "payload data" is. What I know is that: 1) If I add line breaks to the XML file with a text editor, they aren't converted to &#xD;. 2) The data that is passed to PHP via POST with linebreaks(is that the "payload data"?) gets saved with linebreaks conve...
by abeall
Fri Feb 09, 2007 1:20 am
Forum: PHP - Code
Topic: SQL query question: Searching for multiple key words
Replies: 3
Views: 552

Here's what I did. Someone clue me in if it's idiotic: $terms = sqlite_escape_string($_GET['searchquery']); $terms = str_replace(',',' ',$terms); $terms = explode(' ',$terms); $search = ""; foreach($terms as $t){ if(strlen($t)<3) continue; // skip search terms of 3 chars or less $search .=...
by abeall
Fri Feb 09, 2007 12:55 am
Forum: PHP - Code
Topic: SQL query question: Searching for multiple key words
Replies: 3
Views: 552

SQL query question: Searching for multiple key words

I have a basic SQLite table with various short entries. I am creating a simple search by doing something like: $term = $_POST['search']; $query = "SELECT * FROM Posts WHERE title LIKE '%".$term."%'"; $result = $db->arrayQuery($query,SQLITE_ASSOC); It works great, but what I would...
by abeall
Fri Feb 09, 2007 12:49 am
Forum: Javascript
Topic: Multiple keyword search.
Replies: 1
Views: 600

Multiple keyword search.

I have a basic SQLite table with various short entries. I am creating a simple search by doing something like: $term = $_POST['search']; $query = "SELECT * FROM Posts WHERE title LIKE '%".$term."%'"; $result = $db->arrayQuery($query,SQLITE_ASSOC); It works great, but what I would...
by abeall
Thu Feb 08, 2007 9:19 pm
Forum: PHP - Code
Topic: Unbalanced includes
Replies: 9
Views: 1234

Sure, I knew how: a) Give it to a developer, they'll make it work b) Use File > Publish c) Use Dreamweaver Insert Flash (Ever wonder why there's so much horrible markup out there? Choose b) and c) ) Needless to say, I *started* learning AS before HTML. I learned HTML (the whole 30 seconds it takes t...
by abeall
Thu Feb 08, 2007 9:07 pm
Forum: PHP - Code
Topic: [Solved]XML document saved with bad formatting
Replies: 17
Views: 4510

Most likely that is the case, although I can't think of a situation where that would be true, other than for attributes(line break would obviously blow that apart). The problem is, I'm using the line-breaks in text node content, so it's obviously safe. Still kinda stumped how to deal with it. My onl...
by abeall
Thu Feb 08, 2007 8:58 pm
Forum: PHP - Code
Topic: Unbalanced includes
Replies: 9
Views: 1234

I learned ActionScript before I learned HTML or even heard of CSS(as hard as that might be to believe, I had a very weird start in web technology), I think you could call me corrupted beyond repair ;-) I do love Flash, though.
</rabbit:trail>
by abeall
Thu Feb 08, 2007 8:48 pm
Forum: PHP - Code
Topic: Unbalanced includes
Replies: 9
Views: 1234

You can't separate them in any coding language.
You can in ActionScript, the bane of my existence.