Log In
Poison Weather Castform Don't have an account yet? Register now!
.

Forum Thread

Webpage Programming Guide(WPG)

Forum-Index Help Guides Webpage Programming Guide(WPG)
Puru
OFFLINE
Trainerlevel: 31

Forum Posts: 99
Posted: Sun, 24/05/2015 08:19 (9 Years ago)


This Forum Thread is Dedicated to my bro, EdBells

Welcome! Welcome!. After Riako created this marvellous site,most people wanted to learn Webpage designing too.But they mostly take references from some internet websites,which is really very hard to understand. Thanks to my bro EdBells,he teached me webpage programming in a very good way.He's an excellent teacher.He would have teached you but he's locked now so he can't.And now its my responsibility to create such School.

Requirements



1-You should have Notepad++.
2-You should have a browser.

Show hidden content

#1.Installing Notepad++


Before doing coding,You should have a word processor(excluding MS Word all versions).I do coding on a different software called Notepad++
It looks like this in my task pane:


If you want to learn coding from me,you should have Notepad++ installed,so that it will be easy for you to learn and easy for me to teach if we will have same software.
Click here to directly install Notepad++ Installer
A page named as Untitled will open and then close and the installer will start downloading.Then,
if you have a "Google Chrome" Browser,the download will look like this:

After the download is done,a setup wizard will appear.Fill the requirements of the wizard and the Notepad++ will be there.
IF YOU HAVE ANY PROBLEM REGARDING THE WIZARD,FEEL FREE TO ASK ON THIS FORUM.



#2.Browser


A browser is required as the HTML Document will work on a browser only.
I don't have any objection, but please use Google Chrome to view them



If you have installed it then let's move on.I will start the references from basic(sorry those who already know these) including HTML.But first the basic part should be there.



Main Lesson



An HTML Document is the main thing.The webpage you are viewing right now is also an HTML Document. To learn to create a webpage you must first learn HTML.






Well I can't put anything here or in any other forum or the server may blast as the content will be too much.So if any query please visit W3Schools and if there is still ask in forum.Or if you want to know some coding related to Pokeheroes feel free to ask me.



dragonMACK
OFFLINE
Trainerlevel: 24

Forum Posts: 79
Posted: Sun, 24/05/2015 09:06 (9 Years ago)
its wasome
MADE BY NEZHA
MADE BY NEZHA made by Aisling made by viper
Puru
OFFLINE
Trainerlevel: 31

Forum Posts: 99
Posted: Mon, 25/05/2015 09:20 (9 Years ago)

Title: Moving time like of PH's footer

Show hidden content


<!DOCTYPE html>
<html>
<head>
<script>
function startTime() {
var today=new Date();
var h=today.getHours();
var m=today.getMinutes();
var s=today.getSeconds();
m = checkTime(m);
s = checkTime(s);
document.getElementById('txt').innerHTML = h+":"+m+":"+s;
var t = setTimeout(function(){startTime()},500);
}

function checkTime(i) {
if (i<10) {i = "0" + i}; // add zero in front of numbers < 10
return i;
}
</script>
</head>

<body onload="startTime()">

<div id="txt"></div>

</body>
</html>



The code in <HEAD> tag is there as some scripts work only in head tag
the <body onload="startTime()"> body tag is attributed by onload="startTime()" because it will be triggered only then.
and <div> tag with id enables script to work on ID and to show the time text


Puru
OFFLINE
Trainerlevel: 31

Forum Posts: 99
Posted: Mon, 25/05/2015 10:44 (9 Years ago)

Title: Bootstrap Carousel

Copy the following code in your Notepad++ and view it in browser and see its superb effect
Show hidden content


<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<style>
.carousel-inner > .item > img,
.carousel-inner > .item > a > img {
width: 70%;
margin: auto;
}
</style>
</head>
<body>

<div class="container">
<br>
<div id="myCarousel" class="carousel slide" data-ride="carousel">
<!-- Indicators -->
<ol class="carousel-indicators">
<li data-target="#myCarousel" data-slide-to="0" class="active"></li>
<li data-target="#myCarousel" data-slide-to="1"></li>
<li data-target="#myCarousel" data-slide-to="2"></li>
<li data-target="#myCarousel" data-slide-to="3"></li>
</ol>

<!-- Wrapper for slides -->
<div class="carousel-inner" role="listbox">
<div class="item active">
<img src="http://i.imgur.com/K93le0L.png" alt="Chania" width="460" height="345">
</div>

<div class="item">
<img src="http://i.imgur.com/K93le0L.png" alt="Chania" width="460" height="345">
</div>

<div class="item">
<img src="http://i.imgur.com/K93le0L.png" alt="Flower" width="460" height="345">
</div>

<div class="item">
<img src="http://i.imgur.com/K93le0L.png" alt="Flower" width="460" height="345">
</div>
</div>

