Jump to content
kaijim

PHP Tutorial

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 :)

Share this post


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

Share this post


Link to post
Share on other sites

Yes string replacement is the best option for such activity.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...