PHP updates from ws1 server to ws6
authorSteve Sutton <steve@gaslightmedia.com>
Thu, 1 Dec 2016 17:25:47 +0000 (12:25 -0500)
committerSteve Sutton <steve@gaslightmedia.com>
Thu, 1 Dec 2016 17:25:47 +0000 (12:25 -0500)
Updating the PHP code for new server.

17 files changed:
admin/del_event.phtml
admin/edit_events.phtml
admin/edit_template.phtml
admin/list_events.phtml
admin/nav.phtml
admin/path.phtml
admin/update_template.phtml
calendar.phtml
email_action.phtml
form.html
friend.phtml
glmlib/db/db_config.phtml
glmlib/graphic/glm_graphic.phtml
glmlib/std/glm_std.phtml
index.html [deleted file]
index.html.save [new file with mode: 0644]
path.phtml

index 8c53555..4e9f8a3 100755 (executable)
@@ -1,4 +1,5 @@
 <?php
+extract($_REQUEST);
 include_once("path.phtml");
 include_once(GLM_BASE."db/glm_db.phtml");
 include_once(GLM_BASE."html/glm_html.phtml");
@@ -20,7 +21,7 @@ if($topic) {
        $qs =  "UPDATE  event
                        SET             topicid='0'
                        WHERE   topicid='$id'";
-       if(!db_exec($dbd, $qs)) 
+       if(!db_exec($dbd, $qs))
                html_error($qs, 1);
 ?>
 <script lang="javascript">
@@ -48,7 +49,7 @@ else {
        $qs = "DELETE
                   FROM         event
                   WHERE        id='$id'";
-       
+
        $res = db_exec($dbd, $qs);
        if(!$res)
                html_error(DB_ERROR_MSG, 1);
index dc6c2a7..53066c1 100755 (executable)
@@ -1,4 +1,5 @@
-<?
+<?php
+extract($_REQUEST);
 include_once("path.phtml");
 include_once(GLM_BASE."db/glm_db.phtml");
 include_once(GLM_BASE."graphic/glm_graphic.phtml");
@@ -81,7 +82,7 @@ if($edittopic) {
 <?
        for($i = 0; $i < db_numrows($res); $i++) {
                $row = db_fetch_array($res, $i, PGSQL_ASSOC);
-               if($row[id] != 0) 
+               if($row[id] != 0)
                        echo "<option value=\"$row[id]\">$row[descr]</option>\n";
        }
        ?>
@@ -118,7 +119,7 @@ if($edittopic) {
 </form>
 <?
 }
-               
+
 elseif($commit) {
        /* these are all of the "event" fields */
        $vars = array(
@@ -151,18 +152,18 @@ elseif($commit) {
                                INTO    topic
                                        (descr)
                                VALUES
-                                       ('$new_topicid')";
-               $res = db_exec($dbd, $qs);
-               if(!$res)
-                       html_error(DB_ERROR_MSG, 1);
-               $oid = pg_getlastoid($res);
-               db_freeresult($res);
-               $qs =  "SELECT  id
-                               FROM    topic
-                               WHERE   oid='$oid'";
+                                       ('$new_topicid') RETURNING id";
                $res = db_exec($dbd, $qs);
                if(!$res)
                        html_error(DB_ERROR_MSG, 1);
+               //$oid = pg_getlastoid($res);
+               //db_freeresult($res);
+               //$qs =  "SELECT        id
+               //              FROM    topic
+               //              WHERE   oid='$oid'";
+               //$res = db_exec($dbd, $qs);
+               //if(!$res)
+               //      html_error(DB_ERROR_MSG, 1);
                $nrow = db_fetch_array($res, 0, PGSQL_ASSOC);
                if(!$nrow[id])
                        html_error("Empty Row! No OID: $qs", 1);
index a12e9f4..af41f1f 100755 (executable)
@@ -1,4 +1,5 @@
-<?
+<?php
+extract($_REQUEST);
 include_once("path.phtml");
 include_once(GLM_BASE."db/glm_db.phtml");
 include_once(GLM_BASE."html/glm_html.phtml");
@@ -11,10 +12,10 @@ define("STYLE","main.css");
 if(!$dbd = db_connect()) html_error(DB_ERROR_MSG, 1);
 
 if(isset($id)) {
-       $qs =  "SELECT  id,description 
+       $qs =  "SELECT  id,description
                        FROM    template
                        WHERE   id = $id";
-               
+
        if(!$res = db_exec($dbd, $qs)) html_error(DB_ERROR_MSG,1);
        $row = db_fetch_array($res,$i, PGSQL_ASSOC);
        if(!$row[id])
@@ -32,20 +33,20 @@ echo "<table cellspacing=0 cellpadding=4 width=400 align=center border=0 bgcolor
 
 
 form_header("update_template.phtml?".SID,"POST","");
-       
+
 foreach($row as $key=>$value) {
        switch($key) {
-               
+
        case "id":
        echo "<input type=\"hidden\" name=\"id\" value=\"$value\">";
        break;
-               
+
        case "description":
                echo "<tr><td class=\"navtd\" align=\"right\">Description:</td>";
                text_area("description",$value);
                echo "</tr>";
        break;
-               
+
        case "image":
                ?>
                <tr></tr>
@@ -74,7 +75,7 @@ foreach($row as $key=>$value) {
                <tr></tr>
                <tr>
                <td class="theadertd" align="center" colspan=2>
-               <span class="theader">Home Page Template</span>                         
+               <span class="theader">Home Page Template</span>
                </td>
                </tr>
                <?
@@ -83,7 +84,7 @@ foreach($row as $key=>$value) {
                text_box("header",$value, 35, 230);
                echo "</tr>";
        break;
-               
+
        default:
                html_error("need case for ->".$key,1);
        break;
index 5029e9f..00f983b 100755 (executable)
@@ -1,4 +1,5 @@
-<?
+<?php
+extract($_REQUEST);
 include_once("path.phtml");
 include_once(GLM_BASE."db/glm_db.phtml");
 include_once(GLM_BASE."html/glm_html.phtml");
@@ -72,7 +73,7 @@ $qs =  "SELECT        event.id,event.bdate,event.edate,event.header,topic.descr,
                FROM    event,topic
                WHERE   event.topicid=topic.id
                ORDER BY event.bdate ASC";
-               
+
 $res = db_exec($dbd, $qs);
 if(!$res)
        html_error(DB_ERROR_MSG, 1);
@@ -164,7 +165,7 @@ for($i = 0; $i < db_numrows($res); $i++) {
                                else
                                        echo "<img src=\"".URL_BASE
                                                        ."images/redball.gif\" alt=\"Off\" border=0></a>";
-                               
+
                                ?>
                                </td>
                                <td>&nbsp;</td>
index cf20bbe..ff27f64 100755 (executable)
@@ -1,4 +1,4 @@
-<?
+<?php
 include_once("path.phtml");
 ?>
 <HTML>
@@ -22,27 +22,27 @@ include_once("path.phtml");
                <A HREF="<?echo URL_BASE?>index.phtml" TARGET="Main">Home Page</A>
                </span>
        </TD>
-       
+
        <TD ALIGN=CENTER>
                <span class="navlink">
-               <A HREF="<?echo URL_BASE?>admin/edit_template.phtml?id=4" 
+               <A HREF="<?echo URL_BASE?>admin/edit_template.phtml?id=4"
                TARGET="Main">Template</A>
                </span>
        </TD>
-       
+
        <TD ALIGN=CENTER>
                <span class="navlink">
-               <A HREF="<?echo URL_BASE?>admin/list_events.phtml" 
+               <A HREF="<?echo URL_BASE?>admin/list_events.phtml"
                TARGET="Main">Events</A>
                </span>
        </TD>
-       
+
        <TD ALIGN=CENTER>
                <span class="navlink">
-               <A HREF="<?echo URL_BASE?>admin/logs" 
+               <A HREF="<?echo URL_BASE?>admin/logs"
                TARGET="Main">Server Logs</A>
                </span>
-       </TD>   
+       </TD>
 </TR>
 <TR>
        <TD COLSPAN=7><HR NOSHADE COLOR="#000000"></TD>
index a5329bb..76225e0 100755 (executable)
@@ -1,7 +1,7 @@
-<?
-define("URL_BASE", "/");
+<?php
+define("URL_BASE", "/www.classiccarcocoon.com/");
 define("HELP_BASE", "help/");
-define("BASE", "/home/httpd/server/www.classiccarcocoon.com/");
+define("BASE", "/var/www/server/www.classiccarcocoon.com/");
 define("UP_BASE", BASE."uploads/");
 define("IMG_BASE", URL_BASE."images/");
 /* IMAGE PATHS */
index 53b0d9a..e43c52f 100755 (executable)
@@ -1,4 +1,5 @@
 <?php
+extract($_REQUEST);
 include_once("path.phtml");
 include_once(GLM_BASE."db/glm_db.phtml");
 include_once(GLM_BASE."graphic/glm_graphic.phtml");
@@ -6,77 +7,76 @@ include_once(GLM_BASE."html/glm_html.phtml");
 include_once(GLM_BASE."html/html_config.phtml");
 include_once(BASE."admin/stdfunc.phtml");
 
-if($REQUEST_METHOD == "POST") {
+if($_POST) {
        switch($Command) {
-       
+
        case "Update":
-       
+
                if($image == "none" || $image == "") {
                        $image_name = $oldimage;
                }
-               else { 
+               else {
                        $image_name = process_image($image,$image_name);
                }
-               
+
                if($delete == "1") {
                        $image_name = "";
-                       
+
                        unlink(ORIGINAL_PATH."/".$oldimage);
                        unlink(RESIZED_PATH.$oldimage);
                        unlink(THUMB_PATH.$oldimage);
                        unlink(MIDSIZED_PATH.$oldimage);
                }
-               
+        $description = addslashes(stripslashes($description));
+
                $qs = "UPDATE   template SET
-                                               header                  = '$header',
-                                               image                   = '$image_name',
                                                description     = '$description'
                           WHERE        id                              = $id;";
-               
+
                if(!db_auto_exec($qs)) html_error("failed ->".$qs,1);
-               
-               $location = "splash.phtml"; 
-       
+
+               $location = "splash.phtml";
+
        break;
-       
+
        case "Insert":
-               
+
                if($image == "none" || $image == "") {
                        $image_name = $oldimage;
                }
-               else { 
+               else {
                        $image_name = process_image($image,$image_name);
                }
-               
-               $qs = "INSERT INTO template 
+
+               $qs = "INSERT INTO template
                                        (image,description,header)
                           VALUES
                                        ('$image_name','$description', '$header')";
-               
+
                if(!db_auto_exec($qs)) html_error("failed ->".$qs,1);
-               
-               $location = "splash.phtml"; 
-       
+
+               $location = "splash.phtml";
+
        break;
-       
+
        case "Delete":
                $qs = "DELETE FROM template
                           WHERE id = $id";
-               
+
                if(!db_auto_exec($qs)) html_error("failed ->".$qs,1);
-               
+
                unlink(ORIGINAL_PATH."/".$oldimage);
                unlink(RESIZED_PATH.$oldimage);
                unlink(THUMB_PATH.$oldimage);
                unlink(MIDSIZED_PATH.$oldimage);
-               
-               $location = "splash.phtml"; 
+
+               $location = "splash.phtml";
        break;
-       
+
        case "Cancel":
-               $location = "splash.phtml"; 
+               $location = "splash.phtml";
        break;
-       
+
        default:
                html_error("incorrect value for Command",1);
        break;
index 2db0471..1647838 100755 (executable)
@@ -1,4 +1,5 @@
-<?
+<?php
+extract($_REQUEST);
 include("path.phtml");
 include_once(GLM_BASE."db/glm_db.phtml");
 include_once(GLM_BASE."html/html_config.phtml");
@@ -8,7 +9,7 @@ if(!$dbd = db_connect())
        html_error(DB_ERROR_MSG,1);
 
 $month_id = array( "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" );
-               
+
                // Set up the $selection array to get a query box use only item fields
 $selection = array( "state" => "States" );
 
@@ -18,23 +19,23 @@ $qs = "SELECT       bdate,date_part('month', bdate) as d1_month,
                                date_part('year', bdate) as d1_year,
                                date_part('year', edate) as d2_year
                FROM    event
-               WHERE   edate > CURRENT_DATE 
+               WHERE   edate > CURRENT_DATE
                AND     visable = 't'
                ORDER BY bdate ASC;";
 
 $result = db_Exec($dbd,$qs);
-               
+
 if(!$result) html_error(DB_ERROR_MSG.$qs,0);
 
 echo "<form action=\"$PHP_SELF\" method=\"POST\">";
 for($i=0;$i<pg_numrows($result);$i++) {
-       $data = db_fetch_array($result,$i,PGSQL_ASSOC); 
+       $data = db_fetch_array($result,$i,PGSQL_ASSOC);
        $s_month = $data['d1_month'];
        $s_year = $data['d1_year'];
        $e_month = $data['d2_month'];
        $e_year = $data['d2_year'];
 
-       $watchdog = 20; 
+       $watchdog = 20;
        for( $y=$s_year, $m=$s_month; !($y==$e_year && $m==$e_month+1) ; ) {
                if( $m == 13 ) {
                        $y++;
@@ -51,64 +52,64 @@ for($i=0;$i<pg_numrows($result);$i++) {
                $m++;
        }
 }
-       
+
 // Selections part
 while( list($key,$value) = each($selection)) {
-       $qs = "SELECT  
+       $qs = "SELECT
                   DISTINCT $key
                   FROM         event
                   WHERE        visable = 't'
                   AND          edate >= CURRENT_DATE
                   ORDER BY $key;";
-       
+
        $result = db_exec($dbd,$qs);
 
        if(!$result) html_error(DB_ERROR_MSG.$qs,0);
-       
+
        echo "<select name=\"$key\">
 <option value=\"All\" selected>Show All $value\n";
-          
+
        for ($i=0;$i<pg_numrows($result);++$i) {
                $data = pg_result($result,$i,$key);
                if($data != "") {
-                       echo "<option value=\"$data\">$data\n"; 
+                       echo "<option value=\"$data\">$data\n";
                }
        }
-               
+
        echo "</select>\n";
 }
-       // topic part 
-       $qs = "SELECT   
-                  DISTINCT     ON (t.descr) t.id,t.descr  
+       // topic part
+       $qs = "SELECT
+                  DISTINCT     ON (t.descr) t.id,t.descr
                   FROM         topic t, event e
                   WHERE        e.visable = 't'
                   AND          e.edate >= CURRENT_DATE
-                  AND          e.topicid = t.id        
+                  AND          e.topicid = t.id
                   ORDER BY t.descr";
-       
+
        $result = db_exec($dbd,$qs);
 
        if(!$result) html_error(DB_ERROR_MSG.$qs,0);
-       
+
        echo "<select name=\"topic\">
 <option value=\"All\" selected>Show All Topics\n";
-          
+
        for ($i=0;$i<pg_numrows($result);++$i) {
                $data = db_fetch_array($result,$i,PGSQL_ASSOC);
                if($data != "") {
-                       echo "<option value=\"$data[id]\">$data[descr]\n"; 
+                       echo "<option value=\"$data[id]\">$data[descr]\n";
                }
        }
-               
+
        echo "</select>\n";
        // Month part (output)
-$month_qs = "SELECT 
+$month_qs = "SELECT
                         DISTINCT       bdate
                         FROM           event
                         WHERE          visable = 't'
                         AND            edate >= CURRENT_DATE
-                        ORDER BY       bdate;";        
-       
+                        ORDER BY       bdate;";
+
 $result = db_exec($dbd, $month_qs);
 
 if(!$result) html_error(DB_ERROR_MSG.$month_qs,0);
@@ -125,8 +126,8 @@ if(isset($emonths) && is_array($emonths)) {
                        echo $month_id[$m-1]." ".substr($key,3,4)."\n";
                }
        }
-}      
-       
+}
+
 ?>
 <!--- #EndCalendarofEventsSearch -->
                </select>
@@ -159,7 +160,7 @@ elseif($month != "All") {
        $y = substr($month,3,4);
        $smonth = date("m-d-Y",mktime(0,0,0,$m,1,$y));
        $emonth = date("m-d-Y",mktime(0,0,0,$m+1,0,$y));
-       $qs .= "\nAND   edate >= '$smonth' 
+       $qs .= "\nAND   edate >= '$smonth'
                         AND    bdate <= '$emonth'";
 }
 $qs .= "\nORDER BY     bdate ASC";
@@ -176,39 +177,39 @@ for($i=0;$i<db_numrows($res);$i++) {
     $start = mktime(0,0,0,$mon,$day,$yr);
     $end = mktime(0,0,0,$mon2,$day2,$yr2);
        if ($day == $day2 && $mon == $mon2 && $yr == $yr2) {
-               $dateparam = "F dS, Y"; 
-       $date_begin[$i] = ereg_replace(" 0([1-9]+)"," \\1", date($dateparam, $start)) ;
+               $dateparam = "F dS, Y";
+       $date_begin[$i] = preg_replace("% 0([1-9]+)%"," \\1", date($dateparam, $start)) ;
                $date_end[$i] = "";
        }
        elseif ($day == $day2 AND $mon == $mon2 AND $yr != $yr2) {
                $dateparam1 = "F dS, Y -";
                $dateparam2 = "Y";
-       $date_begin[$i] = ereg_replace(" 0([1-9]+)"," \\1", date($dateparam1, $start));
-               $date_end[$i] = ereg_replace(" 0([1-9]+)"," \\1", date($dateparam2, $end));
+       $date_begin[$i] = preg_replace("% 0([1-9]+)%"," \\1", date($dateparam1, $start));
+               $date_end[$i] = preg_replace("% 0([1-9]+)%"," \\1", date($dateparam2, $end));
        }
        elseif ($day != $day2 AND $mon == $mon2 AND $yr == $yr2) {
                $dateparam1 = "F dS -";
                $dateparam2 = "dS, Y";
-       $date_begin[$i] = ereg_replace(" 0([1-9]+)"," \\1", date($dateparam1, $start));
-               $date_end[$i] = ereg_replace(" 0([1-9]+)"," \\1", date($dateparam2, $end));
+       $date_begin[$i] = preg_replace("% 0([1-9]+)%"," \\1", date($dateparam1, $start));
+               $date_end[$i] = preg_replace("% 0([1-9]+)%"," \\1", date($dateparam2, $end));
        }
        elseif ($day != $day2 AND $mon == $mon2 AND $yr != $yr2) {
                $dateparam1 = "F dS, Y -";
                $dateparam2 = "F dS, Y";
-       $date_begin[$i] = ereg_replace(" 0([1-9]+)"," \\1", date($dateparam1, $start));
-               $date_end[$i] = ereg_replace(" 0([1-9]+)"," \\1", date($dateparam2, $end));
+       $date_begin[$i] = preg_replace("% 0([1-9]+)%"," \\1", date($dateparam1, $start));
+               $date_end[$i] = preg_replace("% 0([1-9]+)%"," \\1", date($dateparam2, $end));
        }
        elseif ($yr == $yr2) {
                $dateparam1 = "F dS -";
                $dateparam2 = "F dS, Y";
-       $date_begin[$i] = ereg_replace(" 0([1-9]+)"," \\1", date($dateparam1, $start));
-               $date_end[$i] = ereg_replace(" 0([1-9]+)"," \\1", date($dateparam2, $end));
+       $date_begin[$i] = preg_replace("% 0([1-9]+)%"," \\1", date($dateparam1, $start));
+               $date_end[$i] = preg_replace("% 0([1-9]+)%"," \\1", date($dateparam2, $end));
        }
        else {
                $dateparam1 = "F dS, Y -";
                $dateparam2 = "F dS, Y";
-       $date_begin[$i] = ereg_replace(" 0([1-9]+)"," \\1", date($dateparam1, $start));
-               $date_end[$i] = ereg_replace(" 0([1-9]+)"," \\1", date($dateparam2, $end));
+       $date_begin[$i] = preg_replace("% 0([1-9]+)%"," \\1", date($dateparam1, $start));
+               $date_end[$i] = preg_replace("% 0([1-9]+)%"," \\1", date($dateparam2, $end));
        }
 }
 ?>
index dfb73e5..a34fd7e 100755 (executable)
@@ -1,4 +1,4 @@
-<?
+<?php
 
 
 ## Check for required fields ##
@@ -29,7 +29,7 @@
 
 # Send email notification to site owner ##
 ##info@classiccarcocoon.com##
-mail("info@classiccarcocoon.com,daniellelynnjared@gmail.com","Contact Form Notification","                    
+mail("info@classiccarcocoon.com,daniellelynnjared@gmail.com","Contact Form Notification","
 Information from your Contact form:
 
  $f_name $l_name
index 1caf2c0..88641ae 100755 (executable)
--- a/form.html
+++ b/form.html
@@ -74,7 +74,7 @@ function MM_openBrWindow(theURL,winName,features) { //v2.0
           <td background="">
             <div class="adress">Corrosion Control Outdoors LLC</div>
        <div class="adress">Luzerne, MI 48636</div>
-       <div class="adress">Phone: 231.360.9990</div><div 
+       <div class="adress">Phone: 231.360.9990</div><div
 class="adress">E-mail: <a class="email" href="mailto:info@classiccarcocoon.com">info@classiccarcocoon.com</a></div>
                        <div id="socialMedia">
                                <a id="fb" href="https://www.facebook.com/pages/Corrosion-Inhibiting-Cocoons/158353654200049" target="_blank" title="Find us on Facebook">Facebook</a>
@@ -98,7 +98,7 @@ contact us at (231) 360-9990 to inquire</li>
         <li>Prices include shipping and handling</li>
         <li>We can custom make any size cocoon for your classic car or motorcycle - i.e:
 Tractor, ATV's, etc. <br>
-
+<!--
                        <form action="https://ws1.gaslightmedia.com/classiccar/form2.phtml">
 
           <table cellpadding="0" cellspacing="0" border="0" bgcolor="#CDDAED" align="center">
@@ -171,7 +171,7 @@ Tractor, ATV's, etc. <br>
                       <td bgcolor="#7897BD">
                         <div class="size">Large Cover 26888 Lined</div>
                         Fits Sportster size bikes<br><br>
-<br>   <div class="size">Large Cover 26888 Unlined</div> <br>                    
+<br>   <div class="size">Large Cover 26888 Unlined</div> <br>
 
 
 
@@ -227,6 +227,7 @@ Tractor, ATV's, etc. <br>
               </tr>
             </table>
           </form>
+-->
         </li>
       </ul>
       <!-- #EndEditable --></td>
index 5cd4724..db2f06b 100755 (executable)
@@ -1,19 +1,19 @@
-<?     
+<?php
 
 mail(
                "$femail",
-               "Take a look at www.tourbaycitymi.org",
+               "Take a look at www.classiccarcocoon.com",
                "
 Dear $fname,
 Your friend $yname has been to the Classic Car Cocoon website and wanted you to know about it and it's corrosion free storage for your classic car or motorcycle .
 
        http://www.classiccarcocoon.com/
-               
+
 
                ",
-       
+
                "From: Classic Car Cocoons <server@gaslightmedia.com>\nReply-To:$yemail"
                );
-                               
+
                header("Location: friendsent.html");
 ?>
index 68191c2..523b4d8 100644 (file)
@@ -1,5 +1,5 @@
-<?
+<?php
 define("DB_TYPE", "postgres");
-define("CONN_STR", "host=ds4 dbname=classiccarcocoon user=nobody");
+define("CONN_STR", "host=localhost dbname=classiccarcocoon user=nobody");
 define("DB_ERROR_MSG", "an error has occured with the database!");
 ?>
index bcf0a55..ddec46f 100755 (executable)
@@ -47,7 +47,7 @@
  *                                                                                                                                             *
  * NOTES:                                                                                                                              *
  *             This function expects "good" parameters. Make sure you                  *
- *             ereg_replace any bad escape characters (or even spaces) that    *
+ *             preg_replace any bad escape characters (or even spaces) that    *
  *             are part of $img and $timg before passing them to                               *
  *             graphic_thumb(). You may want to look at escapeshellcmd() or    *
  *             EscapeShellArg() once we upgrade to php4.03     ./muk                           *
@@ -75,7 +75,7 @@
  *             PPMQUANT                                                                                                                *
  *                                                                                                                                             *
  ***********************************************************************/
+
 function graphic_thumb($img, $timg, $type) {
        include_once(GLM_BASE."graphic/graphic_config.phtml");
 
@@ -111,7 +111,7 @@ function graphic_thumb($img, $timg, $type) {
  *                                                                                                                                             *
  * NOTES:                                                                                                                              *
  *             This function expects "good" parameters. Make sure you                  *
- *             ereg_replace any bad escape characters (or even spaces) that    *
+ *             preg_replace any bad escape characters (or even spaces) that    *
  *             are part of $img and $timg before passing them to                               *
  *             graphic_thumb(). You may want to look at escapeshellcmd() or    *
  *             EscapeShellArg() once we upgrade to php4.03     ./muk                           *
@@ -141,13 +141,13 @@ function graphic_thumb($img, $timg, $type) {
  *             PPMQUANT                                                                                                                *
  *                                                                                                                                             *
  ***********************************************************************/
+
 function graphic_resize($img, $timg, $type, $w, $h) {
        include_once(GLM_BASE."graphic/graphic_config.phtml");
        switch ($type) {
                case "image/gif":
                        $cmd = GIFTOPNM." $img | ";
-                       
+
                        if($w && $h)
                                $cmd .= PNMSCALE." -width $w -height $h |";
                        elseif($h)
@@ -166,7 +166,7 @@ function graphic_resize($img, $timg, $type, $w, $h) {
                        elseif($w)
                                $cmd .= PNMSCALE." -width $w |";
                        $cmd .= CJPEG." -outfile $timg";
-                       
+
                        break;
 
                case "image/pjpeg":
@@ -179,7 +179,7 @@ function graphic_resize($img, $timg, $type, $w, $h) {
                        elseif($w)
                                $cmd .= PNMSCALE." -width $w |";
                        $cmd .= CJPEG." -outfile $timg";
-                       
+
                        break;
 
                default:
@@ -227,15 +227,15 @@ function graphic_resize($img, $timg, $type, $w, $h) {
 function process_image ($image,$image_name) {
        include_once(GLM_BASE."graphic/graphic_config.phtml");
 
-       if(!defined("ORIGINAL_PATH")) 
+       if(!defined("ORIGINAL_PATH"))
                html_error("this not defined original_path",1);
-       if(!defined("RESIZED_PATH")) 
+       if(!defined("RESIZED_PATH"))
                html_error("this not defined resized_path",1);
-       if(!defined("MIDSIZED_PATH")) 
+       if(!defined("MIDSIZED_PATH"))
                html_error("this not defined midsized_path",1);
-       if(!defined("THUMB_PATH")) 
+       if(!defined("THUMB_PATH"))
                html_error("this not defined thumb_path",1);
-               
+
        if(!$image_upload_array = img_upload($image,$image_name,ORIGINAL_PATH))
                html_error("image could not be uploaded",1);
        img_resize($image_upload_array[1],RESIZED_PATH.$image_upload_array[0],'a',ITEM_RESIZED);
@@ -323,7 +323,7 @@ function img_resize($path2image,$path2thumb,$axis,$size) {
  *                                                                                                                                             *
  * NOTES:                                                                                                                              *
  *             This function expects "good" parameters. Make sure you                  *
- *             ereg_replace any bad escape characters (or even spaces) that    *
+ *             preg_replace any bad escape characters (or even spaces) that    *
  *             are part of $img and $timg before passing them to                               *
  *             graphic_thumb(). You may want to look at escapeshellcmd() or    *
  *             EscapeShellArg() once we upgrade to php4.03     ./muk                           *
@@ -349,8 +349,8 @@ function img_resize($path2image,$path2thumb,$axis,$size) {
  ***********************************************************************/
 
 function img_upload($form_field,$img_name,$destination_path) {
-       if (ereg('[!@#$%^&()+={};: ]',$img_name)) {
-        $img_name = ereg_replace("[!@#$%^&()+={};: ]","x",$img_name);
+       if (preg_match('%[!@#$\%^&()+={};: ]%',$img_name)) {
+        $img_name = preg_replace("%[!@#$\%^&()+={};: ]%","x",$img_name);
         $dumb = "dumber";
     }
 
index f0514ea..3546453 100644 (file)
@@ -18,7 +18,7 @@
  *                                                                                                                                             *
  * Copyright (c) 2001 by Gaslight Media Inc.                                                   *
  ***********************************************************************/
+
 /************************************************************************
  *                                                                                                                                             *
  * File Notes                                                                                                                  *
@@ -72,7 +72,7 @@
  ***********************************************************************/
 
 function std_sm($m, $del, $change) {
-       list($dollars, $cents) = split("\.", $m);
+       list($dollars, $cents) = preg_split("%\.%", $m);
        print "<h1>dollars: $dollars</h1>\n";
        print "<h1>cents: $cents</h1>\n";
        $trp = preg_split('/((\d){3})+/', $dollars);
diff --git a/index.html b/index.html
deleted file mode 100644 (file)
index dcb37f5..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-<html>
-<head>
-<title>Classic Car Cocoon, classic car cover for corrosion prevention</title>
-
-
-<META NAME="Keywords" CONTENT="Classic Car Cocoon, classic car cover, car storage bags,
-motorcycle cover, corrosion prevention, rust prevention, rust protection, carbag,
-motorcycle cocoon, motorcycle storage">
-
-
-<META NAME="Description" CONTENT="Classic Car Cocoon, classic car cover for corrosion prevention
-Corrosion Inhibiting Classic Car and Motorcycle Cocoons. This carbag, is perfect for motorcycle storage
-and helps in rust prevention and rust protection.">
-
-
-<META HTTP-EQUIV="Refresh" CONTENT="5;URL=http://www.classiccarcocoon.com/index.phtml">
-
-<body bgcolor="#CDDAED" LINK="#003366" leftmargin="10" topmargin="10" marginwidth="10" marginheight="10">
-
-
-<CENTER><A HREF="index.phtml"><IMG SRC="images/doorway1.jpg" height="212" width="385" ALT="Classic Car Cocoon, classic car cover for corrosion prevention" BORDER=0></A></CENTER>
-
-<BR CLEAR=ALL>
-<P>
-
-<CENTER>
-<TABLE WIDTH=400 BGCOLOR="#FFFFFF">
-<TR><TD>
-
-<H1><FONT SIZE="2"><B>Corrosion Inhibiting Classic Car and Motorcycle Cocoons</B></FONT></H1><BR CLEAR=ALL>
-<P>
-<BR>
-Classic Car Cocoon, classic car cover for corrosion prevention.
-Corrosion Inhibiting Classic Car and Motorcycle Cocoons. This carbag, is perfect for motorcycle storage
-and helps in rust prevention and rust protection.
-
-<BR CLEAR=ALL>
-<FONT SIZE="1">
-If you are interested in:
-<A HREF="index.phtml">Classic Car Cocoon</A>, <A HREF="index.phtml">classic car cover</A>, <A HREF="index.phtml">car storage bags</A>,
-<A HREF="index.phtml">motorcycle cover, <A HREF="index.phtml">corrosion prevention, <A HREF="index.phtml">rust prevention</A>, <A HREF="index.phtml">rust protection</A>, <A HREF="index.phtml">carbag</A>,
-<A HREF="index.phtml">motorcycle cocoon</A>, <A HREF="index.phtml">motorcycle storage</A>, look no further.
-</FONT>
-<P>
-<FONT SIZE="1">Corrosion Control Outdoors LLC<br>
-Luzerne, MI 48636<br>
-Phone: 231.360.9990<br>
-E-mail: <A HREF="mailto:info@classiccarcocoon.com">info@classiccarcocoon.com</A><BR>
-</FONT>
-</TD></TR></TABLE>
-
-</CENTER>
-
-</body>
-</html>
diff --git a/index.html.save b/index.html.save
new file mode 100644 (file)
index 0000000..dcb37f5
--- /dev/null
@@ -0,0 +1,55 @@
+<html>
+<head>
+<title>Classic Car Cocoon, classic car cover for corrosion prevention</title>
+
+
+<META NAME="Keywords" CONTENT="Classic Car Cocoon, classic car cover, car storage bags,
+motorcycle cover, corrosion prevention, rust prevention, rust protection, carbag,
+motorcycle cocoon, motorcycle storage">
+
+
+<META NAME="Description" CONTENT="Classic Car Cocoon, classic car cover for corrosion prevention
+Corrosion Inhibiting Classic Car and Motorcycle Cocoons. This carbag, is perfect for motorcycle storage
+and helps in rust prevention and rust protection.">
+
+
+<META HTTP-EQUIV="Refresh" CONTENT="5;URL=http://www.classiccarcocoon.com/index.phtml">
+
+<body bgcolor="#CDDAED" LINK="#003366" leftmargin="10" topmargin="10" marginwidth="10" marginheight="10">
+
+
+<CENTER><A HREF="index.phtml"><IMG SRC="images/doorway1.jpg" height="212" width="385" ALT="Classic Car Cocoon, classic car cover for corrosion prevention" BORDER=0></A></CENTER>
+
+<BR CLEAR=ALL>
+<P>
+
+<CENTER>
+<TABLE WIDTH=400 BGCOLOR="#FFFFFF">
+<TR><TD>
+
+<H1><FONT SIZE="2"><B>Corrosion Inhibiting Classic Car and Motorcycle Cocoons</B></FONT></H1><BR CLEAR=ALL>
+<P>
+<BR>
+Classic Car Cocoon, classic car cover for corrosion prevention.
+Corrosion Inhibiting Classic Car and Motorcycle Cocoons. This carbag, is perfect for motorcycle storage
+and helps in rust prevention and rust protection.
+
+<BR CLEAR=ALL>
+<FONT SIZE="1">
+If you are interested in:
+<A HREF="index.phtml">Classic Car Cocoon</A>, <A HREF="index.phtml">classic car cover</A>, <A HREF="index.phtml">car storage bags</A>,
+<A HREF="index.phtml">motorcycle cover, <A HREF="index.phtml">corrosion prevention, <A HREF="index.phtml">rust prevention</A>, <A HREF="index.phtml">rust protection</A>, <A HREF="index.phtml">carbag</A>,
+<A HREF="index.phtml">motorcycle cocoon</A>, <A HREF="index.phtml">motorcycle storage</A>, look no further.
+</FONT>
+<P>
+<FONT SIZE="1">Corrosion Control Outdoors LLC<br>
+Luzerne, MI 48636<br>
+Phone: 231.360.9990<br>
+E-mail: <A HREF="mailto:info@classiccarcocoon.com">info@classiccarcocoon.com</A><BR>
+</FONT>
+</TD></TR></TABLE>
+
+</CENTER>
+
+</body>
+</html>
index a5329bb..d251078 100755 (executable)
@@ -1,7 +1,7 @@
 <?
 define("URL_BASE", "/");
 define("HELP_BASE", "help/");
-define("BASE", "/home/httpd/server/www.classiccarcocoon.com/");
+define("BASE", "/var/www/server/www.classiccarcocoon.com/");
 define("UP_BASE", BASE."uploads/");
 define("IMG_BASE", URL_BASE."images/");
 /* IMAGE PATHS */