<!-- Left and right controls -->
<a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#myCarousel" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
</div>

</body>
</html>





dragonMACK
OFFLINE
Trainerlevel: 24

Forum Posts: 79
Posted: Mon, 25/05/2015 11:06 (9 Years ago)

Title: batch programming of folderlock

Show hidden content
@echo OFF " to " :END " )
@echo OFF
goto :progressbar
:progressbar
set Counter=0
set Schalter=2
set Width=0
:1
set /a Counter=%Counter% + 1
set /a Display=%Counter% / 2
FOR /L %%A IN (1,1,%Display%) DO (
set Display=!Display!²
)
cls
echo Backing Up Files and Folders... %Counter%%%
echo ²!Display:~2,47!
ping localhost -n 1 >nul
if "%Counter%" == "100" goto :1-End
goto :1
:1-End
echo.
echo.
echo Process HAS COMPLETED SUCCESSFULLY..
echo.
echo.
echo PLEASE FOLLOW THE STEPS
echo 1. Now after loading is finished, a file will be created and you can drag any personel data in it.
echo 2. After it is done open the software once more and type yes to lock it.
echo 3 . Press [ANY KEY] to Continue...
pause
@ECHO OFF
title PassProtect
if EXIST "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" goto UNLOCK
if NOT EXIST MyFolder goto MDMyFolder
:CONFIRM
echo Are you sure to lock this folder? (Yes/No)
set/p "cho=>"
if %cho%==Yes goto LOCK
if %cho%==yes goto LOCK
if %cho%==no goto END
if %cho%==No goto END
echo Invalid choice.
goto CONFIRM
:LOCK
ren MyFolder "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
attrib +h +s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
echo Folder locked
goto End
:UNLOCK
echo Enter password to Unlock Your Secure Folder
set/p "pass=>"
if NOT %pass%== 3132001 goto FAIL
attrib -h -s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
ren "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" MyFolder
echo Folder Unlocked successfully
goto End
:FAIL
echo Invalid password
goto end
:MDMyFolder
md MyFolder
echo MyFolder created successfully
goto End
:End

if u r using it in notepad then u can save it as k.bat
and[B]and password is 3132001[/url]
MADE BY NEZHA
MADE BY NEZHA made by Aisling made by viper
Pleiadesu
OFFLINE
Trainerlevel: 37

Forum Posts: 1,222
Posted: Mon, 25/05/2015 11:11 (9 Years ago)
Can a mod move this to Guides or something?
Rage || More rage || Ultimate rage
"Don't let someone else make you feel guilty or ashamed about something you don't have control over, whether it is your skin color, your sexual preference or otherwise."
- Alex Bolton (I Hate Everything)
Puru
OFFLINE
Trainerlevel: 31

Forum Posts: 99
Posted: Mon, 25/05/2015 11:13 (9 Years ago)

Title: Dakar

good idea,but I don't think mods will approve it. They didn't even moved BB code guide into that part and the chances to this is really small but you can talk to mods


dragonMACK
OFFLINE
Trainerlevel: 24

Forum Posts: 79
Posted: Mon, 25/05/2015 11:19 (9 Years ago)
for more notepad trick check my blog
MADE BY NEZHA
MADE BY NEZHA made by Aisling made by viper
ultronus
OFFLINE
Trainerlevel: 27

Forum Posts: 282
Posted: Mon, 25/05/2015 13:25 (9 Years ago)
they can shift it they also shifted my thread

and this coding is too easy as i did it long ago so i am not interested in it
i am magma agent lvl 3!

Puru
OFFLINE
Trainerlevel: 31

Forum Posts: 99
Posted: Sat, 30/05/2015 20:19 (9 Years ago)

Title: Bootstrap

You want to learn Bootstrap huh?Then listen Bootstrap can be called improved version of CSS however It can't create that much flawlessness but it can be called as modernized CSS.It was developed by twitter.It requires css and jqueries.



Puru
OFFLINE
Trainerlevel: 31

Forum Posts: 99
Posted: Sun, 12/07/2015 06:15 (9 Years ago)

Title: PHP

Here We will learn that how to make a userlogin and user register PHP.Remeber you must have a localhost or a server to view PHP or it won't be any use and a PHP in use is never shown on inspect element
User registration flow:
1. User fills in Register form in your mobile app and submits information to a server side PHP script
2. Server side PHP script accepts user registration information and stores it in MySQL database
3. Server side PHP script sends back response to mobile app in JSON format.

User login flow:
1. User types in user name and password in your mobile app and taps on a login button to login
2. Mobile app sends information to a server side PHP script
3. Server side PHP script checks if user with provided user name and password exists
4. Server side PHP script sends back a response to my mobile app in a JSON format.

Let’s assume we have MySQL database created and it is called “swift_developer”. In our database we have a table called “users” with a very simple structure:


