Jump to content


  • Posts

  • Joined

  • Last visited

mklappen's Achievements


Contributor (5/14)

  • First Post
  • Collaborator
  • Conversation Starter
  • Week One Done
  • One Month Later

Recent Badges



  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!
  • Create New...