Jump to content
  • Announcements

    • boen_robot

      Guidelines and Netiquette   03/28/2017

      Posting Problems:   Having problems posting your topic? Read through this: To join, you agree to our terms and conditions and fill out and submit a registration form. An activation email will be sent to your email adress, so you'll need to verify your account. After that the account has to be validated by one of the moderators. This will mean that it can take up to a day to be activated. A couple of things to remember to ensure approval: Don't use an email address in one of those $2 four character .com domains eg. xyds.com. These will be deleted and the domain added to the banned list. Don't use an email address that is within a domain with a bad reputation for spam. A Google search is run on every email address and email domain. Don't sign up with an email address that doesn't exist, doesn't work or requires the sender to answer a quiz before their email can get to you. Put your country and or state and city in the signup form. Blank forms will go to the botton of the "to do" list. And make sure that your email address and your country match, saying you're from Alabama and using a .ru email address is not going to get you activated. After a membership is activated the first few posts will be monitored. Posting spam or unapproved topics described in the agreement results in an immediate ban. The email provider and the IP addresses associated with the account will be banned and all posts will be deleted. These strict measures have been deemed necessary to hinder spam. Sorry for any inconvenience this causes, but it's not liable to change. If, after reading this, you still can't post and don't understand why, contact one of the Moderators listed here.   Topic Guidelines   Including the following information can expedite an accurate response from board members: Must be a Specific Problem or Question related to web design and development Include Code in Question (wrap with   for small blocks of code and for longer blocks   ) Include Code Author Include Extra Notes/Modifications/Attempts Include web link to page/file when possible Content Guidelines   You may not post, upload, link to, or email any Content that contains, promotes, gives instruction about, or provides prohibited Content. Prohibited Content includes any Content that breaks any local, state, county, national or international law. Prohibited Content also includes: No direct or indirect advertising or websites, forums, products, services No hijacking of posts (do not post your question in someone elses) Content that infringes upon any rights [ex. MP3s and ROMs] (including, but not limited to, copyrights and trademarks) Abusive, threatening, defamatory, racist, or obscene Viruses or any other harmful computer software False Information or libel Spam, chain letters, or Pyramid schemes Gambling or Illicit drugs Terrorism Hacking or cheating for internet/online games Warez, Roms, CD-Keys, Cracks, Passwords, or Serial Numbers Pornography, nudity, or sexual material of any kind Excessive profanity Invasive of privacy or impersonation of any person/entity Hacking materials or information Posting Tips   There are more BBcodes than there are buttons for on the reply menu. To get the full list, click "BB Code Help" underneath the clickable smilie face menu. Use   for small snippets of code Use   for lengthy snippets of code Use   if your snippet is HTML (optional) Use   if your snippet is SQL (optional) Rules of Conduct   Be nice. There's no need for calling someone stupid if they ask an 'easy' question. Keep your avatars and signatures absolutely child friendly. We have a younger audience on this forum. Keep your language appropriate for the same reason above. Do not PM moderators for help on the forum. Post on the topic, or create a new one.   Spam:   Recently, as you have all without doubt noticed, we have had lots of spam and advertisement on the forum. Therefore, we'd like to alert you as to what to do when you have found any of the aforementioned annoying messages: it. Immediately. Give a clear reason, please, if the advertising is not evident. DO NOT POST! Report, let the post stay as is, and we will get to it, meanwhile if you continue to post as normal in the other threads, it won't be on the top so long. Refrain from PMing the member. This won't help at all, as they are most likely spambots anyway. Thank you.       Images in signatures:   After thinking of users on dial-up, we have decided to enforce the following rules regarding signatures. Please pay heed to them. Respecting these rules is respecting the members on this forum with dial-up. Signature rules: No animated images AT ALL. No matter the amount of animation. Maximum image widthxheight: 300x150 Maximum image (file) size: 15kb Use calm colors. Do not use highly contrasting images in your signature, as this can get really annoying when seeing several posts from one member in the same thread. The same prohibited content goes for images as for posts. Lastly, use common sense. No lengthy signatures please. Save us some scrolling. Thank you.       Links in signatures:   Please understand that w3schools.com only exists because of voluntary work and is barely supported by the advertising littered throughout the tutorials and the forum. So, please, stop advertising other sites. DO not post links that drive traffic away from the w3schools domain - especially to a site that offers similar if not identical information. Please help support the site by keeping individuals on it. Thank you. Here are some guidelines as to what you can put in your signature: w3schools links --> allowed w3.org links --> allowed browser links --> allowed html editor links --> allowed personal sites --> allowed tutorial sites competing with w3schools --> NOT allowed sites completely irrelevant to webprogramming and this forum --> NOT allowed   Thanks for understanding, and for taking the time to read this. ~W3Schools Modstaff~
kaijim

PHP Tutorial

Recommended Posts

SirPaladin    0

Perhaps practical projects, BBCode like it`s been mentioned, how to code finite data trees (for forums, for example), paging etc.. It`d be very interesting. Although you could just stick to theory and add a detailed OOP page. :)

Share this post


Link to post
Share on other sites
boen_robot    105

I think a fine addition to the PHP tutorial that would be good, without going too much spoonfeeding on the user, if it includes the regular expression functions.Now that theese functions are used in the Secure Mail script, such explanation is more requred then before. Not to mention regular expression functions are used in a lot of other scripts, such as the above mentioned BBCode for example.

Share this post


Link to post
Share on other sites
Guest Mwnci   
Guest Mwnci

How about some more advanced features of PHP? For example sockets and how to use exec...Also how about a page of challenges to test your php ability? :)

Share this post


Link to post
Share on other sites
Guest Jorn van Engelen   
Guest Jorn van Engelen

This PHP tutorial was very usefull.The only thing I couldn't find was how to put an [enter] in a file. :) I found the awnser of this question 2 weks ago. :) Just writefwrite($file,"\r\n");in your PHP file.I think this is very usefull for people who want to make a database without using mySQL.

Share this post


Link to post
Share on other sites

Hmm, the carriage return (\r) and newline (\n)? Are you sure? And I dont think you need the return, just the \n FYI :).

Share this post


Link to post
Share on other sites
justsomeguy    942

It depends on the OS. DOS format is CRLF, Unix-based systems prefer LF only, and Mac-based systems prefer CR only.btw: LF = line feed = \nCR = carriage return = \rA Linux system seeing \r\n will sometimes show 2 newlines. But, for things like email headers, \r\n is required by the RFC to separate them, even though just \n is used in the email body.

Share this post


Link to post
Share on other sites
sree06    0

hi,PHP tutorial is nice ....adding to the above disc v can have something rel to ADO connectivity thru PHP - which is very useful 4 many appln proging ....then something covering PEAR packages ....shopping cart integrations ....last but not the least something rel to CMS tools ...

Share this post


Link to post
Share on other sites
justsomeguy    942

Specific applications like shopping carts and CMS programs typically don't have tutorials. You pretty much have to design it, break it down into features that you want and then figure out how to make each feature work individually.

Share this post


Link to post
Share on other sites

Personally, I would like to see a section added about PHP Image manipulation and the GD library and such. It wouldn't have to be a very in-depth tutorial, basically one just to let people know what they can do. But a full PHP Image reference would be useful.

Share this post


Link to post
Share on other sites
Yeah, but you can also go to www.php.net/gd :)
Yes, you could also go to PHP.net for examples of every other item on W3S. I think that some of the missions of W3S is to simplify concepts for beginner developers, as well as provide comprehensive references to the more advanced. A PHP GD section deserves a spot I think.

Share this post


Link to post
Share on other sites
Guest Necrotising Fasciitis   
Guest Necrotising Fasciitis

One very simple and easy to set up Server Package is AppServ. It is available from http://www.appservnetwork.com/. It includes PHP, MySQL and Apache and will run on any windows computer. Took me five minutes to install and have my server running nicely. :)

Share this post


Link to post
Share on other sites
Xalor    0

We should have something that deals with CMS with the PHP, I don't see anything that makes PHP work with SQL in there. Thats important for game designers, who plan to host their game online, or private servers for games like MapleStory, who need a database system for their website.

Share this post


Link to post
Share on other sites
shadowblade    0

