homepage Welcome to WebmasterWorld Guest from 54.166.148.189
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
get me started in php.please
I know absolutely zilch about php.
Artsyrat




msg:3891656
 9:48 pm on Apr 13, 2009 (gmt 0)

Can someone push me in the right direction to learn some basic php. I need to start using 'file includes' before I go batty and I need to create a 'contact us' form. I've gone to various websites reading info on the subject but it seems I can't find a place that will start me right at the very beginning. I do not understand ANY of the verbage. My web site is css/xhtml.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Thanks in advance!

 

g1smd




msg:3891666
 10:05 pm on Apr 13, 2009 (gmt 0)

PHP is a scripting language, the output of which is HTML code and content.

Includes are fairly simple, but you first need to tell your server that the script files on your server need to be sent to the PHP handler instead of being just sent directly to the user's browser.

You do NOT have to change the URLs that are used to access that content. In fact it is a very bad idea to change the URLs. There's several ways to achieve that, documented in a number of threads here.

Includes are great, because you can use the same code fragment on every page of your site. When you need to change that common code, it is just one small edit - and that change appears immediately on every page of the site.

rocknbil




msg:3891733
 12:18 am on Apr 14, 2009 (gmt 0)

I've gone to various websites reading info on the subject but it seems I can't find a place that will start me right at the very beginning. I do not understand ANY of the verbage.

Did you try W3Schools [w3schools.com]?

My web site is css/xhtml.

This is off topic, but I have to ask. If you're struggling with includes, you may be making things harder than they have to be just in your page production. Why are you using XHTML? If your output is going to be HTML, and your server outputs text/html headers, and you're not going to be digging into the wonderful features of XHTML and extending your html elements with a custom DTD, go easy on yourself.

Continue using CSS, but use a doctype that actually describes your web site content. Use a 4.01 strict or even transitional doctype. You won't need the annoying little /'s everywhere.

Artsyrat




msg:3891834
 6:02 am on Apr 14, 2009 (gmt 0)

OK, just by the two replies I've learned something about PHP. This is a start.
Happy to hear I don't need to change any URLs.

Regarding the doctype...this doctype I posted is what my css/xhtml instructor said is the appropriate doctype for what I had just learned. I just believed him and put it there. I think I need to read further on the doctypes.

Rocknbil...you said,
=============================
and you're not going to be digging into the wonderful features of XHTML and extending your html elements with a custom DTD, go easy on yourself.
================================
Are you saying there is more to xhtml than I am probably utilizing? It's obvious I have some gaps in my understanding here.

I was intrigued by what I read about PHP and thought it could have a positive impact on my website. I've been to W3schools a ton for several aspects of learning web development. Looks like another trip to school.

tomhumf




msg:3892055
 2:14 pm on Apr 14, 2009 (gmt 0)

Do a search for 'killer php', I found the video tutorials were great for the basics

Artsyrat




msg:3892129
 3:33 pm on Apr 14, 2009 (gmt 0)

tomhumf- Thanks for the suggestion. That is exactly what I was looking for. I've watched several of the video tutorials and they are very easy to understand and answered many questions already.

I have a couple of questions here before I pursue this further. Learning something new can take alot of time, something of which I don't have much of currently.

If I decide to incorporate php script into my site at this point it would be only for file includes on every page and an 'email contact us' form on one page.

My question is, using this new script will I be changing all my file extensions over to php or keeping them html? Is there some drastic change I'll need to make to my html site to be able to incorporate these cool funtions with php. OR, am I able to just add the php script into my html and keep everything as it is? Am I making sense?

rocknbil




msg:3892241
 5:33 pm on Apr 14, 2009 (gmt 0)

Are you saying there is more to xhtml than I am probably utilizing? It's obvious I have some gaps in my understanding here.

Sorry for the off-topic, this is the last I'll divert your thread. :-) It's not just you. Developers claiming to be "experts" don't even know this, or ignore it.

Many developers, including "instructors," give a knee-jerk answer to doctype with XHTML as the "latest and greatest, it's the replacement for HTML." People just accept this and go with it without knowing why other than someone somewhere told them it was so, so it must be. When you have a moment, read this thread posted by DrDoc Why MOST of us should NOT use XHTML [webmasterworld.com] and this excellent FAQ by encyclo: Choosing the best doctype for your site [webmasterworld.com]. Then go kick your instructor's patootie for not knowing these. :-)

using this new script will I be changing all my file extensions over to php or keeping them html?

It might be simpler to convert them all to .php so you know "what is what," but you can change your server configuration to parse all .html extensions as PHP.

g1smd




msg:3892453
 9:34 pm on Apr 14, 2009 (gmt 0)

Either:

- change your server configuration so that it will look inside .html files for PHP scripts. You keep on using the same .html URLs as before.

- change the filenames to .php and carry on using .html URLs. Set up a rewrite to connect .html URL requests to be handled by .php files. You keep on using the same .html URLs as before.

Do NOT change your URLs from .html to .php as that would be a major setback to the indexing of your site.

.

Dump the XHTML DOCTYPE and go with HTML 4.01 - either Transitional or Strict will be fine.

Artsyrat




msg:3892580
 1:42 am on Apr 15, 2009 (gmt 0)

Excellent responses from all, I'm changing the doctype for sure. I read the suggested thread by DrDoc and it's very informative. There's always something new to make me think or change the way I think about my new skill (some what not really quite there yet skill)...this web development moves forward very fast and is ever changing.

Glad I don't have to change my URLs. whew.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved