There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
access audio avg avg 8 bios blue screen boot bsod computer connection cpu crash css dell desktop dma driver drivers dvd email error excel explorer firefox firefox 3 freeze gimp graphics hard drive hardware hijackthis hjt install internet internet explorer itunes keyboard laptop macro malware monitor motherboard network networking outlook outlook 2003 outlook 2007 outlook express pio problem problems router seo server slow sound sp3 spyware trojan usb video virtumonde virus vista vundo windows windows vista windows xp winxp wireless
Web Design & Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Internet & Networking > Web Design & Development >
PHP Parser


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

 
Thread Tools
pcpro17's Avatar
Senior Member with 233 posts.
 
Join Date: Oct 2006
Location: Wisconsin, USA
Experience: Advanced
22-Aug-2007, 04:42 PM #1
Talking PHP Parser
Hello. I'm trying to make a mirror site (for myself) to get around certain annoying firewalls. I can get it to work on a very basic level, but I am having trouble writing some PHP code that will parse through the retrieved HTML file to fix links (e.g. href & src) so that the page itself displays properly. Here is what I have so far:
Code:
function get_item( $path ) {
  $ch = curl_init();
  $timeout = 5; // set to zero for no timeout
  curl_setopt ($ch, CURLOPT_URL, $path);
  curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
  $contents = curl_exec($ch);
  curl_close($ch);
  return $contents;
  }

$uri = $_POST['the_url'];
$page = get_item( $uri );

$tok = strtok( $page, ' ' ); // tokenize by spaces
while( $tok != FALSE ) {
  // $filtered_page = strcat( $tok );
  echo $tok;
  }
Initialy I was going to use strstr to parse through the file, but php.net says that it only looks for the first occurance within the string. Any suggestions? Thanks.
brendandonhu's Avatar
Distinguished Member with 15,988 posts.
 
Join Date: Jul 2002
Location: Ann Arbor, MI
Experience: Advanced
22-Aug-2007, 10:35 PM #2
Sounds like you want to install "phproxy".
http://whitefyre.com/poxy/
pcpro17's Avatar
Senior Member with 233 posts.
 
Join Date: Oct 2006
Location: Wisconsin, USA
Experience: Advanced
23-Aug-2007, 10:38 AM #3
Hi Brendan. Sounds interesting, but that site is blocked here by the Websense filter as "Proxy Avoidance" lol. Do you know of any other download locations, or might you be able to email it to me in a zip?
pcpro17's Avatar
Senior Member with 233 posts.
 
Join Date: Oct 2006
Location: Wisconsin, USA
Experience: Advanced
23-Aug-2007, 10:43 AM #4
Okay, upon a little more investigation Wikipedia states, "Currently PHProxy is under indefinite pause." What is this supposed to mean? Does it mean that development/support of phproxy has been suspended?
brendandonhu's Avatar
Distinguished Member with 15,988 posts.
 
Join Date: Jul 2002
Location: Ann Arbor, MI
Experience: Advanced
23-Aug-2007, 02:36 PM #5
Are you trying to evade a filter or something? I doubt if anyone here is going to help with that.
JohnWill's Avatar
Computer Specs
Moderator with 77,418 posts.
 
Join Date: Oct 2002
Location: South Eastern PA, USA
Experience: Advanced age & experience
23-Aug-2007, 03:59 PM #6
Sorry, we won't help with issues like this here. Please read the TSG Rules

Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are Off
Refbacks are Off

You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 05:52 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.