Does anyone know where I can find PHP tutorials? I don't need them urgently, but I would like to know where I can find them as I want to convert my site to PHP. Thanks in advance.
unfortunetly, it's not as simple as html, in fact, I've been trying to learn it, but most of the tutorials I've been to are either: a. dont explain to how plug it into a site b. give and take from other languages Anyways, tell me what you need PHP for and I'll get you the script for it ;-)
Heres some steps for php 1. Make your layout 2. Delete where your content would go and put in the following code: <#?php include ("$page"); ?> <-- Remove the "#" For the $page thing, you can put anything u want, like $goto. 3. Now name that file main.php 4. Now make your content pages, like information about catching a bug or some sort. Have the file have a html, txt, or htm extensions. 5. When linking to the page, you would put the following code: http://www.YOURSITE.com/main.php?$page=VARIABLE The VARIABLE is what your page is, like site.html or some sort. For the $page part, you have to put whatever you put whatever in place of your content.
Will, PHP is an embedded language and there for there is no kind of new/special HTML to learn. PHP is just adding dynamic elements into your normal HTML pages. Of course it can get a lot more advanced than that (e.g. LPAs main file has no HTML in it and runs an advanced templating systems designed by me) but you need to start with the basics. http://www.devshed.com is my fav tutorial library
Here is an example of a template page of LPA that PHP reads and then makes. Code: {%}{title.News}{pagetitle.Linkin Park News}{networktitle.Network}{vis.1}{%} {tmpl.head} {content.17.10} {tmpl.colbreak} {Nad} {tmpl.foot} :chemist:
Code: {%}{title.News}{pagetitle.Linkin Park News}{networktitle.Network}{vis.1}{%} {tmpl.head} {content.17.10} {tmpl.colbreak} {Nad} {tmpl.foot} Isn't that using string replacements? ========================= A personal favourite of mine is http://www.phpfreaks.com/ it has the full php command index and also specialises in demonstrating some of them to make it more understandable, seeing as the documentation from php.net is really confusing for beginners
no will, ur running away from me lol How can I make the site so that I can change the design without having to change every page manually?
well what you could do let say have one template and the only bit you wud have change is the "content" area. and you would all all ur nice luvly links like index.php?p=stuff... provided that the template is called index.php and the content for that specific example is called stuff. First you'd make your design template and then where you want the content area to go put in this code: Code: <?php if(!isset($p)) { $p = "home"; } include("content/" . $p . ".php"); ?> What that says is if a variable 'p' is not set then p will automatically be set to 'home' . so when it gets to the include() it will pick up the file within the 'content' directory and plonk it into that content area space that u put the code. [ that sounds so confusing ] What you do is for all of your bits of content, such as lets say two pages called 'music' and 'lyrics' the links to those pages would be : [*]index.php?p=music [*]index.php?p=lyrics and if you input those into the php coding instead of the variable $p it would look like [*]include(content/music.php); [*]include(content/lyrics.php); I made that worse than it really is, all u gotta do is make a directory called 'content' and put all of your content files into that direcotry. make your main template and then finally stick that bit of coding where yu want the coding to go. it's possible to play around with the code to do lots of other things, you cud rename the variables and directoy name if you want... thats hwat i like about php, so much more scope than regular html
In a way yes but a lot more toys are coded into the site then you can see. And dont forget that 100% of LPAs content is stored in a database and not to file. LPA is the most dynamic site ive coded to date.