[PHP-DB] Re: Applications using multiple databases
Hello! In my opinion what your conclusion is sounds correct. I would not have a system that creates a new database for each and every client. Why? If the sollution is hosted on a random ISP, most of theese does not allow the creation of new databases. However, surtain ISP have packages where you can have multiple databases, but often not more than 5 in total. This would in most circumstances result in you only having 5 customers in each installation. If you are running the system on your own server, there are no problems with this, as you controll the system and can create as many databases as you would want. On the other hand you could solve this by instead of creating unique databases for each client, prefix the tables inside the database with the clients username. This would result in alot of tables, but again would give you access to every server in the world that has mySQL database available - And it would be easy to backup since you only have just 1 database to backup. It is however, in my opinion, smart to have seperate tables and such for each end every customer. Should there be a corruption somewhere, atleast it wont effect all the clients, but only 1 client. (Aslong as its not the main software that destroys/deletes everything in a faulty SQL statement. My applications are done a little different, as I have solved this by installing a seperate installation for each customer. To protect my code I have purchased IonCube Encoder, which encrypts the code and renders it useless for reverse engineering. :) You might want to do the same. Kim Steinhaug --- There are 10 types of people when it comes to binary numbers: those who understand them, and those who don't. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] using code for multiple sites
Well, on the webservers I am using this would mean that the current user has read access to this folder aswell. E.g. /home/users/james /home/users/matt /home/users/patrick /home/users/shared Im used to that *james* only have read access in .../james/* Matt has only in .../matt/* and such, which would make it impossible to include anything in the .../shared/* folder. Unless you have root privilegies and can set up special rights. This would also only work as all the files are on the same server, as PHP cant include PHP code via HTTP (atleast in my knowledge). I have another sollution, which isnt quite as good, but I program all my PHP in classess and have a standard class file, that is identical for all customers. Difference is only what classes each client are using. As I develop my classess I see to that they are always backwards compatibel, this way I only have 1 (or more, but same directory) that I have to update. This makes it easy in my opinion, just connect with FTP - Update the files and Im down. -- Kim Steinhaug --- There are 10 types of people when it comes to binary numbers: those who understand them, and those who don't. --- Peter Lovatt [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi I do exactly this on servers running several hundred sites. each site has a single file in the root, with any local config and a variable $inc_root set. eg ?php $config_var1 = 'xyz'; $config_var2 = 'xyz'; $inc_root = '/home/sites/shared_stuff/'; //must be an absulute not relative address ? all files are then referenced as include($inc_root.'directory/sub_directory/file_i_want.php') If you move things a lot you could link each site to a single file which sets the $inc_root, so you only change one file. HTH Peter -Original Message- From: mike [mailto:[EMAIL PROTECTED] Sent: 13 November 2003 14:42 To: [EMAIL PROTECTED] Subject: [PHP-DB] using code for multiple sites I currently manage several websites that share the same code. This code is included into many of the pages on every site. I have duplicate copies of the code set up in each virtual host directory. Obviously this wastes space on my server and wastes my time having to update them all. I was looking for suggestions on the best way to be able to access these php files through includes for each site. A couple of the options that I have already looked into were- I could put the code all into one directory for site A and when I want to include these files I would have to include the full path to the files I really don't want to have to do this because I frequently move things and I would have to change the path on each file. either put these files into .:/usr/local/lib/php or create a directory called inc in /usr/local/apache and then add the following line to php.ini include_path = .:/usr/local/apache/inc I hope I made it clear what I want to accomplish. If you could give your recommendations I would greatly appreciate it. Thanks in advance, Mike Mike Calvelage Webmaster / Sales Associate Viper Systems _.·´¯`·.¸¸-vipersystems.biz http://www.vipersystems.biz/ -¸¸.·´¯`·._ [EMAIL PROTECTED] 419-224-8344 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] - ereg_replace
Hello list I'm trying to replace the string say a href=http://www.mysite.gr; with a href=http://www.mysite.gr target=_blank with no luck I use the code: ereg_replace(^a href=\([:alnum:])\$, a href=\\\1\ target=\_blank\, $string) I echo the result but nothing changing. What Im doing wrong? Thanx -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] - ereg_replace
Hi! ...and then ÍÉÊÏÓ ÃÁÔÓÇÓ said... % ... % ereg_replace(^a href=\([:alnum:])\$, a href=\\\1\ % target=\_blank\, $string) % % I echo the result but nothing changing. % What Im doing wrong? Is your string really the only thing on a line, or could it be anywhere in the input? The ^ (beginning) and $ (ending) anchors are probably messing you up. If your format *is* like this, you could do a quick preg_replace('/$/',' target=_blank',$string) (untested) and be done with it :-) % Thanx HTH HAND :-D -- David T-G * There is too much animal courage in (play) [EMAIL PROTECTED] * society and not sufficient moral courage. (work) [EMAIL PROTECTED] -- Mary Baker Eddy, Science and Health http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg! pgp0.pgp Description: PGP signature
Re: [PHP-DB] - ereg_replace
Thank you for reply, but the a is not the only tag in my string. ... % ereg_replace(^a href=\([:alnum:])\$, a href=\\\1\ % target=\_blank\, $string) % % I echo the result but nothing changing. % What Im doing wrong? Is your string really the only thing on a line, or could it be anywhere in the input? The ^ (beginning) and $ (ending) anchors are probably messing you up. If your format *is* like this, you could do a quick preg_replace('/$/',' target=_blank',$string) (untested) and be done with it :-) % Thanx -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] - ereg_replace
Hi again! ...and then ÍÉÊÏÓ ÃÁÔÓÇÓ said... % % Thank you for reply, but the a is not the only tag in my string. You're quite welcome, and now we definitely know that ^ and $ are not what you need. HTH HAND :-D -- David T-G * There is too much animal courage in (play) [EMAIL PROTECTED] * society and not sufficient moral courage. (work) [EMAIL PROTECTED] -- Mary Baker Eddy, Science and Health http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg! pgp0.pgp Description: PGP signature
Re: [PHP-DB] - ereg_replace
wrote: I'm trying to replace the string say a href=http://www.mysite.gr; with a href=http://www.mysite.gr target=_blank with no luck I use the code: ereg_replace(^a href=\([:alnum:])\$, a href=\\\1\ target=\_blank\, $string) Since it looks like you're changing all of the links, how about a simple str_replace() replacing 'a' with 'a target=_blank' ?? -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals - www.phparch.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] - ereg_replace -SOLVED
Thank you all for the replies. I solve it with the following code: eregi_replace(a href=\(.+)\, a href=\\\1\ target=\_blank\ class=\down_txt\, $body); - Original Message - From: John W. Holmes [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: PHP-mailist [EMAIL PROTECTED] Sent: Friday, November 14, 2003 3:25 PM Subject: Re: [PHP-DB] - ereg_replace wrote: I'm trying to replace the string say a href=http://www.mysite.gr; with a href=http://www.mysite.gr target=_blank with no luck I use the code: ereg_replace(^a href=\([:alnum:])\$, a href=\\\1\ target=\_blank\, $string) Since it looks like you're changing all of the links, how about a simple str_replace() replacing 'a' with 'a target=_blank' ?? -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals - www.phparch.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] - ereg_replace -SOLVED
From: [EMAIL PROTECTED] eregi_replace(a href=\(.+)\, a href=\\\1\ target=\_blank\ class=\down_txt\, $body); How is that any different than just doing a str_replace() on a, though? The str_replace() is going to be much faster than the eregi_replace() function and href doesn't _have_ to be the first attribute in the anchor tag... Just trying to open your mind to other possibilities... :) ---John Holmes... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Mulitpart form posts and mysql blobs
How are files encoded when theyre sent in mulitpart forms??? Is it the same as blob fields in mySQL databased when you use the LOAD_FILE() command?? If not, is it easy to convert from one to the other?? At the moment, Im taking the blob from mySQL and writing it to a file and then uploading that file through cURL! Very messy. TIA -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: [PHP] Mulitpart form posts and mysql blobs
John Ryan wrote: How are files encoded when theyre sent in mulitpart forms??? Is it the same as blob fields in mySQL databased when you use the LOAD_FILE() command?? If not, is it easy to convert from one to the other?? At the moment, Im taking the blob from mySQL and writing it to a file and then uploading that file through cURL! Very messy. So what are you actually trying to accomplish? Moving a file from one server to another??? -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals www.phparch.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Re: [PHP] Mulitpart form posts and mysql blobs
Sorry, I should have said. Im trying to send this file to an external multipart form script which converts the file to the desired format. Im using cURL to do this. cURL can send files when given the filename, so I have to write the filename from the database and then give cURL the path. But thats messy I want to be able to get the BINARY data from mySQL and send it via cURL directly. TIA - Original Message - From: John W. Holmes [EMAIL PROTECTED] To: John Ryan [EMAIL PROTECTED] Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Saturday, November 15, 2003 1:22 AM Subject: [PHP-DB] Re: [PHP] Mulitpart form posts and mysql blobs John Ryan wrote: How are files encoded when theyre sent in mulitpart forms??? Is it the same as blob fields in mySQL databased when you use the LOAD_FILE() command?? If not, is it easy to convert from one to the other?? At the moment, Im taking the blob from mySQL and writing it to a file and then uploading that file through cURL! Very messy. So what are you actually trying to accomplish? Moving a file from one server to another??? -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals www.phparch.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: [PHP] Re: [PHP-DB] Re: [PHP] Mulitpart form posts and mysql blobs
John Ryan wrote: cURL can send files when given the filename, so I have to write the filename from the database and then give cURL the path. Kind of begs the question of why you're storing files in the database in the first place... -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals www.phparch.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php