php

Is there a PHP-based source code management system?

I'm looking for a PHP-based tool for managing source code. Basically like a wiki but for code. I know that SVN or CVS may be the better option, but I just need something basic that allows users to collaborate. I don't need the ability to checkout or anything like that. Edit: I created some files that provide the basics: account managem...

[PHP]RegEx help with a string

So I have a random of strings and I need to parse them, let's take an example: This string - DeleteMe please and some other text So I want to find DDeleteMe please and some other text and remove it, because all I need is This string Best Regards, ...

Requesting a GZIP'ed page and processing with cURL and PHP

I'd like to make a cURL request that accepts a gzip'ed page. I would then like to unzip the page and process it. I haven't been able to find any ready built examples, so I would like a quick one. Any settings that need to be adjusted, making the actual request, and decompressing the contents. ...

imagecreatefrompng() Makes a black background instead of transparent?

Hi, I make thumbnails using PHP and GD library but my code turn png transparency into a solid black color, Is there a solution to improve my code? this is my php thumbnail maker code: function cropImage($nw, $nh, $source, $stype, $dest) { $size = getimagesize($source); $w = $size[0]; $h = $size[1]; switch($stype...

Plugin to avoid share username in Wordpress

Is there a way to void sharing of username (based on ip address or login at same time in different location) for Wordpress? If there is a plugin just to track IP address and login time, it should be fine too. Thanks ...

how to get all group images in facebook using FACEBOOK API

Hello i'm trying to get all the images from a facebook group using facebook API i have a problem i can't get all the photos using $facebook->api_client->call_method('Photos.get', array('subj_id' => $uid)); http://wiki.developers.facebook.com/index.php/Photos.get what i'm using now is the method $albums = $facebook->api_client->p...

move_uploaded_file() error

I have a website on free hosting - 000webhost.com and it allows you to upload images. However, when I try to upload an image, I get these errors: Warning: move_uploaded_file(images/SmallSmileyFace.jpg) [function.move-uploaded-file]: failed to open stream: Permission denied in /home/a6621074/public_html/m/write.php on line 76 Warning:...

PHP 5.2.12 - Interesting Switch Statement Bug With Integers and Strings

<?php $var = 0; switch($var) { case "a": echo "I think var is a"; break; case "b": echo "I think var is b"; break; case "c": echo "I think var is c"; break; default: echo "I know var is $var"; break; } ?> Maybe someone else will find this fascinating and have an answer. If you run this, i...

XAMPP is caching .html files running as PHP

I have XAMPP (latest version) installed on my Mac OS 10.6.3 I've added the following to .htaccess because I want .html to be interpreted as PHP. AddType application/x-httpd-php .php .html The problem is that the default XAMPP config seems to be caching .html files as static... so even though the PHP statements inside are being called...

Can I use this technique to provide free email service for my users?

I'll let users register their [email protected] ,,, they enter their members area where they can : 1- send emails ( easy to do) 2- receive emails .. for receiving emails , I'll use a catch all email account , read the email and figure to whom it's sent (username), and then I save it on the database with userid of the username who h...

trying to parse an xml from a url and it wont work.

this page shown an xml file and im trying to use simplexml to parse the data out and print it. what am i missing? cause all it does is show a blank page when i run it. <?php $url = "http://api.scribd.com/api?method=docs.getList&amp;api_key=somestring"; $xml = new SimpleXMLElement($url,NULL,true); foreach($xml -> result as $value) { ...

Is it better to echo javascript in raw format with php, or echo a script include that has been minified and gzipped?

Hey guys quick question, I am currently echoing a lot of javascript that is based conditionally on login status and other variables. I was wondering if it would be better to simply echo the script include like <script type="text/javascript" src="javascript/openlogin.js"></script> that has been run through a minifying program and been gzi...

Does anyone know if WordPress has builtin PHP validation functions?

Hi everyone, I am trying to build a form in WordPress and taking advantage of all its built-in functions but I am hard pressed to find any functions that do form validation. I figure those kinds of functions have to exist in WordPress but I couldn't find any because its documentation is sparse and spread out in some respects. Would anyo...

How can arguments to variadic functions be passed by reference in PHP?

Assuming it's possible, how would one pass arguments by reference to a variadic function without generating a warning in PHP? We can no longer use the '&' operator in a function call, otherwise I'd accept that (even though it would be error prone, should a coder forget it). What inspired this is are old MySQLi wrapper classes that I une...

Should you do validation checks that go outside the possiblility of normal user activity?

Hey guys I have been thinking about form security a lot lately. I have been told time and time again to check if form input is a number if you are expecting a number or escape it in case (unless you use proper mysqli formatting) to avoid injection. 1.After the safety checks are done, should I do additional logic checks? For example, if ...

explaining $this->load->view()

In a controller you can use this method to load a view, but I want to know what happens behind the scenes here. I'm new to PHP and frameworks, but I’ve learned the basics of OOP. When $this->view() is called then the method in the current class or the parent class is used. But what does $this->load->view() mean? What is the intermedi...

How do you write "Select (all) From (table) Where posting=$posting except this posting? (Mysql)

I want to write a Mysql statement that selects all from a table(posting) where title is like $title except for the title of $title. Basically I want to display all related posting of a certain posting. I want the query to select all the postings in the table that has the title name in the title OR detail. But I don't want the posting to ...

PHP can't connect to Mongodb

Hi, I followed the windows installation instructions in mongodb's website but I still can't connect to MongoDB through PHP because of this error: Class 'Mongo' not found Why isn't the file containing the Mongo Class not being loaded? I've also found this error: PHP Warning: PHP Startup: mongo: Unable to initialize module Module com...

How to do interactive with the prompt this way in PHP?

C:\>mysql -uroot -padmin Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 6 Server version: 5.0.37-community-nt-log MySQL Community Edition (GPL) Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> show databases -> ; +--------------------+ | Database | +--------------...

php how do I grab the date of oldest item in rss feed

using simplexml to parse a feed, but I want to grab the date of the oldest item in the feed. Does anyone know how to do it? Thanks $rss = simplexml_load_file("http://search.twitter.com/search.atom?lang=en&amp;q=foobar&amp;rpp=100&amp;page=1"); ...