php

How to handle upload of .php files without possibility of executing them?

I want to allow my users to upload .php files to the server, but also want to make sure the files are harmless to my application. Any suggestions? Thank you. ...

Some Q regarding SOLR and how it actually works!

I have a classifieds website, and I have currently around 100thousand ads in a mysql table. I am using php to fetch results and to display them on a page. However, I am noticing the searches getting slower and slower. That is why I am planning on installing and using SOLR, as I have heard good things about it. But to my suprise, I have...

Disabling cURL echoing everything out, throws 'access violation'

I've got something like the following lines of PHP code (on IIS): $service_url = 'http://some-restful-client/'; $curl = curl_init($service_url); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); $curl_response = @curl_exec($curl); curl_close($curl); When executing this I get the following exception PHP has encountered an Access Vio...

php xml eacute error

hi,please help me here.i got this error <Name>secret CAKES &amp; CAF&Eacute; imited</Name> XML Parsing Error: undefined entity Location: http://localhost/xml.php in my php htmlentities($row['companys'],ENT_QUOTES) ...

Export to PowerPoint (*.ppt)

Hi all, do you have any idea how to export html/xml/json data into PowerPoint format in php? Tanks in advance ...

How to launch php script binded to different ip adresses?

I’ve got ethernet interface on FreeBSD 7.1 with 3 ip adresses binded to it. # ifconfig em0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 options=19b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4> ether 00:e0:81:b1:1b:4b inet 89.xx.xx.1 netmask 0xfffffc00 broadcast 89.xx.xx.255 inet 89.xx.xx.2 netmask 0x...

htaccess url RewriteRule

Hello, This is my url http://mydomain.com/Anonymous/47/comments.php My file hosting script contains lots of rewrites, So how can I redirect this particular type of url to comments.php without conflicting with other rewrites. My htaccess file Options +FollowSymLinks RewriteEngine on ##point to installation directory ##if it is ...

Opensource CMS that allows defining editable regions

I'm looking for an opensource lightweight CMS for those situations where you would like to be able to set up a web site with some editable content regions, but don’t want to have to install a full-blown CMS or try to hack a blogging system in order to do the job. Something similar to Perch or Cushy CMS, but free and opensource ofcourse. ...

Optional belongsTo relationship in cakephp

Hi SO, I have a simple Category model in my CakePHP application. I want to add sub-categories, and do this by simply adding a parent_id column. The parent_id is a belongsTo relationship, that references back to the same Category model. When I generate my admin scaffolds, a dropdown will shop up (correct!), but I'd like to include a NU...

PHP forcing file download. Not showing what amount of space has been downloaded

I have a issue, I have a PHP script that compresses images in a Zip file and then forcing the zip file to download. Now my issue is it's not showing in IE how much space has been downloaded sofar. Eg 2MB's out of 20MB's..... 15secs remaining. Firefox works perfect. My code header("Content-Disposition: attachment; filename=" ...

Is it possible to integrate jetpay merchant services in MAGENTO

Hi all, Is it possible to integrate jetpay merchant services in MAGENTO If yes, HOW? If No, WHY? thanks in advance Fero ...

Querying a MySQL database step by step - Best method?

Hi, I am building a web application that uses PHP 5, MySQL 5 and Javascript with jQuery and AJAX. The application is a quite complicated selection process with several pulldown menus that the user can select from in any order. Each select in a pulldown will give some more selection critera, that will limit the choices in the other pull...

How to serve gziped an otf font using htaccess+php.ini? (no mod gzip or deflate)

Im asking this here cause if i try more i think im going to lose my mind for sure it seems i can't use php_value or php_flag but linking a php.ini using suPHP_ConfigPath works (for php files) here's a list of stuff i tried in random order: AddHandler application/x-httpd-php .otf AddType default_mimetype application/vnd.oasis.opendocumen...

How to tell who is calling web service (PHP on Apache)

I am creating a web service using php's SoapServer built-in class. I have run some basic tests and it seems to be working fine, but now I need to limit who can use the service. Assuming that only other scripts on the same server are trying to consume my service, and that they would do this server-side (as opposed to with AJAX or similar...

Convert FLV to MP4 or 3GP

Can I convert videos with PHP or do I have to use some library? ...

How do I query on a number in Zend Lucene?

How can I create a Query to search for a number? $query->addTerm(new Zend_Search_Lucene_Index_Term('1', 'id'), null); $query->addTerm(new Zend_Search_Lucene_Index_Term('frank', 'name'), null); $queryP = Zend_Search_Lucene_Search_QueryParser::parse($query); $hits = $ix->find($queryP); echo $queryP; Returns; ...

Storing A PHP Object In A Session Variable

Hi guys, I'm new to OOP and am writing one of my first classes. I work for an insurance broker and am trying to use a Class to store things about a quote, and store the Object as a session variable. Thing is, when I view the session variables, I get: sessionName __PHP_Incomplete_Class Object ( [__PHP_Incomplete_Class_Nam...

Is there a built in function to retrieve domain name of url in PHP?

If the url is http://www.google.com/url?sa=t&amp;source=web&amp;ct=res&amp;cd=1&amp;ved=0CAsQFjAA&amp;url=https%3A%2F%2Fwww.google.com%2Fadsense%2F&amp;ei=1AdLS5HSI4yQ6APt6Ly-BQ&amp;usg=AFQjCNHKn8TzGhRO1eUfLhB79AVU-_FnGQ&amp;sig2=EGlbrGQ3jTQdTViEt14cYg, I need the result to be :google.com ...

Is this grammar not LR(1)?

I'm working on parse generator for PHP. Currently I'm trying to implement canonical LR(1) parser, but it outputs reduce-reduce conflict on following grammar. Is this grammar not LR(1)? Or should I recheck my algorithms? Grammar in Bison(-like) notation: syntax : toplevels rules ; toplevels : toplevel | toplevel toplevels ;...

simple php function

I wanna be able to get everything from a signed in user. Like, username, email, msn, and alto more with a function like: echo getUserInfo('email'); gets the content of "email". but it does not work, see below: My function: function getUserInfo($field) { global $userID; $sql = mysql_query("select * from users where id = $userID...