douzhi4311
2015-06-17 10:01
浏览 150

放置PHP文件以连接MySQL数据库的正确位置是什么

I have set up a database on a hosting site and want to connect it with my Android app. I am following this tutorial: http://www.androidhive.info/2012/05/how-to-connect-android-with-php-mysql/

The tutorial doesn't say where you should save the Php files that are created, so where should I be saving them using the file manager in Cpanel? the current structure looks like this:

A image of folder structure

图片转代码服务由CSDN问答提供 功能建议

我在托管网站上设置了一个数据库,并希望将其与我的Android应用程序连接。 我正在关注本教程: http:/ /www.androidhive.info/2012/05/how-to-connect-android-with-php-mysql/

教程没有说明你应该保存在哪里 创建的Php文件,所以我应该在Cpanel中使用文件管理器保存它们? 当前结构如下所示:

  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

2条回答 默认 最新

  • doulanli6146 2015-06-17 10:07
    已采纳

    php files must upload to "public_html" folder to view public.

    for example: if your domain is: http://example.com/ you must create "index.php" file in "public_html" folder, so you can access that by: http://example.com/index.php or http://example.com/

    read more, how using cpanel: https://www.siteground.com/tutorials/cpanel/file_manager.htm

    已采纳该答案
    打赏 评论
  • dongzan9069 2015-06-17 10:05

    You need to upload your codes to the root folder, which in your case is public_html

    打赏 评论

相关推荐 更多相似问题