php

Deregistering Jscripts / CSS From Wordpress Plugins

Im not sure if this is an issue with Wordpress 3.0 and changes to function names but as far as I can tell this should remove the jscripts and css from the headers sitewide add_action('wp_print_scripts','my_deregister_javascript', 100); function my_deregister_javascript(){ wp_deregister_script('ngg_script'); wp_deregister_script...

Сreate trigger in MySQL or not (via PHP)?

Table in MySQL have 1 problem column: creation_date. During inserting a new row through PHP, I thought that there would be correct to insert the date directly in the query, MySQL has to do it himself. Do I need to do the trigger, or it would be better to use PHP for this, as intended? How would you have done to? PS: http://stackoverfl...

mod_rewrite for PHP's "lang?=" for more than one page?

I currently use the follwoing code in my .htaccess file RewriteEngine On RewriteBase / # Redirect languages RewriteRule ^(en|es|zh\-tw|zh\-cn)/?$ index.php?lang=$1 [L] With that code, every time I type for instance, /en at the end of the URL, it redirects me to /?lang=en (loads the the English content from a PHP array): For instance...

Where can i set the location of the css file in wordPress using php?

I am using wordpress and am trying to link to the stylesheet: <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" /> It is not recognizing that link tag, because I think the bloginfo('stylesheet_url') part is not working correctly. Where can I set the location of the stylesheet url in wor...

array replace function not working for me

is there any array replace function in php .. in php manual there is a function called array_replace but its not working... Tell me some example... for array replace.. ...

Problems with redeclaring classes when using PHP's class_alias in a functional test

Hi I'm using PHP 5.3's class_alias to help process my Symfony 1.4 (Doctrine) forms. I use a single action to process multiple form pages but using a switch statement to choose a Form Class to use. public function executeEdit(sfWebRequest $request) { switch($request->getParameter('page')) { case 'page-1': class_alias('MyFor...

PHP Query Generator/Reporter

I'm in the process of tweaking a web application and so far I've had some really helpful guys from here, explaining things in layman's terms. Thank you. One of the abilities I wanted in my app was the ability to search through records and use the result to generate different kinds of useful reports. In my workplace we use a system like ...

Regular expression for <a> tag replacement

Hello, I'm new to regular expressions, but I'm trying to learn about it. I want to remove the tag of a html text, and let only the inner text. Something like that: Original: Lorem ipsum <a href="http://www.google.es"&gt;Google&lt;/a&gt; Lorem ipsum <a href="http://www.bing.com"&gt;Bing&lt;/a&gt; Result: Lorem ipsum Google Lorem ipsum ...

Pass arguments from array in php to constructor

Normally, if I want to pass arguments from $myarray to $somefunction I can do this in php using call_user_func_array($somefunction, $myarray); However this does not work when the function one wishes to call is the constructor for an object. For fairly obvious reasons it does not work to do: $myobj = new call_user_func_array($classna...

php flash highscore system for a games site

Hi, I am currently working on a php/flash/mysql based high score system for a games website. The main obejctive of this system is to submit the scores in the database using flash game. Whenever the user makes the score it will be reflected in the database. While in testing evironment when i submit the scores from flash file the scores a...

Talk to web service without SoapClient in php?

I'm severely annoyed with many shared hosting providers not enabling SoapClient support on their hosting environments. Usualy, after a lot of begging and growling they enable it for me, but sometimes they just won't budge. So, is it possible to consume web service on php without using SoapClient class? ...

How to keep two sessions at a time for a single page?

Hi, I've a online service tool where users registers themselves and use it. I've admin control panel for this service. Sometimes when users tell us some weird things about data and usuability , we need to check them as if they were logging in ... so i decided to have a page in admin panel as 'log in as xx user' where xx is an user of...

PHP nl2br() basic function help

Can somebody please help me with this mail script. I'm simply trying to send an html email and part of the message is from a user textarea, which puts in \r\n. I seem to be unable to use nl2br or any other similar function. The code below isn't what I'm using but still produces the error. The code: $to = '[email protected]'; $subj...

PHP Plugins System

Possible Duplicate: Best way to allow plugins for a PHP application Hello all.. I'd like to learn how does the php plugins system works.. So can anyone explain the idea of it for me in detail, I saw many posts and explanations but I didn't learn and understand any of it. Edited: Sorry.. I meant if I want to make a plugins sy...

Redirects - alternative to "<meta http-equiv='refresh' />" ?

Possible Duplicate: Best redirect methods? Hello I am working with some legacy code that includes a module for user registration / login. There is a block that queries the DB to see if the user is logged in, then re-directs to the login page. The re-direct is handled by <meta http-equiv='refresh' content='=2;index.php' /> ...

Wrong url parsing

I have usual url, where params and values are separated by / And i have this url piece word//show-count/1 On my local machine zend retrieves word = '' show-count = '1' On test-machine it retrieves word = 'show\-count' Why it happens and who is guilty. I think, that problem is in ignoring double // ...

Performing a dictionary attack on my own site.

I would like to perform a dictionary attack, or, if it is easier an attack directly in the database with my hashed passwords in order to find out what users of my site are using simple passwords. I will be implementing some complexity rules when creating passwords but I would love to be able to contact the users who have simple dictiona...

MySQL -PHP insert DATETIME

can anyone please guide me on How to insert a DATETIME filed from iphone through PHP script into MySQL database. $dates = date('Y-m-d H:i:s','2010-10-12 15:09:00'); $query = "INSERT INTO timeTable(time) VALUES ('$dates')"; Thank you.. ...

[IPB3] ssi.php return strange page

Hello I include in some pages this code: $_GET['a'] = 'stats2'; include "/var/www/forum/ssi.php"; on main page (www.musite.com) its work fine. But on other pages like www.mysite.com/bigpage/, www.mysite.com/about/ etc. ssi.php return part of forum page (a lot of css an js). How can i fix it? ...

Select a random row but with odds

I have a dataset of rows each with an 'odds' number between 1 and 100. I am looking to do it in the most efficient way possible. The odds do not necessarily add up to 100. I have had a few ideas. a) select the whole dataset and then add all the odds up and generate a random number between 1 and that number. Then loop through the datase...