![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Confirmed User
Industry Role:
Join Date: Jun 2004
Location: Canada
Posts: 3,056
|
HTML and PHP Question building Websites
I have a quick question.
I want to build a new site (I usually buy templates) but am not sure if I should build a php site or build an html site with some php code in it? I want to build many pages with content (text, images) using a plain old termplate - header, footer, sidebars - but have those areas be so that I update one file and the sidebar across hundreds of pages is instantly updated. Each page will be unique only in content but not the areas that surround a site. So do I build html with some php that can be parsed/served or make the site all php to begin with. Most pages will be built manually. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Confirmed User
Industry Role:
Join Date: Sep 2021
Posts: 29
|
I recommend you taking the long route and developing a full php site, it will be easier to change the navbar, footer or the sidebar in all of the site if it is php, becuase you will need only to change one file.
Best wishes. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Confirmed User
Industry Role:
Join Date: Jun 2004
Location: Canada
Posts: 3,056
|
Thanks. So you mean create index.php files instead of .html files?
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Confirmed User
Industry Role:
Join Date: Jul 2021
Posts: 185
|
Is there even a benefit to having all HTML files?
__________________
![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Confirmed User
Industry Role:
Join Date: Sep 2013
Location: The Netherlands
Posts: 805
|
Lol, I was thinking the same.
Not sure why you would use html files instead of php in the first place. If you don't like the "looks" of the url, for example, yourdomain.com/pagepoop.php, you can easily change it to /pagepoop or even /pagepoop.html for that matter, with your .htaccess file. You can use a html template and make like a default layout for your page(s), which you re-use for each page. For example, where you want the header menu, you use <?php include("headermenu.php"); ?>. Same for the sidebar and page content etc. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
Confirmed User
Industry Role:
Join Date: Apr 2010
Posts: 1,084
|
Hi there,
If you want to have a dynamic content area with a static sidebar for example, you'll definitely have to use PHP for that. The point is, you can still build your site with html, as always, and feed the dynamic parts with php.. Simple as that.. Also, there's Wordpress.. a CMS which will do everything for you without even coding.. If you need any help or guidance, feel free to contact me! Cheers, z |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 |
Living The Dream
Industry Role:
Join Date: Jun 2009
Location: Inside a Monitor
Posts: 19,496
|
Either is fine, depends on what you know best, how much work you wanna do etc. But sounds like a simple template (html) and then php in the sidebars, header, footer.
![]() Have luck!
__________________
My Affiliate Programs: Porn Nerd Cash | Porn Showcase | Aggressive Gold Over 90 paysites to promote! Skype: peabodymedia |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 |
DINO CORTEZ™
Industry Role:
Join Date: Jun 2003
Location: Vancouver Island
Posts: 2,145
|
Whichever you choose to build with, if you hope for Google search traffic, be sure that your site is completely responsive to a wide variety of devices - especially mobiles with max 400ish pixel width.
Mobile friendliness is a huge factor. RE: Html vs PHP - PHP full scripts or inclusive, can adapt rendering to the visitors' devices, but at the cost of server resources. You'll feel it when the scrapers come knocking. I developed my platforms as HTML shells that dynamically include JavaScript. Lower load on the server and with even the wimpiest of mobiles packing more power than some older desktops, the client's end can unpack and render the pages. It's tricky though, but not impossible, to maintain synchronized dependencies. Also, while Google is very capable of rendering even the most dynamically nested JS pages, other "search engines" are not - including Bing, which is useless in delving into anything beyond what's on the main de facto "HTML" page. Also, don't waste your time on problematic traffic. Decide which countries you want to monetize and firewall the rest out. MOST traffic to content rich sites are scrapers and brutes. So firewall webhosts, proxies, and data centers that are notorious for hosting malicious players. Yes, some babies will go out with the bathwater. Pay attention to your server logs. ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 |
Confirmed User
Industry Role:
Join Date: Apr 2019
Posts: 657
|
You can do this with javascript. No need for PHP at all.
__________________
__________________ |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#10 |
Confirmed User
Industry Role:
Join Date: Jun 2004
Location: Canada
Posts: 3,056
|
Thanks for the replies.
I'd want my main content area to be static and the header/footer/sidebars to be able to be changed throughout the site by updating only one file. For example, if I wanted to add a link to the navigation area on a sidebar I'd want to just update one file and have that new link appear across all the pages simultaneously, without having to update each page. So from the replies it seems I can: - Use html and parse some php code using htaccess - Use html and put in some includes (<?php include("headermenu.php"); ?>) where I want the dynamic areas to be. - php only - Use html with java I think I'll stick with html + some php code or some java (which I'll have to learn). I guess I wanted some opinions as coding is not my strong suit. I wanted to make sure I was using languages that would still be relevant 10+ years from now and not have a site that is left in the dust because the original language used (html + some form of php) is not relevant anymore making it too late to change by the time it has grown. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#11 |
Confirmed User
Industry Role:
Join Date: Oct 2018
Location: New Orleans, Louisiana. / Newcastle, England.
Posts: 1,123
|
I just started turning all of my sites to .php a few months ago, its definitely a learning curve but, the end results will save so much time its unreal.
I have a directory site right now that pulls everything from an SQL database and several smaller niche specific sites that pull from that same database, just on a more limited scale. The sites logo, header, navigation, sidebar and main content are all template driven, in addition to the ad blocks on the site so, if anything needs changing, it can be done instantly across thousands of web pages, by changing one include file. If you have the time, patience and drive, definitely start learning to do everything in .php I wish I had done so years ago, it would have saved me so much work over the years ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#12 |
Confirmed User
Industry Role:
Join Date: Dec 2019
Posts: 143
|
php still serves html to the front end, and you end up with a fully dynamic site - dont see why anyone would bother doing .html unless you are ready to duplicate pages and make each one again and again.
header.php content1,2,3,blah.php [this has your includes] sidebar.php footer.php all those will have html in them im well aware thats a very simplified look at things
__________________
AMA SEO or Wordpress ![]() My best performing cams network | Club Brandy | Lovense Live |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#13 | |
Confirmed User
Industry Role:
Join Date: Sep 2013
Location: The Netherlands
Posts: 805
|
Quote:
Htaccess file is used to rewrite the url. So, to turn page.php?id=2 into page-2.html etc. One final tip, learn to create and use functions. Let's say a simple function for showing an image, else, you might one day end up having to edit 100s of html image codes manually whenever you want to change something (like adding lazyloading or webp support) in the future. |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#14 |
Registered User
Join Date: Jun 2007
Posts: 80
|
yeah make sure you're learning javascript, not java
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#15 | |
Confirmed User
Industry Role:
Join Date: Jun 2004
Location: Canada
Posts: 3,056
|
Quote:
Is it not the same to have a .html site with some php code inside it? That way you can change one file where the php code resides and still update an area of the site over 1000s of pages? |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#16 |
Monger Cash
Industry Role:
Join Date: Jul 2010
Posts: 2,773
|
Just learn and use Wordpress, you'll save yourself so much time and headaches
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#17 | |
Confirmed User
Industry Role:
Join Date: Jun 2004
Location: Canada
Posts: 3,056
|
Quote:
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#18 | |
Confirmed User
Industry Role:
Join Date: Jun 2004
Location: Canada
Posts: 3,056
|
Quote:
I love it because it's easy to use and does everything for me. I hate it because it's clunky, slower than straight html or php sites and is hard to make it look like you want it to (design, fonts etc.) |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#19 | |
DINO CORTEZ™
Industry Role:
Join Date: Jun 2003
Location: Vancouver Island
Posts: 2,145
|
Quote:
Static HTML pages are flat text files, usually with .html file extension. They require the least amount of server resources. If properly configured, the server can send back an HTTP 304 code for pages which have not been modified, so the browser checks it's own cache of the page before even bothering to download the same file again. On the other hand, static HTML is incapable of responding in real time to any special considerations such as the browser type/device. Dynamic HTML pages include all basic HTML markup tags, but they may bring in PHP and JavaScript includes, and/or inline JavaScript code. These pages offer the greatest versatility in responsiveness and it's up to you as to how much load to add with your server include calls. One can, and I have in the past, develop content management systems that rebuild entire websites as static HTML, sometimes with just a dash of "includes". This is the best of all worlds because database-related functions are not run in real-time. Pages load fast. In 2008, I coded a directory, that had over 20 million pages - all static HTML, and rebuilt on the server during off hours. I also cached my Wordpress pages the same way. My visitors/hackers NEVER invoked my MYSQL server. Wordpress USED to be a wonderful platform for crafting sites to which content could be easily added and there was plenty of style control available though Templates (free or paid) and customizing the PHP modules. Now, it is too auto dynamic, and what was a tight working blog before you hit the sack, can drop dead while you're sleeping, after an update. Also, the core structural design of Wordpress is so well known that there are many brute force tools out there constantly pecking away at the built-in vulnerabilities. Just check you regular server logs and see how many hits you get (from Russia without love, and China) on wp-admin and such folder scripts. I would not recommend using Wordpress for any serious website that expects significant traffic with consistent response time. IF you do go that route, make sure you have page caching to spare your DB server loads, and TEST IT regularly. ![]() |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#20 |
Monger Cash
Industry Role:
Join Date: Jul 2010
Posts: 2,773
|
we've been running our paysites on wordpress for over a decade... granted, we're in the process of working on a headless react setup due to our growth over the years, but still.
Wordpress is a viable starting place for nearly any type of website you can think of (that requires php and a database heh). I'm not advocating for it as the end-all-be-all, but manually handling data via html alone is so 1996 >< |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#21 |
Registered User
Join Date: Jan 2007
Posts: 15
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#22 | ||
Confirmed User
Industry Role:
Join Date: Jun 2004
Location: Canada
Posts: 3,056
|
Quote:
Quote:
Same question here as above. If you have 20 million static html pages, how then can you modify or change them all if they don't have any php includes or code that is common to all pages that can be modified in one file? Unless I'm misunderstanding. |
||
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#23 | |
DINO CORTEZ™
Industry Role:
Join Date: Jun 2003
Location: Vancouver Island
Posts: 2,145
|
Quote:
It's all about building on a basic simple concept, but depending on how much you add in, the end result can be extremely dynamic - not necessarily in real time per user, but periodically updating over a longer term. You have slow moving data and fast moving data. 1) THE BASIC HTML PAGE WITH INCLUDES So you start with <html> ... </html> If HTML tags are all you use, that page will always look the same. Actually, not necessarily. CSS is a great way to manage the esthetics of your page WITHOUT having to change your HTML. Just update your CSS with your "new look", and the rest takes care of itself. You have several choices for "includes": PHP INCLUDES: When it comes to integrating PHP code with HTML content, you need to enclose the PHP code with the PHP start tag <?php and the PHP end tag. The code you put into the PHP sections will determine what is visually generated and how much load/delivery time your code adds. PHP can do calculations, server environment retrievals (date/time), and database lookups. JAVASCRIPT INCLUDES: The <script>... tag lets you put JS code in your HTML page, either directly or by including files of JavaScript. JS, like PHP can do calculations, determine/render your page according to the user's browser/device, but unlike PHP, JS runs on the user's browser without adding load to the server. DYNAMICALLY GENERATING HTML FROM A DATABASE AND SERVER SCRIPTS: When you start making your HTML pages, you will probably use a page or text editor to insert all the HTML markup codes, plus any PHP and/or JS you want to add. When you're done, you upload that page file to your server and then anyone with a browser can "see" your page. Now imagine, instead of manually "typing" all the stuff in your HTML page, you create a database (like MYSQL or even just plat text files) and organize all the "shared" information you want on groups of your pages (like headers, menus, etc) as data in the database. To do this, you need to really be clear on the overall structure of your website. In many ways, this is what Wordpress does - all of your blog posts and categories, etc are saved in a MYSQL db, which is used by PHP scripts each time (unless the page is cached) a page is requested. If your website has lots of pages where the information is pretty static, instead of rendering each page (at the expense of a server DB hit) in real time, one can write their own scripts in PHP or (my preference) Perl, that are run as an administrative (like once a day or week) tasks, either as CRON jobs or manually invoked from Shell (if it's best to keep an eye out for unexpected side effects, across thousands of pages). So in this case, the actual "HTML files" are not typed and uploaded by you - they are actually created by the server, on the server, with careful provisions to replace the old pages with the newer fresh pages. These server-written pages can enjoy the benefits of full access to databases (when they are created), and also code includes in the HTML pages. Even though the HTML pages are static, they can take advantage of includes for stuff that needs to be up-to-date for every page request. This level of content generation works for ANY code pages. I have scripts that write PHP and JAVASCRIPT CODE from databases as well. Server-generated pages/code is not for beginners, nor is it appropriate for all applications. STARTING OUT: Mock up you pages, and figure out which parts of them need to change regularly or adapt each and every time to a visitor request. Those changeable parts can be handled by includes. FOR COMPLETENESS: You could just code the entire page as PHP (index.php vs index.html), with full access to what PHP offers, and use JAVASCRIPT and CSS to respond to the visitor's browser dimensions. I've been writing code generator programs for decades, so I'm comfortable with my hybrid approach, but that's not say that using PHP for the whole shebang is not a good idea. In the end, you, or whoever is going to maintain your site, needs to be comfortable with the development platform you choose (also why Worpress is so popular). Good luck! |
|
![]() |
![]() ![]() ![]() ![]() ![]() |