php

problem in changing the direction of jquery treemenu

hey guys , i have used the popular treemenu plugin for my project ,but the only problem i have is with direction . as you may see , it shows menus in LTR direction and icons of folder and file floating left side http://jquery.bassistance.de/treeview/demo/ question is how can i change the directio to rtl believe me , it takes me on...

PHP explode and set to empty string the missing pieces

What's the best way to accomplish the following. I have strings in this format: $s1 = "name1|type1"; //(pipe is the separator) $s2 = "name2|type2"; $s3 = "name3"; //(in some of them type can be missing) Let's assume namen/typeN are strings and they can not contain a pipe. Since I need to exctract the name/type separetly, I do: $te...

Using nohup mysqldump from php script is inserting a '!' and breaking to a new line.

I'm trying to run a mysqldump from php using the nohup command to prevent the script from hanging. Here's the command (The database is mc6_erik_test, everything else is just a table list until you get to the end) exec("mysqldump -u root -pPassword -h vfmy1-dev.mountainmedia.com mc6_erik_test access_log admin affiliate affiliate_2_produ...

Include a repetitive chunk of HTML

I basically have a div on my site that always has the same stuff. However, this div is not present on all pages which is why I won't use the dynamic web template. I was wondering if it was possible for PHP to get the code from a document on the server and put in into the div? Ex: <div id="section... then my text file contains <p>hel...

jQuery ajax multiline "script" response

I'm designing a template creation tool, which uses a jQuery Ajax request that posts parameters to a PHP file. The PHP does the actual generation of the template's HTML. // Send for processing. Expect JS back to execute. function generate() { $.ajax({ type: "POST", url: "generate.php", data: $('#genform :input').serialize(), ...

Handling snippets and views in MVC

Hi, if I have a page on my site where i have to show 4 or 5 snippets (news feeds, event feed etc), all relating to different data (in different models and db tables), then what is a sensible way to handle the generation of the snippet content and layout? i could use a single snippet controller which contains static functions which each r...

Are there any libraries (or using GD2 or Image Magick) to allow the upload and processing of EPS or Vector files?

I need to allow for scaling a user uploaded logo to different sizes for different formats, are there any libraries (included or extra) that allow for the procesing of EPS files or high res artwork for this purpose? ...

Listening to PHP function calls to intercept the returned value

I am working on making use of a Web Services API offered by the hosts of our internal system. I am accessing it via PHP with the built-in SOAP offering. The API session is initiated by a remote call to a function that returns some session tokens; every call to any function thereafter will return a new session token, which must accompany...

PHP Include and accents (They show up as �)

I'm using PHP include to include a PHP file that has HTML in it. some of the content has french accents and these show up as � on the site. How can this be solved? Thanks Here is the PHP file I include: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; <html di...

Doctrine Update by DQL + field with parenthesis: "(" and ")"

Hello! I have a doctrine update query to save my data: $customer = Doctrine_Query::create() ->update('Customer') ->set('fax',"'". $this->getRequest()->getParam('fax')."'") ->where('id ='.$this->getRequest()->getParam('id')) ->execute(); The problem is that the field fax has parenthesis and doctrine returns an ...

Getting msn contact list and sending e-mail via msn on PHP

Is there any class for it i found some classes but they were old so not working. I need a code snippet or a class for getting msn contact list with username and password. And is it possible sending mail via hotmail instead of php's mail function ...

Yahoo Video Upload with cURL

I want to use cURL to post a video to Yahoo Video. I planned to make two calls to yahoo as follows: call to sign in to an existing account and store the returned cookie call to send the cookie, collected video metadata (title, description, etc.), AND the file But the problem is that apparently, the original Video Upload form sends th...

Why does this PHP script interfere with my CSS layout?

This page uses $_GET to grab an asset id and query a mysql database and return some information. If 'id' does not match anything, no results are displayed but the page looks fine. If 'id' is null an error would occur at $id = $_GET["id"] or die(mysql_error()); When this occurs, they page layout is not displayed correctly. How do I fi...

URI routing in codeigniter

I have my CI site working well except the URL's are a bit ugly. What approach should I take to enable me to route what is displaying at: http://domain.com/content/index/6/Planning to the url: http://domain.com/Planning I'm confused about whether this should be be done in the routes file or in my .htaccess Thanks ...

Any way to chunk gzip with Apache and PHP

I have a web application on a site that takes a while (~10 seconds) to complete a portion of the page near the bottom - it has been as optimized as it can be, and caching is not an option. We have compression enabled on the server via an .htaccess directive SetOutputFilter DEFLATE the problem is this causes the whole page to be held unt...

Not being prompted to download CSV file.

I've created a custom solution in WordPress that will generate a CSV file to be downloaded by clicking a simple hyperlink, linked directly to this file. Instead of being prompted to download the file to the computer; the CSV opens in the the browser window instead. FWIW I'm on Media Temple using a vanilla install of WordPress. ...

The largest prime factor with php

So, I wrote php program to find the largest prime factor with php and I think it is quite optimal, because it loads quite fast. But there is a problem, it doesn't count very big numbers's prime factors. Here is a program: function is_even($s) { $sk_sum = 0; for($i = 1; $i <= $s; $i++) { if($s % $i == 0) { $sk_sum++; }...

Is it bad for performance to extract variables from an array?

Hi everyone, I have found out about the great extract function in PHP and I think that it is really handy. However I have learn that most things that are nice in PHP also affects performance, so my question is which affect using the extract can have, seen in a performance perspective? Is it a no-no to use for big applications to extrac...

WinService hosted WCF + PHP client, and disabled service

Hi, I have implemented a WCF service hosted on Windows Service. I want to consume it with PHP. Everything works OK for now, but problem is when I stop my win. service. Consuming it with .NET application I get EndpointNotFoundException. But using PHP I get HTTP Error 500.0 - Internal Server Error This is my PHP code: <?php header('Con...

How can I detect the domain that is parsing my RSS feed?

I've got a php rss feed. There's a lot of domains that are using my RSS feed for news. I'd like to be able to track which domains are using my rss feed. I tried using $_SERVER['http_referrer'] to no avail. Any ideas? ...