Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by mklappen

  1. Thanks Bruce... opened ticket last night and issue has been resolved.
  2. Hi I'm doing some maintenance on an old site of mine and I have noticed that PHP code that I have had in some .htm/.html pages is showing through to browser. I checked the .htaccess in the www directory of my cpanel and it shows that I have the following: >#AddHandler application/x-httpd-php .htm .html #AddHandler application/x-httpd-php5 .php .html .htm AddType application/x-httpd-php52 .php I updated the .htaccess with >AddType application/x-httpd-php .htm But that does not correct the problem. Any ideas on what I need to do? Thanks!
  3. Thanks Bruce, will open a ticket to find out. Michael
  4. Hi Does anyone know if there are any PHP Frameworks such as symfony, cakePHP, Zend, etc... that are installed on TCH Shared Servers? if not is it something that can be installed if requested or can it only be done if you're on a dedicated server? http://en.wikipedia.org/wiki/Zend_Framework Thanks!
  5. Thanks, I did open a ticket with support and they informed me that it was installed however, I'm having some issues trying to get it to work... To get started, I'm just testing a simple script called unzip.php: ><?php $zip = zip_open('/home/mysite/public_html/cms/ziptest.zip'); if($zip != false) { echo "Zip file Opened"; ?> but when I go to execute it at www.mysite.com/cms/unzip.php I recieve the following fatal error saying function not found. Is there some sort of import call that is needed to pull in the zlib library? As always thanks for the help! Michael
  6. Does anyone know if we can get the php zip library? (for php 5.2.4 it's called zlib). If so how to we go about adding this to our server? http://us3.php.net/manual/en/ref.zip.php http://www.zlib.net/ Thanks Mike
  7. yeah i figured it out and got it fixed, found a small reference to it on php.net...when using the include whith the directory path I needed to remove my parameters after the counter.php, instead I passed them as variables using $_GET in both the counter.php and my .htm files. So just in case anyone else runs into the problem with php5 This does not work because of the URL path: ><?php include_once("http://www.mysite.com/counter.php?ip=$ip&url={$_SERVER[PHP_SELF]}"); ?> I used the follow which now has my counter working again! >//in htm file <?php $_GET['ip'] = $ip; $_GET['url'] = $_SERVER[PHP_SELF]; include_once("/home/*****/public_html/counter.php"); ?> Then I used the same $_GET calls in my counter.php script.
  8. ok, I've changed my include once to use the $_SERVER['DOCUMENT_ROOT'] but I'm now receiving the follow errors (I removed the @ from my include_once so I could see the errors it was throwing.) Not sure why it throws a failed to open stream: No Such file or directory since my include is calling something from another directory. Also don't know much about the second inclusion error. Thanks in advance for any help. >Warning: include_once(/home/mydomain/public_html/counter.php?ip=99.999.999.99&url=/mydir/mysubdir/mysubsubdir/index.htm) [function.include-once]: failed to open stream: No such file or directory in /home/mydomain/public_html/mydir/mysubdir/mysubsubdir/index.htm on line 20 Warning: include_once() [function.include]: Failed opening '/home/mydomain/public_html/counter.php?ip=99.999.999.99&url=/mydir/mysubdir/mysubsubdir/index.htm' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/mydomain/public_html/mydir/mysubdir/mysubsubdir/index.htm on line 20 This is my new include statment which is line 20 referenced in the errors above.
  9. Thanks, I will try that...I need to have the doc root since my counter script is in my home dir while the htm files are all over the place.
  10. Hi With the recent upgrade to php5/mysql5 a counter script that I created count page hits of some of my html files and store in a MYSQL DB has stopped working... Just before the header of my html file I have an @include_once function that use to execute my counter script everytime the html page was loaded. The url to the counter script contains 2 parameters (PHP_Self URL and the users ip address.) Once the counter script gets this information it updates or inserts a mysql table. I can execute the counter script manually by cut/paste it into the browser, it updates the mysql table with no issues. For some reason however it does not do this in the html file through the include_once(). This has been working for the past 6-9 months up until yesterday or the day before and code hasn't changed. Any thoughts or recommendations on how to get this working again are greatly appreciated. PHP code inside my html file. It includes the include_once() which should call the counter script every time the page is loaded. ><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en"> <?php if (getenv(HTTP_X_FORWARDED_FOR)) { $ip = getenv("HTTP_X_FORWARD_FOR"); $host = gethostbyaddr($ip); } else { $ip = getenv("REMOTE_ADDR"); $host = gethostbyaddr($ip); } @include_once("http://www.mysite.com/counter.php?ip=$ip&url={$_SERVER[PHP_SELF]}"); /* just created this var for troubleshooting...the $curl returns the correct path and parameters. If I cut paste this exact variable when renedered in browser, Mysql table is updated w/o problems */ $curl = "http://www.mysite.com/counter.php?ip=$ip&url={$_SERVER[PHP_SELF]}"; echo "CounterURL: $curl"; ?> <head> <title> page title </title> <meta> etc.... No more PHP code on page.... Here is my counter.php again this has been working on php4 for the past 6-9 months w/o issues. ><?php require_once('mysql_connect.php'); //connection to DB $URL = $_GET['url']; //get url parameter from url that is passed through the @include_once() $ip = $_GET['ip']; //get ip parameter from url that is passed through the @include_once() //troubleshooting variables...when executing from browser these variables are returned correctly echo "URL: $URL<br>"; echo "ip: $ip<br>"; $qip = "SELECT COUNT(url) as ct FROM ipaddr WHERE url='$URL' and date=CURDATE() and ip='$ip'"; $rip = @mysql_query($qip); $rowip = @mysql_fetch_array($rip,MYSQL_ASSOC); //if user ip address is NOT in db for curdate then add info to ipaddr table and counter table. if($rowip['ct'] == 0) { $i1 = @mysql_query("Insert INTO ipaddr(url,ip,date) Values('$URL','$ip','CURDATE()')"); $qurl = "SELECT url FROM counter WHERE url='$URL' and date=CURDATE()"; $rurl = @mysql_query($qurl); if(@mysql_num_rows($rurl) == 0) { $query = @mysql_query("INSERT INTO counter(url,count,date) VALUES('$URL','1',CURDATE())"); } else { $query = @mysql_query("UPDATE counter SET count=count+1 WHERE url='$URL'"); } } ?>
  11. ok, I think I remember now... it's AddHandler application/x-httpd-php .htm .html to the .htaccess file.
  12. Hi With the recent upgrade to php5 it appears that my HTML pages that contain php code are no longer working. I recall when I was first setting up these pages I needed to update a file to enable php code within an html file. However, I can't remember what file it was that I updated... .htaccess? or what I updated it with! Anyone have an idea what I'm referring to ? Any help is appreciated. Thanks Michael
  13. Thanks, I've added the following to my script but I still get an error: <?php ini_set('include_path', "/usr/local/bin/pear". ini_get("include_path")); require_once ('File/SearchReplace.php'); ... ?> Error: Warning: main(File/SearchReplace.php) [function.main]: failed to open stream: No such file or directory in /home/mysite/public_html/test.php on line 6 Fatal error: main() [function.require]: Failed opening required 'File/SearchReplace.php' (include_path='/usr/local/bin/pear.:/usr/lib/php:/usr/local/lib/php') in /home/mysite/public_html/test.php on line 6 Thanks Mike
  14. Hi From reading the forums I've found that PEAR is installed on TCH servers but I'm not sure how to call from my PHP script. I'd like to use the File_SearchReplace() function but I'm not where this module is located on the server to make the require_once 'File/SearchReplace.php'; or include statement. http://pear.php.net/manual/en/package.file...archreplace.php Thanks Mike
  15. very frustrating but I was able to do this through a php script...guess it doesn't work from phpmyadmin. Thanks!
  16. Thanks, that's what I thought but my sql is not working from within phpmyadmin. Below is the full query I'm trying to run. I've set up the table with the 427 columns(yes, that many columns) and the text file is in my public_html folder. I'm going to need to do this for other data as well so if possible I'd like to get it working so I can do it on my own... >LOAD DATA LOCAL INFILE '/home/*****/public_html/One.txt' INTO TABLE OneOrMore FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\n'( Gram, doc1, doc2, doc3, doc4, doc5, doc6, doc7, doc8, doc9, doc10, doc11, doc12, doc13, doc14, doc15, doc16, doc17, doc18, doc19, doc20, doc21, doc22, doc23, doc24, doc25, doc26, doc27, doc28, doc29, doc30, doc31, doc32, doc33, doc34, doc35, doc36, doc37, doc38, doc39, doc40, doc41, doc42, doc43, doc44, doc45, doc46, doc47, doc48, doc49, doc50, doc51, doc52, doc53, doc54, doc55, doc56, doc57, doc58, doc59, doc60, doc61, doc62, doc63, doc64, doc65, doc66, doc67, doc68, doc69, doc70, doc71, doc72, doc73, doc74, doc75, doc76, doc77, doc78, doc79, doc80, doc81, doc82, doc83, doc84, doc85, doc86, doc87, doc88, doc89, doc90, doc91, doc92, doc93, doc94, doc95, doc96, doc97, doc98, doc99, doc100, doc101, doc102, doc103, doc104, doc105, doc106, doc107, doc108, doc109, doc110, doc111, doc112, doc113, doc114, doc115, doc116, doc117, doc118, doc119, doc120, doc121, doc122, doc123, doc124, doc125, doc126, doc127, doc128, doc129, doc130, doc131, doc132, doc133, doc134, doc135, doc136, doc137, doc138, doc139, doc140, doc141, doc142, doc143, doc144, doc145, doc146, doc147, doc148, doc149, doc150, doc151, doc152, doc153, doc154, doc155, doc156, doc157, doc158, doc159, doc160, doc161, doc162, doc163, doc164, doc165, doc166, doc167, doc168, doc169, doc170, doc171, doc172, doc173, doc174, doc175, doc176, doc177, doc178, doc179, doc180, doc181, doc182, doc183, doc184, doc185, doc186, doc187, doc188, doc189, doc190, doc191, doc192, doc193, doc194, doc195, doc196, doc197, doc198, doc199, doc200, doc201, doc202, doc203, doc204, doc205, doc206, doc207, doc208, doc209, doc210, doc211, doc212, doc213, doc214, doc215, doc216, doc217, doc218, doc219, doc220, doc221, doc222, doc223, doc224, doc225, doc226, doc227, doc228, doc229, doc230, doc231, doc232, doc233, doc234, doc235, doc236, doc237, doc238, doc239, doc240, doc241, doc242, doc243, doc244, doc245, doc246, doc247, doc248, doc249, doc250, doc251, doc252, doc253, doc254, doc255, doc256, doc257, doc258, doc259, doc260, doc261, doc262, doc263, doc264, doc265, doc266, doc267, doc268, doc269, doc270, doc271, doc272, doc273, doc274, doc275, doc276, doc277, doc278, doc279, doc280, doc281, doc282, doc283, doc284, doc285, doc286, doc287, doc288, doc289, doc290, doc291, doc292, doc293, doc294, doc295, doc296, doc297, doc298, doc299, doc300, doc301, doc302, doc303, doc304, doc305, doc306, doc307, doc308, doc309, doc310, doc311, doc312, doc313, doc314, doc315, doc316, doc317, doc318, doc319, doc320, doc321, doc322, doc323, doc324, doc325, doc326, doc327, doc328, doc329, doc330, doc331, doc332, doc333, doc334, doc335, doc336, doc337, doc338, doc339, doc340, doc341, doc342, doc343, doc344, doc345, doc346, doc347, doc348, doc349, doc350, doc351, doc352, doc353, doc354, doc355, doc356, doc357, doc358, doc359, doc360, doc361, doc362, doc363, doc364, doc365, doc366, doc367, doc368, doc369, doc370, doc371, doc372, doc373, doc374, doc375, doc376, doc377, doc378, doc379, doc380, doc381, doc382, doc383, doc384, doc385, doc386, doc387, doc388, doc389, doc390, doc391, doc392, doc393, doc394, doc395, doc396, doc397, doc398, doc399, doc400, doc401, doc402, doc403, doc404, doc405, doc406, doc407, doc408, doc409, doc410, doc411, doc412, doc413, doc414, doc415, doc416, doc417, doc418, doc419, doc420, doc421, doc422, doc423, doc424, doc425, dstar ) Thanks for your help Mike
  17. I'm trying to import a txt file, into one of my DBs but I keep getting a "file not found" error. Sorry if this is a repeat question but I've read all the post I can find on this and I can't seem to get the sql to work. >LOAD DATA LOCAL INFILE '/home/www.mysite.com/public_html/One.txt' INTO TABLE OneOrMore FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\n' (Gram, doc1, doc2, doc3, doc4, doc5); I know it has something to do with my infile location but I don't know what it is...in other posts I've seen it as /home/cpanelName/public_html/file.txt but what is my cpanelName, is it just my user name? If so that doesn't seem to be working any more than putting domain name url as I show above. Thanks in advance. mike.
  18. I'll give it a try, thanks for the quick replies!
  19. Hi I have convinced a friend to transfer a site I manage for them to TCH, I read through other posts but didn't find answers... When I have them open a TCH account how long does a transfer normally take? The site is currently hosted on Geocities, will I need to manually ftp the files from there to the new TCH account or is copying the files part of the process of transferring? Finally, how difficult is it to transfer the actual website name to someone else? (i.e. Current owner of www.website.com wants to give sitename to new owner). Is that something that can be done through TCH? Sorry for all the questions. Thanks mk
  20. Hi I didn't know which forum to post this question in so I just picked Open Discussion. Has anyone ever used Toad for MySql with the TCH MySQL databases? http://www.toadsoft.com/toadmysql/toad_mysql.htm I'm trying it out but can't figure out how to get it to connect from my PC to a remote db on my site. For TCH what is the Host name for DBs? www.mysite.com/localhost ? Thanks mk
  21. Thanks for your help. I didn't realize that about the include function, it's good to know. My work around was to pass a PHP_SELF into the counter.php url and then GET that. Thanks to everyone who helped! Mike
  22. Hi I'm trying to add a very basic and simple email form to a site and for some reason I'm getting the 500 Internal Server Error. I've followed the step by step instructions here http://web.mit.edu/wwwdev/cgiemail/user.html , created my email template, but I still can't get it to work! I have my emailform.txt located in the /public_html directory but have also tried it in other directories /cgi-bin (and others) changing the action each time, with no luck. (I've also used the fill link in my form action="http://www.mysite.com/cgi-bin/cgiecho/emailform.txt") Can someone point me in the right direction? Here's my form: <form method="post" action="/cgi-bin/cgiecho/emailform.txt" enctype="text/plain"> Email address: <input type="text" name="email" size="30" maxlength="75" style ="font-size: 10; background-color: #CCCCCC; border: 1px solid #666666;"> <input name="Submit" type="submit" value="Submit" class="buttons" style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #000; background-color: #FFCCFF; " /> </form> Thanks MK
  23. Hi I've posted a few times while creating this and now I'm starting to regret taking on writing a "simple" counter script myself… But I'd still like to finish what I started. I created a script called counter.php(shown below) and uploaded it into my public_html folder. I have also placed <?php @include_once www.mysite.com/counter.php?> into the pages I want counted. My problem is that when I load the html pages, it doesn't seem to get a $URL variable from the $URL=$_SERVER('HTTP_REFERER'); line in my counter.php. When I place the counter.php script in the same directory of my html pages $URL gets an ugly value of http://www.mysite.com:2082/frontend/x2/fil...&file=index.htm Does anyone know why I can't get a value for $URL when the counter.php is located in any folder other than the one my webpages are in? Is there some file permissions in public_html that I'm missing? Is there a better way I can accomplish this? I've read other msg boards/php sites that say HTTP_REFERER doesn't always act as it should but I can't find anything else comparable. <?php require_once('mysql_connect.php'); $URL=$_SERVER['HTTP_REFERER']; $dt = date("Y-m-d"); $q1 = "SELECT url FROM counter WHERE url='$URL' and date='$dt'"; $r1 = mysql_query($q1); if(mysql_num_rows($r1) == 0) { //url has not been counted on date=$dt $query = mysql_query("INSERT INTO counter(url,count,date) VALUES('$URL', '1','$dt')"); } else { $query = mysql_query("UPDATE counter SET count=count+1 WHERE url='$URL'"); } ?> Thanks for your help Mike
  24. Please disregard.... the query: $qu = mysql_query("INSERT INTO counter(url, count, date) VALUES ('$URL', '1', '$dt'"); was missing a close paren at the end, should have been. $qu = mysql_query("INSERT INTO counter(url, count, date) VALUES ('$URL', '1', '$dt')"); Thanks!
  • Create New...