php

How do I pass session variables from one domain to another in PHP

Hi everyone, I have encountered a situation where I need to pass $_SESSION variables from one domain to an iFrame page from another domain. I have spent the last 16 days trying various methods to no avail. I think that the only logical way would be to encode the variables in the url that calls the iFrame and decode them in th iFrame pag...

How can I append a description to a Zend_Form_Element?

I have the following Zend_Form_Element: $imginstructions = "Some description"; $img = $this->createElement('select','img'); $img->setAttrib('class', 'image-select'); $imgdecorator = $img->getDecorator('Description'); $imgdecorator->setOption('escape', false); $img->setLabel('Image:') ->setRequired(true) ...

display loading gif on multi-part form submit

Im trying to display a loading gif before submitting a multipart-form (file upload), this is my code.. but the image is not displaying.. if i remove the submit() it displays, so.. is not a path or syntax problem. $('#btnSubmit').click(function() { document.getElementById('loader').innerHTML = "<img src='<?= url::base() ?>themes/img...

php array regular expressions

I am using regular expressions in php to match postcodes found in a string. The results are being returned as an array, I was wondering if there is any way to assign variables to each of the results, something like $postcode1 = first match found $postcode2 = second match found here is my code $html = "some text here bt123ab and an...

Linking how PHP/HTML

Hello. Alright so im done doing pages with frames, and know i splitted up my design to top.php and bottom.php. In top.php it's linking to style.css and ajax_framework.js and such.. Now this works great until i tried to include top.php & bottom.php in videos/index.php (another dirr), i did like this: include "../top.php"; <-- and the ori...

How Do I Convert text to a WAV file With Inaudible Waveform?

I am trying to create an audio watermarking system. I figure the best solution is to create an audio file (WAV) based on a unique string of text and then combine this with the original wav. The part that makes this tricky (for me anyway) is: How do I convert the text string to a wav? How do I ensure that the resulting WAV form is inau...

Soundcloud API, PHP, and OAuth

Hi guys. I'm building a site, and I need to query my last two tracks from my soundcloud account and display them on my page. I've read the Soundcloud API documentation but it seems obscure and far from my reach. I've installed the PHP library for using the API and Oauth, and set up my SoundCloud application to get my Consumer Keys, but I...

HTML, PHP No data in drop down box

Hey, I am trying to figure out why a website's drop down box will not show any options. The data file for this drop down box comes from a microsoft access .mde file. The file is present and after the last update was working fine. Some changes happened to the site, i.e. text got added along with some photos. Im not saying this was when...

Creating an array from a MySQL table

I'm trying to create an array to use for a curl_multi_exec, but I can't seem to create the array properly. Here is my code: $SQL = mysql_query("SELECT url FROM urls") or die(mysql_error()); //Query the shell table while($resultSet = mysql_fetch_array($SQL)){ ...

Replace Word Screw ups Via PHP

Hello, Content people have been using Word and pasting things into the old unicode system. I'm now trying to go UTF8. However, upon importing the data there are characters I cannot get rid of. I have tried the following stackoverflow thread and none of the functions provided fix this string: http://snipplr.com/view.php?codeview&amp;id...

Converting a PHP array to class variables.

Simple question, how do I convert an associative array to variables in a class? I know there is casting to do an (object) $myarray or whatever it is, but that will create a new stdClass and doesn't help me much. Are there any easy one or two line methods to make each $key => $value pair in my array into a $key = $value variable for my cl...

PHP class function.

What is wrong with this code? <?php class users { var $user_id, $f_name, $l_name, $db_host, $db_user, $db_name, $db_table; function users() { $this->$db_host = 'localhost'; $this->$db_user = 'root'; $this->$db_name = 'input_oop'; $this->$db_table = 'users'; } function userInput($f_name, $l_name) { $dbc ...

what does $$ mean in PHP?

example a variable declaration within a function: what is $$ mean? global $$link; thanks ...

file upload functional testing in symfony without calling click()

I can't seem to perform functional test on file uploads through the sfTestFunctional's post() method. My action handling the HTTP post is able to get all parameters except the file upload field. Looking at Symfony 1.4's source codes, i think the sfBrowserBase only handle file upload through the click() method (specifically, the doClickE...

Jquery get array details

I'm having trouble getting a response back from a Jquery ajax call... (It's a script to authenticate a user, and needs to return their name and user ID. My understanding was that I could encode it as JSON and get the data in the format below. It is returning an error of "undefined" for the alert(). The javascript $.ajax({ type: "PO...

Log into file or database, readability question

Hi there! Right now I'm logging some info of the user in my web app in a log file to observe the usage & interest for some services, but I'm interested in checking that info in a readeable way, so I'm questioning if maybe I shall save that info in a database and then retrieve it to show it in tables or whatever. It's better to log in t...

Whats better- query with long 'where in' condition or many small queries?

Maybe it's a little dumb, but i'm just not sure what is better. If i have to check more than 10k rows in db for existanse, what i'd do? #1 - one query select id from table1 where name in (smth1,smth2...{till 30k}) #2 - many queries select id from table1 where name=smth1 Though, perfomance is not the goal, i don't want to go down w...

A Digg-like rotating homepage of popular content, how to include date as a factor?

I am building an advanced image sharing web application. As you may expect, users can upload images and others can comments on it, vote on it, and favorite it. These events will determine the popularity of the image, which I capture in a "karma" field. Now I want to create a Digg-like homepage system, showing the most popular images. It...

[ PHP - Image Magic / GD ] How to change the background black color to transparent?

Hello, I am rotating an image using Image Magick (as PHP-GD scales down image). But it leaves the background to be black. Also, the image doesn't look good at all(but better than PHP-GD). Any suggestions? @oren , @razzed Here's the code $patchImageS = 'kapeels.png'; // the image to be patched over the final bg $imagick ...

CakePHP hasOne ineffeciency?

I was looking at examples on the CakePHP website, in particular hasOne used in linking models. http://book.cakephp.org/view/78/Associations-Linking-Models-Together My question is this, is CakePHP using two queries to build the array structure of data returned in a model that uses hasOne linkage? Taken from CakePHP: //Sample results fro...