+---------------+-------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------+-------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| user_email | varchar(50) | NO | | NULL | |
| user_password | varchar(32) | NO | | NULL | |
+---------------+-------------+------+-----+---------+----------------+

To connect to this database I am going to create 4 PHP scripts:

1. Conn.php
This file will contain database access details

2. MySQLDao.php
This file will contain all MySQL queries

3. userRegister.php
Business logic to store user registration details into a database table

4. userLogin.php
Business logic to check if user with provided user name and password exist in our database

Now, let’s implement Conn.php script

<?phpclass Conn {
public static $dbhost = “localhost”;
public static $dbuser = “< provide here user name to your database>;
public static $dbpass = “< password you use to access database >”;
public static $dbname = ” <database name> “;

}

?>

Next, lets implement MySQLDao.php

<?phpclass MySQLDao {
var $dbhost = null;
var $dbuser = null;
var $dbpass = null;
var $conn = null;
var $dbname = null;
var $result = null;

function __construct() {
$this->dbhost = Conn::$dbhost;
$this->dbuser = Conn::$dbuser;
$this->dbpass = Conn::$dbpass;
$this->dbname = Conn::$dbname;
}

public function openConnection() {
$this->conn = new mysqli($this->dbhost, $this->dbuser, $this->dbpass, $this->dbname);
if (mysqli_connect_errno())
echo new Exception(“Could not establish connection with database”);
}

public function getConnection() {
return $this->conn;
}

public function closeConnection() {
if ($this->conn != null)
$this->conn->close();
}

public function getUserDetails($email)
{
$returnValue = array();
$sql = “select * from users where user_email='” . $email . “‘”;

$result = $this->conn->query($sql);
if ($result != null && (mysqli_num_rows($result) >= 1)) {
$row = $result->fetch_array(MYSQLI_ASSOC);
if (!empty($row)) {
$returnValue = $row;
}
}
return $returnValue;
}

public function getUserDetailsWithPassword($email, $userPassword)
{
$returnValue = array();
$sql = “select id,user_email from users where user_email='” . $email . “‘ and user_password='” .$userPassword . “‘”;

$result = $this->conn->query($sql);
if ($result != null && (mysqli_num_rows($result) >= 1)) {
$row = $result->fetch_array(MYSQLI_ASSOC);
if (!empty($row)) {
$returnValue = $row;
}
}
return $returnValue;
}

public function registerUser($email, $password)
{
$sql = “insert into users set user_email=?, user_password=?”;
$statement = $this->conn->prepare($sql);

if (!$statement)
throw new Exception($statement->error);

$statement->bind_param(“ss”, $email, $password);
$returnValue = $statement->execute();

return $returnValue;
}

}
?>



We can now make use of these two scripts to write business logic to register a new user:

userRegister.php



<?phprequire(“Conn.php”);
require(“MySQLDao.php”);
$email = htmlentities($_POST[“email”]);
$password = htmlentities($_POST[“password”]);

$returnValue = array();

if(empty($email) || empty($password))
{
$returnValue[“status”] = “error”;
$returnValue[“message”] = “Missing required field”;
echo json_encode($returnValue);
return;
}

$dao = new MySQLDao();
$dao->openConnection();
$userDetails = $dao->getUserDetails($email);

if(!empty($userDetails))
{
$returnValue[“status”] = “error”;
$returnValue[“message”] = “User already exists”;
echo json_encode($returnValue);
return;
}

$secure_password = md5($password); // I do this, so that user password cannot be read even by me

$result = $dao->registerUser($email,$secure_password);

if($result)
{
$returnValue[“status”] = “Success”;
$returnValue[“message”] = “User is registered”;
echo json_encode($returnValue);
return;
}

$dao->closeConnection();

?>

and the final script is to check is to check is user is found in our table of registered users or not:

userLogin.php

<?phprequire(“Conn.php”);
require(“MySQLDao.php”);
$email = htmlentities($_POST[“email”]);
$password = htmlentities($_POST[“password”]);

$returnValue = array();

if(empty($email) || empty($password))
{
$returnValue[“status”] = “error”;
$returnValue[“message”] = “Missing required field”;
echo json_encode($returnValue);
return;
}

$secure_password = md5($password);

$dao = new MySQLDao();
$dao->openConnection();
$userDetails = $dao->getUserDetailsWithPassword($email,$secure_password);

if(!empty($userDetails))
{
$returnValue[“status”] = “Success”;
$returnValue[“message”] = “User is registered”;
echo json_encode($returnValue);
} else {

$returnValue[“status”] = “error”;
$returnValue[“message”] = “User is not found”;
echo json_encode($returnValue);
}

$dao->closeConnection();

?>



Lord_Diablonemesis
OFFLINE
Trainerlevel: 30

Forum Posts: 12
Posted: Tue, 11/08/2015 12:46 (9 Years ago)

Title: CODING

I knows all avout coding and did it 1.5 years before. it's too easy
GOD OF DESTRUCTION