2

I'm building a site that provides Windows software that users can download. I want to retrieve text on another page.

Software Review Page (e.g: domain.com/obs-studio/):

<ul class="software_facts">
    <li>
        <div class="dorat">
            <div class="labelimg">[thumbnail]</div> 
            <div class="wp-block-button is-style-squared">
                <form name="myform1" action="/download-page/" method="post"><input name="bode" type="hidden" value="https://github.com/obsproject/obs-studio/releases/download/25.0.8/OBS-Studio-25.0.8-Full-Installer-x64.exe"></form>
                <div class="wp-block-button__link has-background has-vivid-green-cyan-background-color" onclick="document.myform1.submit()">Download (24 MB)</div>
            </div>
        </div>
    </li>
    <li class="bg">
        <p class="labelnil">Nilai:</p>
        [kkratings]
    </li>
    <li>
        <p class="label">Version:</p>
        <p itemprop="softwareVersion">25.0.8</p>
    </li>
    <li class="bg">
        <p class="label">Publisher:</p>
        <p itemprop="publisher" itemscope="" itemtype="http://schema.org/Organization"><span itemprop="name">Jim</span></p>
    </li>
    <li>
        <p class="label">Sistem Operasi:</p>
        <p itemprop="operatingSystem">Windows</p>
    </li>
    <li class="bg">
        <p class="label">Kategori Aplikasi:</p>
        <p itemprop="applicationCategory">Multimedia</p>
    </li>
    <li>
        <p class="label">Licence:</p>
        <p>Freeware</p>
    </li>
</ul>

The user is directed to the domain.com/download-page/ page when clicking on the "Download (24MB)" button.

Download Page (e.g. domain.com/download-page/):

<p>OBS Studio was developed by <strong>Jim</strong>, the latest version is <strong>25.0.8</strong>.</p>

I want the "Jim" and "25.0.8" sections to change according to the software information that the user wants to download on the previous page.

I use Wordpress, how do I do this with Javascript or PHP. Can anyone help me, thanks in advance.

R.M. Reza
  • 725
  • 1
  • 8
  • 20

2 Answers2

0

In Software Review Page

Use the input tag with hidden type to have publisher and software version values to send in the post method.

<ul class="software_facts">
<li>
    <div class="dorat">
        <div class="labelimg">[thumbnail]</div> 
        <div class="wp-block-button is-style-squared">
            <form name="myform1" action="/download-page/" method="post"><input name="bode" type="hidden" value="https://github.com/obsproject/obs-studio/releases/download/25.0.8/OBS-Studio-25.0.8-Full-Installer-x64.exe">

                <input name="publisher" type="hidden" value="Jim">
                <input name="softwareVersion" type="hidden" value="25.0.8">

            </form>
            <div class="wp-block-button__link has-background has-vivid-green-cyan-background-color" onclick="document.myform1.submit()">Download (24 MB)</div>
        </div>
    </div>
</li>
<li class="bg">
    <p class="labelnil">Nilai:</p>
    [kkratings]
</li>
<li>
    <p class="label">Version:</p>
    <p itemprop="softwareVersion">25.0.8</p>
</li>
<li class="bg">
    <p class="label">Publisher:</p>
    <p itemprop="publisher" itemscope="" itemtype="http://schema.org/Organization"><span itemprop="name">Jim</span></p>
</li>
<li>
    <p class="label">Sistem Operasi:</p>
    <p itemprop="operatingSystem">Windows</p>
</li>
<li class="bg">
    <p class="label">Kategori Aplikasi:</p>
    <p itemprop="applicationCategory">Multimedia</p>
</li>
<li>
    <p class="label">Licence:</p>
    <p>Freeware</p>
</li>

In Download Page

<p>OBS Studio was developed by <strong><?php echo $_POST['publisher']; ?></strong>, the latest version is <strong><?php echo $_POST['softwareVersion']; ?></strong>.</p>

Please note that I have sent the values in the superglobal variable called $_POST with the keys provided. Use echo statements to print the values from these variables.

Madhu Jayarama
  • 415
  • 1
  • 5
  • 15
0

you need create a crone job to update the software information table data by file_get_html the web page you want to grab the data from . Using file_get_html , the output will be an String, so create a DOM using it and extract your desired content from the DOM content and save to your database table

refer : reference to html dom paser

Shafeeque TP
  • 361
  • 1
  • 16