What I'm trying to do is automatically change the output format of dates in my sql queries without having to specify it (PHP/Oracle).
I'm using to_char(pi.date_of_birth , 'YYYY/MM/DD') as date_of_birth to change the formatting of my queries. What I'd like to be able to do is apply this to any date returned by the '*' operator.
My probl...
I am trying to make a php script that runs on the terminal that would connect to a remote server by ssh and retrieve a file. this is my code so far
#!/usr/bin/php -q
<?php
$cwd = dirname(__FILE__).'/';
$filename = 'retrive-this.file';
$host = 'hostip';
$connection = ssh2_connect($host, 22, array('hostkey'=>'ssh-rsa'));
$methods = ssh2_...
How to detect in AppModel, model that is loaded, belong to which plug-in?
EDIT:
When I check model name or other details in AppModel, there is no difference between the model loaded from the main program and a model that within the plugin loaded.
I need to know if model belongs to the plugin to do some operation on it.
...
Hello,
Sorry if the question is a bit vague but I'm new to gd. I'm wondering whether gd already has some built-in methods or whether PHP classes relying on gd exist that could present me with a bunch of statistics for a given image. I'm mostly interested in:
Colors (nb of colors used, most used colors, even better if I can get a the n...
Hello there,
we are trying to find the best solution for merging an XML data coming from an HTML form that the user is filling, with the PDF "template" form that resides on the server. After submitting the form in the browser, user should be able to download his/her merged PDF.
I have found similar questions regarding FDF and PHP but n...
Possible Duplicate:
Where can I learn web programming from start to mastery?
I want to be able to make websites like facebook, youtube and google (and even stack overflow!), can someone suggest a step by step guide (as best as you can, if even for part of the way) and not just "Do tutorials and make websites".
I can't go to a...
I have installed zend framework on my local machine. I have configured a vhost in httpd.conf and have added a line in my hosts file (127.0.0.1 mysite). I am running windows 7. Everything works perfect. The problem is when i upload on a hosting server the paths get mixed up.
I am uploading on a remote dir called zf-framework. To access t...
I was under the impression that 404 redirects to the front page is considered bad. all websites should have a 404 page. But at the same time I notice alot of people in forums that want their site to redirect to front page when a 404 is called. which is better. Having a 404 error page or redirecting to the front page
...
I have a Facebook app that was built for Christmas of last year, and worked through April, and somewhere between then and now has stopped working. First their was an issue with it breaking the iFrame, but now it seems that Facebook is sending too many GET variables to the PHP and it is timing out. Has anyone else had this problem? Is the...
I'm trying to get the mysqlnd driver setup on php5.3.2 (default version) on Ubuntu 10.04 (Lucid). The PHP docs say that mysqlnd is compiled by default in the 5.3 builds. But I haven't been able to find a way to make it part of the aptitude build.
...
As part of a hackweek project for visualising the number of people at London Tube stations, we have an SVG image linked to with a standard tag in HTML. This svg file is generated by PHP, and includes an tag importing the tube map and some tags. When viewed directly, this works fine. However, when viewing the HTML page containing the S...
I'm running a third party script by using a wrapper class I've written which calls shell_exec() and pipes into a file I parse later using php code. I should mention that this is working, but I am trying to enhance the functionality, having encountered a use case I hadn't thought of.
How is it best to manage timeout on shell_exec()? I wa...
Hey,
I want to get all keys of the array an compare each key to number, somthing like that:
array(
[0] => 7
[1] => 8
[2] => 4
[3] => 6
)
if (6 != EACH KEY OF ARRAY) {
so...
}
The condition wont show because there is [3] => 6 and the key 6 = 6 of course.
There is a function to do it? somthing else?
...
This is part of a PHP script I am putting together. Basically a domain ($domain1) is defined in a form and a different message is displayed, based on the response code from the server. However, I am having issues getting it to work. The 3 digit response code is all I am interested in.
Here is what I have so far:
function get_http_...
There is a variable $posts, which gives an array with many values.
foreach() is used for output:
foreach($posts as $post) {
...
}
How to show only five first values from $posts?
Like, if we have 100 values, it should give just five.
Thanks.
...
Hi,
I'd like to figure out a way to authenticate a facebook account on a form, without having to go into facebook login and whatnot.
So my question, is there anyway to check, I was thinking maybe the markup with regex, where I could check to see if a facebook count exists, and if so do something.
Thanks for the suggestions.
...
Take a look to this function please
function CheckHost()
{
$url = parse_url($_SERVER['HTTP_REFERER']);
$host = $url['host'];
if($host == $_SERVER['SERVER_NAME'])
return true;
return false;
}
i saw it somewhere, but can't understand it's usage.
is it for security reasons, or what?(as i see, it just verify is th...
hi there,
got a (I guess...) very simple problem:
I want to set a session within a function.
Simple situation:
I got a login form. After subimitting the form, I call a function "login" which checks if user has authenticated. If yes, a session should be set.
Here some very simple code:
session_start();
function login() {
$SESSION[...
Hi there.
Last time I did PHP I worked with CodeIgniter. To implement AJAX I used the XAJAX library, which was extremely simple and was capable of invoking private controller methods. Unfortunately XAJAX does not seem to be compatible with the latest version of CodeIgniter, or it might just be that it is not compatible with php5.2/5.3.
...
A school system has 30 schools. The lowest school code is 298 and the highest is 516. For every school, the same processes will be called. The approach I've taken so far can be seen below. How can I shorten this code? Thank you.
for ( $i = 298; $i <= 516; $i++ )
{
switch ( $i )
{
case 298:
$c_sch = strval ( $i ...