PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
<?php
$page1 = '<html>
<head>
<title>page1</title>
<script>
alert(''Hello'');
</script>
</head>
<body>
Top of the world ma!
</body>
</html>';
$page2 = '<html>
<head>
<title>page2</title>
<script>
alert(''Hello'');
</script>
</head>
<body>
Top of the world ma!
</body>
</html>';
if($p == 2)
{
echo $page2;
}
else
{
echo $page1;
}
?>
simple as that. just make sure you search and replace ' with '', you can do that useing notepad!
i bet nay is gona come around and talk about heredoc
accually on my phpnuke site, http://project-epsilon.com i have a module that converts normal html to phpnuke module format..and it adds echo and all the slashes for me ...btw, whats heredoc?
C wrote:
now that i'll be using the "echo" tag to put in the html to the php file will i have to add the "echo" tag to each line of html that i export from photoshop? or is there an programm that will do it for me?
You have come to the right place my friend . *recruits you*. You use heredoc for it.
$html = <<< HTML
<html>
<head>
bla bla bla
Yeah, syntax is bad, isn't it?
HTML;
But for loads of HTML, it's more...........sensible to have them in an external file and use require(). So you seperate the HTML and the PHP. Much neater.
And the images, there's really not a way. You can just go to View -> Source, or press CTRL + U in Mozilla and view the source, and get the images from there.
ok, one more question..lol: if u go http://www.venox.org/?p=home&style=default there u can see that in ur browser's url box it will display the ?p=home thing that we have been talking about but it also has a &style=default. on the home page of that site it has a set of links allowing u to cahnge the colors of the page, clicking on one of them also changes that &style= default tag to &style=blue (if u click on the blue). how is that done?
C wrote:ok, one more question..lol: if u go http://www.venox.org/?p=home&style=default there u can see that in ur browser's url box it will display the ?p=home thing that we have been talking about but it also has a &style=default. on the home page of that site it has a set of links allowing u to cahnge the colors of the page, clicking on one of them also changes that &style= default tag to &style=blue (if u click on the blue). how is that done?
thanks all! its all working execpt for the fact that sometimes it will not load any of the images. even if u refresh. u have to close ur browser completly and open it agian in order to see the images. why is that and how can i fix it?