php

Creating an efficient way of keep track of many 100's of 1000's of tagged cache id references

We currently have a table setup to keep track of cache file names or memcached key references. The table exists so that when a comment is added or more content is added the system automatically purges those cache files/key-value pairs that are affected by the update so the rebuild the next time a user accesses the page the user sees the ...

How do I access programmatically the url where my index is located in CakePHP?

Ex: echo getMyUrl(); should echo: http://localhost/myapplication ...

Whats the best way to manage keys (in memcache ) to prevent stale cached values?

Ive recently implemented memcache on my site which has been under heavy mysql load (mysql was as optimized as I could make it). It solved all my load issues, and site is running beautifully. The problem that Im facing now is stale cached values. I have 1hr auto expiration times on most pages, and Im also deleting the key when the value...

How can I break an url and store the key-words into database using php

Like http:webmail.wipro.com#a:?b; I want to break this url and store only webmail and wipro into my database. Can any one help me out with this please. Using php. ...

Why doesn't this image work?

I wrote: $im = imagecreatefromstring($im_string); return imagegif($im,'a.gif'); The content of variable $im_string I get from a ZIP file. It should work, but it returns '1'. Why is the reason? ...

Why this fails in PHP?

echo explode(' ','A B')[0] What's the right version? ...

PHP if-then-else statement not working.

My url is something such as: "inventory.php?sorting=1" and so forth. Page loads fine but does not display the information properly. mysql_connect("localhost","user","pass"); mysql_select_db("database"); if ($sorting == 1){ $result = mysql_query("select * from vehicles ORDER BY year DSC"); } elseif ($sorting == 2){ $result = mysql_qu...

Google Calendar - how to delete entries using PHP?

I'm working on syncing events from our project management DB into a google calendar using PHP. Creating events in GCal works fine, but deleting them is proving to be a real pain, especially as there aren't any examples on how to do it. Has anyone done this before in PHP (not on Zend Framework)? Thanks ...

Good PHP & MySQL Rating And Voting Script Tutorials?

Is there any good rating and voting script tutorials that use PHP and MySQL? If so can someone point them to me so I can check them out. ...

cURL sending XML incorrectly when using tag attributes

Scenario: Sending XML, generated using php, via cURL to an external server for parsing. Problem: The XML contains tag attributes which cause problems when being sent using cURL Code: $generated_xml = -- NOTE: NOT THE SYNTAX USED IN THE CODE, SPLIT FOR EASE OF READING -- "<xconnect> <report> <id>contact_get</id> <in...

Apache Dir Listing

Hi I want to allow a dir list of certain directorys, but I want to block any downloads. Basically the dir structure is Nzbs -> Alt.binaries.mp3 -> Alt.binaries.tv -> Alt.binaries.multimedia The files in the sub dirs are .zip files. I want users to be able to view the contents of the sub dirs, but not allow any downloading. Ive sea...

How to get name of the constant?

Assuming you have a constant defined in a class: class Foo { const ERR_SOME_CONST = 6001; function bar() { $x = 6001; // need to get 'ERR_SOME_CONST' } } Is it possible with PHP? ...

Convert MD5 to base62 for URL

I have a script to convert to base 62 (A-Za-z0-9) but how do I get a number out of MD5? I have read in many places that because the number from an MD5 is bigger than php can handle as an integer it will be inaccurate... As I want a short URL anyway and was not planning on using the whole hash, maybe just 8 characters of it.... So my qu...

Configuration file was not found. Url invalid. in zend server.

Hi, I am using Zend Server CE with windows XP. I am trying Virtual host. My server port is 8080. Server default document root is C:\Zend\Apache2\htdocs. and my project is on c:\workspace\projectname My Virtual host file is as follows. NameVirtualHost *:8080 <Files ~ "^\.ht"> Order allow,deny Deny from all </Files> <Virtua...

multipart/mixed email. Comes with empty body. What's wrong?

sending an email: From: <...> X-Mailer: SnowBoss Reply-To: <...> X-Priority: 3 (Normal) Message-ID: <[email protected]> To: <...> Subject: =?UTF-8?B?0JzQntCZIFNVQkpFQ1Q=?= MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----------A4D921C2D10D7DB" This is a multi-part message in MIME format. ---------...

reading first 5 fields of csv file in php

Hi, I am confused on how to read a csv file in php ( only the first 4 fields) and exclude the remaining fileds. Sno,Name,Ph,Add,PO 1,Bob,0102,Suit22,89 2,Pop,2343,Room2,78 I just want to read first 3 fileds and jump to next data. cannot figure out how to do through fgetcsv any help? Thanks, ...

Can't load text from database inside Tiny MCE Editor

Hi all, I'm using the tiny mce editor in my website and I want to load some text from database in the text area that uses tinymce. The javascript configuration for the editor is the following: <script type="text/javascript"> tinyMCE.init({ mode : "textareas", theme : "advanced", editor_selector : "mceAdvanced", plugins ...

How to record the name of the file/line that called the current function in PHP?

I am writing a lightweight logging class in php. How do I automatically record the filename/function/line number where the function in the Log class is being called from and save the line number and time and stuff without making my users bother with entering $__LINE__ and $__FILE__ every time they call the function. Is there something ...

Mysql Selection

Hi good people once again While busy traversing, iterating and manipulating my arrays from a mysql database i have stumbled on a problem, which i know you will be able to help me with - fellow geeks. I have a COLUMN the contains city names and some cities appear several times on the COLUMN. I'm using the following query to retrieve th...

Fdf (Filling online pdf form multiple times)

I use fdf to fill online pdf form. Now I want to fill the same pdf form multiple times ( entries from a database) for multiple users and save this pdf document with all the entries ( same form multiple times for multiple users). My user wants to fill this form for all the users from a table and save this pdf document for future reference...