Very new Newbie to PHP with a Question..
Moderator: General Moderators
-
TheeDanimal
- Forum Newbie
- Posts: 2
- Joined: Sun Sep 14, 2003 3:41 pm
Very new Newbie to PHP with a Question..
I'm trying to convert my html pages to php, is there a software I can use or a simple way to do it, I plan on learning more about php adn fixing things up so that changes can be made easier,
Is there a place someone can start me out with?
Is there a place someone can start me out with?
nothing i knwo of to do it automatically.
http://www.php.net
that should be your first stop whenyou have errors
http://www.php.net
that should be your first stop whenyou have errors
There are no such things as html2php converter, as it so much different from each other.
The manual (as m3rajk mentioned) is a place where most people start at. Also PHPDN member sites (check that page at the lower left, LINKS) is more or less specialized on various areas.
Visit those places, try something out, and get back to us if you need more help. And good luck!
The manual (as m3rajk mentioned) is a place where most people start at. Also PHPDN member sites (check that page at the lower left, LINKS) is more or less specialized on various areas.
Visit those places, try something out, and get back to us if you need more help. And good luck!
Php manual on php.net - can download a version with user comments which I'd recommend.
Mysql manual from mysql.com.
Relational architecture & db normalisation article http://www.oreilly.de/catalog/javadtabp ... r/ch02.pdf
(looks tough but you need to know this stuff).
Install a local test server - see: http://www.hotscripts.com/PHP/Software_ ... tion_Kits/
Check links out from this site and php.net, zend.com for various articles.
Handy tool to try out regex expressions: http://www.weitz.de/regex-coach/#install
Mysql manual from mysql.com.
Relational architecture & db normalisation article http://www.oreilly.de/catalog/javadtabp ... r/ch02.pdf
(looks tough but you need to know this stuff).
Install a local test server - see: http://www.hotscripts.com/PHP/Software_ ... tion_Kits/
Check links out from this site and php.net, zend.com for various articles.
Handy tool to try out regex expressions: http://www.weitz.de/regex-coach/#install
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
The easiest way to convert an HTML page to PHP is to change the extension of the page - instead of .htm/.html change it to .php. Then (if you've got PHP setup on your computer) you can start adding PHP code to the pages.
Note that PHP does not replace HTML, they are very, very different things.
Definitely use the links that you've had posted for you - lots of good resources.
Mac
Note that PHP does not replace HTML, they are very, very different things.
Definitely use the links that you've had posted for you - lots of good resources.
Mac
-
TheeDanimal
- Forum Newbie
- Posts: 2
- Joined: Sun Sep 14, 2003 3:41 pm
If you just want to change the file extension .html to .php you can write a mini script using opendir()
This should work, but you should add some php chmod functions in there too.
Code: Select all
<?php
$dir = "temp/";
if (is_dir($dir)) {
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false) {
if(ereg(".html",$file)) { //list all files with .html extension
print nl2br("filename: $file" . "\n"); //verify they exist
$phpfile=str_replace(".html",".php",$file);//create php file
copy($file,$phpfile); //copy file
unlink($file); //delete .html file
}
}
closedir($dh);
}
}
?>- SantaGhost
- Forum Commoner
- Posts: 41
- Joined: Mon Sep 15, 2003 11:54 am
you should know what youre expecting from php to add to your website, you can just change all pages to .php and they will still work fine and you can add php code to them (<?php .. ?>)
the idea behind php is to make the content of websites dynamic, without having to make changes to a hundred html pages if you just want to change the logo....
the idea behind php is to make the content of websites dynamic, without having to make changes to a hundred html pages if you just want to change the logo....
-
AaronSmith
- Forum Commoner
- Posts: 32
- Joined: Fri Mar 28, 2003 3:14 pm
- SantaGhost
- Forum Commoner
- Posts: 41
- Joined: Mon Sep 15, 2003 11:54 am
yes, it would shure be worth it to take a look at CSS too, which will save you a lot of design and layout work, a good starting point isAaronSmith wrote:To be very specific... PHP is a programming language while HTML is (now) used for design. I suggest you also look into MYSQL, as your web page could most likely benifit from a database.
http://www.w3schools.com/css/
no. do not call a scripting language a programming language.AaronSmith wrote:To be very specific... PHP is a programming language while HTML is (now) used for design. I suggest you also look into MYSQL, as your web page could most likely benifit from a database.
i know programmer that get very upset.
scripting languages are very different from programming languages. there are some things you can't do with programming languages you can do with scripting languages. and something scripting langs are much better for.
php is a scripting language.
it was designed specifically to give state to a stateless protocil. keep that in mind when you write with it
you need xml or html or some other markup language to give formatting to output from scripts in php.
-
AaronSmith
- Forum Commoner
- Posts: 32
- Joined: Fri Mar 28, 2003 3:14 pm
there's a big difference between scripting and programming languages. and an even bigger one between them and mark ups.
as i pointed out, it's a bad idea to think of programming and scripting languages as the same. their functinoality is different.
it could be detrimental down the line if he thinks of them as the same.
as i pointed out, it's a bad idea to think of programming and scripting languages as the same. their functinoality is different.
it could be detrimental down the line if he thinks of them as the same.
-
AaronSmith
- Forum Commoner
- Posts: 32
- Joined: Fri Mar 28, 2003 3:14 pm