Cannot figure out how to run my website

I created a website called https://uncloistered-ampere.000webhostapp.com/ and also added the files into it. But I don’t see how can I view my webpage because whenever I go to the link it says that I did not add “index.html”.

Please help me out.

I shall take a look just now.

Better? :slight_smile:

Always upload your content into public_html this is the root directory that the world will see when visiting your website.

index.html is the first page always served to the public when visiting your site also, so ensure this is the correct file you want people to see! :smiley:

Yes thank you, I figured that out.

Also, I wanted to know if there are any special methods to connect to the databases provided by the page?

Thanks Again.

PHP using PDO is most recommended

for example

<?php
$servername = "localhost";
$username = "username";
$password = "password";
$database = "database";

try {
    $conn = new PDO("mysql:host=$servername;dbname=$database", $username, $password);
    // set the PDO error mode to exception
    $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
    echo "Connected successfully"; 
    } catch(PDOException $e) {    
    echo "Connection failed: " . $e->getMessage();
    }
?>
2 Likes

*Connection failed: SQLSTATE[HY000] [1045] ProxySQL Error: Access denied for user ‘id4354560_sharukh’@‘2a02:4780:bad:f00d::13’ (using password: NO)

Does anyone know what might be causing this error?

You didn’t set a password :slight_smile:

Is that mandatory? Infact I removed it as I was facing the same issue before(I did it to see if that action rectified the issue).

You must specify a database name, database user, database password to make use of MySQL yes.

The host is always localhost.