# Website



## dubya008 (Dec 13, 2006)

Hello I've been asked to create a website for someone's business. I know that they have a server and that is it. 

I have a small amount of computer experience but am in no way an expert. I'm up to the challenge for the sake of the knowledge itself.

I was wondering if some one could point me to some articles or give some info on how to get started.

I will be the "project chief" so i will have to do it all.

Thank you in advance


----------



## 2twenty2 (Jul 17, 2003)

http://www.w3schools.com/html/

http://www.google.ca/search?hl=en&q=html+tutorial&btnG=Google+Search&meta=

http://www.google.ca/search?hl=en&q=web+page+design+tutorial&btnG=Google+Search&meta=


----------



## ferrija1 (Apr 11, 2006)

Good luck. You're _really_ going to need it.
http://www.oswd.org/


----------



## dubya008 (Dec 13, 2006)

Why do you say that? is it going to be a headache?


----------



## ferrija1 (Apr 11, 2006)

Yeah, especially if you have to set it up on the server and whatnot.


----------



## dubya008 (Dec 13, 2006)

Oh well that is the kind of info i'm looking for: How to set it up on the server and what not. I don't really know how to do that just yet


----------



## dubya008 (Dec 13, 2006)

I guess my real question would be how do i get the website (once finished) on the server and out to the web?


----------



## MMJ (Oct 15, 2006)

You need someone local to consult.


----------



## ferrija1 (Apr 11, 2006)

I would tell the person that you can't do it and point them to a web designer.


----------



## dubya008 (Dec 13, 2006)

MMJ said:


> You need someone local to consult.





ferrija1 said:


> I would tell the person that you can't do it and point them to a web designer.


Is it that difficult? I'd really like to learn it. Some one some where must do it


----------



## ferrija1 (Apr 11, 2006)

Well it goes something like setting up Linux on the server, getting the pages on the server and configuring it somehow. And of course you must create the pages. If you want to do this yourself it should only take a few months.


----------



## MMJ (Oct 15, 2006)

ferrija1 said:


> Well it goes something like setting up Linux on the server, getting the pages on the server and configuring it somehow. And of course you must create the pages. If you want to do this yourself it should only take a few months.


If you learn quickly.

Otherwise you'll just make a bad website.


----------



## Techmonkeys (Feb 10, 2005)

hi dubya, firstly take the immediate headache out of it for yourself and pay for hosting, a company like TSOHost do excellent packages, very reliable and good support for as little £5/month ($10).

Next if you know what they want for their website, IE is it just somewhere to post company news and info or do they want forums and that sort of thing?

Take a look at using a pre-scripted CMS (Content Management System).

Something like Joomla or WordPress would be excellent for simple webs front end that is updatable by them, then if they do want more in the way of forums then look at something like MyBB as is very easily customised.

The benefit of using one of these CMS type solutions is that you are not trying to create a site from scratch and they all have lots of support and users.


----------



## dubya008 (Dec 13, 2006)

okay so i checked out the server today and we have a linux based server with a windows front end.

It has Apache 2 and MySQL on it already. So now i just need some help on getting the pages on to the internet after i've registered my doman name.



> The benefit of using one of these CMS type solutions is that you are not trying to create a site from scratch and they all have lots of support and users.


I've been looking into a CMS and will more than likely use one. The main thing here is that i do no have the option of web hosting(it's complicated) so i must learn to use the server that is there already.

thank you to all of you for helping me thus far. the help and input that you guys (and girls?) have given to me is a testimony to the usefulness of this site.


----------



## comprookie20 (Jan 24, 2004)

Why not use a CMS;
http://en.wikipedia.org/wiki/Content_management_system
I like drupal;
http://drupal.org/
Here is mine and I am not the sharpest;
http://linuxcrazy.com/


----------



## Fyzbo (Feb 6, 2002)

comprookie20 I like the design for linuxcrazy.com, did you put it together yourself?


----------



## dubya008 (Dec 13, 2006)

I've been checking into some CMS's. I like that idea. However the first thing i need to do is put up a few static pages within the next few days. so this brings me to the next question

Is Apache 2 the software on the computer to use for this?


