Results 1 to 4 of 4

Thread: CAn I have a PHP subdirector in an HTML site?

  1. #1
    Join Date
    Nov 2004

    Question CAn I have a PHP subdirector in an HTML site?

    i'm about to convert my site from XHTML 1.0 Strict to PHP.

    Also, I'm building a tiny site for a friend, as a surprise, for Christmas, I hope; don't know if I'll make that date; it'll be PHP.

    What I want to do is put up a subdirectory for this friend (actually, it's already there, but it's in XHTML 1.0 Strict; I can wipe it out, and start again with PHP).

    So, can I have a structure like this:

    My regular site:


    all pages and subdirectories contained here.


    with highgarth in PHP instead of XHTML

    Would that work?

    If so , how do I implement that?


    Mon, 19 Dec 2005 17:09:26
    My site is my home-and-playground
    Carol W

  2. #2
    Join Date
    Dec 2002
    Manchester, UK
    Well anything with the extension .php will be parsed as PHP and anything with the extension .htm or .html will be served as text/html without being parsed. So you should be able to just create the directory and start PHPing, assuming your host supports PHP.

    By the way, you know that the PHP should still output (X)HTML, right?
    Last edited by David Harrison; 12-19-2005 at 08:56 PM.
    Every fight is a food fight when you’re a cannibal.

  3. #3
    Join Date
    Nov 2004
    Dear David,

    Oh! Great! Then before I tackle the full editing of my c150-page site, I could use the site I'm building to test with; whew! Gosh, and when I tackle my own site, I can have some pages conversted to PHP and others not, and they should still work EXCEPT - for the links - come to think of it, I don't think the links would work right, so I'd better edit my entire site before uploading it to my host, so the links work!

    However, the one I'm building for my friend only has one page (and no content yet), and only about 7 pages planned to begin with, and that one, I can put into PHP in a subdirectory; it isn't linking to my own regular site (yet). So no problem there, I guess! This is wonderful; I can try it out to see how it works, which will make my editing easier.

    Umm, I'm not sure exactly what you mean by that last sentence, but I went to the PHP home page and began reading their tutorial, and very early there, I see that you can put PHP into an (X)HTML page, and go back and forth, and I think I vaguely get the idea of what you're talking about. I was glad to see remarks in the PHP tutorial about maintaining (X)HTML standards, because the W3C Validators are my lifesavers, along with these forums.

    I also tried validating a PHP page, and got an error message, but when I renamed the same page from index.php to index.htm, without changing a thing n the page, the W3C Markup Valadator accecpted that, so I guess I can validate locally on my own machine, before upload to my host, using that method.

    Oh - so I guess yes, I did know that - that is, that I can just use my XHTML 1.0 Strict pages, leaving the document type intact, and converting only any bits of code that run little scripts. (Is that right? I think so.)

    Mon, 19 Dec 2005 18:20:31
    Last edited by David Harrison; 12-19-2005 at 09:45 PM.
    My site is my home-and-playground
    Carol W

  4. #4
    Join Date
    Dec 2002
    Manchester, UK
    Well since PHP is a server-side language, when it's finished running, only (X)HTML is sent to the browser. So even if you use PHP, the browser will still end up with your XHTML Strict, except that the file will be called .php.

    Yeah, you can use your existing pages and just insert PHP into them which will run before anything is sent to the browser, but unless you have a .htaccess file that tells the server to parse .html pages for PHP, all the files will need to be renamed to .php.

    Edit: I think I must be a bit tired, I just edited your post instead of posting a new reply , luckily I could restore your post though. Think I better go to bed before I cause any more damage.
    Every fight is a food fight when you’re a cannibal.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center



X vBulletin 4.2.2 Debug Information

  • Page Generation 0.10826 seconds
  • Memory Usage 2,862KB
  • Queries Executed 13 (?)
More Information
Template Usage (32):
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_global_above_footer
  • (1)ad_global_below_navbar
  • (1)ad_global_header1
  • (1)ad_global_header2
  • (1)ad_navbar_below
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)ad_thread_first_post_content
  • (1)ad_thread_last_post_content
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)headinclude_bottom
  • (4)memberaction_dropdown
  • (1)navbar
  • (4)navbar_link
  • (1)navbar_moderation
  • (1)navbar_noticebit
  • (1)navbar_tabs
  • (2)option
  • (4)postbit
  • (4)postbit_onlinestatus
  • (4)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available (6):
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files (26):
  • ./showthread.php
  • ./global.php
  • ./includes/class_bootstrap.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/functions_navigation.php
  • ./includes/class_friendly_url.php
  • ./includes/class_hook.php
  • ./includes/class_bootstrap_framework.php
  • ./vb/vb.php
  • ./vb/phrase.php
  • ./includes/functions_facebook.php
  • ./includes/functions_calendar.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_notice.php
  • ./packages/vbattach/attach.php
  • ./vb/types.php
  • ./vb/cache.php
  • ./vb/cache/db.php
  • ./vb/cache/observer/db.php
  • ./vb/cache/observer.php 

Hooks Called (70):
  • init_startup
  • friendlyurl_resolve_class
  • init_startup_session_setup_start
  • database_pre_fetch_array
  • database_post_fetch_array
  • init_startup_session_setup_complete
  • global_bootstrap_init_start
  • global_bootstrap_init_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • load_show_variables
  • load_forum_show_variables
  • global_state_check
  • global_bootstrap_complete
  • global_start
  • style_fetch
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • strip_bbcode
  • friendlyurl_clean_fragment
  • friendlyurl_geturl
  • forumjump
  • cache_templates
  • cache_templates_process
  • template_register_var
  • template_render_output
  • fetch_template_start
  • fetch_template_complete
  • parse_templates
  • fetch_musername
  • notices_check_start
  • notices_noticebit
  • process_templates_complete
  • friendlyurl_redirect_canonical
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • bbcode_parse_start
  • postbit_imicons
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • memberaction_dropdown
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • build_navigation_data
  • build_navigation_array
  • check_navigation_permission
  • process_navigation_links_start
  • process_navigation_links_complete
  • set_navigation_menu_element
  • build_navigation_menudata
  • build_navigation_listdata
  • build_navigation_list
  • set_navigation_tab_main
  • set_navigation_tab_fallback
  • navigation_tab_complete
  • fb_like_button
  • showthread_complete
  • page_templates