Skip to content

Instantly share code, notes, and snippets.

View arif98741's full-sized avatar
🏠
Actively Working

Ariful Islam arif98741

🏠
Actively Working
View GitHub Profile
<?php
$msg = '';
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$permited = array('jpg', 'jpeg', 'png', 'gif', 'pdf', 'doc', 'docx', 'xlxs', 'xls');
$file_name = $_FILES['image']['name'];
$file_size = $_FILES['image']['size'];
$file_temp = $_FILES['image']['tmp_name'];
$div = explode('.', $file_name);
echo $div[1];
$file_ext = strtolower(end($div));
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<!--bootstrap css-->
<link href="assets/css/bootstrap.min.css" rel="stylesheet">
<link href="assets/css/bootstrap.min.css.map" rel="stylesheet">
<!--font awesome css-->
<link href="assets/css/font-awesome.css" rel="stylesheet">
<!--jquery ui css-->
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>PHP Online Course For Learning</title>
<style type="text/css">
.main{
width: 75%;
margin: 10px auto;
<?php
//using mysqli_connect. it is about dead nowadays
$link = mysql_connect("localhost", "root", "");
mysql_select_db("test", $link);
$result = mysql_query("SELECT * FROM user", $link);
//always try to use if condition for skipping errors
if($result)
{
$num_rows = mysql_num_rows($result);
package calculation;
public class Cal {
private int num1 = 0;
private int num2 = 0;
public Cal(int a, int b) {
this.num1 = a;
this.num2 = b;
@arif98741
arif98741 / Passing Data to Href.php
Last active January 25, 2018 10:19
Passing data from database in href
<?php
$con = new mysqli("localhost", "root", "", "test");
$sql = "select * from userdata"; //userdata is a table
$stmt = $con->query($sql);
if($stmt){
if($stmt->num_rows>0){
$row = $stmt->fetch_assoc();?>
<a href="something.php?userid=<?php echo $row['userid']; ?>">Go To Something Page</a>
<?php }
}
@arif98741
arif98741 / Data by Go or Serial
Last active January 25, 2018 13:25
Getting Data From Server By Go or Serial
<?php
//Code Written By Ariful Islam
//arif98741@gmail.com
//www.phpdark.com
//https://www.youtube.com/channel/UCMCe6bUMkxBP2dpsN0eSJ4g
?>
<!DOCTYPE html>
<html lang="en">
<head>
@arif98741
arif98741 / Query
Last active January 25, 2018 11:57
Mysql QUery
Follow this query and correct your query
"SELECT * FROM question WHERE question_number = '$number'";
wrong code
<?php while($row= $choice ->fetch_assoc()); ?>
<li><input name="choice" type="radio" value="<?php echo $row['id'];?>" /> <? php echo $row['text']; ?></li>
<?php endwhile;? >
@arif98741
arif98741 / dateconcat.php
Last active March 8, 2018 19:53
Date Moth Year Concat in PHP
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<div class="form-group col-sm-3 ">