DanM
DanM

Reputation: 1540

Transfer data between html

I have a client that uses joomla for his website. Via joomla the client is inputting some data to his articles (prices of products). I need some simple way to get this data to my HTML page. I can add anything to to his HTML page (java script, PHP) and I need to transfer the data to my HTML page. My HTML page is the one who triggers the data transfer. Any one can please put me in the right direction how to do this?

Upvotes: 1

Views: 740

Answers (1)

NewUser
NewUser

Reputation: 3819

You can certainly use the following steps. If you have two parameters and their values are known(Let's assume) 5 & 10 then you can create a button when clicking on it, the next page opens up. So you need 3 things.

  1. A Button which is set up to open second page.
  2. A javascript function is triggered when the button is clicked.
  3. A PHP page where you retrive the variables and process them.

<form action = "nextpage.php" method = "post">
<input type = "hidden" name = "val2" value = "5"/>
<input type = "hidden" name = "val2" value = "10"/>
</form>
<a href = "javascript:nextpage()">Submit</a>
//Write a function to submit the form using javascript

When there is some requirement of sending some data which are to be sent without the knowledge of the user you can use input type as hidden. This should be the PHP part.

<?php
$var1 = $_POST['var1'];
$var2 = $_POST['var2'];
echo $var1.' '.$var2;
?>

Upvotes: 1

Related Questions