php

MediaWiki: how to hide users from the user list?

I've set up Mediawiki 1.15.1 for a client who has added two users by mistake. They now want to hide these users from the user list. It seems this is done via the $wgGroupPermissions array with $wgGroupPermissions['suppress']['hideuser'] = true;, but it isn't at all clear what entry this needs for the hiding to work, or whether a new gro...

Get webroot in php

I am using apache server for php. How can i retrieve my web root in php like http://localhost/testthesis/ help me please ...

replace characters that are enclosed with quotes regexp

How can I replace characters with preg_replace, that are enclosed in quotes. I need to replace all special characters, that are in href="" things. example: <a href="ööbik">ööbik</a> should become <a href="oobik">ööbik</a> ...

Word comparing and replacing

Hi friends, I need some comparing and replacing code in PHP Our mission is to empower consumers to Praise Good Service when they receive it and to Report Poor Service wherever they have to endure it. I need this paragraph to xcompare for some words (for example mission, Good ) and replace that word like this m***n and G**d ...

how to maintain session in cURL in php?

how can we maintain session in cURL? i'am having a code the sends login details of a site and logs in successfully i need to get the session maintained at the site to continue. here is my code that used to login to the site using cURL <?php $socket = curl_init(); curl_setopt($socket, CURLOPT_URL, "http://www.XXXXXX...

PHP query string

hi i am facing a strang problem that a part of querystring are showing in title on page i have used following function function tabVideo(){ global $db,$bll; ?> <table width="100%" align="center" border="0" cellspacing="0" bgcolor="CCCDE2"> <? $page_vi=$_GET['page_vi']; ...

Cannot store value into database

when i submit the form.. the form display the 'error' msg that mean the query does'nt work.. i've compare the code with the other code and it seem similar... i dont know what to do with this.. please guys... help me... (here's is the form code) <?php if(isset($_GET['bookno'])) $bookingno = $_GET['bookno']; elseif(isset($_PO...

ASP.net or PHP webmail app I can install on my shared hosting domain with inteface similar to Gmail

I'm looking for either an ASP.net or PHP based webmail app I can install on my shared hosting. I want to set this up on one of my domains for my Gmail address, due to Gmail being blocked at work. I'd like the interface to be as similar to Gmail as possible, conversation view, labels, starred emails etc if possible well at least allow m...

Having the option of customized classes but a unified class name

Suppose you are building a web application that is going to be a packaged product one day, one that users will want to be able to extend and customize. It comes with a core library consisting of PHP files containing classes: /library/ /library/frontend.class.php /library/filesystem.class.php /library/backend.class.php Now, suppose yo...

PHP fork promblems in OSX

HELP :) I was trying to copy the Zend_Tool stuff into /usr/etc/php (according to 'which php' command). I don't know what went wrong but if I try and run php from the command line I get this error : /usr/bin/php: fork: Resource temporarily unavailable I can't find any help online. Anyone have any suggestions ? Brian ...

PHP: xml_parse replaces entities and "?" character

How can I describe something I can't quite put my finger on? I have a module for RSS reading "magpierss" it uses xml_parse() and after extensive troubleshooting all I can come up with is that it removes certain entities like "?" character. I haven't written this module myself but I have traced the code until the part uses xml_parse() an...

PHP form values after POST

I have a form on which I POST the data with PHP. When the data is send I want to show the new values. Doing this on textfields is easy, but how can I set the new values on the radioboxes. My default value is Male here. PHP if (isset($_POST['Submit'])) { update_user($_POST['name'], $_POST['sex']); // the update method } HTML <for...

PHP, CSV columns into separate arrays

Basically, i want to make a system where a user can upload a CSV file and pick what columns they want to upload/process I can do this fine by using fopen and foreach, but since the number of the column may vary from CSV to CSV.... i can store the picked columns in an array, eg picked[]= "1,2,4"; //from 1,2,3,4 columns comma separated...

CakePHP belongsTo relationship with a variable 'model' field.

I've got a problem with a belongsTo relationship in CakePHP. I've got an "Action" model that uses the "actions" table and belongs to one of two other models, either "Transaction" or "Tag". The idea being that whenever a user completes a transaction or adds a tag, the action model is created to keep a log of it. I've got that part workin...

Where is the errors console?

I'm new to PHP, started with Code Igniter and MAMP. I start the server from the MAMP application, and write PHP in the text editor. When errors occur in the code, the page doesn't display anything! Is there anyway to see the errors on console? or PHP just doesn't show errors? I'm used to Eclipses console when developing Java, is there...

PDO: Unable to create SQLite database in memory

Trying to learn a bit about PDO and is going through this tutorial. It has the following snippet of code: <?php try { $db = new PDO('sqlite::memory'); echo "SQLite created in memory."; } catch(PDOException $e) { echo $e->getMessage(); } When I run this I get the following exception message: SQLSTATE[HY000] [14] unabl...

PHP gettext function only returns orignal untranslated string

I'm trying to use gettext add localisation support to my website. I've followed various guides on how to setup gettext and have done the following: I've created the following files and directories in the root of my project dir: test.php locale/ de_DE LC_MESSAGES messages.mo messages.po en_GB LC_MESSAGES ...

How can I replace ?myuser=number with an empty string in PHP

How can I replace a string containing a lot of ?myuser=12122 ?myuser=5457 ... with empty string so that it doesn't show ?myuser=number inside the string? I think I should use regex? ...

select outgoing ip for curl request

I have a server with two different IPs. I need to send odd curl requests from first IP, and even from the second one. How can i select outgoing ip address? my php script is something like this: $curlh = curl_init($url); curl_setopt($curlh, CURLOPT_USERAGENT, $uagent); curl_setopt($curlh, CURLOPT_RETURNTRANSFER, true); $result = curl_ex...

MVC, handling POST data, preparing form field values

I am using Codeigniter to develop an application, and have been reading bits about Ruby on the Rails. In particular Skinny Controller, Fat Model seemed to make perfect sense. It really allows me to look at the controller and know what the hell is actually going on, and allows very very quick adjustments and bug fixes. However the one st...