Welcome! Log In Create A New Profile

Advanced

smiling smiley PHP is cool

Posted by Mac 
Announcements Last Post
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
avatar
Mac
smiling smiley PHP is cool
February 24, 2013 06:09PM
Just to give you a taste of what you can do with PHP.

I recently coded an email app for our School (INTCOM - internal communication). We get so many emails daily that it just makes sense to collate all our "internal & departmental" emails into a digest (i.e. all internal emails are collated into one single email, which is sent out 2 times a day, @ 10 a.m and 3 p.m). Much more user-friendly to open one email and read 20 collated messages at once as opposed to opening 20 individual messages.

This is how I did it. Just to tickle you.

Staff send all emails they want included in the INTCOM digest to an email address I created on a server ( e.g. intcom@server.ac.za ).
I sourced, and adapted a pre-written and free (open sourced) PHP email class (classes are cool - you are welcome to discuss it here) that extracts (harvest) all information from the mailbox into a database. This was tricky - took me 3 months (in between other work) to change the code to fit our needs. For example, I wanted a online repository where all (or rather "some"winking smiley attachments send by email are automatically saved on our server, where it can be organized and searched by staff (another free class which I adapted). I say "some" attachments, because a graphic email signature is an attachment, and I have not desire to save such attachments on our server.

Now, I wanted emails to be categorized. E.g. is it an important email, or a tuition related, or a research related etc.email? All important emails are collated under a heading (e.g IMPORTANT!!!) followed by all tuition emails etc. I also wanted to colour the background of categories(e.g. important emails have a red background, tuition is yellow etc.) This way, with time, staff will be sensitized to color. Admin staff, for example, is not interested in tuition-related emails, so they instinctively scan the list for colours for their emails of interest (of course, I could add a flag in the database to define who is admin and who is academic and who receives what, but logic is at play here, which I will not cover here). Me, I chose to add three characters in front of the subject. xnb is for important emails e.g xnbWe are closing down! Using PHP functions (which you will learn about, the first three letters are extracted. Using simple if/elses (e.g. if the fist three letters is xnb, then save it as follows, and extract and collate it as follows..)

So, I have a cron-job running on the server ( a server function that runs the PHP script). Every 5 minutes, it checks the mail inbox for a new email, then extracts the information into a database. at 10 and 15 hours, another cronjob script collates all the information in the database into a single digest email, formats it and sends it out to all staff (pulling email addresses from the staff database, which is also used to create our school web page - http://osprey.unisa.ac.za - So one database and one table has many uses. If you have information in a database, you can present it in many ways. The portfolio is designed to sensitize you to the ways you can present information (e.g. you can control who sees it - admin, students or both) and what they see.

There is much more, but I just wanted to tickle you. It works like a bomb.
avatar smiling smiley Re: PHP is cool
February 24, 2013 06:30PM
MMM, interesting indeed. I wonder if I could adapt this to screen through our enquiry emails and categories them according to product and reroute them to the correct AI - obviously discarding all the spam while it is at it. Have I ever mentioned how much I hate spam angry smiley

My PHP is limited to Wordpress but I am amazed everyday with what I am able to do with it. HTML and CSS will always be my passion but PHP is definitely close behind.

____________________________________________Nazi Coder____________________________________________

I'm not antisocial, I'm just not user friendly

"It's not a bug; it's an undocumented feature!" ~ some unknown Microsoft developer
avatar smiling smiley Re: PHP is cool
February 25, 2013 09:25AM
WOW!!! Nice going Mac!! I still have a long way to go. The last program that I wrote in Java topped at 1310 downloads on a free site, and it was a small Addressbook app that I never thought would be usefull to anyone.
smiling smiley Re: PHP is cool
February 25, 2013 03:08PM
Interesting stuff hey.... so even the official " http://osprey.unisa.ac.za/phorum " forum can also be done purely using php only?
avatar
Mac
smiling smiley Re: PHP is cool
February 25, 2013 04:24PM
It is. Maybe one day I'l tell about the other apps... smiling smiley

Maybe I must organize a video conference to tell you about what you can do with PHP? But then you will need to be close to a Unisa provincial center (see here http://www.unisa.ac.za/Default.asp?Cmd=ViewContent&ContentID=1680)
smiling smiley Re: PHP is cool
February 25, 2013 04:38PM
Sounds awesome. Well done!!

http://capetown-airport.co.za/
avatar smiling smiley Re: PHP is cool
February 26, 2013 09:10AM
How about putting it on youtube so that all of us living in remote rural areas can able to stream it! cool smiley i wonder why unisa doesn't use ustream and Itunes U?

gbakamela [77234715]
avatar
Mac
smiling smiley Re: PHP is cool
February 26, 2013 11:55AM
There are far more impressive apps written in PHP by far more impressive people, like the people who wrote this forum software!
avatar smiling smiley Re: Re: PHP is cool
February 26, 2013 12:00PM
I like this idea!! Mac, maybe you can make a YouTube movie and tell us about the other things that one can do with PHP. The video conference is ok, but I won't get time off at work to go to Cape Town for that.


gcobani Wrote:
-------------------------------------------------------
> How about putting it on youtube so that all of us
> living in remote rural areas can able to stream
> it! cool smiley i wonder why unisa doesn't use ustream and
> Itunes U?
avatar
Mac
smiling smiley Re: PHP is cool
February 26, 2013 02:21PM
Mmmm... hey gcobani - you are giving me work here smiling smiley
avatar
Mac
smiling smiley Re: PHP is cool
February 26, 2013 02:44PM
Thought about it and then it hit me... if I show the app/s, I will be showing personal information. So no can do sad smiley
smiling smiley Re: PHP is cool
February 26, 2013 04:16PM
Is it possible to see some examples of php applications so that one can visualise how they work in practice?
avatar
Mac
smiling smiley Re: PHP is cool
February 27, 2013 07:42AM
This forum is built with php smiling smiley
avatar smiling smiley Re: PHP is cool
February 27, 2013 08:40AM
lol i think wordpress and facebook are also built with php and one of exciting things is that cloud technoloy which is base on web applications so if one has knowladge of PHP, ASP.net and JQUERY he stand better chance to get cool job or even better be your boss

gbakamela [77234715]
smiling smiley Re: PHP is cool
February 27, 2013 10:17AM
yes indeed, cloud computing is certainly here, and mastering php will give us a good understanding of how web based applications are created and how best we can maintain (and audit) the systems.

..&ru..
smiling smiley Re: PHP is cool
February 27, 2013 10:35PM
WOW, well done. Not anywhere close to that level. Maybe one day.
smiling smiley Re: Re: PHP is cool
February 28, 2013 11:17AM
mac Wrote:
-------------------------------------------------------
> This forum is built with php smiling smiley


why was phorum picked? There are so many other more convenient ones. The spam check before posting is a drag confused smiley

http://capetown-airport.co.za/
avatar smiling smiley Re: Re: Re: PHP is cool
February 28, 2013 11:31AM
kreason, I have to agree with you. Personally I am a big fan of phpBBforums. I have installed and modified many forums and it's such a breeze with phpBB.

As for the spam check, would it not make sense to disable it after a member has made x number of posts. Surely after 20 (no moderation needed) posts it's safe to say that a person is not a bot?

kreason_77840070 Wrote:
-------------------------------------------------------
> mac Wrote:
> --------------------------------------------------
> -----
> > This forum is built with php smiling smiley
>
>
> why was phorum picked? There are so many other
> more convenient ones. The spam check before
> posting is a drag confused smiley

____________________________________________Nazi Coder____________________________________________

I'm not antisocial, I'm just not user friendly

"It's not a bug; it's an undocumented feature!" ~ some unknown Microsoft developer
avatar
Mac
smiling smiley Re: PHP is cool
February 28, 2013 11:32AM
Most forums have spam checks these days. besides, it improves your maths ....

Phorum is the best, loads the fastest, it mostly text based and thus low on bandwidth requiremens etc etc.
avatar smiling smiley Re: PHP is cool
February 28, 2013 11:44AM
smiling bouncing smiley so we not just improving our php skills then smile

____________________________________________Nazi Coder____________________________________________

I'm not antisocial, I'm just not user friendly

"It's not a bug; it's an undocumented feature!" ~ some unknown Microsoft developer
smiling smiley Re: PHP is cool
March 04, 2013 06:47PM
Hi Mac...that's inspirational.Will try do it on my own
smiling smiley Re: Re: PHP is cool
March 04, 2013 06:59PM
Hi 77843835AlexB..are you new to PHP or you have been doing it for long?I want to contribute free apps also in future
avatar smiling smiley Re: Re: Re: PHP is cool
March 05, 2013 02:08PM
First time doing PHP. Been doing most of my programming in JAVA and C++. Have a look at Programmers Heaven this is where I share my code.



72101067 Wrote:
-------------------------------------------------------
> Hi 77843835AlexB..are you new to PHP or you have
> been doing it for long?I want to contribute free
> apps also in future
avatar smiling smiley Re: PHP is cool
March 06, 2013 11:32AM
This sounds like some hectic coding. I have heard about cron-jobs. I don't really know what they are all about. I just think they are some server-side scripts. I can see that PHP is very powerful.
avatar
Mac
smiling smiley Re: PHP is cool
March 06, 2013 02:21PM
A cron job is a script on the server that is set to run at certain times. So you may have a simple PHP script like this:

Language: PHP
$to = "lovebird@mweb.co.za"; $subject = "Hi lovely!"; $body="I love you every minute of the day!"; if (mail($to, $subject, $body)) { echo("<p>Message successfully sent!</p>"); } else { echo("<p>Message delivery failed...</p>");

Given the subject, you want to send it to her every minute of the every day of every week, but every now and then you are out with your mates and not in front of the PC. So you create a cronjob - a command on the server that runs this script (the PHP page) every minute, and thus sends the mail.

Tip: Don't do it. Eventually she will catch on that you are actually with your mates....
avatar smiling smiley Re: PHP is cool
March 20, 2013 11:43PM
Hi Mac,

Thank you for the explaining what a cron-job is.
I understand what you are trying to achieve.
This is very cool.
The beauty of PHP smile

Yeah, I won't do this. She will definitely figure out what's going on.
I have to admit though, this is pretty neat stuff.
smiling smiley Re: Re: PHP is cool
April 04, 2013 07:18AM
That would be goood

78009855
avatar smiling smiley Re: PHP is cool
July 11, 2013 10:57AM
Hi guys, I just passed introduction to Web Design and have now registered for PHP.

I am so happy to have reached this stage and cant wait to roll up my sleeves and apply some elbow grease.smileys with beer
Sorry, only registered users may post in this forum.

Click here to login