The Social Geek A never ending story of a never stopping idiot!

29Feb/082

Free PHP Auto Form Mailer

Auto Form Mailer is an easy to use and powerful PHP script that lets you manage even the most complex of HTML forms and have them mailed to your email address. This script assumes zero knowledge of PHP to have it working for you. It handles unlimited form fields, you can set which fields are required and which fields need to have email validation applied to them.

This auto form mailer script is pretty simple to use. All the required files are in the 'files' folder in the download package. You DO NOT have to worry about what is happening inside of the 'fm.php' script. If you are a PHP pro, then you can always fiddle around with the scrip itself, but otherwise you don't really need to.

Okay, so what you have to do is, make the right changes in your HTML form. A demo HTML form is included in the package but the following documentation helps you if you are a totally dumb human being like me:

In your HTML form, make sure the 'action' attribute is pointing to the 'fm.php' script and the post method of form submission is being used:

<form method="post" action="fm.php">

Along with that, make sure your form has the following four hidden form fields:

<input type="hidden" name="email_subject" value="Feedback from your website">
<input type="hidden" name="email_sender" value="webmaster@yoursite.com">
<input type="hidden" name="email_recipient" value="you@yoursite.com">
<input type="hidden" name="email_thanks_url" value="thanks.html">

The first one (email_subject) is the subject of the email message that you'll get when the form is submitted.

The second hidden field (email_sender) will have the email address that tells you from where the email is sent, usually its your site's email address such as webmaster@yoursite.com.

The third one is the email address where you want to actually receive the email message when the form is submitted. This should ideally be your own email address of course.

The final hidden field should be the url of the page that should be displayed once the form has been successfully submitted and emailed.


Additional Settings:

All the basic setup was done above but the Auto Form Mailer also provides additional functionality such as setting up required form fields and email validation fields.

To make sure a certain form field is required, prefix it with 'r_' in the name attribute like so:

<input type="text" name="r_Sender_Name" />

To implement the email validation field, where you need to make sure the person entered a valid email address, prefix the field with 'email_' and you're all good to go!

<input type="text" name="email_Sender_Email_Address" />

Download: www.thesocialgeek.com/afm.zip

Live Demo: http://www.thesocialgeek.com/afm/ 
(try leaving some of the initial fields empty to see the validation results)

More Help:

I have oversimplified this script so it can be used generically. You can alter it slightly to have it working within template systems such as smarty and others. If you need more help with this script, feel free to email me at kamran.usman at gmail dot com and I'll be glad to help.

Enjoy,
Kamran

27Feb/087

Wake Up Call!

I got a wakeup call in the late afternoon when I slipped off my bike on main Karsaz. I was in full speed (just like everybody else) and then I saw some grease on the center of the road, it was covering quite an area of the road opposite to Maritime Museum. I knew I did not have to apply the brakes but a couple of cars ahead of me slowed down miserably and I had no choice but to try and slow down or I would've hit them!

End of story, I slipped like they do in the movies and as I was going through that moment, it felt as if i was in air... one of the freakiest moments of my life to tell you the truth... where I was somewhat alive and somewhat...duh. I was lucky as myself as I did not suffer from any major injuries. Some great people gathered around me and tried to help me get out of the situation. One person (Mr. Usman) was more than helpful and accompanied me to the place near my house and then I myself asked him (after thanking him) that it was alright and he should move on to his own destination.

Went to the hospital, got the (painful) treatment and called a friend (Ibad) who dropped me home in his car. So many things got back to me in the process, so many thoghts ;)

Here I'm writing this post with my right leg straight and not willing to bend or move... I'm not scared of dying, I just don't want to!

24Feb/082

RIB Mosaic – Just luv ya so much!

I am going through my Computer Graphics course project these days and our instructor has asked us to use Renderman as the rendering tool for our animation. I am using Blender 3d for all my work in this project. But Blender does not come with a RIB Exporter by default. I looked around the Internet for a decent RIB Export python plugin but was not able to find something that worked with the latest Blender release.

Then I (luckily) came to know about this tool called RIB Mosaic, and I was blessed with amazing convenience. It works with the standard python modules that come with Blender (that means no additional python setup required) and it's just the matter of putting the python (.py) file in the scripts folder. The only thing you need is a Renderman compliant renderer which can be Pixie or 3Delight or Aqsis or even PRMan if you got enough cash ;)

I did a few test renders of my work and I must say I am so relieved now that I've found this easy to use tool which can export stills as well as animated ribs woohoo!

