Results 1 to 3 of 3

Thread: simple_html_dom: where to put it if i run a testsript?

  1. #1

    Default simple_html_dom: where to put it if i run a testsript?

    good day dear opensuse-experts,

    running opensuse 42.3 - i look forward to the release of Version 15



    i just run some scripts that need the inclusion of simple_html_dom. i need to put this into the same folder, in which my testscript resides:

    btw-, the projectpage looks like down : see http://simplehtmldom.sourceforge.net/manual.htm
    include('simple_html_dom');

    Code:
    Project web is currently offline pending the final migration of its data to our new datacenter.
    https://sourceforge.net/projects/simplehtmldom/

    funny:
    i download it form Sourceforge:

    But: what is pretty important: The php-extension (simple_html_dom) should be found by my testscript.

    conditions:
    It should probably include(simple_html_dom.php);

    in other words: it's should be in the same folder as my testscript:

    if not - then i would need to use the relative path to it.


    So i have two options.

    a- put the extension into the same folder as the testscript remains or
    b- use the correct path


    how to apply the option a - putting the extension to the same folder?
    dilbert ;-)
    Wordpress-development - a Toolset: wpgear.org

  2. #2
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    13,295
    Blog Entries
    2

    Default Re: simple_html_dom: where to put it if i run a testsript?

    I don't write PHP but if the PHP DOM works like all the other languages I've worked worth (IMO likely), you wouldn't put phpsimplehtmldom into a script folder.

    A DOM is the foundation of a web page which states the various elements and basic functionality that the individual tagged content on the page can act upon. As such, you'd think that the foundation of what happens in a page should be set as the page loads and shouldn't be modified later (but see the last reference in this post)

    So, typically the DOM is referenced at the top of each web page code (web pages in general and HTML or other predominantly text-type code is always read in sequence from top to bottom on the page), and the DOM file itself is normally placed in the root of the website code for easy reference.

    PHP.net documentation of what a PHP DOM is, including an example deployment in the User contributions
    http://php.net/manual/en/class.domdocument.php

    An example, doesn't say how it's deployed but it looks like it simply replaces the first element of the PHP page (yes, all that replaces the first line)
    https://www.tutorialspoint.com/php/p...er_example.htm

    The following looks like it might be intended to inject a DOM modification and might be placed in the content <BODY> which is an approach I'm not familiar with, but might be acceptable practice in PHP (again, I'm not actually a PHP coder). Might be an approach close to how you think it should work
    https://davidwalsh.name/domdocument

    HTH,
    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  3. #3

    Default Re: simple_html_dom: where to put it if i run a testsript?

    hello dear tsu2,


    many thanks for the continued support - as i understand i do not have to put the extension into the same folder like the test-script.
    i will have a closer look at the documents you have mentioned.

    btw. the orignial-docs are back online again

    http://simplehtmldom.sourceforge.net/manual.htm
    http://simplehtmldom.sourceforge.net/


    I will read through all the docs and will do some trials. I keep you informed.

    Greetings
    dilbert ;-)
    Wordpress-development - a Toolset: wpgear.org

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •