PHP: Programming Bliss

At one time, I aspired to be a computer programmer; programming in c++, or visual basic was fun at one time. At the time, I did not realize how much more would be done with the internet. Designing and publishing, I started to teach myself. There has, however, always been this part of me that just wants to sit down and program something really useful. What could that be, I’m not sure, but it’s all good. Now that I’m a switcher from windows I wouldn’t know where to start when programming from os x.

After doing quite a bit of web design, and unknowingly getting yet others hooked on designing for the web, I decided to learn some server side programming. After asking other designers and programmers which language I should learn, out of Pearl, PHP, ColdFusion, and ASP, I was told PHP is the way to go. Shortly after, I ordered the PHP Bible and waited for the time and right opportunity to learn.

My First PHP

For the contact page on this site, I envisioned a simple test statement that would be used if the form was submitted. Here is the code.


<?php
($_GET['Sent']=$Sent);
($_GET['Name']=$Name);
if ($Sent == 1) {
?>

<h3>Comment Sent</h3>
<p>Thanks for taking time to drop us a line <?php echo $Name; ?>.</p>

<?php } else { ?>

<h4>We would like to hear you speak graphically.</h4>
<div class="contactform">
<form name="form1" method="post" action="mailaction.php">
<INPUT TYPE="hidden" NAME="recipient" VALUE="info@gs.designbymk.com">
<INPUT TYPE="hidden" NAME="subject" VALUE="Contact Graphically Speaking">

<p><label>Name</label><input name="realname" type="text" size="33" maxlength="33"></p>
<p><label>E-Mail</label><input name="email" type="text" size="33" maxlength="33"></p>
<p><label>Web Site</label><input name="website" type="text" size="33"></p>
<p><label>Comment</label><textarea name="textarea" cols="40" rows="15"></textarea></p>
<p><input type="submit" name="Submit" value="Submit"></p>
</form>
</div>
<?php } ?>

When the form passes the testing the redirect page is http://gs.designbymk.com/contact.html?Sent=1&Name=mk; that is the same contact page passing variables that is tested in the PHP if statement. Simple, yet powerful. I hope to incorporate other fun and useful techniques in to Graphically Speaking. To bad Movable Type is done in Perl.

This entry was posted in Technology, Web Design. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>