As an additional candybar, I'd like to share a link that I came across today related to computer animation. All the Industry gurus (such as Catmull and others) from the animation industry talk about how it all started. Here is the link:

http://www.computerhistory.org/events/index.php?id=1114720561 

23Feb/082

Advertising Space

There's no earthly way of knowing
What was in your heart
When it stopped going
The whole world shook
A storm was blowing through you

Waiting for God to stop this
And up to your neck in darkness
Everyone around you was corrupted
Saying somethin'

There's no dignity in death
To sell the world your last breath
They're still fighting over
Everything you left over

I saw you standing at the gates
When Marlon Brando passed away
You had that look upon your face
Advertising space

And
No one learned from your mistakes
We let our profit s go to waste
All that's left in any case
Is Advertising space

Through your eyes
The world was burning
Please be gentle
I'm still learning
You seemed to say
As you kept turning up

They poisoned you with compromise
At what point did you realise
Everybody loves your life
But you ahahh

Special agent for the man
Through watergate and vietnam
No one really gave a damn
Did you think the CIA did

I've seen your daughter
Man shes cute
I was scared but I wanted to
Boy she looks a lot like you

- written by Robbie Williams and Stephen Duffy

21Feb/084

The Dream

I have for you today a dream that I remember. I was not the one to see that dream. It was my sister who was there to experience the moments.

It is some time back, when my sister saw in her dream that she is in a graveyard alone and suddenly she finds out that the devil (Shaitan) comes out of one of the graves. She is scared, she is shouting and crying for help and suddenly she witnesses an amazing source of light and the devil runs away.

Now the thing with dreams is that whatever you are witnessing in the dream, you tend to know about all the aspects of the environment. According to my sis, in that dream, her mind interpreted the devil creature as 'Shaitan' and the source of light as the holy prophet Mohammad (S.A.W).

The most surprising thing in all this was, she saw that dream at about 3 AM in the night. And the instant when she saw the light source in the dream and the devil ran away, the glass covered frame in our home with the name of our holy prophet written over it literally exploded and she woke up. The frame is located in a place where there can be no possibility of a gunshot or a stone entering in our house (and that too at 3 AM) and hitting it, yet the frame having the holy prophet's name in it exploded as if it was hit by a shotgun. When we woke up in the morning, we saw the glass pieces all across the lounge.

Normally, we experience such things only in movies where some sort of power comes out of a name or any other similar sign. But experiencing it in front of me was indeed thought provoking and it made me believe more in supernatural happenings.

19Feb/083

Missing in Pakistan

This documentary really moved me badly. I have a friend who does email me regularly on the missing people issue but this documentary that my bro sent me was a real eye opener.

Part 1: http://www.youtube.com/watch?v=tuOqQM3KrQg 

Part 2: http://www.youtube.com/watch?v=N8sZB7ln6vs 

Part 3: http://www.youtube.com/watch?v=3QEWGWiKyGk 

18Feb/083

A new book in my shelf: PHP 5 Advanced

I went to Saddar on Saturday and on my way back, me and my friend Saadi decided to check out Urdu bazaar as we had to look for some books related to our respective courses.

We did not find the course books we were looking for, but I saw this book titled 'PHP 5 Advanced' by Larry Ullman at Bismillah Book Shop in Urdu Bazaar. I took up the book, scanned through its contents and I thought I should buy it, so I did ;)

I have my plans to take the Zend certification exam sometime soon so I thought this might just be the right kind of book to have for the preparation. Plus, I think even without the certification, this book is worth buying.

Larry Ullman is one of my favorite authors. I have read another of his books before and I loved it! Luckily for me, this book (that I just purchased) is an ideal match to complement Larry's previous book that I read before. It takes you from where you were left in the previous book.

You can find the table of contents here to whet your appetite. I just bought the book so I am on chapter 1 right now, hopefully will finish this up soon and become a pro =P

Cheers,
Kami

17Feb/086

Saturday Roundup

I came back from office in the morning and brought halwa poori at home. My bhabi likes halwa poori; well everyone likes it but she likes it more.

Then I went to Bank Alfalah for some financial transactions. Then I went to my friend Saadi for we had planned for a number of days that we're gonna visit the market as I have to buy a guitar. Now Saadi is an excellent guitarist and an eternally cool guy and he just looks like a maestro when he is playing his guitar.

We went to the market but we were not able to find a guitar of good quality. The quality standards were set by Saadi himself and all the instrument evaluation was being done by Saadi, I was merely an spectator looking at things and trying to learn from them.

