Showing posts with label html. Show all posts
Showing posts with label html. Show all posts

Sunday, 20 December 2015

code for website automatic redirection

Your questions:

how redirect my website ?
how redirect my website using html ?
how redirect my website using js (javascript) ?
how redirect my website using php ?

Answers:

You can redirect your website (web pages) using html or javascript or php

html code for website redirection:

<meta http-equiv="refresh" content="0;url=http://yournewurl.com"/>

you can redirect your website using this html code 

Javascript code for website redirection:

<script type="text/javascript"> 
window.location="login.php";
 </script>

you can redirect your website using this javascript code 

php code for website redirection:

<?php   header('Location:http://yoursite.com/path/login.php'); ?>

you can redirect your website using php header function 

website redirection using html

Tag: Automatic redirection website using html meta tag

STEP 1:

Scroll down to where you see <head> tag.

STEP2 :

Add below code into your template just after the <head> tag.

<meta http-equiv="refresh" content="0;url=http://yournewurl.com"/>

It should Look Like This.

<head>
<meta http-equiv="refresh" content="0;url=http://yournewurl.com"/>
</head>

STEP3:

Replace http://yournewurl.com , you want to redirect your url.


php form submit without page refresh using angularjs

how to php form submit without page refresh ?

answer:

you can submit input field without page refresh using html , php , angular js
[This example is submit html check box and without page refresh]

angular.min.js

index.php

<!DOCTYPE html>
<html>
<head>
    <script src="angular.min.js"></script>
</head>

<body ng-app="myapp">

<div ng-controller="MyController" >
    <form>

        <input class="singleRoom" type="checkbox" name="firstName" ng-model="myForm.firstName"  ng-true-value="YES" ng-false-value=" " /> First name <br/>

    </form>

    <div>

<?php
       $a=" {{myForm.firstName}} ";
   
   echo $a;    ?>

    </div>
</div>

<script>
    angular.module("myapp", [])
            .controller("MyController", function($scope) {
                $scope.myForm = {};
                
            } );
</script>

</body>
</html>

html and php input form using angular.js

you can submit input field without page refresh using html , php , angular js

[This example is submit html check box and without page refresh]

angular.min.js

index.php


<!DOCTYPE html>
<html>
<head>
    <script src="angular.min.js"></script>
</head>

<body ng-app="myapp">

<div ng-controller="MyController" >
    <form>

        <input class="singleRoom" type="checkbox" name="firstName" ng-model="myForm.firstName"  ng-true-value="YES" ng-false-value=" " /> First name <br/>

    </form>

    <div>

<?php
       $a=" {{myForm.firstName}} ";
  
  echo $a;   ?>

    </div>
</div>

<script>
    angular.module("myapp", [])
            .controller("MyController", function($scope) {
                $scope.myForm = {};
                
            } );
</script>

</body>
</html>