Jump to content

how can I use a variable in an html doc in another html document?

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
5 replies to this topic

#1
Diana86

Diana86

    Newbie

  • Members
  • PipPip
  • 12 posts
Hi,

I have two html pages and I'm trying to use one of the variables in the first html page in the second html page..how can I do this?

thanks in advance

#2
Termana

Termana

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 4,057 posts
i didnt realize html could store variables are you sure your not using something like PHP or javascript?
Posted via CodeCall Mobile

#3
Diana86

Diana86

    Newbie

  • Members
  • PipPip
  • 12 posts
ohh I appologize .. yea I have two pages.. the first html/javascript and 2nd is php .. how can I pass a variable that has been used in the html/javascript doc to the php document??

#4
Xav

Xav

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 13,118 posts
Use JavaScript to submit data (either via GET or POST) to the PHP page, and then you can access it like this:

$data = $_POST["variablename"];

Replace $_POST with $_GET if you are going to store the data in the URL, rather than send it internally.
Jordan said:

Good members, like yourself, stick around and post for ages to come!
Mr. Xav | Blog | Forums

#5
TcM

TcM

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 11,147 posts
To forwarding data that the user inserted just make the textbox or whatever into a form and make a submit button...

#6
Xav

Xav

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 13,118 posts
@TcM: It's not user inputted data. It's data from a variable elsewhere in JavaScript.
Jordan said:

Good members, like yourself, stick around and post for ages to come!
Mr. Xav | Blog | Forums