Go Back   vb.org Archive > vBulletin 5 Connect Discussion > vB5 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 08-13-2014, 01:49 AM
Brad Padgett's Avatar
Brad Padgett Brad Padgett is offline
 
Join Date: Jul 2014
Posts: 46
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Editing .htaccess to use PHP inside of HTML?

I am hosting with Godaddy.

I need the correct coding to edit .htaccess for running PHP code inside of an HTML file (my homepage for instance).

For example, "AddType application" does not work.

Neither did "FCGIdWrapper" or "AddHandler" but I may have used the wrong variation.

I'm sure many of you have had to set this up at some point or another so the correct code for Apache 2.5 is highly appreciated.

Thank you so much.

- Bradley Padgett (thexboxcloud)
Reply With Quote
  #2  
Old 08-13-2014, 01:53 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Why not just set the homepage as index.php instead of index.html?

I'm not sure if a lot of people have had to set up what you want as most would just set index.php as the default.

I don't know the .htaccess to do what you want, sorry.
Reply With Quote
  #3  
Old 08-13-2014, 02:48 AM
Brad Padgett's Avatar
Brad Padgett Brad Padgett is offline
 
Join Date: Jul 2014
Posts: 46
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
Why not just set the homepage as index.php instead of index.html?

I'm not sure if a lot of people have had to set up what you want as most would just set index.php as the default.

I don't know the .htaccess to do what you want, sorry.
If this happens to be Lynne Sands then I am in the right place. And thanks for directing me to vBulletin.org

I may name my vBulletin home page index.php but I also need to know for wordpress for a separate site I am working on for a buddy.

If I was to name it index.php as I have tried, the html code does not take affect. This is possible if you were to explain how I am supposed to get the page to work properly?

To save trouble, the correct .htaccess lines for Apache 2.5 would be perfect.

But if you have a real suggestion that may assist in my (even) creation of the homepage using index.php then I'm all ears. I am experienced in html and css but I haven't got started with my php schooling quite yet.

I will wait on your response.

Thank you a lot.

- Bradley Padgett (thexboxcloud)
Reply With Quote
  #4  
Old 08-13-2014, 05:01 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If you have a file called index.html and you want to show it in index.php, I think your index.php file can just look like this:

PHP Code:
<?php
   readfile
("/path/to/index.html");
?>
(I haven't tried that, but I think it would work.)

As I said before, I've never done what you want to do, but I did google it and found this - http://php.about.com/od/advancedphp/p/html_php.htm According to that, the line to add to your .htaccess file is:
Code:
AddType application/x-httpd-php .html
If that doesn't work, then are you sure your .htaccess file is working? Your host could have the server set up to not allow .htaccess files (they may have AllowOverride set to None instead of All).
Reply With Quote
  #5  
Old 08-14-2014, 08:32 AM
Scanu's Avatar
Scanu Scanu is offline
 
Join Date: Nov 2010
Posts: 829
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Lynne I think that the op doesn't know how to use html and php in a php file

Code:
This is your html code
<?php
echo 'This is your php code';
?>
This is other html code
Reply With Quote
  #6  
Old 08-14-2014, 09:44 AM
Brad Padgett's Avatar
Brad Padgett Brad Padgett is offline
 
Join Date: Jul 2014
Posts: 46
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Scanu View Post
Lynne I think that the op doesn't know how to use html and php in a php file

Code:
This is your html code
<?php
echo 'This is your php code';
?>
This is other html code
From reading I have heard of a similar method with doing the same thing inside of html files.

Like this:
Code:
<?php
echo '<p>text</p>';
echo '<h2>text</h2>';
?>
I intend to name my vBulletin homepage index.php

There are a couple other things I need to use the php for so I'm working with godaddy support right now to figure out how I'm going to get .htaccess to work on apache 2.5

I believe the php handler is FCGI. The support I've received with my webhost so far hasn't been of much help.

The link Lynne gave me is more directed towards another version of apache.

I've tried the method of using FCGIdWrapper and AddHandler. Still nothing.

A solution would evidently be impressive.
Reply With Quote
  #7  
Old 08-14-2014, 09:59 AM
Scanu's Avatar
Scanu Scanu is offline
 
Join Date: Nov 2010
Posts: 829
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm still not sure why you don't want to use a .php file
In a .php file you can use html and php at the same time, why would you need to use php file in a .html file? I'm sorry but i don't fully understand what do you want
Reply With Quote
  #8  
Old 08-14-2014, 10:09 AM
Brad Padgett's Avatar
Brad Padgett Brad Padgett is offline
 
Join Date: Jul 2014
Posts: 46
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Scanu View Post
I'm still not sure why you don't want to use a .php file
In a .php file you can use html and php at the same time, why would you need to use php file in a .html file? I'm sorry but i don't fully understand what do you want
The reason is I have another project going on.

I am designing a wordpress blog to implement a live feed and recent posts widget while still maintaining my index.html as this is all it's going to be.

I've made what I need to get done as clear as possible.

And please don't say I shouldn't ask here because it has to do with wordpress. I am confident it shouldn't matter. Really, I need to know for the purpose of using it anywhere but I could use the info for vBulletin too.

Apache 2.5 > .htaccess > lines for php inside of html

Pretty simple from there. I'll be checking back and forth so if anyone is used to .htaccess on sites like godaddy let me know. It's really been a pain.
Reply With Quote
  #9  
Old 08-14-2014, 04:05 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Have you asked GoDaddy if you can use .htaccess on your site? Like I said previously, if .htaccess doesn't seem to be working, then they may have AllowOverride set to None instead of All.
Reply With Quote
  #10  
Old 08-15-2014, 01:09 AM
Brad Padgett's Avatar
Brad Padgett Brad Padgett is offline
 
Join Date: Jul 2014
Posts: 46
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
Have you asked GoDaddy if you can use .htaccess on your site? Like I said previously, if .htaccess doesn't seem to be working, then they may have AllowOverride set to None instead of All.
Yes, they said it was working.

I'm going to have to start using .php

So I'm going to have to learn how to do this. Apparently the method the other guy suggested is not working. I'll figure this out somehow.
Reply With Quote
Reply


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

Forum Jump


All times are GMT. The time now is 03:13 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05062 seconds
  • Memory Usage 2,268KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (4)bbcode_code
  • (1)bbcode_php
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete