kaijim
Apr 26 2006, 12:03 PM
Hello everybody!
We are currently trying to make the PHP part of the page better.
We have taken a small break from writing the reference part (have made over 400 reference pages the last months), and we have started working on the tutorial part.
I would very much like to get suggestions on what to add
boen_robot
Apr 26 2006, 12:37 PM
A thing I certanly want to see is global variables handling, such as the GET variable. You know, the ones with which when you type "?VariableName=VariableValue" at the end of the URL to trigger special actions in the PHP file.
Maybe some more detailed information on form processing and an example of simple MySQL connection and action (just like the ODBC example).
And one thing which is probably with the least prirority but... some kind of universal way to install extensions? I mean... most extension's installation follow similar steps, right? If so, what are they? The one of my particular interest is (as some people of this forum could already figure out) a step-by-step way to install the XSLT Processor extension.
Chocolate570
Apr 26 2006, 02:12 PM
I'd love more on SQL connections like boen said, and we need a detailed tutorial on classes. They're pretty important.
Maybe some examples on how PHP can interact with AJAX and perform different things too.
Sessions would be nice, along with (slightly off-topic) a PHP quiz? I've always wanted to check how much I can do

(which shouldn't be much)

I'll see if I can come up with some other things...
I suggest you just look at the ASP section and try to balance each one out.
Jonas
Apr 26 2006, 02:22 PM
An example of an email form, because that is the question that is most often asked here...
boen_robot
Apr 26 2006, 02:27 PM
QUOTE (Jonas @ Apr 26 2006, 04:22 PM)
An example of an email form, because that is the question that is most often asked here...
What about the one
here? I haven't tested it, but it seems as a PHP email form to me.
[edit]@...678 what are you talking about? What you show is BBCode. It doesn't belong anywhere in the PHP tutorial. [/edit]
...678
Apr 26 2006, 02:54 PM
i think it should have the basics like [B] [I] [U] [URL] etc.
aspnetguy
Apr 26 2006, 04:50 PM
QUOTE (...678 @ Apr 26 2006, 10:54 AM)
i think it should have the basics like [B] [I] [U] [URL] etc.
BBCode only exists in this forum (and other forum software). It is not even a language. It is just a way to format posts in a forum.
It was a way to allow post formatting without allowing full html coding.
Jonas
Apr 26 2006, 06:49 PM
QUOTE
It was a way to allow post formatting without allowing full html coding.
String replacement, right?
kaijim
Apr 27 2006, 06:46 AM
The e-mail form was added yesterday.. so that is brand new... just a simple way to send mail... i am planning to add more examples.. and a guide to avoid spammers getting your mail adress..
aspnetguy
Apr 27 2006, 01:58 PM
QUOTE (Jonas @ Apr 26 2006, 02:49 PM)
String replacement, right?
Yeah that is all IPB does. It uses string replacement to add the proper HTML when it finds a BBCode.
Jonas
Apr 27 2006, 04:03 PM
Well, then I guess one php example would be string replacement, for a guestbook or forum, with example of how to detect bbcode sets, split it into three (opentag, data to format, endtag) and replace the opentag and endtag with < and > instead of [ and ].
Jack McKalling
May 7 2006, 04:02 PM
I don't know if it is an old idea or a new one, but is it possible to create a Try-it editor for PHP?
Maybe eval() could be used for that, like eval($_POST['php_input']);
Of cource with limitations
boen_robot
May 7 2006, 04:20 PM
Nah, that's a really high security risk. More like live example, such as the code on the left and the result on the right WITHOUT the ability to edit the code (like in the ASP tutorials).
I think it would be good if something like an example on how to use regular expressions is shown. But perhaps the already suggested regular expressions tutorial would have to be created first though.
Jack McKalling
May 7 2006, 06:26 PM
Such examples would do the trick too

There is always a security risk when php gets allowed in editors, but maybe it would be just cool when only the ECHO instruction was allowed

Beginners playing such as
echo "I have hacked yor site!!";
Jonas
May 8 2006, 11:17 AM
Yeah, I don't think a php editor could be more advanced than
this. They could even make examples in php, while the file name was still .asp, since the code they output doesn't do anything. That way, they wouldn't need a php server...
MISIIM
May 9 2006, 12:01 PM
BBCode can be done like this:
CODE
<?php
$code = preg_replace("\[b\](.*?)\[\/b\]","<b>$1</b>", $code);
?>
Little Goat
May 9 2006, 04:41 PM
yes, but it would be nice if that could be in the tutorial for noobs (like me!) so they don't have to come here and ask.
reportingsjr
May 27 2006, 09:04 PM
could you put in the foreach() loop? cant miss anything..
scott100
May 28 2006, 03:59 PM
Maybe a mention for a program like EASYPHP which includes PHP, Apache and MySQL.
It can be a very daunting task for newcomers to get these 3 up and running, when you can just instal a program that does all this for you
Jonas
May 28 2006, 05:14 PM
deved
May 29 2006, 12:14 AM
I'm a newbie PHP student and see a lot of sites that require logins to access information companies have about individuals such as, ISP's, banks, hosting providors, etc.
On your 'web building' page for developers under the Server Side Scripting section, you mention 'Provide security and access control to different Web pages'
Could a tutorial be done on this?
Yuval200
Jun 13 2006, 03:07 PM
Here are some things that by my opinion, would make the php tutorial better:
- Here, under the section "Comments in PHP", you forgot to mention that you can use "#" too, like:
CODE
<?php
\*Comment!
another omment!*\
echo "I like "; //prints "I like "
echo "pasta!" #prints "pasta!"
?>
- Try to explain more about how to install PHP, Apache and MySQL.
- Try to make a page with information about programs that install the three servises, like EasyPHP or WAMP.
Offtopic: a CSS tutorial about designing scrollbars would be nice

(so far I didn't found one, I might missed it if you have one)
Jonas
Jun 13 2006, 03:28 PM
There's no need of a tutorial for css scrollbars, because Scrollbar-css is not a part of any css spesification, be it 1, 2.1 or 3. Scrollbar-css is microsoft only css.
dcole.ath.cx
Jun 14 2006, 12:09 AM
With FireFox you don't need to edit the scroll bar to look like the webpage, I want the scroll bar to look like my browser... The scroll bar would really fit into the browser owned more than the webpage owned...
not to make a argument or nothing..
joecoolaug
Aug 15 2006, 02:21 AM
Well I think that the best thing to add would be detailed explainations of every bit of code. I've noticed that some of the PHP tutorial pages and many others don't explain certain bits of code at all or not enough.
SirPaladin
Aug 27 2006, 04:53 PM
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.
boen_robot
Aug 27 2006, 05:08 PM
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.
Mwnci
Sep 5 2006, 07:00 PM
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?
eguru
Sep 11 2006, 04:16 PM
can add some examples for php too.
Jorn van Engelen
Oct 18 2006, 02:24 PM
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 write
fwrite($file,"\r\n");
in your PHP file.
I think this is very usefull for people who want to make a database without using mySQL.
reportingsjr
Oct 19 2006, 12:43 AM
Hmm, the carriage return (\r) and newline (\n)? Are you sure? And I dont think you need the return, just the \n FYI

.
justsomeguy
Oct 19 2006, 04:42 AM
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 = \n
CR = carriage return = \r
A 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.
sree06
Nov 11 2006, 09:10 AM
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 ...
justsomeguy
Nov 11 2006, 10:48 PM
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.
Mosquito
May 9 2007, 07:48 AM
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.
Anders Moen
May 9 2007, 07:54 AM
Yeah, but you can also go to
www.php.net/gd
Mosquito
May 9 2007, 10:02 AM
QUOTE (Anders Moen @ May 9 2007, 12:54 AM)

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.
Necrotising Fasciitis
Nov 15 2007, 07:20 AM
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.
Xalor
Sep 22 2008, 08:45 PM
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.
Deirdre's Dad
Sep 22 2008, 09:04 PM
QUOTE (Xalor @ Sep 22 2008, 01:45 PM)

I don't see anything that makes PHP work with SQL in there.
http://www.w3schools.com/php/php_mysql_intro.asp
shadowblade
Sep 25 2008, 05:17 PM
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...
CODE
<?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.
Jack McKalling
Sep 25 2008, 09:50 PM
QUOTE (shadowblade @ Sep 25 2008, 07:17 PM)

...
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.
jlhaslip
Sep 26 2008, 03:15 AM
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?
justsomeguy
Sep 26 2008, 05:12 PM
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.
Synook
Sep 28 2008, 09:23 AM
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.
justsomeguy
Sep 29 2008, 05:00 PM
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.
{No}-{Name}-{At}-{All}
Mar 22 2009, 07:07 PM
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.
justsomeguy
Mar 23 2009, 07:21 PM
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.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here.