Page 2 of 2
Posted: Wed Dec 10, 2003 9:02 pm
by qads
you dont need to use echo on each line, here is a example;
Code: Select all
<?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

Posted: Wed Dec 10, 2003 11:26 pm
by C
qads wrote:you dont need to use echo on each line, here is a example;
Code: Select all
<?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?
Posted: Thu Dec 11, 2003 12:40 am
by Nay
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.
Code: Select all
$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.
-Nay
Posted: Thu Dec 11, 2003 12:42 am
by C
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?
Posted: Thu Dec 11, 2003 1:12 am
by m3mn0n
Cookies, or Sessions most likely.
btw: thanks for the link, that site (and his affiliates) are mega eye-candy.
This has to be the coolest layout i've ever seen:
http://www.shiver7.com/
btw he/she/they even got a tutorial on this topic:
http://www.shiver7.com/tutorials/97/
heh

Posted: Thu Dec 11, 2003 5:46 am
by AnsonM
there is another way... if u want to know, send me a PM..

Posted: Thu Dec 11, 2003 3:00 pm
by TheDeath2k4
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?
ok this is how i did it:
Code: Select all
//INDEX.PHP
<?php
include("menu.php");
?page=$_GETї'page']
$indexcontent = "blah";
$page1content = "blah1";
$page2content = "blah2";
if ($page == page1)
{
print("page1content");
}
elseif ($page == page2)
{
print("page2content");
}
else
{
print("indexcontent");
}
//END INDEX.PHP
?>
<?php
//MENU.PHP, note i took this directly from my page i coded with it, you can view at //http://uberhost.ath.cx/thedeath2k4 change this code as nessicary. This also includes a //simple text design switcher.
<?php
$design = $_GETї'design'];
if ($design == "aqua")
{
$menu = '
<center>
<a href="index.php?page=&design=aqua">Home</a><br>
<a href="index.php?page=sigsavas&design=aqua">Sigs and Avatars</a><br>
<a href="index.php?page=designs&design=aqua">Designs</a><br>
<br /></center>';
echo $menu;
echo "Design: $design<br />";
$change = '<a href="index.php?page=sigsavas&design=pixel">Pixel</a>';
echo $change;
}
else
{
$menu = '
<center>
<a href="index.php?page=&design=pixel">Home</a><br>
<a href="index.php?page=sigsavas&design=pixel">Sigs and Avatars</a><br>
<a href="index.php?page=designs&design=pixel">Designs</a><br>
<br /></center>';
echo $menu;
echo "<center>Design: pixel<br />";
$change = '<a href="index.php?page=sigsavas&design=aqua">Aqua</a></center>';
echo $change;
}
?>
//END MENU.PHP
hope that helps

oh and you can use echo for anything, ii was just feeling like using print when i made it.
Posted: Thu Dec 11, 2003 6:34 pm
by C
hahaha...lols...damn, there is a tutorial for everything...
Posted: Thu Dec 11, 2003 8:13 pm
by TheDeath2k4
they do don't they? i didn't notice the tutorial there.
Posted: Thu Dec 11, 2003 9:31 pm
by m3mn0n
I just wanted to show how I do my template system as I described earlier.
Code: Select all
<?php
if (isset($_GET['p']))
{
$p = $_GET['p'];
}
switch ($p)
{
default:
require_once "inc/home.inc.php";
break;
case 'home':
require_once "inc/home.inc.php"; // no html headers or footers, just code
break;
// etc...
}
?>
Posted: Thu Dec 11, 2003 10:01 pm
by C
hmmm...it appears there are many different ways...im using quads' version cuz thats what i saw 1st...lol
Posted: Thu Dec 11, 2003 11:40 pm
by Nay
Yeah! Finally I remember, I went to that site a while ago while on a hunt for 3D tutorials. I lost the URL <_<.
la la la la
-Nay
Posted: Sun Dec 14, 2003 12:03 pm
by C
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?