Screencast: Building a PHP contact form with the Zoop Framework

And here are the code snippets I used in this screencast:

pageDefault

	/**
	 * pageDefault
	 *
	 * @param mixed $inPath
	 * @access public
	 * @return void
	 */
	function pageDefault($inPath)
	{
	// 	You may usually want the following line, but for our demo we don't
	// 	$this->zoneRedirect("login");
 
 		global $sGlobals;
 		global $gui;
 
 		//this is for gets.  It displays the page
 		$gui->display("contact-form.tpl");
	}

postDefault

	/**
	 * postDefault
	 *
	 * @param mixed $inPath
	 * @access public
	 * @return void
	 */
	function postDefault($inPath)
	{
		global $sGlobals, $gui;
		//this is for posts, it handles when forms get submitted.
 
		$post = getPost();
 
		$from = $post['address'];
		$to = 'justin@mailinator.com';
		$cc = null;
		$subject = $post['subject'];
		$body = $post['message'];
 
		$msg = new message();
		$msg->sendTextEmail($from, $to, $cc, $subject, $body);
 
		$gui->assign('message', 'Thanks for contacting us!');
		$gui->display('message.tpl');
	}

Note: It's not a good practice to actually display things in the post handlers. As a general rule, you should do your emailing and form handling in the post handler, then redirect to a page function to display feedback. Something like this:

	/**
	 * postDefault
	 *
	 * @param mixed $inPath
	 * @access public
	 * @return void
	 */
	function postDefault($inPath)
	{
		global $sGlobals;
		//this is for posts, it handles when forms get submitted.
 
		$post = getPost();
 
		$from = $post['address'];
		$to = 'justin@mailinator.com';
		$cc = null;
		$subject = $post['subject'];
		$body = $post['message'];
 
		$msg = new message();
		$msg->sendTextEmail($from, $to, $cc, $subject, $body);
 
		zoneRedirect('thanks');
	}
 
	/**
	 * pageThanks
	 *
	 * @param mixed $inPath
	 * @access public
	 * @return void
	 */
	function pageThanks($inPath)
	{
		global $sGlobals, $gui;
		$gui->assign('message', 'Thanks for contacting us!');
		$gui->display('message.tpl');
	}

Contact form template

{include file="head.tpl"}
<body>
 
<h1>Contact Me!</h1>
 
<p>Fill out the form below to contact me.</p>
 
<form method="POST">
 
	<div>
		<label for="name">Name:</label>
		<input name="name" id="name" type="text" />
	</div>
 
	<div>
		<label for="address">Email address:</label>
		<input name="address" id="address" type="text" />
	</div>
 
	<div>
		<label for="subject">Subject:</label>
		<input name="subject" id="subject" type="text" />
	</div>
 
	<div>
		<label for="message">Message:</label>
		<textarea name="message" id="message"></textarea>
	</div>
 
	<input type="submit" name="submit" value="Send Message" />
</form>
 
</body></html>

Hi! I'm just wondering if

Hi! I'm just wondering if anyone else is using ZOOP? If so, what version are you using, and what positive/negative experiences did you have? I'm using it for about a year now, also downloaded some reviews from http://bytesland.com search engine and I'm somewhat dissatisfied. Though the Zoop PHP framework features includes AJAX support and integration, GuiControls (a PHP execution of .net's webcontrols), PDF creation, Smarty templating system, automatic form validation and creation, SMTP template-based email sending, session handling and integrated caching, employs the PEAR modules, there never was any documentation, and the framework has been frozen since 2008. The framework itself is solid (I run a 1mil+ pageviews/mo career website) but it is very tightly-coupled and uses the outdated PEAR::DB. Is anyone interested in reviving this project?

RightBehindYou 29 Mar 2011

No, the stock beta may

No, the stock beta may reflect both business and financial risk. Whenever a company borrows money, it increases the beta of its stock. Remember, the company cost of capital is the expected return on a portfolio of all the firm’s securities, not just the common stock. free ads |jobs|twin memory foam mattress

DaniGrey 03 May 2011

I have try the way you

I have try the way you served here after having read it. Well yeah, I feel comfortable also with this. Comfortable is always important aspect in everything we do.
SEO Firm India

Helmore 09 May 2011

I agree with you bro. I am

I agree with you bro. I am also after softwares and programs I will be comfortable with.
skin care products

angel1975 18 Aug 2011

This opportunity is so

This opportunity is so fantastic and working style so speedy. I was fascinated by the delivery and execution of the file. I found your website perfect for my needs & definitely use it in my work.. Thank you for your info, greatly appreciated. It could be a great tool in many ways for research.
fulfillment companies

janinapujol 19 Aug 2011

This is a great inspiring

This is a great inspiring article.I am pretty much pleased with your good work.You put really very helpful information.Promat

hushcat 23 Aug 2011

Thanks for adding the video

