php

Zend Framework 1.10: Cookies aren't stored

Hi, I'm trying to with Cookies and Zend Framework 1.10. This is my code: $zendCookie = new Zend_Http_Cookie('foo', 'bar', 'localhost', time() + 60 * 60 * 24 * 30); $client = new Zend_Http_Client(); $client->setCookie($zendCookie); But the cookies aren't stored. I checked it with Firecookie Firefox's extension. What's wrong? Thank yo...

PHP can I do this loop?

I have a loop (based on an array - which could grow but NOT too much - max 6 keys) e.g.: array('12','34','56',48'). What I would like to do is loop through the array and THEN loop again to find the "previous" array val. For example, key[0] = 12, key[1] = 34 then key[0] = 12, key[2] = 56 then key[1] = 34 etc. The values of the array ar...

[jquery] submit form with textarea and multiple file?

if i have one form that include some input, textarea, select, and multiple file. such as <form> <input type="text" id="name" /> <textare id="address"></textarea> file 1 : <input type="file" id="file[]" name="file[]" /> file 2 : <input type="file" id="file[]" name="file[]" /> file 3 : <input type="file" id="file[]" name="file[]" /> </for...

how to get joomla menu object based on name?

Hi, This question is bit specific to joomla. I know if with the code $menu = &JSite::getMenu() I can get the reference object of the complete menu. But how can i get a specif menu based on the name? My Scenario : I have footer-menu with items : home | about us | rules | privacy policy. I need to display links to two menu items Rules ...

php ‘apache_note’ function whilst SUPHP is active

I am using maxminds geoip apache mod extention. It requires the php function 'apache_note'. However while suphp is active I am unable to access the function. Ideally I would like to use suphp as I understand it offers security benefits. Is it possible to use apache_note while also using suphp? ...

API of price-comparison website. is there any ?

i'm try to work on e-commerance stuff. i would like to know whether there a price-comparison website that support API ? ...

Get results from php script via jquery load() functon before php script finishes

I have the following situation: jquery: $(function(){ $('input[type="button"]').click(function(){ $('#result').load('script.php'); }); }); script.php: <?php echo "1"; sleep(2); echo "2"; sleep(2); echo "3"; ?> Currently the jquery load function will wait for the php script to finish and the...

PHP Variable Issue

For starters, I am completely new to PHP. That being said, here's my problem. I've got a web page index.php that includes a header.php and footer.php. At the top of my index.php page I have: <?php $pageID = 'home'; ?> In the header.php file I have <body id="<?php echo $pageID; ?>"> Yet when the page loads, the body tag simply lo...

How to populate zend form select element?

Hello I have been searching for it from last couple of hours and have read every matching result google can give me but still can't get it to work. I am creating a zend form select element through: this->addElement('select','my_select', array( 'label' => 'Currency', 'value' => 'blue', 'multiOptions' => array( 'red' => 'Rouge'...

restricting access to static content/authenticating via htaccess with PHP?

I'm developing a LMS solution with php/apache which takes SCORM files and outputs the courses for users to undertake in the format http://www.example.com/courses/course1/index.html The LMS itself will be accessible by anyone and as the course content is static html I dont seem to have many options in regards to authentication. I origin...

PHP SOAP WSDL CALL RETURNS EMPTY RESULT

I am making a SOAP WSDL Request and get an exmpty result - no errors. The last_response is filled with: <?xml version='1.0' encoding='UTF-8'?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"&gt;&lt;S:Body&gt;&lt;ns2:getResponse xmlns:ns2="http://api.sponsoredlistings.ask.com/api/v5/"&gt;&lt;rval xmlns="http://api.sponsore...

Using php's swiftmailer with gmail

I'm writing a simple script in which a gmail account is used to send an email to itself. I altered the script from SwiftMailer's reference, but I'm not getting any results. What's wrong? Edit: after further debugging I've found that the statement $result = $mailer->send($message); causes the code to fail (the echo below it doesn't...

Safety precautions while doing html form processing using javascript, PHP, MySQL

I am not a professional web developer but I love web development as a hobby.. I am a student and I was asked to make a departmental event web site. I need to create HTML forms for user registration. I am aware of XSS Scripting attack and SQL Injection. But don't know how they exactly work. I am using PHP and MySQL on server side. I am t...

Emulate public/private properties with __get() and __set()?

I was writing a class that uses __get() and __set() to store and retrieve array elements in a master array. I had a check to make some elements ungettable, basically to re-create private properties. I noticed that it seemed that __get intercepts all calls to class properties. This sucks for me, because I wanted to have a variable priva...

Call PHP Function from Smarty with AJAX with no user action

I am hitting a lot of different sites to get a list of information and I want to display this information as I get it. Right now I am using a Smarty Template and what I would like to do is: Pseudo code: {foreach $page} $smarty_var = use AJAX to call a PHP function Render out a new table row on the fly w/ the newly assigned var ...

Select from dropdown list selected option with php after check

Hi! I ran out of ideas... Imagine, I have fields that must be filled <select> <option value="1">Yes</options> <option value="2">No</options> <option value="3">Fine</options> </select> <input type="text" value="" name="name"> <input type="submit" value="go" name="go"> butI forgot to fill my name and I press submit. How to return option...

php - good 'date' class for dealing with weekdays?

Does anyone know of a php class or library that helps deal with dates (meaning weekdays)? For example, I could use it to say "give me the timestamp for next Tuesday at 9:00" or "is this timestamp between next Tuesday and next Thursday". I just have a part of my application that I need to make sure I'm not scheduling things at certain ti...

Paginating findManyToManyRowset result

Hi, I have two database tables (lets call them A and B) with many-to-many bridge table (AB). I have written Zend_Db_Table models for all three tables. I have an A_Row object I extracted from the database using for example Zend_Db_Row::find method. Now I need get print a table of all rows, which are in relationship with this row. The pr...

How do you authenticate a Wordpress front-end against a RESTful Grails-driven backend?

I'm developing a Software as a Service offering that other developers can use to integrate into their own sites running on Wordpress (and eventually other platforms). The backend will run on a set of REST webservices using Grails. I want to create a set of Wordpress widgets that can automatically hook in to my web services. The wordpres...

PHP SOAP XML Response convert to DOM Document loadxml() - not working, empty

I have a SOAP Response which I want convert to a DOM Document. I am using loadxml() for that, but it returns an empty object. <?xml version='1.0' encoding='UTF-8'?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"&gt;&lt;S:Body&gt;&lt;ns2:getResponse xmlns:ns2="http://api.sponsoredlistings.ask.com/api/v5/"&gt;&lt;rval xmln...