I have a form with action set to a php-file (verify.php).
In the form, I have made a pretty nice picture upload section.
After submitting the form, the verify.php is opened to verify the form filled in by the user.
The form values are all placed inside another form on the verify.php page.
Only the image is uploaded to a folder on the se...
Any way to determine file age of an image in a folder using PHP?
I want to delete older files than 2 hours, is this possible without adding timestamp-names to their filenames on upload to the folder?
If so, please give me an example!
thanks
...
Hi,
I'm using PHP's shell_exec function to call a bash script on my server.
shell_exec("bash -x /tesladata/isetools/0-extractbytickerforweb.bash $ticker $isedate > /t24alv2/iseoutput/$ticker-$isedate-$thistime.log &");
Now, I previously had the command running from a CGI script ("bash -x...") and it was much faster (instantaneous). N...
I want to know which php architecture strategies developers use in complex php applications . So far , i know the mvc structure which consists of models, views and controller (and controller plugins which handle with common tasks such as user access controller ). I know some good php frameworks which makes some common stuffs easier .But...
Hello,
I'm at my wits end with this one, then I remember stack overflow.
I have a site, http://bridgeserver3.co.uk/disklavier/de/ , the language is stored in a simple PHP file which looks like..
$translations["welcome_text_3"]="Zum Lieferumfang eines jeden Disklaviers gehren bereits zahlreiche Lieder und das Angebot lsst sich jederz...
I need to consume a ASP.Net webserice from PHP. So far reading data hasn't been to difficult. I have been able to pars the XML and find the information that I need. The problem I am running into is sending data back to the webservice. It is looking for the XML representation of a dataset. Is there anything out there that can generate the...
I am passing a filename to a download page.
ie somefile.xls
The download page adds back in the full directory path onto the filename.
ie c:\temp\somefile.xls
The problem is that now setting the 'Content-Disposition' of the header doesn't work. The filename it wants to download is the full directory-filename path.
ie c_tem...
What are some of the best practices for clean code, naming conventions and documentation for PHP?
I see users/people saying this is a bad practice, Example:
// Create an array to hold x values
$arr_x = array();
That this is a unnecessary comment cause the syntax alone explains the functionality. That is should be more of a header com...
Note: I'm using Zend Framework, but I think most of this applies to PHP coding in general.
I'm trying to choose a strategy for writing views scripts, possibly with the help of a templating engine. Motivations: clarity and security. I'm just not happy with writing .phtml scripts. This syntax is awfully verbose to do the most often needed...
Hi, I can't seem to find where to specify the CSS class of the list items for rendering a Zend_Navigation object. I know you can set the class of the ul tag via the navigation menu view helper and the class of the anchor via a page attribute...but not the li tag containing the anchor.
Can anyone point me in the right direction?
...
Could I achieve this in a more cleaner way? Would be really appricated.
switch($vocation) {
case 1: $vocation = "Sorcerer"; break;
case 2: $vocation = "Druid"; break;
case 3: $vocation = "Paladin"; break;
case 4: $vocation = "Knight"; break;
case 5: $vocation = "Master Sorcere...
A friend is writing an advertisement script that puts links around select phrases in HTML code.
Naturally if the phrase is already inside an <a> element (or another element that doesn't allow it - like if the phrase is found in the attribute of an element), he doesn't want the script to write out a link as it would break validation.
H...
Hi All,
I have a MYSQL database of photo galleries;
each row contains a field with the list of images included in that gallery, eg:
1,5,134,13,5
these are the IDs of the photos. The same image_id could be included in other galleries.
When I delete a photo, I need to remove the corresponding id from the galleries that contain it.
Wha...
Here's a very broad question:
I've been building a small MVC framework in PHP, mostly for the sake of learning better practices in my coding (and so I have a system to manage my home finances). In reading up, I've discovered a lot on VOs and DAOs, which were new to me, at least in a formalized way. This made me realize that even thoug...
I'm working with a Symfony generated admin and need to include some custom HTML into a form. This HTML (a label, img tag, and link) should only appear when the action is 'edit'. What's the best way to do this? It seems like I should just be able to include a partial, but I don't know where to include it from. Thanks.
...
I'm running PHP 5.2.6 on Windows, I have extension=php_curl.dll and extension=php_openssl.dll uncommented in php.ini; as such I can see the following in phpinfo:
curl
cURL support enabled
cURL Information libcurl/7.16.0 OpenSSL/0.9.8g zlib/1.2.3
openssl
OpenSSL support enabled
OpenSSL Version OpenSSL 0.9.8g 19 Oct 200...
When I installed Xdebug through pecl, it added the following line to my php.ini file.
extension="xdebug.so"
and everything I used worked. Until today.
Today I was having trouble setting up Xdebug for interactive debugging. I couldn't get anythign working until I changed the above to
zend_extension="/usr/local/lib/php/extensions/xd...
When a user enters a web url in a comment, that url becomes a link.
How do I prevent attacks from those links? any measures I can take?
thanx
...
I have a form where users enter a URL. I need a regular expression to skip the part 'http://' if present. For example, if the user insert into the form: http://youtube.com I need to save only youtube.com.
I don't know regular expressions. Could you help me? Thanks!
...
I control access via a proxy server and run some regex on every request. For prototype I have used curl, regex and php. Obviously this won't put up with any serious load. Can anyone suggest and proxy servers that would be suitable?
...