|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
php-general Digest 2 Apr 2005 21:37:30 -0000 Issue 3374
php-general-digest-help
lists.php.net
Date: Sat Apr 02 2005 - 15:37:30 CST
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
php-general Digest 2 Apr 2005 21:37:30 -0000 Issue 3374
Topics (messages 212076 through 212095):
Re: Connection to Two databases simultaneously
212076 by: Dan Rossi
Re: mysql error
212077 by: Burhan Khalid
Re: Easy way to grab a value out of XML?
212078 by: Burhan Khalid
Re: pass variable from vbscript to php
212079 by: Burhan Khalid
Re: Catching error from mail function?
212080 by: Burhan Khalid
Re: Recommendation for a MySql wrapper class
212081 by: Ryan A
212082 by: Marek Kilimajer
212085 by: Ryan A
Re: .htaccess config
212083 by: Jochem Maas
Re: filtering uploaded files
212084 by: Marek Kilimajer
Re: Session in two servers
212086 by: Matthew Weier O'Phinney
Printing
212087 by: Niels Riis Kristensen
212095 by: Warren Vail
Re: Help! mod_php4 upgrade breaks GD!
212088 by: Jason Wong
212093 by: up.3.am
entrepreneur/startup projects..
212089 by: bruce
212090 by: Richard Davey
passing variables with HTTP_GET_VARS
212091 by: AndreaD
212092 by: AndreaD
Validating a Blogger Template using PHP
212094 by: Eli
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscribe
lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscribe
lists.php.net
To post to the list, e-mail:
php-general
lists.php.net
----------------------------------------------------------------------
attached mail follows:
both db's on the same host ?
I would try select * from second_db2.theothertable :)
On 02/04/2005, at 6:53 PM, Jochem Maas wrote:
> HarryG wrote:
>> Hi,
>> I am connecting to two database in my index.php.
>> Here is how:
>>
$db = mysql_connect("localhost", USERLOGIN, USERDBPASS);
>> if (!$db)
>> { print "Error: Could not connect to database. Please try again
>> later."; exit; }
>> mysql_select_db(DATABASE);
>>
$userdb = mysql_connect("localhost", USERLOGIN, USERDBPASS);
>> if (!$userdb)
>> { print "Error: Could not connect to database. Please try again
>> later."; exit; }
>> mysql_select_db(USERDB);
>> $getaccount = "SELECT * FROM account WHERE visible=1"; //Account
>> table is present in USERDB.
>> $result = mysql_query($getaccount);
>> $get = "SELECT * FROM useraccount"; //UserAccount table is present
>> in DATABASE.
>> $result = mysql_query($get);
>> There is no problem with the connection. but I need to query tables
>> in both databases. I know you need to use link identifiers, but have
>> had no luck in getting it to work. Appreciate your help.
>
> er, you are not actually using the link identifiers.... try like this:
>
>
>
$db = mysql_connect("localhost", USERLOGIN, USERDBPASS);
> if (!$db) {
> print "Error: Could not connect to database. Please try again
> later."; exit; }
> mysql_select_db(DATABASE, $db);
> }
>
>
$userdb = mysql_connect("localhost", USERLOGIN, USERDBPASS);
> if (!$userdb) {
> print "Error: Could not connect to database. Please try again
> later."; exit; }
> mysql_select_db(USERDB, $userdb);
> }
>
> $getaccount = "SELECT * FROM account WHERE visible=1"; //Account
> table is present in USERDB.
> $result = mysql_query($getaccount, $userdb);
>
> $get = "SELECT * FROM useraccount"; //UserAccount table is present in
> DATABASE.
> $result = mysql_query($get, $db);
>
>> Thanks.
>> HarryG
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
Mikey wrote:
>>>I have not changed any of my hostname/username/password code
>>
>>in the last 6 months and I can still connect to
>>mysql.timerescue.co.uk via the command line interface.
>>
>>>Has anyone seen this before - any ideas at all - just
>>
>>started happening
>>
>>>today! :o(
>
>
> Strange indeed.
>
> I tried to connect first via the command line and it found your server and
> threw me out with invalid login details, but when I tried entering your
> servername into phpMyAdmin it couldn't resolve the hostname. However, when
> I replaced it with your server IP it returned to not liking my login
> details.
>
> Have there been any changes made to your DNS service of late? Or provider?
Perhaps MySQL was upgraded and its no longer listening on correct
IP/hostname?
attached mail follows:
Brian Dunning wrote:
> I've been looking at the XML commands and am feeling a bit overwhelmed.
> My needs are simple and I'm hoping there's an easy solution that I'm
> just missing. I have a hunk of well-formed XML in a variable, $xml, and
> it contains only one instance of <price>x.xx</price>. I just want to get
> the $price out of $xml. What's the simplest way?
$xml = "....";
preg_match_all("|<price>(.*?)</price>|mi",$xml,$results);
echo $results[1];
attached mail follows:
Ashley wrote:
> I have a unique problem that may be able to be solved another way, but I
> don't know how.
>
> What I need to do is pass a variable from a vbscript into php for use.
>
> I am using vbscript to access an activeX control on the computer that
> grabs the currently logged in user. This works fine, but I cannot
> determine how I can get that value into php so that I can use it.
If PHP is running on the same computer that the user is logged into,
then you can use $_SERVER['REMOTE_USER'] to get the current logged in user.
attached mail follows:
Ben Cheng wrote:
> Hi I'm using the mail() function to send email and I know it's failing
> because it's returning a false but how do I tell what problem is? Is
> there an error message that I can grab that will show me why the
> function is returning false? Any help greatly appreciated. Thanks!
The function itself doesn't return an error code, just true or false.
Things to check :
1. Current error reporting level. Set it to E_ALL to catch possible causes
3. Make sure your MTA is correctly setup on your server.
4. Make sure your php.ini file is correctly setup for your MTA. This
means that for Windows servers, you have a valid smtp host specified in
your php.ini file; for Unix/Linux, sendmail (or preferred MTA).
5. If your SMTP server requires authentication, you cannot use mail(),
but must "manually" (via sockets) send your message. There are many
classes available to do this. One is phpmailer found at phpmailer.sf.net
6. If possible, mail server logs.
attached mail follows:
Hey Dan,
Even if you did have something to do with these companies/softwares/classes
I would still take your advise as you have given me some real helpful advise
in the past, and a lot of others too, you're one of the helpful guys on the
list.
Thanks, I'll chech these out, the thing is i didnt want to use any of the
pear classes as not all hosts have them installed, and if these guys switch
hosts later on....they may have a problem which means i will have a problem.
If anybody (with more experience) than I thinks I am wrong...please tell me
so and most prolly go with PEARs solution, another one high on my list is
the ADODB as I remember someone else talking about it on the list some time
back.
Thanks,
Ryan
On 4/1/2005 9:01:32 PM, Dan Rossi (php
electroteque.org) wrote:
> I have nothing to do with these but I would check out PEAR DB, MDB,MDB2
>
> and ADODB.
>
>
>
> On 02/04/2005, at 10:41 PM, Ryan A wrote:
>
>
>
> --
>
> PHP General Mailing List (http://www.php.net/)
>
> To unsubscribe, visit: http://www.php.net/unsub.php
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.9.1 - Release Date: 4/1/2005
attached mail follows:
Ryan A wrote:
> Hey Dan,
>
> Even if you did have something to do with these companies/softwares/classes
> I would still take your advise as you have given me some real helpful advise
> in the past, and a lot of others too, you're one of the helpful guys on the
> list.
>
> Thanks, I'll chech these out, the thing is i didnt want to use any of the
> pear classes as not all hosts have them installed, and if these guys switch
> hosts later on....they may have a problem which means i will have a problem.
>
> If anybody (with more experience) than I thinks I am wrong...please tell me
> so and most prolly go with PEARs solution, another one high on my list is
> the ADODB as I remember someone else talking about it on the list some time
> back.
You can pack PEAR classes with your project and set up include_path
accordingly.
attached mail follows:
On 4/2/2005 3:08:30 AM, Marek Kilimajer (lists
kilimajer.net) wrote:
>
>
> You can pack PEAR classes with your project and set up include_path
>
> accordingly.
Hey,
Thanks for replying.
Good idea, have never done it but that should be a reason to start anyway
:-)
Cheers,
Ryan
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.9.1 - Release Date: 4/1/2005
attached mail follows:
Philip Hallstrom wrote:
> allow_url_fopen can only be set in php.ini. See here for more info:
scope of ini settings (from the manual)...
Constant Value Meaning
PHP_INI_USER 1 Entry can be set in user scripts or in Windows registry
PHP_INI_PERDIR 2 Entry can be set in php.ini, .htaccess or httpd.conf
PHP_INI_SYSTEM 4 Entry can be set in php.ini or httpd.conf
PHP_INI_ALL 7 Entry can be set anywhere
allow_url_fopen is PHP_INI_SYSTEM.
note that it can also be passed as an arg to the CLI e.g (-d flag):
/usr/bin/php -dallow_url_fopen=1 ./getmyremotefile.php
>
> http://us2.php.net/manual/en/ref.filesystem.php#ini.allow-url-fopen
>
>
>
> On Thu, 31 Mar 2005, Neo Theone wrote:
>
>> Hi
>>
>> I got a simple problem:
>> I need to have allow_url_fopen on for a certain directory and so I
>> wanted to control it by .htaccess file.
>> now I can control other php_flags like register_globals in this
>> directory (so apache allows the Override) but I just simple can't get
>> the following line to work:
>> php_flag allow_url_fopen on
>>
>> any help is appreciated
>> neo
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>
attached mail follows:
Angelo Zanetti wrote:
> hi Richard this sounds like quite a serious subject but is there no
> other way to check the validity of the file and type without using the
> unix command?
>
> IE using PHP and not depending on system commands? thanks for your
> insight so far, very important.
The equivalent of `file` command is mime_content_type() php function (if
enabled). Other alternatives are to use fgetcsv() to check if the file
is a csv file, imagesize() to check for image files, and similar.
But you can never be 100% sure the file is completely valid without
checking the whole file. For example mime_content_type() and imagesize()
check only first few bytes, but the rest of the file might be junk.
attached mail follows:
* Srinadh Sannidhanam <ssnadh
gmail.com>:
> I am using sessions in my web application which is installed in two
> pawns. So the request is randomly picked by one of the two servers. I
> am using files in php session but not database. My problem is, if the
> first request go to one server and the session is created there, then
> for the following request going to other server will not have session.
> How can we manage the session simultaniously in two servers? Please
> help me in this regard.
You have two options:
* share a networked partition between the two servers to which each will
write/read for session information; change your php.ini file's session
save path to that partition
* read and write sessions to a shared container, such as a database
--
Matthew Weier O'Phinney | WEBSITES:
Webmaster and IT Specialist | http://www.garden.org
National Gardening Association | http://www.kidsgardening.com
802-863-5251 x156 | http://nationalgardenmonth.org
mailto:matthew
garden.org | http://vermontbotanical.org
attached mail follows:
Hi
I am using a Unix machine (Mac) but can't find ways to print to my
local printer. Plenty of information about printing from a PC, but none
from a mac. Can that be, that you can't print from php to mac?
Niels Riis Kristensen
(nrk
nrk-gruppen.dk)
NRK Group
- Electronic Music Engraving
- Webhosting
- Dynamic Web design
- E-Lists hosting
attached mail follows:
That is because Windoz, for all it's faults, provides a bit of an
interface for applications to exercise some control over printed output,
and even attempts to make it device independent. Don't know if Gnome,
or other GUI's provide something, but if you write the output intended
for a printer to a physical file and then post that file to your print
spooler using a exec() function that should do the trick.
http://us4.php.net/manual/en/function.exec.php
I suspect you would use the unix command to cause the file to be spooled
to the printer as you would manually (I seem to recall an lpr command
being involved, but don't trust my memory).
This carries with it all the caviates about whether or not you know who
your website visitors are, and what happens when multiple users try to
trigger printing (who loads paper in the printer?). Another potential
snag is, will you website user (usually "nobody") have permission to
print (execute the lpr command)?
Unless gnome or kde is involved, don't know how you could detect your
printer types, since your program will need to know which pcl (printer
control language) is required.
Good luck,
Anyone have other solutions?
Warren Vail
> -----Original Message-----
> From: Niels Riis Kristensen [mailto:nrk
nrk-gruppen.dk]
> Sent: Saturday, April 02, 2005 8:03 AM
> To: php-general
lists.php.net
> Subject: [PHP] Printing
>
>
> Hi
>
> I am using a Unix machine (Mac) but can't find ways to print to my
> local printer. Plenty of information about printing from a
> PC, but none
> from a mac. Can that be, that you can't print from php to mac?
>
>
> Niels Riis Kristensen
> (nrk
nrk-gruppen.dk)
>
> NRK Group
> - Electronic Music Engraving
> - Webhosting
> - Dynamic Web design
> - E-Lists hosting
>
attached mail follows:
On Saturday 02 April 2005 02:46, up
3.am wrote:
> No clue why it couldn't find libjpeg, but I then tried adding:
> --with-zlib-dir=/usr/include (AND) --with-jpeg-dir=/usr/local/include/
> (the header files are there)
That ought to be:
--with-zlib-dir=/usr
--with-jpeg-dir=/usr/local
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
New Year Resolution: Ignore top posted posts
attached mail follows:
FWIW, I installed /usr/ports/graphics/php4-gd and everything appears to be
fine, now.
Strangely, I am not getting any of the posts from this list in my mailbox,
although my posts show up here...I have to look at the archive to see them
and any responses to them.
On Fri, 1 Apr 2005 up
3.am wrote:
>
> A customer needed curl support, so I reconfigured and upgraded from an
> older version of mod_php4 to the latest (4.3.10) and all hell broke loose.
> I installed from FreeBSD ports, using what I thought were a combination of
> the ports default and my old settings. Ports had --disable-all, which
> broke all kinds of functions, but I fixed that, but it still appears that
> alot of gd functions are still undefined.
>
> My last config options were:
>
> './configure' '--enable-versioning' '--enable-memory-limit'
> '--with-layout=PHP' '--with-regex=php' '--with-apxs=/usr/local/sbin/apxs'
> '--prefix=/usr/local' 'i386-portbld-freebsd4.9' '--with-curl'
> '--with-mysql=/usr/local' '--with-pcre' '--with-gd=/usr/local/'
>
> It configures, builds and installs ok, but I have the gd problems I
> described. I also tried to use the built-in gd support by switching to
> just "--with-gd", but then it won't build.
>
> Configure then fails with:
>
> checking for GD support... yes
> checking for the location of libjpeg... no
> checking for the location of libpng... no
> checking for the location of libXpm... no
> checking for FreeType 1.x support... no
> checking for FreeType 2... no
> checking for T1lib support... no
> checking whether to enable truetype string function in GD... no
> checking whether to enable JIS-mapped Japanese font support in GD... no
> checking for fabsf... (cached) yes
> checking for floorf... (cached) yes
> If configure fails try --with-jpeg-dir=<DIR>
> configure: error: PNG support requires ZLIB. Use --with-zlib-dir=<DIR>
>
> No clue why it couldn't find libjpeg, but I then tried adding:
> --with-zlib-dir=/usr/include (AND) --with-jpeg-dir=/usr/local/include/
> (the header files are there)
>
> the configure script then runs through fine, but when I try to run make, I
> get:
>
> eg -lcurl -lz -lm -lcurl -lssl -lcrypto -lz -lcrypt -lcrypt -o
> sapi/cli/php
> ext/gd/gd.lo: In function `zif_imagecreatefromstring':
> /usr/ports/www/mod_php4/work/php-4.3.10/ext/gd/gd.c:1328: undefined
> reference to `gdImageCreateFromJpegCtx'
> ext/gd/gd.lo: In function `zif_imagecreatefromjpeg':
> /usr/ports/www/mod_php4/work/php-4.3.10/ext/gd/gd.c:1507: undefined
> reference to `gdImageCreateFromJpegCtx'
> /usr/ports/www/mod_php4/work/php-4.3.10/ext/gd/gd.c:1507: undefined
> reference to `gdImageCreateFromJpeg'
> ext/gd/gd.lo: In function `zif_imagejpeg':
> /usr/ports/www/mod_php4/work/php-4.3.10/ext/gd/gd.c:1762: undefined
> reference to `gdImageJpegCtx'
> ext/gd/gd.lo: In function `zif_imagecolorat':
> /usr/ports/www/mod_php4/work/php-4.3.10/ext/gd/gd.c:1891: undefined
> reference to `gdImageBoundsSafe'
> ext/gd/gd.lo: In function `_php_image_convert':
> /usr/ports/www/mod_php4/work/php-4.3.10/ext/gd/gd.c:3759: undefined
> reference to `gdImageCreateFromJpeg'
> *** Error code 1
>
> Stop in /usr/ports/www/mod_php4/work/php-4.3.10.
>
> These are all the functions that are breaking. Any help greatly
> appreciated!
>
>
> James Smallacombe PlantageNet, Inc. CEO and Janitor
> up
3.am http://3.am
> =========================================================================
>
>
James Smallacombe PlantageNet, Inc. CEO and Janitor
up
3.am http://3.am
=========================================================================
attached mail follows:
hi...
we're curious... is anyone here looking/trying to start their own software
company, who are looking for help/assistance/etc... it can be sweat
equity/salaried...
not looking to spam, just looking to create a biz.
thanks
bruce
bedouglas
earthlink.net
attached mail follows:
Hello bruce,
Saturday, April 2, 2005, 6:12:49 PM, you wrote:
b> we're curious... is anyone here looking/trying to start their own
b> software company, who are looking for help/assistance/etc... it can
b> be sweat equity/salaried...
There are far better lists to be asking this sort of question on to be
honest (i.e. this isn't a PHP question)
Best regards,
Richard Davey
--
http://www.launchcode.co.uk - PHP Development Services
"I do not fear computers. I fear the lack of them." - Isaac Asimov
attached mail follows:
Can someone show me a simple example of how to make variables availble to
all pages in my site via $http_post_vars and $http_get_vars.
just say I have a page index.php and that is doing a calucualtion and
creating a couple of variables called $age and $height.
How so I make these variables globally available and how do all the other
pages show/retrieve them??
Many Thanks
AD
attached mail follows:
By the way these variables are not part of a form they are just generated by
index.php
"AndreaD" <andrea.davidson
silene.co.uk> wrote in message
news:20050402172123.69865.qmail
lists.php.net...
> Can someone show me a simple example of how to make variables availble to
> all pages in my site via $http_post_vars and $http_get_vars.
>
>
> just say I have a page index.php and that is doing a calucualtion and
> creating a couple of variables called $age and $height.
>
> How so I make these variables globally available and how do all the other
> pages show/retrieve them??
>
>
> Many Thanks
>
>
> AD
attached mail follows:
Hi,
We want to validate a blogger template structure using PHP. We thought
about using XML schema on that, but it's not going well for us..
Do you know about existing tools that validate Blogger Template
structure? Or of a way how to validate the Blogger Template?
-thanks, Eli
- application/pkcs7-signature attachment: smime.p7s
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]