returning variable from php with html
Moderator: General Moderators
-
psychotomus
- Forum Contributor
- Posts: 487
- Joined: Fri Jul 11, 2003 1:59 am
returning variable from php with html
how would you go a bout returning the variable X from a php with html from a different server?
- redhair
- Forum Contributor
- Posts: 300
- Joined: Fri May 30, 2003 4:36 pm
- Location: 53.23N-6.57E
- Contact:
You could write var.X in a url.
Then call the other page.
example:
Then call the other page.
example:
Code: Select all
<a href='http://yourserver.com/page.php?VarX=<? echo $var_x; ?>'>Pass it on</a>-
psychotomus
- Forum Contributor
- Posts: 487
- Joined: Fri Jul 11, 2003 1:59 am
-
psychotomus
- Forum Contributor
- Posts: 487
- Joined: Fri Jul 11, 2003 1:59 am
He's saying, html can't process variables in itself. Javascript *can* take a client-side cookie (which php has created) and spit out some variables, but you would be much better off just saving the html file as .php, and putting <?=$_GET['variable_name']?> wherever you need the variables inserted. It's inobtrusive, effective, and doesn't rely on the user having javascript enabled in their browser.