----------



## ferrija1 (Apr 11, 2006)

Yes, you can use Apache to serve static pages.


----------



## comprookie20 (Jan 24, 2004)

> comprookie20 I like the design for linuxcrazy.com, did you put it together yourself?


thanks, That is pretty much the stock Drupal, I just added the logo.
Here is another Drupal theme I like;
http://www.abbottdavid.com/
Here is a simple static page, it is using html and css, I can send you the files to play around with;
http://linuxcrazy.com/homesite/


----------



## dubya008 (Dec 13, 2006)

Will apache serve dynamic pages as well?


----------



## LiberatioN (Dec 19, 2007)

If you have no web programming experience (not even html coding), it'd be best to use a program like Dreamweaver. There are countless tutorials on how to setup a website with a server using all the information the company can give you. You'll need a name and a directory for the space as well as a registered .com, .org., or whatever extension you want. See if you can get the company to purchase a license for this software.

Here's the FAQ page for the software directly from Adobe's website. That's the latest version of Dreamweaver CS3...you might be able to find a cheaper/older version (MX, MX 2004, etc.) that would work just fine. Personally, I use notepad for everything still. CSS + basic html and then java/javascript in a freeware compiler...that's how i roll.

And it might also help to go to Barne's and Noble and pickup a web programming book. There are alot of great tutorials and walk-throughs for people that don't know anything. Hope this helps! Happy programming!


----------



## MMJ (Oct 15, 2006)

@LiberatioN

Why would you need Java to build a website?


----------



## ferrija1 (Apr 11, 2006)

LiberatioN said:


> If you have no web programming experience (not even html coding), it'd be best to use a program like Dreamweaver. There are countless tutorials on how to setup a website with a server using all the information the company can give you. You'll need a name and a directory for the space as well as a registered .com, .org., or whatever extension you want. See if you can get the company to purchase a license for this software.
> 
> Here's the FAQ page for the software directly from Adobe's website. That's the latest version of Dreamweaver CS3...you might be able to find a cheaper/older version (MX, MX 2004, etc.) that would work just fine. Personally, I use notepad for everything still. CSS + basic html and then java/javascript in a freeware compiler...that's how i roll.
> 
> And it might also help to go to Barne's and Noble and pickup a web programming book. There are alot of great tutorials and walk-throughs for people that don't know anything. Hope this helps! Happy programming!


Nvu is much better for beginners. Dreamweaver is quite advanced and can easily confuse beginners (and myself).


----------



## dubya008 (Dec 13, 2006)

Thank you all so much for all of the help so far.

I have been using Microsoft front page to help with the layouts and html part of this project. some times i use notepad.

Well i have done quite well so far.
I have a construction page up and running.
http://www.jrautocomplex.com

Hopefully by the end of the week I can hae some static pages up to tell what the place is all about.

I downloaded
*Apache2
MySQL and MySQL yog
PHP 5*
All of these are up and running on my machine at home for testing and such.

We went with a webhosting place here in town so that burden is off of me. the only thing that i have to worry about i the cPanel aspect of everything which helps quite a bit.

I now have just a few questions about html and php that i can't seem to answer from some of the tutorials that i have been looking at and am not sure if this would be the place to ask them or not.


----------



## ferrija1 (Apr 11, 2006)

You can ask those questions here.


----------



## dubya008 (Dec 13, 2006)

okay then here goes:

I have an index page that is set up with a table for layout purposes. in the middle there is a giant column that is where all of the info for the pages will go.

is it possible to load different pages in the middle of that table by just pressing a button on the left using php? i saw some thing about that in passing but was unsure of how to do such.

also is it possible to make scroll bars appear in that same column of the table so that only that column is moving and not the rest of the page?


----------



## dubya008 (Dec 13, 2006)

I found the following thread here

http://forums.techguy.org/web-design-development/655020-newbie-building-website.html

here some one posted the following


```
<?php
/* Header info here */

switch ($_GET['page']) {
case 'info':
    require_once('info.php');
    break;
case 'contact':
    require_once('contact_us.php');
    break;
//etc.
}

/* Footer info here */
?>
```
can some one explain this to me a bit more. I believe i know what is going on but owuld like to be completley clear before i try to do this. this seems to be a more efficient way of going about having more than one page on the same layout


