0

Thanks ahead of time for reading my post.

I am getting a 500 Internal Server Error when I successfully access my database via MySQL_Connect. If I put in incorrect credentials for my database I successfully display an error message when I visit my "loginapp.php" file on my site.

I am currently using iPage as a web host.

This is the code in my "loginapp.php"

<?php

//ob
ob_start();

//session
session_start();

//connect
$error = 'Could not connect to the database';
mysql_connect('MyDataBase.ipagemysql.com', 'MyBase','MyPass') or die($error);
mysql__select_db('MyDatabase') or die($error);

//include functions.php phpbb script
require 'forum/includes/auth/loginuser.php';

?>

<form action="loginapp.php" method="POST">
Username:<br />
<input type="text" name="username"><p />
Password:<br />
<input type="password" name="password"><p />
<input type="submit" name="login" value="Log in">

</form>

I'm aware that my .htaccess file might somehow be blocking external access to MySQL databases, but I am not very familiar with .htaccess...

I'm pretty sure its not a coding problem, because I only get the 500 error when I put in the correct credentials for my database.

Thanks Scott

Scott
  • 1
  • 1
  • 2

1 Answers1

0

Disable mod_security in .htaccess file

<IfModule mod_security.c>

  SecFilterEngine Off

  SecFilterScanPOST Off

</IfModule>

Note : "mysql__select_db" should be "mysql_select_db"

Source :

Internal Server Error on php submit with MySQL commands

How can I disable mod_security in .htaccess file?

Community
  • 1
  • 1
koolwithk
  • 685
  • 8
  • 14