Page 1 of 1
Very new Newbie to PHP with a Question..
Posted: Sun Sep 14, 2003 3:41 pm
by TheeDanimal
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?
Posted: Sun Sep 14, 2003 4:03 pm
by m3rajk
nothing i knwo of to do it automatically.
http://www.php.net
that should be your first stop whenyou have errors
Posted: Sun Sep 14, 2003 4:26 pm
by JAM
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!
Posted: Sun Sep 14, 2003 9:14 pm
by McGruff
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
Posted: Mon Sep 15, 2003 4:40 am
by twigletmac
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
Posted: Mon Sep 15, 2003 1:48 pm
by TheeDanimal
Thanks everyone Ill start with that
Posted: Mon Sep 15, 2003 2:20 pm
by Bizwala
If you just want to change the file extension .html to .php you can write a mini script using opendir()
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);
}
}
?>
This should work, but you should add some php chmod functions in there too.
Posted: Mon Sep 15, 2003 2:46 pm
by SantaGhost
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....
Posted: Mon Sep 15, 2003 3:38 pm
by AaronSmith
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.
Posted: Mon Sep 15, 2003 3:46 pm
by SantaGhost
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.
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 is
http://www.w3schools.com/css/
Posted: Mon Sep 15, 2003 4:12 pm
by m3rajk
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.
no. do not call a scripting language a programming language.
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.
Posted: Mon Sep 15, 2003 4:14 pm
by AaronSmith
Geesh... I was trying to make it easy!
Thanks for the ass kickin!

Posted: Mon Sep 15, 2003 4:27 pm
by m3rajk
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.
Posted: Mon Sep 15, 2003 4:30 pm
by AaronSmith
Just curious... Why are those that script PHP called programmers?
Posted: Mon Sep 15, 2003 4:34 pm
by m3rajk
same reason those that script in perl are.
genreally if you use scritping languages you're either a web designer that doesn't necessarily know programming languages or you know several of tose as well.