php

How to get Zend Lucene Range Search working properly (or help me debug)

I have an implementation of the Zend Search (Lucene) framework on my website that contains an index of products with prices. I am trying to allow customers to search for something, while contsraining the prices. Eg. Search for "dog food" between $5-$10 dollars. My search index looks like this: Keyword('name') Keyword('price') Lets sa...

php regex for link url

Hay guys i need help on a regex. I'm using file_get_contents() to get the source of a page, i want to then loop through the source and find all the and extract all the HREF values into an array. Thanks ...

How to achive single-processing mode running php scripts?

I have cron job - php script which is called one time in 5 minutes. I need to be sure that previously called php script has finished execution - do not want to mix data that's being processed. There are three approaches I used to apply: Creation of auxiliary text file which contains running-state flag. Executed script analyzes the co...

Why are there unexpected spaces on my PDF using FPDF with PHP?

Here is an example of my problem: http://idea-palette.com/pdf/ I'm using FPDF to write some text on a PDF. I'm displaying 8 different cells of text. The Cells are being displayed, but after two cells, it puts the next cell onto a new page as If I had asked for a new PDF page to be made, but I did not. I'm guessing it is somehow pushing ...

multiple file upload

Hey Does know how to or can provide a demo or script which will allow multiple files to be uploader to a web server WITHOUT using flash or anything which needs to be installed on the client machine. Ideally providing a status with how the uploads are doing ie 27% etc. It would be great if I could select multiple files then hit upload...

symfony redirect with 2 parameters

how can i redirect to another action passing 2 or more parameters? this code: $this->redirect('input/new?year=' . $year . '&month=' . $month); results in URL: http://.../input?year=2009&month=9 ...

How to improve PHP performance more?

I've created PHP application for Facebook. It uses MySQL, Memcached and works on Lighttpd on Centos 2,6 Ghz and 2 GB RAM. it's basically one PHP file that after first run is cached and every next time it's served in 0,8 ms directly from Memcached. What more can I do to shorten this time? ...

Why does this code add id="active" to html?

The following view code produces html code as follows. Q1. what is the first line doing? <?php $ci_uri = trim($this->uri->uri_string(), '/'); $att = ' id="active"';?> Q2. Why producing id="active"? Q3. What are the purpose of <?= substr($ci_uri, 0, 7) == 'example'? $att: ''?> <?= $ci_uri == $this->config->item('FAL_login_ur...

connect to MYSQL from PHP via terminal

Hay all, i need a little hlep. I'm trying to connect to my localhost MySQL server via php in the terminal. It's outputting that it cannot connect to the host through my socket. My PHP ini install says this MYSQL_SOCKET /tmp/mysql.sock so i used mysql_connect("/tmp/mysql.sock","root","",""); And i get errors Any suggestions? ...

How to increase PHP over HTML speed?

I have a PHP file that gets HTML from Memcached and serves it to user. When I test it like this: ab -n 1000 -c 100 http://website.com/test.php It does 22 requests per second. But when I put the same HTML to a html file and do this test: ab -n 1000 -c 100 http://website.com/test.html I get like 4500 requests per second. I n...

Replacing a querystring parameter value using mod_rewrite

I would like to map this: `http://www.example.com/index.php?param1=value1&amp;param2=value2&amp;param3=value3` (etc. ad infinitum) to `http://www.example.com/index.php?param1=newvalue1&amp;param2=value2&amp;param3=value3` (etc.) ie. just change the value of a single parameter in the querystring. I know what the old value is, so I a...

Need help about array

What do $categories[$id] = array('name' => $name, 'children' => array()); and $categories[$parentId]['children'][] = array('id' => $id, 'name' => $name); mean? Thanks a lot. ...

problem with comparing two arrays

I'm trying to compare the content of 2 arrays, basically I'm using a shopping cart and I need to check the prices of submitted forms against a database, the problem is when I have one incorrect price in the shopping cart it gives me an error message but when I have 1 correct price and 1 incorrect it continues with the checkout, I don't k...

How do we upload a file to mysql database using php

Hello All, I need to upload a file of ethereal capture into the MySQL database. The problem is , it is not done manually through a html form . Hence I can't use enctype="multipart/form-data" and $_FILES to upload a file. Is there a way to upload a file just using PHP in to the MySQL database. Regards, Mithun ...

406 "Not Acceptable" error when using JanRain OpenID Library with Google

Hello everybody, I am using the latest Janrain openid library example and the discovery process seems to work well with Yahoo, myopenid.com and others... But I am stuck with Google endpoint (https semicolon //www.google.com/accounts/o8/id). Consumer.php just returns a 406 apache error, before I am redirected to google's page. All my i...

access json object and array

Here is my JSON data : {"Liste_des_produits1":[{"Added_Time":"28-Sep-2009 16:35:03","prod_ingredient":"sgsdgds","prod_danger":["sans danger pour xyz"],"prod_odeur":["Orange"],"prod_nom":"ceciestunproduit","prod_certification":["HE • Haute Efficité","Certifier Ecologo","Contenant recyclable"],"prod_photo":"","prod_categorie":["...

uploading images

Hi, I got this error when I'm uploading the image into the folder: Warning: fopen(images1/image.jpg) [function.fopen]: failed to open stream: Permission denied. i gave read/write permissions. but its not working.How to rectify this error? Anyone can help me please? Regards, padma. ...

Php object orient concept in file handling

Hai I want to read content from a Txt file and down load it into a pdf file using PHP object orientation, How I Read content from a file, IS it same as simple PHP... Please Help me in urgently Thanks in advance.............. ...

Help with mysql str-to-date

I cannot get this to work. I want to use str_to_date to convert a date string. Here is my insert statement. INSERT INTO cars(carno, color, date) VALUES ('1', 'brown', STR_TO_DATE('$date', 'm%/%d/%Y')) Can someone please tell me where I am going wrong? The date in my variable is 12/12/2002 Anyone??? ...

How to make port 2196 as incoming port in xampp mac

"Feedback works now - open incoming port 2196 Sep 26, 2009 6:57 AM Be sure that your server has port 2196 open for INCOMING data, not just outgoing. This was after I had my server support guy open 2196 for incoming data. This works - I un-installed the app, sent a push to it, and then checked feedback:" It's feedback on appleforum. S...