php

PHP strtotime() looks like it is expecting a Euro format

I've been using PHP's strtotime() method to accept a date field on a form. I love how powerful it is, in how it will accept "Tomorrow", "Next Thursday", or (supposedly) any date representation and convert it to the Unix timestamp. It's been working great -- until yesterday. Someone entered "2-4-10" and instead of logging Feb 4th, 2010, ...

Fine-tuning my MySQL relations database and how to use JOIN on it?

I am very new to mysql and databases, so I need help here... How should I use JOIN to fetch a record from the tables below, when the only given variable is the ad_id? category and category options are filled in manually i.e. the users may not alter them. So they are only reference tables, but I am not sure this is how I should do it......

Multidimensional array iteration

Say you have the following array: $nodes = array( "parent node", "parent node", array( "child node", "child node", array( "grand child node", "grand child node"))); How would you go about transforming it to an XML string so that it looks like: <node> <node>parent node</n...

Is it possible to pass a javascript array through GET and access it through $_GET at the other end..?

Hi all... I have a javascript array say jsArr[]. I want this array to be passed to a php page through the get method. Something like "nextPage.php?arr=jsArr[]". There i should be able to access the array like "$arr[] = $_GET[arr]" and perform operations like foreach($arr as $key => $val). Is it possible...? Thanks a lot in advance.....

Converting XML format

We have an issue where we have an XML feed leaving our system and a client needs to be able to import this feed into their system but they require the XML file to be in a different format. For a number of reasons its not possible for either of us to alter our format. I was thinking then that it would make sense for us to build some kind ...

php parse error always on the last line

I'm trying to read a comment that is stored in a mysql table. For some reason I always get a parse error on the last line of the file even if the last line is blank. I'm not sure if it's relevant but the connect.php works for putting the comment into the database. I'm using wampserver to host it and coding it by hand. I think that's it'...

Convert GD image back to binary data

I have a GD image resource created from imagecreatefromstring. After some image operations, I want to convert it back to binary data. How would I do this? Can't see any functions in the manual... ...

Apache/PHP serving file multiple times

I have a system with a download.php page. The page takes and id and loads a file based on from the DB Record and then serves it up. I've noticed a couple instances where files are requested multiple times in short time spans (20ms). Times that are too quick for human input. There are plenty of instances where the downloader functions fin...

How to get odd numbers of parameters in Zend Framework?

Greetings everyone Using the request object, I can't get a sole value as in this URI: http://mydomain.com/controller/action/value1 Using $request->getParams() is not returning the value1. Output: array([controller] => 'controller', [action] => 'action') The key is missing. The issue itself is quite simple and I could parse the U...

Filtering duplicities by another table.

Hello, I have two (example) tables here A) data_table: +----------+-------+ | location | value | +----------+-------+ | 43 | 38 | | 44 | 31 | | 3 | 31 | | 11 | 38 | | 47 | 35 | | 49 | 31 | | 50 | 31 | | 55 | 16 | | 56 | 16 | | 59 | 35 | ...

php string add tag (modify)

I got from a json feed this : <img src = "http://produits-lemieux.com/produits/bainmoussant_hg.jpg" ></img> i need to inject alt="" into the string Best method to do that in php ? ...

How to test for "If-Modified-Since" HTTP Header support

Using PHP how can I accurately test that a remote website supports the "If-Modified-Since" HTTP header. From what I have read, if the remote file you GET has been modified since the date specified in the header request - it should return a 200 OK status. If it hasn't been modified, it should return a 304 Not Modified. Therefore my q...

URI re-routing in codeigniter

I'm using URI re-routing in CI to make better URLS. An example here would be: $route['users/(:any)'] = "users/index/$1"; The aim here is to get rid of the index from URL. This works well. However it stops me from being able to access any functions in the users controller, for example mywebsite.com/users/messages Just redirects to t...

PHP - Pulling single value from multidimensional array

Hi, this is probably quite simple but I could do with some help. I am trying to create a small PHP function that will display a single value form a multidimensional array when the user used two dropdown boxes to select the row and column of the array. So, the user will make a selection from the first dropdown box, which will contain th...

Generate Forms, best practice

Hi, I would like to know if there is any library around I could use to generate forms and maintain them without too much pain. I'm working on an app with hundreds of form, and we have been re-inventing the wheel for all of them so far. It's not really DRY and I have to test them all. I know that some framework can manage forms quite we...

PHP popen and proc_open not returning binary output

When using popen or proc_open to run the following command to list the contents of a windows share: smbclient -N -U 'username%password' -O 'TCP_NODELAY IPTOS_LOWDELAY SO_KEEPALIVE SO_RCVBUF=8192 SO_SNDBUF=8192' -O 'TCP_NODELAY IPTOS_LOWDELAY SO_KEEPALIVE SO_RCVBUF=8192 SO_SNDBUF=8192' -d 0 '//server/sharename' -c 'dir "dirpath\*"' 2>/...

Is there a built in way to get an array out of multi dim array in PHP?

(Very useful when querying DB). If I have a multy dim array [['id'=>1],['id'=>2],['id'=>34],['id'=>67]] and what I want is [1,2,34,67] I know how to do it in code, just asking if there is a built in way in PHP (or may be in PDO) to do this. ...

upload large files in a browser with a progress bar, prefer no flash just js and php

what is the best way to build an upload widget that can handle large files is there a great jquery plugin for this? I'd really love to have a progress bar without having to depend on flash would need to use php for the backend ...

LogMeIn API - getSession?

The LogMeIn API's "getSession" call is driving me a bit crazy. According to their documentation, you should be able to input an iNodeID either from the getHierarchy call or just the tech's ID# from the LogMeIn admin page and it will report their open session information, but no matter what I use, I get an error "stdClass Object ( [getSes...

Why is this SQL query not working?

this script have to update things on every refresh but not working. lend me a hand $yp = mysql_query("select id from yyy where twitterid = '$tid'"); $qq = "update yyy set twitterid = '$tid', twitterkullanici = '$twk', tweetsayisi = '$tws', takipettigi = '$tkpettigi', takipeden = '$tkpeden', nerden = '$nerden', bio = '" . mysql_re...