How would i make a 3 page website in 1 script using php? Example. There are sections that are fun, boring, and evil. And i want to be able to edit and create the website all in one page. I know its possible but i do not know how. Please help
tcollins412
0
Junior Poster
Recommended Answers
Jump to PostWell, the easiest way would be to use the $_GET and a switch case statement.
Something like. . .
<!-- Header Stuff here --> <?php $here=$_SERVER['SERVER_NAME'].$_SERVER['SCRIPT_NAME']; if (isset($_GET['page'])) { $page=$_GET['page']; switch ($page) { case "fun": echo "This is the fun page."; // You said you wanted …
Jump to PostNeither of those is a standalone webpage. The header stuff is the <html><head></head><body> and the other tags that you normally have in a web page. The part I wrote would go in between the <body> and </body> tags. And still probably wouldn't work because I just wrote it off the …
Jump to PostHere's the PHP version.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>3 Pages in 1</title> </head> <body> <?php $thispage=$_SERVER['SCRIPT_NAME']; echo "Which page would you like?<br />"; echo "<a href='$thispage?page=fun'>[FUN]</a> | "; echo "<a href='$thispage?page=boring'>[BORING]</a> | "; echo "<a href='$thispage?page=evil'>[EVIL]</a><br /><br />"; if (isset($_GET['page'])) { $page=$_GET['page']; …
All 12 Replies
dietdew12z
8
Junior Poster
tcollins412
0
Junior Poster
tcollins412
0
Junior Poster
dietdew12z
8
Junior Poster
tcollins412
0
Junior Poster
dietdew12z
8
Junior Poster
dietdew12z
8
Junior Poster
tcollins412
0
Junior Poster
dietdew12z
8
Junior Poster
tcollins412
0
Junior Poster
tcollins412
0
Junior Poster
tcollins412
0
Junior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.