By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,625 Members | 1,604 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,625 IT Pros & Developers. It's quick & easy.

Variables showing?

P: 1
I have a program that is passing me variables.

{$firstname}
{$refid}

I need to know the syntax of html to say

HELLO JOHN (where firstname=john)

and the syntax for a "<a href "http://www.mysite.com/"+{$refid}
Jan 19 '12 #1
Share this Question
Share on Google+
2 Replies


Dormilich
Expert Mod 5K+
P: 8,639
HTML is not a programming language, but a markup language. hence there are no variables. you have to do it in the programming language that creates the HTML.
Jan 19 '12 #2

Exequiel
100+
P: 288
You can save it in php file type. but you need php tag for your program... example :
Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>Sample By Zick</title>
  6. </head>
  7. <body>
  8. <?php    
  9.             $refid="porn";
  10.             $firstname="JOHN";
  11.  
  12.             echo 'Hello '.$firstname.'<br>';        
  13.  ?>
  14.     <a href="http://www.mofos.com/<?php echo $refid; ?>">Click Me baby</a>
  15. </body>
  16. </html>
  17.  
just save it like this, filename.php

but you need xampp to run php files.
Jul 19 '12 #3

Post your reply

Sign in to post your reply or Sign up for a free account.