Skip to content

Instantly share code, notes, and snippets.

View GedMullen's full-sized avatar

Ged Mullen GedMullen

View GitHub Profile
<html>
<head>
<title>Query string</title>
</head>
<body>
<?php
echo $_GET ["message"];
<?php
header("Location: login.php?message=Invalid%20Login");
?>
@GedMullen
GedMullen / sum.js
Last active November 4, 2015 12:35
var i = 2;
function numberFunction(number) {
var sum = 0;
if(number<1){
console.log("Enter a positive whole number greater than 0");
}else{
for (count = number; count>0; count--) {
sum = sum + count;
if(count != 1){
var shade = process.argv[2];
switch(shade) {
case "black":
console.log("You chose black");
break;
case "white":
console.log("You chose white");
break;
default:
@GedMullen
GedMullen / args.js
Last active November 4, 2015 11:20
var i = 2;
for (i; i < process.argv.length; i++) {
if (process.argv[i] == "black") {
console.log("You chose black");
} else if (process.argv[i] == "white") {
console.log("You chose white");
}
}
function createUsername(firstName, secondName) {
var username = firstName[0] + secondName;
console.log("Hi " + username);
};
createUsername("john", "smith");
$username = $_POST["uname"];
$password = $_POST["pword"];
$con = mysqli_connect("localhost", "student", "", "ryan04");
//check connection
if (mysqli_connect_errno()) {
echo "Failed to connect to MySQL: " . mysqli_connect_error();
} else {
@GedMullen
GedMullen / names.js
Last active November 11, 2015 11:25
var i = 3;
while(i < process.argv.length){
console.log(process.argv[i] + " " + process.argv[i+1]);
i=i+2
}
public class CareWorker {
private String firstName;
private String secondName;
private String speciality;
private String manner="Polite";
public CareWorker(String firstName, String secondName, String speciality){
this.firstName = firstName;
public class Doctor extends CareWorker {
private String manner = " and Informative";
public Doctor(String firstName, String secondName, String speciality){
super(firstName, secondName, speciality);
}