php

How to specify a command when posting a form, using php?

I'm trying to post a form with php, and I want the form to be handled depending on the value of cmd. Specifying this after the filename does not work..what is the correct way to do this? echo "<form name=\"statusForm\" action=\"edit_status.php?cmd=submitinfo\" method=\"post\" enctype=\"multipart/form-data\"> Where/how can I specify ?c...

Problems with mixing form and mysql database query

I have the following form, which I have reduced as much as I can, without being sure where the problem is coming from. I am trying to insert the form values into a database. However, when trying to use the form below, it spits out: Query was empty twice. The STATUS table exists, as do the fields deleted and notice. The table is curren...

Log the REQUEST_URI variable when php is set to log to syslog.

This is the source code of php_log_err. I would like to modify it to be able to log the variable _SERVER["REQUEST_URI"] /* {{{ php_log_err */ PHPAPI void php_log_err(char *log_message TSRMLS_DC) { FILE *log_file; char error_time_str[128]; struct tm tmbuf; time_t error_time; /* Try to use the spe...

Problem passing variables in php form.

I have the following php form. I am trying to make it so that when the form is loaded, the values will be assigned the appropriate check- variable. This variable will contain either "checked or "". If it contains checked, the way it is displayed with the html should cause the relevant checkbox to be checked. As it is, the variables do ...

How do I set the uploaded files folder for SWFUpload?

I don't see in the documentation how to set the uploaded files folder with SWFUpload. Can anyone point me to the right direction? I'm using PHP 5 if it helps. ...

Combining and Compressing multiple JavaScript files in php

Hello, I am working on a PHP app that requires eight javascript files (hello web2.0). I am wondering what the best way combine and compress all of the files dynamically. Am I phrasing the question correctly? The end result is that I would include one .js file in the header, and that .js file would include of the .js files in my "incl...

PHP Subscriptions - Preventing Sharing

Hi Have a client who is looking at developing a site where clients get access by subscriptions. Obviously the biggest concern is people sharing their login details. Are there any good techniques which can be deployed to help prevent this or at least reduce it. Obviously only allowing single session per user logged in so it would kick...

Is there a code covearge tool that works with manual testing?

In php, is there a tool that can generate a code coverage report without using automated unit test cases ? (basically not using phpunit or similar unit testing frameworks which do a good job generating the report but require unit testcases to be written in php!). Exactly what I am looking for, is a tool that would generate me a code co...

How do I serve a downloadable file online without exposing the physical path?

I'm serving up documents that require the user to register before download. Currently, once you register and login, the links to the documents are displayed as: myurl.com/docs/mypdf.pdf So the physical path to the document is exposed to anyone logged in. What is the best practice for keeping the physical path to the document hidden so...

Re-sort orders to improve warehouse efficiency

I am trying to optimize how orders are filled at my work. Right now, an employee just grabs the latest 16 orders(sometimes 14 or 18) and fills them. I am trying to change it so that instead of simply going by the latest list of orders, that it orders them so each batch has order in similar locations. But I can't figure out how I should...

Memory / Optimization concern

I'm working at a complex script which could be processing upto 500,000 records. Here's my question. Basically my code will parse a text file to get each of those 500,000 or so records. Each record will have a category, my code will need to check if a new record in the categories table had been created for that category during that parti...

Getting SimpleXMLElement to include the encoding in output

This: $XML = new SimpleXMLElement("<foo />"); echo($XML->asXML()); ...outputs this: <?xml version="1.0"?> <foo/> But I want it to output the encoding, too: <?xml version="1.0" encoding="UTF-8"?> <foo/> Is there some way to tell SimpleXMLElement to include the encoding attribute of the <?xml?> tag? Aside from doing this: $XML = ...

PHP Difference between Curl and HttpRequest

I have a need to do RAW POST (PUT a $var) requests to a server, and accept the results from that page as a string. Also need to add custom HTTP header information (like x-example-info: 2342342) I have two ways of doing it Curl (http://us.php.net/manual/en/book.curl.php) PHP HTTP using the HTTPRequest (http://us.php.net/manual/en/book...

Get image dimensions with Curl

I would like the height*width of a remote image. Could that be done with Curl, and if so how? ...

PHP Microsoft Excel file generation / export class

I've been looking for a good Excel file generation class and have yet to find one - my number one issue is that I although I can get the exported file to open in Excel (running 2007), I always get a warning saying "the file is in a different format to the file extension". I noticed that the Excel export in phpMyAdmin even generates the ...

Repost: Creating a RSS feed with PHP

I asked how to do this before but it seems I needed to put more code to really get an answer. I have a reddit type site, and I am trying to create a rss feed this is the code, but I get a Fatal error: Uncaught exception 'Exception' with message 'Query failed' Here its the code: <?php require_once($_SERVER['DOCUMENT_ROOT'].'/config.php...

Force-Download with php on Amazon S3

I am trying to use http://code.google.com/p/amazon-s3-php-class/ to force-dowload files from AWS S3. I have an mp3 that I want people to "play" or "download." By default the when you access the file directly on s3 it begins to play in the browser. I need to add an option to actually download. I have Googled and found came up with nothing...

Zend_Db Question... updating an incrementor

Should this work? (increment the login count?) // update the login count $data = array( 'logins' => 'logins + 1' ); $n = $db->update('users', $data, 'user_id = '.$_userId); ...

How to upload video to Facebook

I am working on a PHP/CURL project that uploads videos to the various websites. Is there a way to post a video to the Facebook without creating an application? I found a way to update status info by posting to the Facebook Mobile version URLs but mobile version doesn't support video upload. All suggestions are highly appreciated! ...

what are the specifics of setting up PHP so that integers will be 64-bit?

I think the general idea of PHP being able to have common integer 64-bit (as opposed to use math packages) is to use 64-bit hardware and 64-bit PHP. Does someone know the specifics? For example, won't the Core2Duo machine be able to support it? What about the 32-bit version of OS like Vista or OS X, can they support it too? ...