Yes, just copy/pasting won't work at all. Basically for server side executed parts like php, etc...
I'll give you an example. Say you have a page as below. Save this as mypage.php
- Code: Select all
<html>
<head>
<title>My Page</title>
</head>
<body>
Some text here ..... 1 <br><br>
<?php
$a = 10;
$b = 15;
echo "a + b is " . ($a+$b) . "<br><br><br>";
?>
Some text here ..... 2
</body>
</html>
If you copy this page to your webserver root (if it is WAMP, C:/WAMP/WWW/), call it in a browser (If you are using WAMP,
http://localhost/mypage.html) and you will see the answer as 25.
- Code: Select all
Some text here ..... 1
a + b is 25
Some text here ..... 2
Get page source and you will see following code.
- Code: Select all
<html>
<head>
<title>My Page</title>
</head>
<body>
Some text here ..... 1 <br><br>
a + b is 25<br><br><br>
Some text here ..... 2
</body>
</html>
Now, where is the part which is enclosed with <?php and ?>?
That php code was executed on the server and you only got the output of it.
I'm sure now you know why simple copy/paste won't work here. However when you see the page source of the output, you must be able to think how it was created and make a page close to the original code.