Something that needs to be fixed right away...On the file upload section (http://w3schools.com/php/php_file_upload.asp) the file_exists() function is called, but the value passed to it is the user's file name, so with the given setup, the script will always stop because the file that the user selected to upload does in fact exist.This can be fixed like so...

<?php$userfile = $_FILE['formfile']['name'];$name = basename($userfile);$dir = "some_upload_directory/";if (file_exists($dir.$name))   //code?>

On that note, a few other things I'd like to see in the file upload section are a reference of MIME types for common files (and the fact that $_FILE["file"]["type"] is a MIME type and not just a common extension - afaik this isn't mentioned anywhere).Also, I don't think it is mentioned ever that the "file" in $_FILE["file"] is the name of the file field in the form. I can see this being very confusing for a beginner. It should be changed to something to differentiate it from the $_FILE array.

Share this post


Link to post
Share on other sites
...On that note, a few other things I'd like to see in the file upload section are a reference of MIME types for common files (and the fact that $_FILE["file"]["type"] is a MIME type and not just a common extension - afaik this isn't mentioned anywhere)....
Actually there is a MIME-types list on W3Schools. Just not in that tutorial :)See this list: http://www.w3schools.com/media/media_mimeref.asp (Media Tutorial)You're right about the "file" name of the file-input, indeed confusing. I would choose "userfile" or so.

Share this post


Link to post
Share on other sites
jlhaslip    1

On that list, I could not find application/x-httpd-php or application/x-httpd-phps ???*edit*I forgot to RTFM. "The reference below is a list of MIME types supported by Microsoft Internet Information Server version 5."M$ uses ASP don't they?

Share this post


Link to post
Share on other sites
justsomeguy    942

You can install PHP on IIS as well, in fact every server I've installed PHP on was IIS.I don't really think that w3schools has a "complete" list of anything though.

Share this post


Link to post
Share on other sites
Synook    47

There can never really be a complete list of MIME types - for example, a new one could be invented for appml: application/appml+xml, and as long as the required agents understand, it is fine.IIS don't call their server a HTTPD though, so it may have a different MIME type for PHP documents.

Share this post


Link to post
Share on other sites
justsomeguy    942

The IIS that I'm looking at doesn't even have a mime type set up for PHP. That would make sense, because it's not sending the PHP files for download. There is an application mapping for PHP files, but not a mime type. If I wanted the server to send the files instead of execute them I could remove the application mapping and add a mime type.

Share this post


Link to post
Share on other sites

Sorry, but there is no way I'm going to read through all those replies, I just want to say that PHP need the 'try it yourself' links.

Share this post


Link to post
Share on other sites
justsomeguy    942

Not going to happen. It would be an enormous security threat to allow people to enter arbitrary server-side code for the server to execute. That goes for both PHP and ASP. There's no try-it editor for ASP code, either. Only client-side code. If you want to execute server-side code you need your own server (or space on someone else's). If you want to set up your own site to allow people to execute their own PHP code, fine, but don't expect your server to stay online very long.

Share this post


Link to post
Share on other sites
skaterdav85    12

If the PHP tutorial is still being worked on, I'd like to see more object oriented concepts in php. Because the tutorial doesnt cover OOP, I've been reading "PHP Object-Oriented Solutions" by David Powers, which is a great book for a beginner, as well as getting help from forum members. It'd be nice to have reference of some of the basics so i dont have to flip through my book or go to php.net all the time.

Share this post


Link to post
Share on other sites
Comfy    0
http://w3schools.com/php/php_looping.aspI'm extremely new to web design and programming so was hoping some one could clarify the below as it may be my understanding that is incorrect.In the tutorial
<html><body><?php $i=1;do  {  $i++;  echo "The number is " . $i . "<br />";  }while ($i<=5);?></body></html>

which would output:

The number is 2The number is 3The number is 4The number is 5The number is 6

But if my understanding of loops is correct this isn't strictly right, the i increment should be below the echo line:

<?php $i=1;do  {  echo "The number is " . $i . "<br />";   $i++;  }while ($i<=5);?>

which would return an output of:

The number is 1The number is 2The number is 3The number is 4The number is 5

If I'm mistaken I apologise, I'm alittle confused./Comf

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×