Hi I'm not familiar with php / webdesign myself and i want to ask how i can make a page look like this: The layout must be centered and the content must be php pages something like php?id=blabla Does anyone know how to make these php pages? tips / hints are welcome i'm using dreamweaver Mx ps. i could have posted this in the PHP board but i also need to know how to make the layout so i thought that this was the best suited board to post in..
Just do the layout normally in html and plug in the php sections with <? include("filename.php") ?> Code (markup):
Roseytoes is right. Php is a server side scripting language, meaning that it can process information, variables, input, etc on the server side. Once your server is set up to run php, you can move in and out of php and html easily. Just use the <?php tag to start php code, and the ?> tag to close it. While in php, you can use the php "echo" command to send embedded html code to the browser as well.
I wouldn't strive for URLS that looked like that, you'd probably do better with mod_rewriting any of your URLS;
One mistake alot of new developers make is MAKE SURE the page your using the php includes in is saved as a PHP file itself. Simple mistake, but ive seen it happen many a time
yeah as mentioned above the include will help you get the stuff without rewriting code much and with a css stylesheet file you can get the centering and block sizes quite easily. I don't see you planning for a footer but it'll work the same way. you might want to separate the menus and constant code like Header, menus and footer in one place and the content pages in another.
The layout is done with HTML. If you know how to do that with HTML, do so and save it with a .php extension. For the pages you could do something like: <?php $pageRequested = $_GET['id']; $pageRequested = strtolower($pageRequested); switch ($pageRequested) { case "blabla": include 'blablah.php'; break; case "forum": include 'forum.php'; break; default: include 'news.php'; } ?> PHP:
OMG! Mod_rewrite is only for SE friendly links. On that a simple "id=x" shouldn't cause you to use mod_rewrite. On that mod_rewrite will cause extra strain on your server.