php

How to determine if a user accessing your website is not a bot?

I know that user agents are one indicator, but that's easy to spoof. What other reliable indicators are there that a visitor is really a bot? Inconsistent headers? Whether images/javascript are requested? Thanks! ...

Sharepoint - where to get started with integrating to another site

...

Setting type "password" inputs with value from previous submit after validation failure

I'm creating a walkup create account page for our website. I've always cleared out the default value="" for a type="password" input out of paranoia, after a user has submitted a form, even if the two passwords match and are valid. I started to think on this after our designer asked me if there was any real point to doing that. I can cert...

PHP send mail on windows causing it to 'hang' after sending email

Hi, we're starting to build a web app. My colleague is developing on linux, and I am running via a WAMP stack running windows xp. We're using Zend. When we submit a form and send an email using Zend email, the email would send and then I would get a blank screen, wheras on the linux machine the app would continue normally. So I wrote m...

File upload not working in IE, but works in FF, Chrome, and Safari...

I'm stumped. I've created an upload image process that works in every browser except Internet Explorer. I didn't check IE7 but IE8 seems to not check the file extension. I keep getting the error "you must upload a jpg, gif, bmp." /* image uploading */ $target_path = "img/"; $image = $_FILES['crebusimage']; $image['name'] = my...

Large file uploads

I'm working on an application that allows the upload, and storage of large files on a web server. Currently I'm using PHP to handle POSTed files via http. I have my php.ini set with: upload_max_filesize = 100M post_max_size = 100M memory_limit = 128M max_input_time = 6000 max_execution_time = 6000 There doesn't seem to be any apache...

How to get CURL to work with PHP on Windows? (WAMP)

Update: The problem appears to have been corrupt DLLs somewhere in my PHP installation, or possibly a bug in PHP 5.2.9 on Win2k. I downloaded the windows (binaries-only) distribution of PHP 5.2.10 from php.net and extracted that to my c:\PHP directory. After doing that, everything worked fine. Update2: I undid everything that I tried ...

Real world oop example?? (php)

Im trying to learn OOP, but the so called 'real world' examples in the books im reading arent helping me at all. I already know that some people think that learning oop for php is unnecessary, so i don't need more people telling me the same thing. All the examples like Pet, Car, Human arent helping me anymore. I need REAL LIFE examples t...

PHP loading xml feeds quickly

Hi, I am building a comparison shopping site that takes in multiple xml feeds and displays the best deals. I use PHP Simplexml and then sort them using php when the page loads. I use a library like this: http://www.developertutorials.com/blog/php/parallel-web-scraping-in-php-curl-multi-functions-375/ to process the feeds in parallel...

Sleep between calls of Mail() in PHP

How would i send an email, to say 3000 recipients - with a Max 500 emails / hours on my dedicated IP? So far my thought is to send each email every 9 seconds, this would come to about 450 emails an hour... but how could i do this? My plan for the sending of the emails would be the following... $emails = ARRAY OF EMAILS, MYSQL RESULT fo...

Counting number of articles within a category using CakePHP?

Hi I have a simple cakephp app with table "articles" that has a "cat_id" column to reference a "id" column of categories in a "cats" table. What I would like to do is display all categories names, each followed with a count of the number of articles belonging to that category. I know there is a find('count') function in cakephp, but t...

PCRE to replace #334455 hex with #345

I'm writing a function that replaces long hex coded color (#334455) with short one (#345). This can be only done when each color in hex is multiple of 17 (each hex pair consists of the same characters). e.g. #EEFFCC is replaced with #EFC, but #EDFFCC isn't replaced with anything. I want to make this with single preg_replace() call with...

PHP-CGI is not loading extensions

I have a local server running PHP-GCI 5.3.0, but when I run phpinfo() it shows me normal information, but extensions. There are nothing about extensions, and I'm using its normal ext folder. Could this be related to my folder having spaces? (i.e. this is my php.ini C:\Arquivos de programas\Winco\Winconnection4\php.ini) I need to do so...

Flex App getting data from MySql via PHP - Examples

Hello guys. I'm learning Flex, I already know how to submit data from a Flex App to a MySql DB using PHP. But thats easy, but getting data... Thats a different story. This isn't a question for sort of speak, its a request. I wanted to ask to everyone that already learned how to do this, if it could send some Flex Projects (the ones yo...

save language even if user close browser

I have my language files in /language/ en.php, se.php etc Here a snippet from one file: $lang = array ( 'IMAGE_NOT_FOUND' => 'Kunde ej hitta bilden.', 'ACCOUNT_ALREADY_ACTIVATED' => 'Ditt konto har redan aktiverats.' ... ); Current code if (isset($_GET['setlang']) && $_GET['setlang'] == 'en') include('language/en.php'...

A good way to send complex objects with ajax?

In my web app, I have some complex objects written with JavaScript (ie nested arrays, objects within objects withing objects, etc) and the nature of my app relies on these. I need to send all the data to PHP so that I can save it to the database. What is an efficient, easy way to send my objects to PHP? I tried JSON, but got strange erro...

Possible types of $_POST and $_GET values

Is it possible for there to by any type of value in $_GET or $_POST which is not an array or string? For those who read code better, is it at all possible to run this simple script on a web server and get it to throw the exception? // crash-me.php <?php function must_be_array_or_string($value) { if(is_string($value)) retur...

Developing a rich internet application

Hello, I have been a desktop developer for a few years mostly doing object oriented stuff. I am trying to branch out into web development, and as a hobby project trying to put a web application together. I have been reading quite alot of information, but I still can't seem to decide on the path to take and would really like some advice....

What is a good option for a two-way processing of password?

I plan on using Kohana's encryption class but is there a better and more secure way of doing a two-way processing? I want my users to be able to send requests for their previous passwords, not give them a reset one. Any algorithms or libraries you can suggest? prticularly in PHP? ...

I need help fixing Broken UTF8 encoding

I am in the process of fixing some bad UTF8 encoding. I am currently using PHP 5 and MySQL In my database I have a few instances of bad encodings that print like: î The database collation is utf8_general_ci PHP is using a proper UTF8 header Notepad++ is set to use UTF8 without BOM database management is handled in phpMyAdmin not al...