PHP

how to do PHP?

Page 1 of 1

14 Replies - 2489 Views - Last Post: 18 February 2006 - 11:59 AM Rate Topic: -----

#1 WMIIII923  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 1
  • View blog
  • Posts: 101
  • Joined: 10-February 06

PHP

Posted 18 February 2006 - 07:49 AM

I was wondering how you put PHP into css or html(an external PHP file).
Is This A Good Question/Topic? 0
  • +

Replies To: PHP

#2 Amadeus  Icon User is offline

  • g+ + -o drink whiskey.cpp
  • member icon

Reputation: 248
  • View blog
  • Posts: 13,506
  • Joined: 12-July 02

Re: PHP

Posted 18 February 2006 - 07:50 AM

Are you referring to including an external php file in html? Or putting php code into an HTML page?
Was This Post Helpful? 0
  • +
  • -

#3 dec1pher  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 1
  • View blog
  • Posts: 116
  • Joined: 27-January 06

Re: PHP

Posted 18 February 2006 - 07:52 AM

i guess second one... but you must first have a php web server running

<?php /* code goes there */ ?>


Was This Post Helpful? 0
  • +
  • -

#4 Amadeus  Icon User is offline

  • g+ + -o drink whiskey.cpp
  • member icon

Reputation: 248
  • View blog
  • Posts: 13,506
  • Joined: 12-July 02

Re: PHP

Posted 18 February 2006 - 07:59 AM

Well, if it turns out the user wnats to unclude a file, you can view the documentation here:
http://us2.php.net/include/
Was This Post Helpful? 0
  • +
  • -

#5 WMIIII923  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 1
  • View blog
  • Posts: 101
  • Joined: 10-February 06

Re: PHP

Posted 18 February 2006 - 10:37 AM

Yes an external PHP page.
Was This Post Helpful? 0
  • +
  • -

#6 Amadeus  Icon User is offline

  • g+ + -o drink whiskey.cpp
  • member icon

Reputation: 248
  • View blog
  • Posts: 13,506
  • Joined: 12-July 02

Re: PHP

Posted 18 February 2006 - 11:14 AM

Then you'll want either the include or require directives.
Was This Post Helpful? 0
  • +
  • -

#7 WMIIII923  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 1
  • View blog
  • Posts: 101
  • Joined: 10-February 06

Re: PHP

Posted 18 February 2006 - 11:20 AM

what are those?
Was This Post Helpful? 0
  • +
  • -

#8 Amadeus  Icon User is offline

  • g+ + -o drink whiskey.cpp
  • member icon

Reputation: 248
  • View blog
  • Posts: 13,506
  • Joined: 12-July 02

Re: PHP

Posted 18 February 2006 - 11:22 AM

My first post in this thread contains a direct link to documentation for the include directive. That documentation contains a link to the require directive. They are both methods of including code from an external page.

include()
require()
Was This Post Helpful? 0
  • +
  • -

#9 WMIIII923  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 1
  • View blog
  • Posts: 101
  • Joined: 10-February 06

Re: PHP

Posted 18 February 2006 - 11:39 AM

This might make things easier. I cant get the file header.php to open.
<html>
<head>
<title>
MY SITE
</title>
<link rel="stylesheet" type="text/css" href="format.css" />
</head>
<body>
<div id="head">
<?php
require "header.php";
?>
</div>
<div id="sidebar">
media
</div>
<div id="navigation"> 
links
</div>
<div id="content">
content
</div>
</body>
</html>


Was This Post Helpful? 0
  • +
  • -

#10 Nova Dragoon  Icon User is offline

  • The Innocent Shall Suffer, Big Time
  • member icon

Reputation: 36
  • View blog
  • Posts: 6,169
  • Joined: 16-August 01

Re: PHP

Posted 18 February 2006 - 11:43 AM

does header.php exist in that path?

is this file you are typing a .php file?
Was This Post Helpful? 0
  • +
  • -

#11 Amadeus  Icon User is offline

  • g+ + -o drink whiskey.cpp
  • member icon

Reputation: 248
  • View blog
  • Posts: 13,506
  • Joined: 12-July 02

Re: PHP

Posted 18 February 2006 - 11:47 AM

Another question...does the server (even if it's local) have a php intepreter installed on it?
Was This Post Helpful? 0
  • +
  • -

#12 WMIIII923  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 1
  • View blog
  • Posts: 101
  • Joined: 10-February 06

Re: PHP

Posted 18 February 2006 - 11:49 AM

header.php exists but im trying to insert it into an html file
Was This Post Helpful? 0
  • +
  • -

#13 WMIIII923  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 1
  • View blog
  • Posts: 101
  • Joined: 10-February 06

Re: PHP

Posted 18 February 2006 - 11:52 AM

I dont think so but i can view other web pages that have PHP files in them
Was This Post Helpful? 0
  • +
  • -

#14 snoj  Icon User is offline

  • Married Life
  • member icon

Reputation: 84
  • View blog
  • Posts: 3,564
  • Joined: 31-March 03

Re: PHP

Posted 18 February 2006 - 11:58 AM

Is the file that's calling it have the extension .php? Or is the server configured to use the php parser on the filetype that it is?
Was This Post Helpful? 0
  • +
  • -

#15 Amadeus  Icon User is offline

  • g+ + -o drink whiskey.cpp
  • member icon

Reputation: 248
  • View blog
  • Posts: 13,506
  • Joined: 12-July 02

Re: PHP

Posted 18 February 2006 - 11:59 AM

To execute PHP code, the file that will execute it has to be a php file as well, and for that code to be executed, the server must be able to interpret the php code. You are able to view other pages that have php code because the server on which they sit can interpret php...you are only viewing them through a browser, not serving them as well. You may wish to have a closer look at some of the documentation...you can begin here for windows:
http://ca.php.net/install.windows

or here:
http://www.hostlibra...ql_php_on_linux
or here:
http://ca3.php.net/install.unix
for linux
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1