----------



## dubya008 (Dec 13, 2006)

I figured it the above post out. after reading some on php and html it all works great now.
prattey soon i'll be starting the db part of the site


----------



## dubya008 (Dec 13, 2006)

the static pages of the website are up and running with a few minor modifications comming soon
www.jrautocomplex.com
However I need some comments back from the people that really know what they are doing. 
The pictures take a long time to load and i was wonering if there is any thing that can be done about that.
Also the the initial page doesn't work correctly. If any one could help me with it would be great.
here is thecode i used to run it

```
<?php 
	$p = $_GET['p']; 
	if ($p==null) //P is null if not specified. 
	{ 
		header("Location: ?p=home"); 
		exit; // Redirect to the homepage. 
	} 
	elseif ($p=="home") // The homepage 
	{ 
		include("home.php"); 
	} 
	elseif ($p=="sales") // sales page 
	{ 
		include("sales.php"); 
	} 
	elseif ($p=="service") // service 
	{ 
		include("service.php"); 
	} 
	elseif ($p=="parts") // parts 
	{ 
		include("parts.php"); 
	} 	elseif ($p=="collision") // collision
	{
		include("collision.php"); 
	} 
	elseif ($p=="towing") // towing 
	{ 
		include("towing.php"); 	}
	elseif ($p=="contact") // contact 
	{ 
	include("contact.php"); 
	} 
?>
```


----------



## MMJ (Oct 15, 2006)

The images take long to load because they are very big, you should compress them.

I wrote it in a better way for you:


```
switch ($_GET['p']) {
	case 'home':
	    include("home.php");
		break;
	case 'sales':
	    include("sales.php");
		break;
	case 'service':
	    include("service.php");
		break;
	case 'parts':
	    include("parts.php");
		break;
	case 'collision':
	    include("collision.php");
		break;
	case 'towing':
	    include("towing.php");
		break;
	case 'contact':
	    include("contact.php");
		break;
	default:
        header("Location: ?p=home"); 
        exit;
}
```
This is even better though:


```
$pages = array('home', 'sales', 'service', 'parts',  'collision', 'towing', 'contact');
if (in_array($_GET['p'], $pages) && is_file($_GET['p'] . '.php'))
	include($_GET['p'] . '.php');
else
	include($pages[0] . '.php');
```
or


```
$pages = array('home', 'sales', 'service', 'parts',  'collision', 'towing', 'contact');
include in_array($_GET['p'], $pages) && is_file($_GET['p'] . '.php') ? $_GET['p'] . '.php' : $pages[0] . '.php';
```
(same thing but smaller)


----------



## dubya008 (Dec 13, 2006)

by compress do you mean "zip" them? or do you mean to just change the width and height of them?


----------



## MMJ (Oct 15, 2006)

The latter.

Google "image compressor".


----------



## dubya008 (Dec 13, 2006)

hey thanks. i'm using PIXresizer it works.
is it possible to put scroll bars on only a certain part of a page without using frames?


----------



## MMJ (Oct 15, 2006)

It depends. overflow:auto or overflow:scroll should do the trick.


----------



## CollegeTrained (Dec 29, 2007)

Congrats on the site. It looks good.


----------



## dubya008 (Dec 13, 2006)

Thnk you CollegeTrained. now i'm working on the DB part. It is going good. just have to make it possible to search the cars that will be for sale on the lot.

Right now i am stuck on the delete portion. I can edit and add a new record from the web. going over how to efficiently delete a record.

My idea is this have an extra button on the edit screen that will delete the record not sure how to add the extra button with out doing another form.

Thank mmj for all of your help so far. you are a wonderful resource of knowledge.


----------



## MMJ (Oct 15, 2006)

It would probably be best to add another form.


----------



## dubya008 (Dec 13, 2006)

i actaully used a link that will run a script called delete.php. is there any danger in doing that?


----------



## MMJ (Oct 15, 2006)

dubya008 said:


> i actaully used a link that will run a script called delete.php. is there any danger in doing that?