Saadi told me he is going to tell me in a day or two as he is going to look for a better guitar. After the market we went to the new (for me atleast) Eaton branch on Sindhi Muslim Society. We had a good khapa over there. It was a good deal that we had, a chicken roll, a quarter of steamed chicken, fries and a drink.

Then I dropped Saadi home. Having a bike really makes things easier especially when you're going to a crowded place like Saddar. I swiftly ran through the lean passages on the roads while the car owners looked at me secretly admiring my luck of owning a bike :P

On my way back I decided to go and meet a friend Ibad, its been some time since I met him. We had some good time and then I came home at 6 pm and slept like no other. I just woke up on Fajr and now writing this post.

While browsing, I came across this:

http://www.clay.smith.name/Parallel_Quran.htm 

A file having multiple translations of the Quran in an organized manner (ayah by ayah). Maybe it would be useful for some. I know it will come handy to me for sure.

15Feb/086

the text without a title (read whining)

As heterogeneous as it may sound, all of us humans do eventaully do one thing: we look for our own interests first. I activley believe that this should be the way to go. We should always go about our interests. I wonder why people call such people as selfish or 'matlabi'. I think human nature is selfish. Under rare cases is when a human actually gives more value to other things than herself or himself, and that too out of their own interest. Such as a mother ready to die for her child. And that too is the mother's interest: she prefers her child's life over her own death, so she still remains selfish.

What basically happens here is the notion of value that gets to work. We would make great or even the greatest of sacrifices for times when we give value to something. We should never assume that we should be kind to every human being on the planet at the extent of giving up our life for them. A good example is that of a soldier, who can easily lay down his life for the safety of the borders of the country. Heck I ain't talking about soldiers who get corrupted by lights and royal stays.

But still, I wanna make a point that humans are objective oriented by default and by design. We have objectives and they get attached to our lives through the gate of the heart. Our heart decides the level of sacrifice we need to make for that person or thing. For example, when I meet a new person, I like that person, I would like to be of his use, I'd love to be some one who would be in his top list when it comes to getting things done. I would put extra effort just to make sure that particular person is happy with me. But once I find something in that same person which is not according to what I think is cool, I'd begin to shallow my depth of lovingness for that person. Had I travelled along the path of businessmen, I would have kept things under balance: "give enough and take enough" to use a silly and insulting, but actually practical phrase. This way, I would not feel disgusted about the fact that the other guy hurt me or the other person should have thought about the special things I did for him. A businessman thinks this way: ok i got enough profit from this person and he got enough profit from me, without either of us running into a desire of vengeance, since we never really lost too much; we lost enough and we gained enough.

We should not and i repeat NOT discourage this. This is normal and has to be observed and accepted. We have to think of any relationship in the form of a business deal. When you make a business deal, you measure the amount of benefit and the amount of loss a particular partner might give you. The same goes with everything else in life. The only difference is, business has "cash" as the  unit of profit while most other partnerships have "happiness" or "peace" (you can take 'peace' as grams and 'happiness' as kilograms ;) as the unit of profit.

Expecting a business partner to sing and dance exactly like yourself is unacceptable and impractical. We really need to figure this fact out: All in this world are here for an objective. People without objective are not people but jails for their own souls. So leaving those jails beside and just talking about people, I would say that you just have to measure things up. If i think person X is an excellent programmer but his jokes are ridiculously silly, and at that very same time the person X thinks Kami is a dumb programmer but he can talk well with even people like person X himself, we would be in for a beautifully rewarding compromise: he codes, i talk, WE earn! In the process I would have to digest person X's jokes and person X will have to fix my bugs in Visual Studio or Netbeans or any other IDE we might be using. You see how it works don't you? It all has to be in a balance. Law of usefulness to others is equally important but we need to set preferences when it comes to special partnerships. One thing to remember is that all of this process needs to be without things like lies, hatred or passion to pull legs and all will be fine.

I'll stop my extremely rewarding lecture so you can have an easy time reading something more useful perhaps. I might be wrong but I think I do have a decent formula for a painless life without too many of regrets.

14Feb/083

Book Meme

Tagged by Hina

The rules are:

1. Pick up the nearest book (of at least 123 pages)

2. Open the book to page 123.

3. Find the fifth sentence.

4. Post the next three sentences.

5. *************.

The nearest book that I have with me is Developing Java Software by Russel Winder & Graham Roberts. It's a really good book btw.

The Three Sentences:

“The expression array.length gives you the number of rows.”

“For this program, testing is a matter of checking the totals displayed against the argument array.”

“More realistically the program might be modified to read a number of 2D arrays from a data file and total the columns of each one, providing a more thorough check.”

Tagged as: 3 Comments