Thanks for adding the video admin. It has helped us more to understand how to properly do it.
ipad 2 keyboard

angel1975 14 Sep 2011

I would also like to

I would also like to disagree with some of the comments that were made I think you should know more about the topic before writing on it. Mercy hospital

leonardod 21 Nov 2011

I am now starting to learn

I am now starting to learn Screencast, thanks that you have shared another ideas.
birthday gift baskets

darrensy 30 Nov 2011

I fit in with your

I fit in with your conclusions and will eagerly look forward to your approaching updates. Saying thanks will not just be sufficient, for the exceptional clarity in your writing. I will immediately grab your rss feed to stay privy of any updates.bruidsfotograaf

leonardod 19 Jan 2012

reply

I find that there is alot of different views based on the comments from your blog, this only happens when someone writes on a toical subject in a way that creates discussion..well done!
blog immobiliare
donna cerca uomo roma
portali immobiliari

jacklavoro 05 Jan 2012

Hi, just wanted to say I

Hi, just wanted to say I attended this conference last year, and found it by far the best of about 8 conferences that I attended in the field. Full of professional insight based on testing by experts that knew what they were talking about. I would certainly go again and recommend it to anyone operating in this field. relatiegeschenken

leonardod 09 Jan 2012

My dear god,I prefer this

My dear god,I prefer this great site we let you know took your time and efforts when adding this post. I'm a huge fan. Great Share I actually appreciate it.Computerhulp

leonardod 15 Jan 2012

Functions can be defined

Functions can be defined inside code blocks, permitting a run time decision as to whether or not a function should be defined. Function calls must use parentheses, with the exception of zero argument class constructor functions called with the PHP new operator, where parentheses are optional. Thanks.
Regards,
Douglasville bankruptcy attorneys

jaffa 11 Jan 2012

I am very interested in this

I am very interested in this article and you have really helped me. I think you have a great knowledge especially while dealings with such subjects. Bootcamps in Australia

khusbo781 20 Dec 2011

Great work you have done by

Great work you have done by sharing them to all. simply superb. Thanks for a nice share you have given to us with such an large collection of information regards.software review
PDF tools

hongchen 31 Oct 2011

Thanks a lot for the

Thanks a lot for the sharing, that greatly helped me to resolve the problem. now I am glad to share the latest fashionable news about the cheap jerseys with everyone. direct holidays

samooth6754 28 Dec 2011

fresno accounting

Hello Daria. I'm really impressed with your post here. Glad you came up with something like this. Can you give me more updates? I really need it. Thanks. I will be back for more of your posts.fresno accounting

Lucky127 04 Jan 2012

Nice post

That's a really sweet and full of an awesome time for me personally and my office colleagues to search your blog at the very least 3 times weekly to see the latest update you have got. We are gaining a lot of information through your blog
analysis essay , essay writers online , essays help , write my essay for me.

adamsavyer 19 Jan 2012

I love the way you write and

I love the way you write and share your niche! Very interesting and different! Keep it coming! Funny Clip

prince11 30 Jan 2012

Thank you.

Thank you for sharing it!
vent hood

serenali 11 Jun 2011

The post is written in very

The post is written in very a good manner and it contains many useful information for me....

anti-aging medical news

laserlight 09 Oct 2011

I wanted to thank you for

I wanted to thank you for this great read!! I definitely enjoying every little bit of it I have you bookmarked to check out new stuff you post........ grand rapids attorneys

laserlight 14 Oct 2011

Its a great pleasure reading

Its a great pleasure reading your post.Its full of information I am looking for and I love to post a comment that "The content of your post is awesome" Great work. iphone 4s jailbreak

jazzbee 17 Dec 2011

Thanks for sharing nice

Thanks for sharing nice information with us. i like your post and all you share with us is update and quite informative, i would like to bookmark the page so i can come here again to read you, as you have done a wonderful job. recover deleted files

jazzbee 19 Dec 2011

Great survey, I'm sure

Great survey, I'm sure you're getting a great response. snoring

prince11 20 Dec 2011

Wonderful illustrated

Wonderful illustrated information. I thank you about that. No doubt it will be very useful for my future projects. Would like to see some other posts on the same subject! Hemorrhoid Treatment

prince11 22 Dec 2011

It is a very good and

It is a very good and informative article about energy indeed. It is great to have such a nice articles about environmental friendly energy production. I hope to see more articles in future……
best ghost writers

adam7962 24 Dec 2011

Superbly written article, if

Superbly written article, if only all bloggers offered the same content as you, the internet would be a far better place. find jobs

prince11 24 Dec 2011

Houston Electricity

This is an good masterpiece. I am truly impressed. I would love to read more of your blogs. Please sustain posting. Keep up the good work. Houston Electricity

Lucky127 27 Dec 2011

Thank you for the good write

Thank you for the good write up. It in fact was a entertainment account it. Look complicated to far introduced agreeable from you! However, how can we keep in touch?

