php

[PHP] What exactly does it mean when $_FILES is empty?

I am working on a PHP upload script and when testing my error checks, I attempted to upload a 17MB TIFF file. When I do this the $_FILES array is empty. The script works fine for what I need it to do, which is to upload JPEG files. My solution is to test if $_FILES is empty or not before continuing with the upload script. Can anybody ex...

I have this broken php upload script

I have this script for uploading a image and content from a form, it works in one project but not the other. I have spent a good few hours trying to debug it, I am hoping someone could point out the issue I might be having. Where there are comments is where I have tried to debug. The first error I got was the "echo invalid file" at the b...

Can i use gzip compression in POST file upload with PHP?

Can i use gzip compression in POST file upload with PHP? ...

opening MS word document without using com object

Hai frnd can give me some solution.. 1.how to open ms word document without using com(word.application) 2.actually i want to edit existing document only changing content without affecting any properties? ...

php 5.1.6 magic __toString method

In codeigniter Im trying to use this plugin which requires I implement a toString method in my models. My toString method simply does public function __toString() { return (string)$this->name; } On my local machine with php 5.3 everything works just fine but on the production server with php 5.1.6 it shows "Object id#48" where the...

Protecting my website content from being downloaded through cURL

I heard about external access of a website using curl by the following code: $curl_handle=curl_init(); curl_setopt($curl_handle,CURLOPT_URL,'http://example.com'); $buffer=curl_exec($curl_handle); curl_close($curl_handle); I want to protect my website from this external access. I am using PHP. How can I protect my web site? ...

Steps to achieve setting up SFTP on server

Can any one please explain about SFTP and how do i set it up on my server to secure data transfer. It would be better if you explain step by step. ...

PHP: how to get the url of the currently executing script?

For example, the url http://www.domain.com/folder/script.php sends a request to /var/www/domain/folder/script.php. In script.php, I want to echo http://www.domain.com/folder/ (not /var/www/domain/folder/, not http://www.domain.com/folder/script.php). What is the simplest way to do this? ...

How to Compare Dates in php?

i need code to compare date in php Input date should be a valid date input date should not be less than the current date. i need to give time zones EST,PST,etc.. We need to make the time to GMT and compare with Current Time. can anyone help on this. Thanks Ramakrishnan.p ...

A maximum character limit on the preg functions?

On my site I use output buffering to grab all the output and then run it through a process function before sending it out to the browser (I don't replace anything, just break it into more manageable pieces). In this particular case, there is a massive amount of output because it is listing out a label for every country in the database (a...

I call session_start() the script hangs and nothing happens

I am running php5, however as soon as I call session_start() the script hangs and nothing happens. Is anyone else experiencing this problem, or am I doing something incorrectly? I am using session_start() on index.php and for some reason sometimes it'll fail. No warnings, no errors, no notices, not even after prepending error_reporting(...

Fetching custom Authorization header from incoming PHP request

So I'm trying to parse an incoming request in PHP which has the following header set: Authorization: Custom Username Simple question: how on earth do I get my hands on it? If it was Authorization: Basic, I could get the username from $_SERVER["PHP_AUTH_USER"]. If it was X-Custom-Authorization: Username, I could get the username from...

How to customize Yii CGridView Pager?

How to customize Yii CGridView Pager about its position, css, template? ...

Appending Comment Number Anchors to Comments

Hello, I am using a PHP file called comments.php that has a query that enters values into a mySQL table called "comment." As the query does this, it auto-generates a field called "commentid", which is set to auto_increment in MySQL. The file also contains a loop what echoes out all comments for a given submission. It all works fine a...

Is it good practice to display the session id in the url?

I am using PHP 4+ and I am working in a project of osCommerce, where I encounter with the session id in the url, so i just need to know, is it a good practice display the session id on the url? if yes then why? and if no then why? and how can i hide the session id in url and use any substitute string there in url? ...

How Can I Know If An Input Is Checked If I Only Know His Value?

Hello here! I have a dynamic input in my php code like this one: <input type="checkbox" id="advantage[]" name="advantage[]" value="Special Option" /> And I need to know if it's checked... I can have multiple checks in the same format in the code, my brain hurts because i can't find a solution! Thanks 4 the help! ...

Wordpress Plugin with Database connection

Hi all, I am using WordPress Version 2.9.2 for my blog.when i am trying to include a database connection in one of my plug-in which is not working properly.Which did not get the database connection.But in all other directory it is possible to use a common connection.So,now I am using manual coding in all of my plug-in file.Any ways to ge...

How to know the file type of the file which you are forcing the user to download?

I am trying to force the user to download a file. For that my script is: $file = "file\this.zip"; header("Cache-Control: public"); header("Content-Description: File Transfer"); header("Content-Disposition: attachment; filename=$file"); header("Content-Type: application/zip"); //This is what I need header("Content-Transfer-Encodi...

PHP: calling a child tag simplexml

Trying to parse a YouTube feed using PHP simplexml_load_file(); I am able to access other tags pretty simply using $xml->id; When I try to access <openSearch:totalResults> with $xml->openSearch->totalResults; I don't get any results ...

Maintaining a framework and applications based on that framework

Hello, I have written a simple framework (actually collection of libraries) and a number of applications based on that framework. These framework and applications both have their own mercurial repositories. When I update the framework repository, I copy all framework files to application folders one by one. This work flow causes me some...