php

Is this possible?

I have a question, I'm using uploadify, and every time when a file finishes to upload, the script runs a code which is located in the onComplete statement, and the code from the onComplete statement it's an ajax call to a page, let's call it X , how can I know when the script access the page X for the first time? ...

cURL ip address

Hi, I need to send a curl request with the user's ip address not the server one. I tried this with no luck: curl_setopt( $ch, CURLOPT_INTERFACE, $ip ); Any ideas? Thanks! ...

PHP/Amazon S3: Query string authentication

I have been using the Zend_Service_Amazon_S3 library to access Amazon S3, but have been unable to find anything that correctly deals with generating the secure access URLs. My issue is that I have multiple objects stored in my bucket with an ACL permission of access to owner only. I need to be able to create URLs that allow timed access...

Removing Unnecessary Header Title in PHPBB such as "Index Page" or "View Topic"

I need help removing the unnecessary PHPBB header title on my forum for SEO purposes. I need some type of hack or something to get this removed. I want to have the title of a certain topic followed by a category and then the name of the forum. THanks GUys! ...

PHP __Constructor & __Destructor Questions...

I've been trying to learn the object oriented side of PHP, and was wondering: If I used a _constructor to open a connection to a database, used a function within that class (eg. insert), would the defined __destructor close the connection after the method "insert" is executed? class data(){ function __constructor { // connect to ...

PHP Conditional Operator and Self Assignment

Is this sort of thing considered OK in PHP? $foo = $_GET['foo']; $foo = empty($foo) || !custom_is_valid($foo) ? 'default' : $foo; Are there cleaner alternatives to this? I'm basically trying to avoid extra table look-ups. ...

How do you use RESTful APIs from PHP?

I've tried searching but I can't figure out how to access data via a RESTful interface. I'm looking for just example code that shows someone access some data from some imaginary web service using its API. A simple "how-it-works" explanation would be helpful too. ...

what are the vulnerabilities in direct use of GET and POST?

Hi all, i want to know what are the vulnerabilities while using the GET and POST variable directly. ie with out trimming and addslashes function and mysql escape string something like that. My Question is What more we need to take care of while playing with GET and POST. What kind of attacks are there like SQL injection? ...

Zend Forms - populate() and setDefaults()

Let's say I have a form that collects a first name and a last name: $first_name = new Zend_Form_Element_Text('first_name'); $first_name->setLabel("First Name") ->setRequired(true); $last_name = new Zend_Form_Element_Text('last_name'); $last_name->setLabel("Last Name") ->setRequired(true); $form = new Zend_Form(); $form->addEle...

How can I invalidate a page in the browser cache from the client side?

I need the client (using javascript) to invalidate a page it has and essentially fetch a new version? I thought I could do it all with headers: http://stackoverflow.com/questions/1295397/invalidating-cached-content-if-modified-headers If there NO way to have the browser refresh its current cached version, with out making a new request ...

zend_navigation and onclick attribute

is there any way how to push into zend_navigation page type mvc or uri and give it onclick attribute? array ( 'type' => 'uri', 'label' => 'Map', 'title' => 'Map', 'uri' => '#', 'click' => 'alert("show map");' ) i have sub sub menus included links which fires only modal. till yet i use my own "navigation" soluti...

jquery ajax call to a remote php file failing

i've got a foo.php file which retrieves client infomation and generates an xml output with the relevant client info. i'm trying this ajax call which does not seem to want to work $.get('http://www.foo.php','',function(xml){ $('samplenode',xml).each(function(i){ //stuff done here }); }, 'xml'); i'm still new to javascript...

Determine Logic for MySQL Select - Reservation System

Hi all, I'm creating an equipment reservation (PHP/MySQL) for my school. My database looks like this: tblEvents: id start end equipID tblEquipment: id name description I'd like to know the best way to query the database based on a user's time parameters to see if a certain item is 'not available.' For example, if I have...

Using XAMPP, how do i swap out PHP 5.3 for PHP 5.2?

I'm using XAMPP 1.7.2, but need to swap out PHP 5.3 for PHP 5.2 - how do I do this? ...

php email class that will display correct output on outlook 2007

Hi, Can anyone tell me of a php class that can send html based email on outlook express? I am using a class it words fine on yahoo, msn and gmail but when i try it on outlook it does not display correct output. I mean the email display on outlook is not correct. Thanks, -dizyn ...

Selecting a float in MySQL

I am trying to do a SELECT match on a table based upon an identifier and a price, such as: SELECT * FROM `table` WHERE `ident`='ident23' AND `price`='101.31'; The above returns zero rows, while if you remove the price='101.31' bit it returns the correct row. Doing a... SELECT * FROM `table`; Returns the same row as above and qui...

How to implement Live chat on my site?

I want to implement a live chat button on my site. Just want to know what you guys think is best? Or at least what are my options? ...

Setting quality with imagemagick?

I use the following code to create a thumbnail on the site: $small_image = new Imagick($large_path."/".$pic['image']); $small_image->thumbnailImage(100, 0); $small_image->writeImage($small_path."/".$pic['image']); It sets it's own quality and I tried adding $small_image->setCompression(imagick::COMPRESSION_JPEG); $small_image->setCom...

Break apart variable contents and load into array with php

This is what i have. $number = 25880; I need to break that up into individual lines in an array so i can read it like this $numbers['1'] = 2 $numbers['2'] = 5 $numbers['3'] = 8 $numbers['4'] = 8 $numbers['5'] = 0 How do i do this in php? ...

PHP Image Resize & My upload script.

I have seen a lot of examples, but I am not sure how it can tie into the upload script i currently have. Could someone please explain how I might be able to use ImageMagick or something of the like to resize an uploaded image to a fixed width while keeping the w:h ratio? I have googled and looked at over 150 web pages but none of them ...