Help with cURL & simple_html_dom

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I've been playing around with cURL & simple_html_dom, and can't quite
figure out how to make this work:

My goal is to grab a page from another domain, and change one of the
<a href=""> links to point somewhere else, then display the page.
Both domains are mine, but one ( ) is a
whitelable site rebranding content.  At the bottom of the page is a
link for "Models Wanted" which sends them to a form on the hosted
site, the contents of which are ultimately forwarded to me.  I have a
better form, and would like to change the href to my form.  I've
checked with the content owners, and they're cool with me changing the
url, but can't do it for me.

Can anyone give me a code sample?

Thank you!

Re: Help with cURL & simple_html_dom

Mike wrote:
Quoted text here. Click to load it

I can't think how many red flags go up on this one....

And why can't the owner change it for you??

If both domains are yours, then you can just edit the code to go to your

What code have you tried already??


Re: Help with cURL & simple_html_dom


I completely understand why the red flags would go up!  The domains
are mine, but on the one I named above, I simply point my DNS A
records to their server and voila, instant site.  Since it's a
"whitelabel" site, I don't have access to the code.  Even if I point
DNS to my own servers, I'd have to IFRAME back to the same content and
have the same problem.  They won't change the code for me, because
there are thousands of others using the same code, with a different
logo and css.  In their system, they assign me a code number and
record my e-mail address, when visitors fill out that form, it
generates an e-mail to me.  Still their system is screwy, and they
send out the emails about once a week... besides it doesn't have all
the info that I need.  Regarding the code I'm trying, I haven't gotten
very far.  Here's what I have so far:

        include_once '../htmlconvert/simple_html_dom.php';
        $ch = curl_init();
        curl_setopt ($ch, CURLOPT_URL, " /?
        curl_setopt ($ch, CURLOPT_RETURNTRANSFER,1);
        curl_setopt ($ch, CURLOPT_HTTPGET, 1);
        $output = curl_exec ($ch);
        curl_close ($ch);
        $html = str_get_html($output);
        echo $html;

I need to change the baseURI to , but am not
sure how to insert the <base> tag.  Also, I'm such a flake with the
DOM, and can't quite figure out how to find the <a> tag at the bottom
"Models Only".

Re: Help with cURL & simple_html_dom

aandmstudios wrote:
Quoted text here. Click to load it

If you're having that much trouble with it, it sounds like you need to
change templates or code the site from scratch.

In this case I'm not sure I'd use DOM.  All you need to do is replace a
tag.  I'd just use str_replace() to replace the old with the new, then
display the text.

Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.

Site Timeline