Web Design Forums

Other Languages

Get help with any programming languages other than the ones above.

Grab DOM from user sumbited page



Site of the Month Voting - Now Open. CAST YOUR VOTE NOW!

Reply
 
LinkBack Thread Tools
Old April 6 '09, 11:11 AM (#1)
Seldimi is offline
PHP Maniac
 
Seldimi's Avatar
 
Join Date: December 2002
Location: Kozani, Greece
Posts: 488
Seldimi has disabled reputation
Send a message via MSN to Seldimi
Grab DOM from user sumbited page

Hello... i was asked from my university to create a project about getting the DOM or HTML from a user submited page on Perl or c++.... but I am free to use any language I want...
the results etc wil be published with php of course..

I did a small search on google but couldnt find a lot of help... any tips, ideas etc?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old April 6 '09, 11:32 PM (#2)
Shadowfiend is offline
Code beautifully and honorably
 
Shadowfiend's Avatar
 
Join Date: June 2005
Location: Atlanta, GA
Posts: 4,143
Shadowfiend has a reputation beyond reputeShadowfiend has a reputation beyond reputeShadowfiend has a reputation beyond reputeShadowfiend has a reputation beyond reputeShadowfiend has a reputation beyond reputeShadowfiend has a reputation beyond reputeShadowfiend has a reputation beyond reputeShadowfiend has a reputation beyond reputeShadowfiend has a reputation beyond reputeShadowfiend has a reputation beyond reputeShadowfiend has a reputation beyond repute
Do they submit it as in upload the page or submit a URI? If the latter, you'll have to do some interesting juggling. The best way would probably be to open the URI using PHP (with the fopen wrappers, ideally), then send that back to the script (either in an iframe or through an AJAX call). Then you can use Javascript to dig into the DOM. You can't just drop the page in an iframe directly and then use JS to read it, as the same-origin policy will block you from accessing the other site's DOM in the iframe.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old April 7 '09, 12:42 PM (#3)
Seldimi is offline
PHP Maniac
 
Seldimi's Avatar
 
Join Date: December 2002
Location: Kozani, Greece
Posts: 488
Seldimi has disabled reputation
Send a message via MSN to Seldimi
The user will submit a webpage URL.. so the program should get the DOM through external webpage... fopen() works for external websites?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old April 7 '09, 02:59 PM (#4)
Shadowfiend is offline
Code beautifully and honorably
 
Shadowfiend's Avatar
 
Join Date: June 2005
Location: Atlanta, GA
Posts: 4,143
Shadowfiend has a reputation beyond reputeShadowfiend has a reputation beyond reputeShadowfiend has a reputation beyond reputeShadowfiend has a reputation beyond reputeShadowfiend has a reputation beyond reputeShadowfiend has a reputation beyond reputeShadowfiend has a reputation beyond reputeShadowfiend has a reputation beyond reputeShadowfiend has a reputation beyond reputeShadowfiend has a reputation beyond reputeShadowfiend has a reputation beyond repute
Assuming you have PHP set up right. See http://php.net/fopen and the section on the filename in particular.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old April 15 '09, 08:06 PM (#5)
Seldimi is offline
PHP Maniac
 
Seldimi's Avatar
 
Join Date: December 2002
Location: Kozani, Greece
Posts: 488
Seldimi has disabled reputation
Send a message via MSN to Seldimi
http://simplehtmldom.sourceforge.net/
Found what I was looking for
Thx for replies
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old April 15 '09, 10:16 PM (#6)
Shadowfiend is offline
Code beautifully and honorably
 
Shadowfiend's Avatar
 
Join Date: June 2005
Location: Atlanta, GA
Posts: 4,143
Shadowfiend has a reputation beyond reputeShadowfiend has a reputation beyond reputeShadowfiend has a reputation beyond reputeShadowfiend has a reputation beyond reputeShadowfiend has a reputation beyond reputeShadowfiend has a reputation beyond reputeShadowfiend has a reputation beyond reputeShadowfiend has a reputation beyond reputeShadowfiend has a reputation beyond reputeShadowfiend has a reputation beyond reputeShadowfiend has a reputation beyond repute
Ah I see. You want this done server-side. Cool resource.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

  Web Design Forums » Programming Help » Other Languages

Bookmarks


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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Easily adding text to a page Aleister PHP 8 March 15 '04 01:01 PM
Efficient PHP/MySQL Page Counter futureal PHP 5 June 10 '03 12:03 AM
Loading a page during an intro movie XpTraveler Adobe Photoshop Help 15 April 24 '03 10:20 AM
%_SERVER["QUERY_STRING"] mouse_ PHP 3 March 30 '03 12:41 AM
force user to access from certain page veredgf Javascript, AJAX, and JSON 3 January 14 '03 11:26 AM

 
User Infomation
Your Avatar

Site Of The Month
Nominate Your Site Now!

Advertisement
WolfCMS.org

Latest Articles
- by RickM
- by bfsog

Advertisement

Partner Links



All times are GMT -4. The time now is 01:56 PM.


WebDesignForums.net is Copyright © 2010 RikeMedia.

SEO by vBSEO

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164