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.

 

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
New Webmasters ask "How-To" questions here. This is where other fucking Webmasters help.

 
Thread Tools
Old 03-16-2013, 08:26 AM   #1
redmark
Registered User
 
redmark's Avatar
 
Join Date: Jul 2007
Posts: 8
Dynamic content with PHP or javascript

Hi everyone

I'm working on my new site (a free pics and vids), is there another way to built a dynamic site then using PHP because i don't want to rename all my pages to .php . I saw other websites with dynamic menu, ad space, refferrer list... all the stuff added to all pages of the site and they use .html

If they use javascript to add HTML to their pages, how it work, because when check the source code of their pages, I see HTML codes. Is Google bot can see their HTML codes for SEO reasons?

I want to use javascript to include HTML codes to my pages like I did with PHP
Maybe I miss something, I need some help, Thanks
__________________
Redmark
redmark is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook
Old 03-16-2013, 09:41 AM   #2
Kostly
Confirmed User
 
Kostly's Avatar
 
Industry Role:
Join Date: Oct 2011
Posts: 474
You need .htaccess to remove the .php
__________________
Slippery Onion - Upload Images for Free Backlinks
Our Kinky Life - Our Adult Sites
Kostly is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook
Old 03-16-2013, 09:41 AM   #3
hulker
Registered User
 
Industry Role:
Join Date: Mar 2013
Posts: 26
Actually you miss a lot of things. You can set up your webserver to parse html files for php code very easily. Or you can set up your webserver to call the equivalent .php document if you call an .html ( like index.html still points to an index.php ) . And a few more options.
__________________
pervypig.com
hulker is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook
Old 03-17-2013, 11:58 AM   #4
redmark
Registered User
 
redmark's Avatar
 
Join Date: Jul 2007
Posts: 8
What most webmasters do to include html code to their pages like a menu on top of every pages of the site that can be updated without manually change all these pages.

What is the right way to do this for seo, server speed and user friendly

I need step by step details for server configuration
Thanks in advance
__________________
Redmark
redmark is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook
Old 03-24-2013, 07:22 PM   #5
robber
Web Developer
 
Industry Role:
Join Date: Jan 2011
Location: UK
Posts: 264
Quote:
Originally Posted by redmark View Post
What most webmasters do to include html code to their pages like a menu on top of every pages of the site that can be updated without manually change all these pages.

What is the right way to do this for seo, server speed and user friendly

I need step by step details for server configuration
Thanks in advance
Showing Pages as .htm

Ok you have two methods, you could use .htaccess to map all the .php files to be .htm, but this involves using a reasonable structure as the rules can be fiddly if you have a lot of subdirectories of different depths that you need to display content from.

or as previously suggested get the server to parse all .html / .htm files as php. This is something which can backfire if you're not careful as it will evaluate all .html / .htm files, which could slow the server down if it's only a handful which need to be php.

Showing standard menu across top of site

You can either create a standard template and have that used across the site, then you only need to update the template (this involves some forward planning, but can be good if you what to have a dynamic site).

Or you can include the menu on all the pages you need (same with the footer info), to do this you can write it as

Code:
<?php
   @include_once("menu.php"); # For your menu
   @include_once("footer.php"); # For your footer
   # ..... you can carry this on for as many elements you want.
?>
What I do

Personally I would create one template and then link all the pages up and feed them in through $_GET[] in the url's and it would have the page names being mapped by a .htaccess file using mod_rewrite functions. It might sound a little complicated to start with but it will pay off if you're creating a site which needs to be able to grow and expand quickly without the need to create every single page, take for example http://livegfcam.com this creates all the pages and links you see dynamically, all I have done is write the template, directory mapping and layout, if you looked at the server there are only a handful of files and the directories you see in the URL do not exist.

I use this solution as I know php well enough to be able to create a lot of my content on the fly, what I would suggest is to think about what you want to do, google the question then if you can't understand the answer either post on the forums or if you don't want to do that, you can always drop me an email rob [at] foxydrop [dot] com

An example from a project I'm currently doing (edited down to remove some of my features so you can get an idea)

Example

index.php

Code:
<?php

ob_start();

## FTGP V 2.0 :D ##

@require_once("config.php");
$url = str_replace("www.","",$_SERVER["HTTP_HOST"]);

$sq = @mysql_query("select * from sites where address='".$url."' limit 0,1");
$tgps = @mysql_fetch_assoc($sq);

$sitename = $tgps['title'];

?><html>
<head>
<title><?php echo $sitename; ?></title>
<link href="/style.css" rel="stylesheet">
</head>
<body>
<img src="/title/<?php echo $tgps['title']; ?>.jpg" alt="<?php echo $sitename; ?>">
<div id="wrapper">
<?php
	if($_GET['page']== "index" || empty($_GET['page'])) $_GET['page'] = "home";
	if(file_exists($_GET['page'].".php")){
		include_once($_GET['page'].".php");
	} else {
		include_once("home.php");
	}
?>
<div style="clear:both"></div>
</div>
<div id="foot">
	<!-- Footer info here -->
</div>
<span style="clear:both">&nbsp;</span>
</body>
</html><?php

ob_end_flush(); ?>
.htaccess

Code:
#start .htaccess code
## FTGP 2 by FoxyDrop.com ##

RewriteEngine On
RewriteBase /

####### Security #######

<FilesMatch ?\.(htaccess|htpasswd|ini|pg|eps|log|sh)$?>
Deny from all
</FilesMatch>

## Lock Directories ##

Options -Indexes -MultiViews +FollowSymlinks

## Hotlink Protection

RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?(top\.)?foxydrop.com [NC]
RewriteRule \.(jpg|jpeg|png|gif)$ - [NC,F,L]

####### House Keeping #######

## Error Pages ##

ErrorDocument 401 /?pg=404&error=401
ErrorDocument 403 /?pg=404&error=403
ErrorDocument 404 /?pg=404&error=404
ErrorDocument 500 /?pg=404&error=500

####### Clean URLS #######

## General ##

RewriteRule ^([^/\.]+).htm?$ index.php?page=$1 [L]
RewriteRule ^sitemap.xml?$ sitemap.php [L]
The above are simple examples the actual files are much more indepth as I have multisite templates which span across a wide number of sites. I've removed a lot of the .htaccess file and parts of the template as they are all the extras like my actual footer and all my tracking and ad details, as well as the additional network sites.

Also just to point out the actual working parts of the site like the actual pages which are being included are the ones which have most of the code in this is just the template part of the site.

Hope this helps

Rob
robber is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook
Old 04-06-2013, 10:00 PM   #6
Mark.Roy
Confirmed User
 
Industry Role:
Join Date: Apr 2013
Posts: 122
for dynamic content site, you need to use php.

and if you want html as an extension then you need to use htaccess rewrite rules.

or you can add single line in httpd.conf on your server to treat .html files as .php files.

this way you can create php coded files with .html extension like you said.

good luck.
Mark.Roy is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook
 
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.