I'm building a site with wordpress, and when I use the date() function on an otherwise empty file, it shows the right date. However, if I use it in a file that includes other wordpress files, the time is displayed as GMT time, so the date is off.
If anyone can figure out how I can use date function without interruption from the wordpre...
Hi,
How do I achieve this:
//view.php
<input type="hidden" name="Name" value="<?php echo $variable->id; ?>"
using CodeIgniter’s form_hidden helper:
//view.php
<?php echo form_hidden('Name','<?php echo $variable->id; ?>') ?>
The first one works fine when I display $variable->id but CI's form_hidden doesn't work.
...
how do I define a constant inside a function
eg.
class {
public test;
function tester{
const test = "abc";
}
}
...
Online editing gettext files, is it possible?
I use gettext for all my PHP projects, but sides with a minor problem, want to mine user may translate my language from as Danish to Norwegian, but in this case it enste I know is that I need to export my file from Poedit there is any. other software that can export / import my files? for Po...
On insert I am catching the unique constraint mysql_errno() 1062.
This works fine but I want to find the existing row to re-instate or modify it.
Is there are method to obtain the row id on insert fail? I tried mysql_insert_id() but realised that would only return the row I'm inserting (or failed to insert) therefore, I get 0.
Is the...
I have a script that recursively scans a directory pulling out class names from php files, and storing those classes names in an array. This is working nicely even through the rather large Zend Framework library folders.
The issue is that classes that extend other classes are not being included in the array.
Here is my current preg_mat...
In my code here, I have a CSS class called "active" which I use if the $_GET['page'] == tutorials, php, mysql, etc...
The problem is, even if the 'page' variable is not equal to any of these values, the Tutorials button in this case is still active for some reason.
Any ideas why this would be happening?
Am I using the 'or' (||) operand...
Hi
I've a php file which processes a query and returns an array.
How do i get these and array and parse them and display them using ajax.
I call the file using ajax. Its used to display the matching products while typing a text box with the price...
responseText doesn't return anything...
...
Hi
I need to segment text using fullstops using PHP/Javascript.The problem is if I use "." to split text then abbreviations , date formatting (12.03.2010 ) or urls as well split-ed , which I need to prevent.There are many such possibilities , I might not be able to imagine.
How to recognize that the "." is used as fullstop and nothing ...
Hey,
I have a CGI script that uses an old database driver that is no longer supported. Instead of struggling with this old cgi script, I thought it would be easier to rewrite it in php. It works now as a php script, but I need it to be served from the same web address. When a user accesses http://somesite.com/myscript.cgi, I want it to ...
Can someone please help me with this preg_match
if (preg_match('~[^A-Za-z0-9_\./\]~', $filepath))
// Show Error message.
I need to match a possible filepath. So I need to check for double slashes, etc. Valid file path strings should look like this only:
mydir/aFile.php
or
mydir/another_dir/anyfile.js
So a slash at the begi...
Hi, anyone can help me with a preg_match? I'd like to use php's preg_match to determine if an input is a valid filename or not (only the filename + file extension, not the full path). General rules:
1) filename = a-z, A-Z, 0-9
2) extension = 3 or 4 letters
Thank you!
...
Hi,
I have a CCK datetime field and would like to set its default value to 31 May 2011.
When I go to the configuration of the field I can set the default value to Now, Blank or Relative.
Relative is to be set by a PHP's strtotime argument. However, it fails when I set it to
31 May 2011 --> I get today in the node add form
last day of...
Hello,
In one of my php project I have used curl multi function to scrap data. It worked for almost 9 months. For last few weeks, I observed its returning wrong data.
Like correct data format (php serialized) is (which is returned most of the time):
[odds_value] => a:6:{i:0;s:4:"+0.5";i:1;s:4:"+0.5";i:2;s:4:"+0.5";i:3;s:4:"+0.5";i:4;s...
We can easily check for a match in a string
if (preg_match("/happy/i", "happy is he who has ")) {
echo "match found.";
} else {
echo "match not found.";
}
?>
But how to check for the occurrence of match in a webpage or given a url?
EDIT:
How to use Regex to find if a specific string exists within a webpage?
I am able to...
hello everybody!
can anyone tell me how to create 2 different thumbnails of same images with different sizes and location in codeigniter. I have created a upload function and another thumbnail generation function, it works fine but can't sort out how to create 2 different thumbnail at accordingly at once. any help will be appreciated.
...
Hi guys, I would like to know if it is possible to re-size and re-position a greybox or shadowbox window to display in a certain div element?
I am creating a template for a wordpress site, and I am using the default calendar, but when you click on a date inside of the calendar, the default action is to open it up in a new window.
Would...
Do interfaces have properties or only methods?
Thanks
...
If I have a REST based service written in the Symfony [symfony-project.org] framework (i.e. PHP), is there any decent tools/frameworks out there that will parse my code and generate API documentation?
The Java based framework enunciate has documentation capabilities similar to what I need, you can view an example of this here: http://en...
I found this site is just what I need.
http://www.freeingweb.com/
I want to build a personal Poxey tool coz quite a lot of great sites were blocked for me. Which technique should I learn? Is PHP enough for the job?
...