<?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>phpPig</title>
	<atom:link href="http://phppig.org/feed/" rel="self" type="application/rss+xml" />
	<link>http://phppig.org</link>
	<description>PHP scripts and code to help newbies</description>
	<lastBuildDate>Mon, 25 Jul 2011 07:50:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Using In-Browser FTP to manage files on server</title>
		<link>http://phppig.org/220/using-in-browser-ftp-to-manage-files-on-server/</link>
		<comments>http://phppig.org/220/using-in-browser-ftp-to-manage-files-on-server/#comments</comments>
		<pubDate>Mon, 25 Jul 2011 07:50:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Scripts]]></category>

		<guid isPermaLink="false">http://phppig.org/?p=220</guid>
		<description><![CDATA[<p>For the past few months, I have been looking at options to give me an in-browser method of editing/uploading files on my server because I am having to cut costs and get rid of my ISP (namely, HughesNet). Where I live it, we are in an extremely rural area and haven&#8217;t been able to get highspeed <span style="color:#777"> . . . &#8594; Read More: <a href="http://phppig.org/220/using-in-browser-ftp-to-manage-files-on-server/">Using In-Browser FTP to manage files on server</a></span>]]></description>
			<content:encoded><![CDATA[<p>For the past few months, I have been looking at options to give me an in-browser method of editing/uploading files on my server because I am having to cut costs and get rid of my ISP (namely, HughesNet). Where I live it, we are in an extremely rural area and haven&#8217;t been able to get highspeed access to the internet without using one of the satellite service providers. Due to the limitations on the service, I have been really been bound to what I could or couldn&#8217;t do online.</p>
<p>Two months ago, AT&#038;T Wireless upgraded our cellphone towers to 3G. Having an iPhone and having downloaded HandyLight in the few hours it was available through the iTunes store, I have been looking for a method of being able to FTP in files and folders to my server through the data connection established with my iPhone (I do have the unlimited data plan on my iPhone and needed a method to utilize this in the fullest capabilities.)</p>
<p>I have tried and tried to find a way to make it work and was just about to throw in the towel when I came across a site that had the exact solution to my problem. <a href="http://www.gerd-tentler.de/tools/filemanager/" target="_blank">FileManager</a> was the answer to my problems. Installing it on my server and integrating it into my homepage was rather simple. All I have to do now is visit my homepage with the data connection from my iPhone and the index page initializes my FTP session in the browser. And using a zip and unzip php script, it takes a lot less time to upload a new folder to the server because I can upload the zip file the decompress on the server.</p>
<p>I can now say goodbye to HughesNet and their high priced/low quality service and hello to a much more efficient and cost effective method of conducting my business online.</p>
<p>For those of you who have HandyLight and have been looking for a way to FTP in and out of a server with it, try this out. I have the homepage protected using .htaccess/.htpasswd to keep others out.</p>
<p>This would also work great if you need to edit or upload files from a public computer or other device. It is a perfect method for you to work on your websites from work, too! ;D</p>
]]></content:encoded>
			<wfw:commentRss>http://phppig.org/220/using-in-browser-ftp-to-manage-files-on-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating basic admin section (part 2 of building full php script)</title>
		<link>http://phppig.org/203/creating-basic-admin-section-part-2-of-building-full-php-script/</link>
		<comments>http://phppig.org/203/creating-basic-admin-section-part-2-of-building-full-php-script/#comments</comments>
		<pubDate>Tue, 31 Aug 2010 23:53:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Scripts]]></category>

		<guid isPermaLink="false">http://phppig.org/?p=203</guid>
		<description><![CDATA[<p>In the first article, we created the entire install script while creating a database and writing the config and .htaccess files for the site. (Files will be written when install script is run.)</p>
<p>We now need to have a way to add posts, pages, and items to our database, as well as edit our site&#8217;s details and <span style="color:#777"> . . . &#8594; Read More: <a href="http://phppig.org/203/creating-basic-admin-section-part-2-of-building-full-php-script/">Creating basic admin section (part 2 of building full php script)</a></span>]]></description>
			<content:encoded><![CDATA[<p>In the first article, we created the entire install script while creating a database and writing the config and .htaccess files for the site. (Files will be written when install script is run.)</p>
<p>We now need to have a way to add posts, pages, and items to our database, as well as edit our site&#8217;s details and to add our homepage and paypal address information.</p>
<p>Before we get started, you will need to download the <a href="http://tinymce.moxiecode.com/download.php">TinyMCE</a> open source editor to make adding pages a snap without having to know a bit of html. The first file that we are going write is our index.php file. Go ahead and save the file to Script->admin->index.php.<br />
<code><br />
&lt;?php<br />
 session_start();<br />
 ob_start();<br />
 define( 'ADMIN_ACCESS', 1 );<br />
 $inscript = true;<br />
 include_once('../inc/config.php');<br />
 include_once('../inc/functions.php');<br />
 include_once('./admin-titles.php');<br />
 //login checker<br />
 include_once('./admin-login.php');<br />
 $sql = mysql_query("SELECT `reported` FROM `".$SQL_Ext."_media` WHERE `reported` = '1'");<br />
 $reported = @mysql_num_rows($sql);<br />
 $sql = mysql_query("SELECT `published` FROM `".$SQL_Ext."_media` WHERE `published` = '0'");<br />
 $pending = @mysql_num_rows($sql);<br />
 $idblah = $_GET['id'];<br />
 $pos = strpos($idblah, "UNION SELECT");<br />
 if ($pos === false) {}<br />
 else { echo 'error'; }<br />
 $idblah = $_GET['action'];<br />
 $pos = strpos($idblah, "UNION SELECT");<br />
 if ($pos === false) {}<br />
 else { echo 'error'; }<br />
 $action = makesafe($_GET['action']);<br />
 $id     = intval($_GET['id']);<br />
?&gt;<br />
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;<br />
&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;<br />
&lt;head&gt;<br />
&lt;title&gt;&lt;?php admin_title($action)?&gt;&lt;/title&gt;<br />
&lt;? include('./images/style.css'); ?&gt;<br />
&lt;script&gt;<br />
 function selectText(){<br />
 document.sitemap.sitemap.focus();<br />
 document.sitemap.sitemap.select();<br />
 }<br />
 &lt;/script&gt;<br />
&lt;script language="javascript" type="text/javascript" src="&lt;?php echo $site_url; ?&gt;/admin/tinymce/jscripts/tiny_mce/tiny_mce.js"&gt;&lt;/script&gt;<br />
&lt;script language="javascript" type="text/javascript"&gt;<br />
tinyMCE.init({<br />
	mode : "textareas",<br />
	theme : "advanced",<br />
	plugins : "table,save,autosave,autosave,cleanup,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,zoom,flash,searchreplace,print,contextmenu,directionality,inlinepopups,media,nonbreaking,visualchars,devkit,paste,noneditable,layer,halfpage,fullscreen,",<br />
	theme_advanced_buttons1_add_before : "save,separator,",<br />
	theme_advanced_buttons1_add : "fontselect,fontsizeselect",<br />
	theme_advanced_buttons2_add : "separator,insertdate,inserttime,preview,zoom,separator,forecolor,backcolor",<br />
	theme_advanced_buttons2_add_before: "cut,copy,paste,separator,search,replace,separator",<br />
	theme_advanced_buttons3_add_before : "tablecontrols,separator",<br />
	theme_advanced_buttons3_add : "emotions,iespell,flash,advhr,separator,print,ltr,rtl",<br />
	theme_advanced_buttons4_add_before : "visualchars,nonbreaking,devkit,separator,layer,fullpage,fullscreen",<br />
	table_styles : "Header 1=header1;Header 2=header2;Header 3=header3",<br />
	table_cell_styles : "Header 1=header1;Header 2=header2;Header 3=header3;Table Cell=tableCel1",<br />
	table_row_styles : "Header 1=header1;Header 2=header2;Header 3=header3;Table Row=tableRow1",<br />
	table_cell_limit : 100,<br />
	table_row_limit : 5,<br />
	table_col_limit : 5,<br />
	theme_advanced_toolbar_location : "top",<br />
	theme_advanced_toolbar_align : "left",<br />
	theme_advanced_path_location : "bottom",<br />
	plugin_insertdate_dateFormat : "%Y-%m-%d",<br />
	plugin_insertdate_timeFormat : "%H:%M:%S",<br />
	extended_valid_elements : "a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]",<br />
	external_link_list_url : "example_data/example_link_list.js",<br />
	external_image_list_url : "example_data/example_image_list.js",<br />
	flash_external_list_url : "example_data/example_flash_list.js"<br />
});<br />
&lt;/script&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
&lt;br&gt;<br />
&lt;center&gt;<br />
&lt;table width="850" border="1" cellspacing="0" cellpadding="0" style="border-collapse: collapse"&gt;<br />
  &lt;?php<br />
    if($_SESSION['adminloggedin'] == '1') {<br />
  ?&gt;<br />
    &lt;tr&gt;<br />
     &lt;td bgcolor="#0033CC" class="tabletop2" align="center" height="75px"&gt;<br />
       &lt;a class="adminlink" href="index.php"&gt;Home&lt;/a&gt; &lt;font color="#7f7f7f"&gt;&middot;&lt;/font&gt;<br />
       &lt;a class="adminlink" href="?action=manage_media"&gt;Affiliate Pages&lt;/a&gt; &lt;font color="#7f7f7f"&gt;&middot;&lt;/font&gt;<br />
       &lt;a class="adminlink" href="?action=manage_advertiser"&gt;CJ Advertisers&lt;/a&gt; &lt;font color="#7f7f7f"&gt;&middot;&lt;/font&gt;<br />
       &lt;a class="adminlink" href="?action=manage_cats"&gt;Categories&lt;/a&gt; &lt;font color="#7f7f7f"&gt;&middot;&lt;/font&gt;<br />
       &lt;a class="adminlink" href="?action=manage_pages"&gt;Pages&lt;/a&gt; &lt;font color="#7f7f7f"&gt;&middot;&lt;/font&gt;<br />
       &lt;a class="adminlink" href="?action=manage_users"&gt;Users &lt;/a&gt; &lt;font color="#7f7f7f"&gt;&middot;&lt;/font&gt;<br />
       &lt;a class="adminlink" href="?action=manage_links"&gt;Links&lt;/a&gt; &lt;font color="#7f7f7f"&gt;&middot;&lt;/font&gt;<br />
       &lt;!--&lt;a class="adminlink" href="?action=manage_advertisment"&gt;&lt;s&gt;Ads&lt;/s&gt;&lt;/a&gt; &lt;font color="#7f7f7f"&gt;&middot;&lt;/font&gt;--&gt;<br />
       &lt;a class="adminlink" href="?action=aff"&gt;Affiliate Info&lt;/a&gt; &lt;font color="#7f7f7f"&gt;&middot;&lt;/font&gt;<br />
       &lt;a class="adminlink" href="?action=settings"&gt;Settings&lt;/a&gt; &lt;font color="#7f7f7f"&gt;&middot;&lt;/font&gt;<br />
       &lt;a class="adminlink" href="?action=checkin"&gt;Submissions&lt;/a&gt; (&lt;?=$pending?&gt;) &lt;font color="#7f7f7f"&gt;&middot;&lt;/font&gt;<br />
       &lt;a class="adminlink" href="?action=reported"&gt;Reported&lt;/a&gt; (&lt;?=$reported?&gt;)<br />
      &lt;hr width="80%"&gt;<br />
       &lt;a class="adminlink" href="?action=add_media"&gt;Add Article&lt;/a&gt; &lt;font color="#7f7f7f"&gt;&middot;&lt;/font&gt;<br />
       &lt;a class="adminlink" href="?action=add_advertiser"&gt;Add Advertiser&lt;/a&gt; &lt;font color="#7f7f7f"&gt;&middot;&lt;/font&gt;<br />
       &lt;a class="adminlink" href="?action=add_cat"&gt;Add Category&lt;/a&gt; &lt;font color="#7f7f7f"&gt;&middot;&lt;/font&gt;<br />
       &lt;a class="adminlink" href="?action=add_page"&gt;Add Page&lt;/a&gt; &lt;font color="#7f7f7f"&gt;&middot;&lt;/font&gt;<br />
       &lt;a class="adminlink" href="?action=add_link"&gt;Add Link&lt;/a&gt; &lt;font color="#7f7f7f"&gt;&middot;&lt;/font&gt;<br />
       &lt;a class="adminlink" href="index.php?action=logout"&gt;Log Out&lt;/a&gt; &lt;font color="#7f7f7f"&gt;&middot;&lt;/font&gt;<br />
       &lt;a class="adminlink" href="&lt;? echo $site_url; ?&gt;/index.php" target="_blank"&gt;View Site&lt;/a&gt;<br />
     &lt;/td&gt;<br />
    &lt;/tr&gt;<br />
  &lt;?php<br />
    }<br />
  ?&gt;<br />
    &lt;tr&gt;<br />
     &lt;td class="maintable" align="center"&gt;<br />
     &lt;br&gt;<br />
        &lt;table width="90%" border="0" cellspacing="0" cellpadding="0" class="table"&gt;<br />
        &lt;tr&gt;<br />
          &lt;td background="./images/menu2.png" bgcolor="#0066FF" class="tabletop"&gt;<br />
            &lt;b&gt;&nbsp;&nbsp;&lt;?php admin_title($action)?&gt;&lt;/b&gt;<br />
          &lt;/td&gt;<br />
        &lt;/tr&gt;<br />
        &lt;tr&gt;<br />
        &lt;td bgcolor="#FFFFFF" align="center"&gt;<br />
        &lt;div style="width:95%; text-align:left;"&gt;<br />
&lt;?php<br />
  if($_SESSION['adminloggedin'] == '1')<br />
  {<br />
     if ($action == 'add_media')     { include('admin-add-media.php'); }<br />
     elseif ($action == 'add_link') { include('admin-add-link.php'); }<br />
     elseif ($action == 'add_cat')  { include('admin-add-cat.php'); }<br />
     elseif ($action == 'add_page') { include('admin-add-page.php'); }<br />
     elseif ($action == 'add_advertisments') { include('admin-add-advertisment.php'); }<br />
     elseif ($action == 'aff') { include('admin-affiliate.php'); }<br />
     elseif ($action == 'add_advertiser') { include('admin-add-advertiser.php'); }<br />
     elseif ($action == 'edit_media') { include('admin-edit-media.php'); }<br />
     elseif ($action == 'edit_advertiser') { include('admin-edit-advertiser.php'); }<br />
     elseif ($action == 'edit_link') { include('admin-edit-link.php'); }<br />
     elseif ($action == 'edit_cat')  { include('admin-edit-cat.php'); }<br />
     elseif ($action == 'edit_page') { include('admin-edit-page.php'); }<br />
     elseif ($action == 'edit_user') { include('admin-edit-user.php'); }<br />
     elseif ($action == 'edit_advertisment') { include('admin-edit-advertisment.php'); }<br />
     elseif ($action == 'manage_media') { include('admin-manage-media.php'); }<br />
     elseif ($action == 'manage_advertiser') { include('admin-manage-advertiser.php'); }<br />
     elseif ($action == 'manage_links') { include('admin-manage-links.php'); }<br />
     elseif ($action == 'manage_cats')  { include('admin-manage-cats.php'); }<br />
     elseif ($action == 'manage_pages') { include('admin-manage-pages.php'); }<br />
     elseif ($action == 'manage_users') { include('admin-manage-users.php'); }<br />
     elseif ($action == 'manage_advertisment') { include('admin-manage-advertisment.php'); }<br />
     elseif ($action == 'reported')     { include ('admin-reported.php'); }<br />
              elseif ($action == 'delete_done')<br />
              {<br />
                 mysql_query("DELETE FROM `".$SQL_Ext."_media` WHERE `id` = '$id'");<br />
                 if ($_GET['check'] == 1)<br />
                  { header("Location: index.php?action=checkin&#038;message=Link%20Deleted"); exit; }<br />
                 else<br />
                  { header("Location: index.php?action=manage_media&#038;message=Article%20Deleted"); exit; }<br />
              }<br />
              elseif ($action == 'delete_user_done')<br />
              {<br />
                 mysql_query("DELETE FROM ".$SQL_Ext."_users WHERE id='$id'");<br />
                 header("Location: index.php?action=manage_users&#038;message=User%20deleted");<br />
                 exit;<br />
              }<br />
              elseif ($action == 'delete_cat_done')<br />
              {<br />
                 mysql_query("DELETE FROM ".$SQL_Ext."_cats WHERE id='$id'");<br />
                 header("Location: index.php?action=manage_cats&#038;message=Category%20deleted");<br />
                 exit;<br />
              }<br />
              elseif ($action == 'delete_comment')<br />
              {<br />
                 mysql_query("DELETE FROM ".$SQL_Ext."_comments WHERE id='$id'");<br />
                 header("Location: $site_url/index.php?task=view&#038;id=".makesafe($_GET['link_id']));<br />
                 exit;<br />
              }<br />
              elseif ($action == 'delete_page_done')<br />
              {<br />
                 mysql_query("DELETE FROM ".$SQL_Ext."_pages WHERE id='$id'");<br />
                 header("Location: index.php?action=manage_pages&#038;message=Page%20deleted");<br />
                 exit;<br />
              }<br />
              elseif ($action == 'link_delete_done')<br />
              {<br />
                 mysql_query("DELETE FROM `".$SQL_Ext."_links` WHERE `id` = '$id'");<br />
                 if ($_GET[check] == 1) { header("Location: index.php?action=checkin&#038;message=Unpublished link%20deleted"); exit; }<br />
                 else { header("Location: index.php?action=manage_links&#038;message=Link%20deleted"); exit; }<br />
              }<br />
              elseif ($action == 'config_view')<br />
              {<br />
                  include('config_view.php');<br />
              }<br />
              elseif ($action == 'new_pass')<br />
              {<br />
                  include('admin-new-pass.php');<br />
              }<br />
              elseif ($action == 'settings')<br />
              {<br />
                  include('settings.php');<br />
              }<br />
              elseif ($action == 'checkin')<br />
              {<br />
                  include('admin-checkin.php');<br />
              }<br />
              elseif ($action == 'checkin_done')<br />
              {<br />
                  include('admin-check.php');<br />
              }<br />
              elseif ($action == 'logout')<br />
              {<br />
                  session_destroy();<br />
                  header("Location: index.php");<br />
                  exit;<br />
              }<br />
              else<br />
              {<br />
                  include('./admin-main.php');<br />
              }<br />
  }<br />
  else<br />
  {<br />
     include_once('./admin-login-form.php');<br />
  }<br />
?&gt;<br />
&lt;br&gt;<br />
&lt;/div&gt;<br />
        &lt;/td&gt;<br />
        &lt;/tr&gt;<br />
        &lt;/table&gt;<br />
      &lt;br&gt;<br />
      &lt;br&gt;<br />
     &lt;/td&gt;<br />
    &lt;/tr&gt;<br />
    &lt;/table&gt;<br />
&lt;/center&gt;<br />
&lt;br&gt;<br />
&lt;br&gt;<br />
&lt;/body&gt;&lt;/html&gt;<br />
&lt;?php<br />
  mysql_close();<br />
?&gt;<br />
</code></p>
<p>A brief glimpse of what we have done here: At the beginning, we start the session. If admin is not logged in during the session, the script will take you to a login page, otherwise, it will load the page requested based on the action. Starting on line 117 you will see the code that makes this happen.</p>
<p>Basically what we have done is created a universal page for our site now. All that we will need to do is create a page that writes the page titles and each page for the admin script.</p>
<p>At this point, we are going to write our titles page, which will consist of a function that tells the script how to write each page title. In a new php editor window, let&#8217;s create our admin-titles.php file. (Script->admin->admin-titles.php)</p>
<p>Here is the code that we will use for admin-titles.php:<br />
<code><br />
&lt;?php<br />
function admin_title($action) {<br />
if($action == 'add_advertiser') {<br />
echo 'Add Advertiser';}<br />
if($action == 'edit_advertiser') {<br />
echo 'Edit Advertiser';}<br />
if($action == 'manage_advertiser') {<br />
echo 'Manage Advertiser';}<br />
if($action == 'aff') {<br />
echo 'Edit Affiliate Information';}<br />
else if($action == 'edit_media') {<br />
echo 'Edit Affiliate Page';}<br />
else if($action == 'add_link') {<br />
echo 'Add Link';}<br />
else if($action == 'edit_link') {<br />
echo 'Edit Link';}<br />
else if($action == 'manage_links') {<br />
echo 'Manage Links';}<br />
else if($action == 'edit_cat') {<br />
echo 'Edit Category';}<br />
else if($action == 'edit_user') {<br />
echo 'Edit User';}<br />
else if($action == 'add_page') {<br />
echo 'Add Page';}<br />
else if($action == 'edit_page') {<br />
echo 'Edit Page';}<br />
else if($action == 'manage_pages') {<br />
echo 'Manage Pages';}<br />
else if($action == 'add_cat') {<br />
echo 'Add Category';}<br />
else if($action == 'new_pass') {<br />
echo 'Set new password for user';}<br />
else if($action == 'manage') {<br />
echo 'Manage Affiliate pages';}<br />
else if($action == 'manage_cats') {<br />
echo 'Manage Catergories';}<br />
else if($action == 'manage_users') {<br />
echo 'Manage Users';}<br />
else if($action == 'settings') {<br />
echo 'Settings';}<br />
else if(!isset($_GET['cat_id'])){<br />
echo 'Admin Home';}}<br />
?&gt;<br />
</code><br />
On line 2 we start the function by defining it. The rest of the page tells the function to look at the action. If action = this then we need to write this.</p>
<p>To finish this article up, we are going to write our admin-main.php file. The admin-main page will allow us to edit our homepage text and our paypal address.</p>
<p>In a new php editor, create a file named admin-main.php. (Script->admin->admin-main.php)</p>
<p>Here is the code that we will use for this page:<br />
<code>&lt;? defined( 'ADMIN_ACCESS' ) or die( '' );<br />
if ($_GET[done] == 1)<br />
{<br />
  $homepage = makesafe($_POST['homepage']);<br />
  $paypal = makesafe($_POST['paypal']);<br />
  mysql_query("UPDATE ".$SQL_Ext."_sitespecs SET homepage='".$homepage."', paypal_id='".$paypal."'");<br />
  header("Location: index.php?&#038;message=Settings%20Changed");<br />
}<br />
else<br />
{<br />
$sql = mysql_query("SELECT * FROM ".$SQL_Ext."_sitespecs");<br />
$row = mysql_fetch_assoc($sql);<br />
if ($_GET['message']) {<br />
echo '&lt;div align="center" class="style2"&gt;&lt;br&gt;'.makesafe($_GET['message']).'&lt;br /&gt;&lt;/div&gt;'; }<br />
?&gt;<br />
  &lt;br&gt;<br />
  &lt;table width="100%" border="0" cellspacing="0" cellpadding="0"&gt;<br />
    &lt;tr&gt;<br />
      &lt;td&gt;<br />
 &lt;br&gt;<br />
 &lt;form method="post" action="index.php&#038;done=1"&gt;<br />
&lt;strong&gt;Homepage Text&lt;/strong&gt;&lt;br/&gt;<br />
&lt;textarea cols="70" rows="6" name="homepage"&gt;<br />
&lt;?php echo $row['homepage']; ?&gt;<br />
&lt;/textarea&gt;<br />
&lt;br/&gt;<br />
Paypal Address&lt;br/&gt;<br />
&lt;input type="text" name="paypal" size="70" value="&lt;?php echo $row['paypal_id']; ?&gt;"/&gt;<br />
&lt;input type="submit" name="submit" value="Update"/&gt;<br />
&lt;/form&gt;<br />
      &lt;/td&gt;<br />
    &lt;/tr&gt;<br />
  &lt;/table&gt;<br />
  &lt;?}?&gt;<br />
</code><br />
In the first few lines of code we are telling the page that to check and see if we are done editing. If we are done editing, we need to post the values that we entered in and insert them into the database using the UPDATE sql query.</p>
<p>If we are NOT done editing, then we need to query the database and get the current settings so that they can be edited. We will insert the values of the the homepage in a textarea for easy editing and the paypal address we will place into an input box. </p>
<p>We DO need to display the current information so that we can edit it so we echo the values for those two rows out of the db.</p>
]]></content:encoded>
			<wfw:commentRss>http://phppig.org/203/creating-basic-admin-section-part-2-of-building-full-php-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Your first FULL php script &#8211; install.php</title>
		<link>http://phppig.org/196/your-first-full-php-script-install-php/</link>
		<comments>http://phppig.org/196/your-first-full-php-script-install-php/#comments</comments>
		<pubDate>Tue, 31 Aug 2010 09:17:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Members Only]]></category>

		<guid isPermaLink="false">http://phppig.org/?p=196</guid>
		<description><![CDATA[<p>In this article, we are going to write our install.php page. Install.php is going to actually get all of the information from our user, such as database, username, password, admin setup, etc.</p>
<p>This is vital to our script if we want to have a script that we can mass produce. The install page is going to do <span style="color:#777"> . . . &#8594; Read More: <a href="http://phppig.org/196/your-first-full-php-script-install-php/">Your first FULL php script &#8211; install.php</a></span>]]></description>
			<content:encoded><![CDATA[<p>In this article, we are going to write our install.php page. Install.php is going to actually get all of the information from our user, such as database, username, password, admin setup, etc.</p>
<p>This is vital to our script if we want to have a script that we can mass produce. The install page is going to do quite a few things. First, it will create the database. It will also write the site configuration page that will be detrimental to our site&#8217;s existence because the site will rely on this page for connection details along with details for our SEO. This script is also going to create our .htaccess file that will be used to make SEO friendly URL&#8217;s.</p>
<p>Prior to doing this, let&#8217;s go ahead and create a file system on our local machine to run this code from. We will need to make the parent folder and name it what you will. Inside that folder, let&#8217;s create our children folders: ->admin, ->inc, ->install, ->media, ->template. We will come back to these folders later and add more folders to these but for now this is going to be our main file structure.</p>
<p>Open your php editor, and get ready to write the install file. You can go ahead and save the file into the install folder as index.php.</p>
<p><code><br />
&lt;?php session_start(); ?&gt;<br />
&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"&gt;<br />
&lt;html&gt;<br />
&lt;head&gt;<br />
&lt;title&gt;phpPig Content Management and Shopping Cart Script&lt;/title&gt;<br />
&lt;/head&gt;<br />
&lt;body style="background-image:url(bg.gif);"&gt;<br />
&lt;br&gt;<br />
&lt;br&gt;<br />
&lt;br&gt;<br />
&lt;center&gt;<br />
&lt;img src="top.png"&gt;<br />
&lt;div style="border:1px #8EB9FF solid; border-left:1px #8EB9FF solid; border-right:1px #8EB9FF solid; width:293px;" align="center"&gt;<br />
&lt;?<br />
if(!isset($_REQUEST['page'])){<br />
?&gt;<br />
 &lt;form action="index.php?page=2" method="post" style="display:inline;"&gt;<br />
 &lt;table cellpadding="0" border="0" style="border-collapse: collapse" width="260"&gt;<br />
 &lt;tr&gt;<br />
  &lt;td colspan="2" valign="middle" align="center"&gt;<br />
  &lt;br&gt;<br />
     Step 1: MySql Information<br />
  &lt;br&gt;<br />
  &lt;br&gt;<br />
  &lt;/td&gt;<br />
 &lt;/tr&gt;<br />
 &lt;tr&gt;<br />
   &lt;td&gt;Mysql Host Name&lt;/td&gt;<br />
   &lt;td&gt;&lt;input type="text" value="localhost" name="host" size="15" value="localhost"&gt;&lt;/td&gt;<br />
 &lt;/tr&gt;<br />
 &lt;tr&gt;<br />
   &lt;td&gt;Mysql Database&lt;/td&gt;<br />
   &lt;td&gt;&lt;input type="text" name="dbtable" size="15"&gt;&lt;/td&gt;<br />
 &lt;/tr&gt;<br />
 &lt;tr&gt;<br />
   &lt;td&gt;Mysql User Name&lt;/td&gt;<br />
   &lt;td&gt;&lt;input type="text" name="dbname" size="15"&gt;&lt;/td&gt;<br />
 &lt;/tr&gt;<br />
 &lt;tr&gt;<br />
   &lt;td&gt;Mysql Password&lt;/td&gt;<br />
   &lt;td&gt;&lt;input type="password" name="dbpass" size="15"&gt;&lt;/td&gt;<br />
 &lt;/tr&gt;<br />
  &lt;tr&gt;<br />
   &lt;td&gt;Table Prefix&lt;/td&gt;<br />
   &lt;td&gt;&lt;input type="text" name="prefix" size="15" value="ShoppingCartDeluxe"&gt;&lt;/td&gt;<br />
 &lt;/tr&gt;<br />
   &lt;tr&gt;<br />
   &lt;td&gt;Site Description&lt;/td&gt;<br />
   &lt;td&gt;&lt;input type="text" name="desc" size="15" value="Your Site Description"&gt;&lt;/td&gt;<br />
 &lt;/tr&gt;<br />
   &lt;tr&gt;<br />
   &lt;td&gt;Site Keywords&lt;/td&gt;<br />
   &lt;td&gt;&lt;input type="text" name="key" size="15" value="Your Keywords Here"&gt;&lt;/td&gt;<br />
 &lt;/tr&gt;<br />
 &lt;tr&gt;<br />
 &lt;td&gt;<br />
 Shopping Cart SEO extension&lt;br/&gt;<br />
 i.e. site.com/&lt;i&gt;&lt;b&gt;products&lt;/b&gt;/&lt;/i&gt;<br />
 &lt;/td&gt;<br />
 &lt;td&gt;<br />
 &lt;input name="cart" type="text" size="15" value="products"/&gt;<br />
 &lt;/td&gt;<br />
 &lt;/tr&gt;<br />
 &lt;tr&gt;<br />
 &lt;td&gt;<br />
 Blog SEO extension&lt;br/&gt;<br />
 i.e. site.com/&lt;i&gt;&lt;b&gt;blog&lt;/b&gt;&lt;/i&gt;/<br />
 &lt;/td&gt;<br />
 &lt;td&gt;<br />
 &lt;input name="seo" type="text" size="15" value="blog"/&gt;<br />
 &lt;/td&gt;<br />
 &lt;/tr&gt;<br />
 &lt;tr&gt;&lt;td colspan="2" align="right"&gt;&lt;input type="submit" name="submit" value="Submit"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;<br />
 &lt;/table&gt;<br />
&lt;/form&gt;<br />
&lt;?<br />
}<br />
if ($_REQUEST['page'] == 2)<br />
{<br />
   $_SESSION['host']     = $_POST['host'];<br />
   $_SESSION['cart']     = $_POST['cart'];<br />
   $_SESSION['dbname']   = $_POST['dbname'];<br />
   $_SESSION['dbtable']  = $_POST['dbtable'];<br />
   $_SESSION['dbpass']   = $_POST['dbpass'];<br />
   $_SESSION['prefix']   = $_POST['prefix'];<br />
   $_SESSION['seo']      = $_POST['seo'];<br />
   $_SESSION['desc']     = $_POST['desc'];<br />
   $_SESSION['key']      = $_POST['key'];<br />
   $con = @mysql_connect ($_SESSION['host'],$_SESSION['dbname'], $_SESSION['dbpass']) or die ("&lt;br&gt;Can not make the connection to the database.&lt;br&gt;&lt;br&gt; &lt;a href='index.php'&gt;Click here to enter connection details.&lt;/a&gt;&lt;br&gt;&lt;br&gt;");<br />
   $db = @mysql_select_db ($_SESSION['dbtable'],$con) or die ("&lt;br&gt;Can not connect to database. &lt;br&gt;&lt;br&gt; &lt;a href='index.php'&gt;Click here to enter connection details.&lt;/a&gt;&lt;br&gt;&lt;br&gt;");<br />
mysql_query("CREATE TABLE `".$_SESSION['prefix']."_cats` ( `id` int(10) unsigned NOT NULL auto_increment, `name` text NOT NULL, `keywords` text NOT NULL, `description` text NOT NULL, `parentid` tinyint(4) NOT NULL default '0', PRIMARY KEY  (`id`) );");<br />
mysql_query("INSERT INTO `".$_SESSION['prefix']."_cats` VALUES(1, 'News', '', '', 0);");<br />
mysql_query("CREATE TABLE ".$_SESSION['prefix']."_storecat (`id` int(10) unsigned NOT NULL auto_increment, `name` text NOT NULL, `description` text NOT NULL, `keywords` text NOT NULL, PRIMARY KEY (`id`));");<br />
mysql_query("INSERT INTO ".$_SESSION['prefix']."_storecat VALUES(1,'Products','','');");<br />
mysql_query("CREATE TABLE ".$_SESSION['prefix']."_items (`id` int(10) unsigned NOT NULL auto_increment, `title` text NOT NULL, `author` text NOT NULL, `price` decimal(5,2) NOT NULL, `image` text NOT NULL, `catid` tinyint(5) NOT NULL default '1', `couponcode` text NOT NULL, PRIMARY KEY(`id));");<br />
mysql_query("CREATE TABLE `".$_SESSION['prefix']."_products` ( `id` int(10) unsigned NOT NULL auto_increment, `name` text NOT NULL, `description` text NOT NULL, `keywords` text NOT NULL, `categoryid` text NOT NULL, `price` decimal(3,2) NOT NULL, PRIMARY KEY (`id`));");<br />
mysql_query("CREATE TABLE `".$_SESSION['prefix']."_storecat` ( `id` int(10) unsigned NOT NULL auto_increment, `name` text NOT NULL, `description` text NOT NULL, `keywords` text NOT NULL, `parentid` tinyint(4) NOT NULL default '0', PRIMARY KEY (`id`) );");<br />
mysql_query("INSERT INTO `".$_SESSION['prefix']."storecat` (1, 'products', '', '', 0);");<br />
mysql_query("CREATE TABLE `".$_SESSION['prefix']."_comments` ( `id` int(10) unsigned NOT NULL auto_increment, `user` varchar(30) NOT NULL default '', `comment` text NOT NULL, `link_id` varchar(10) NOT NULL default '', PRIMARY KEY  (`id`) );");<br />
mysql_query("CREATE TABLE `".$_SESSION['prefix']."_links` ( `id` int(11) NOT NULL auto_increment, `name` text NOT NULL, `url` text NOT NULL, `description` text NOT NULL, `sitewide` varchar(10) NOT NULL default '', `published` char(1) NOT NULL default '', PRIMARY KEY  (`id`) );");<br />
mysql_query("CREATE TABLE `".$_SESSION['prefix']."_media` ( `id` int(10) unsigned NOT NULL auto_increment, `name` text NOT NULL, `description` text NOT NULL, `keywords` text NOT NULL, `url` text NOT NULL, `custom` text NOT NULL, `catergory_id` varchar(10) NOT NULL default '', `hits` int(11) NOT NULL default '0', `mpaa_rating` varchar(5) NOT NULL default '', `published` char(1) NOT NULL default '0', `user_submit` varchar(10) NOT NULL default '0', `width` varchar(4) NOT NULL default '', `height` varchar(4) NOT NULL default '', `image` text NOT NULL, `type` char(3) NOT NULL default '1', `import` char(1) NOT NULL default '0', `remote_image` char(1) NOT NULL default '0', `remote_media` char(1) NOT NULL default '0', `thedate` varchar(50) NOT NULL default '', `uploader` varchar(100) NOT NULL default '', `featured` char(1) NOT NULL default '0', `reported` CHAR( 1 ) NOT NULL DEFAULT '0', PRIMARY KEY  (`id`) );");<br />
mysql_query("CREATE TABLE `".$_SESSION['prefix']."_pages` ( `id` int(10) unsigned NOT NULL auto_increment, `name` text NOT NULL, `page` text NOT NULL, `home` char(1) NOT NULL default '0', PRIMARY KEY  (`id`) );");<br />
mysql_query("INSERT INTO `".$_SESSION['prefix']."_pages` VALUES (1, 'Index Page', 'This is your home page.  Edit this page as you please. Download a copy of &lt;a href=http://thecollard.com&gt;TheCollard&lt;/a&gt; for yourself.', '1')");<br />
mysql_query("CREATE TABLE `".$_SESSION['prefix']."_users` ( `id` int(10) unsigned NOT NULL auto_increment, `username` varchar(200) NOT NULL default '', `password` varchar(50) NOT NULL default '', `email` varchar(30) NOT NULL default '', `activate` char(1) NOT NULL default '0', `first_name` text NOT NULL , `last_name` text NOT NULL, `address` text NOT NULL, `phone` text NOT NULL, `city` varchar(75) NOT NULL default '', `state` varchar(200) NOT NULL default '', `admin` char(2) NOT NULL default '', `zip` int(11) NOT NULL default '0', `website` text NOT NULL, PRIMARY KEY  (`id`) );");<br />
mysql_query("INSERT INTO `".$_SESSION['prefix']."_users` VALUES (1, '', '', '', '1', '', '', '', '', '', '', '1', 0, '0')");<br />
mysql_query("CREATE TABLE `".$_SESSION['prefix']."_orders` ( `id` int(12) unsigned NOT NULL auto_increment, `user` text NOT NULL, `email` text NOT NULL, `city` text NOT NULL, `state` text NOT NULL, `zip` text NOT NULL, `address` text NOT NULL, `products` text NOT NULL, PRIMARY KEY (`id`));");<br />
mysql_query("CREATE TABLE `".$_SESSION['prefix']."_settings` ( `site_name` text NOT NULL, `site_url` text NOT NULL, `template_url` text NOT NULL, `max_results` text NOT NULL, `image_height` text NOT NULL, `image_width` text NOT NULL, `seo_on` char(1) NOT NULL default '', `email_on` char(2) NOT NULL default '', `allowsubmissions` tinyint(4) NOT NULL default '0' );");<br />
mysql_query("INSERT INTO `".$_SESSION['prefix']."_settings` VALUES ('', '', '/template', '22', '85', '95', '1', '1', 1);");<br />
mysql_query("CREATE TABLE `".$_SESSION['prefix']."_sitespecs` (`homepage` text NOT NULL, `paypal_id` text NOT NULL, `confirm` text NOT NULL, `cancel` text NOT NULL);");<br />
mysql_query("INSERT INTO `".$_SESSION['prefix']."_sitespecs` VALUES('This is your homepage text','paypal@address.com','Your order confirmation page','Order cancellation page');");<br />
  $myFile = "../inc/config.php";<br />
  $fh = fopen($myFile, 'w') or die("Error creating config.php");<br />
  fwrite($fh, '&lt;'.chr(63).'php<br />
$server = \''.$_SESSION['host'].'\';<br />
$username = \''.$_SESSION['dbname'] .'\';<br />
$password = \''.$_SESSION['dbpass'] .'\';        // MySql Password<br />
$database = \''.$_SESSION['dbtable'].'\';        // MySql Database<br />
$host = $server;<br />
$user = $username;<br />
$pass = $password;<br />
$name = $database;<br />
$db = &#038;new MySQL($host,$user,$pass,$name);<br />
$con = mysql_connect("$server","$username","$password");<br />
if (!$con) { die(\'Could not connect: \' . mysql_error()); }<br />
mysql_select_db("$database", $con);<br />
$SQL_Ext = \''.$_SESSION['prefix'].'\';<br />
$sql = mysql_query("SELECT * FROM ".$SQL_Ext."_settings");<br />
$row = mysql_fetch_array($sql);<br />
$seotag = \''.$_SESSION['seo'].'\';<br />
$shoptag = \''.$_SESSION['cart'].'\';<br />
$site_description = \''.$_SESSION['desc'].'\';<br />
$site_keywords = \''.$_SESSION['key'].'\';<br />
$site_name = $row[\'site_name\'];<br />
$site_url = $row[\'site_url\'];<br />
$seo_on = $row[\'seo_on\'];<br />
$template_url = $row[\'template_url\'];<br />
$max_results = $row[\'max_results\'];<br />
$image_height = $row[\'image_height\'];<br />
$image_width = $row[\'image_width\'];<br />
$email_on = $row[\'email_on\'];<br />
$allowsubmissions = $row[\'allowsubmissions\'];<br />
'.chr(63).'&gt;');<br />
fclose($fh);<br />
$myFile1 = "../.htaccess";<br />
  $fh1 = fopen($myFile1, 'w') or die("Error creating config.php");<br />
  fwrite($fh, 'Options -Indexes<br />
RewriteEngine on<br />
RewriteRule ^'.$_SESSION['seo'].'/([0-9]+)-([a-zA-Z0-9?-]+) index.php?task=view&#038;id=$1&#038;name=$2 [L]<br />
RewriteRule ^'.$_SESSION['cart'].'/([0-9]+)-([a-zA-Z0-9?-]+) index.php?task=view&#038;id=$1&#038;name=$2 [L]<br />
RewriteRule ^([0-9]+)-([a-zA-Z0-9?-]+) index.php?task=articles&#038;id=$1&#038;name=$2 [L]<br />
RewriteRule ^categories/([0-9]+).html$ index.php?task=viewcat&#038;cat_id=$1&#038;name=$2 [L]<br />
RewriteRule ^categories/([0-9]+)?-p([0-9]+).html$ index.php?task=viewartcat&#038;cat_id=$1&#038;name=$2&#038;page=$3 [L]<br />
RewriteRule ^cat/([0-9]+)-([a-zA-Z0-9?-]+) index.php?task=viewcat&#038;cat_id=$1&#038;name=$2 [L]<br />
RewriteRule ^cat/([0-9]+)-([a-zA-Z0-9?-]+)&#038;page=([0-9]+) index.php?task=viewcat&#038;cat_id=$1&#038;name=$2&#038;page=$3 [L]<br />
RewriteRule ^cat/([0-9]+)-([a-zA-Z0-9?-]+)&#038;page=([0-9]+) index.php?task=viewcat&#038;cat_id=$1&#038;page=$2 [L]<br />
RewriteRule ^profile/([0-9]+)?/([a-zA-Z?-]+) index.php?task=profile&#038;id=$1&#038;name=$2 [L]<br />
RewriteRule ^([0-9]+) index.php?task=view_page&#038;id=$1 [L]<br />
RewriteRule ^task/contact.html index.php?task=contact [L]<br />
RewriteRule ^task/register.html index.php?task=register [L]<br />
RewriteRule ^task/lost-password index.php?task=lost_pass [L]<br />
RewriteRule ^task/links.html index.php?task=links [L]<br />
RewriteRule ^task/members.html index.php?task=member_list [L]<br />
RewriteRule ^task/email_sent.html index.php?task=sendemail [L]<br />
RewriteRule ^search.html index.php?task=search [L]<br />
RewriteRule ^store.html index.php?task=store [L]<br />
RewriteRule ^shopping-cart.html index.php?task=cart [L]<br />
RewriteRule ^update-cart.html index.php?task=update [L]<br />
RewriteRule ^delete/([0-9]+)-([a-zA-Z0-9?-]+) index.php?task=delete&#038;id=$1 [L]<br />
RewriteRule ^order/([0-9]+)-([a-zA-Z0-9?-]+) index.php?task=add&#038;id=$1&#038;name=$2 [L]<br />
RewriteRule ^feed rss.php [L]<br />
RewriteBase /';<br />
?&gt;<br />
 &lt;table cellpadding="0" border="0" width="260"&gt;<br />
 &lt;tr&gt;<br />
  &lt;td colspan="2" align="center" valign="center"&gt;<br />
   &lt;br /&gt;<br />
    Step 2: Config.php Created and mysql connection information saved..  Please press next page to proceed to the next step of the install.<br />
   &lt;br /&gt;<br />
   &lt;br /&gt;<br />
  &lt;/td&gt;<br />
 &lt;/tr&gt;<br />
 &lt;tr&gt;&lt;td&gt;Goto the Next Page&lt;/td&gt;&lt;/tr&gt;<br />
 &lt;tr&gt;&lt;td align="right"&gt;&lt;a href="index.php?page=3"&gt;Next Step&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;<br />
 &lt;/table&gt;<br />
&lt;?<br />
}<br />
if ($_REQUEST['page'] == 3)<br />
{<br />
   $con = @mysql_connect ($_SESSION['host'],$_SESSION['dbname'], $_SESSION['dbpass']) or die ("&lt;br&gt;Can not make the connection to the database.&lt;br&gt;&lt;br&gt; &lt;a href='index.php'&gt;Click here to enter connection details.&lt;/a&gt;&lt;br&gt;&lt;br&gt;");<br />
   $db = @mysql_select_db ($_SESSION['dbtable'],$con) or die ("&lt;br&gt;Can not connect to database. &lt;br&gt;&lt;br&gt; &lt;a href='index.php'&gt;Click here to enter connection details.&lt;/a&gt;&lt;br&gt;&lt;br&gt;");<br />
?&gt;<br />
&lt;form action="index.php?page=4" method="post" style="display:inline;"&gt;<br />
 &lt;table cellpadding="0" border="0" width="260"&gt;<br />
 &lt;tr&gt;<br />
  &lt;td colspan="2" align="center" valign="center"&gt;<br />
   &lt;br /&gt;<br />
   Step 3: Enter your sites configuration.<br />
   &lt;br /&gt;<br />
   &lt;br /&gt;<br />
  &lt;/td&gt;<br />
 &lt;/tr&gt;<br />
 &lt;tr&gt;<br />
   &lt;td&gt;Site Name&lt;/td&gt;<br />
   &lt;td&gt;&lt;input type="text" name="site_name" size="20"&gt;&lt;/td&gt;<br />
 &lt;/tr&gt;<br />
 &lt;tr&gt;<br />
   &lt;?php $website = $_SERVER['HTTP_HOST']; ?&gt;<br />
   &lt;td&gt;Site Url&lt;/td&gt;<br />
   &lt;td&gt;&lt;input type="text" name="site_url" size="20" value="http://&lt;?=$website?&gt;"&gt;&lt;/td&gt;<br />
 &lt;/tr&gt;<br />
 &lt;tr&gt;<br />
   &lt;td&gt;SEO On&lt;/td&gt;<br />
   &lt;td&gt;&lt;input type="checkbox" name="seo_on" checked&gt;&lt;/td&gt;<br />
 &lt;/tr&gt;<br />
 &lt;tr&gt;<br />
   &lt;td&gt;&lt;br&gt;&lt;/td&gt;<br />
   &lt;td&gt;&lt;/td&gt;<br />
 &lt;/tr&gt;<br />
 &lt;tr&gt;<br />
   &lt;td colspan="2"&gt;&lt;b&gt;Administration Setup&lt;/b&gt;&lt;/td&gt;<br />
 &lt;/tr&gt;<br />
 &lt;tr&gt;<br />
   &lt;td&gt;Admin Name&lt;/td&gt;<br />
   &lt;td&gt;&lt;input type="text" name="admin_name" size="20"&gt;&lt;/td&gt;<br />
 &lt;/tr&gt;<br />
 &lt;tr&gt;<br />
   &lt;td&gt;Admin Password&lt;/td&gt;<br />
   &lt;td&gt;&lt;input type="password" name="admin_pass" size="20"&gt;&lt;/td&gt;<br />
 &lt;/tr&gt;<br />
 &lt;tr&gt;<br />
 &lt;tr&gt;<br />
   &lt;td&gt;Admin Email&lt;/td&gt;<br />
   &lt;td&gt;&lt;input type="text" name="email" size="20"&gt;&lt;/td&gt;<br />
 &lt;/tr&gt;<br />
 &lt;tr&gt;<br />
   &lt;td&gt;&lt;br&gt;&lt;/td&gt;<br />
   &lt;td&gt;&lt;/td&gt;<br />
 &lt;/tr&gt;<br />
 &lt;tr&gt;&lt;td colspan="2" align="right"&gt;&lt;input type="submit" name="submit" value="Submit"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;<br />
 &lt;/table&gt;<br />
&lt;/form&gt;<br />
&lt;?<br />
}<br />
if ($_REQUEST['page'] == 4)<br />
{<br />
  $con = @mysql_connect ($_SESSION['host'],$_SESSION['dbname'], $_SESSION['dbpass']) or die ("&lt;br&gt;Can not make the connection to the database.&lt;br&gt;&lt;br&gt; &lt;a href='index.php'&gt;Click here to enter connection details.&lt;/a&gt;&lt;br&gt;&lt;br&gt;");<br />
  $db = @mysql_select_db ($_SESSION['dbtable'],$con) or die ("&lt;br&gt;Can not connect to database. &lt;br&gt;&lt;br&gt; &lt;a href='index.php'&gt;Click here to enter connection details.&lt;/a&gt;&lt;br&gt;&lt;br&gt;");<br />
  if($_REQUEST['seo_on'] == 'on') { $seoon = '1'; }<br />
  else { $seoon = '0'; }<br />
  $adminpass = md5($_REQUEST['admin_pass']);<br />
  $_SESSION['name'] = $_REQUEST['admin_name'];<br />
  $_SESSION['pass'] = $_REQUEST['admin_pass'];<br />
  $_SESSION['site_url'] = $_REQUEST['site_url'];<br />
  $_SESSION['email'] =$_REQUEST['email'];<br />
  mysql_query("UPDATE `".$_SESSION['prefix']."_settings`  SET `site_name` = '".$_REQUEST['site_name']."', `site_url` = '".$_REQUEST['site_url']."', `seo_on` = '".$seoon."'");<br />
  mysql_query("UPDATE `".$_SESSION['prefix']."_users` SET `username` = '".$_REQUEST['admin_name']."', `password` = '".$adminpass."', `email` = '".$_REQUEST['email']."' WHERE `id` = '1'");<br />
?&gt;<br />
 &lt;table cellpadding="0" border="0" width="260"&gt;<br />
 &lt;tr&gt;<br />
  &lt;td align="center" valign="center"&gt;<br />
   &lt;br /&gt;<br />
   Script Setup: Setup Finished<br />
   &lt;br /&gt;<br />
   &lt;br /&gt;<br />
  &lt;/td&gt;<br />
 &lt;/tr&gt;<br />
 &lt;tr&gt;&lt;td&gt;The content management and cart site set-up has finished.<br />
         You can now log into your admin panel.<br />
         &lt;b&gt; Do not forget to erase this folder&lt;/b&gt;<br />
         &lt;br&gt;&lt;br&gt; Name: &lt;?php echo $_SESSION['name']; ?&gt;<br />
         &lt;br&gt; Pass: &lt;?php echo $_SESSION['pass']; ?&gt;&lt;br&gt;<br />
         &lt;br&gt;&lt;a href="&lt;?=$_SESSION['site_url'];?&gt;/admin/index.php"&gt;Click here&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;<br />
 &lt;/table&gt;<br />
&lt;?<br />
}<br />
?&gt;<br />
&lt;/div&gt;&lt;img src="footer.png"&gt;&lt;/center&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
</code> </p>
<p>Now that this page is completed, we will want to save the index.php file again into the install folder. Also, we need to get the graphics for the page. </p>
<p>Here are the images. Right click and save to the install folder.<br />
Top of page<br/><br />
<img src="http://phpPig.org/top.png"><br/><br />
Bottom of page<br/><br />
<img src="http://phpPig.org/footer.png"><br/><br />
Background<br/><br />
<img src="http://phpPig.org/bg.gif"><br/><br />
Download the entire <a href="http://phpPig.org/password/thank/you/please/install.zip">install.zip file</a> </p>
]]></content:encoded>
			<wfw:commentRss>http://phppig.org/196/your-first-full-php-script-install-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating a php script to sell products</title>
		<link>http://phppig.org/193/creating-a-php-script-to-sell-products/</link>
		<comments>http://phppig.org/193/creating-a-php-script-to-sell-products/#comments</comments>
		<pubDate>Tue, 31 Aug 2010 08:41:25 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Scripts]]></category>

		<guid isPermaLink="false">http://phppig.org/?p=193</guid>
		<description><![CDATA[<p>Ever wonder how some people are able to get sites up and going giving them access to update the content on the site and add pages of new products without knowing a single thing about html?</p>
<p>Marketing a new and exciting product is just one way to make money online. You will find that there is much <span style="color:#777"> . . . &#8594; Read More: <a href="http://phppig.org/193/creating-a-php-script-to-sell-products/">Creating a php script to sell products</a></span>]]></description>
			<content:encoded><![CDATA[<p>Ever wonder how some people are able to get sites up and going giving them access to update the content on the site and add pages of new products without knowing a single thing about html?</p>
<p>Marketing a new and exciting product is just one way to make money online. You will find that there is much more money to be made when you have a service to offer people who are just starting out online. </p>
<p>Follow this series of posts in the members section. By the end of the posts, you will have a working content management system with a shopping cart that ACTUALLY works! Plus, you can learn how to <strong>manipulate php to appear as different file types</strong>, build a MySQL database, build a functioning script that works around the MySQL database, and how to write files on the fly&#8230;.Plus let&#8217;s not forget about the making php code to look and quack like xml, yet it is really still php!</p>
<p>We will include all sorts of tools that <i><b><u>EVERY WEBMASTER AND USER NEEDS AND DESIRES</u></b></i>. Goodies will include: RSS feed of products, on the fly XML sitemap, podcasting abilities, RSS feed for podcasts that goes directly to iTunes, shopping cart that will work with paypal (will also show you how to use it with clickbank), easy to use WYSIWYG editor in the admin area that gives you COMPLETE CONTROL over the page being created, and much, much more!</p>
<p>To view a sample of the script that we will be coding, visit <a href="http://scottpdaugherty.com">my personal website</a>. I coded this script and will include the source code to the WHOLE PROJECT as a download at the end of the tutorial.</p>
<p>You won&#8217;t want to miss this advanced lesson on how to create your own working php script that you can customize and sell to people, gaining you respect as a coder and giving your customer a very useful product that they will very likely pay hundreds or thousands of dollars for!</p>
<p>Look in the Member&#8217;s Only section to read this series of articles.</p>
]]></content:encoded>
			<wfw:commentRss>http://phppig.org/193/creating-a-php-script-to-sell-products/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Amazon, CJ, and eBay WordPress classes</title>
		<link>http://phppig.org/184/amazon-cj-and-ebay-wordpress-classes/</link>
		<comments>http://phppig.org/184/amazon-cj-and-ebay-wordpress-classes/#comments</comments>
		<pubDate>Tue, 31 Aug 2010 08:01:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[Wordpress Plugins]]></category>
		<category><![CDATA[amazon associate webservices]]></category>
		<category><![CDATA[cj webservices]]></category>
		<category><![CDATA[ebay partner network]]></category>

		<guid isPermaLink="false">http://phppig.org/?p=184</guid>
		<description><![CDATA[<p>I am considering having a member&#8217;s only area where member will be able to view and download source code for Amazon, commission junction and eBay affiliate program plugins. </p>
<p>Still just thinking about it now. If this were to happen, how many people would actually be interested in this? Comment to this post if you would be <span style="color:#777"> . . . &#8594; Read More: <a href="http://phppig.org/184/amazon-cj-and-ebay-wordpress-classes/">Amazon, CJ, and eBay WordPress classes</a></span>]]></description>
			<content:encoded><![CDATA[<p>I am considering having a member&#8217;s only area where member will be able to view and download source code for Amazon, commission junction and eBay affiliate program plugins. </p>
<p>Still just thinking about it now. If this were to happen, how many people would actually be interested in this? Comment to this post if you would be interested in viewing and downloading source code, having videos readily available on how to use the code, and instructions on how to make plugins and making your own comparison shopping plugin. Maybe even have code samples and instructions on how to make your own complete affiliate script!</p>
<p>Debating on it&#8230;.Let me know what you think.</p>
]]></content:encoded>
			<wfw:commentRss>http://phppig.org/184/amazon-cj-and-ebay-wordpress-classes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Protected: Interpreting data from CJ API Rest call</title>
		<link>http://phppig.org/169/interpreting-data-from-cj-api-rest-call/</link>
		<comments>http://phppig.org/169/interpreting-data-from-cj-api-rest-call/#comments</comments>
		<pubDate>Mon, 30 Aug 2010 08:21:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Scripts]]></category>

		<guid isPermaLink="false">http://phppig.org/?p=169</guid>
		<description><![CDATA[There is no excerpt because this is a protected post.]]></description>
			<content:encoded><![CDATA[<form action="http://phppig.org/wp-pass.php" method="post">
<p>This post is password protected. To view it please enter your password below:</p>
<p><label for="pwbox-169">Password:<br />
<input name="post_password" id="pwbox-169" type="password" size="20" /></label><br />
<input type="submit" name="Submit" value="Submit" /></p></form>
]]></content:encoded>
			<wfw:commentRss>http://phppig.org/169/interpreting-data-from-cj-api-rest-call/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Protected: CJ Webservices REST API call code</title>
		<link>http://phppig.org/161/cj-webservices-rest-api-call/</link>
		<comments>http://phppig.org/161/cj-webservices-rest-api-call/#comments</comments>
		<pubDate>Sun, 29 Aug 2010 22:57:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Scripts]]></category>

		<guid isPermaLink="false">http://phppig.org/?p=161</guid>
		<description><![CDATA[There is no excerpt because this is a protected post.]]></description>
			<content:encoded><![CDATA[<form action="http://phppig.org/wp-pass.php" method="post">
<p>This post is password protected. To view it please enter your password below:</p>
<p><label for="pwbox-161">Password:<br />
<input name="post_password" id="pwbox-161" type="password" size="20" /></label><br />
<input type="submit" name="Submit" value="Submit" /></p></form>
]]></content:encoded>
			<wfw:commentRss>http://phppig.org/161/cj-webservices-rest-api-call/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Learn How to Code php From Home</title>
		<link>http://phppig.org/136/learn-how-to-code-php-from-home/</link>
		<comments>http://phppig.org/136/learn-how-to-code-php-from-home/#comments</comments>
		<pubDate>Thu, 19 Aug 2010 06:42:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://phppig.org/?p=136</guid>
		<description><![CDATA[﻿<p>There are many ways to learn php from home. There is a vast amount of information on the web to teach one how to program php, though I recommend getting a book to keep as a reference manual in the future.</p>
<p>Once you have a book, install mysql and Apache on your machine and start coding locally <span style="color:#777"> . . . &#8594; Read More: <a href="http://phppig.org/136/learn-how-to-code-php-from-home/">Learn How to Code php From Home</a></span>]]></description>
			<content:encoded><![CDATA[<p>There are many ways to learn php from home. There is a vast amount of information on the web to teach one how to program php, though I recommend getting a book to keep as a reference manual in the future.</p>
<p>Once you have a book, install mysql and Apache on your machine and start coding locally in a non-production environment. This will allow you to do two things:<br />
1.) Debug your code before putting up for the public.<br />
2.) Keep a copy on your local machine for future upgrades that you would want to make to the code.</p>
<p>Below, I have listed a couple of books that I recommend you to read before trying to code a project yourself. </p>
<table border="0"><tr><td><h2><font size="3">PHP and MySQL Web Development (4th Edition)</font></h2></a><br><font size="2"><b>$31.18 </font></b><br><img src="http://ecx.images-amazon.com/images/I/51QGM-5H%2BLL._SL160_.jpg" title="PHP and MySQL Web Development (4th Edition)" border="0"></a><br>PHP and MySQL are popular open-source technologies that are ideal for quickly developing database-driven Web applications. PHP is a powerful scripting language designed to enable developers to create highly featured Web applications quickly, and MySQL is a fast, reliable database that integrates well with PHP and is suited for dynamic Internet-based applications. <p style="margin: 0px;"> </p> <p style="margin: 0px;"><i>PHP and MySQL Web Development</i> shows how to use these tools together to produce effective, interactive Web applications. It clearly describes the basics of the PHP language, explains how to set up and work with a MySQL database, and then shows how to use PHP to interact with the database and the server. </p> <p style="margin: 0px;"> </p> <p style="margin: 0px;">This practical, hands-on book includes numerous examples that demonstrate common tasks such as authenticating users, constructing a shopping cart, generating PDF documents and images dynamically, sending and managing email, facilitating user discussions, connecting to Web services using XML, and developing Web 2.0 applications with Ajax-based interactivity.</p> <p style="margin: 0px;"> </p> <p style="margin: 0px;">The fourth edition of <i>PHP and MySQL Web Development</i> has been thoroughly updated, revised, and expanded to cover developments in PHP 5 through version 5.3, such as namespaces and closures, as well as features introduced in MySQL 5.1.</p><p style="margin: 0px;"> </p><p style="margin: 0px;"><br></p><p style="margin: 0px;"> </p> <br></td></tr>
<tr><td><form action="/go.php?PHP_and_MySQL_Web_Development_4th_Edition" method="post" enctype="multipart/form-data"><input name="link" type="hidden" value="http://www.amazon.com/PHP-MySQL-Web-Development-4th/dp/0672329166%3FSubscriptionId%3D05VTE22MFHGQ29ZMNK82%26tag%3Dhttprockbotto-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3D0672329166" /><input type="image" name="Submit" src="http://phppig.org/wp-content/plugins/ActionAffiliate/images/more.jpg" /></form>
</td></tr></table> <a title="HARDWARE RAID WEB SERVER 8 GIG RAM 4 X 400GB SATA   AND GUI PHP MYSQL DNS MAIL"  href="http://rover.ebay.com/rover/1/711-53200-19255-0/1?icep_ff3=2&amp;toolid=10005&campid=5335866424&amp;customid=EZnichestore&icep_item=200618415710&ipn=psmain&icep_vectorid=229466&kwid=902099&mtid=824&kw=rss" target="_blank" ><b>HARDWARE RAID WEB SERVER 8 GIG RAM 4 X 400GB SATA   AND GUI PHP MYSQL DNS MAIL</b></a><table border="0" cellpadding="8"><tr><td><a title="HARDWARE RAID WEB SERVER 8 GIG RAM 4 X 400GB SATA   AND GUI PHP MYSQL DNS MAIL" href="http://rover.ebay.com/rover/1/711-53200-19255-0/1?icep_ff3=2&amp;toolid=10005&campid=5335866424&amp;customid=EZnichestore&icep_item=200618415710&ipn=psmain&icep_vectorid=229466&kwid=902099&mtid=824&kw=rss"><img border="0" src="http://thumbs.ebaystatic.com/pict/200618415710_0.jpg" /></a></td><td><strong>US $525.00</strong><br /> End Date: Saturday Feb-04-2012 20:00:52 PST<br />Buy It Now for only: US $525.00<br /><a title="HARDWARE RAID WEB SERVER 8 GIG RAM 4 X 400GB SATA   AND GUI PHP MYSQL DNS MAIL" href="http://rover.ebay.com/rover/1/711-53200-19255-0/1?icep_ff3=2&amp;toolid=10005&campid=5335866424&amp;customid=EZnichestore&icep_item=200618415710&ipn=psmain&icep_vectorid=229466&kwid=902099&mtid=824&kw=rss">Buy it now</a> | <a title="HARDWARE RAID WEB SERVER 8 GIG RAM 4 X 400GB SATA   AND GUI PHP MYSQL DNS MAIL" href="http://rover.ebay.com/rover/1/711-53200-19255-0/1?ff3=4&amp;toolid=10005&campid=5335866424&amp;customid=EZnichestore&amp;mpre=http%3A%2F%2Fcgi1.ebay.com%2Fws%2FeBayISAPI.dll%3FMfcISAPICommand%3DMakeTrack%26item%3D200618415710%26ssPageName%3DRSS%3AB%3ASRCH%3AUS%3A104">Add to watch list</a></td></tr></table><hr size="1" noshade="noshade" />
<p>What are the benefits of do-it-yourself coding when there are so many freelancers one may ask. In the long run, if you are going to run an independent site (or multiple sites) you will save a lot of money by coding it yourself.</p>
]]></content:encoded>
			<wfw:commentRss>http://phppig.org/136/learn-how-to-code-php-from-home/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Action Affiliate Software presale</title>
		<link>http://phppig.org/103/action-affiliate-software-presal/</link>
		<comments>http://phppig.org/103/action-affiliate-software-presal/#comments</comments>
		<pubDate>Thu, 12 Aug 2010 10:38:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Scripts]]></category>

		<guid isPermaLink="false">http://phppig.org/?p=103</guid>
		<description><![CDATA[<p>I have coded a new script and plugin for WordPress. Action Affiliate is officially ready for the market.</p>
<p>With the Action Affiliate script, it is a stand alone site. It provides you the ability to add content to keep your site from being deemed as a thin affiliate site within the search engines. With the ability to <span style="color:#777"> . . . &#8594; Read More: <a href="http://phppig.org/103/action-affiliate-software-presal/">Action Affiliate Software presale</a></span>]]></description>
			<content:encoded><![CDATA[<p>I have coded a new script and plugin for WordPress. Action Affiliate is officially ready for the market.</p>
<p><span style="float:right; padding:3px"><img src="http://phpPig.org/phpaffstandard.bmp" width="300px" height="300px"></span>With the Action Affiliate script, it is a stand alone site. It provides you the ability to add content to keep your site from being deemed as a thin affiliate site within the search engines. With the ability to pull listings from three separate networks (Amazon, CJ, and eBay), you can provide your site&#8217;s visitors with a comparison of prices of products from these networks while never having to login to your affiliate networks and search for adds.</p>
<p>By providing your visitor with a good review, article, or other useful content describing a product, you can literally have them ready to buy the product. That&#8217;s where Action Affiliate comes in. At the end of the article, there will be listings showing products that match your keywords. They click through, by the product, and you earn money.</p>
<p>With the stand-alone version, I have provided you with every tool known to man to get high SEO rank. This is a php script but it allows you to have seo friendly url&#8217;s, comes complete with an XML sitemap creator, and allows for imaging uploads. It also includes a user friendly admin section that gives you a super easy to use WYSIWYG (what you see is what you get) editor that automatically formats your typing into html (no need to know how to program).</p>
<p>The WordPress edition works with the same three affiliate networks. If you already love WordPress (like my wife), this is the best alternative for you. Let&#8217;s say you have had luck writing blog posts about yoga mats and have made a decent amount of commission from the posts but you have to constantly login to your affiliate networks, get the links for the products and images, and then play the copy-paste routine. You have wasted 10-15 minutes of your time getting the ads and pasting them in.</p>
<p>With Action Affiliate, you will never have to search for links again. Action Affiliate for WordPress is based on shortcode so all you would have to do is enter the following text into your post: <table border="0"><tr><td><h2><font size="3">YogaAccessories (TM) 1/4'' Extra Thick High Density Yoga Mat (Phthalate Free) - Teal Green</font></h2></a><br><font size="2"><b> </font></b><br><img src="http://ecx.images-amazon.com/images/I/51tFZlk-4ZL._SL160_.jpg" title="YogaAccessories (TM) 1/4'' Extra Thick High Density Yoga Mat (Phthalate Free) - Teal Green" border="0"></a><br>At 6.2mm, the YogaAccessories&trade; Extra Thick Deluxe Yoga Mat is a full 1/4'' thick, an extra long 74'', weighs almost 4 lbs, and is one of the thickest sticky mats on the market. The mats come in a variety of colors that are strong and vivacious, but not overpowering in their brightness - and of course, completely latex and heavy metal free, plus no phthalates are used in the inks and dyes. This well-made exercise mat will add comfort to your yoga workouts. Because of its high quality, this deluxe mat will last longer than most standard foam mats. When shopping around for a yoga mat, note that what many other companies call a 1/4'' mat is actually 4.5 - 5.2 mm in thickness -- considerably thinner than this mat. A thicker non-slip mat is good for all types of yoga, especially for restorative poses. Reward yourself and your body with an Extra Thick Deluxe Yoga Mat, and see why this is the most popular sticky mat found in yoga studios, schools, fitness clubs, and at home!<p>Looking for a unique yoga mat? YogaAccessories&trade; Extra Thick Deluxe Yoga Mats are also available in the Chakra Series or custom printed with your own logo or design -- in the same vibrant colors that make our yoga mats so appealing. <br></td></tr>
<tr><td><form action="/go.php?YogaAccessories_TM_14_Extra_Thick_High_Density_Yoga_Mat_Phthalate_Free_Teal_Green" method="post" enctype="multipart/form-data"><input name="link" type="hidden" value="http://www.amazon.com/YogaAccessories-Extra-Thick-Density-Phthalate/dp/B000PUHFSA%3FSubscriptionId%3D05VTE22MFHGQ29ZMNK82%26tag%3Dhttprockbotto-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3DB000PUHFSA" /><input type="image" name="Submit" src="http://phppig.org/wp-content/plugins/ActionAffiliate/images/more.jpg" /></form>
</td></tr></table> <a title="BLUE 68" x 24" x 1/4" (6 mm) Pad Mat for Exercise & Yoga w/ EZ Buy Now Inside"  href="http://rover.ebay.com/rover/1/711-53200-19255-0/1?icep_ff3=2&amp;toolid=10005&campid=5335866424&amp;customid=EZnichestore&icep_item=250988068225&ipn=psmain&icep_vectorid=229466&kwid=902099&mtid=824&kw=rss" target="_blank" ><b>BLUE 68" x 24" x 1/4" (6 mm) Pad Mat for Exercise & Yoga w/ EZ Buy Now Inside</b></a><table border="0" cellpadding="8"><tr><td><a title="BLUE 68" x 24" x 1/4" (6 mm) Pad Mat for Exercise & Yoga w/ EZ Buy Now Inside" href="http://rover.ebay.com/rover/1/711-53200-19255-0/1?icep_ff3=2&amp;toolid=10005&campid=5335866424&amp;customid=EZnichestore&icep_item=250988068225&ipn=psmain&icep_vectorid=229466&kwid=902099&mtid=824&kw=rss"><img border="0" src="http://thumbs.ebaystatic.com/pict/250988068225_0.jpg" /></a></td><td><strong>US $0.99</strong> (0 Bid)<br /> End Date: Saturday Feb-04-2012 13:21:20 PST<br /><a title="BLUE 68" x 24" x 1/4" (6 mm) Pad Mat for Exercise & Yoga w/ EZ Buy Now Inside" href="http://rover.ebay.com/rover/1/711-53200-19255-0/1?icep_ff3=2&amp;toolid=10005&campid=5335866424&amp;customid=EZnichestore&icep_item=250988068225&ipn=psmain&icep_vectorid=229466&kwid=902099&mtid=824&kw=rss">Bid now</a> | <a title="BLUE 68" x 24" x 1/4" (6 mm) Pad Mat for Exercise & Yoga w/ EZ Buy Now Inside" href="http://rover.ebay.com/rover/1/711-53200-19255-0/1?ff3=4&amp;toolid=10005&campid=5335866424&amp;customid=EZnichestore&amp;mpre=http%3A%2F%2Fcgi1.ebay.com%2Fws%2FeBayISAPI.dll%3FMfcISAPICommand%3DMakeTrack%26item%3D250988068225%26ssPageName%3DRSS%3AB%3ASRCH%3AUS%3A104">Add to watch list</a></td></tr></table><hr size="1" noshade="noshade" />. Let Action Affiliate find relative ads and place them into your post. How long did it take you to type in the short code? Probably less than 15 seconds. I don&#8217;t know about you but my time is THE SINGLE most valuable thing that I have.</p>
<p>Both versions of Action Affiliate also include jump links that go through a link on your site, then redirects to your advertiser&#8217;s site. This keeps those pesky anti-virus programs from blocking your tracking cookie and puts the money in your pocket! (Hopefully you will see a spike in commission from this feature alone.)</p>
<p>A lot of time and effort has gone into this script and plugin to make sure that YOU WILL SUCCEED!</p>
<p>You can download the version that is right for you below before they go for sale on their own site! I have decided to let a limited number of copies sell on phpPig.org before selling them on phpAffiliateScript.com.</p>
<p>The versions that you get from phpPig.org are the Deluxe packages which means you may install them on as many sites as you own! How much does Action Affiliate cost? Previous versions of the script that didn&#8217;t include all of the features that I am giving you today has cost literally thousands of dollars. The lowest amount that I charged was $497. Today, I am giving you the opportunity to have the stand alone script for only $97. This $100 less than I will charge when I move it to http://phpAffiliateScript.com. The WordPress plugin is only $77. Again, it will sell for no less than $177 when I move it to the new site. Plus, I am giving you a 30-day, no hassle money back guarantee.</p>
<table>
<tr>
<td width="50%">
Download the Stand Alone version of Action Affiliate here:</p>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="UNXZHJV6X7BNN">
<input type="image" src="http://phpPig.org/005_13.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"><br />
</form>
</td>
<td width="50%">
Download the WordPress plugin of Action Affiliate here:</p>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="YCF374SEG8U5E">
<input type="image" src="http://phpPig.org/005_13.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"><br />
</form>
</td>
</tr>
</table>
<p><center><img src="http://phpPig.org/009_32.gif" border="0"></center><br />
The choice is yours! You can spend hours of your precious time adding links that may or may not get you commission due to tracking cookie issues, or you can take advantage of this special deal and start getting all of the commissions that are rightfully yours! Take the chance and try it risk-free for 30 days.</p>
]]></content:encoded>
			<wfw:commentRss>http://phppig.org/103/action-affiliate-software-presal/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Beta Testers Needed: php Affiliate Script</title>
		<link>http://phppig.org/100/beta-testers-needed-php-affiliate-script/</link>
		<comments>http://phppig.org/100/beta-testers-needed-php-affiliate-script/#comments</comments>
		<pubDate>Wed, 04 Aug 2010 19:22:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Scripts]]></category>

		<guid isPermaLink="false">http://phppig.org/?p=100</guid>
		<description><![CDATA[<p>I have finished a php script that utilizes the CJ, Amazon, and eBay Partner Network&#8217;s services. </p>
<p>It works as simple as this&#8230;.You add a post like you would in a blog. (Quality content gets the traffic). Before you submit the page, you enter a single keyword phrase. The keyword phrase is what is going to get <span style="color:#777"> . . . &#8594; Read More: <a href="http://phppig.org/100/beta-testers-needed-php-affiliate-script/">Beta Testers Needed: php Affiliate Script</a></span>]]></description>
			<content:encoded><![CDATA[<p>I have finished a php script that utilizes the CJ, Amazon, and eBay Partner Network&#8217;s services. </p>
<p>It works as simple as this&#8230;.You add a post like you would in a blog. (Quality content gets the traffic). Before you submit the page, you enter a single keyword phrase. The keyword phrase is what is going to get the links from your selected affiliate programs.</p>
<p>If you want to use just cj, then you are able to turn off the other 2, and vice versa. I have included every tactic to make this the most search engine friendly script on the market. </p>
<p>I need 5 more testers.</p>
<p>If you wish to test it, simply sign up for our newsletter, and I will send the download link to you free of charge.</p>
<form method="post" action="http://phpPig.org/addlead.php">
First Name:<br />
<input type="text" name="name" size="20" />
<br/><br />
Email Address:<br />
<input type="text" name="email" size="20" />
<br/></p>
<input type="submit" name="submit" value="Signup and Get Me Started"/>
<p>You will receive an email within a few minutes with a download link. Be sure to allow phpPig.org to your safe sender&#8217;s list so that it is not filtered out as SPAM.</p>
]]></content:encoded>
			<wfw:commentRss>http://phppig.org/100/beta-testers-needed-php-affiliate-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting Cookies With PHP</title>
		<link>http://phppig.org/88/setting-cookies-with-ph/</link>
		<comments>http://phppig.org/88/setting-cookies-with-ph/#comments</comments>
		<pubDate>Mon, 17 May 2010 21:01:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Scripts]]></category>

		<guid isPermaLink="false">http://phppig.org/?p=88</guid>
		<description><![CDATA[<p>I am currently adding a shopping cart to a CMS script that I have written. The object is to eventually have a script that many people will find useful on their sites by allowing them to generate traffic from their articles as well as from their shop. In this post, I will discuss some of the <span style="color:#777"> . . . &#8594; Read More: <a href="http://phppig.org/88/setting-cookies-with-ph/">Setting Cookies With PHP</a></span>]]></description>
			<content:encoded><![CDATA[<p>I am currently adding a shopping cart to a <a href="http://thecollard.com/" target="_blank">CMS script</a> that I have written. The object is to eventually have a script that many people will find useful on their sites by allowing them to generate traffic from their articles as well as from their shop. In this post, I will discuss some of the code used to make the cart work, how it works, and how I will implement the code into my own script, which again is available for free download at <http://thecollard.com" target="_blank">The Collard</a>.</p>
<p>One of the first things that I needed to do was create sessions. This will allow my users to create a unique session and only allow the products added to their cart during the visit from their machine. In the previous versions of the collard, their was no session variables defined so I set this up by editing the functions.php file of this script. If you are not using this script, you will need to create a functions.php page and add this function to that page.</p>
<p><code>&lt;?php<br />
function Session()<br />
{<br />
//This will generate an encrypted string and will set the cookie. It will also be used in the cookieId field in the<br />
//cart<br />
if(isset($_COOKIE["cartid"]))<br />
{<br />
return $_COOKIE["cartId"];<br />
}<br />
else<br />
{<br />
//No cookie was found. We will set the cookie and return the session ID<br />
session_start();<br />
setcookie("cartId",session_id(),time()+((3600*24)*30);<br />
return session_id;<br />
}<br />
}<br />
?&gt;</code></p>
<p>This code has now created session ids and will return to that session id if visited again within the next 30 days. This allows the user to add products to a cart and if they decide to think about it, need to wait until payday, etc., the products are now in the shopping cart and will be available to them when they come back to complete the purchase.</p>
<p>Now to explain how I did this. I used the setcookie function to create the cookie on their machine. In order for this cookie to work for the next 30 days, I defined that by adding the time function to the string. There are 3600 seconds in every hour (60*60). I multiply that by 24 hours in a day and then by 30 days in a month. That sets the cookie to last exactly 30 days from the moment it was created.</p>
]]></content:encoded>
			<wfw:commentRss>http://phppig.org/88/setting-cookies-with-ph/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress Server Migration Information</title>
		<link>http://phppig.org/81/wordpress-server-migration-information/</link>
		<comments>http://phppig.org/81/wordpress-server-migration-information/#comments</comments>
		<pubDate>Mon, 03 May 2010 06:37:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Scripts]]></category>

		<guid isPermaLink="false">http://phppig.org/?p=81</guid>
		<description><![CDATA[<p>Thinking of moving your WordPress site from one server to another? Here are detailed instructions on how to do it via FTP. If you follow these instructions to the letter, you will not have any problems with the migration.</p>
<p>First things first, if you don&#8217;t have a good quality FTP client, I recommend to download Filezilla. It <span style="color:#777"> . . . &#8594; Read More: <a href="http://phppig.org/81/wordpress-server-migration-information/">WordPress Server Migration Information</a></span>]]></description>
			<content:encoded><![CDATA[<p>Thinking of moving your WordPress site from one server to another? Here are detailed instructions on how to do it via FTP. If you follow these instructions to the letter, you will not have any problems with the migration.</p>
<p>First things first, if you don&#8217;t have a good quality FTP client, I recommend to download <a href="http://filezilla-project.org/download.php" target="_blank" title="Filezilla">Filezilla</a>. It is open source, free, and the fastest FTP software that I have used to date.</p>
<p>So&#8230;.You have FTP software and you are ready to go. You first download the entire folder of that the blog is in from your server to your local computer. Once it is downloaded to your local machine, you can either search through each file to find the server path (not recommended because this can literally take hours), or you can download a free application for your computer to do this for you. <a href="http://www.rjlsoftware.com/software/utility/search/" target="_blank">Simple Search and Replace</a> allows you to choose a folder on your machine and it will search all files for specified text and replace it with whatever text you choose. You will need to search for your old server path and replace with new path. You can get the server paths from your hosting company.</p>
<p>Next, you will need to download your SQL database from phpMyAdmin. My recommendations for this is to login into phpMyAdmin and choose to save as a file. If your hosting company allows you can save as .gz but if not save as .zip instead of .sql. This will allow for a faster download to your computer.</p>
<p>If you don&#8217;t have .zip software, you can download <a href="http://www.7-zip.org/download.html" target="_blank">7 zip file manager</a> for free. Again, it is open source and performs very well. I recommend it and use it myself. It allows you to unzip any format and works well.</p>
<p>Once the file is downloaded, unzip it and open it in a php editor. I say this because I use <a href="http://download.cnet.com/tsWebEditor/3000-10248_4-10376995.html" target="_blank">tsWebEditor</a> because it is free and open source.</p>
<p>Once you have the .sql file open, you can select edit->find (or CTRL+F for the keyboard shortcut), and enter in the old server path and the new server path where the blog will be installed. If you are using tsWebEditor, be sure to select from start in the options box and then select replace all. Save this file but keep it open. </p>
<p>Login on your new hosting site and create a new database. Whenever it active, you need to login to the phpMyAdmin for that database and the easiest method to get the new database uploaded is to select SQL from the options and enter the new database in there. If you have a large database (5mb or larger), it is probably easiest to select part of the code from the sql file that you have open in tsWebEditor and use the cut/paste method of getting it into the database. You can import about 1500 lines per cut/paste this way.</p>
<p>Most hosting companies won&#8217;t allow a database larger than 1mb to be uploaded and this is why I suggest getting your new database uploaded using this method. </p>
<p>Once you have the entire database uploaded, there is one last file to edit with the details of your new server prior to uploading the folder to your new server. You will need to open wp-config.php in the root folder and edit the details of your database. Most of the time, your database location is localhost, though I know if you are moving to GoDaddy, the database location is actually a separate server from where your site will be uploaded. Be sure that this information is correct!</p>
<p>You are just about ready to upload this folder to the server now. Last thing to do is make sure that there is no .html files anywhere in the root of your folder. Sometimes, your old server will have 500.html, 501.html, etc. in the root of your server and these can actually cause problems with your new server being able to parse php. Simply delete these files. Also, if there is a file named error_log, delete it as well. It will server no purpose on your new server.</p>
<p>Once you have done this, upload the entire folder to your new server. Once you have completed the upload, it is now safe to point your domain to the new host. This typically can take up to 48 hours but is completed within a couple hours most of the time. Once you are on the new server, you are now safe to either delete the files from your old server or cancel the old hosting plan.</p>
<p>If you need help moving your wordpress site from one server to another, I can help you for only $47 and can have it done usually within 24 hours of payment. </p>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="FZMKCUUZE2UZG">
<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"><br />
</form>
<p>Contact me at the paypal address for details or questions.</p>
]]></content:encoded>
			<wfw:commentRss>http://phppig.org/81/wordpress-server-migration-information/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Ebay Partner Network WordPress Plugin</title>
		<link>http://phppig.org/78/ebay-partner-network-wordpress-plugin/</link>
		<comments>http://phppig.org/78/ebay-partner-network-wordpress-plugin/#comments</comments>
		<pubDate>Wed, 28 Apr 2010 11:51:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Scripts]]></category>

		<guid isPermaLink="false">http://phppig.org/?p=78</guid>
		<description><![CDATA[<p>WordPressers: Have you wondered how to make a little additional money while blogging using ebay partner network? Now you can add targeted ads to your blog and make revenue with the ebay partner network.</p>
<p>This plugin installs in just seconds and you can add as many listing as you would like to your blog post by using <span style="color:#777"> . . . &#8594; Read More: <a href="http://phppig.org/78/ebay-partner-network-wordpress-plugin/">Ebay Partner Network WordPress Plugin</a></span>]]></description>
			<content:encoded><![CDATA[<p>WordPressers: Have you wondered how to make a little additional money while blogging using ebay partner network? Now you can add targeted ads to your blog and make revenue with the ebay partner network.</p>
<p>This plugin installs in just seconds and you can add as many listing as you would like to your blog post by using a little bit of shortcode. Simply type in [ebay keywords="Your keywords" amount="Number of returns to your post"] and that is it! How simple is that?</p>
<p>Like the cjAffShop plugin, it publishes the results in the content of your post with a natural look to your blog. Simply put the code ANYWHERE in the post that you like! </p>
<p>You will need to upload to small files to the root folder of your blog and then install the plugin to make it work. It takes only a couple of minutes using dial up and mere seconds for highspeed users. </p>
<p>Included with the download is:<br />
FTP Software (Windows only(necessary if you don&#8217;t have a way to upload files to your server))<br />
The two files necessary for plugin to work to be uploaded in blog&#8217;s root folder.<br />
Plugin .zip file to upload from WordPress admin section.</p>
<p>You can demo the plugin here: <a href="http://scottpdaugherty.com/2010/04/28/funny_people_revie/" target="_blank">Funny People Review</a>. </p>
<p>Download the plugin instantly here:</p>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="92MAZAEMDMSZS">
<input type="image" src="http://phpPig.org/ebayp.jpg" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"><br />
</form>
]]></content:encoded>
			<wfw:commentRss>http://phppig.org/78/ebay-partner-network-wordpress-plugin/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Keep your site&#8217;s visitors by decreasing page load time</title>
		<link>http://phppig.org/50/keep-your-sites-visitors-by-decreasing-page-load-time/</link>
		<comments>http://phppig.org/50/keep-your-sites-visitors-by-decreasing-page-load-time/#comments</comments>
		<pubDate>Fri, 09 Apr 2010 10:02:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Scripts]]></category>

		<guid isPermaLink="false">http://phppig.org/?p=50</guid>
		<description><![CDATA[<p>If you are new to php or a seasoned veteran and aren&#8217;t utilizing the gzip compression features of php, you could be missing out on a lot of traffic. Did you know that you could be losing traffic before they land on your page because the page takes too long to load? That is a fact! <span style="color:#777"> . . . &#8594; Read More: <a href="http://phppig.org/50/keep-your-sites-visitors-by-decreasing-page-load-time/">Keep your site&#8217;s visitors by decreasing page load time</a></span>]]></description>
			<content:encoded><![CDATA[<p>If you are new to php or a seasoned veteran and aren&#8217;t utilizing the gzip compression features of php, you could be missing out on a lot of traffic. Did you know that you could be losing traffic before they land on your page because the page takes too long to load? That is a fact! According to market research, people will click away before they actually arrive because a page takes too long to load!</p>
<p>Fellow php coders and newbies, there is a way to keep your site&#8217;s visitors by decreasing the load time of a page significantly. You can turn on gzip compression that works just like WinZip or other software that archives files on your computer. It only takes a single line of code but it has to be read first, so if you are using WordPress you would put this in the top index file. If you are using oscommerce, this would need to go in the application top file in the includes folder.Â  For custom scripts, simply place this as the first line of code read by the server.</p>
<p>Here is the code:<br />
<code><br />
&lt;?php<br />
ob_start('ob_gzhandler');<br />
?><br />
</code><br />
Now this will make the server load all pages faster. But, it is set at a default setting of 6 which still can slow things down a bit. In order to increase the compression, you have to define it. The compression is on a scale of 1 to 9, 9 being the highest compression. Please note that if you are running on a sluggish server, increasing the compression size can knock the server down and send your website down. Be sure that you are indeed using a good webhost before increasing your gzip compression. </p>
<p>To increase the compression and activate gzip, put this line of code on the first file your server reads:<br />
<code><br />
&lt;?php<br />
ini_set('zlib.output_compression_level', 9); ob_start('ob_gzhandler');<br />
?><br />
</code><br />
I hope this helps you keep your site&#8217;s visitors and wish each and everyone of you success! If you are worried that your webhost isn&#8217;t up to par, I recommend this <a href="best/webhosting_company.html" target="_blank">host</a>!<img src="http://www.awltovhc.com/image-2484123-10365666" width="1" height="1" border="0"/></p>
]]></content:encoded>
			<wfw:commentRss>http://phppig.org/50/keep-your-sites-visitors-by-decreasing-page-load-time/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Making clean url&#8217;s using CJ Webservices API</title>
		<link>http://phppig.org/45/making-clean-urls-using-cj-webservices-api/</link>
		<comments>http://phppig.org/45/making-clean-urls-using-cj-webservices-api/#comments</comments>
		<pubDate>Mon, 29 Mar 2010 03:16:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Scripts]]></category>

		<guid isPermaLink="false">http://phppig.org/?p=45</guid>
		<description><![CDATA[<p>There are many advertisers on CJ&#8217;s webservices that have a product catalog that use links that can easily be cleaned up on your site using mod rewrite commands. A simple str_replace function and updating the .htaccess file on your server will do the trick. It doesn&#8217;t matter if you are using SOAP or REST api calls, <span style="color:#777"> . . . &#8594; Read More: <a href="http://phppig.org/45/making-clean-urls-using-cj-webservices-api/">Making clean url&#8217;s using CJ Webservices API</a></span>]]></description>
			<content:encoded><![CDATA[<p>There are many advertisers on CJ&#8217;s webservices that have a product catalog that use links that can easily be cleaned up on your site using mod rewrite commands. A simple str_replace function and updating the .htaccess file on your server will do the trick. It doesn&#8217;t matter if you are using SOAP or REST api calls, you can easily rewrite the urls as outlined in this article.</p>
<p>I am going to base the content off of the same code that I am running on one of my sites. If anybody reading this article is a boater&#8217;s world affiliate, the code is here for you to grab, by the way. I am only showing one of the links. You will need to rewrite the url&#8217;s going from each domain that cj uses for tracking purposes. Also, it is detrimental to insure that the click-123456-12345678 is indeed correct. The first number is your PID that you have to enter into the API code to make the call so if you get that number wrong, you definitely need to double check it. The second number in the series is the creative, I think, but am not clear on.</p>
<p>We are using the boaters world connection because of it&#8217;s simple urls. The urls appear like this: http://boatersworld.com/product/12345.htm&amp;cjsku=12345. If you notice the product number and cjsku is the same number.</p>
<ol>
<li>Run the script on your site to get an idea of how the links look. You should copy the link to text editor where you will later update this to the .htaccess file.</li>
<li>View source code to copy the url in html. You will need this to update your webservices API call to present a friendly link to your site&#8217;s visitor. The .htaccess will redirect the link to the advertisers page and you still get commission or referral fees for any sales or leads generated.</li>
<li>Open the .htaccess file. At the bottom of the RewriteRules and before the RewriteBase statement, add the following command: RewriteRule ^product/([a-zA-Z 0-9?-]+)-([a-zA-Z 0-9?-]+) http://jdoqocy.com/click-123456-12345678?url=http://www.boatersworld.com/product/$1.htm&amp;cjsku=$1.</li>
<li>In the php code where you make your API call it is important to copy the url exactly from the source code from your browser. The code uses the utf-8 code for symbols. i.e. &lt;space&gt; is notated %20. After you make your API call in the php code, your code should look like this [SOAP REFERENCE]:<br />
<code>$click_url = $result['searchReturn']['products']['products'][$i]['clickUrl'];</code><br />
This is for the actual url to the product. Now below all the calls, you should add these lines:<br />
<code>$click_url = str_replace("%2F","/",$click_url);<br />
$click_url = str_replace("%3A",":",$click_url);</code><br />
These commands will convert the UTF-8 to the actual symbols used in the url. (:/) Now for the line of code that I have in my .htaccess file, I will use that to rewrite the urls on my site like this.<br />
<code>$click_url = str_replace("http://www.tkqlhce.com/click-123456-12345678?","http://alabamatombigbeefishing.info/product",$click_url);</code><br />
This will change the url to show my domain instead of the tracking domain. Now to complete the cleaning of the urls so that the url looks like this: http://alabamatombigbeefishing.info/product/MP84149749-Catfish_Master_Combo_8_Medium.html, we will add the following code:<br />
<code>function seo_str($string)<br />
 {<br />
      $string = html_entity_decode($string, ENT_QUOTES);<br />
      $string = ereg_replace("[^a-zA-Z0-9 ]", "", $string);<br />
      $string = ereg_replace(" +", " ", $string);<br />
      $string = str_replace(" ", "_", $string);<br />
      return $string;<br />
  }<br />
$click_url = str_replace("url=http://www.boatersworld.com/product","",$click_url);<br />
$click_url = str_replace(".htm","",$click_url);<br />
$click_url = str_replace("cjsku","",$click_url);<br />
$click_url = str_replace("&#038;=","",$click_url);<br />
$name1 = seo_str($name);<br />
$click_url2 = 'http://alabamatombigbeefishing.info/product/'.$sku.'-'.$name1.'.html';<br />
&lt;a href=$click_url2&gt;$name&lt;/a&gt;</code><br />
You can preview the code in action at the bottom of this page: <a href="http://alabamatombigbeefishing.info/page/3-Mississippi_State_Record_Flathead_Catfish.html" target="_blank" rel="follow" title="Mississippi State Record Flathead Catfish">Mississippi State Record Flathead caught on Tombigbee</a>. Note that we wrote a custom function named seo_str at the very beginning of this code. This function allows us to make an SEO friendly url that .htaccess and the search engines, by the way, will love. </p>
<p>You have now gotten rid of the ugly urls and have made urls that look like they belong to your site. You should notice an increase in clicks now, as well. A lot of visitors won&#8217;t click through if the url in the status bar doesn&#8217;t look friendly. My click rate increased 5 times within 2 months of implementing this on my various sites.</p>
<p>If you aren&#8217;t using the CJ API but are interested in it and haven&#8217;t found a plugin for wordpress that looks natural to your site, check out the cjAffShop plugin that I have written. It works seamlessly with wordpress allowing you to add as many advertisers, keywords, and returns as you wish. Before our wedding, my wife showed off a dress that she was interested in on her blog. She wound up not buying that style dress but really liked it. You would never know that she didn&#8217;t just put the picture and link on her site to show it off, looking at it. Preview for yourself at <a href="http://www.polkaspotfarm.com/2010/01/24/i-think-i-found-a-dress/" target="_blank">PolkaSpotFarm</a>.</p>
<p>You can get this plugin now, for a limited time, for only $27. I have both the SOAP and REST versions available, though, if your server can handle the REST call, I recommend. CJ is slowly phasing out the SOAP API calls.<br />
<!--SOAP API--></p>
<form action="https://www.paypal.com/cgi-bin/webscr" target="_blank" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="8JCGAPT7TB298">
<input type="image" src="http://phpPig.org/soap.gif" border="0" height="50%" width="50%" name="submit" alt="Instant Download!">
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"><br />
</form>
<p><br/><br />
<!--REST API--></p>
<form action="https://www.paypal.com/cgi-bin/webscr" target="_blank" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="GPYQDYBAGHR3U">
<input type="image" src="http://phpPig.org/rest.gif" border="0" height="50%" width="50%" name="submit" alt="Instant Download!">
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"><br />
</form>
</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://phppig.org/45/making-clean-urls-using-cj-webservices-api/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CJ WordPress Plugin now available</title>
		<link>http://phppig.org/40/cj-wordpress-plugin-now-available/</link>
		<comments>http://phppig.org/40/cj-wordpress-plugin-now-available/#comments</comments>
		<pubDate>Fri, 05 Feb 2010 08:04:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Wordpress Plugins]]></category>
		<category><![CDATA[CJ API Code]]></category>
		<category><![CDATA[CJ Wordpress Plugin]]></category>

		<guid isPermaLink="false">http://phppig.org/?p=40</guid>
		<description><![CDATA[<p>For all of you bloggers who have been following the posts about the CJ WordPress code on my site for the CJ webservices, I have written two different plugins that make it simple to add listings to your post. Simply use a little short code and literally have as many listings on your post as you <span style="color:#777"> . . . &#8594; Read More: <a href="http://phppig.org/40/cj-wordpress-plugin-now-available/">CJ WordPress Plugin now available</a></span>]]></description>
			<content:encoded><![CDATA[<p>For all of you bloggers who have been following the posts about the CJ WordPress code on my site for the CJ webservices, I have written two different plugins that make it simple to add listings to your post. Simply use a little short code and literally have as many listings on your post as you desire within seconds.</p>
<p>You will need an affiliate PID that can be retrieved from the CJ settings and a CJ webservices developer id. Enter that into the plugin settings and activate the plugin. Then go to advertiser that you wish to add products from and enter the advertiser id (found in the url at the top of the advertiser page listed as &amp;advertiserid=12345).Â  Use the shortcode [cjaff keywords="What you want to search for" amount="# of listings" advertiser="12345 or whatever the advertiser is"]. You can do this with as many advertisers and as many keywords as you wish per listing.</p>
<p>Why would you want to use such a plugin as this? Unlike the other plugins available, our plugin makes the advertisements look as if they were added by you into the post. Here is an example of my fiance&#8217;s post about <a href="http://www.polkaspotfarm.com/2010/01/24/i-think-i-found-a-dress/" target="_blank">wedding gowns.</a> Here is also an affiliate site of mine <a href="http://pickup-truck-accessories.com" target="_blank">Pickup truck accessories</a> and a post about <a href="http://pickup-truck-accessories.com/7/pickup-truck-bed-covers/" target="_blank">pickup truck bed covers</a>.Â These affiliate links appear naturally as if they were added into the post by the blogger. Both of these sites are using the php5 REST version.</p>
<p>The php4 soap version can be viewed on a page on my site about <a href="http://scottpdaugherty.com/2010/01/24/fender-stratocaster/" target="_blank">Fender Stratocasters</a>.</p>
<p>Either version gives you the options of finding only your specified keywords without having to get links from cj and return the amount of listings that you choose. You can choose the amount of advertisers, the amount of listings, and relevant keywords to your post and add as many as you like.</p>
<p>With this CJ API plugin for wordpress, I have seen clicks and earnings go up over the past month since I wrote the plugin and have also seen my page impressions go up because more traffic is finding my pages organically than before due to the extra keyword listings from each ad on the site.</p>
<p>I will give you unlimited upgrades and unlimited support. We have a members section that is available to you and I will personally help each and every one of my customers succeed using this plugin. I will even make small modifiications to the code to suit your specific needs.</p>
<p>How much would this cost, is the next question? Well, it took hours of developing and debugging to get it to work. After over a week, the plugin was perfected to where it works effortlessly. The plugin that will earn you hundreds, thousands, or even more; a $497 value is yours not for $497. I wouldn&#8217;t even charge you $297. It can be yours for<span style="text-decoration: line-through;">$147</span>. For a limited time, I am giving this away for only <span style="color: #ff0000;"><strong>$<span style="text-decoration: line-through;">97</span> <span style="color: #000000;">$39.95.<br />
</span></strong></span></p>
<p>This is a limited time offer so don&#8217;t miss your chance to earn large money without ANY HASSLES at all. Simply choose your php version below because the SOAP version will run with php4 and the REST version will run with php5. I can assure you that it is so easy to use, my son who is in the 3rd grade can add advertisements to a site. (Post will be available on February 6th with video footage of him using the software.)</p>
<p>Download your copy instantly now. (If you are not redirected, check your email to get the download link.)</p>
<p>php4 users using SOAP for only $<span style="color: #ff0000;"><span style="text-decoration: line-through;">97</span></span>! $39.95</p>
<form action="https://www.paypal.com/cgi-bin/webscr" target="_blank" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="8JCGAPT7TB298">
<input type="image" src="http://phpPig.org/soap.gif" border="0" height="50%" width="50%" name="submit" alt="Instant Download!">
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"><br />
</form>
<p> php5 users using REST calls for only $<span style="text-decoration: line-through;"><span style="color: #ff0000;">97</span></span>! $39.95</p>
<form action="https://www.paypal.com/cgi-bin/webscr" target="_blank" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="GPYQDYBAGHR3U">
<input type="image" src="http://phpPig.org/rest.gif" border="0" height="50%" width="50%" name="submit" alt="Instant Download!">
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"><br />
</form>
]]></content:encoded>
			<wfw:commentRss>http://phppig.org/40/cj-wordpress-plugin-now-available/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Building a sufficient php site</title>
		<link>http://phppig.org/35/building-a-sufficient-php-site/</link>
		<comments>http://phppig.org/35/building-a-sufficient-php-site/#comments</comments>
		<pubDate>Tue, 12 Jan 2010 06:32:42 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://phppig.org/?p=35</guid>
		<description><![CDATA[<p>To get more popular search engine rank, a new webmaster must make sure that they do their keywords homework. There are several ways to do this, with Wordtracker being the most popular. Once you have done your homework and have great keyword phrases, then register your domain and start building your site.</p>
<p>If you are running a <span style="color:#777"> . . . &#8594; Read More: <a href="http://phppig.org/35/building-a-sufficient-php-site/">Building a sufficient php site</a></span>]]></description>
			<content:encoded><![CDATA[<p>To get more popular search engine rank, a new webmaster must make sure that they do their keywords homework. There are several ways to do this, with <a href="http://wordtracker.com">Wordtracker</a> being the most popular. Once you have done your homework and have great keyword phrases, then register your domain and start building your site.</p>
<p>If you are running a php/mysql website, then you will have urls that look like this: http://yoursite.com/index.php?task=view&#038;id=1 or something of that nature. You can change the urls, if your server allows for ModRewrite by utilizing a small file that is planted on the server. The file name is .htaccess. Now, to rewrite the files, you will need to write the file in a text editor and simply save as .htaccess or .htaccess.txt and rename on server by removing the .txt extension. In this file, using a url like the one listed above, you will want to write the .htaccess like this:</p>
<p><code><br />
Options -Indexes<br />
RewriteEngine on<br />
RewriteRule ^([0-9]+)-([a-zA-Z0-9?-]+) index.php?task=view&#038;id=$1&#038;name=$2 [L]<br />
RewriteBase /<br />
</code></p>
<p>Now is time for the php code to rename the urls. This can be done in a separate php file if so desired or on the pages that query for the urls on the site. If you use the latter, your code can look something like this.<br />
<code><br />
&lt;?php<br />
$sql = mysql_query("SELECT * FROM table_in_datbase_where_info_is");<br />
$row = mysql_fetch_assoc($sql);<br />
$url_1 = $row['id'].'-'.$row['name'];<br />
</code><br />
That will query the database and get you a link that would look like this:<br />
1-Your url name<br />
Now that we have done this, we will use php str_replace to make the link look friendlier.<br />
<code><br />
$url_1 = str_replace(" ","_",$url_1);<br />
</code><br />
That will remove the spaces and replace them with an underscore. Now to tie it all in together:<br />
<code><br />
$url = "http://yoursite.com/".$url_1.".html";<br />
echo "&lt;a href='".$url."'&gt;$row['name']&lt;/a&gt;";<br />
?&gt;<br />
</code><br />
This will now make your urls look like this: http://yoursite.com/1-Your_page_or_post_name.html. With the .htaccess file that we placed earlier, it will look for that url and place it with the same url as before based on the id of your page being 1 or the first entry found in your database. It will automatically rename every entry in the database in that table and will increase your sites search engine popularity.</p>
<p>When your url matches the keywords of the popular searched phrase with little competition, you will soon start to see a steady flow of traffic from the search engines. </p>
]]></content:encoded>
			<wfw:commentRss>http://phppig.org/35/building-a-sufficient-php-site/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mod_rewrite with .htacess to change links in rss feed</title>
		<link>http://phppig.org/30/mod_rewrite-with-htacess-to-change-links-in-rss-feed/</link>
		<comments>http://phppig.org/30/mod_rewrite-with-htacess-to-change-links-in-rss-feed/#comments</comments>
		<pubDate>Mon, 28 Dec 2009 09:07:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://phppig.org/?p=30</guid>
		<description><![CDATA[<p>The last post, we showed you how to add datafeeds to a site utilizing php and the MagpieRSS script. In this post, I am going to show you how to go one step further for search engine optimization using your .htaccess file and the str_replace command in php.</p>
<p>In the last post, I showed you how to <span style="color:#777"> . . . &#8594; Read More: <a href="http://phppig.org/30/mod_rewrite-with-htacess-to-change-links-in-rss-feed/">Mod_rewrite with .htacess to change links in rss feed</a></span>]]></description>
			<content:encoded><![CDATA[<p>The last post, we showed you how to add datafeeds to a site utilizing php and the MagpieRSS script. In this post, I am going to show you how to go one step further for search engine optimization using your .htaccess file and the str_replace command in php.</p>
<p>In the last post, I showed you how to use an rss feed from craigslist and incorporate it into your site. This time, I am going to show you how to take the same feed and rename all urls in the feed to urls that are more appropriate to your site. </p>
<p>I cannot be sure how this will react with wordpress because I have not tried it yet, however, I am going to give it a shot tomorrow and see what needs to be changed and will write a post about that.</p>
<p>In the last post, we pointed you to <a href="http://scottpdaugherty.com/mobile-al-boat-classifieds/" target="_blank">Boat Classifieds</a>. Since the last post, I have taken all of the links from that by removing the $href statement.</p>
<p>Now if you have a custom php script or would like to run this with no style, feel free to copy this into wordpad and save as index.php or whatever you choose to rename it. </p>
<p>Okay, enough of the talk, here is the code:<br />
<code>Options -Indexes<br />
RewriteEngine on<br />
RewriteRule ^boat_classifieds/([0-9]+)-([a-zA-Z0-9?-]+) http://mobile.craigslist.org/boa/$1.html</code><br />
Now to discuss what we are doing. This is telling your server to redirect all links that appear like this: www.yoursite.com/boat_classifieds/1-This_is_your_boat_ad.html to craigslist. The $1 tells the file that the first string of the url defined ([0-9]+) is the string that it will redirect to.</p>
<p>Now for the php code to actually rewrite the urls so that the urls listed actually appear to belong to your site.<code>&lt;?php<br />
require_once('magpierss/rss_fetch.inc');<br />
$url = "http://mobile.craigslist.org/boa/index.rss";<br />
$rss = fetch_rss ( $url );<br />
echo "&lt;ul&gt;";<br />
foreach ($rss->items as $item) {<br />
$href = $item['link'];<br />
$title = $item['title'];<br />
$title1 = seo_str($title);<br />
$href1 = str_replace("http://mobile.craigslist.org/boa/","",$href);<br />
$href1 = str_replace(".html","",$href1);<br />
$href = $site_url.'/boat_classifieds/'.$href1.'-'.$title1.'.html';<br />
$description = $item['description'];<br />
$description = str_replace("a href","a target='_blank' rel='nofollow' title='$title' href", $description);<br />
echo"&lt;li&gt;&lt;a href=$href target='_blank' rel='follow' title='$title&gt;&lt;h2>$title&lt;/h2>lt;/a>&lt;/li> &lt;p>$description&lt;/p>";<br />
}<br />
echo"&lt;/ul>";<br />
?></code><br />
In this code, on line 3 we define the rss feed that we are going to show on our site. Lines 6-8 grab the information from the rss feed. On line 9 we define a function that will be useful for Search Engine Optimization by replacing all irregular characters with an underscore. In the rest of the code, we define the links, description, and then show them in html with the echo command. Specifically, lines 18-20 define the new url that we are going to redirect. On line 22 we redefine how the link opens so that it opens in a new window or tab and allows your original window open.</p>
<p>Preview the code here at <a href="http://alabamatombigbeefishing.info/boat_classifieds/mobile_al.html" target="_blank">Mobile Alabama Boat Classifieds</a>.<br />
You may copy this code now and test it, modify or etc, as you see fit.</p>
]]></content:encoded>
			<wfw:commentRss>http://phppig.org/30/mod_rewrite-with-htacess-to-change-links-in-rss-feed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding RSS or XML to php site</title>
		<link>http://phppig.org/25/adding-rss-or-xml-to-php-site/</link>
		<comments>http://phppig.org/25/adding-rss-or-xml-to-php-site/#comments</comments>
		<pubDate>Wed, 23 Dec 2009 16:58:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://phppig.org/?p=25</guid>
		<description><![CDATA[<p>A lot of people locally have asked me how to add an xml or rss feed to their site. A lot of people may wonder what the benefits of adding a feed to your site and basically it keeps fresh content updating to your site. If the search engines come by and snap what you have <span style="color:#777"> . . . &#8594; Read More: <a href="http://phppig.org/25/adding-rss-or-xml-to-php-site/">Adding RSS or XML to php site</a></span>]]></description>
			<content:encoded><![CDATA[<p>A lot of people locally have asked me how to add an xml or rss feed to their site. A lot of people may wonder what the benefits of adding a feed to your site and basically it keeps fresh content updating to your site. If the search engines come by and snap what you have got from your own personal content, then more content from a feed, it helps you get more traffic for different keywords.</p>
<p>It is rather simple, so simple that anybody can do it, techie or non-techie. I am going to show you how to do it briefly and then send you to a demo page to see it in action. First, you will need an rss aggregator script. The best free script to download is magpie. You can download it <a href="http://sourceforge.net/projects/magpierss/files/" target="_blank">here</a>.</p>
<p>For this post, I downloaded Magpie RSS 0.72 and extracted it to a folder on my local machine. If you don&#8217;t have a good zip program, you can download 7zip for free <a href="http://www.7-zip.org/download.html" target="_blank">here</a>. Once you extract the Magpie archive, it should automatically unzip to folder magpierss-0.72. You will want to rename the folder magpierss.</p>
<p>Next you will need to FTP this folder into your webhost. If you don&#8217;t have good FTP software, you can download Filezilla for free <a href="http://filezilla-project.org/download.php" target="_blank">here</a>. It is Open Source and very fast.</p>
<p>Now once this is done, on the php page that you want the feed to appear, somewhere in the code you will need to add the following line:<br />
<code>&lt;?php<br />
require_once('magpierss/rss_fetch.inc');<br />
?&gt;</code></p>
<p>Once you add that bit of code to the page, wherever you want the rss feed to appear, add the following code:<br />
<code>&lt;?php<br />
$url = "your_url_here";<br />
$rss = fetch_rss ( $url );<br />
echo "Channel Title: " . $rss-&gt;channel['title'] . "&lt;p&gt;";<br />
echo "&lt;ul&gt;";<br />
foreach ($rss-&gt;items as $item) {<br />
$href = $item['link'];<br />
$title = $item['title'];<br />
$description = $item['description'];<br />
echo"&lt;li&gt;&lt;a href=$href&gt;$title&lt;/a&gt;&lt;/li&gt;&lt;p&gt;$description&lt;/p&gt;";<br />
}<br />
echo"&lt;/ul&gt;";<br />
?&gt;</code></p>
<p>If you use wordpress like I am using for this and my other blog, you can easily manipulate an rss feed into any page that you want to in your blog by adding the EXEC-PHP plugin for wordpress. It can be downloaded here: <a href="http://bluesome.net/post/2005/08/18/50/" target="_blank">http://bluesome.net/post/2005/08/18/50/</a>.Â  Once you install the EXEC-PHP plugin, activate it and then paste the code above into any page of your blog by changing the following line:</p>
<p>$url = &#8220;your_url_here&#8221;;</p>
<p>Change the your_url_here to the url of the feed that you want to add to your site. Whenever you publish this, it goes live and is available for all of your site&#8217;s visitors.</p>
<p>Preview <a href="http://scottpdaugherty.com/tombigbee-river-level-leroy-al/" target="_blank">here</a> and <a href="http://scottpdaugherty.com/mobile-al-boat-classifieds/" target="_blank">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://phppig.org/25/adding-rss-or-xml-to-php-site/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CJ affiliates and eBay affiliates: Prepare for a new set of free tools</title>
		<link>http://phppig.org/22/cj-affiliates-and-ebay-affiliates-prepare-for-a-new-set-of-free-tools/</link>
		<comments>http://phppig.org/22/cj-affiliates-and-ebay-affiliates-prepare-for-a-new-set-of-free-tools/#comments</comments>
		<pubDate>Tue, 24 Nov 2009 07:26:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Scripts]]></category>

		<guid isPermaLink="false">http://phppig.org/?p=22</guid>
		<description><![CDATA[<p>I have been showing you how to add links to your wordpress sites using the CJ api service but the code is almost ready to upload for a brand new CMS. The script will be released under GNU/GPL and will feature plug-ins that will search the CJ advertiser of your choice for your keywords in both <span style="color:#777"> . . . &#8594; Read More: <a href="http://phppig.org/22/cj-affiliates-and-ebay-affiliates-prepare-for-a-new-set-of-free-tools/">CJ affiliates and eBay affiliates: Prepare for a new set of free tools</a></span>]]></description>
			<content:encoded><![CDATA[<p>I have been showing you how to add links to your wordpress sites using the CJ api service but the code is almost ready to upload for a brand new CMS. The script will be released under GNU/GPL and will feature plug-ins that will search the CJ advertiser of your choice for your keywords in both your article posting and page posting.</p>
<p>The script features a user-friendly admin section and an SEO friendly front-end that will guarantee that your site gets higher optimization and you can start making profits strictly from organic traffic.</p>
<p>Also, a plug-in has been written to search YouTube for videos relating to your specified keywords in your post and article. </p>
<p>The script will be available to demo starting on December 1, 2009 and the code will be available immediately. </p>
<p>I look forward to seeing/ hearing from you in the future.</p>
]]></content:encoded>
			<wfw:commentRss>http://phppig.org/22/cj-affiliates-and-ebay-affiliates-prepare-for-a-new-set-of-free-tools/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>New ebay and CJ affiliate script almost ready for launch</title>
		<link>http://phppig.org/19/new-ebay-and-cj-affiliate-script-almost-ready-for-launch/</link>
		<comments>http://phppig.org/19/new-ebay-and-cj-affiliate-script-almost-ready-for-launch/#comments</comments>
		<pubDate>Sun, 22 Nov 2009 19:42:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Scripts]]></category>

		<guid isPermaLink="false">http://phppig.org/?p=19</guid>
		<description><![CDATA[<p>So, I know that I have spoken about this script several times in the past. I am in the last few days of testing and adding more features to the script before releasing it to the public.</p>
<p>The latest design has videos from youtube included in the page to show video results of whatever product you are <span style="color:#777"> . . . &#8594; Read More: <a href="http://phppig.org/19/new-ebay-and-cj-affiliate-script-almost-ready-for-launch/">New ebay and CJ affiliate script almost ready for launch</a></span>]]></description>
			<content:encoded><![CDATA[<p>So, I know that I have spoken about this script several times in the past. I am in the last few days of testing and adding more features to the script before releasing it to the public.</p>
<p>The latest design has videos from youtube included in the page to show video results of whatever product you are promoting. This feature helps sell a product, especially a music instrument. <a href="http://rockbottommusicgear.com/music_instruments/563-Behringer_CS100_CompressorSustainer_Pedal.html" target="_blank">Behringer CS100 Compressor Sustainer Pedal</a> at RockBottomMusicGear.com. RockBottomMusicGear.com isn&#8217;t the exact design of the script but it is the closest version that we have up running right now. This script uses a data feed from Zzounds.com and you click the link to go direct to Zzounds. Below that we have the ebay listings, the video results then results from commission junction advertisers.</p>
<p>If you would like to receive a beta version of this script to test out, leave a comment. When we get it ready we will offer it to our beta testers first.</p>
<p>We are still deciding whether or not to release the script under GNU open source or to copyright and sell the script, however, beta testers will receive a FREE version of the script to test drive for us.</p>
]]></content:encoded>
			<wfw:commentRss>http://phppig.org/19/new-ebay-and-cj-affiliate-script-almost-ready-for-launch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using CJ API service with WordPress</title>
		<link>http://phppig.org/5/using-cj-api-service-with-wordpress/</link>
		<comments>http://phppig.org/5/using-cj-api-service-with-wordpress/#comments</comments>
		<pubDate>Mon, 16 Nov 2009 20:14:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://phppig.org/?p=5</guid>
		<description><![CDATA[<p>Many affiliate marketers don&#8217;t know how easy the use of an API program is. I have been using the CJ API service for about two weeks and have noticed an increase in revenue because of it. Since I figured out how to put it to you in WordPress, I am going to share the code with <span style="color:#777"> . . . &#8594; Read More: <a href="http://phppig.org/5/using-cj-api-service-with-wordpress/">Using CJ API service with WordPress</a></span>]]></description>
			<content:encoded><![CDATA[<p>Many affiliate marketers don&#8217;t know how easy the use of an API program is. I have been using the CJ API service for about two weeks and have noticed an increase in revenue because of it. Since I figured out how to put it to you in WordPress, I am going to share the code with you. First, you need to download and install the EXEC-PHP plugin for wordpress. It can be downloaded here: <a href="http://bluesome.net/post/2005/08/18/50/" target="_blank">http://bluesome.net/post/2005/08/18/50/</a>.</p>
<p>Next you will need a couple of bits of information from CJ. First, if you haven&#8217;t signed up for the CJ API service, you can sign up here: <a href="http://webservices.cj.com/" target="_blank">http://webservices.cj.com/</a>. For the code to work, you will need you API number and the advertiser id. If you haven&#8217;t signed up for an advertiser that has a product catalog, now would be the time to do so.</p>
<p>Finally you will need to download the <a href="http://phppig.org/nusoap.zip" target="_blank">Nusoap library</a> by clicking the link. Unzip it and ftp into your sites root directory.</p>
<p>Once you have an advertiser that has a product catalog, you need to click on the advertiser details and look at the url. In Firefox, you are not able to edit the url but rather only view it. The url will look like this: https://members.cj.com/member/1234567890/accounts/publisher/getadvertiserdetail.do?ispopup=true&amp;<strong><span style="text-decoration: underline;">advertiserId=123456.<br />
</span></strong>I have highlighted the area by making the advertiser id bold and underlined. You will need to copy the number only and paste it into wordpad or some other text editor for now. You will also need to go to your account settings in CJ by clicking account. Click website settings and choose the site from the list of sites that you have entered that you will be making your post on. Once you get in here, copy the PID number and paste it in the same text editor file that you have saved the advertiser id on. Save the file for future reference.</p>
<p>Once you get your API number, you are ready to go.</p>
<p>Whenever you get the EXEC-PHP plugin installed into WordPress, you will now need to edit the header of your theme. You can do this by clicking Appearance &#8211;&gt;Editor. On the right hand side of the screen, you will see header. Click it. At the bottom of the code, you will need to add this snippet of code:<br />
<code>&lt;?php<br />
/*CJ API FOR WORDPRESS<br />
COPYRIGHT (C) 2009<br />
SCOTT P DAUGHERTY<br />
*/<br />
include("nusoap/lib/nusoap.php");</code><br />
<code>?></code></p>
<p>Save the header file with this code in it. Now you will be able to add the rest of the CJ API code on each individual post just as you would the twp-auction code for ebay. Now you are ready for your API id number and advertiser id. At the end of the post that you want the cj ads on, you will insert this code:</p>
<p><code>&lt;?php<br />
/*<br />
CJ API SEARCH AND RETURN<br />
PHPPIG<br />
COPYRIGHT (C)2009<br />
SCOTT P DAUGHERTY<br />
*/<br />
//Define user information<br />
$developerkey ="Your API key here";<br />
$websiteIdx ="Your website id here";<br />
$cjword = "Your keyword here";<br />
$advertiserIds = "Your advertiser id here";<br />
$serviceableArea = "";<br />
$upcOrIsbnOrEan = "";<br />
$manufacturerName = "";<br />
$advertiserSku = "";<br />
$lowPrice = "";<br />
$highPrice = "";<br />
$currency = "";<br />
$sortBy = "";<br />
$orderIn = "";<br />
$startAt = 0;<br />
$maxResultsx = 15;<br />
$soapclient = new nusoap_client("https://product.api.cj.com/wsdl/literal_wrapped/productSearchService.wsdl", true);<br />
$params = array(<br />
"developerKey" =&gt; $developerkey,<br />
"websiteId" =&gt; $websiteIdx,<br />
"advertiserIds" =&gt; $advertiserIds,<br />
"keywords" =&gt; $cjword,<br />
"serviceableArea" =&gt; "",<br />
"upcOrIsbnOrEan" =&gt; "",<br />
"manufacturerName" =&gt; "",<br />
"advertiserSku" =&gt; "",<br />
"lowPrice" =&gt; "",<br />
"highPrice" =&gt; "",<br />
"currency" =&gt; "",<br />
"sortBy" =&gt; "",<br />
"orderIn" =&gt; "",<br />
"startAt" =&gt; $startAt,<br />
"maxResults" =&gt; $maxResultsx<br />
);<br />
$proxy = $soapclient-&gt;getProxy();<br />
$result = $proxy-&gt;search($params);<br />
$count = $result['searchReturn']['count'];<br />
if($count &gt; 0) {<br />
for($i = 0; $i &lt; $count; $i++) {<br />
$advertiser_id  = $result['searchReturn']['products']['products'][$i]['advertiserId'];<br />
$advertiser_name = $result['searchReturn']['products']['products'][$i]['advertiserName'];<br />
$click_url = $result['searchReturn']['products']['products'][$i]['clickUrl'];<br />
$currency = $result['searchReturn']['products']['products'][$i]['currency'];<br />
$description = $result['searchReturn']['products']['products'][$i]['description'];<br />
$image_url = $result['searchReturn']['products']['products'][$i]['imageUrl'];<br />
$name = $result['searchReturn']['products']['products'][$i]['name'];<br />
$price = $result['searchReturn']['products']['products'][$i]['price'];<br />
$sku = $result['searchReturn']['products']['products'][$i]['sku'];<br />
$upc = $result['searchReturn']['products']['products'][$i]['upc'];<br />
echo "&lt;table border='0'&gt;&lt;tr&gt;&lt;td&gt;&lt;a href='$click_url' title='$name'&gt;&lt;font size='3'&gt;$name";<br />
echo "&lt;/font&gt;&lt;/a&gt;&lt;br&gt;&lt;font size='2'&gt;&lt;b&gt;$ $price &lt;/font&gt;&lt;/b&gt;";<br />
echo "&lt;br&gt;SKU: $sku";<br />
echo "&lt;br&gt;&lt;a href='$click_url'&gt;&lt;img src='$image_url'  title='$name'&gt;&lt;/a&gt;";<br />
echo "&lt;br&gt;&lt;font color='#000000'&gt;$description&lt;/font&gt;";<br />
echo " &lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;hr size='1'&gt;";<br />
}}<br />
?&gt;</code></p>
<p>At the top of the code, you will see the following:</p>
<p><code>$developerkey ="Your API key here";<br />
$websiteIdx ="Your website id here";<br />
$cjword = "Your keyword here";<br />
$advertiserIds = "Your advertiser id here";</code></p>
<p>Enter the information in on the appropriate lines and insert complete code into your post. It will return the results from the advertiser that you choose with your affiliate id. For an example, visit my site at <a href="http://scottpdaugherty.com/2009/11/15/choosing-a-guitar-for-a-christmas-present/">http://scottpdaugherty.com</a> to review the code in use.</p>
<input id="gwProxy" type="hidden" />
<input id="jsProxy" onclick="jsCall();" type="hidden" />
<input id="gwProxy" type="hidden" />
<input id="jsProxy" onclick="jsCall();" type="hidden" />
<input id="gwProxy" type="hidden" />
<input id="jsProxy" onclick="jsCall();" type="hidden" />
<input id="gwProxy" type="hidden" />
<input id="jsProxy" onclick="jsCall();" type="hidden" />
<input id="gwProxy" type="hidden" />
<input id="jsProxy" onclick="jsCall();" type="hidden" />
]]></content:encoded>
			<wfw:commentRss>http://phppig.org/5/using-cj-api-service-with-wordpress/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 9.260 seconds -->

