php

Write an array to config in Codeigniter?

I'm working with a config file that I have create in order to store users. This surely wasn't what the configs were intended to be used for, but it's an extremely small application and I think that it would be a nice solution. My array looks like this: $config['users'] = array(array('username' => 'username', 'password' => 'password'));...

Why in cpanel databse size is showing 0.00MB?

Why in cpanel database size is showing 0.00MB while when i take backup of database then it is 1.2 MB? ...

PHP Garbage collection sucks or is it just me?

Hello all, I have the function below which I call very frequently in a loop. I waited 5 minutes as the memory climbed up from 1MB to 156MB. Should't PHP's garabage collector turn up and reduce this at some point?! Is it because I have set memory limit at 256MB? At echo point 2,3,4 its pretty constant memory usage. It goes down my hal...

Updating a node value with PHP's simpleXML and xpath not working

Hello everyone! I have the following code inside a class: $tmp= $this->Xml->xpath("/page/text[@id='$this->Id']"); $tmp[0]= $this->Text; echo $tmp[0]; echo $this->Xml->asXml(); $this->Xml->asXML($this->FileName); //save XML the problem is "echo $tmp[0]" prints the updated text while $this->Xml->asXml() still contains the old node value...

find image links in html using php

Hi, Why does this code not find picture links in text? $text = 'text text <img src = "http://www.singlewheel.com/Scoots/PAV/Martin7PAV/42316.jpg" /> text text'; preg_match_all('#^http:\/\/(.*)\.(gif|png|jpg)$#i', $text, $all_img); ...

Getting a full RSS feed

I'm testing a feed which I plan to later consume in my application. When viewing it in the browser, it shows only the last 7 items. Do feeds behave different when consumed from a program? If not, how do I view the full feed from the first item to the last item? I'd like to at least see it in the browser first ...

How can I remove ID veriable from URL with htaccess?

I'm sorry for complexive question. I've got a website that reading contents from MySQL database to get video information just like YouTube. I've 7 column: id, title, desc, url, date, whosadded, views. I want to do is Rewriting url's from /video.php?id=X to /title-music-video.html There's ( http://www.devarticles.com/c/a/Apache/Using-...

Mapping object signatures for required attributes

Hello, i am trying to think of the best way to create a way to store the signatures of objects, in particular products. There will be several types of products that will each have their own set of attributes and therefore different required attributes. There will be different types of actions performed on the products, i.e validation e...

Downloading videos from youtube with PHP - still possible?

Hi guys, I was wondering if there is a way, after all the changes in youtube in the last months, to write a script that enables downloading videos? I'm aware of the fact that the methods that worked a year ago, are no longer relevant. ...

help understand mvc php

ok yesterday i open a thread about when to use mvc, today im about to learn how does the MVC frameworks works, ive open some framework like CI, CAKE, etc 1.on the .htacsess i found this <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ inde...

How this Jquery function calls [jumping window]?

Go to the site here: http://en.heroes.gpotato.eu/ and click Register. What is the jquery function or plugin to make this jumping window? Thanks. ...

php breadcrumbs from url and query database

I have a php function that works for what i need but now i've found that there is chance for it to fail. I use mod rewrite to rewrite urls and this function needs urls to be rewritten for it to work. If i have 2 pages that have been rewritten as the same even though they are not the same, it could fail. The function reads the url and ...

How can I solve a PHP syntax error that I receive when parsing html code?

Trying to print out some html forms but I get a parsing syntax error. I believe it gets stuck on the SERVER[PHP_SELF] but I'm not sure. How can I get this to echo correctly? Error occurs on the SERVER[PHP_SELF] line Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING func...

Preventing SQL injections with PHP and Zend Framework - how?

I'm trying to defend the sign-in form on my page from SQL injections. On the serverside, I use Zend Framework (Zend_Db,Zend_Db_Table_Abstract), but its build-in injection prevention functions: quote, quoteInto, quoteIdentifier don't make their work well (as far as I know how to use them). Other ways like mysql_real_escape_string, addslas...

suPHP / PHP scrip timeout

After my host enabled suPHP, a previously working script has been timing out after ~3min (it varies, but the script has not run for more then 3, AFAIK). The odd part is, the script is not throwing any errors that I can see (and yes, full PHP error reporting/logging is enabled and all MYSQL queries have been checked for errors, also) it s...

Zend_Form: Add elements to radio buttons

Hi, I'm trying to add Zend_Form_Elements following the radio buttons in my form, but so far I have been unable to do so. If anyone could point me in the right direction it would be greatly appreciated. Form needs to be rendered as shown below: (*) [____]% ( ) [____]€ ( ) [___] for [___] ...

Advices on creating a first e-Commerce application ?

I need to create a e-commerce application in PHP. As a first option I though to use Magento, that I already used one or two times in the past. But as the requirements are growing, I think Magento is not correct choice, there are too much options I don't need, and some options which are not available and/or some customization which will b...

Program to an interface not an implementation in php

Once of the major design principles is program to an interface not an implementation. Is this even possible in php or any other weakly typed language. EDIT: I maybe didnt write the question as clearly as i should have. I dont mean that php cant use interfaces - it obvisouly can. I mean does the design principle "program to an interf...

theming language in shopify

how can i create my own themeing tags/language or whatever its called like shopify is using? smarty has it also, sorry i dont know what its called. for example in shopify if you type <h1> {{ product.title }} </h1> - this will print out the products title. what im wondering is how can i create my own language of this type using ph...

Match against with multi values - the right way?

Hello guys, i really hope that someone can help me with my problem. I would like to realize a match against query with multiple searchstrings. In the moment it looks like this: SELECT result.* FROM ( SELECT A.TITLE AS title MATCH(A.TITLE) AGAINST('$searchstring1' IN BOOLEAN MODE) AS REL, MATCH(A.TITLE) AGAI...