php

PHP Include Error

After changing my include header to a add a function. It disabled my php echo username code. So it went from htp://example.com/register.php?r=username to htp://example.com/register.php?r= <?php function headertop($page) { include('header.php'); } headertop('members'); ?> <div id="myaccount"> <p class="reflink" align="cente...

Wordpress pull Blog Post

I'm designing a theme for wordpress. I need advice on how I would construct it. At the bottom of my Frontpage/Home I will put a snippets (a title and a short description of blog post) of what is new in my Blog . Preview: Question: What approach should I use? I can make the bottom page widget ready and will just use widget or will u...

PHP explode function

I want to let the user type in tags: windows linux "mac os x" and then split them up by white space but also recognizing "mac os x" as a whole word. Is this possible to combine the explode function with other functions for this? There has to be a way. ...

Job scheduling problem

I'm working on an application where I need to automatically schedule jobs for members on a rotating schedule. I'm not very good at explaining rules, so here's some data to help out: Positions: A job title, with rules such as Mondays and Wednesdays weekly. Categories: A set of positions Groups: Another set of positions. Positions in the ...

PHP recursion function to show valid combinations of array values.

I have a PHP array that looks like this: Array ( [340] => Array ( [1] => 1 [2] => 18 [3] => 23 ) [341] => Array ( [1] => 1 [2] => 17 [3] => 23 ) [342] => Array ( [1] => 1 [2] => 16 [3] => 23 ) [343] => Array ) The array is actually longe...

Smarty outputs blank page

SOLVED: Error in template file I have Smarty setup like this: require_once 'smarty/Smarty.class.php'; $smarty = new Smarty(); $smarty->compile_dir = $compile_dir; $smarty->template_dir = $tpl_dir; That's all I should need for now... I have Smarty setup exactly like this for another site and it works just fine on the same server. va...

Postgresql Query

Dear all, I have working in database Postgresql for the first time. I need your help to finding out a solution. One table contains 15 rows With a regn_srno as P.K., another table has the same regn_srno as F.K. I want to count the total number of rows which has the same regn_srno. But My problem is the second table has contain 2 or 3 fie...

Which third party search engine (free) should I use ?

As the title says, I need a search engine... for mysql searching. My website is PHP based. I was going with sphinx but my hosting company doesn't support full-text indexes! So a search engine to be used without full-text! It should be pretty powerful, and must include atleast these functions below: When searching for 'bmw 520' only ...

php: auto indent the whole code?

isnt there any software/plugin to netbeans/eclipse that auto indent the whole code after i've inserted it? not just indent when i press ENTER for new function. i want to paste in a code for example without indents and it will auto indent everything automatically since it can recognize what language is used. should save a lot of time. ...

zend search engine, need some guidance in the right direction please

I have been looking at manuals of the Zend search engine, but I don't really understand much of it. I have a php website (classifieds) and I want users to be able to search my mysql database for records. Can someone explain a little more about the Zend search engine, and how I should actually 'install' it. I don't have my own server (h...

how i can make Permission system in php

i have table titled gorups have posting enum('yes','no') delete enum('yes','no') in the gorups table how i can make Permission system in php this mean when write if(Permis['posting']=='yes'){ echo ok; } ...

Read mercurial repository from PHP

I want to be able to take a file in a Mercurial repository (Readme for example) and display it to the user. Is this possible in PHP? I do have command line hg installed on the server. ...

Zend_framework - place data in $_POST when using _redirector helper in the controller

I an redirection (in some cases) from a controller to the error controller, action 'not-logged-in' using the redirector helper. My problem is the following: I want to pass an argument in the $_POST array (an URL from where the redirection happened) so the user will be able to return to that page after performing a login. How can i plac...

What should I do, create a search engine myself or use another one?

I have this classifieds website and I have now been searching for ways to implement a search function of the classifieds. I wonder, is there any tutorial for creating a pretty powerful search engine in PHP that you know of? I have looked into third party search engines, and it feels they are too much... PS: No full-text support on my ...

Check if function has been called yet

New to OOP in PHP One of my functions requires another function to be executed before running. Is there a way I can check this? ...

Ok, last question regarding search engine on my website...

I have read the intro to the zend manual, and as far as I understand I have to install the framework on my server... And my webhosting provider says they don't support that, so it's not possible... It must be installed in order for me to use it and implement a search function of my mysql records, right? Thanks ...

Multiple MySQL queries and how to make my script go faster

Hello to all. Using PHP (1900 secs time limit and more than 1GB memory limit) and MySQL (using PEAR::MDB2) on this one... I am trying to create a search engine that will load data from site feeds in a mysql database. Some sites have rather big feeds with lots of data in them (for example more than 80.000 records in just one file). Some...

PHP Equivalent of Master page in ASP.NET

Is there any way to achieve the master page concept of ASP.NET in PHP? ...

Connecting to a WCF service in php via NetTcpBinding

I can't find a duplicate for this question, but I honestly hope I'm not the first to ask. I have a WCF service that is sitting inside my LAN. For .NET clients on my lan, NetTcpBinding is the appropriate binding. However, one of my clients is a PHP web application. Is there any way to do this? Update: I am well aware I can have multiple...

Check for the pipe symbol with Regex

The pipe symbol | is used in Regular Expression as a sort of 'either' statement, far as I know. Either this, either that, or that, or that, etc... However, I wish to check a string with a regular expression, for the presence of this symbol. I've tried escaping it, but that doesn't seem to work. How do I do this, especially if I'm alrea...