PHP date formatting issue
This PHP statement date('Y-m-d',1281394800) returns different values in different servers. One gives me 2010-08-09 and the other 2010-08-10. Could someone please help explain? ...
This PHP statement date('Y-m-d',1281394800) returns different values in different servers. One gives me 2010-08-09 and the other 2010-08-10. Could someone please help explain? ...
Say $d is a directory path and I want to ensure that it starts and ends with exactly one slash (/). It may initially have zero, one or more leading and/or trailing slashes. I tried: preg_replace('%^/*|/*$', '/', $d); which works for the leading slash but to my surprise yields two trailing slashes if $d has at least one trailing slash...
Hello I want to make something like a meta language which gets parsed and cached to be more performant. So I need to be able to parse the meta code into objects or arrays. Startidentifier: { Endidentifier: } You can navigate through objects with a dot(.) but you can also do arithmetic/logic/relational operations. Here is an example o...
I want to generate the following SQL: SELECT `rc`.*, `c`.`name` FROM `RunConfigurations` AS `rc` INNER JOIN `Clients` AS `c` ON rc.client_id = c.id WHERE (rc.client_id = ?) ORDER BY `rc`.`config_name` ASC However I am getting: SELECT `rc`.*, `c`.* FROM `RunConfigurations` AS `rc` INNER JOIN `Clients` AS `c` ON rc.client_id = c.id WHE...
A general question, without a specific case in mind - is it usually preferred to use MySQL stored procedures over writing a PHP script that performs the same calculations and queries? What are the benefits of each method? ...
Hi, I have a trouble displaying Cyrillic characters properly. Looked in forums, tried a few different thing and nothing works. Site runs on PHP / MySQL. MySQL tables charset is utf8, and collation is utf8_general_ci Name entry in DB looks correct (in PhpmyAdmin): Sasha Рукина Output on page http://www.sodaq.com/: Sasha ?????? Inside...
hey guys, i'm using a force-download script on my own server. - click on a link and the file prompts as download. works perfect, but even if a file does not exist it can be downloaded as empty file. so if i set a link with /folder/filexyz.txt it prompts the download and an empty txt-file gets downloaded to the harddrive. i'm currently ...
hey guys, i'm using ftp_put to uplaod files to my ftp server. if i select a file with like "Some Zip.jpg" i want it automatically to rename to "Some_Zip.jpg" with underscores instead of spaces. $name=$_FILES['userfile']['name']; how can i replace all spaces in $name with underscores. Is there anything else i should be aware of when ...
What reasons could there be for PHP to provide a new session ID to a Safari browser at absolutely random intervals? Could the PHPSESSID cookie be expiring in the client? Or maybe something else, more complex? ...
I find php's Object Orientation somewhat verbose and unsavory. I love working with the cleanliness of functions, and my ideal is to code in php from as close to Clojure's excellent approach to Functional Programming as can be done & still make sense in php. As I move towards F.P., I've found that it's hard to keep a group of related fu...
Basically what I need to do is run through a series of checkbox if it is checked I need to submit its value using ajax. Now I can't seem to find a way to run through each checkbox one at a time. Here's the code on my page. $(document).ready(function(){ $('#submit').click(function(){ }); }); <?php /** * Include vB core. */ require_o...
Hi guys, I have a client that wanted their sales staff to be able to populate highly designed 2 column html templates and send emails using these. 6 recipients max per email. Solution worked very well until they decided they want to send to each of the recipients separately. No CC, no BCC. I figured where I had simply imploded the ar...
Hello everyone, I'm using CodeIgniter with Doctrine in a project. One of my models has the Sluggable behavior. The slug is created according to another field X when the object is saved. I was wondering if there was a way to automatically update this slug field when the X field is updated. At the moment, if I update the X field, the slu...
Hello all, I have the following two script files (i.e., formtest.html and calc.php). When I do the server side validation on calc.php, how do I pass the error message (i.e. $err_msg back to the formtest.html? Thank you ///////////////////////////////////////////////////////////// <html> <head> <title>Form...
I'm new to drupal, had a good start with basic functionality but I need to do some specific tasks and I'm starting to struggle. I want a form with a drop down list, that selects a string. I also want to create a serial number thats unique, and append it to the string. I was thinking that I'd create a document type "index", then as as d...
Hello, I know, it may sound ridiculous, but I can't turn off safe_mode. I'm using wkhtmltopdf (which is best html->pdf converter I've used, and yes, I tried html2ps, fpdf and lots of others). And it needs to be executed with exec() function. I've done find / | grep php.ini, found all of php.ini's and changed safe_mode to Off. Then ...
Is there a way I can check if a function is true inside another function? For example. function Name() { //check database } function Send() { if(Name() == TRUE){ //do something } } ...
I made a Windows GUI through PHP's DOTNET class and System.Windows.Forms. But, I'm stuck on handling button clicks, field updates, form open/close events, etc. I cannot get com_event_sink() working with any events whatsoever. I know of no method to get PHP to fake or sink control event "delegates". The best I can do is hackish - cons...
Hi there: I have the following possible string: '', or '4.', or '*.4' or '4.35' all the above format are valid, others are all invalid. basically, if I don't care the digit or word character, this is what I used in PHP for the validation: else if ( !ereg('^\*|.*\..*$',$bl_objver) ) Now, I would like to add some clientside...
I have php scripts that call perl scripts to do various things and sometimes I get it where it just goes on and on without getting a response back, this is based on the variable that is being passed to the perl script and I am doing a lot of different ones in succession so I can't get really debug it directly since I don't have a respons...