how to run php code in remote (not using localhost)

Discussion in 'PHP' started by nikhita, Jul 30, 2009.

  1. #1
    In database.php i have

    $db_host="localhost";
    $db_database="digital_phots";
    $db_username="root";
    $db_password="";
    ...............

    in browser i can give localhost://...../database.php like this

    i want to execute in remote

    what way we give in the browser

    thank u
     
    nikhita, Jul 30, 2009 IP
  2. krishmk

    krishmk Well-Known Member

    Messages:
    1,376
    Likes Received:
    40
    Best Answers:
    0
    Trophy Points:
    185
    #2
    You should use "localhost" to access the database provided by your hosting company[assuming your web script + database are with the same hosting provider]. Regardless of the name "localhost" it would work fine with any web based script.

    However if you are trying to connect to a database located in some other web server (different from the calling script (php or asp)), you first need to enable the option for "remote database access" thru the cpanel provided by the hosting company where the database resides. Most probably it would be based on IP authentication.
     
    krishmk, Jul 30, 2009 IP
  3. nikhita

    nikhita Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    in cpanel i will create a database with the name digital_photos

    and in the database.php i give the code like

    $db_database="iguru_digital_phots";
    $db_username="digital";
    $db_password="school";

    i think i am provide right code but i have a small confusion in writing the url in the address bar of web browser.

    could u pls help me to run
     
    nikhita, Jul 30, 2009 IP
  4. ermac2014

    ermac2014 Peon

    Messages:
    13
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    ermac2014, Jul 30, 2009 IP