<?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>1</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[Site error: the file <b>/homepages/43/d374880644/htdocs/phppig/wp-content/plugins/ActionAffiliate/includes/aafunctions.php</b> requires the ionCube PHP Loader ioncube_loader_lin_5.2.so to be installed by the site administrator.
