Jump to content

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 :)
Link to post
Share on other sites
  • Replies 81
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular 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

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 specia

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

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

Yes string replacement is the best option for such activity.

Link to post
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 post
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 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...