Hi, I've a class that basically looks like this:
class App {
public function newTemplate($filename, $vars=array())
{
$smarty = new Smarty;
$smarty->compile_dir = $this->template_compile_path;
if(count($vars) > 0)
{
foreach($vars as $v_key => $v_name)
{
$smar...
Say a user visits your site on an old blackberry with stylesheets off (and probably javascript off as well). How would you go about detecting if a browser was applying stylesheets or not?
...
In my php page, I recieve a bunch of get parameters. can a file I include read these too?
...
I'm trying to create a module in joomla, which uses one jquery plugin. I've to do an ajax operation while clicking on an element in the module. Currently I'm specifying the whole path to the php file. But I know Its a wrong method.
The code in jquery plugin is like this.(please note the second line where the path is specified in the jqu...
I have a facebook app that hooks into an external calendar built using PHP and MySQL. Some of the events in this calendar have associated facebook events, some don't. The external calendaring system also supports invitations and responses to events.
When a user is invited to an event on the non-facebook calendar, I would like to be ab...
I am using cakephp 1.2 and I have an array that appears to have a value change even though that variable is not being manipulated. Below is the code to that is causing me trouble.
PLEASE NOTE - UPDATE Changing the variable name makes no difference to the outcome.
function findCountByString($string, $myArr=array()) {
$main_conditions['...
Hi people, i'm having a problem trying to print some data of a table. I'm new at this php mysql stuff but i think my code is right. Here it is:
<html>
<body>
<h1>Lista de usuários</h1>
<?php
$host="localhost"; // Host name
$username="root"; // Mysql username
$password=""; // Mysql password
$db_name="sabs"; // Database name
$tbl_name="do...
I've written a CMS which uses the PHP function json_encode to send some data back via an Ajax Request.
Unfortunately, I'm trying to load it onto a server which is running PHP version 5.1, the json_encode PHP function is not available on versions of PHP before 5.2.0.
Does anyone know of a way to encode a PH array as JSON without using t...
Hi guys, I would like to embed a flash file into my facebook iframe canvas, I am using the PHP sdk, here is my code,
echo "<fb:swf swfsrc=\"http://my.site.com/facebook-test/the_file.swf\" width=\"760\" height=\"710\" />";
I have tried everything but it still doesn't seem to want to display.
Thanx in advance!
...
I'm trying to backup a folder containing several folders and files to a remote location (will be uploading zipped files). Is there any existing scripts that may help me, which checks if the files have been modified after the date of the last backup, and only backs up files created / modified after that?
The current size of the data is a...
Trying to sort the array below by memnum in ascending order, and I'm a bit confused which is better to use... usort or array_multisort? I was thinking usort because it's multidimensional? Does anyone have an example of this?
Array
(
[0] => Array
(
[memnum] => 3236467423
[mid] => 1104881300
...
Hi,
I have a problem with my php/mysql script. It should only output the while loop once but I am getting unlimited loops and an endless page.
$query = mysql_query("SELECT * FROM users WHERE username ='".base64_encode($_SESSION['username'])."' LIMIT 1");
$result = mysql_fetch_array($query);
if(empty($result)){
echo "No user......
hi,
I need to incrase the php file upload limit of 8MB on an IIS server.
I don't have access to configuration files, so I was wondering how to increase it (I need something similar to .htaccess for apache..
thanks
...
This is the code in ZF (simplification of a real problem):
<?php
$nested = $table->select()
->where('name = :var')
->bind(array('var' => 'my value'));
$select = $table->select()
->join(array('nested' => $nested), 'nested.id = id', array());
$table->fetchAll($select);
The variable :var is not "bind-ed" in this scenario. What am I...
Hello,
I have a homebase script, that I have many other scripts ping for information using the CURL method. I need to determine the domain name of the callers. Can I do this with tricks just on my homebase script?
. using php .
Hudson
...
Hello all!
Well I have unusual question I think. I am making a web site and the products must be shown as a line I will past a link for better understanding.
http://partyclub.mdkbg.com/products_carbonated_mix.html
Clicking the bottle in the right will change the products to the next. But if you keep clicking will see that when the end...
Hi,
I am using paypal standard as my payment gateway.
My problem is that, in Paypal Standard payment method,
I have done my code as below:
When user click on return to merchant button from paypal then user return to the site with order data , and on that page my order entry will be inserted in my DB.
So my problem occur when someone p...
I have an image I have to rotate that image 25 degree. if I rotate it shows some black background. How can I avoid that. How can I rotate image completely with out showing the black portion by using PHP GD. I cant use js for rotation. because I have to merge the image with another one after rotation. any body have the scripts for this pl...
How to get the path of the current class, from an inherited method?
I have the following:
<?php // file: /parentDir/class.php
class Parent {
protected function getDir() {
return dirname(__FILE__);
}
}
?>
and
<?php // file: /childDir/class.php
class Child extends Parent {
public function __constru...
I have a strange problem with php sessions. I use them for authorization on my site. I store two variables - currently logged in user's id and username in session. When I log in with one username, than log out and log in again with another username the previous user's id is returned using the session variable instead of the current user....