php

Help me for creating huge database in Mysql

We are building a website for business on global wise, for every country major cities are covered in this concept. I need some suggestions from PHP Mysql People. Can i create single databse for all cities or multiple databases. Because in this system contains some relations between cities ,every chamber need nearly 50 tables for networ...

Check whether a Directory Exists in PHP

I know, I know, this sounds soo easy. But I can't seem to find the correct answer on the Internet. One of the solution I found was to use is_dir. if(is_dir($dir)) echo 'directory exists'; else echo 'drectory not exist'; But this is wrong-- All this function does is to check whether the $dir is a directory, it doesn't check wheth...

Prevent sent emails treated as junk mails using php mail funtion

I wrote a PHP script to send emails. My script is like this: $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= 'From: [email protected]' . "\r\n"; // Email Variables $toUser = "[email protected]"; // recipient $subject = "testing"; // subject $body = "<html><body>...

How do I add survey capabilities for my users

I need to add survey capability to my social website so that each user is able to create and manage their own surveys/polls etc. Can anyone recommend any existing application for this? PHP-MySQL combo preferred. ...

Array always comes back as empty [PHP]

below is my register form for my game and it is looking for errors that the user may have done, but even if an error is found it wont add it onto the $errors array. When I print_r the array it returns empty. I believe something is going wrong with the if functions because if I add a value into the array from outside one of the if functi...

Resize a picture to a fixed size

Hello , I need to resize a picture to a fixed size. But it has to keep the factors between the width and height. Say I want to resize a picture from 238 (w) X 182 (h) to 210 / 150 What I do now is: Original width / target width = 1.333333 Original Height / target Height = 1.213333 Now I take the smallest factor. Now I always hav...

Something like Crystal Reports for PHP?

I'm looking for something that works in PHP and is similar to crystal reports. I basically need to have a layout setup that means I can output invoices just by inserting the data, and then send it to a printer. The closest I've found so far is PDFB, but It's a bit of a pain as it needs to have precise positioning. I'd like to have som...

Symfony: Options for admin URL

In development mode my symfony admin/backend app can be accessed at http://localhost/backend_dev.php. For production mode, I created a controller php file, admin.php, so now in production the admin application can be accessed at http://www.domain.com/admin.php. What do I have to do to allow the admin app to be accessed at domain.com/ad...

Consuming a php webservice in visual studio

Hi, Is it possible to consume a php webservice in visual studio? I have a webservice with a wsdl file created by nusoap, when I try to add the web reference in visual studio the name of the service and the methods show up but it complains that the 'wsdl is not a known document type' and the discovery document could not be found. Any su...

Put Images on other computers under login credentials

I have an application server, a database server and a file server, with the file server has its own subdomain name (i.e., file.myexample.com) The file server stores all the images that are used in the application, the point is that I don't want the user to view those images without obtaining proper authentication first. So in a sense th...

What do you recommend for a PHP Coding Standards tool/system/program?

I'm working on a PHP project with several developers, each who has their own style. The styles differ significantly, and can make the code really hard to read, and everyone is in agreement that we need to standardize our style. The issue I'm having is that I can't find any good program or system to help enforce standards for PHP. I've...

What is the correct PHP configuration to connect to MS SQL 2000/2005?

I have a number of servers running PHP 5.2.6 (non-thread-safe build) on Windows 2003/IIS6 utilising FastCGI. I'm having some issues connecting to MS SQL 2000/2005 (MySQL connectivity is working fine, ASP/ASP.NET scripts can connect to MS SQL successfully as well). One solution suggests copying the SQL Client Tools ntwdblib.dll file to ...

Where to find the reference for the double dollar PHP syntax?

Hi guys, i hope that everyone here know the php 'variable variable' syntax: $color = 'red'; $red = 'yes, im red'; echo $$color; //output: 'yes, im red'; but my problem is: how this syntax is named? i'm trying to find the reference on php.net, with no results (i wanna know if this feature will be kept in php6, the others attributes, et...

Problem reading accented characters in PHP

Got a strange problem in PHP land. Here's a stripped down example: $handle = fopen("file.txt", "r"); while (($line = fgets($handle)) !== FALSE) { echo $line; } fclose($handle); As an example, if I have a file that looks like this: Lucien Frégis Then the above code run from the command line outputs the same n...

PHP how to use string as superglobal

Hi, I'm building a small abstract class that's supposed to make certain tasks easier. For example: $var = class::get('id'); would run check if there's pointer id in the $_GET, returning a string or array according to parameters. This should also work for post and request and maby more. I'm doing it in the way there's function for all t...

Where should I start for Web Services with PHP with C# Client?

Hello I have been working in C# for a while ago, and recently started again with PHP; and I wonder if it is possible to make web services in php that can be consumed from C#. Googling, i found various frameworks as NuSOAP, Zend and others. My questions are: What good frameworks are out there for doing SOAP Web Services development ...

How can I simply return objects in PDO?

Trying out PDO for the first time. $dbh = new PDO("mysql:host=$hostname;dbname=animals", $username, $password); $stmt = $dbh->query("SELECT * FROM animals"); $stmt->setFetchMode(PDO::FETCH_INTO, new animals); foreach($stmt as $animals) { echo $animals->name; } If i skip the setFetchMode() method, then I need to call $animals["na...

How to offset dates in a MySQL database by 1 second?

I've imported a bunch of posts into a Wordpress site that all have the exact same date. I'd like to edit the post dates so they are offset by one second. My concern is that there may be a performance issue when all of the dates are the same. Anyone know quick way to get this done using phpMyAdmin to edit the MySQL database or some other ...

Retrieving PHP variables from an AJAX form input

I have a form in a PHP sending variables to a PHP file which duly inserts them into a MySQL table. I currently have a div displaying the response from the PHP (which is anything that is printed by the PHP). All works fine. The problem is I want to use variables that are created/updated during the PHP MySQL insert process. I.e. not only...

301 redirect with PHP and MySQL on 404 ... how?

I am transferring a large static website of 500+ pages to a Joomla installation but what I am wanting to do, rather than code a 500+ line .htaccess file, is to use PHP's built in 301 header redirect to dynamically redirect requests that come in to the new URL. So for example, after I move the site, the following URL would 404 without a ...