Page 1 of 1
Newb help.
Posted: Sun May 16, 2004 11:17 pm
by BlazinSpitfireX
Hi. I've done so much reasearch about PHP it hurts my brain. And all i was able to find out was that its a code embeded in the HTML and its some sort of data base? i noticed that after looking at a couple source codes of a few PHP forums is that they all have this
<script language="JavaScript">
<!--
function SymError()
{
return true;
}
window.onerror = SymError;
var SymRealWinOpen = window.open;
function SymWinOpen(url, name, attributes)
{
return (new Object());
}
window.open = SymWinOpen;
//-->
</script>
<script language="Javascript" type="text/javascript">
...i just fineshed my first site and it rocks. the only thing i'm missing is a forum and i can't find a simple explanation for how to get a forum like this on my site...someone please help me

(any links tutorials or just talkin is appreciated) thanks.
-spitfire
Posted: Mon May 17, 2004 3:25 am
by JayBird
Re: Newb help.
Posted: Mon May 17, 2004 4:15 am
by leenoble_uk
BlazinSpitfireX wrote:..all i was able to find out was that its a code embeded in the HTML and its some sort of data base?
It appears you have a fundamental misunderstanding of how PHP works. You are correct that PHP code is embedded into an HTML document but I'm afraid there is no way you are going to be able to read any of this code by looking at the source of a web page.
PHP is a scripting language similar in style to the Javascript you have found but that is Javascript. You'll find Javascript embedded in source code becuase this script is read and understood by your browser and translated into actions as you interact with the page currently displayed.
PHP is written into the HTML document in the same way as Javascript is but it is not read by your browser. Your browser never sees the PHP. The PHP is read (parsed) by the server which is hosting the web page. The server parses the PHP and sends the HTML which is generated by the PHP to the client browser. Since PHP can output different HTML dependant on its script the same page may contain different HTML.
In order to server PHP pages you need a server which can run PHP. Your computer you are using now will suffice but if you are looking to host your site with an ISP you will need to make sure they can host your PHP files.
PHP is not itself a database. MySQL is a database, as is PostgreSQL. PHP can talk to these databases and retrieve information which can be presented as HTML. You will also need to install either of these databases on whichever computer you are going to serve pages from.
That's where you need to start. Installing PHP/MySQL on your computer.
Lee
Re: Newb help.
Posted: Mon May 17, 2004 4:42 am
by JayBird
leenoble_uk wrote:BlazinSpitfireX wrote:PHP is written into the HTML document in the same way as Javascript is...
Not entirely true, a PHP script is contained within a PHP file, which HTML can be included in, not the other way round (although you van change the Apache config to parse HTML files as PHP).
Also, PHP can exist entirely on its own without HTML.
Mark
Posted: Mon May 17, 2004 4:53 am
by leenoble_uk
Yah, I know. I was trying to keep it simple.
On the face of it, provided you have Apache set to parse .html documents then the PHP can be written into an HTML doc just like Javascript effectively.
I just didn't think you'd provided enough information with your link to PHPBB when the guy seems to think the JS he found is what is doing all the forum cleverness.
Posted: Mon May 17, 2004 4:54 am
by JayBird
leenoble_uk wrote:I just didn't think you'd provided enough information...
It's Monday, it's early, and the Corona is still flowing round my body. What can i say
Mark
Posted: Mon May 17, 2004 6:18 am
by BlazinSpitfireX
*clicks* THANK-YOU. Thats all i wanted from all these sites i looked at. That link helped also. I thought that all these were writen in strictly HTML...and that'd be one huge ass source if it was. So all I gotta do is get the PHP/MySQL and mess around with that till i get it later ^_^