Publishing a dynamic web site

ctyrd

Active Member
Messages
956
Reaction score
80
Points
28
I just made a dynamic web site and would like to know how to go about publishing it.

In short upload files to your sites public_html directory. Have no idea what you used to create website or your host name.
 
Last edited:

practicalcrafts

New Member
Messages
8
Reaction score
0
Points
1
In short upload files to your sites public_html directory. Have no idea what you used to create website or your host name.
Thanks for getting back. I built the site with wampserver and notepad++ and the languages I used were; html, css, php and mysql.
My confusion is how to upload the php and mysql. It's all .php and .inc.php files except for the css.
 

Anna

I am just me
Staff member
Messages
11,750
Reaction score
581
Points
113
All files (html, php etc) goes into the public_html folder of the domain.
For the database you would need to have it exported from WAMP (believe phpMyAdmin is part of that which you can use to export the database).
In DirectAdmin you create a database and user under "MySQL Managment", take note of the user and its password, you will need to edit the config file for your site to reflect this.
Once the database is created, head to phpMyAdmin (linked from where you created the database) and import the database you exported from your local site development.
 

ctyrd

Active Member
Messages
956
Reaction score
80
Points
28
My confusion is how to upload the php and mysql.
Hosting Control Panel has all the tools you will need for uploading, MySQL, and phpAdmin. I would like to take a look at your site after you publish (upload). I don't know the address.

x10hosting.com/login >> Hosting Control Panel Button.
 

practicalcrafts

New Member
Messages
8
Reaction score
0
Points
1
All files (html, php etc) goes into the public_html folder of the domain.
For the database you would need to have it exported from WAMP (believe phpMyAdmin is part of that which you can use to export the database).
In DirectAdmin you create a database and user under "MySQL Managment", take note of the user and its password, you will need to edit the config file for your site to reflect this.
Once the database is created, head to phpMyAdmin (linked from where you created the database) and import the database you exported from your local site development.
For the config file, where do I place the user and password in the file?

Also, is there a way to send a private message to someone?
 
Last edited:

ctyrd

Active Member
Messages
956
Reaction score
80
Points
28
@practicalcrafts
PHP:
<?php
$servername = "localhost";
$username = "username";
$password = "password";
$db = "db_name";
// Create connection
$conn = mysqli_connect($servername, $username, $password,$db);
// Check connection
if (!$conn) {
   die("Connection failed: " . mysqli_connect_error());
}
echo "Connected successfully";
?>
 
Last edited:

spacresx

Community Advocate
Community Support
Messages
2,199
Reaction score
195
Points
63
For the config file, where do I place the user and password in the file?

Also, is there a way to send a private message to someone?
generally when you upload to your public_html folder any folders/files follow suit on your server.
so if config,php was in your root folder in wampserver, you would put it in the public_html folder.
then just put rest of the folders in the same public_html keeping same structure.
 

practicalcrafts

New Member
Messages
8
Reaction score
0
Points
1
generally when you upload to your public_html folder any folders/files follow suit on your server.
so if config,php was in your root folder in wampserver, you would put it in the public_html folder.
then just put rest of the folders in the same public_html keeping same structure.
So I just put the config file in my public_html folder, I don't edit anything in it?
 

practicalcrafts

New Member
Messages
8
Reaction score
0
Points
1
@practicalcrafts
PHP:
<?php
$servername = "localhost";
$username = "username";
$password = "password";
$db = "db_name";
// Create connection
$conn = mysqli_connect($servername, $username, $password,$db);
// Check connection
if (!$conn) {
   die("Connection failed: " . mysqli_connect_error());
}
echo "Connected successfully";
?>
Do I type this into my config file? if so, where exactly?
 

spacresx

Community Advocate
Community Support
Messages
2,199
Reaction score
195
Points
63
So I just put the config file in my public_html folder, I don't edit anything in it?
you may need to exit any paths/urls in the config file to other files.
thats why file structure is usually important between your hard drive copy and website copy.
 

ctyrd

Active Member
Messages
956
Reaction score
80
Points
28
Do I type this into my config file? if so, where exactly?
No, that code is just for reference, to where username, passwd, host name and database name would go. You should have a config file in you wampserver htdocs directory, that may need to be modified after uploaded to your hosts public_html directory. As @spacresx mentioned, keep the file/folder structure the same as in the wampserver htdocs directory.
 

Anna

I am just me
Staff member
Messages
11,750
Reaction score
581
Points
113
"config file" would be wherever your current code have the username/password and other database information.

Now this might not be a separate, specific, file at all in your case, as it would depend entirely on how you have coded, but somewhere in your current code you would have the details for how the script connects the database on your WAMP server.
 
Top