php

Jquery Form Validation and Checking the values with Mysql Database through PHP Script

I have a form which has a input textbox and submit button. On submission of the form the textbox value should get pass to an php script and check the values whether it exists in the Mysql Database. If it exists then we need to show an alert box stating that "Entered Value is already exists, Try something new". If the value not exists th...

Apache / PHP Disable Cookies for Subdomain ?

Hi There, I am trying to follow these guidelines (http://developer.yahoo.com/performance/rules.html#cookie_free) to make my page load quicker, I have created a static subdomain to load static content from, however it is advising me to not have cookies sent on this subdomain, any ideas on how I might be able to do this in apache / php ? ...

server side validation

Hi I have created a reg.php. I need to include the server validation using php. I have written the code and dissabled the java script in my browser. But it is showing "you have successfully registered even if i dont give any field.this is my code <?php $hostname = "xxxx"; $username = "xxx"; $password = "xxx"; $dbName = "xxx"...

jQuery AJAX request fails on PHP exception

Hi, I'm using the Kohana PHP Framework for an application. Now I'm running into a problem, when jQuery does an AJAX request to a certain file, it does work, but when this file throws an PHP exception, jQuery fails and doesn't show the output of the file. A little example, this is the piece of Javascript: $.post($('#' + e.currentTarget...

implement RESTFUL webservice with php

I need some better understanding on how to implement REST services with php From what I have read sofar, they say "use logical adresses" and preferably don't use get variables at all. What I don't see is how these url's are getting processed. Like www.somename.com/product and product is supposed to be not a physical address. I mean, y...

Obtaining parameters passed with zend php _forward

Hi, A simple question really. I am using the _forward function in the Zend Php Framework. $this->_forward('formview', null, null, array('test'=>'penu')); So Im forwarding to the formview action with the same controller with the paramater test = 'penu' However how do obtain this value when I am in the action which I am forwarded to. ...

PHP- making a fake directory!

I have been looking at some sites that pretend that there is a directory structure in the URL and wondered 'how?'. I am taking control of a website at work and have looked over the code. They have a database for all the pages and they are created dynamically. I can get the homepage working on my local server but i dont have a clue as...

WordPress oddity with broken images (part 2)

Can you tell me your opinion of this, and possibly see if you can recreate it? There are TWO scenarios: SCENARIO 1 (works as intended)... The $post->post_content variable contains this (with a VALID image src): (string) "before [hw] <img src="/path/to/valid_image.gif" /> after" This code placed at the top of the theme header.php... ...

Detecting frames in PHP without JavaScript?

Hi folks -- I have a client running an ASP.NET application. Inside of that, there's a self-contained PHP wiki. The problem is that the wiki won't use the .NET authentication, so requests directly to http://foobar/path/wiki/ will resolve without forcing a login. My simple solution for this is to run the PHP application in an iFrame fro...

Multiple pages with codeignitor?

I am trying to find the best way to only have to load my view one time and re-use them on different pages. For the home page for example I have this code: function index() { /* Load Includes for all pages */ $header = $this->load->view('includes/header','',true); $scripts = $this->load->view('includes/scripts','',t...

Woot-badge like in PHP

Hi everyone! Does anybody knows how to implement something into a website written in PHP, similar to the Woot-badge and the Fanatic-badge on stack overflow? I want to reward my users if they visit my site everyday for 75 days, without days they don't visit it. My site uses sessions for log ins. And I use a MySQL database. The users tab...

Async interferes with my ACL plugin

Hey guys, I just created a plugin to go with my site to make sure a user is authenticated before performing an action. This is the plugin: class Booze_Plugin_AclPlugin extends Zend_Controller_Plugin_Abstract{ public function preDispatch(Zend_Controller_Request_Abstract $request) { $auth = Booze_Permissions_Auth::getInstance(); ...

Object Orientated Common Methods: Interfaces, Abstract, or something else.

Hi This is probably a really straightforward answer - but a bit of advice would be appreciated. I have a small system where all of my objects use the same load() and loadMultiple() methods. Exactly the same code in each. Very simple, example below. public static function load($id) { // Instantiate the object $object = new self($id);...

PHP App doesn't work after migrating to a Windows machine

Hello; A PHP application that was working perfectly on a LAMP server can't require or include files at all after migrating to a Windows Server 2003 machine. For example, given the following file : include("connectme.php"); echo "==== $SERVER_NAME, $USER, $PASSWORD"; $sql="SELECT id, model FROM `products` WHERE acc_code IS NULL O...

Best Practices for Non-loggable Accounts

I am wondering what the best practices are for creating non-loggable accounts. On StackOverflow, there is a Community Wiki account that I'm assuming can't be logged into. How should I go about scripting for non-loggable accounts? If there is an account that I don't want to be accessible, should I set parameters like you can't log into ...

PHP array with distinct elements (like Python set)

Is there a version of the PHP array class where all the elements must be distinct like, for instance, sets in Python? ...

Best way to process large XML in PHP

I have to parse large XML files in php, one of them is 6.5 MB and they could be even bigger. The SimpleXML extension as I've read, loads the entire file into an object, which may not be very efficient. In your experience, what would be the best way? ...

PHP / Apache how to set session.cookie_domain from outside php.ini

Hi There, I need to restrict cookies to my www subdomain, this works by me adding the line session.cookie_domain = www.example.com in the php.ini file. However I have a number of virtual hosts on my server so I need this domain to be different for each one. After a bit of a web-seach, I have tried using: 'SetEnv session.cookie_domain w...

User actions like social networks facebook,myspace, all big ones

I am working on a social network type site in PHP, I have done this once before and the site outgrew my coding ability to keep up, this was a couple years back and now I am wanting to tackle this project again. Basicly on my network there is a friend_friend mysql table that keeps track of who is who's friend, for every confirmed friend,...

How to change a string globally in a MySQL database

I have an old drupal site that I'd like to upgrade, but I need to move all the site data files (like jpgs, gifs, etc.) from /files to /sites/default/files. I'd like to use a PHP script or just a MySQL command to find any instance of /files/* and change it to /sites/default/files/* (without messing up the string in the * part of the name...