php

The fastest way to update a database table

Hello, I've got a website where people can create a table of an unknown length containing two columns, word_1 and word_2, and store this table in a database. It is of course very simple to insert these values into the database by just iterating through the rows. Now someone decides to update some of the values and he goes to the edit-p...

Access Parent object PHP

I have class that extends another class. class TWITTER_FOLLOWERS extends TWITTER_BOT in TWITTER_FOLLOWERS i want to acces the db object from TWITTER_BOT but i get just an error Fatal error: Call to a member function fetch_all_array() on a non-object in /var/www/bot/inc/TWITTER_FOLLOWERS.php on line 163 On line 163 i have this code ...

PHP echo repeating rows only once

Hi all, I have 2 tables. One table is 'headings' & contains Headings and the other one is 'sub-headings' and contains Sub-headings that are (& must be) classified under the Headings and must have a respective Heading. A Sub-Heading can have only one Heading and many sub-headings can have the same Heading. So consider the following forma...

including php in <noscript> tag

is it possible to include a php file in tag......to show if javascript is disable ...

check for any content in php

I want to see if there are any POST vars set. Is there anyway i can do this? ...

WordPress Rewrite Plugin Problem

Example Code: function flush_rewrite_rules() { global $wp_rewrite; $wp_rewrite->flush_rules(); } function activate() { global $wp_rewrite; createRewriteRules( $wp_rewrite ); flush_rewrite_rules(); } function createRewriteRules( $rewrite ) { global $wp_rewrite; $new_rules = array( 'option/(.+)' => 'index.php?o...

php fopen - name of file

I currently have: <?php if (isset($_POST["submitwrite"])) { $handle = fopen("writetest.txt","w+"); if ($handle) { fwrite($handle, "Dan"."¬".$_POST["username"]."¬".$_POST["pollname"]."¬".$_POST["ans1"]."¬".$_POST["ans2"]."¬".$_POST["ans3"]."¬".time()); fclose($handle); } } ?> Howe...

How to create graph using php?

I found a charts tutorial, but couldn't find any for graphs like this. Any ideas on what should I use? ...

Convert a date DD-MM-YY and HH:MM vars to RFC-822 using PHP

I have a date variable that contains data in the forma: DD-MM-YY. -> $date I also have another variable that contains the time in HH:MM. -> $time I'd like to convert it to RFC-822 for to be used in a RSS feed. How can I achieve this with PHP? ...

Help with understanding usage of Value Objects in Flex

Hello! I have some small problem in understanding Value Objects in Flex... I'm trying to get some data from PHP/MySQL and send it to Flex but I'm stuck in some (obviously) basic problems... Let's say That my object in Flex would look like this: package some.package.VO { [RemoteClass(alias="VOPerson")] [Bindable] public...

Scrolling to an anchor in a programatically loaded DIV (from an iframe)

Hi! I am in trouble! I have a page called results.php that has a hidden iframe and a DIV container. When the page is loaded, some code is run in the hidden iframe which, when complete, loads the results into the CONTENT DIV in the results page, generating a scrollbar to results.php All this works fine, but when I have anchors in the c...

Image resize,crop with gd afresh every time or caching?

I found this really nice function that receives your desired proportions and resizes/crops the image for you. The function requires ImageMagick to work. Will it be better to cache the image or resize it every time? I'm pretty sure using gd will be slower than caching, but it won't require me to use ImageMagick, and I still haven't succe...

Norwegian characters problem

I create a folder as follows. function create(){ if ($this->input->post('name')){ ... ... $folder = $this->input->post('name'); $folder = strtolower($folder); $forbidden = array(" ", "å", "ø", "æ", "Å", "Ø", "Æ"); $folder = str_replace($forbidden, "_", $folder); $folder = 'images/'.$folder; $this-...

Regex to match html attributes

Hello all, I am trying to match a pattern so that I can retrieve a string from a website. Here is the string in Question: <a title="Posts by ivek dhwWaVa" href="http://www.example.com/author/ivek/" rel="nofollow">ivek</a> I am trying to match the string "ivek" in between the a tag and I want to do this for each post and relate it to ...

Retrieving iTunes App Store XML with cURL and PHP

Hey guys, I have been extracting information from the iTunes App Store for the past couple of weeks using a script I found and modified. Everything was working fine until a couple days ago when I realized that no XML was being generated anymore. Here is the code for the script that generates the XML: <?php header("Content-type: text/pl...

Display contents of multiple text files

I have a number of text files held in directory /results/... All the text files are named with unixtime stamps, inside each of the following files there is: #text¬test¬test1¬test2¬test3¬test4¬1262384177 Each piece of text is seperated by '¬'. I'd then like to feed the contents of the text file into an array and output it, in for...

How to compress images in CodeIgniter, yet do not change their dimensions?

I have a site where users can upload images. I process these images directly and resize them into 5 additional formats using the CodeIgniter Image Manipulation class. I do this quite efficiently as follow: I always resize from the previous format, instead of from the original I resize using an image quality of 90% which about halves th...

Configuring LAMP Environment in Linux Mint using XAMPP- installing Memcache

Hi, Okies, I have successfully installed the XAMPP and added virtual hosts and am able to make database calls and stuff. The problem I am facing is while trying to enable the memcache module. Currently trying to configure using these links. http://theindexer.wordpress.com/2008/06/02/installing-a-lamp-stack-on-linux-using-xampp-for-li...

Update cookies for Facebook connect based site?

I'm using the Facebook Connect API for the login system on a website built using PHP. There is no straightforward way to determine if a user is logged in. $fb = new Facebook($api, $secret); $fb->get_loggedin_user(); The above function always returns a user id, once a user has authenticated with the site, even if they sign out of Fac...

How to Check if a link string contains a word? (PHP)

Hello all.. i'm wondering how to check if a string like : http://www.reddit.com/xxx/x/xxx contains the word : reddit.com that string could contains or not contains reddit.com and if it contains , it execute my function : itsReddit() maybe with preg match? or something like this? Please i don't want a link for tutorial, i only need a...