로컬에서 돌아가도록 초기세팅

This commit is contained in:
Hyojin Ahn 2025-10-20 15:03:01 -04:00
parent 4ac3b5da39
commit f68db6c7f2
3 changed files with 11 additions and 10 deletions

View File

@ -2,11 +2,11 @@
date_default_timezone_set('America/Toronto');
if ($_SERVER["REMOTE_ADDR"] == "127.0.0.1") {
if ($_SERVER["REMOTE_ADDR"] == "127.0.0.1" || $_SERVER["REMOTE_ADDR"] == "::1" || str_contains($_SERVER["HTTP_HOST"], "localhost")) {
$host = "localhost";
$user = "ifreshy_goi";
$pw = "L0C2CKN5GHHY";
$dbName = "ifreshy_goi";
$user = "goiintra_root";
$pw = "L0C2CKN5GHHY";
$dbName = "goiintra_db";
} else if ($_SERVER['HTTP_HOST'] == "goi.ifreshy.com") {
$host = "localhost";
$user = "ifreshy_goi";

View File

@ -1,13 +1,13 @@
<?php
if ($_SERVER["REMOTE_ADDR"] == "127.0.0.1") {
if ($_SERVER["REMOTE_ADDR"] == "127.0.0.1" || $_SERVER["REMOTE_ADDR"] == "::1" || str_contains($_SERVER["HTTP_HOST"], "localhost")) {
$DB_HOST = "localhost";
$DB_NAME = "ifreshy_goi";
$DB_USER = "ifreshy_goi";
$DB_NAME = "goiintra_db";
$DB_USER = "goiintra_root";
$DB_PASSWORD = "L0C2CKN5GHHY";
if ($pdo = new PDO('mysql:host=localhost;dbname=ifreshy_goi', $DB_USER, $DB_PASSWORD))
{echo "";}else{echo "bad news";}
if ($pdo = new PDO('mysql:host=localhost;dbname=goiintra_db', $DB_USER, $DB_PASSWORD))
{echo "";}else{echo "bad news";}
}
else if ($_SERVER['HTTP_HOST'] == "goi.ifreshy.com") {

View File

@ -4,6 +4,7 @@ include getenv("DOCUMENT_ROOT")."/include/session_include.php";
$confirmID = trim($_POST['confirmID']);
$confirmPW = $_POST['confirmPW'];
$action = $_POST['action'] ?? $_GET['action'] ?? '';
if($action == "login") {
@ -34,7 +35,7 @@ if($action == "login") {
}
if ($_SERVER["REMOTE_ADDR"] == "127.0.0.1") {
if ($_SERVER["REMOTE_ADDR"] == "127.0.0.1" || $_SERVER["REMOTE_ADDR"] == "::1") {
$res['success'] = 1;
}
else {