php

install imap in windows

I'm trying to write a script in php that requires imap functions. I found the functions at here. How do I download and install it in windows ? ...

How to remove $_SERVER['DOCUMENT_ROOT'] from a given string in PHP

How can i remove $_SERVER['DOCUMENT_ROOT'] from a string like this /home/bla/test/pic/photo.jpg the result should look like this /test/pic/photo.jpg I also need to take the photo.jpg from /test/pic/photo.jpg How can i do that i PHP? Thank ...

javascript image picker php

im having dynamically created image tags, in php foreach function img scr=asdfsf.gif... so if i click on a particular image the src of the image store in a javascript variable should not use onclick, use binding the image javascript.. ...

How can I decode json in PHP 5.1 ?

json_decode function is not part of PHP 5.1, so I cannot use it. Is there any other function for this version? ...

PHP: building (X)HTML output with DOM - pros and cons?

I just started out with a new site and I decided to use DOMImplementation for building the complete site. What do you think about this, is it fast enough? I expect it to be quite a bit slower than the basic print method. I prefer the DOM one because it allows greater flexibility when building the final output, not to mention the more er...

Disable error_log. Error_log flooding

Hello, i got an webserver running and old version of gambio (xt:commerce fork). The error_log in the dir over the public_html is flooding with errors. About 30mb in 15min. How can I disable this log? I can't fix all the errors. Here are a few examples of the errors: [warn] mod_fcgid: stderr: PHP Notice: Undefined variable: key in /u...

Inserting html code in a mysql table

Hi everyone... I use joomla to manage a website... and i am developing a stand alone php application that will insert and modify data into the tables that are used by joomla to store the html of webpages that it dynamically creates... The way it works is i use a joomla component to create content and the html code of these articles ar...

tidy_parse_string expects exactly 1 parameter, 2 given

I have HTML tidy extension on my home computer using PHP 5.2.11 (Windows - WAMP), and I use this to clean up HTML: $data = tidy_parse_string($data, array( 'clean' => TRUE, 'indent' => 0, 'output-xhtml' => true, 'wrap' => 7000, )); This works great on my home machine, but on the actual server on which the website run...

How do I distinguish files and folders on an FTP server

I want to list all files on an FTP server using PHP. According to RFC 959 the FTP command LIST is allowed to print arbitrary human-readable information on files/folders, which seems to make it impossible to determine the file type correctly. But how do other FTP clients manage to distinguish files and folders? Is there an unwritten stand...

Interface and abstract public function

It seems to me that both interface and abstract public function are quite similar, it's like an order that some method must be implemented, so what's the difference? ...

I'm building an online snippet management website, is there a control that I can use to visualize code and color code source according language?

You guys know in Pastebin how according to the selected language, the code is colored? Is there a control I can use on my site? I'm using PHP and Zend Framework. Edit: I was thinking something along the lines of: CodeControl mycontrol = new CodeControl(sourcecode.txt, 'c#'); or CodeControl mycontrol = new CodeControl(sourcecode.txt...

Decoding html entities issue

I have the following line of text that I need to display <ul><li>Complementary to cleansing with HY-ÖL®<li>Especially for irritated and sensitive skin<li>Noticeably calms and relaxes the skin</ul> if I do the following html_entity_decode('<ul><li>Complementary to cleansing with HY-ÖL®<li>Especially for irritated and sensitive skin<l...

XML Parser in PHP

I am using php 5.3 but when i try read an xml using xmlparser which shows the error Fatal error: Class 'XMLParser' not found .Please help me to solve this.. ...

How to use apache logs to check complete file downloads.

Hello, I have a file hosting site thats using this script MFHS. I want to develop a point system of my own in which points will be rewarded only if the visitor downloaded the whole file. How can I track it and where are the logs relating to it saved in apache? I am using unbuntu server. Or else is there any easier way? The average fi...

Create function not existing in class with NetBeans PHP

Howdy, i have seen a lot of screencasts where the author is creating methods with the following way: $myObj = new myObj(); $myObj->getAllMyWhatEver($xyz); The "getAllMyWhatEver" function is not existing yet, he is clicking some kind of key and the function is created in the proper class. Does someone knows how to do this in Netbeans...

Previewing PHP files within Subversion?

So after our codebase had become unmanageable, we finally decided to set up subversion for a web project I work on with a few friends. We've successfully set up a trunk and branches for each developer. We're working with PHP. What I'm wondering is, is if there's any way to actually view a PHP file's output from within Subversion so th...

Modifying view from Action Helper in Zend Framework

I want to modify a view from Action Helper in Zend Framework in preDispatch() method. So I do something like: class MyHelper extends Zend_Controller_Action_Helper_Abstract { public function preDispatch() { $view = $this->getActionController()->view; $view->doSomething(); } } Is it OK to do so? What I want to do...

What is encoding characters the URL? Browser or PHP?

Imagine this simple form <form action="<?php echo $_SERVER['REQUEST_URI']; ?>" method="post"> <fieldset> <legend>Contact Me</legend> <label for="email">Email:</label> <input type="text" name="email" id="email" /> <button type="submit">Submit</button> </fieldset> </form> Now imagine it is accesse...

how to delete a file via PHP

Hi, how do I delete a file e.g 22.pdf from my server with php if the file is in an other directory page layout: projects/backend/removeProjectData.php (this file deletes all my entries for the database and should also delete the related file) public_files/22.pdf (the place where the file is located) now I'm using the unlink('../../p...

Insert Image into Excel cell(s) using ActiveXObject ("Excel.Application")

I have a PHP Web Application, which uses the ActiveXObject to export the contents of a table into an Excel spreadsheet. I have a bit of formatting (cell alignment, currency, dates, etc,.) for some cells, but I need to merge the top 3 cells and then import an image. I've been searching, but haven't had any joy. If anyone knows if this is ...