What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » HTML > PHP

HTML > PHP
Author: Message:
Eddie
Veteran Member
*****


Posts: 2078
Reputation: 30
32 / Male / Flag
Joined: Oct 2005
Status: Away
O.P. HTML > PHP
Hello everyone, i have made a page in HTML that actually needs to be coded in php, is there a way to easily convert the code?? :S
...there used to be a signature here :)
11-28-2006 01:55 PM
Profile PM Web Find Quote Report
xJ +
Full Member
***

Avatar
A$$ple/Buttple xD

Posts: 460
Reputation: 15
117 / Other / Flag
Joined: Jan 2006
Status: Away
RE: HTML > PHP
You might want to try this
11-28-2006 02:00 PM
Profile PM Web Find Quote Report
Adeptus
Senior Member
****


Posts: 732
Reputation: 40
Joined: Oct 2005
RE: HTML > PHP
There is nothing to convert.  PHP pages still contain HTML.  PHP is nothing more than a way to enhance an HTML page with some code that will execute server-side when the page is requested by the browser.  So, all the "conversion" it takes is changing the extension to ".php". 

Of course, you will still need to add the PHP code to do what you want it to do.  Although somewhat dated, you may find this tutorial helpful in that task.
11-28-2006 02:03 PM
Profile E-Mail PM Find Quote Report
RaceProUK
Elite Member
*****

Avatar

Posts: 6073
Reputation: 57
39 / Male / Flag
Joined: Oct 2003
RE: HTML > PHP
And of course there's php.net, which has the full documentation for all of PHP.
[Image: spartaafk.png]
11-28-2006 03:21 PM
Profile PM Web Find Quote Report
absorbation
Elite Member
*****

Avatar

Posts: 3636
Reputation: 81
– / Male / Flag
Joined: Feb 2005
RE: HTML > PHP
HTML and PHP are very different. HTML is used for your browser to pick up on read-able code and form objects using it, which is what you see on your screen. PHP is a server addon designed to allow dynamic content. It basically is a web server language, in a syntax similar to C.

PHP 'echos' or 'prints' HTML code using a variety a formulas to decide what HTML for the web server to load into your browser. A simple example of this is check the day of the week. A simple peice of PHP code can be used to check the date:

code:
<?PHP
$date = date('D');

if ($date == 'Mon')
{
     echo "It's monday";
}

else
{
     echo "It is not Monday";
}
?>

Of course you can't do this with HTML. PHP is something needed to be installed on a server, whereas HTML code is something all up to your browser. The 'echo' used shows the HTML code like you would normally, but the PHP checks to see what code should be echoed :P


Edit: There is no such thing as converting HTML to PHP, and your best chance is to post your HTML page and explain what is not working ;)

This post was edited on 11-28-2006 at 04:58 PM by absorbation.
11-28-2006 04:56 PM
Profile PM Find Quote Report
RaceProUK
Elite Member
*****

Avatar

Posts: 6073
Reputation: 57
39 / Male / Flag
Joined: Oct 2003
RE: HTML > PHP
You can also do dynamic content with HTML, by leveraging JavaScript, but the beauty of PHP is that your code remains hidden from the browser.

And
code:
It is <?php if (date("D") !== "Mon") {?>not <?php }?>Monday
is a little more efficient. Though a little harder to read.

Edit: :P @ Mike

This post was edited on 11-28-2006 at 07:22 PM by RaceProUK.
[Image: spartaafk.png]
11-28-2006 07:18 PM
Profile PM Web Find Quote Report
Mike
Elite Member
*****

Avatar
Meet the Spam Family!

Posts: 2795
Reputation: 48
31 / Male / Flag
Joined: Mar 2003
RE: HTML > PHP
quote:
Originally posted by RaceProUK
but the beauty of PHP is that your code remains hidden from the browser.
And, that the user doesn't need to have Javascript enabled to see the website ;)
YouTube closed-captions ripper (also allows you to download videos!)
11-28-2006 07:21 PM
Profile E-Mail PM Web Find Quote Report
rav0
Veteran Member
*****

Avatar
i have an avatar

Posts: 1419
Reputation: 29
34 / Male / Flag
Joined: Aug 2003
RE: HTML > PHP
quote:
Originally posted by Shadow
Hello everyone, i have made a page in HTML that actually needs to be coded in php, is there a way to easily convert the code?? :S

Rename the Page to end in ".php". When it's requested by a browser, it'll come out exactly the same (unless there are PHP start marks ("<?php" or "<?" with short tags enabled in PHP) in the page code).

You can add bits of PHP where they need to go into the existing code.

This post looks long, but it's simple and only looks long because there's lots of space. Have a read of the examples below.


awesome.html:
code:
<html>
<body>
The date is 2006-11-30. It is a Thursday.
</body>
</html>
gives:
quote:
The date is 2006-11-30. It is a Thursday.

awesome.php:
code:
<html>
<body>
The date is 2006-11-30. It is a Thursday.
</body>
</html>

gives:
quote:
The date is 2006-11-30. It is a Thursday.

awesomer.php
code:
<html>
<body>
The date is <?php date(Y-m-d) ?>. It is a <?php date(l) ?>.
</body>
</html>

gives:
quote:
The date is <the date now>. It is a <whatever day today is>.

This post was edited on 11-30-2006 at 11:10 AM by rav0.
| [Image: dorsh] |

(\ /)
(O.o)
(> <)

This is Bunny. Copy Bunny into your signature to help him on his way to world domination
11-30-2006 10:33 AM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On