Try to use this important htaccess code for redirecting an URL's index page to non index Url’s. this code is very very important for seo point of view
RewriteCond %{THE_REQUEST} /index\.html [NC]
RewriteRule ^/?index\.html$ http://www.maindomain.com/$1 [R=301,L]
Php Tutorials 4all
Tuesday 6 August 2013
Redirect URL's index page to nonindex page
Redirect URL from subdirectory to sub domain using htaccess
We can redirect URL's from any subdirectory (like maindomain.com/dorectoryname) to a sub domain (subdomain.maindomain.com) using PHP and .htaccess by the subsequent ways.
For example, the .htaccess file is full of rules like the following:
For example, the .htaccess file is full of rules like the following:
------------------------------------------------------------------------------------------------------------------------
RewriteCond %{HTTP_HOST} ^(www\.)?maindomain\.com$
RewriteRule ^dorectoryname/(.*)$
http://subdomain.maindomain.com/$1 [L,QSA,R=301]
or we can using this code
RewriteCond %{REQUEST_URI} ^/
dorectoryname
RewriteRule ^(.*)$ http://
subdomain.
maindomain.com/$1 [R=301,L,P]
Sunday 2 October 2011
How to make account registration with account activation script in PHP
This is a basic and simple user account registration script with account activation script, written in PHP and MySql.
This is a link, which comes from user email, when the user click on itt, then the link goes and redirect to this script.
http://xyz.com/activate.php?key=true&p=fgdsfdjhfyuiobmjioujnllshgfuropvn
Make a page named it as activate.php and paste below stated php code
This is a link, which comes from user email, when the user click on itt, then the link goes and redirect to this script.
http://xyz.com/activate.php?key=true&p=fgdsfdjhfyuiobmjioujnllshgfuropvn
Make a page named it as activate.php and paste below stated php code
if($_GET['key'] == true)
{
$key = $_GET['p'];
$sql = "SELECT * FROM users WHERE user_key = '" . $key . "'";
$result = mysql_query($sql) or die(mysql_error());
if(mysql_affected_rows($result) > 0)
{
$sql = "UPDATE users
SET user_key = '', user_active = '1'
WHERE user_key = '" . $key . "'";
$result = mysql_query(sql) or die(mysql_error());
if($result)
{
$_SESSION['PROCESS'] = $lang['Account_activated'];
header("Location: ../index.php");
}
else
{
$_SESSION['ERROR'] = $lang['Key_error'];
header("Location: ../index.php");
}
}
else
{
$_SESSION['ERROR'] = $lang['Invalid_key'];
header("Location: ../index.php");
}
{
$key = $_GET['p'];
$sql = "SELECT * FROM users WHERE user_key = '" . $key . "'";
$result = mysql_query($sql) or die(mysql_error());
if(mysql_affected_rows($result) > 0)
{
$sql = "UPDATE users
SET user_key = '', user_active = '1'
WHERE user_key = '" . $key . "'";
$result = mysql_query(sql) or die(mysql_error());
if($result)
{
$_SESSION['PROCESS'] = $lang['Account_activated'];
header("Location: ../index.php");
}
else
{
$_SESSION['ERROR'] = $lang['Key_error'];
header("Location: ../index.php");
}
}
else
{
$_SESSION['ERROR'] = $lang['Invalid_key'];
header("Location: ../index.php");
}
Thursday 22 September 2011
How to generate a random password using php
Here there is a simple example for generate a random password using php, it is quite easy and simple to make.
$length =10; // the length of the required password length
$characters_to_use ="abcdef1234567890"; // characters are to be use in your password
for($i = 0; $i < $length; $i++)
{
$do = mt_rand(0,strlen($characters_to_use)-1);
$password = $password . $characters_to_use{$do};
}
echo $password; // here you can view the password
$length =10; // the length of the required password length
$characters_to_use ="abcdef1234567890"; // characters are to be use in your password
for($i = 0; $i < $length; $i++)
{
$do = mt_rand(0,strlen($characters_to_use)-1);
$password = $password . $characters_to_use{$do};
}
echo $password; // here you can view the password
Wednesday 21 September 2011
Hide navbar from blogger
If you want to hide or remove the navigation bar which is appear on the top region of your blogger, follow these steps
1. Login to your blogger.
2. Click "Designs".
3. Goes to "Template Manager", a template editor will be open.
4. Click on "Advanced" and then "Add css".
5. Then at right side text box areas put the below mentioned css code . and then click on "apply to Blog" option for saving this property to your blogger.
#navbar {
height: 0px;
visibility: hidden;
display: none;
}
6. Watch the changes in your browser.
1. Login to your blogger.
2. Click "Designs".
3. Goes to "Template Manager", a template editor will be open.
4. Click on "Advanced" and then "Add css".
5. Then at right side text box areas put the below mentioned css code . and then click on "apply to Blog" option for saving this property to your blogger.
#navbar {
height: 0px;
visibility: hidden;
display: none;
}
6. Watch the changes in your browser.
Monday 19 September 2011
php web development tools - captcha
Web development tool CAPTCHA, stands for Completely Automated Public Turing to tell Computers and Humans Apart.
A CAPTCHA is a program that can generate distorted text that humans can see or listen but computer cannot.
Applications of CAPTCHA systems
-- Preventing Spam in Blogs.
-- Protecting Website Registration.
-- Search Engine Bots.
-- Worms and Spam.
In web application development we can use the following CAPTCHA systems that are listed below
reCAPTCHA - In this type of CAPTCHA systems user can view the distorted text or also listen the text, now a days it is most popular CAPTCHA systems for web developers
Securimage : The Securimage Captcha script is free open-source. here the PHP script is used to generat complex images and complex CAPTCHA alphanumeric codes.
FreeCap - This script support GPL CAPTCHA script systems to stop spam
A CAPTCHA is a program that can generate distorted text that humans can see or listen but computer cannot.
Applications of CAPTCHA systems
-- Preventing Spam in Blogs.
-- Protecting Website Registration.
-- Search Engine Bots.
-- Worms and Spam.
In web application development we can use the following CAPTCHA systems that are listed below
reCAPTCHA - In this type of CAPTCHA systems user can view the distorted text or also listen the text, now a days it is most popular CAPTCHA systems for web developers
Securimage : The Securimage Captcha script is free open-source. here the PHP script is used to generat complex images and complex CAPTCHA alphanumeric codes.
FreeCap - This script support GPL CAPTCHA script systems to stop spam
Sunday 18 September 2011
function with static variables
static variables can not be reset
values can not change after execution
can not accessible through out the programme
function with global variables
accesible through program.
it generates a unique value after execution
can not assign any values at the time of declaring it or using it
Subscribe to:
Posts (Atom)