php

Zend Framework forms, decorators and validation: should I go back to plain HTML?

I am currently working on a pretty large application which contains a lot of forms. Up to this moment, I have always been writing my forms by hand and writing my own validation logic, but I have decided it was about time I started using Zend_Form and it's built-in validation routines. However, I keep stumbling upon more and more proble...

should i use insert select or just loop through with insert ?

i have extracted a list of usernames using the answers from this: http://stackoverflow.com/questions/1273259/how-to-optimize-mysql-query-if-i-have-too-many-or-operators-in-my-query now i have another issue. I have a friend table made up of just 2 columns, requestor and buddy both form a composite primary key. Now suppose i have an arr...

Memcached concurrency w/ lighttpd php

I'm having an issue with memcached. Not sure if it's memcached, php, or tcp sockets but everytime I try a benchmark with 50 or more concurrency to a page with memcached, some of those request failed using apache ab. I get the (99) Cannot assign requested address error. When I do a concurrency test of 5000 to a regular phpinfo() page. Ev...

How can I programatically add images to a drupal node?

I'm using Drupal 6.x and I'm writing a php class that will grab an RSS feed and insert it as nodes. The problem I'm having is that the RSS feed comes with images, and I cannot figure out how to insert them properly. This page has some information but it doesn't work. I create and save the image to the server, and then I add it to the ...

PHP: Make the CakePHP router pass all requests to a single controller

I'm setting up a CakePHP project, and would like all requests passed in to be redirected to one specific controller. Currently my routing rule is set up like this: Router::connect('/:action/*', array('controller' => 'files')); However, this is obviously not the correct way to achieve this, as it is producing several E_NOTICE errors. ...

Howto encode texts outside the <pre></pre> tag with htmlentities()? (PHP)

Hello there, I'm trying to make my own BBCode parser for my website and I'm looking for a way to "htmlentities()" except the codes inside PRE tags, and the PRE tag itself. For example: <b>Hello world</b> (outputs &lt;b&gt;Hello world&lt;&gt;) <pre>"This must not be converted to HTML entities"</pre> (outputs <pre>"This must not be conv...

matching text to a row

I have a row in my mysql table like so John - Hey (johnnny) but because of how the string has been formatted i have john hey johnnny I've tried this query $q = mysqli_query($id,"SELECT * FROM mixes WHERE `tracklist` LIKE %".$_REQUEST['did']."%"); but this did not work? Any ideas? ...

Prevent form resubmit in Zend framework?

An action within a controller generates the next id from the database and displays it on screen as reference. How can I prevent the action being called again if the user clicks refresh. ...

handling two mysql connection in PHP

Hi, for a project I need to open a Mysql connection, close it and let old legacy code run after that. The legacy code have it's own connection, and just call mysql_query($sql) without the resource parameter. How can I handle this? Can I set a Mysql connexion as the global one? Must I re-execute the mysql_connect() statement? The legac...

passing GET parameters that look like URI directories

I've seen a lot of URIs that look something like this: www.fakesite.net/stories/1234/man_invents_fire and I was wondering if the /1234/man_invents_fire part of the URI are actually directories or if they are GET parameters (or something else). I've noticed that a lot of times the /man_invents_fire segment is unnecessary (can be remove...

jquery hide problem

Hello! I use this to toggle my div elements, and hide all them when the DOM is ready... $('div[class*="showhide"]').hide(); $('input:image').click( function() { var nr = $(this).attr('id').substr(7,2); $('div.showhide' + nr).toggle(400); }); I have dinamically created div elements with class showhide0;showhide1;...

PHP technique to query the APNs Feedback Server

Hi all, Can someone clarify what the APNs (Apple Push Notification) wants as far as how you query it? The docs say it starts sending as soon as the connection is made. Does this mean that I don't do an fread() on it? Here's my current code to try and read it. I did NOT put the fread() in a loop as I do not know what response indicates...

Get details from another mysql table

Hi, I have a table which would contain information about a certain month, and one column in that row would have mysql row id's for another table in it to grab multiple information from is there a more efficent way to get the information than exploding the ids and doing seperate sql queryies on each... here is an example: Row ID | Name...

PHP Encryption & VB.net Decryption

I'm trying to do a simple task. Encypt a value in PHP and Decrypt it in my VB.net app. I figure I'd use tripleDES or Rijdael 128 or 256 I though this should be simple. Can anyone point me in the right direction? Thank you ...

PHP Parse Date String

If I've got a date string: $date = "08/20/2009"; And I want to separate each part of the date: $m = "08"; $d = "20"; $y = "2009"; How would I do so? Is there a special date function I should be using? Or something else? Thanks! ...

Getting static property from a class with dynamic class name in PHP

Hi Guys, I have this: one string variable which holds the class name ($classname) one string variable with holds the property name ($propertyname) I want to get that property from that class, the problem is, the property is static and I don't know how to do that. If the property weren't static, it would have been: $classname->$pro...

What URL is the XtraUpload script posting to?

I am using the XtraUpload script from http://xtrafile.com. Their forum support is very poor, and I need to write a PHP function to post to remotely post to my XtraUpload website at http://uber-upload.com. So, I ask, ok, I beg for help. Can someone please tell me what the post URL is, and what variables are being sent (i need exact nam...

Xampp, Access forbidden for non index files

I've been using xampp for a long time and it's always worked fine. I have a project I am currently working on and it was working fine just a couple of days ago. Now I am getting 403 Access forbidden page for any file that is not named index.php. Anyone have any ideas why this might be happening. I'm on Windows XP and have Xampp Versio...

Convert vb.net byte to php

I have the following code in VB.net Dim bytIV() As Byte = {121, 241, 10, 1, 132, 74, 11, 39, 255, 91, 45, 78, 14, 211, 22, 62} I'm trying to convert it to php. $iv = array(121, 241, 10, 1, 132, 74, 11, 39, 255, 91, 45, 78, 14, 211, 22, 62); That doesn't work. The complete php code below: <?php $key = "lvvxmzmfrqeephxwmifw...

php ssl curl : object moved error

Im developing a php script to scrape this website and email me the data to me. It seems to be logging in correctly because when the script runs, it seems to redirect and give me a message saying Object moved Here and the here is linked to the default.aspx page which is what exactly happens when I manually login. Below is my script: ...