<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Nancy Fusco &#187; php</title>
	<atom:link href="http://nancyfusco.com/wp/index.php/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://nancyfusco.com/wp</link>
	<description></description>
	<lastBuildDate>Sun, 29 Apr 2012 14:45:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.4</generator>
		<item>
		<title>PHP form to email tutorial &#8211; Part 2 &#8211; Setting up the PHP</title>
		<link>http://nancyfusco.com/wp/index.php/2009/03/php-form-to-email-tutorial-part-2/</link>
		<comments>http://nancyfusco.com/wp/index.php/2009/03/php-form-to-email-tutorial-part-2/#comments</comments>
		<pubDate>Tue, 17 Mar 2009 15:08:50 +0000</pubDate>
		<dc:creator>Nancy</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[web design]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[scripts]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://nancyfusco.com/wp/?p=640</guid>
		<description><![CDATA[In Part 1 we setup the actual contact form using basic html form tags and form elements. Here in Part 2, we are going to setup the PHP code to receive the data (or info) from that contact form. Open up your html editor and create a new PHP page. Enter the following code bits, [...]]]></description>
			<content:encoded><![CDATA[<p>In <a href="http://nancyfusco.com/wp/index.php/2009/03/php-form-to-email-tutorial-part-1/" target="_blank">Part 1</a> we setup the actual contact form using basic html form tags and form elements.</p>
<p>Here in Part 2, we are going to setup the PHP code to receive the data (or info) from that contact form. Open up your html editor and create a new PHP page. Enter the following code bits, in order, within PHP tags.</p>
<p>First thing, define the variables. These will be the names of the fields exactly as they are in your contact form. In our example, we had 1 text input box called <b>cName</b> and 1 text area box called <b>notes</b>.</p>
<p>Let&#8217;s also add a few variables that we will use to send our contact form via email. We don&#8217;t need these over on the contact form, but we want to define them here so our PHP script can use them later on.<br />
<code>// define our variables, the info that we will be gathering from the form and any variables we want to use later in the script<br />
$EmailFrom = "youremail_here@where.com";<br />
$EmailTo = "youremail_here@where.com";<br />
$Subject = "Contact Form";<br />
$cName = Trim(stripslashes($_POST['cName']));<br />
$notes = Trim(stripslashes($_POST['notes'])); </code></p>
<p>It&#8217;s often handy to have the user&#8217;s IP address passed along for troubleshooting if needed, so let&#8217;s add in a variable for that:<br />
<code>$user_ip = ($_SERVER['X_FORWARDED_FOR']) ? $_SERVER['X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR'];</code></p>
<p>Ok, now that everything&#8217;s defined, let&#8217;s setup what the email message should look like when it&#8217;s received. <span id="more-640"></span> Here we are basically just formatting the look of the message body, making it more readable.<br />
<code>// formatting the data for the email message body<br />
$Body .= "Contact Name: ";<br />
$Body .= $cName;<br />
$Body .= "\n";<br />
$Body .= "Notes: ";<br />
$Body .= $notes;<br />
$Body .= "\n";<br />
$Body .= "Users IP: ";<br />
$Body .= $user_ip;<br />
$Body .= "\n";</code></p>
<p>Here is a quick check to see if a spambot is adding emails to our form. This is just a basic check, so at some point your going to want to make sure your form isn&#8217;t being used by a spammer. I will talk more about this in Part 3 &#8211; validation.</p>
<p>For now, let&#8217;s just do a simple check to see if an extra line or breaking space is being inserted in either the Name text box.<br />
<code>if ( ereg( "[\r\n]", $cName )) ) {</p>
<p>	//if spambot send directly to error page</p>
<p>	print "&lt;meta http-equiv=\"refresh\" content=\"0;URL=error.php\"&gt;" ;</code></p>
<p>Ok, so now that we&#8217;ve used an &#8220;if&#8221; statement to check and re-route to an error page if they are a spammer, what do we do if it&#8217;s ok to send the form? We use the &#8220;else&#8221; statement, like this:<br />
<code>// if all good then send our contact form via email and display the results</p>
<p>} else {</p>
<p>// send email to the address specified above and include the data<br />
$success = mail($EmailTo, $Subject, $Body, "From:youremail_here@where.com");</code><br />
And finally, we display the info that the user entered in the form as confirmation that it was sent and so they have a copy for their records. It also let&#8217;s us say &#8220;Thank you!&#8221; for sending the message:<br />
<code>// display results on page so the user has confirmation of their form details<br />
echo "&lt;h3&gt;Thank you! We have received your message!&lt;/h3&gt;";<br />
echo "&lt;br /&gt;";<br />
echo "&lt;br /&gt;";<br />
echo "&lt;p&gt;Hello ".$cName.", &lt;/p&gt;";<br />
echo "&lt;br /&gt;";<br />
echo "&lt;p&gt;Following are the details of your message:&lt;/p&gt;";<br />
echo "&lt;br /&gt;";<br />
echo "&lt;p&gt;".$cName."&lt;/p&gt;";<br />
echo "&lt;br /&gt;";<br />
echo "&lt;p&gt;Your message was: &lt;/p&gt;";<br />
echo "&lt;p&gt;<i>".$notes."</i>&lt;/p&gt;";<br />
echo "&lt;br /&gt;";<br />
}</code></p>
<p>So, that&#8217;s it! Not too bad right? Remember to type the code snippets above inside PHP tags and to save the file as adaction2.php before testing. If you want to change the name of this file, be sure and go back to your form and edit the form tag so it knows where to send this data:<br />
<code>&lt;form name="adReg" method="POST" action="adaction2.php"&gt;</code></p>
<p>To learn PHP in more detail, check out <a href="http://www.tizag.com/phpT/index.php" target="_blank">TiZag</a> &#8211; many props to TiZag &#8211; I learned more from his tutorials than anywhere on the web.</p>
<p>And to get some additional code samples, check out Steve&#8217;s site <a href="http://www.stevedawson.com/download.php" target="_blank">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://nancyfusco.com/wp/index.php/2009/03/php-form-to-email-tutorial-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP form to email tutorial &#8211; Part 1 &#8211; Setting up the form</title>
		<link>http://nancyfusco.com/wp/index.php/2009/03/php-form-to-email-tutorial-part-1/</link>
		<comments>http://nancyfusco.com/wp/index.php/2009/03/php-form-to-email-tutorial-part-1/#comments</comments>
		<pubDate>Mon, 16 Mar 2009 17:47:43 +0000</pubDate>
		<dc:creator>Nancy</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[web design]]></category>
		<category><![CDATA[form]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[scripts]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://nancyfusco.com/wp/?p=629</guid>
		<description><![CDATA[This weekend I did some volunteer work for a local non-profit by constructing an online form in php that would email from their website. I&#8217;m going to simplify that form and walk thru a tutorial to help you build your own online php forms. Part 1 will walk you thru setting up the actual form [...]]]></description>
			<content:encoded><![CDATA[<p>This weekend I did some volunteer work for a local non-profit by constructing an online form in php that would email from their website. I&#8217;m going to simplify that form and walk thru a tutorial to help you build your own online php forms.</p>
<p>Part 1 will walk you thru setting up the actual form to get it ready to be processed by the PHP script. The form just gets the information to the PHP script. </p>
<p><a href="http://nancyfusco.com/wp/index.php/2009/03/php-form-to-email-tutorial-part-2/" target="_blank">Part 2</a> will be the setup of the receiving PHP script, which will process the info from the form and email it.</p>
<p><a href="http://nancyfusco.com/wp/index.php/2009/03/php-form-to-email-tutorial-part-3/" target="_blank">Part 3</a> will look at client-side validation with Javascript.</p>
<p>Part 4 we will create a multiple choice input area for the user, and only emailing their selections in the form. We will do this by creating an Array.</p>
<p>Part 5 will create code to also email a confirmation to the user with the info they filled out.</p>
<p>A well designed form will set the stage for easy processing so, with that said, let&#8217;s dive into the form construction. <span id="more-629"></span></p>
<p>Open your html editor, for most it will be Dreamweaver or similar. I use <a href="http://quanta.kdewebdev.org/" target="_blank">Quanta+</a>, an open-source software for Linux. Create a new PHP document.</p>
<p>First, let&#8217;s add the form elements to our web page, take notice that we are defining the name, method, and action:<br />
<code>&lt;html&gt;<br />
&lt;head&gt;&lt;/head&gt;<br />
&lt;form name="adReg" method="POST" action="adaction2.php"&gt;<br />
&lt;/form&gt;<br />
&lt;/html&gt;</code></p>
<p>name = how we will refer to our form<br />
method = POST &#8211; how we will send our data over to PHP &#8211; this is the transport<br />
action = when a user clicks the Submit button, where the form should send it&#8217;s data.</p>
<p>Now, inside the form tags, let&#8217;s add just two items, keeping it simple for right now:<br />
<code>&lt;form name="adReg" method="POST" action="adaction2.php"&gt;<br />
Contact Name:<br />
&lt;input type="text" name="cName"&gt;<br />
Notes:<br />
&lt;textarea name="notes"&gt;&lt;/textarea&gt;<br />
&lt;/form&gt;</code></p>
<p>Notice again, we have to define the elements in our form so that in our PHP script we know how to refer to them.</p>
<p>All we need to do now is add in the Submit button and a few line breaks for spacing:</p>
<p><code>&lt;html&gt;<br />
&lt;head&gt;&lt;/head&gt;<br />
&lt;form name="adReg" method="POST" action="adaction2.php"&gt;<br />
Contact Name:<br />
&lt;br /&gt;<br />
&lt;input type="text" name="cName"&gt;<br />
&lt;br /&gt;<br />
Notes:<br />
&lt;br /&gt;<br />
&lt;textarea name="notes"&gt;&lt;/textarea&gt;<br />
&lt;br /&gt;<br />
&lt;input type="submit" name="submit" value="Submit"&gt;<br />
&lt;/form&gt;<br />
&lt;/html&gt;</code></p>
<p>Preview your PHP page and you should see this basic form:</p>
<form name="adReg" method="POST" action="adaction2.php">
Contact Name:<br />
</p>
<input type="text" name="cName">
<br />
Notes:<br />
<br />
<textarea name="notes"></textarea><br />
</p>
<input type="submit" name="submit" value="Submit">
</form>
<p>That&#8217;s it! Pretty easy right? Now if you click the Submit button above, it won&#8217;t actually do anything &#8211; yet &#8211; visit back for Part 2 where we will construct the actual PHP code that will take the info from the form we created and send it via email.</p>
]]></content:encoded>
			<wfw:commentRss>http://nancyfusco.com/wp/index.php/2009/03/php-form-to-email-tutorial-part-1/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>PHP script for calculating shipping based on weight and destination</title>
		<link>http://nancyfusco.com/wp/index.php/2009/02/php-script-for-calculating-shipping/</link>
		<comments>http://nancyfusco.com/wp/index.php/2009/02/php-script-for-calculating-shipping/#comments</comments>
		<pubDate>Mon, 23 Feb 2009 14:20:46 +0000</pubDate>
		<dc:creator>Nancy</dc:creator>
				<category><![CDATA[web design]]></category>
		<category><![CDATA[Web Projects]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[scripts]]></category>
		<category><![CDATA[shopping cart]]></category>

		<guid isPermaLink="false">http://nancyfusco.com/wp/?p=446</guid>
		<description><![CDATA[Developed this php script for one of my clients eCommerce sites. They needed their shopping cart to calculate shipping costs based on the weight of the item and the destination. And all US shipping was to be Free. Best application for this code is in Click Cart Pro version 6+ but here is the stand [...]]]></description>
			<content:encoded><![CDATA[<p>Developed this php script for one of my clients eCommerce sites. They needed their shopping cart to calculate shipping costs based on the weight of the item and the destination. And all US shipping was to be Free.  Best application for this code is in Click Cart Pro version 6+ but here is the stand alone code if you can benefit from it, go for it. I just ask that the credit stays in the comments. Just enclose the following code in php tags:</p>
<p>/* This script is a modification of the default Calculation On Total Item Weight. Script setup for FREE Shipping to all US delivery locations. All other delivery locations, worldwide, are calculated by Price Groups/Zones and Weight of the product. If the specific delivery location is not specified, the closing part of the script will include a flat rate. */</p>
<p>/* Code mods by themonarch with thanks to fazman at the CCP forums for the basic structure http://forum.kryptronic.com/viewtopic.php?id=18218 and this site for excellent php tutorials http://www.tizag.com */</p>
<p>// Definitions</p>
<p>$info = $this-&gt;globals(&#8216;ecom.customship&#8217;);</p>
<p>$method = &#8216;USPS/UPS Standard Shipping&#8217;;</p>
<p>$weight = $info['weight'];</p>
<p>// FREE SHIPPING USA ONLY</p>
<p>if ($info['country'] == &#8216;United States&#8217;) {</p>
<p>$custom = array($method =&gt; &#8217;0.00&#8242;);</p>
<p>// Price Group 1</p>
<p>} elseif (($weight &lt;= &#8217;3&#8242;) &amp;&amp; ($info['country'] == &#8216;Canada&#8217; || $info['country'] == &#8216;Virgin Islands     British&#8217; || $info['country'] == &#8216;Virgin Islands     US&#8217;)) {</p>
<p>$custom = array($method =&gt; &#8217;19.99&#8242;);<br />
<span id="more-446"></span><br />
} elseif (($weight &lt;= &#8217;7&#8242;) &amp;&amp; ($info['country'] == &#8216;Canada&#8217; || $info['country'] == &#8216;Virgin Islands     British&#8217; || $info['country'] == &#8216;Virgin Islands     US&#8217;)) {</p>
<p>$custom = array($method =&gt; &#8217;25.99&#8242;);</p>
<p>} elseif (($weight &lt;= &#8217;11&#8242;) &amp;&amp; ($info['country'] == &#8216;Canada&#8217; || $info['country'] == &#8216;Virgin Islands     British&#8217; || $info['country'] == &#8216;Virgin Islands     US&#8217;)) {</p>
<p>$custom = array($method =&gt; &#8217;27.99&#8242;);</p>
<p>} elseif (($weight &lt;= &#8217;20&#8242;) &amp;&amp; ($info['country'] == &#8216;Canada&#8217; || $info['country'] == &#8216;Virgin Islands     British&#8217; || $info['country'] == &#8216;Virgin Islands     US&#8217;)) {</p>
<p>$custom = array($method =&gt; &#8217;44.99&#8242;);</p>
<p>} elseif (($weight &lt;= &#8217;90&#8242;) &amp;&amp; ($info['country'] == &#8216;Canada&#8217; || $info['country'] == &#8216;Virgin Islands     British&#8217; || $info['country'] == &#8216;Virgin Islands US&#8217;)) {</p>
<p>$custom = array($method =&gt; &#8217;84.99&#8242;);</p>
<p>// Price Group 2</p>
<p>} elseif (($weight &lt;= &#8217;3&#8242;) &amp;&amp; ($info['country'] == &#8216;Mexico&#8217;)) {</p>
<p>$custom = array($method =&gt; &#8217;23.99&#8242;);</p>
<p>} elseif (($weight &lt;= &#8217;7&#8242;) &amp;&amp; ($info['country'] == &#8216;Mexico&#8217;)) {</p>
<p>$custom = array($method =&gt; &#8217;34.99&#8242;);</p>
<p>} elseif (($weight &lt;= &#8217;11&#8242;) &amp;&amp; ($info['country'] == &#8216;Mexico&#8217;)) {</p>
<p>$custom = array($method =&gt; &#8217;44.99&#8242;);</p>
<p>} elseif (($weight &lt;= &#8217;20&#8242;) &amp;&amp; ($info['country'] == &#8216;Mexico&#8217;)) {</p>
<p>$custom = array($method =&gt; &#8217;64.99&#8242;);</p>
<p>} elseif (($weight &lt;= &#8217;90&#8242;) &amp;&amp; ($info['country'] == &#8216;Mexico&#8217;)) {</p>
<p>$custom = array($method =&gt; &#8217;118.99&#8242;);</p>
<p>// Price Group 3</p>
<p>} elseif (($weight &lt;= &#8217;3&#8242;) &amp;&amp; ($info['country'] == &#8216;Australia&#8217; || $info['country'] ==</p>
<p>&#8216;China&#8217; || $info['country'] == &#8216;Hong Kong&#8217; || $info['country'] == &#8216;Japan&#8217;)) {</p>
<p>$custom = array($method =&gt; &#8217;31.99&#8242;);</p>
<p>} elseif (($weight &lt;= &#8217;7&#8242;) &amp;&amp; ($info['country'] == &#8216;Australia&#8217; || $info['country'] ==</p>
<p>&#8216;China&#8217; || $info['country'] == &#8216;Hong Kong&#8217; || $info['country'] == &#8216;Japan&#8217;)) {</p>
<p>$custom = array($method =&gt; &#8217;48.99&#8242;);</p>
<p>} elseif (($weight &lt;= &#8217;11&#8242;) &amp;&amp; ($info['country'] == &#8216;Australia&#8217; || $info['country'] ==</p>
<p>&#8216;China&#8217; || $info['country'] == &#8216;Hong Kong&#8217; || $info['country'] == &#8216;Japan&#8217;)) {</p>
<p>$custom = array($method =&gt; &#8217;51.99&#8242;);</p>
<p>} elseif (($weight &lt;= &#8217;20&#8242;) &amp;&amp; ($info['country'] == &#8216;Australia&#8217; || $info['country'] ==</p>
<p>&#8216;China&#8217; || $info['country'] == &#8216;Hong Kong&#8217; || $info['country'] == &#8216;Japan&#8217;)) {</p>
<p>$custom = array($method =&gt; &#8217;92.99&#8242;);</p>
<p>} elseif (($weight &lt;= &#8217;91&#8242;) &amp;&amp; ($info['country'] == &#8216;Australia&#8217; || $info['country'] ==</p>
<p>&#8216;China&#8217; || $info['country'] == &#8216;Hong Kong&#8217; || $info['country'] == &#8216;Japan&#8217;)) {</p>
<p>$custom = array($method =&gt; &#8217;186.99&#8242;);</p>
<p>// Price Group 4</p>
<p>} elseif (($weight &lt;= &#8217;3&#8242;) &amp;&amp; ($info['country'] == &#8216;Czech Republic&#8217; || $info['country'] == &#8216;Hungary&#8217; || $info['country'] == &#8216;Romania&#8217; || $info['country'] == &#8216;Poland&#8217;)) {</p>
<p>$custom = array($method =&gt; &#8217;27.99&#8242;);</p>
<p>} elseif (($weight &lt;= &#8217;7&#8242;) &amp;&amp; ($info['country'] == &#8216;Czech Republic&#8217; || $info['country'] == &#8216;Hungary&#8217; || $info['country'] == &#8216;Romania&#8217; || $info['country'] == &#8216;Poland&#8217;)) {</p>
<p>$custom = array($method =&gt; &#8217;39.99&#8242;);</p>
<p>} elseif (($weight &lt;= &#8217;11&#8242;) &amp;&amp; ($info['country'] == &#8216;Czech Republic&#8217; || $info['country'] == &#8216;Hungary&#8217; || $info['country'] == &#8216;Romania&#8217; || $info['country'] == &#8216;Poland&#8217;)) {</p>
<p>$custom = array($method =&gt; &#8217;44.99&#8242;);</p>
<p>} elseif (($weight &lt;= &#8217;20&#8242;) &amp;&amp; ($info['country'] == &#8216;Czech Republic&#8217; || $info['country'] == &#8216;Hungary&#8217; || $info['country'] == &#8216;Romania&#8217; || $info['country'] == &#8216;Poland&#8217;)) {</p>
<p>$custom = array($method =&gt; &#8217;84.99&#8242;);</p>
<p>} elseif (($weight &lt;= &#8217;91&#8242;) &amp;&amp; ($info['country'] == &#8216;Czech Republic&#8217; || $info['country'] == &#8216;Hungary&#8217; || $info['country'] == &#8216;Romania&#8217; || $info['country'] == &#8216;Poland&#8217;)) {</p>
<p>$custom = array($method =&gt; &#8217;178.99&#8242;);</p>
<p>// Price Group 5</p>
<p>} elseif (($weight &lt;= &#8217;3&#8242;) &amp;&amp; ($info['country'] == &#8216;Austria&#8217; || $info['country'] == &#8216;Belgium&#8217; || $info['country'] == &#8216;Denmark&#8217; || $info['country'] == &#8216;Finland&#8217; || $info['country'] == &#8216;France&#8217; || $info['country'] == &#8216;Germany&#8217; || $info['country'] == &#8216;United Kingdom&#8217; || $info['country'] == &#8216;Greece&#8217; || $info['country'] == &#8216;Ireland&#8217; || $info['country'] == &#8216;Netherlands&#8217; || $info['country'] == &#8216;Norway&#8217; || $info['country'] == &#8216;Spain&#8217; || $info['country'] == &#8216;Sweden&#8217; || $info['country'] == &#8216;Liechtenstein&#8217; || $info['country'] == &#8216;Switzerland&#8217;)) {</p>
<p>$custom = array($method =&gt; &#8217;25.99&#8242;);</p>
<p>} elseif (($weight &lt;= &#8217;7&#8242;) &amp;&amp; ($info['country'] == &#8216;Austria&#8217; || $info['country'] == &#8216;Belgium&#8217; || $info['country'] == &#8216;Denmark&#8217; || $info['country'] == &#8216;Finland&#8217; || $info['country'] == &#8216;France&#8217; || $info['country'] == &#8216;Germany&#8217; || $info['country'] == &#8216;United Kingdom&#8217; || $info['country'] == &#8216;Greece&#8217; || $info['country'] == &#8216;Ireland&#8217; || $info['country'] == &#8216;Netherlands&#8217; || $info['country'] == &#8216;Norway&#8217; || $info['country'] == &#8216;Spain&#8217; || $info['country'] == &#8216;Sweden&#8217; || $info['country'] == &#8216;Liechtenstein&#8217; || $info['country'] == &#8216;Switzerland&#8217;)) {</p>
<p>$custom = array($method =&gt; &#8217;25.99&#8242;);</p>
<p>} elseif (($weight &lt;= &#8217;11&#8242;) &amp;&amp; ($info['country'] == &#8216;Austria&#8217; || $info['country'] == &#8216;Belgium&#8217; || $info['country'] == &#8216;Denmark&#8217; || $info['country'] == &#8216;Finland&#8217; || $info['country'] == &#8216;France&#8217; || $info['country'] == &#8216;Germany&#8217; || $info['country'] == &#8216;United Kingdom&#8217; || $info['country'] == &#8216;Greece&#8217; || $info['country'] == &#8216;Ireland&#8217; || $info['country'] == &#8216;Netherlands&#8217; || $info['country'] == &#8216;Norway&#8217; || $info['country'] == &#8216;Spain&#8217; || $info['country'] == &#8216;Sweden&#8217; || $info['country'] == &#8216;Liechtenstein&#8217; || $info['country'] == &#8216;Switzerland&#8217;)) {</p>
<p>$custom = array($method =&gt; &#8217;25.99&#8242;);</p>
<p>} elseif (($weight &lt;= &#8217;20&#8242;) &amp;&amp; ($info['country'] == &#8216;Austria&#8217; || $info['country'] == &#8216;Belgium&#8217; || $info['country'] == &#8216;Denmark&#8217; || $info['country'] == &#8216;Finland&#8217; || $info['country'] == &#8216;France&#8217; || $info['country'] == &#8216;Germany&#8217; || $info['country'] == &#8216;United Kingdom&#8217; || $info['country'] == &#8216;Greece&#8217; || $info['country'] == &#8216;Ireland&#8217; || $info['country'] == &#8216;Netherlands&#8217; || $info['country'] == &#8216;Norway&#8217; || $info['country'] == &#8216;Spain&#8217; || $info['country'] == &#8216;Sweden&#8217; || $info['country'] == &#8216;Liechtenstein&#8217; || $info['country'] == &#8216;Switzerland&#8217;)) {</p>
<p>$custom = array($method =&gt; &#8217;25.99&#8242;);<br />
} elseif (($weight &lt;= &#8217;91&#8242;) &amp;&amp; ($info['country'] == &#8216;Austria&#8217; || $info['country'] == &#8216;Belgium&#8217; || $info['country'] == &#8216;Denmark&#8217; || $info['country'] == &#8216;Finland&#8217; || $info['country'] == &#8216;France&#8217; || $info['country'] == &#8216;Germany&#8217; || $info['country'] == &#8216;United Kingdom&#8217; || $info['country'] == &#8216;Greece&#8217; || $info['country'] == &#8216;Ireland&#8217; || $info['country'] == &#8216;Netherlands&#8217; || $info['country'] == &#8216;Norway&#8217; || $info['country'] == &#8216;Spain&#8217; || $info['country'] == &#8216;Sweden&#8217; || $info['country'] == &#8216;Liechtenstein&#8217; || $info['country'] == &#8216;Switzerland&#8217;)) {</p>
<p>$custom = array($method =&gt; &#8217;25.99&#8242;);</p>
<p>// Price Group 6</p>
<p>} elseif (($weight &lt;= &#8217;3&#8242;) &amp;&amp; ($info['country'] == &#8216;India&#8217; || $info['country'] == &#8216;Indonesia&#8217; || $info['country'] == &#8216;New Zealand&#8217; || $info['country'] == &#8216;Singapore&#8217; || $info['country'] == &#8216;Taiwan&#8217; || $info['country'] == &#8216;Vietnam&#8217; || $info['country'] == &#8216;Thailand&#8217;)) {</p>
<p>$custom = array($method =&gt; &#8217;25.99&#8242;);</p>
<p>} elseif (($weight &lt;= &#8217;7&#8242;) &amp;&amp; ($info['country'] == &#8216;India&#8217; || $info['country'] == &#8216;Indonesia&#8217; || $info['country'] == &#8216;New Zealand&#8217; || $info['country'] == &#8216;Singapore&#8217; || $info['country'] == &#8216;Taiwan&#8217; || $info['country'] == &#8216;Vietnam&#8217; || $info['country'] == &#8216;Thailand&#8217;)) {</p>
<p>$custom = array($method =&gt; &#8217;25.99&#8242;);</p>
<p>} elseif (($weight &lt;= &#8217;11&#8242;) &amp;&amp; ($info['country'] == &#8216;India&#8217; || $info['country'] == &#8216;Indonesia&#8217; || $info['country'] == &#8216;New Zealand&#8217; || $info['country'] == &#8216;Singapore&#8217; || $info['country'] == &#8216;Taiwan&#8217; || $info['country'] == &#8216;Vietnam&#8217; || $info['country'] == &#8216;Thailand&#8217;)) {</p>
<p>$custom = array($method =&gt; &#8217;25.99&#8242;);</p>
<p>} elseif (($weight &lt;= &#8217;20&#8242;) &amp;&amp; ($info['country'] == &#8216;India&#8217; || $info['country'] == &#8216;Indonesia&#8217; || $info['country'] == &#8216;New Zealand&#8217; || $info['country'] == &#8216;Singapore&#8217; || $info['country'] == &#8216;Taiwan&#8217; || $info['country'] == &#8216;Vietnam&#8217; || $info['country'] == &#8216;Thailand&#8217;)) {</p>
<p>$custom = array($method =&gt; &#8217;25.99&#8242;);</p>
<p>} elseif (($weight &lt;= &#8217;91&#8242;) &amp;&amp; ($info['country'] == &#8216;India&#8217; || $info['country'] == &#8216;Indonesia&#8217; || $info['country'] == &#8216;New Zealand&#8217; || $info['country'] == &#8216;Singapore&#8217; || $info['country'] == &#8216;Taiwan&#8217; || $info['country'] == &#8216;Vietnam&#8217; || $info['country'] == &#8216;Thailand&#8217;)) {</p>
<p>$custom = array($method =&gt; &#8217;25.99&#8242;);</p>
<p>// Price Group 7</p>
<p>} elseif (($weight &lt;= &#8217;3&#8242;) &amp;&amp; ($info['country'] == &#8216;South Africa&#8217;)) {</p>
<p>$custom = array($method =&gt; &#8217;25.99&#8242;);</p>
<p>} elseif (($weight &lt;= &#8217;7&#8242;) &amp;&amp; ($info['country'] == &#8216;South Africa&#8217;)) {</p>
<p>$custom = array($method =&gt; &#8217;25.99&#8242;);</p>
<p>} elseif (($weight &lt;= &#8217;11&#8242;) &amp;&amp; ($info['country'] == &#8216;South Africa&#8217;)) {</p>
<p>$custom = array($method =&gt; &#8217;25.99&#8242;);</p>
<p>} elseif (($weight &lt;= &#8217;20&#8242;) &amp;&amp; ($info['country'] == &#8216;South Africa&#8217;)) {</p>
<p>$custom = array($method =&gt; &#8217;25.99&#8242;);</p>
<p>} elseif (($weight &lt;= &#8217;91&#8242;) &amp;&amp; ($info['country'] == &#8216;South Africa&#8217;)) {</p>
<p>$custom = array($method =&gt; &#8217;25.99&#8242;);</p>
<p>// Price Group 8</p>
<p>} elseif (($weight &lt;= &#8217;3&#8242;) &amp;&amp; ($info['country'] == &#8216;Egypt&#8217; || $info['country'] ==</p>
<p>&#8216;Israel&#8217; || $info['country'] == &#8216;Saudi Arabia&#8217; || $info['country'] == &#8216;United Arab Emirates&#8217;)) {</p>
<p>$custom = array($method =&gt; &#8217;25.99&#8242;);</p>
<p>} elseif (($weight &lt;= &#8217;7&#8242;) &amp;&amp; ($info['country'] == &#8216;Egypt&#8217; || $info['country'] ==</p>
<p>&#8216;Israel&#8217; || $info['country'] == &#8216;Saudi Arabia&#8217; || $info['country'] == &#8216;United Arab Emirates&#8217;)) {</p>
<p>$custom = array($method =&gt; &#8217;25.99&#8242;);</p>
<p>} elseif (($weight &lt;= &#8217;11&#8242;) &amp;&amp; ($info['country'] == &#8216;Egypt&#8217; || $info['country'] ==</p>
<p>&#8216;Israel&#8217; || $info['country'] == &#8216;Saudi Arabia&#8217; || $info['country'] == &#8216;United Arab Emirates&#8217;)) {</p>
<p>$custom = array($method =&gt; &#8217;25.99&#8242;);</p>
<p>} elseif (($weight &lt;= &#8217;20&#8242;) &amp;&amp; ($info['country'] == &#8216;Egypt&#8217; || $info['country'] ==</p>
<p>&#8216;Israel&#8217; || $info['country'] == &#8216;Saudi Arabia&#8217; || $info['country'] == &#8216;United Arab Emirates&#8217;)) {</p>
<p>$custom = array($method =&gt; &#8217;25.99&#8242;);</p>
<p>} elseif (($weight &lt;= &#8217;91&#8242;) &amp;&amp; ($info['country'] == &#8216;Egypt&#8217; || $info['country'] ==</p>
<p>&#8216;Israel&#8217; || $info['country'] == &#8216;Saudi Arabia&#8217; || $info['country'] == &#8216;United Arab Emirates&#8217;)) {</p>
<p>$custom = array($method =&gt; &#8217;25.99&#8242;);</p>
<p>// Price Group 9</p>
<p>} elseif (($weight &lt;= &#8217;3&#8242;) &amp;&amp; ($info['country'] == &#8216;Argentina&#8217; || $info['country'] ==<br />
&#8216;Bahamas&#8217; || $info['country'] == &#8216;Bermuda&#8217; || $info['country'] == &#8216;Brazil&#8217; || $info['country'] == &#8216;Chile&#8217;<br />
|| $info['country'] == &#8216;Colombia&#8217; || $info['country'] == &#8216;Jamaica&#8217; || $info['country'] == &#8216;Panama&#8217; || $info['country'] == &#8216;Peru&#8217; || $info['country'] == &#8216;Venezuela&#8217;)) {</p>
<p>$custom = array($method =&gt; &#8217;25.99&#8242;);</p>
<p>} elseif (($weight &lt;= &#8217;7&#8242;) &amp;&amp; ($info['country'] == &#8216;Argentina&#8217; || $info['country'] ==<br />
&#8216;Bahamas&#8217; || $info['country'] == &#8216;Bermuda&#8217; || $info['country'] == &#8216;Brazil&#8217; || $info['country'] == &#8216;Chile&#8217;<br />
|| $info['country'] == &#8216;Colombia&#8217; || $info['country'] == &#8216;Jamaica&#8217; || $info['country'] == &#8216;Panama&#8217; || $info['country'] == &#8216;Peru&#8217; || $info['country'] == &#8216;Venezuela&#8217;)) {</p>
<p>$custom = array($method =&gt; &#8217;25.99&#8242;);</p>
<p>} elseif (($weight &lt;= &#8217;11&#8242;) &amp;&amp; ($info['country'] == &#8216;Argentina&#8217; || $info['country'] ==<br />
&#8216;Bahamas&#8217; || $info['country'] == &#8216;Bermuda&#8217; || $info['country'] == &#8216;Brazil&#8217; || $info['country'] == &#8216;Chile&#8217;<br />
|| $info['country'] == &#8216;Colombia&#8217; || $info['country'] == &#8216;Jamaica&#8217; || $info['country'] == &#8216;Panama&#8217; || $info['country'] == &#8216;Peru&#8217; || $info['country'] == &#8216;Venezuela&#8217;)) {</p>
<p>$custom = array($method =&gt; &#8217;25.99&#8242;);</p>
<p>} elseif (($weight &lt;= &#8217;20&#8242;) &amp;&amp; ($info['country'] == &#8216;Argentina&#8217; || $info['country'] ==<br />
&#8216;Bahamas&#8217; || $info['country'] == &#8216;Bermuda&#8217; || $info['country'] == &#8216;Brazil&#8217; || $info['country'] == &#8216;Chile&#8217;<br />
|| $info['country'] == &#8216;Colombia&#8217; || $info['country'] == &#8216;Jamaica&#8217; || $info['country'] == &#8216;Panama&#8217; || $info['country'] == &#8216;Peru&#8217; || $info['country'] == &#8216;Venezuela&#8217;)) {</p>
<p>$custom = array($method =&gt; &#8217;25.99&#8242;);</p>
<p>} elseif (($weight &lt;= &#8217;91&#8242;) &amp;&amp; ($info['country'] == &#8216;Argentina&#8217; || $info['country'] ==<br />
&#8216;Bahamas&#8217; || $info['country'] == &#8216;Bermuda&#8217; || $info['country'] == &#8216;Brazil&#8217; || $info['country'] == &#8216;Chile&#8217;<br />
|| $info['country'] == &#8216;Colombia&#8217; || $info['country'] == &#8216;Jamaica&#8217; || $info['country'] == &#8216;Panama&#8217; || $info['country'] == &#8216;Peru&#8217; || $info['country'] == &#8216;Venezuela&#8217;)) {</p>
<p>$custom = array($method =&gt; &#8217;25.99&#8242;);</p>
<p>// Default Shipping Cost Any Other Country</p>
<p>} else {</p>
<p>$custom = array($method =&gt; &#8217;55.00&#8242;);</p>
<p>}</p>
<p>// Closing Returns</p>
<p>$this-&gt;globals(&#8216;ecom.customship_response&#8217;,$custom);</p>
]]></content:encoded>
			<wfw:commentRss>http://nancyfusco.com/wp/index.php/2009/02/php-script-for-calculating-shipping/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>wvoheater project</title>
		<link>http://nancyfusco.com/wp/index.php/2009/01/wvoheater-project/</link>
		<comments>http://nancyfusco.com/wp/index.php/2009/01/wvoheater-project/#comments</comments>
		<pubDate>Mon, 19 Jan 2009 19:03:25 +0000</pubDate>
		<dc:creator>Nancy</dc:creator>
				<category><![CDATA[Web Projects]]></category>
		<category><![CDATA[cart]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[project]]></category>
		<category><![CDATA[shopping]]></category>

		<guid isPermaLink="false">http://nancyfusco.com/wp/?p=51</guid>
		<description><![CDATA[Web Development project completed in July 2008 for wvoheater.com. Following is the specifications outline of the project. I like to make these outlines before typing one line of code to make sure that the customer and I are on the same page for accomplishing the target objectives. Implementation Project Plan Shopping Cart System Introduction PHP [...]]]></description>
			<content:encoded><![CDATA[<p>Web Development project completed in July 2008 for <a href="http://www.wvoheater.com/store/index.php" target="_blank">wvoheater.com</a>. Following is the specifications outline of the project. <span id="more-51"></span> I like to make these outlines before typing one line of code to make sure that the customer and I are on the same page for accomplishing the target objectives.</p>
<h2>Implementation Project Plan<br />
Shopping Cart System</h2>
<h3>Introduction</h3>
<p>PHP Code, Database setup &amp; population, UI graphics, XHTML, and CSS design and development of web based shopping cart front-end and web based shopping cart administration area back-end.</p>
<h3>Project Timeline</h3>
<p>1.Design/color-scheme, CSS style sheets, layout structures, html text and graphics for UI, can commence on Thursday, XXXXX, 2008 and be completed by Friday, XXXXX, 2008.<br />
2.Database setup, population of categories/products, assignment of categories, featured products, cross-selling of products, can commence on Monday, XXXXX, 2008 and can be completed by Thursday, July XXXXX, 2008.<br />
3.Shopping cart code outline, writing, implementation and testing can commence on Monday, XXXXX, 2008 and be completed by Wednesday, XXXXX, 2008.<br />
4.Optimizing UI, code simplification, menu systems, and breadcrumbs throughout site can commence on Sunday, XXXXX, 2008 and can be completed by Monday, XXXXX, 2008.<br />
5.Shipping costs/rates configuration and specific code scripts for real-time calculation can commence on Monday, XXXXX, 2008 and can be completed by Wednesday, XXXXX, 2008.<br />
6.Final edits/adjustments/changes to any aspect of the shopping cart implementation to be completed by Tuesday, XXXXX, 2008.</p>
<h3>Project Specifications</h3>
<p>Discounts, Sales and Taxes<br />
Support for the entry of discount codes at checkout.<br />
Discount codes are set up using the web-based management interface.<br />
Discount codes can be set to expire one use or be of the non-expiring type.<br />
Discount codes can include/exclude certain items at the administrator&#8217;s discretion.<br />
Discounts can be done as a currency amount or percentage of the items ordered.<br />
Unused portions of currency amount discounts are saved for future use.<br />
Custom sale logic allows the administrator to use custom scripts to calculate sales at checkout.<br />
Taxes can be calculated for both State/Provinces and Countries.<br />
Items can be marked individually as tax exempt.<br />
Multiple taxation localities are supported.<br />
Payment processed securely thru PayPal API.</p>
<h4>Order Management, Reporting and Accounting Exports</h4>
<p>Order management functions include a fully searchable database table, the ability to enter shipping tracking numbers for ordered items and the ability to include comments.<br />
Customers have the ability to track their orders realtime using the front-end.<br />
Administrator based reports include: Administrator Access Log, Page View Reports and Daily, Month and Yearly Activity Reports<br />
Accounting exports are available for both Quickbooks &amp; Peachtree.<br />
Customer Care and Retention<br />
The program uses both cookies and URL management to ensure customer shopping carts are retained throughout the shopping experience.<br />
Customer account functions allow customers to set up accounts, edit them and retrieve lost passwords.<br />
Customers with accounts can save wishlists and address books as well as have full management of their accounts.<br />
Both the front-end and management interface have contact modules that allow for email based communication between customers and administrators.<br />
The program is delivered with a full-blown mail list program that allows the administrator to send text-only and/or XHTML-based email messages to subscribers.<br />
The mail list function allows customers to subscribe/unsubscribe via simple account links.</p>
<h4>Wholesale and Affiliate Systems</h4>
<p>The program comes with built-in affiliate and wholesale systems.<br />
At the administrator&#8217;s discretion, maximum payouts per order based on a currency amount or percentage can be set.<br />
The management interface has functions to activate affiliates and wholesalers and assign commission levels.<br />
Affiliate front-end functions include account upgrade requests, lost password retrieval, linking information and order &amp; sales reports.<br />
Set affiliate commissions and wholesale prices on either the product level or globally per-affiliate or per-wholesaler</p>
<h4>Dynamic Forms and Remote APIs</h4>
<p>Dynamic form function that allows for the setup of web-based forms using a simple management interface.<br />
Choose what types of form fields to present, the questions asked and the email address to which results from each form are sent.<br />
The shopping cart function has a remote API that allows for shopping cart additions to originate from outside HTML pages.</p>
<h4>Order Management, Reporting and Accounting Exports</h4>
<p>Order management functions include a fully searchable database table, the ability to enter shipping tracking numbers for ordered items and the ability to include comments.<br />
Customers have the ability to track their orders realtime using the front-end.<br />
Administrator based reports include: Administrator Access Log, Page View Reports and Daily, Month and Yearly Activity Reports<br />
Accounting exports are available for both Quickbooks &amp; Peachtree.</p>
<h4>Customer Care and Retention</h4>
<p>The program uses both cookies and URL management to ensure customer shopping carts are retained throughout the shopping experience.<br />
Customer account functions allow customers to set up accounts, edit them and retrieve lost passwords.<br />
Customers with accounts can save wishlists and address books as well as have full management of their accounts.<br />
Both the front-end and management interface have contact modules that allow for email based communication between customers and administrators.<br />
The program is delivered with a full-blown mail list program that allows the administrator to send text-only and/or XHTML-based email messages to subscribers.<br />
The mail list function allows customers to subscribe/unsubscribe via simple account links.</p>
<h4>Wholesale and Affiliate Systems</h4>
<p>The program comes with built-in affiliate and wholesale systems.<br />
At the administrator&#8217;s discretion, maximum payouts per order based on a currency amount or percentage can be set.<br />
The management interface has functions to activate affiliates and wholesalers and assign commission levels.<br />
Affiliate front-end functions include account upgrade requests, lost password retrieval, linking information and order &amp; sales reports.<br />
Set affiliate commissions and wholesale prices on either the product level or globally per-affiliate or per-wholesaler</p>
<h4>Web-Based Management Interface</h4>
<p>All configuration and modifications to the shopping cart will be web-based, thru a secure administration area off the main website.<br />
Password-protected, MD5 hash encryption, administrative access.<br />
Manage your site from anywhere &#8211; all you need is an Internet connection.<br />
Set up multiple users and user groups with different levels of access.<br />
Make changes to the site in real time.</p>
<h4>File Management Functions</h4>
<p>Full file management functions will be available within the web-based management interface.<br />
The management interface will have functions to upload and manage image and media files and to associated these files with specific products.<br />
The management interface will have functions to upload and manage downloadable files available for purchase as a product.</p>
<h4>Operating/Web Server Platform</h4>
<p>Unix/Linux Apache Server</p>
<h4>Database/Language Platform</h4>
<p>MySQL/PHP</p>
<h4>PHP Configuration</h4>
<p>PHP version: PHP 4.3.0 or newer including PHP5.<br />
PHP.ini: safe_mode set to Off.<br />
PHP.ini: magic_quotes_runtime set to Off.<br />
PHP.ini: file_uploads set to On.<br />
PHP extension: cURL must be loaded.</p>
<h4>Mail Configuration</h4>
<p>Sending mail via an SMTP server (authorization supported) and as a backup sending mail via the sendmail executable.</p>
]]></content:encoded>
			<wfw:commentRss>http://nancyfusco.com/wp/index.php/2009/01/wvoheater-project/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

