Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $database_handle = mysql_connect('localhost', 'user', 'pass');
- if (!database_handle) {
- echo "Could not connect";
- }
- $db_selected = mysql_select_db('connect_shout', $link);
- if (!$db_selected) {
- die ('Can\'t use foo : ' . mysql_error());
- }
- $target_path = "./";
- $target_path = $target_path . basename( $_FILES['uploadedfile']['name']);
- if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {
- $x = simplexml_load_string(file_get_contents($target_path));
- $source = (string)$x->data->attributes()->source;
- $reply = (string)$x->data->attributes()->reply_to;
- $message = (string)$x->message;
- $sql = "INSERT INTO `shout_data` VALUES(NULL,'$source','$reply','$message');";
- mysql_query($sql) or die("There was an error uploading the file, please try again!");
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement