Hard to Learn?

  • Thread starter CDailey
  • 28 comments
  • 1,130 views
Haha, no, PHP isnt really hard, its actually really easy.

I learned the basics by myself (making stuff show on pages, making a script that will accept form data and print it out, etc.)

If youre really interested in learning about it then go for it! There are some good articles at http://php.resourceindex.com .

;)
 
What is PHP what can it do what makes it soooo cool? - You see I am new to coding! - I just stick to WYSIWYG HTML!
 
It can do alot. Its a scripting language made for retrieving data easier, and streamlining content. Whats so cool about it, is it can make a whole website into 1 page. How this works is you just put in the right tags and if statements to detect wat the user wants to do... That didnt make sense.

Ok heres an example:
Your old site:
Index.html
News.html
Cars.html
Blah.html

All of this could just be called from the same file with php:
Index.php

Index.php would be your whole site, with the exception of data you are going to print out. The php file would decide what file to get by using extra tags after index.php in your browser. Ex: "index.php?area=Cars" would look exactly the same as cars.html. (Mind you that there are statements and such to read that following tag and print out the correct data in index.php)

If any of that made sense to you, confgrats. It barely makes sense to me, but it is 10:30 pm..

PHP can do alot more than just make your website into one page, all of the top sites use it. Even GTP!
 
If you use the standard HTML form the data sent to your e-mail (If you are the Webmaster) is hard to decypher easily it gets wierd characters between the choices.

The form can contain Radio Buttons or User Text bits like this reply box.

You can do it with ASP but Free Hosts rarely support it and my Free Host I think supports PHP....so can it have forms that sends data back to the web master without having to decypher what has been put in the forms...

Do you get what I mean cause I have kinda confused myself.
 
Originally posted by gigo
If you use the standard HTML form the data sent to your e-mail (If you are the Webmaster) is hard to decypher easily it gets wierd characters between the choices.

The form can contain Radio Buttons or User Text bits like this reply box.

You can do it with ASP but Free Hosts rarely support it and my Free Host I think supports PHP....so can it have forms that sends data back to the web master without having to decypher what has been put in the forms...

Do you get what I mean cause I have kinda confused myself.

With PHP you can put the data from the form into a database. Then you can write an administration page that retrieves the data from the database, and shows it in whatever format you want.

As for the earlier question "What makes PHP so cool?": The answer is that PHP is a server-side scripting language. This means that when the user clicks on one of your pages, the server reads it, reads the code inside the page, and then acts upon it. This is at its most useful when running a forums site (PHP is what VBulletin is written in), because each time a thread is clicked, the clicker gets the most current version of the thread - there's no updating on Jordan's part.
 
Oh well I'll see if I can figure something out off somebody elses site later! lol.

And if this forum uses php how comes this page is an .html page?
 
Jordan set VB to write out to html tables instead of making a larger load on MySQL by having it read from the database every time.
 
Originally posted by gt2_gs
Jordan set VB to write out to html tables instead of making a larger load on MySQL by having it read from the database every time.


Does that make a difference? Like making the load time shorter for each page?
 
Originally posted by jubula
Does that make a difference? Like making the load time shorter for each page?

It reduces the amount of work that the server has to do querying the database all the time.
 
Originally posted by gigo
Oh well I'll see if I can figure something out off somebody elses site later! lol.

And if this forum uses php how comes this page is an .html page?

The extension isn't always relevant. Usually developers use .php to tell the server it's to parse the page before sending it to the browser. Anything that's not .php is just sent as-is, with no pre-processing. Jordan must have configured his server to always parse files.
 
No, actually, these pages with .html extensions are accessable because of a simple .htaccess Apache file on the server which points the visitor to the thread. There wasn't any modifications to the vB code itself, so any link using the old format (i.e. https://www.gtplanet.net/forum/showthread.php?s=&threadid=17113 using the variable with showthread.php) will still work as normal. None of the HTML files actually exist. It's a bit complicated, but it is by far the simplest way to display dynamic pages with a .html extension, and without question marks, ampersands, or equal signs. :)
 
So what youre saying is you arent really having the files write out? Why? It would reduce server load... :confused:
 
That's right - it is simply a .htaccess file which lets the server interpret showthread.php's variable in a different way. Why would I want to do that? Many search engines do not crawl dynamic pages with ?, &, and = in the URL, and if they do, they rank it lower than a static page in search results (like Google). By removing those dynamic characters and giving each thread a .html extension, I can effectively trick Google and other spiders into thinking each page is a static page, and I know it will crawl as many threads as possible and give them the highest possible ranking. And, obviously, thousands and thousands of threads full of valuable, keyword-rich content will ensure that GTP shows up in a lot more results, therefore bringing in a lot more people.
 
That's correct - I only changed the home page and forum display template with the new URL, because that's the only ones that need to be picked up by search engines. What URL that "real people" are using after they post their message, doesn't matter.
 
Originally posted by Jordan
That's right - it is simply a .htaccess file which lets the server interpret showthread.php's variable in a different way. Why would I want to do that? Many search engines do not crawl dynamic pages with ?, &, and = in the URL, and if they do, they rank it lower than a static page in search results (like Google). By removing those dynamic characters and giving each thread a .html extension, I can effectively trick Google and other spiders into thinking each page is a static page, and I know it will crawl as many threads as possible and give them the highest possible ranking. And, obviously, thousands and thousands of threads full of valuable, keyword-rich content will ensure that GTP shows up in a lot more results, therefore bringing in a lot more people.

That's REALLY neat.

Respect! :bowdown:
 
Originally posted by Jordan
That's right - it is simply a .htaccess file which lets the server interpret showthread.php's variable in a different way. Why would I want to do that? Many search engines do not crawl dynamic pages with ?, &, and = in the URL, and if they do, they rank it lower than a static page in search results (like Google). By removing those dynamic characters and giving each thread a .html extension, I can effectively trick Google and other spiders into thinking each page is a static page, and I know it will crawl as many threads as possible and give them the highest possible ranking. And, obviously, thousands and thousands of threads full of valuable, keyword-rich content will ensure that GTP shows up in a lot more results, therefore bringing in a lot more people.
:lol: Nice trick J!
 
Whoa, thats pretty smart there J-man.

But why dont you just make it so it writes out to an html file? It would reduce server load, and also keep giving you your results in search engines.

You know, seeing as how every time you view a thread it has to read into the mysql and pull out the data, it would make it easier on the server if it just had to read in html files.. Just an idea.
 
Originally posted by gt2_gs
Whoa, thats pretty smart there J-man.

But why dont you just make it so it writes out to an html file? It would reduce server load, and also keep giving you your results in search engines.

You know, seeing as how every time you view a thread it has to read into the mysql and pull out the data, it would make it easier on the server if it just had to read in html files.. Just an idea.
It would appear that it would decrease server load, but judging by others who have tried this, and a bit closer inspection, you would find the opposite to be true. Re-writing all of those HTML pages every time a user updates any of their account information (avatar, location, post count, etc) or posts in a thread would offset any slight performance advantage static pages would give you. Of course, you'd also have to say goodbye to some of vBulletin's awesome dynamic features (like online status), fast and efficient searches (it would take forever for the server to search through thousands of HTML pages), and different style sets. And, I as a webmaster would no longer be able to use templates to easily organize and create pages.

Put simply, using static pages might lighten up on server load, but it wouldn't be as much as you think. It would simply be a trade-off from one resource hog to another, if common features would even be able to survive on static pages in the first place. And, with software that I have installed on the server such as Zend Optimizer and PHP Accelerator, as well as making use of the incredible bandwidth-saving mod_gzip compression module, static pages are simply not worth it.
 
Back