tags:

views:

51

answers:

3

Is it possible to write the 2 html codes in the same html file and call it when required with help of name property

<html name ="abc1">
<body>
</body>
</html>

<html name ="abc2">
<body>
</body>
</html>

Thanks in advance - Miss subanki

A: 

You can use a scripting language if you want to add conditions like these.

PHP example for page.php?show=abc1

<?php
if ($_GET['show'] == 'abc1') {
  echo 'something';
} elseif ($_GET['show'] == 'abc2') {
  echo 'something else';
}
?>
Alec
isnt php a server side scripting??? Thanks for ur reply friend
subanki
is PHP related DOS programming?
subanki
php is server side (I think you can run php scripts from command line if you installed it)
János Harsányi
+1  A: 

I don't believe that is valid. Depending on what you're doing, couldn't you just do the same things with div tags?

<html>
  <body>
    <div id="abc1">
      <!-- Content goes here -->
    </div>

    <div id="abc2">
      <!-- Content goes here -->
    </div>
  </body>
</html>
Ken Earley
oh can we type html codes in div....i dont know much aout div tags
subanki
A: 

I agree with Alec's post that you should probably use a Server Side Scripting (http://www.w3schools.com/web/web_scripting.asp) to achieve what you are trying to do. It sounds like you are taking users input and deciding what to show them.

So a very high general overview of how server side scripting works is you generate a page request with information from the user and then on the server side, a script parses the url and decides based on the parameters passed in, what to show the user.

The desired effect of showing one section at a time can also be achieved through Javascript or any client side scripting - http://www.w3schools.com/js/default.asp

Eric U.