php

Invalid upload directory with CodeIgniter 1.7.2

I am attempting to create an image-upload form with CodeIgniter 1.7.2 However, when I attempt to upload an image, CI informs me the upload directory is invalid. To check this, I uploaded a file to the uploads directory called test.txt with the content Hello, World! I then echoed out the contents of it, and lo and behold, it says hello...

How to empty REQUEST array?

Hello there, For my framework, i want to empty/disable REQUEST array for security reasons and users should only use proper arrays such as POST, GET or COOKIE. But i don't know how to do it. Even something like below doesn't seem to work, it empties even GET POST, etc. $temp_get = $_GET; $temp_post = $_POST; $temp_cookie = $_COOKIE; // ...

implemenatations of product hit counters

Hi guys! I have been scouring for a while about this one but haven't seen a decent tutorial. the problem is I want to create a hit counter everytime a product's page is viewed I am using a PHP MVC framework and these are what I want to do update a database counter everytime a page is visited check if a the product is repeatedly viewe...

Automatically generating custom field values in Wordpress

I run a few side blogs that I sort of aggregate into my main blog. I use simplepie to parse the feeds from my other blogs, so the posts are being created automatically. My typical post is layed out like this: IMAGE CONTENT/TEXT HYPERLINK What I'm looking to do is automatically grab the hyperlink, and insert it into a Custom Field. T...

PHP ini Question

Hello All, In php.ini, the 'disable_functions' directive can be used to disable certain functions that you may consider to be not necessary or dangerous ones by putting them comma separated. I just wanted to know, it it possible to set 'disable_functions' using php's function: ini_set For example, is following line of code correct? ...

Stop or interrupt php script for particular time

Can I Stop or interrupt PHP script for particular time? I would like to implement logic like below: on mydomain.com/index.php there will be flash appear showing some intro of a product for suppose 20 sec. Once it complete, on same index.php page the home page of site will appear. I am not aware about flash (action script). Is it poss...

Which are the deprecated things for PHP5 in PHP6

Hello All, Which are the deprecated things for PHP5 in PHP6? ...

How to get compatible with php4 in a framework developed with php5

Hello There, How to get compatible with php4 in a framework developed with php5? Thanks ...

Possible to add HTML content to SimpleXMLElement node

Hey all, Simple question. Is it possible to add a block of HTML in a SimpleXMLElement (or as a matter of fact, DOMDocument) node without auto-converting the HTML data into entity format? For example, take this snippet (with DOMDocument here, but SimpleXMLElement behaves exactly the same): <?php $dom = new DOMDocument( '1.0', 'utf-...

php form script

I'm very new to PHP and am having some trouble. I have a form using HTML which is action=.php method=post The form is using text boxes and select options, I'm not sure if it makes a difference in sqldatabase. I've tried about 30 different combinations of this script and can only get a connect successfully message but nothing is posted....

PHP Remove JavaScript

hey guys i am trying to remove javascript from the html but i am not getting the regex to work with php its giving me an null array here is my code <?php $var = ' <script type="text/javascript"> function selectCode(a) { var e = a.parentNode.parentNode.getElementsByTagName(PRE)[0]; if (window.getSelection) { var s = ...

The URL Security

Hello There, I have made below function for the security of URLs. I just wanted to know is there anything i need to re-consider or change in below code. I have made this function after reading quite some articles on security from various sources. Here is the function: // filters possible malacious stuff from URLs private function filt...

PHP: Array Segregation

I have this string: type=openBook&bookid=&guid=7AD92237-D3C7-CD3E-C052-019E1EBC16B8&authorid=&uclass=2&view= Then I want to get all the values after the "=" sign so for the "type" i want to get "openBook" and put this in an array. Note: even if it is null it must be added to the array so i wont loose track.. So how can i do that. M...

Is PHPs SoapServer affected by the maximum execution time?

I recently created a Java frontend for a PHP web-service which uses PHPs SoapServer. My application is performing a long-running data synchronization and from what I know from PHP I prepared myself to get closed connections because of the max_execution_time limit. But I never get any kind of error, as if the SoapServer instance is runn...

Getting php session using c#

I know how to get the source code but the website that I have been working on uses PHP session, this mean that you will need to login(which I have) and use the session ID that the server send back. How do I do this? ...

Creating php arrays from sql queries

Hiya, I'm trying to create an array of arrays so I can build a dynamic menu, but I'm getting lost amongst the code. My output looks like this: $menu = Array ( [0] => Array ( [text] => Home [class] => 875 [link] => //Home [show_condition] => TRUE [parent] => 0 ...

multiple php function instances

I've got a function which calculates some data from a table, a put's it into another, it takes a while for the whole process, about 30 mins or something like that. The function calculates statistics for each day for a couple of months period, but after like 10 days, it starts another thread while continuing another one, and then another ...

Run a batch file using php

Below is my piece of code , on giving the tool name as the input and pressing submit , the batch file corresponding to that tool shall be executed. <html> <head> <title>My Form</title> </head> <body> <form action="batch.php" method=post> Which tool you would like to use: <br> <input type="text" name="ToolName"> <...

How would I implement an upload by email service for my photo sharing website?

I have a photo sharing website in development and want to be able to allow users to add photos and video by email attachment. I have email addresses for the site (hosted with goDaddy). I also have a LAMP CentOS application server running on Amazon Web Services EC2 that processes files uploaded via my web-based uploads page, so would like...

Access to class attributes by using a variable in Python?

In PHP i can access class attributes like this: <?php // very simple :) class TestClass {} $tc = new TestClass{}; $attribute = 'foo'; $tc->{$attribute} = 'bar'; echo $tc->foo // should echo 'bar' How can i do this in Python? class TestClass() tc = TestClass attribute = 'foo' # here comes the magic? print tc.foo # should echo 'bar' ...