phlebotomy training

mehabuba 05 Jan 2012

apple cider vinegar benefits

I have not been able to find such kind of information throughout the search engines and internet.

cathy5077 15 Jan 2012

Celebrate Family Unity this

Celebrate Family Unity this Monday, Apr 18th. Join a Conference Call for Asian American & Pacific Islander Communities, hosted by... Rochville University AND Adisonhighschool AND Corllins University Review

markweee 16 Apr 2011

Thank you for sharing to us.there are many person searching

Thank you for sharing to us.there are many person searching about that now they will find enough resources by your post.I would like to join your blog anyway so please continue sharing with us ...

Wayfinding Signs

laserlight 17 Jul 2011

Great info you have placed.

Great info you have placed. I really enjoyed while reading this post. share more fantastic information for more knowledge.
Craigslist Dallas

greatroxen 20 Apr 2011

Hello, I love reading

Hello, I love reading through your post on how to build a PHP contact form with the Zoop Framework, I wanted to leave a little comment to support you and wish you a good continuation. Wishing you the best of luck for all your efforts. market samurai review / fat burning furnace reviews

danleyvilla 10 Aug 2011

This is a very informative

This is a very informative article.I was looking for these things and here I found it. I am doing a project and this information is very useful me. If you are interested, but this is my duty to inform you that virtual administrative assistant a very dedicated service and can be applied anywhere you want and get better results.
tom ford sunglasses

eavedrop44 27 Aug 2011

informative and interesting article

I found this an informative and interesting article so i think so it is very useful and knowledgeable. I would like to thank you for the work you have made in writing this article. I am wish the same best work from you in the future as well.PSD to HTML|PSD to HTML|PSD to Wordpress

ajeet 20 May 2011

Contact form using Zoop Framework

This is a great video. The new learners can get a lot of help from this video. It makes things very easy to understand... Zoop framework is really very promising and also very interesting. Building a contact form with Zoop is really a great idea.
ceramcor

luigisarabando 14 Jun 2011

Re:

I feel delighted to read such a good post. The author has done a great job in sharing this great piece of news with us through this blog. Thanks. Keep up the good work. medical supplies

jackbrown 24 Oct 2011

fotocamera

was that the night hount rang the train control during the middle of all that, and they rang back on the tunnel phone ?eiken balken

portugese tegels

fotocamera

Lucky127 05 Dec 2011

fotocamera

I suppose all people is blessed by way of completely different expertise. No longer wasting your expertise is a good techniques of being gratefull. It is best to boost you expertise so it is going to grants benefit.fotocamera
Zoekmachine optimalisatie

chalet

Lucky127 09 Dec 2011

what is seo

The information and the aspect were just wonderful. I think that your viewpoint is deep, it’s just well thought out and truly incredible to see someone who knows how to put these what is seo

sohaib2649 07 Jan 2012

When a browser loses its

When a browser loses its internet connection unexpectedly, Apache can't tell that the connection is dead, so waits as long as its Timeout directive for a packet to be received from the client.
App Marketing

daniel naveen 20 Jun 2011

This application stores its

This application stores its sessions in a post database.During the busy season, we would notice db back ends building up.
SEO quick tips

ranga rajan 20 Jun 2011

Nice to be visiting your

Nice to be visiting your blog again, it has been months for me. Well this article that i've been waited for so long.An absolutely terrible-looking video of The Wrestler's Mickey Rourke and Milk's Sean Penn thanking the Boston Society of Film Critics for the "discerning indecisiveness" that resulted in the org splitting the Best Actor award between these two. The BSFC ceremony was held at the Brattle Theatre on 2.8.09, the video was posted on 2.10.Ray Ban Sunglasses

zoopframe 22 Jun 2011

I tried the code that you've

I tried the code that you've provided and it was not working before. I had to search for alternative, but I took your example once again, it seemed to got the job done this time around... I hate to code but appreciate people like you who help us out...cheats on cityville

daisyrutter 22 Jun 2011

Good day I am so delighted I

Good day I am so delighted I found your weblog, I really found you by error, while I was researching on Askjeeve for something else, Regardless I am here now and would just like to say thanks a lot for a incredible post and a all round enjoyable blog (I also love the theme/design), I donâ t have time to read through it all at the minute but I have book-marked it and also added your RSS feeds, so when I have time I will be back to read a great deal more, Please do keep up the great job.
Lancaster PA Inn

lutonroy 22 Jun 2011

Quite good information

Quite good information shared here. PHP has provided so much facilities to the developers. Zoom framework has also done a great job regarding the PHP. Good to see this specific information.
security stickers

iamasterss 24 Jun 2011

This application stores its

This application stores its sessions in a postures database.During the busy season, we would notice db back ends building up.Eventually they could build up to the point where memory on the db server was exhausted and new connections would be rejected.
Omaha Water Treatment

ranga rajan 25 Jun 2011