Search found 24 matches

by neogeek
Wed Jul 05, 2006 9:02 pm
Forum: Installation and Configuration
Topic: file_get_contents() will not open remote file.
Replies: 18
Views: 22921

From what I know file_get_contents() will only be able to fetch a remote file in PHP5. I'm not sure it ever worked in PHP4 or any version before that. The function that I wrote works for fetching any kind of external file and has worked successfully for me on every project I have required it for eve...
by neogeek
Mon May 29, 2006 10:55 pm
Forum: PHP - Code
Topic: Bad Word Censor [UNSOLVED-AGAIN]
Replies: 11
Views: 1244

This is the script that I used to censored words: $word_filter = explode("\n", @file_get_contents('word_filter.txt')); while (list($key, $value) = @each($word_filter)) { $conversation = ereg_replace('[[:<:]](' . $value . ')[[:>:]]', '<span class="censor">censored!</span>', $conve...
by neogeek
Thu May 25, 2006 5:48 pm
Forum: Installation and Configuration
Topic: file_get_contents() will not open remote file.
Replies: 18
Views: 22921

(But there is no need to reinvent the wheel, since http://www.php.net/curl already does this for us...) Very true. Only I wanted a surefire way to fetch files especially if the server this script was running on didn't have that library installed. (I now know that it is a common PHP library on many ...
by neogeek
Thu May 25, 2006 5:35 pm
Forum: Installation and Configuration
Topic: file_get_contents() will not open remote file.
Replies: 18
Views: 22921

Thank timvw, I didn't know that the url it was redirecting to was in the header. Thus I updated the function to include a check to see if its getting the correct file. function fetch_remote_file($file) { $path = parse_url($file); $fs = @fsockopen($path['host'], 80); if ($fs) { $header = 'GET ' . $pa...
by neogeek
Thu May 25, 2006 4:13 pm
Forum: Installation and Configuration
Topic: file_get_contents() will not open remote file.
Replies: 18
Views: 22921

Well what happened was this. I was looking to download this file: http://startupguide.typepad.com/favicon.ico And when you go to it manually it brings you to this file: http://6a.typepad.com/favicon.ico But when you use the function that I wrote, you get this in the file that it returns: <!DOCTYPE H...
by neogeek
Thu May 25, 2006 4:04 pm
Forum: Installation and Configuration
Topic: file_get_contents() will not open remote file.
Replies: 18
Views: 22921

I have no idea, but it does. I have been able to successfully download everything I have tossed in it except for a cross-domain referer.
by neogeek
Thu May 25, 2006 2:36 pm
Forum: Installation and Configuration
Topic: file_get_contents() will not open remote file.
Replies: 18
Views: 22921

I was running into the same issue, here is what I came up with: viewtopic.php?p=266317&highlight=#266317
by neogeek
Wed May 24, 2006 10:14 pm
Forum: PHP - Code
Topic: file_get_contents() or copy() in php4
Replies: 7
Views: 7109

Thank you everyone for your help with this matter. After some more messing around in PHP I think I finally have a solution: define('lnbr', "\n"); function fetch_remote_file($file) { $path = parse_url($file); $fs = @fsockopen($path['host'], 80); if ($fs) { $header = 'GET ' . $path['path'] ....
by neogeek
Wed May 24, 2006 7:08 pm
Forum: PHP - Code
Topic: Alternating table styles?
Replies: 14
Views: 2723

Here is a really neat JavaScript solution: http://bitesizestandards.com/bites/auto ... oured-rows
by neogeek
Wed May 24, 2006 8:17 am
Forum: PHPDN Suggestions
Topic: Printable Version
Replies: 7
Views: 9028

It's not as powerfull as the plugin you suggested I imagine, but I wrote a greasemonkey script that might do something like what you want to do. http://www.neo-geek.net/development/firefox/greasemonkey/phpbb_printable.user.js Hope that helps with what you wanted to do. If you have any suggestions as...
by neogeek
Wed May 24, 2006 6:55 am
Forum: Javascript
Topic: how to stop storing field data in forms using javascript...
Replies: 9
Views: 1482

Wow, that's really simple! I did some research on that attribute and from what I can tell this is how it is used:

Code: Select all

<form action="form.php" method="post" autocomplete="off">

</form>
Note: This attribute is not a valid HTML attribute.
by neogeek
Wed May 24, 2006 6:00 am
Forum: General Discussion
Topic: What's your favourite PHP Editor?
Replies: 533
Views: 235128

SciTE is my text editor of choice for all the languages that I program in. It's lightweight, has syntax highlighting, tabs and export to pdf just to name a few features. Highly recommended for even just the casual developer. I also find it a great substitute for notepad, as it loads just as quickly.
by neogeek
Wed May 24, 2006 5:09 am
Forum: PHP - Code
Topic: named anchors in dynamic content
Replies: 9
Views: 935

@GM: Exactly, my reason for coding my example the way I did was to allow for a one file testing script. When implementing the script, they way you set it up was perfect.
by neogeek
Wed May 24, 2006 4:52 am
Forum: General Discussion
Topic: What music do you code by?
Replies: 418
Views: 144873

by neogeek
Wed May 24, 2006 4:46 am
Forum: PHP - Code
Topic: named anchors in dynamic content
Replies: 9
Views: 935

I set up a quick example of how this can be done. Hope it does the trick. <?php if (!isset($_GET['use_id'])) { print('<a href="redirect.php?use_id=test">Start Test</a>'); } else { print('<a href="redirect.php#' . $_GET['use_id'] . '">Return</a>'); } ?>