Posts

Routing problem solved in codeignitor

 Routing problem solved in codeignitor just add following lines in .htaccess for localserver like wamp or xamp RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /index.php/$1 [L] for online server (put ? in line 5 after index.php) RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /index.php?/$1 [L]

Android Web View Navigation removed orientation fixed

Orientation fixed means if logged in and mobile changes orientation from vertical to horizontal activity restarts if anyone is logged in its logs out automatically so it is fixed in manifest file. also if internet not available it show check internet. ***************************************************************************** MainActivity.java package com.grobharat.learningapp; import android.content.DialogInterface; import android.graphics.Bitmap; import android.os.Bundle; import android.view.View; import android.webkit.WebView; import android.webkit.WebViewClient; import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AppCompatActivity; public class MainActivity extends AppCompatActivity { private WebView webView ; @Override protected void onCreate(Bundle savedInstanceState) { super .onCreate(savedInstanceState); setContentView(R.layout. activity_main ); hideNavigationBar(); webView = (WebView) findViewById(R.id. webView...

Android webview without navigation bar

Manifest.xml <? xml version ="1.0" encoding ="utf-8" ?> < manifest xmlns: android ="http://schemas.android.com/apk/res/android" package ="com.grobharat.grobharateducation" > < uses-permission android :name ="android.permission.INTERNET" /> < application android :allowBackup ="true" android :icon ="@mipmap/ic_launcher" android :label ="GroBharat Education" android :roundIcon ="@mipmap/ic_launcher_round" android :supportsRtl ="true" android :theme ="@style/AppTheme" android :networkSecurityConfig ="@xml/network_security_config" android :usesCleartextTraffic ="true" > < activity android :name =".MainActivity" > < intent-filter > < action android :name ="android.intent.action.MAIN" /> ...

Android webview sample code

activity_main.xml <? xml version ="1.0" encoding ="utf-8" ?> < RelativeLayout xmlns: android ="http://schemas.android.com/apk/res/android" xmlns: app ="http://schemas.android.com/apk/res-auto" xmlns: tools ="http://schemas.android.com/tools" android :layout_width ="match_parent" android :layout_height ="match_parent" tools :context =".MainActivity" > < WebView android :id ="@+id/webView" android :layout_width ="match_parent" android :layout_height ="match_parent" /> </ RelativeLayout > MainActivity.java package com.grobharat.GroBharat; import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; import android.webkit.WebSettings; import android.webkit.WebView; import android.webkit.WebViewClient; import android.content.DialogInterface; import android....

Creating table in database using php

<?php $servername =  "localhost" ; $username =  "username" ; $password =  "password" ; $dbname =  "dbname" ; // Create connection $conn =  new  mysqli($servername, $username, $password, $dbname); // Check connection if  ($conn->connect_error) {    die ( "Connection failed: "  . $conn->connect_error); } // sql to create table $sql =  "CREATE TABLE MyGuests ( id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, email VARCHAR(50), reg_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP )" ; if  ($conn->query($sql) === TRUE) {    echo   "Table MyGuests created successfully" ; }  else  {    echo   "Error creating table: "  . $conn->error; } $conn->close(); ?>

Create Database in mysql or mariadb using php

<?php $servername = "localhost"; $username = "root"; $password = ""; // Create connection $conn = new mysqli($servername, $username, $password); // Check connection if ($conn->connect_error) {   die("Connection failed: " . $conn->connect_error); } // Create database $sql = "CREATE DATABASE dbname"; if ($conn->query($sql) === TRUE) {   echo "Database created successfully"; } else {   echo "Error creating database: " . $conn->error; } $conn->close(); ?>

Create table in mysql database in phpmyadmin panel

DROP TABLE IF EXISTS `tablename`; CREATE TABLE IF NOT EXISTS `tablename` (   `id` int(11) NOT NULL AUTO_INCREMENT,   `AdminUserName` varchar(255) NOT NULL,   `AdminPassword` varchar(255) NOT NULL,   `AdminEmailId` varchar(255) NOT NULL,   `Is_Active` int(11) NOT NULL,   `CreationDate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,   `UpdationDate` timestamp NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,   PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1; -- -- Dumping data for table `tbladmin` -- INSERT INTO `tbladmin` (`id`, `AdminUserName`, `AdminPassword`, `AdminEmailId`, `Is_Active`, `CreationDate`, `UpdationDate`) VALUES (1, 'admin', 'password', 'admin@email.com', 1, '2019-02-10 17:51:00', '2019-02-15 08:52:44');