Using PHP, Javascript and HTML all in one

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.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Program Your Website > PHP Forum

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Oct 12th, 2006, 16:46
New Member
Join Date: Oct 2006
Location: Austin
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Arrow Using PHP, Javascript and HTML all in one

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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Oct 12th, 2006, 16:48
Elite Veteran
Join Date: Aug 2005
Location: That Place
Posts: 2,044
Blog Entries: 1
Thanks: 0
Thanked 37 Times in 37 Posts
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)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Oct 12th, 2006, 16:51
New Member
Join Date: Oct 2006
Location: Austin
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
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?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Oct 12th, 2006, 18:07
Most Reputable Member
Join Date: Apr 2006
Location: Cornwall, UK
Posts: 1,310
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Using PHP, Javascript and HTML all in one

Basically yes.

Code: Select all
<?php
   include (myscript.inc);
   ...
   process as required
   ...
?>
I always use .inc for files that are to be included into other files.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Oct 13th, 2006, 01:35
New Member
Join Date: Oct 2006
Location: Austin
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
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)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old Oct 13th, 2006, 18:09
Most Reputable Member
Join Date: Apr 2006
Location: Cornwall, UK
Posts: 1,310
Thanks: 0
Thanked 0 Times in 0 Posts
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7  
Old Oct 13th, 2006, 21:43
masonbarge's Avatar
Highly Reputable Member
Join Date: Jan 2006
Location: Atlanta GA
Posts: 631
Thanks: 0
Thanked 0 Times in 0 Posts
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8  
Old Oct 13th, 2006, 23:31
New Member
Join Date: Oct 2006
Location: Austin
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Question Re: Using PHP, Javascript and HTML all in one

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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
html, javascript, php

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

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


All times are GMT. The time now is 16:13.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42