php

Jquery UI Sortable Item Contents

So I have this shopping list coded in php and js: http://www.whatcouldicook.com/recipes/planner So people can add, delete or sort the list and thats fine, I dont want multiple lists and instead just have a list item containing a heading tag to represent a new list. All this works and then using serialize I can save the ordering/modify...

Magento started showing PHP language errors since I downloaded the blank theme using Connect

I used the Magento Connect downloader to install the blank theme extension, but I did not switch to it as I was unable to access any-page anymore. Instead, it started showing php errors for front-end and Magento generated security errors for admin. Frontend Error: Fatal error: Call to a member function toHtml() on a non-object in D:\...

Mod_Rewrite: Testing URL got indexed in Google - How do I create a proper 301 redirect?

I worked on a website for which I had a "development URL" that looked something like this: www.example.com.php5-9.dfw1-2.example.com/ Now, several weeks after the website launch, there is at least one page of content indexed on Google with that URL. Question: How do I redirect all requests from that test URL to reroute to the actual ...

what is the regular expression for this

I want to parse this (adv) much (thanks) I want to eliminate the words and the bracket (adv) but not (thanks) the condition is: inside bracket, and word length inside bracket is 1-5 characters I am using preg_match in PHP Thank You ...

Replace ' " in PHP

An interesting question about str_replace. Here's the example: $search = array('A', 'B', 'C', 'D', 'E'); $replace = array('B', 'C', 'D', 'E', 'F'); $subject = 'A'; echo str_replace($search, $replace, $subject); What if I want to replace '" into something else, say -. How do I do that? The problem is I can't write something like th...

mailing system DB structure, need help

i have a system there user(sender) can write a note to friends(receivers), number of receivers>=0. Text of the message is saved in DB and visible to sender and all receivers then they login to system. Sender can add more receivers at any time. More over any of receivers can edit the message and even remove it from DB. For this system i c...

what happens with memory when I throw an exception?

This is the code (just a simplification of a real problem): <?php echo memory_get_usage() . "\n"; function f() { throw new Exception(); } function foo() { try { f(); } catch (Exception $e) { } } foo(); echo memory_get_usage() . "\n"; This is the output (PHP 5.3): 630680 630848 What happened with memory (168 ...

how to get the value of checksum in php header

I have a header in php which contains a link like <?php header("Location: "."https://abc.com/ppp/purchase.do?version=3.0&amp;". "merchant_id=<23255>&merchant_site_id<21312>&total_amount=<69.99>&". "currency=<USD>&item_name_1=<incidentsupporttier1>&item_amount_1=<1>&". "time_stamp=<2010-06-14.14:34:33>&**checksum=<calculated_...

Add widgets to custom WordPress sidebars on theme activation?

I'm working on a WordPress 3.0 multi-site installation. Each new blog will use the same theme with slight modifications (a custom Thesis install, if it matters). I'm trying to automate the set-up process for each new blog as much as possible. To that end, I'd like to automatically add widgets to my custom sidebars and widget-enabled foo...

How to echo Hyperlink Containing a Variable?

Hello, In the code below, I would like to make the word that prints out as the variable "$submittor" a hyperlink to "http://www...com/.../members/index.php?profile=$submittor" . I can't get it to work; I think I'm doing the formatting wrong. How can I do it? Thanks in advance, John echo '<div class="sitename3name">Submitted by '.$s...

Zend Framework: My custom form filter is not filtering!

So I have a form that is using a custom filter (which is really just a copy of Zend_Filter_Null). When I call it directly, it works: $makeZeroNull = new My_Filter_MakeZeroNull(); $null = $makeZeroNull->filter('0'); //$null === null However, when I try to add it to an element in my form, it doesn't filter the value when I call getValue...

Session Regeneration

I have some confusion with session handling in PHP. I know how to regenerate new session ID in PHP using session_regenerate_id();, but I don't understand why and when I should regenerate a new session ID. I have been googling for some time without avail. No one explains why I need to regenerate a new session ID. Can someone explain why...

PHP security scanner

Is there any easy to use PHP Security Scanner? Thanks a lot ...

jQuery - Animate & Time interval

<script> $(document).ready(function() { $.get("database.php", function(data){ var xp = data + "%"; $('#exp_bg').animate({ width: xp }, 1500, function() { }); }); }); </script> Database.php: <?php $xp = 50; $level = 100; $xp_percent = $xp * 100 / $level; echo $xp_percent; ?> What i'm trying to do, is that if $xp_pe...

headers already sent displays after moving files from one server to another

hey there! I have a project running on dreamhost hosting and it's working fine, but since DH has been getting really slow I'm moving the project to my new dedicated server. The thing is that after I move all of my file over to the new dedicated (ubuntu 8.4) I get see warnings all over the place telling me that the headers had been alre...

Generating cache file for Twitter rss feed

I'm working on a site with a simple php-generated twitter box with user timeline tweets pulled from the user_timeline rss feed, and cached to a local file to cut down on loads, and as backup for when twitter goes down. I based the caching on this: http://snipplr.com/view/8156/twitter-cache/. It all seemed to be working well yesterday, ...

Get Json and output to text file undecoded

Hi, I want to fetch json script and write it to a txt file undecoded, exactly how it was originally. I do have a script that I use that I am modifying but unsure what to commands to use. This script decodes, which is what I want to advoid. //Get Age list($bstat,$bage,$bdata) = explode("\t",check_file('./advise/roadsnow.txt',60*2+15))...

Oracle Blob as img src in PHP page

I have a site that currently uses images on a file server. The images appear on a page where the user can drag and drop each as is needed. This is done with jQuery and the images are enclosed in a list. Each image is pretty standard: <img src='//network_path/image.png' height='80px'> Now however I need to reference images stored as a ...

Delphi JavaDoc Parser

I need to parse JavaDoc (documentation) comment syntax with Delphi 7. It is well known in the java world as "JavaDoc", but I'm actually doing this for PHP, ie, parsing JavaDoc in some PHP code. Call it PHPDoc if you want to. To see how these comments work, you can see RAD IDEs like NetBeans etc. Example of JavaDoc for addition function:...

php script to generate checksum from md5

In order to calculate the checksum i need following things. these parameters are concatenated in a constant (no spaces) string made up of the values of the following parameters in the exact order listed below: o Secret Key o Merchant id o Currency o Total amount o Item list (item_name_1, Item_amount_1, item_quantity_1 to item_name_N, It...