Hi everybody,
i need a help. I am explaining at details so that easy to understand.
I want a list of month and year based on the difference of month and year.
I am implementing search functionality based on Start month with year and end month with year.
So
start Selection - 01(month)-2009 (Yr)
End selection 10(month)-2009 (Yr)
so i ...
Like you can in php
<?php
function whatever($var='') {
}
?>
can you do that in javascript?
...
<div style="width: 49%; height: 300px; float: left; padding-top: 10px; ">
<h2><img src="downloads/general.png"></h2>
<h1>General Downloads</h1>
<?php
$Dirdownloads = opendir('downloads/general');
while (false !== ($file = readdir($Dirdownloads))) {
if ($file != "." && $file != "..") {
$files[] = array(
...
I'm fairly new to classical inheritance as I mainly deal with ECMAScript and Python, though I do a fair bit of ( shudder ) PHP. I know it's heavily influenced by Java and other classical inheritance based languages.
Question:
I was taking a peek at a few classes in a framework and noticed that the 'new' keyword wasn't called ( directl...
Hi,
I'm in PHP and I must access a Static method of an object which name must change.
private $controlleur = null;
private static $instance = null;
private function __construct() {
$nomControlleur = "Controlleurs\_" . Session::singleton()->controlleur;
$this->controlleur = $nomControlleur::singleton();
}
This p...
I'm going to be uploading images to a system and need them to be referenced by a non-sequential unique ID. I've read a little about GUIDs, and I'm wondering what the best approach to making one in PHP is. Should I md5() the current timestamp and salt it, or will PHP's uniqueid (http://www.php.net/manual/en/function.uniqid.php) function b...
Hi, I've been using OOP in PHP for a while now, but for some reason am having a total brain meltdown and can't work out what's going wrong here!
I have a much more complex class, but wrote a simpler one to test it, and even this isn't working...
Can anyone tell me what I'm doing wrong?
class test
{
public $testvar;
function _...
Hello everyone, wondered if you can help me with a php/query question.
I want to format the first row differently to the rest of the rows (always 20 returned).
My query looks like this right now:
<?php
$nt=array();
$query="SELECT * FROM table WHERE field=item ORDER BY date DESC LIMIT 20";
$rt=mysql_query($query);
echo mysql_error();
...
need a simply preg_match, which will find "c.aspx" (without quotes) in the content if it finds, it will return the whole url. As a example
$content = '<div>[4]<a href="/m/c.aspx?mt=01_9310ba801f1255e02e411d8a7ed53ef95235165ee4fb0226f9644d439c11039f%7c8acc31aea5ad3998&n=783622212">New message</a><br/>';
now it should preg_match "c....
Hi,
I want to convert and show video that user uploaded. I have dedicated server and i use php for programming. Where should i start ? Thank You
...
I'm looking for a PHP preg_replace() solution find links to images and replace them with respective image tags.
Find:
<a href="http://www.domain.tld/any/valid/path/to/imagefile.ext">This will be ignored.</a>
Replace with:
<img src="http://www.domain.tld/any/valid/path/to/imagefile.ext" alt="imagefile" />
Where the protocol MUST...
I have a gps simulator, which sends continuous location data (nmea strings) through tcpip to 192.168.0.178:2323. How do I get that data using tcp socket and write to DB (php & mysql)?
Thanks!
...
Hello!
Can you tell me how the invert function for the following PHP function is?
<?php
function id2secure($old_number) {
$alphabet_en = '1357902468acegikmoqsuwybdfhjlnprtvxz-_';
$new_number = '';
while ($old_number > 0) {
$rest = $old_number%38;
if ($rest >= 38) { return FALSE; }
$new_number .= $alphabet_en[$rest];
$old_num...
I'm pretty sure now that this cannot be done but I would appreciate clarification on why, so I can avoid similar situations in the future! I have a form that when submitted dependent on user input either completes or requires further input with a parameter needing to be passed to the new form.
The initial submit works fine and the value...
public function run() {
/*
* wrap uri in a decorator
*/
$uri = new URI(trim(str_replace($this->base_path, "", $_SERVER["REQUEST_URI"]), "/"));
/*
* fetch appropriate resource from uri
*/
$this->resource = new Resource($uri);
/*
* prepare the request
*/
$request = new Request;
/*
* get the response of the app base...
I have created a language file in poedit for the use of the PHP gettext function, now on the page I am trying to test it on, I cannot get it to find/load the .po or .mo file I created, does anyone see what I am doing wrong?
$locale = "en_US";
putenv("LC_ALL=$locale");
setlocale(LC_ALL, $locale);
bindtextdomain("default", "/includes/loca...
I use expose in one link, with this code and it works:
$(document).ready(function() {
var triggers = $("a[rel]").overlay({
expose: {
color: '#212121',
loadSpeed: 200,
opacity: 0.9
},
closeOnClick: false
});
});
The link is:
<div id="triggers"><a href="" rel="#pop_member">Click here</a></div>
But I...
Caching the HTML output of non-important pages (like blog posts) really helps to speed up a site by skipping the loading of the entire system (and rendering time) and just spiting out a pre-made copy of the page. This would be one way you can keep large waves of users to your site index or whatever from eating resources.
However, one o...
How do I get the current index in a foreach loop?
foreach( $arr as $key=>$val)
{
//how to get index?
//how to get first element in an associated array
}
...
From your experience, is it better to use 1 language file or multiple smaller langauge files for each language in a PHP project using the gettext extension? I am not even sure if it is possible to use multiple files, it is hard for me to test since the server caches the language files.
I am doing multiple languages on a social networ...