Created
February 15, 2011 21:22
-
-
Save anonymous/828273 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//ICE //William Mantly //willaim@aonic.net //5-2-07 | |
//session_start(); | |
if("4"=="4"){ | |
include("mysql.php"); //conects to D | |
//adds new user | |
$query = "INSERT INTO sites (name, bname, address, notes, dline, tsgt, tline, adminlt, aline, co, cline, xo, xline, t1pri, t1sec, dell, tandberg, lcd, plasma, digi, extron, router, switch, biamp, apcback, apcbat, boro, type) VALUES ('$_GET[name]', '$_GET[bname]', '$_GET[address]', '$_GET[notes]', '$_GET[dline]', '$_GET[tsgt]', '$_GET[tline]', '$_GET[adminlt]', '$_GET[aline]', '$_GET[co]', '$_GET[cline]', '$_GET[xo]', '$_GET[xline]', '$_GET[t1pri]', '$_GET[t1sec]', '$_GET['$_GET[dell]', '$_GET[tandberg]', '$_GET[lcd]', '$_GET[plasma]', '$_GET[digi]', '$_GET[extron]', '$_GET[router]', '$_GET[switch]', '$_GET[biamp]', '$_GET[apcback]', '$_GET[apcbat]', '$_GET[boro]', '$_GET[type]')"; | |
$res = mysql_query($query) OR die ('Could not add user to DB:' . mysql_error()); //runs mysql API | |
if($res){ // if mysql API worked | |
$worked = "Site added:"; | |
$ajax[] = array ('res'=>$worked); | |
}else{ // if mysql API failes ): | |
$ajax[] = array ('res'=>"User not added to DB."); | |
} | |
}else{ | |
$ajax[] = array ('res'=>"Log in."); | |
} | |
$json = array ('res'=>$ajax); | |
echo stripslashes((json_encode($json))); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment