php

Maintaining the same Session in Child Window

When a user arrives at my site, a session is started for them. There is a point where a child window is spawned using JavaScript on my sites home page. This child window goes to Twitter site to authenticate the user and it gets redirected back to a script on my site which stores some variables in a SESSION. I have found out that the P...

Template for JSON data?

I found this? Is this the best way to do it? http://weblogs.asp.net/dwahlin/archive/2009/05/03/using-jquery-with-client-side-data-binding-templates.aspx I'm looking to use some sort of repeat loop with variables that throw in JSON data. I am using Codeignitor and jquery. Thanks ...

Why won't my cookie value change in PHP 5?

Hi, I have a website where the login info is optionally saved in a cookie (remember me checkbox at login) and when the user logs out, the value of the authentication cookie won't change to expire the cookie allowing logout. The system does work correctly in both the dev and staging servers but for some reason will not work on our produc...

RSS Keeps Downloading on me...

I created an RSS Link today with the help of Code Igniter, and when I go to click on the RSS link, Firefox tries to download the file. The first few times, I downloaded it and made sure there were no errors (there were at first, but now that's sorted). Does anyone know why it keeps trying to download the file, instead of going to the "Ad...

IIS 7.0 URL Rewrite Module - Root URL doesn't display

Hi, I'm trying to setup a PHP website in IIS 7.0 with URL rewriting enabled using this module (http://www.iis.net/downloads/default.aspx?tabid=34&g=6&i=1691) I've got the whole thing running fine for inner pages of the site, but my root URL "/" doesn't work any more. I want the structure of my URLs to be www.test.com/test-page...

Making A Secure Login

I have been trying to make a secure login for my site that I am developing. I just cant get it to work, I use MySQL databases with PHP. I can make the form to add the user and their info to the database but I can't seem to make it work with the login. What type of encryption is used with HTML <input type="password">? How do I keep t...

Where does APC store its opcode and user variable cache?

The reason I ask is because when using top I don't see a process for anything like APC. So I assume that the memory usage would be accounted for in an apache process. Is that the case, and does that mean that the memory APC is using is replicated in each apache process, thereby taking up potentially much more memory than what was origi...

Not object although var_dump() says otherwise?

Hello, I have a problem. When I create controller, I load model (AccountModel) to class variable "Model" and check if user is logged in: function __construct() { parent::__construct(); $this->loadModel("AccountModel", "Model"); $account = $this->getUserAccount(); ... } Fatal error occurs in getUserAccount(): ...

Creating and combining controllers in an MVC PHP web application

Over the last few weeks I have been studying the MVC design pattern for web applications using PHP. Taking a broad view I understand how the pattern works and why it is a very good way of implementing any sort of web application from small or large. As I understand it we have 3 distinct layers that talk to each other via the Controller...

How to convert IPv6 from binary for storage in MySQL

Hello, I am trying to store IPv6 addresses in MySQL 5.0 in an efficient way. I have read the other questions related to this, such as this one. The author of that question eventually chose for two BIGINT fields. My searches have also turned up another often used mechanism: Using a DECIMAL(39,0) to store the IPv6 address. I have two ques...

php check if a series of numbers adds up to a given value, and increase if necessary.

I have a php script that is run once a minute. The script runs a second script, then sleeps for a given amount of time. Right now the time is static. 20 seconds each time. What i need to so is randomize the amount of time it sleeps. It can be more than a total of 60 seconds, but NOT less. So here is what i have now. $sleep1 = rand(2...

Making A Website With Profiles

I am working on a social network, and I am doing it with php and mysql, I need to know how to make users have customizable profiles... Like editing status, ect... Also making it so only friends can veiw their profile.. Also how do I add a user's page/directory to the website directory(example: domainname.com/someonesprofile) Thank ...

Sandboxing website best practices?

I currently work in a web shop with almost no formal processes and a million PHP websites, including tricky stuff like custom CMS and shopping cart code. We are trying to improve things. I am pushing for CVS/SVN. My question is, what is the best practice for sandboxing website work? We are on the LAMP stack. Some of our sites have h...

call_user_func_array vs. call_user_func

I ran across an interesting issue today. We have an application that utilizes Zend Frameworks caching functionality. A request to this application typically calls a factory method using the following line $result = call_user_func_array(array("myclass", "factory"), array($id)); The idea is to return an object from the factory method...

CodeIgniter with Eclipse PDT, is clean integration possible?

I am attempting to setup codeigniter with eclipse but am getting project errors. From what I understand this should be as simple as creating a new project in eclipse and pointing to the root directory of codeigniter. This properly loads up the codeigniter files but eclipse reports several errors. Looking into the files, it seems like ...

Tools to highlight deprecated functions in PHP4 sources?

Is there any magic tools i can use to scan source code that was written for PHP4 to highlight deprecated functions in PHP5? I'm currently running the latest version of PHP on a server and need to port this code. Is there anything out there that can give me a hand? ...

Codeigniter Form Validation...form re-population

I am in the process of creating an input form on a record specific page e.g. (property/rentals/rec_id). On submission, the data should be inserted, validated and return to the original page from which it was sent with any relevant messages. If the validation fails, reload the form page a re-populate the form Echo the specific validati...

Jquery dynamic pagination for comments expert opinion

I am trying to create a dynamic pagination system for my website and I've decided on using ajax callback function to dynamically show the comments when the user clicks on different page elements.. So I'm pasting the code below as an example as to how I am doing it...I would like to ask you guys if I'm doing it right or if their is any be...

Recaptcha Styling Using Zend PHP

Hi, I am using Zend_Service_ReCaptcha in a project and wish to customize the colour scheme of the box, however I am completely stumped on which function to use to achieve this. http://framework.zend.com/manual/en/zend.form.standardElements.html#zend.form.standardElements.captcha doesn't seem to shed any light. Answers are appreciated, ...

MKTime Function Returning Wrong Time?

Hi guys, I'm having a bit of trouble with the mktime function. On my production server, if I execute the following: echo '<p>' . mktime(24, 0,0, 8,29,2009) . ' - 12pm</p>'; echo '<p>' . mktime(23, 0,0, 8,29,2009) . ' - 11pm</p>'; echo '<p>' . mktime(22, 0,0, 8,29,2009) . ' - 10pm</p>'; And then convert those timestamps back to readabl...