Last active
November 19, 2015 12:20
-
-
Save Teino1978-Corp/67dcb23f9eabd2cd5ebc to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
header('Content-Type: text/html; charset=utf-8'); | |
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'OneDriveClient.php'; | |
$client = new OneDriveClient('EwBYAq1DBAAUGCCXc8wU/zFu9QnLdZXy+YnElFkAAfMuYeVr71bpeGhrjEkpQerilJPcmh5WClc92WvF86QcVJ09c00C00bBiJJx/fqpt2yJvsDglNWfdMLIDpTR61kwq4CEcoDvlI1uyksJg9u62mSghrxEaJoEGyknY1s3LJOhzkZrycStJZ7uKsx7qd/2DU/mcFaGkEcH0ggGbwuEubeL8N4ZRJ0+I03M50uy722upZ1fGFjDikvJ//YqZYUHAI7HcPE9JSIhproutL/cpin61JvkEEI8yA0GC2ekqgBDasSpJi6f9nq8IQoGxpDubZwxiaW188YXj2r63Ktgfs/s5TYY8b7g+6OnpMeg0E678Y1W6PGG/g1a4N1T5rADZgAACGmwAtyU3SluKAFloXbZtKXG513XWnGB2LOnJEI2tCzi6Mq6WUJSZT0sLPGubkmxYGNHzpMXFUCblUt8EHO/RRCj+OWxqyd/d5h9ZAwkBhxnsvp9nixpdUDi2Y20TK6O+H7CxPsFqDLqSOV8MbrFXtkGBpDrVkiUcw+MOX5fDC3ixQzLts0GemJMYr/mT4qsTVQE67iR9IoGAOpatdMKXNKBLyFlv7OVTA9Q09hAb9hX1Ye0flepM/p/2827XCYdglO7d/Sk3RNFrruSLRwmixkpVKo1jr9q646hr83hMhXH7D9H5RsMS4FPT4QcoNVZ0TJolKJ8D1hGARqq+7W4rEhRMYSyGyAf8cnsGD2miNilF95z4zU2TQgBzs37/94sL/e7zmQGWQca9sSmBADHufdS+VAB'); | |
$result = $client->download_file('faila.txt'); | |
var_dump($result); |
This file contains hidden or 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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <mysql.h> | |
MYSQL *con; | |
char* concat(char *s1, char *s2) { | |
char *result = malloc(strlen(s1) + strlen(s2) + 1); | |
strcpy(result, s1); | |
strcat(result, s2); | |
return result; | |
} | |
void check_errors(int status) { | |
if(status) { | |
fprintf(stderr, "%s\n", mysql_error(con)); | |
mysql_close(con); | |
exit(1); | |
} | |
} | |
int main() { | |
con = mysql_init(NULL); | |
if(con == NULL) { | |
fprintf(stderr, "%s\n", mysql_error(con)); | |
exit(1); | |
} | |
char ip[100] = "", user[100] = "", password[100] = ""; | |
printf("Enter IP (localhost): "); | |
scanf("%s", &ip); | |
printf("Enter User (root): "); | |
scanf("%s", &user); | |
printf("Enter Password: "); | |
scanf("%s", &password); | |
if(strcmp(ip, " ")) | |
strcpy(ip, "localhost"); | |
if(strcmp(user, " ")) | |
strcpy(user, "root"); | |
if(mysql_real_connect(con, ip, user, password, NULL, 0, NULL, 0) == NULL) { | |
check_errors(1); | |
} | |
check_errors(mysql_query(con, "SHOW DATABASES")); | |
MYSQL_RES *result = mysql_store_result(con); | |
MYSQL_ROW row; | |
int i; | |
printf("\n*** Databases!\n"); | |
while((row = mysql_fetch_row(result))) { | |
for(i = 0; i < mysql_num_fields(result); i++) { | |
printf("* %s ", row[i] ? row[i] : "NULL"); | |
} | |
printf("\n"); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment