# what is the main importance of php?



## bball_1523 (Nov 22, 2001)

I'm kinda confused, I read a tutorial on php, but I still do not understand why it's easier or more useful to use php than regular html.

What are good examples of using php? 

Like creating links? Pics? Music? etc? What is it important for? please be specific.

Would html work better or php?

thanks


----------



## Shadow2531 (Apr 30, 2001)

far from a php expert,

php allows you to create dynamic html pages, files, and many other things.

you can use php to for loggin into a site, redirecting a user to a certain page, counters, loggin etc.

for example say if you bball_1523 submits your username and password to log into a site, the php code could then tell the server to generate a personally page that says "Welcome bball_1523!". Now if another user logs in, the server would generate a page that says "welcome username"

You can do all sorts of ..behind the seens... stuff with php.

you can also use a query string for searching sites and redirecting. For example say if you wanted to send somebody a link in email that loads in a frame on your site., you send the link like this. http://www.bbball_1523.com/redirect.php?url=http://www.google.com

Now the php file would have to have the code to load google.com in a frame on your site.

so you use html and php together, but if you are just making a simple web page, you wouldn't need php. plus your web space server would have to support php and have it installed so it would work.

also instead of using php, you could use cgi (perl/c++,other) or asp, which all can use html. you can also use java and javascript to do a lot of things, but php

all have their pros and cons.

but php can be easier that just using plain html if you have logins, searching, weblogs, logs, counters etc. Also, if you set up your own server you can use php to allow people to download files from a certain folder and then log the ip address of the person that downloaded it. Basically if a web page has to save or change files on the server (log files, counter info etc) or generating user specific html pages, you would have to use php or another programming like asp or cgi.

I'm sure others will add more info and clear up anything I said.


----------



## bball_1523 (Nov 22, 2001)

now can i create a easy php page that has video game downloads?

For example: http://www.rct2.com/download/pafiledb.php?action=category&id=4

that is created in php. How long would it take to create that full of downloads for me video game site? Is it free?

thanks


----------



## Shadow2531 (Apr 30, 2001)

your reply was a little unclear so I would do my best.

first I would ask if you are running your own server or you would be using web space from your isp or som free webspace from geocities or the like.

The reason I ask is, I am not sure what free web space providers support php if any. My web space on my isp's server supports php, but it is turned off for me unless I pay $$$.

If you run your own server on win2K for example, you have install IIS and also then install php for php files to work.

Anyways, I took a look at the link. If it was me, I would just create a html page with links pointing to the files and keep it simple. However, if you wanted visitors to be able to rate files or have visitors be directed to an info page for each file before they download, or if you want to require visitors to enter their email address first before the can download a file and then log the email address with the file they downloaded to a text file, you would want to use php.

as for how long it would take create the php file with the associating htmls files to go along with it, I am not sure. I myself know that I could recreate those 2 pages of video game links, and the 28 info pages (1 for each file) a lot quicker that I could do it with php, but that's just me. however doing it with php would be a more efficient way of doing it.

Of course everything depends on where you are uploading all your files too (web space server) and whether it supports php.

as for "is it free"? If you are referring to the php script, you can find php scripts, download them and use them for free.

I myself, set up a cgi perl script on my win2k server to allow visitors to download some files I wanted to host.

it is setup like

this

of course if you wanted to use a cgi perl script, you have to install the perl command interpreter or the server that is hosting your site, must have the perl interpreter installed.

I can probably figure out what exactly you need, just need you to be more specific as to what you want.

do you already had a web page/site that you have up, that we all could take a look at to better answer your questions?


----------



## bball_1523 (Nov 22, 2001)

http://www.angelfire.com/nb/rctballer

-I want to make my site layout look better, and the pictures, rides, downloads, etc


----------



## Shadow2531 (Apr 30, 2001)

php, asp, and the like don't work on angelfire. at least the free one.

That's OK though.

Looking at your site you really wouldn't need php anyways.

In my opinion, your index.html page needs to be spiced up a lot.

I personally like it the way it is; simple and right to the point, but the colors and text size need to be changed.

I am not a fan of frames, but your site might look better that way.

As for your downloads, page, the way it's set up is pretty good. I just don't like the color combinations.

I would use back links instead of back buttons with java script on click previoius history.

I would stay away from tables except for you downloads page.

as for pictures, I would just provide links to click on.

basic and simple. People will visit for info and will want to get right to it without messing around.

Also consider putting the content of some of your linked pages in your index.html page insead. With such a simple site it's not really necessary to bounce around a bunch of linked pages when a lot of it could be on one page.

That's just my opinion.

also consider using XHTML 1.1 and CSS for developing your pages and make them compliant. (just remember though that the code anglefire adds to the generated page seen by visitors might mess with validation compliance of your XHTML.

you can check out my two pages here and here for an example of a XHTML 1.1/CSS2 and a XHTML 1.0/CSS2 compliant pages. Feel free to use any methods I used in your pages if you want.

Good luck.


----------

