[PHP] php help needed, is there a bright spark out there!
Hello All, I have been asked to do a project that seems to be baffling me. It's not really the php which is the hard part, but the mathematical problem behind the project that is causing me to have a headache! Imagine an ecommerce site where a user can pick 5 products (it must be 5) from a possible 60. That's the easy bit. The project that I have to do is to do with the way the order is dealt with. Imagine the company has a warehouse (the attached layout) where the yellow boxes are bins of 1 product in each (A1 would be the bin with all products A1 in). P1, P2, and P3 are stations where pickers (people who pack each order) receive the order. I have to build some PHP that shows the picker the optimum way around the warehouse to pick up all the 5 products, and then return him to the starting station. I hope there is a bright spark out there that can solve this easier than I have (my way requires calculating all the possible ways of picking up the 5 products and then calculating the shortest route from a stored database, but it would require 780 sql statements, that just isn't going to work!) Here are the rules that I have to follow: An Order Picking slip for a complete order is printed at 1 of 3 packing locations (P1, P2, or P3). A picker must start at one of these packing locations, collect all products required for that order then return back to the start position to deposit all items for packing. Note: A picker can only move one square at a time (& not diagonally) Pickers cannot walk through bin locations! A picker can only access a bin location when standing directly at the side. e.g. A picker standing at 'X' can access locations B8 or C8 from this position. A picker standing at 'Y' cannot access any locations. I live in hope! Hamish warehouse layout.xls Description: MS-Excel spreadsheet -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] date format
Hello All, I have a variable in the following date format: April 11, 2002, 1:53 pm and want to get it to the following format: -mm-dd what's the best way? hamish -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] good php hosting environments
Hello, I'm looking for a really good, professional hosting environment in the uk that supports php (not in safe mode)), mysql and offers the use of a secure server and mail server. I'm looking for a client of mine who needs to rely on their site being up, and so needs a hoster who has enough redundancy in all systems. We have a budget of between £200 and £400 a year, but don't want to get stuck with bandwidth charges, database usage, etc etc.. It would be good if the hoster also offered a remote control panel as well as ftp access to the server. Does any one have any suggested companies, or companies that they've had good experiences using? cheers Hamish -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Need some help on security with php and mysql
Hello all, I am using php and mysql with phpmyadmin. I am trying to set up a username and password in mysql so that when I use if(!$db_conn = mysql_connect('localhost', 'username', "password")) { echo 'Could not connect to the Database Server'; } with the correct username and password it will connect me. I used phpmyadmin to add the user to the users table in the mysql database. I used the following sql statement: INSERT INTO user (Host,User,Password) VALUES('localhost','jeffrey',PASSWORD('biscuit')); and the record was created in the table. When I try to connect to the db via the php if(!$db_conn = mysql_connect('localhost', 'jeffrey', "biscuit")) { echo 'Could not connect to the Database Server'; } it tells me: Warning: Access denied for user: 'jeffrey@localhost' (Using password: YES) in /home/httpd/htdocs/helpdesk/test.php What have I done wrong? cheers Hamish -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mail tag
hello, I have coded a typical mail process for sending a mail from a form. It works fine except for anytime any one puts a ' or a " in the content of the mail, the tag places a \ infront of it. I have tried to stripslashes and the mail is being sent as html. Has any one got the answer? code below: (description is my variable on a previous page where the user types in the content of the mail) $subject = 'Email from me'; $message = " This email is regards a question / query that you put to me. This email is for reference purposes only. You asked: ".stripslashes ($description); $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; $headers .= "from: Help Desk <[EMAIL PROTECTED]>\r\n"; mail("$usersemail", "$subject", "$message", $headers); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] File extension for PHP's serialization format?
I have a web application (not written in PHP) that can return data in various formats, including JSON and PHP's serialization format. At the moment my URL scheme looks like this: staff/engineering?format=json but I'd like to switch to using a file extension to denote the format: staff/engineering.json But what file extension should I use for PHP's serialization format? Obviously it can't be .php - aside from being inaccurate (it's not PHP code), using this extension would probably trigger the web server into trying to run a (nonexistent) PHP script. Thanks, Hamish Lawson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] File extension for PHP's serialization format?
Hello Chris Thanks for responding. > But what file extension should I use for PHP's serialization format? > Obviously it can't be .php - aside from being inaccurate (it's not PHP > code), using this extension would probably trigger the web server into > trying to run a (nonexistent) PHP script. You can rewrite the url using mod_rewrite or some such variant to handle this. Yes, there may well be ways to get round what the web server would otherwise do when it encounters a .php extension, but I feel that I'd be breaking an expectation. I'd much rather use an extension that was specific to the serialization format. Hamish -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] File extension for PHP's serialization format?
Hello Chris You could "convert" it to a php file: RewriteCond %{REQUEST_URI} *.json RewriteRule ^(.*).json$ json.php?$1 [T=application/x-httpd-php,L] Thanks for continuing to work on this, but I'm afraid my inadequate explanation has sent you in the wrong direction. Let's see if I can do better. Forget for the moment that the files are generated dynamically and instead suppose that they were static files. An example of a file containing JSON data would be engineering.json. But what about the equivalent information in PHP serialized format? Calling it engineering.php would be inappropriate for the reasons I gave before. Hamish -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] File extension for PHP's serialization format?
Hello Roman there's no standard filename extension for PHP-serialized data, I'd just use txt or something... .psdf or whatever. .ser is used for serialized Java objects and I've found .jser also being used (though less frequently) for that. On the analogy of the latter I'll plump for .pser. Hamish -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php