Nope.


----------



## dubya008 (Dec 13, 2006)

okay now i've run into another problem. I've created an admin folder that will be protected for obvious reasons. I need to figure out how to include files into that folder from another folder.
i have 

```
include 'lib/config.php'
```
that code is in most of my pages but if i put some thing in the admin folder what is the path for that file?
i tried the following but it didn't work

```
include '.lib/config.php'
```


----------



## MMJ (Oct 15, 2006)

Where is the admin folder?

include './lib/config.php'


----------



## dubya008 (Dec 13, 2006)

it will be in the public_html folder


----------



## dubya008 (Dec 13, 2006)

I got it! i had to go up another directory. so it was
include '../lib/config.php';

Thanks for you help so far


----------



## dubya008 (Dec 13, 2006)

Now i'm looking for a good exmple of code to load a CSV file into the db as data. WE'll need to be uploading the data on a weekly bases to the server to update the inventory. I've found some example of the process but am totally confused as to why they don't work.


----------



## dubya008 (Dec 13, 2006)

I found this code
LOAD DATA LOCAL INFILE 'C:/WebDev/Apache2/htdocs/phptests/test.csv' 
INTO TABLE upload 
FIELDS TERMINATED BY ',' 
LINES TERMINATED BY '\n' 
(id, name, type, size, content); 
which i know can be adapted to suit my needs. 

Should there be a screen that will allow the user to find the file or should i hard code the file path in the script it's self?


----------



## MMJ (Oct 15, 2006)

How do you plan to have the CSV loaded?


----------



## dubya008 (Dec 13, 2006)

Well I'm not sure of the most efficient way.
If i hard code the file name then the file will always have to be the same name
If i give the user the option then they can select which ever file they wanted to upload to the db.

My instinct tells me to hard code the name and just force the use of the same file every time. However due to lack of expiernece there could be some things that i am over looking...any advice?


----------



## MMJ (Oct 15, 2006)

It really depends on your needs.


----------



## dubya008 (Dec 13, 2006)

There is a main program that runs the whole business. It can generate a CSV of all the vehicles on the lot (with certain info about them). The goal is to create this file once a week and upload it into the DB so that there is a constant refreshing of the data.
I would think that the best choice would be to constantly overwrite that file and hardcode into the php script the path so that the wrong CSV is not loaded into the DB.


----------



## dubya008 (Dec 13, 2006)

I downloaded some javascript to use for the pics of the vehicles. however i have a problem
i have to have this line


```
preloadimages('<?php echo $pic1; ?>','<?php echo $pic2; ?>','<?php echo $pic3; ?>','<?php echo $pic4; ?>','<?php echo $pic5; ?>')
```
but then when i look at the source of the page that is created i get this line


```
preloadimages('images/carimages/2948_1.jpg','images/carimages/2948_2.jpg','images/carimages/2948_3.jpg','images/carimages/2948_4.jpg','images/carimages/2948_5.jpg
')
```
I'm not sure why the lst line is occuring. is there a way to continue the command onto a different line?


----------



## MMJ (Oct 15, 2006)

Try

<?php echo trim($pic5); ?>


----------



## pailrider (Feb 10, 2008)

Sounds a bit advanced for a beginner but there are thousands of tutorials online just search in google for hosting your own website on your server.


----------



## dubya008 (Dec 13, 2006)

I've actually located the problem. for some reason the DB adds a carriage return or a space at the end of the pic5 field. i'm not sure why this happens. any thoughts?


----------



## MMJ (Oct 15, 2006)

The trim() function will solve your problem. <?php echo trim($pic5); ?>


----------



## dubya008 (Dec 13, 2006)

It did. Thanks so much. do you know why the DB adds the extra character?


----------



## MMJ (Oct 15, 2006)

dubya008 said:


> It did. Thanks so much. do you know why the DB adds the extra character?


Probably when you are inserting the pic you insert a new line.


----------



## dubya008 (Dec 13, 2006)

that makes sense it is the last field in the CSV file. Is there a way to fix that in the DB?


----------



## MMJ (Oct 15, 2006)

Can I see the code you are using to insert?


----------

