if (!($stmt = $link->prepare("INSERT INTO Projectrec (uname, email, phone, raws3url, finisheds3url, jpegfilename, state, DateTime) VALUES (?, ?, ?, ?, ?, ?, ?, ?)"))) {
    echo "Prepare failed: (" . $link->errno . ") " . $link->error;
}
$uname = "MyName";
$email = $_POST['useremail'];
$phone = $_POST['phone'];
$raws3url = $url;
$jpegfname = basename($fname);
$finisheds3url = "none";
$state = 0;
$DateTime = date("Y-m-d H:i:s");
$stmt->bind_param("ssssssis", $uname, $email, $phone, $raws3url, $finisheds3url, $jpegfilename, $state, $DateTime);
if (!$stmt->execute()) {
    echo "Execute failed: (" . $stmt->errno . ") " . $stmt->error;
}
printf("%d Row inserted.\n", $stmt->affected_rows);
/* explicit close recommended */
$sns = new Aws\Sns\SnsClient(['version' => 'latest', 'region' => 'us-west-2']);
$Arn = $sns->createTopic(['Name' => 'mp2']);
$subscribe = $sns->subscribe(['Endpoint' => $email, 'Protocol' => 'email', 'TopicArn' => $Arn['TopicArn']]);
$settopic = $sns->setTopicAttributes(['AttributeName' => 'DisplayName', 'AttributeValue' => 'mp2', 'TopicArn' => $Arn['TopicArn']]);
$publisher = $sns->publish(['Message' => 'Congrats!! Your Image has been uploaded Successfully', 'TopicArn' => $Arn['TopicArn']]);
header("location: gallery.php");
$stmt->close();
$link->real_query("SELECT * FROM Projectrec");
$res = $link->use_result();
echo "Result set order...\n";
while ($row = $res->fetch_assoc()) {
    echo $row['id'] . " " . $row['email'] . " " . $row['phone'];
}
$link->close();
Esempio n. 2
0
require 'vendor/autoload.php';
#use Aws\S3\S3Client;
#$client = S3Client::factory();
$s3 = new Aws\S3\S3Client(['version' => 'latest', 'region' => 'us-east-1']);
echo $_POST['useremail'];
$email = $_POST['useremail'];
$sn = new Aws\Sns\SnsClient(['version' => 'latest', 'region' => 'us-east-1']);
$resARN = $sn->createTopic(['Name' => 'testmp2']);
print "List All Platform Applications:\n";
$Model1 = $sn->listTopics();
foreach ($Model1['Topics'] as $App) {
    print $App['TopicArn'] . "\n";
}
print "\n";
$AppArn = $Model1['Topics'][0]['TopicArn'];
$resSetTopicAttr = $sn->setTopicAttributes(['AttributeName' => 'DisplayName', 'AttributeValue' => 'mp2tester', 'TopicArn' => $AppArn]);
$uploaddir = '/tmp/';
$uploadfile = $uploaddir . basename($_FILES['userfile']['name']);
echo '<pre>';
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
    echo "File is valid, and was successfully uploaded.\n";
} else {
    echo "Possible file upload attack!\n";
}
echo 'Here is some more debugging info:';
print_r($_FILES);
print "</pre>";
$bucket = uniqid("php-rca-", false);
#$result = $client->createBucket(array(
#    'Bucket' => $bucket
#));
Esempio n. 3
0
            $sql_insert = "INSERT INTO topic (topicarn,topicname) VALUES (?,?)";
            if (!($stmt = $link->prepare($sql_insert))) {
                echo "Prepare failed: (" . $link->errno . ") " . $link->error;
            }
            $stmt->bind_param("ss", $topicarn, $topicName);
            if (!$stmt->execute()) {
                print "Execute failed: (" . $stmt->errno . ") " . $stmt->error;
            }
            //	printf("%d Row inserted.\n", $stmt->affected_rows);
            $stmt->close();
        }
    }
} else {
    $sns = new Aws\Sns\SnsClient(['version' => 'latest', 'region' => 'us-east-1']);
    $topicName = 'Mp2-S3Upload1';
    $result = $sns->createTopic(['Name' => $topicName]);
    $topicarn = $result['TopicArn'];
    //	echo "topic arn value is ----------- $topicarn";
    //set topic attributes
    $result = $sns->setTopicAttributes(['AttributeName' => 'DisplayName', 'AttributeValue' => 'S3Upload', 'TopicArn' => $topicarn]);
    $sql_insert = "INSERT INTO topic (topicarn,topicname) VALUES (?,?)";
    if (!($stmt = $link->prepare($sql_insert))) {
        echo "Prepare failed: (" . $link->errno . ") " . $link->error;
    }
    $stmt->bind_param("ss", $topicarn, $topicName);
    if (!$stmt->execute()) {
        print "Execute failed: (" . $stmt->errno . ") " . $stmt->error;
    }
    $stmt->close();
}
$link->close();