-4

i am developing a mobile application and i need to send a certain string where i can be able to use it in an HTML page and i wanna send it from a previous HTML page ,, what's the simplest way to do so ?. I have two pages index.html and home.html and i want to send a variable such as number or string from the index page to the home, as i will change the design of the home page upon this variable. is there any idea how can i do it ? Thanks in Advance.

John Conde
  • 217,595
  • 99
  • 455
  • 496
  • Possible duplicate of [how to exchange variables between two HTML pages?](http://stackoverflow.com/questions/3724106/how-to-exchange-variables-between-two-html-pages) – marmeladze Oct 10 '15 at 20:18
  • @Omar, the common solution to this issue is to use a SPA (Single Page Application) framework, like [Ionic](http://www.ionic.io/) which uses [Angular](https://angularjs.org/). Another solution is to store the data locally in [storage](http://cordova.apache.org/docs/en/5.0.0/cordova/storage/storage.html). –  Oct 10 '15 at 23:53

1 Answers1

0

If you a using a server side language, A common approach is to use a query string

For example your URL would look like this:

Home.html?myvariable=myvalue

In PHP the way to access the value of myvariable is to use $_GET['myvariable']

filype
  • 8,034
  • 10
  • 40
  • 66