php

automatically downloading and installing an exe file

I need to automate the process of downloading and installing an exe file abc.exe from say 'http://10.34.45.21:8080/cruisecontrol/artifacts/xxx_trunk_nightly_build/xxx/test/' I mean now i have to manually goto ''http://10.34.45.21:8080/cruisecontrol' then click on each folder before i finally click on the abc.exe file. Then it downloads ...

What are the possibilites to embed content from other pages on my own page

Hello this is may first question and I have found so far the following alternatives: ServerSideInclude embedding complete pages via iframe to parse xml and translate into html It would be nice, if you have some more suggestions. Thanks for your patience. Best regards Matthias Günther ...

Why does PHP overwrite values when I iterate through this array twice (by reference, by value)

If I iterate through an array twice, once by reference and then by value, PHP will overwrite the last value in the array if I use the same variable name for each loop. This is best illustrated through an example: $array = range(1,5); foreach($array as &$element) { $element *= 2; } print_r($array); foreach($array as $element) { } print...

Modifying the contents of a HTML webpage on the fly in PHP

I would like to load a HTML document and modify it's text in PHP. For example, if I have a document like this: <html> <head><title>Test - Example.com</title></head> <body> <p><a href="http://www.example.com"&gt;Link number 1: Example.com</a></p> <p>Link number 2: Example.com - some random text</p> </body> </html> I would like to add a...

How does vimeo route it's urls?

I'm wondering how vimeo manages to retain its parameters using routing, for example in vimeo, a search uri looks like this: http://vimeo.com/videos/search:google/, which will return a variable in this case google. This is easy enough to do, can simply use routes and explodes in php to get the data you require into a useful array, what ...

Session_ONEnd on PHP

Hi guys, I have recently started programming in PHP. I am building a cart in PHP. I have my products locked in cart when someone adds it to their cart. I need to unlock those products when the specific user gets logoff or session expires. How can i call something like session_onend function as in asp/asp.net to unlock/release those ...

FBML is not rendered in Facebook App in iframe - please help

I'm developing an Facebook Application in PHP. It's loaded as an iframe and not as FBML. The normal interaction with Facebook works. For example the following code gives the username: $facebook = new Facebook($config->appapikey, $config->appsecret); $user_id = $facebook->require_login($required_permissions = 'email'); echo $user->name; ...

What this Url ending means .....&123 ?

Hey I am having some issues while using Nggalley plugin for wordpress the plugin makes use of a JW player and JW player needs an XML - so it requests link like this http://nextgen-gallery.com/index.php?callback=imagerotator&amp;gid=1&amp;149 The lay &xxx really creaps me out couse I am using it for joomla and joomla doesn't like this I...

How to access the value of a url variable in a Zend view Helper?

I want to access the value of a specific variable (in the url) in my view helper. How can I do this? I'm able to get my controller name with: Zend_Controller_Front::getInstance()->getRequest()->getControllerName(); , but I have no idea for the variable ... Thanks in advance! ...

setting write permissions on theme subdirectory?

I've a theme which supports multiple templates, each with a header background image whose color can be set by the site owner via a colorpicker widget in my theme's options panel. This has the effect of opening the background image, recoloring it and resaving it back to the server. I've had zero issues with this routine until recently wh...

How to use PHP in the header of a drupal view?

I have a drupal view, which displays a content type filtered by a url argmuent (e.g. category). Now i'd like to add a link in top of my view, which allows my users to add a new node. In the add form the argument field should be prepopulated with the value from the filter. I think to archive this, i have to install the prepopulate modul...

How to grab dynamic content on website and save it?

Hello! For example I need to grab from http://gmail.com/ the number of free storage: Over <span id=quota>2757.272164</span> megabytes (and counting) of free storage. And then store those numbers in a MySql database. The number, as you can see, is dynamically changing. Is there a way i can setup a server side script that will be grabb...

What is the REGEXP php syntax to change LastName, Firstname to FirstName LastName?

I would like to change the order of names from Last, First to First Last. I don't know the REGEXP and the php syntax for it. ...

Getting a file pointer from file descriptor

In PHP 5.2.3, "fdopen" was used to read/write to a file descriptor that's opened by another application. fdopen(<fileDescriptorId>,"rw"); //It worked fine with PHP 5.2.3 After upgrading PHP to 5.3.2, it's throwing "undefined reference to 'fdopen' function". Please suggest whats the replacement for this in PHP 5.3.2 or any workaround...

writing dynamic headers

I have a php dynamically generated image which I need to write to file to call later. My problem is that I need this image to have appropriate expiration headers included in it. There are a massive number of these and their headers vary individually file-by-file making .htaccess controls not an option. I can write expiration headers i...

Using php's magic function inside another function does not work

I want to use magic function __set() and __get() for storing SQL data inside a php5 class and I get some strange issue using them inside a function: Works: if (!isset($this->sPrimaryKey) || !isset($this->sTable)) return false; $id = $this->{$this->sPrimaryKey}; if (empty($id)) return false; echo 'yaay!'; Does not work: if (!isset(...

Getting the Folder Path via the Browser using Internet Explorer

Hello all, I would like to create a folder selector for my application which will only run on Internet Explorer Browsers (IE6+). I would like to get the full folder path a user wishes to use via a HTML browse button or similar and then pass this to my server side application which is written in PHP! This can not be done via JavaScript ...

How Doctrine saves new related objects

If I create a new Doctrine object, with lots of relations, should I save() these relations before assigning them to newly created object? E.g. $main = new Main(); $child = new Child(); $main->child_rel = $child; // do I need to save the child obj explicitly? $main->save(); I assumed that parent will automatically call cascading saves,...

Can I attach data gathered by a form to a file that is being uploaded?

I need customers to upload files to my website and I want to gather their name or company name and attach it to the file name or create a folder on the server with that as the name so we can keep the files organized. Using PHP to upload file PHP:>> if(isset($_POST['submit'])){ $target = "upload/"; $file_name = $_FILES['file']['...

Help with proper character encoding.

I have a HTML form that is sometimes submitted with accented characters: à, è, ì, ò, ù I have a PHP script that exports these form submissions into CSV format, when I look at the CSV format in a text editor (vim or notepad for example) the characters look fine, but when opened with Open Office or Word, I get some funky results: ����� I...