logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: How do I add multiple web pages to my website?
Author
Robotbuilder



Joined: 23 Jan 2014
Posts: 6

PostPosted: Thu 23 Jan '14 21:31    Post subject: How do I add multiple web pages to my website? Reply with quote

How do I add multiple web pages to my server?
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Thu 23 Jan '14 22:04    Post subject: Reply with quote

There is a thing called vhosts (virtual hosts).

You can take a look at http://httpd.apache.org/docs/current/vhosts/name-based.html

if you still have a question please ask again.
Back to top
Robotbuilder



Joined: 23 Jan 2014
Posts: 6

PostPosted: Thu 23 Jan '14 22:30    Post subject: Reply with quote

So if I want to have a website i.e. domainname.com
I can't add a about page i.e. domainname.com/about without vhost?
Back to top
Robotbuilder



Joined: 23 Jan 2014
Posts: 6

PostPosted: Thu 23 Jan '14 22:44    Post subject: Reply with quote

I have another question:

I have this HTML code in a document:

<form name="create_account" action="html_form_action.asp" method="get">
Username: <input type="text" name="user">
<center> <p> </p> </center>
Password: <input type="password" name="user_password">
<center> <p> </p> </center>
Email: <input type="email" name="user_email">
<center> <p> </p> </center>
Accept terms: <input type = "checkbox" name="checkbox">
<input type = "Submit" name="submit_button">

I would like to receive the input the user types in how do I?
Back to top
Anaksunaman



Joined: 19 Dec 2013
Posts: 54

PostPosted: Fri 24 Jan '14 11:07    Post subject: How do I add multiple web pages to my website? Reply with quote

Whenever you have a website, there is a typical folder tree structure involved. So it may be helpful to think of a URL (or a web page) in these terms.

When you want to create a new web page, you create a new plain text document, type in (or copy/paste) your html or script code into the document, save it, and change the extension to something the web server recognizes as a valid web page (.htm and .html are most common, along with .php, .asp, .jsp and .shtml for particular web applications). Then you place this document on your web server in the folder that houses the data for your website.

For instance, let's say domain.tld is your website. There is a folder on a server (whether you host the server yourself or you buy space from a hosting provider) that houses all the data for that site. This is where all existing pages are found and new web pages are placed.

If put a new text document called "about.html" in the root folder that holds the data for your website, you can access that page with something like http://domain.tld/about.html. If there is a sub-folder called "help" and you put your new "about" web page there, then you can access the new web page via http://domain.tld/help/about.html.

Here is a very simple example layout.

http://s17.postimg.org/9oah3by7z/layout.png



In this case, there is a root folder which houses the main page (index.html), an image and two folders. If I wanted to add an "about.html" page, I would put it in the same folder as index.html if I wanted it accessible via domain.tld/about.html or, if I placed in a folder (say mail), the URL would be domain.tld/mail/about.html similar to the example above.

As to your second question, you need to have a server which has a scripting language installed, such as PHP. Scripting languages are not the same as HTML. A scripting language is what takes the HTML form data and captures it for further use. The web server and scripting interpreter are two separate programs -- each one is independent of the other but they are configured to work together to use submitted information.

So the first thing to do would be to make sure that the server you you are using has scripting. If you are going through a hosting provider, your hosting company can tell you what scripting engines they have installed.

Otherwise, if you are hosting your own server, you would download and install the scripting engine program on the PC running your website, along side the web server software itself.

Either way, the next step would be to upload two separate pages -- one that has the HTML form data (like the example code you posted) and a second page that has some scripting in it to capture the submitted data and do something with it. Then the URL for your "submit" button of the form would be altered to point at the scripting page URL. So when someone fills in the form and clicks "submit", the web server transfers the data to the script and the script does whatever it is supposed to do.

If you would like to see an example where form data is submitted via an HTML form and e-mailed to some email address via the scripting language PHP, you can look at a free bare bones contact form below.

http://www.freecontactform.com/email_form.php

And just so you know, the example you posted was designed to interact with a scripting language called Active Server Pages (ASP or .asp for web documents) originally developed by Microsoft. You would have to have a server with ASP installed and some script called "html_form_action.asp".
Back to top
Robotbuilder



Joined: 23 Jan 2014
Posts: 6

PostPosted: Sat 25 Jan '14 6:08    Post subject: Reply with quote

Thank you! I appreciate the help. I have seen some websites that have: www.domainname.com/info/about and the about is actually not a directory it's a web page. How do they do that?
Back to top
Anaksunaman



Joined: 19 Dec 2013
Posts: 54

PostPosted: Sat 25 Jan '14 13:28    Post subject: How do I add multiple web pages to my website? Reply with quote

Actually, it is a directory... sort of. Smile

What you are seeing is actually a default file in a folder called "about". This type of default file is usually named index.htm or index.html.

So while you type in a web server directory request

Code:
domain.tld/info/about

what the server ACTUALLY gives you is

Code:
domain.tld/info/about/index.htm

except that the last part (index.htm) is automatically hidden in the browser address bar. So it only looks like a file called "about" -- the URL requested is still a directory. But in reality, all the information you see is still data contained in a file called index.htm in the about folder.

Note that this type of default file (index.htm or index.html) can be put in any directory to serve up a basic starting page for that directory when it is requested in a URL. The name of the default file is technically determined by the server administrator but by convention (i.e. to make everything easier), these default file names are almost never changed (that is, they are almost always "index.htm" or "index.html").

A few screen shots to perhaps help visualize this a bit better. Look carefully at the directory listing and URLs in each address bar in the screenshots --

A web server with an about folder/directory, as well as an about.htm file but no index.htm file. Note that there are a list of files from the server, but no web page is displayed:

http://s12.postimg.org/ufgm1fox9/noindex.png



The contents of about.htm (not the about directory):

http://s27.postimg.org/5v57wmd37/about.png



Here we have renamed about.htm to index.htm in the about directory. No other changes have been made:

http://s29.postimg.org/r32eo46af/yesindex.png



The contents of index.htm (not the about directory):

http://s10.postimg.org/lmi3m611l/index.png

Back to top


Reply to topic   Topic: How do I add multiple web pages to my website? View previous topic :: View next topic
Post new topic   Forum Index -> Apache