Questions tagged "php" (page No.1)

Comparing two arrays to prevent massive looping

I have two things I'm cross-indexing; an external .txt file and a directory. I've stored both to a array (or tried to, the txt file is returning a blank array with print_f) What I'm trying to do now is loop through the directory array looking for a fuzzy logic match on the ...

Privacy control using Zend

I am making a social website using Zend. The site allows users to become friends and access each other's profiles and blogs. I also want users to have control over their privacy, which can take parameters "Friends Only" and "Public". I looked at Zend_Acl but it seems to be only ...

PHP topic viewing and replying script

I'm working on a small board/forum. I have topic posting done; it's visible in the database and all that jazz. Now I'm working on retrieving the topic list and so that when you click a topic you can view it. That's working fine, except that when I click ...

How to get a users profile pics to be viewed by other users using PHP?

All I am looking for is when the below code is run and the Albums or the Music links are clicked it posts to the same page, correct? hence the url changes and add the href on the end of it depending on the link clicked. Well how can ...

Yii Framework Session Not Saved After Login

We have the following function in /rpotected/components/UserIdentity.php: public function authenticate() { $username = $this->username; $password = $this->password; ...

Smarty IE9 requests file download of index.php (after an upload has occured)

Okay so I'm getting this weird unexpected response from Internet Explorer, while testing file upload with smarty in php. Here my smarty code for file upload (view), simplified down to main issue, for those who have not used activecollab the Router::assemble is just forming a url with parameters that are read ...

PHP Async GET request works on one server, but doesn't on the other

Please see the edits at the bottom for additional information! I have two servers. Both should be able to call each other with a GET request. To make the request (it's more firing an event than makeing a request actually) I am using this code: function URLCallAsync($url, $params, $type='POST') { ...

Similar images - how to compare them

I have over 1.3milion images that I have to compare with each other, and a few hundreds per day are added. My company take an image and create a version that can be utilized by our vendors. The files are often very similar to each other, for example two different companies can ...

APC user cache entries not expiring

I see 5 output each time when I run this code: <?php $v = 5; apc_store('vwxyz',$v,3); $before = apc_fetch('vwxyz'); sleep(5); $after = apc_fetch('vwxyz'); //should be false echo $before; echo "<br>"; echo $after; $later = apc_fetch('vwxyz'); //OK this should definitely be false echo "<br>"; echo $later; Shouldn't the cached entry be cleared from the cache and return false to apc_fetch()? The user_ttl setting is ...

JQuery's $.post sometimes work sometimes return 403 forbidden error

Sometimes I get a 403 forbidden error, I can't see what's wrong. Here is my jQuery code: $.ajax({ type: 'POST', url: './ajax-conf-editc.php', data: { conf_id: Id, conf_contenido: ...

PHP/PDO strange request

I want to do a PDO request that will get informations from 2 different tables, but things fastly get hard, i explain : I have a first database table (flowers) that is organized like this (but it's REALLY bigger than what I show to you) : ID; ...

Triggering JS from PHP form process

I have form, let's say it's on index.php. On submit, it goes through process.php, then finishes on thanks.php. I want to trigger an Analytics Event so I can track my form (no I don't want to use a URL Destination). If I put the Event code on thanks.php, I'm concerned ...

mod_rewrite to get files from Amazon S3?

Is it possible to use mod_rewrite with Amazon S3 so that when a user types a url such as: www.example.com/link , It can retrieve/download the index.php file from a folder named "link" in S3? For example: www.example.com/user --> s3.amazonaws.com/mybuckname/user/index.php www.example.com/user/anotherfile.php --> s3.amazonaws.com/mybucketname/user/anotherfile.php Essentially, I want www.example.com to equal (probably not the proper terminology) ...

NetBeans code template for using functions' various arguments

Is it possible to write a NetBeans code template for using different functions' arguments, and call other functions with these variables, depending on the number of arguments? To clarify my question, I write an example. I'm developing in Drupal, and use Devel module's different functions, like ...

How to easily send a POST request and receive + interpret JSON using PHP

I'm using the Foursquare API and I need to make a request to their server in order to receive an access token in JSON form (https://developer.foursquare.com/overview/auth). How do I do this using PHP? I haven't found any definitive tutorials online, which is why I'm asking here. I've seen some stuff ...

Arrays with PHP wont evaluate

I have a config.php file which has some constants and methods. I have a test.php file which calls one of the methods in config.php. The relevant code is: $Questions = array( 1 => "Is he/she nice?1", 2 => "Is he/she sweet?2", 3 => "Is ...

How to prevent php submission of sms text message on page refresh?

I am using a 3rd party sms gateway to send clients a text message when a prospect submits an inquiry form on their web page. I'm using Aweber for the autoresponder system, who sends a query string with the prospect data in it, which I collect and send to the ...

How do I protect my templates/views with PHP user auth?

I have a webapp where I've kept most of my PHP code separate in controllers. These controllers have user authentication at the beginning of the file. If the user is authenticated the rest of the code runs and depending on the action, an HTML template/view is included. These template files ...

« Previous12345678910 ... 1322313224Next »Show All