php

BBcode parsing problem

Im building my own forum where you can use diffrent types of BBcode and one of them is [youtube][/youtube] to embed youtube videos, The idea is to make it idiot-proof, the user can enter the full lenght url or just the code to the video like this [youtube]http://www.youtube.com/watch?v=AJ3_kndmeCg[/youtube] [youtube]http://www.yo...

Comments are not displaying in wordpress 3.1

Im running Wordpress 3.1 and its showing that there are comments (ie: 3 comments) but when you click into the single blog post they don't appear but the comment form appears. Im not sure whether its a template issue or something's not correct in the functions.php. I have the multi site function running for multiple blogs. Anyone els...

PHP regular expression to match price or amount

I need a regex that will match on a price or amount. It should match on these 100 410.00 0.12 but not these 100.000 -600.00 .12 .1234 This works for all of the above cases except for single values like 1 /^[0-9]*\.?[0-9]{2}+$/ How can I adjust it so single integers will match? And can anyone explain why the current one is wr...

adding a magento page to the catalog

I want to add another page in the magento module like the following... <catalog_wizard_default translate="label"> <reference name="content"> <block type="catalog/navigation" name="catalog.topnav" template="catalog/navigation/top.phtml"/> <block type="catalog/category_view" name="category.products" template="catalog/cate...

redirect and send variable via js

This is tricky.. I have two sites. Site A and site B. On another site (any site) I post an affiliate link which takes you to site A where I have a script that redirects to site B (so the first link goes to site B after going through site A) On site A, I have a variable which I'm trying to pass to site B but without putting it in the br...

php variable is not setting to desired value after form submission

//get var of posted info so user does not //have to reinsert if if validation = false if(!isset($_POST['FactionChanges'])){ $faction_name = ''; } else { $faction_name = "".$_POST['factionname'].""; } //without form submit, num_errors = 0 if(!isset($_POST['FactionChanges'])){ $num_errors = 0; } //without form submit, success = 0 if(!isse...

Is there a way to search SQL database for similar words (mean not identical words) ?

Hello, Is there a way to search MySQL database for similar words (mean not identical words) . For example : user searches in database for word "abcd" and there is a word "abd" in the database so the search engine or the program Ask the user "Do you mean [abd] ? " as in most of search engines in the web ? Please notice that the search wor...

Interfaces and abstract classes in object oriented programming

Possible Duplicate: Interface vs Abstract Class (general OO) Hi guys, I decided to dig deep into OOP and have been taking on Design patterns practicing with PHP. I just had a question I would like views on. Interfaces and Abstract classes, which has more advantages? It might be vague but any light shed would be helpful. I can...

PHP recursive function problem?

I want to add two different class attributes to my my first and fourth <ol> tags but I really don't know how to add it in my recursive function? can some one help me? Here is my PHP script. function make_list ($parent = 0, $parent_url = '') { global $link; echo '<ol>'; foreach ($parent as $id => $cat) { if($cat['pa...

Is PHP still a viable choice to build a massive app like Facebook?

Much has changed since 2003/2004 when Wordpress and Facebook were started. If you were starting Facebook today, knowing in hindsight the functionality and scale required, would you choose PHP (today)? Why or why not? If not, what would you choose as the basis for a massive, interactive, multi-facetted application like Facebook? I know t...

Scrambled class name passed to spl_autoload_call via call_user_func

I have discovered interesting behaviour of php while calling different classes dynamically. For some reason class name get scrambled and its look like slice of hashed string. here is example of php code I'm trying to execute: call_user_func(array('app_event', 'arrayItems')); Here is backtrace of this event: Array ( [0] => Array ...

how to set up daily php functions or mysql queries

Hi. I have wondered for a while now how to this. If I want to take weekly backups of all or many of my tables that stores values that changes every day in mysql. I also want to execute daily functions with php that update update values in my db. I was thinking of making a stock investing function. Where I have fictional data as the val...

need help with session variables

I'm trying to set a session variable and use it on another page. I have: pg1 session_start(); $_session['sessionID'] = $row['ID']; Then on page two I have. session_start(); $userID = $sessionID; But when I use JC to alert this out I get nothing.. Am I doing this wrong? Thanks. ...

Multiple jquery Scripts on one page

I am brand new to Jquery and have run into something that if answered will help greatly in the future. I have 2 very simple questions I am using codeigniter, HTML5 and all php pages as well. I have a menu 'aside' with 4-5 sections that I want to be able to close to save space. So I am using 2 simple slideToggle scripts. $("a").click(fu...

Unable to set List Item Class in PHP for WordPress Site

Hi, Would really appreciate your help on people's recommendations on the best way to set a list item's currentmenu class, inorder to show the user the current active menu selected using php. I have moved my html/css site over to WordPress but originally had all my code inside my index.html file that consisted of a sidemenu div and jQue...

HTTP Error 500.0 - Internal Server Error with IIS 7and PHP 5.3

I have configuired PHP 5.3 on IIS 7 using the following instructions: http://www.php.net/manual/en/install.windows.iis7.php and it works fine. Util I enable any extension from .ini file. After enabling any php extension I am see the following errors : HTTP Error 500.0 - Internal Server Error C:\PHP\php-cgi.exe - The FastCGI process ex...

Simple Liberty reserve PHP script for registration form

Hi I'm designing a script for someone that wants to have an online registration form where people can sign up for a certain event. There is also a cost to attend the event. So I need to have something where they can pay online. liberty reserve seems like the easiest way to do this. Can somebody show me how to design a script that forward...

Php include path help for Zend framework

I previously posted this question (Reading Google docs spreadsheet) and got a good answer that instructed me to use the Zend Framework. I've never used it before, and I'm fairly certain I'm setting it up wrong. It says to "Simply download the framework, extract it to the folder you would like to keep it in, and add the library directory ...

What to use for building a service tier in PHP?

I come from a MS / C# / .Net background, and am accustomed to everything that the .Net Framework has to offer, including WCF. When building a service tier in .Net, the choice of what framework to use is easy: WCF. WCF gives you the ability to write something once, and the flexibility to expose that functionality in multiple ways and in...

What is the equivalent of Set X = Nothing in PHP?

Is: <% Set Mail = Server.CreateObject("SomeCOMObject") Set Mail = Nothing %> the same as: <?php $Mail = new COM("SomeCOMObject"); $Mail->Close(); // <---- Not sure about this ?> ...