php

PHP mysql_real_escape_string() returning `NULL`

I'm using PHP Version 5.1.6 and trying to escape a query string from my $_GET array. However my script is returning a NULL after it's escaped. It seems that mysql_escape_string() works fine, but it's deprecated, so I don't want to use it. Having checked over the phpinfo() the MySQL lib is all loaded fine from what I can see. Has anyone...

PayPal IPN Security

PayPal IPN sends a POST request with a variable number of fields to the notify URL, in order to confirm that the POST request is legit we need to resubmit the same request along with a additional cmd=_notify-validate field to PayPal, which then replies VERIFIED or INVALID. My question is, why do we need to resend the request to PayPal? ...

sorting array after array_count_values

hi to all! I have an array of products $products = array_count_values($products); now I have an array where $key is product number and $value is how many times I have such a product in the array. I want to sort this new array that product with the least "duplicates" are on the first place, but what ever I use (rsort, krsort,..) i loo...

one variable and multiple controllers..

I'm working on a web application, using the CAKEPHP framework. Herefor i need to request one variable on multiple pages (all pages have different controllers). it is oubvious that i get a error on several pages, since the variable isn't declared in all the different controllers. Is there a workaround for this? i've already tried the ap...

joomla virtuemart site loading issue

I have a Joomla site, integrated with virtuemart in it. have almost 9,000 products. it is not loading the site when i select a manufacturer from a module, which must list all products. Same problem is in the case of categories(have 2 categories). error is FastCGI Error Number: 258 (0x80070102) when I have only 250 products, it was fas...

How to check if the word is Japanese or English using PHP

I want to have different process for English word and Japanese word in this function function process_word($word) { if($word is english) { ///////// }else if($word is japanese) { //////// } } thank you ...

Jump to function declaration in php

HI, I have the following ide's for php Dreamweaver php-Eclipse Textpad I wish to jump to a function's definition which is located in another file which is not yet open. How could I do that. I am studying a websites code and have the entire directory struction in my local root folder. I come accross certain functions and I dont know i...

error while moving an uploaded image

Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phptMeFd4' to './photogallery/4bf2806a0d80c4ad68aa5e4e20dscn6842.jpg' in /some path/addsplashphoto.php on line 49 am trying to upload photo to a destination folder in my server but each and every time an error like above is appearing..same code is working ...

How to change the attribute value of svg file

Hello, In samplexml.svg there is a node <image width="744" height="1052" xlink:href="image1.png"/> I need to replace "image1.png" with another value like "image2.png". Please guide me with sample code how to to that. I could get the attribute value "image1.png". Here is the code: $xdoc = new DomDocument; $xdoc->Load('samplexml.svg'...

Symfony getAttributeHolder in forms

I have a CampaignForm class. It has children Campaign1Form, Campaign2Form, .. CampaignNForm They have by default ref_campaign_type = unique_value_for_each_form_class; How can I get this value in parent class CampaignForm? My way is: $vars = sfContext::getInstance()->getUser()->getAttributeHolder()->get('storedValues', null, 'nsappid_a...

Pass data from one form to another on a separate page

I am building a price/distance calculator with Google Maps API and am trying to pass the info from the calculator to a booking form on a separate page. My first form has 2 submit buttons - one to make the calculation, and one to submit the relevant data to the booking form. I'm stuck trying to make the 2nd button work. Once the API ca...

Facebook Page Statuses API

I've got a curl function in php which posts a status update to our facebook page. However, when I post the update it makes the status appear from me personally rather than me the group. Does anyone know how you can post as administrator of the group. The script is as follows; $xPost['access_token'] = "[key]" $xPost['message'] = "Po...

Best way to list Alphabetical(A-Z) using PHP

can any one please let me know, i need to print/list Alphabetical(A-Z) char to manage Excel cells. Is there any php function to list Alphabetic? I need result as A1 B1 C1 D1 ... ... ... OR A B C ... ... ...

PHP site scheduling Java execution?

I'm trying to get started on combining my (slightly limited) PHP experience with my (better) Java experience, in a project where I need to allow uploads of Java source files to the server, which the server then executes Javac on to compile it. Then, at a set time (e.g. specified on upload) I need to run that once on the server, which ...

How do I make a daemon into a stream in PHP

I have a daemon (written in C, but I assume it does not really matter) which outputs messages with printf, and can get input and do stuff with this input (again, not really important what, but he sends those messages to a different machine to be saved there in the DB). My question, how can I make this daemon to be a stream in PHP, so ...

I'm using a audio in my web page i need to play it first time but not on page refresh in php

I'm using a audio in my web page i need to play it first time but not on page refresh in php ...

WWW::Mechanize VS Curl

Hi, Background: I need to get updated data for all of my users. The data resides on a secure site so the script needs to login (using cookies) Traverses some inner URLs and then fetch the required data. Tools: WWW::Mechanize or Curl What is the best tool for my needs? Performance is a big issue I need to get th...

Filtering OPML file by date of last post on each feed and outputting another OPML file based on results

I have a large OPML file acting as an archive for an online community. I'd like to generate further OPML files based on filtering the feeds it contains by the date last posted. OPML Archive > script > OPML file of feeds which have posted within the last two months. I need to leave the original OPML file intact for archival purposes. I...

How to make a tree view from MySQL and PHP and jquery

hey guys i need to show a treeview of my categories , saved in my mysql database . Database table : table : cats : columns: id,name,parent problem is in php part : //function to build tree menu from db table test1 function tree_set($index) { global $menu; $q=mysql_query("select * from cats where parent='$index'")...

Enable proper relative path in cron

I have 2 servers that are on completely separate OS' and configurations. One properly accepts require_once '../file.php'; and the other doesn't, because it's relative to where the cron is loading I guess. How can I fix the 2nd location so that it's relative path is from the relative path of the file. I need this to work in 3 different...