This is a discussion on "Using PHP, Javascript and HTML all in one" within the PHP Forum section. This forum, and the thread "Using PHP, Javascript and HTML all in one are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
Using PHP, Javascript and HTML all in one
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
Okay, so here's the deal, I'm making a somewhat personal site but also kinda a community thing, the point is I plan to have a forum and a login/register member system just like this site has but of course different. Currently I have no idea on even how to load the php into a my server to test and make sure it works. Does anyone have any suggestions at all? Anything is much appreciated.
|
|
|
|
#2
|
|||
|
|||
|
Re: Using PHP, Javascript and HTML all in one
make a .php file and in that put everything you need.
php code is usually contained within <?php foo$; ?> and such.
Last Blog Entry: Apps every Mac based web dev should consider (Jul 10th, 2008)
|
|
#3
|
|||
|
|||
|
Re: Using PHP, Javascript and HTML all in one
okay but i have several scripts of like a calender and the forum code that i have but it's in many php files, is it as simple as putting them all in a folder and calling from that folder to load?
|
|
#4
|
|||
|
|||
|
Re: Using PHP, Javascript and HTML all in one
Basically yes.
|
|
#5
|
|||
|
|||
|
Re: Using PHP, Javascript and HTML all in one
.inc file? folder? Can you explain just a little bit more please?
because i understand that the <?php include(filename.inc); calls the file/folder whatev (sorry if i seem like an absolute retard) |
|
#6
|
|||
|
|||
|
Re: Using PHP, Javascript and HTML all in one
I'm moving this thread to the php forum as that's where it belongs.
Sorry for miss-leading you before. Use .inc files when you want to have common sections of code such as navigation code that you include on every page and then when the navigation changes, you only have to change one file. I suggest at this stage that you install the Apache/PHP/MySQL combination on your own machine. Then when you have all the wrinkles out of your code you can worry about uploading to a live server. Last edited by ukgeoff; Oct 13th, 2006 at 18:15. |
|
#7
|
||||
|
||||
|
Re: Using PHP, Javascript and HTML all in one
A .php page can include straight html code. When you want the same html code in a number of different php files, it is more efficient to make a single html file and then "include" it in the php file, just like you might have a separate .js page and include it by reference in a number of different html pages.
These files are just code that is used on a lot of different pages, like a header or footer. Files with ".inc" designation are generally .html files that are used only for inclusion in a .php file. You could designate them as ".htm" or ".html" files and they would work just as well; people call them ".inc" files just to help them remember what is what. Actually, many or most ".inc" files contain php code as well as html code. For instance, a variable's value (such as the page title) will be used on the "inc" page; the value will be assigned on the specific php page. Thus, every page will have the same header, except that the correct title for each individual page will be suppliied by the php file. |
|
#8
|
|||
|
|||
|
oh okay, well ends up i just trashed the php confusing idea and am headed towards javascript, so far i have the login halfway completed although i have yet to figure out how to make myself have a login name and pass.
|
![]() |
| Tags |
| html, javascript, php |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Multi-Quote in Javascript/html help | Manz16 | JavaScript Forum | 0 | Apr 11th, 2008 20:11 |
| Javascript syntax in html attributes | kenoli | JavaScript Forum | 4 | Sep 10th, 2007 13:49 |
| HTML/CSS/Javascript custom scrollbar | Voodoochilli | Web Page Design | 10 | Jun 25th, 2007 22:09 |
| Web Developer - CSS, JavaScript, HTML - Cambridge | Web JobBot | Job Opportunities | 0 | Oct 18th, 2006 14:03 |