Jump to content

PHP Tutorial


kaijim

Recommended Posts

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 :)
Link to comment
Share on other sites

Yeah that is all IPB does. It uses string replacement to add the proper HTML when it finds a BBCode.
Link to comment
Share on other sites

Yes string replacement is the best option for such activity.

Link to comment
Share on other sites

  • 1 year later...
  • 5 years later...

One edit that I would like to see made is on the file upload page. You use this bit of code:

 

// Allow certain file formats
if($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg"
&& $imageFileType != "gif" ) {
    echo "Sorry, only JPG, JPEG, PNG & GIF files are allowed.";
    $uploadOk = 0;
}

 

in order to check if an uploaded file is of the right type. It would be nice if you switched that to this:

 

if($imageFileType == "jpg" || $imageFileType == "png" || $imageFileType == "jpeg"
    || $imageFileType == "gif" ) {
    echo "Sorry, only PDF, PNG, JPG,  files are allowed.";
    $uploadOk = false;
}

 

It is much more efficient because you don't need to check through every file type. Its not a big deal and I don't want to come across the wrong way with this. I just know a lot of people use your code without ever looking at it themselves. It should be a pretty easy fix and it just makes the code better on the site.

Thanks for everything you guys do. Most of my html, css, and php knowledge has come from you guys. Keep up the good work.

Link to comment
Share on other sites

  • 9 months later...
  • 1 month later...

I would really like to see the examples changed to use exit() instead of die()

Whilst die() is equivalent to exit(), in the PHP manual it is exit() that has the explanations and examples.

die() is unnecessarily harsh and potentially triggering.

 

Link to comment
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
×
×
  • Create New...