[PHP] Sablotron broken in 4.2.1 ?
Is Sablotron broken in 4.2.1 because none of the transformations have worked that I have tried. I am using: php 4.2.1 apache_1.3.24 expat-1.95.2 my files are: 'wget http://213.84.71.105/news.xml' 'wget http://213.84.71.105/news.xsl' 'wget http://213.84.71.105/news.php' If someone could tell me what to correct to make it right I would appreciate it. Note: Please disregard the content. It is copied from a site that I knew to be using XML with Sablotron and is not mine. -- Bill Amsterdam, NL -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] still running the old version after recompiling??
In that case, you can look at your autoexec.bat. There is a variable (I think called path). Just make sure it's right. On Sunday 02 June 2002 21:31 pm, you wrote: I forgot to write I run on a win98, so no shell :) So what? Makis -Original Message- From: Evan Nemerson [mailto:[EMAIL PROTECTED]] Sent: Monday, June 03, 2002 1:52 AM To: savaidis; [EMAIL PROTECTED] Subject: Re: [PHP] still running the old version after recompiling?? Do echo $PATH from a shell. This will output a list of several folders, seperated by a semi-colon. Check each of these folders for a file named Php. Rename to php. That should do the trick. On Sunday 02 June 2002 11:01 am, savaidis wrote: I have one similar problem. I had a directory Php under my root directory that was the root for Apache. Then I rename Php to php but after restart, reset ecc - some months now- still recognize only Php and NOT php. What's wrong? Makis -Original Message- From: Andy [mailto:[EMAIL PROTECTED]] Sent: Sunday, June 02, 2002 4:51 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] still running the old version after recompiling?? Hello Jason, you have been right, I did a new one on a fresh php untared dir. And the new php install is recognized. But I am still fighting with the installation. I need freetype2 and I did configure it ok, compiled freetype, gd2 but still I am getting a: function: imagettfbbox() not found Php did not complain about not finding freetype. Maybe php compiled with freetype 1 but how come? This drives me cracy! I did install php on several machines at home running the same operating system like my provider is offering. It always worked fine. do u have a good advice? Thank you for your help, Andy Jason Wong [EMAIL PROTECTED] schrieb im Newsbeitrag [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... On Sunday 02 June 2002 17:32, Andy wrote: Hi there, I did recompile php with different flags. Phpinfo() tells me that I am still running the old insatllation! I did restart apache after compiling. So whats wrong. Did I forget something? I did configure with some flags make make install restart apache 1) To avoid any complications I always compile from a freshly unpacked tar.gz. 2) Stop apache before doing make install (not sure whether it makes any difference but it doesn't hurt to do so). -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* There are two ways of disliking poetry; one way is to dislike it, the other is to read Pope. -- Oscar Wilde */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- I am prepared to meet anyone, but whether anyone is prepared for the great ordeal of meeting me is another matter. Samuel Clemens -- Knowledge is power. Information is liberating. Education is the premise of progress, in every society, in every family. Kofi Annan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Overriding Class functions and variables
Jared: On Mon, Jun 03, 2002 at 04:33:45PM -0400, Jared Boelens wrote: In my case i am trying to override a variable. I have a property Username for both the parent and the child. I am wondering if there is a way to differenciate between parent-Username and child-Username. Are you talking about a child class that extends another parent class, or something similar? Kind of like this: class FooParent { var $Username = '1'; } class FooChild extends FooParent { var $Username = '2'; } $F = new FooChild; echo $F-Username; If so, then, no, I don't think there's a way to distinguish the two. The second instance will prevail. To distinguish, you could create two separate object names... $F1 = new FooParent; $F2 = new FooChild; echo $F1-Username and $F2-Username; Or perhaps calling two instances of the class into separate object names, then modify one instance of the Username variable... $F1 = new FooChild; $F2 = new FooChild; $F1-Username = '3'; echo $F1-Username and $F2-Username; All depends on what you're trying to do. Enjoy, --Dan -- PHP classes that make web design easier SQL Solution | Layout Solution | Form Solution sqlsolution.info | layoutsolution.info | formsolution.info T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Download Script - Newbie Alert
Hello, I would like to allow visitors to my site to download documents created with MS office and .PDF files as well. In order to prevent linking from other sites I'd like to make or modify a script that hides the actual location of the files. A pointer in the right direction would be most appreciated. Thanks --- Philip Hess - Pittsburgh, PA USA - Computer Teacher E-mail: pjh_at_zoominternet.net Phil's Place (my web site) http://phil.mav.net/ PA School District Database: http://phil.mav.net/district.hts --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] stupid error, please kick me (and send me a solution)
Hiya, You're using single quotes around all your strings, for variables to be replaced with their values, you must use double quotes. Try replacing every ' with . HTH, Dw Sqlcoders.com Dynamic data driven web solutions - Original Message - From: Jule Slootbeek [EMAIL PROTECTED] To: mysql [EMAIL PROTECTED]; php-general [EMAIL PROTECTED] Sent: June 03 2002 03:09 PM Subject: [PHP] stupid error, please kick me (and send me a solution) Hey guys, i'm getting this error with the following sql script using php: --error-- Warning: Supplied argument is not a valid MySQL-Link resource in /var/www/phpquiz/register_user.php on line 12 --error-- --script-- $link_glob = mysql_connect('$host_glob', '$un_glob', '$pw_glob'); $query = INSERT INTO user values('0', '$fname', '$lname', '$email', '$username', PASSWORD('$password'); $result = mysql_db_query('$db_glob', '$query', $link_glob'); if (!$result) { echo font size=+1Your Information could not be entered into the database, Please contact the a href=mailto:$webmasterwebmaster/a./fontbrbr . mysql_errno() . : . mysql_error() . brbr; } else { echo font size=+1Your Information has successfully been entered into the database!/fontbr; -- Jule Slootbeek [EMAIL PROTECTED] http://blindtheory.cjb.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] stupid error, please kick me (and send me a solution)
Hey guys, i'm getting this error with the following sql script using php: --error-- Warning: Supplied argument is not a valid MySQL-Link resource in /var/www/phpquiz/register_user.php on line 12 --error-- --script-- $link_glob = mysql_connect('$host_glob', '$un_glob', '$pw_glob'); $query = INSERT INTO user values('0', '$fname', '$lname', '$email', '$username', PASSWORD('$password'); $result = mysql_db_query('$db_glob', '$query', $link_glob'); if (!$result) { echo font size=+1Your Information could not be entered into the database, Please contact the a href=mailto:$webmasterwebmaster/a./fontbrbr . mysql_errno() . : . mysql_error() . brbr; } else { echo font size=+1Your Information has successfully been entered into the database!/fontbr; -- Jule Slootbeek [EMAIL PROTECTED] http://blindtheory.cjb.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Cyber Cafe software
Does anybody know of any software all ready written or what would have to be done, to allow us to run a cyber cafe style setup. What we need the software to do is to allow someone to come in and plug in their computer to our network (actually a customers network). They want the following: 1. A customer comes in and signs up starting a clock so they could charge the customer for the time. 2. They want it to work for wired or wireless networks. So when they sign in, it would either have to set their IP address on their machine automatically, or we would have to give them an IP address to put in to their system. 3. It would have to send a report once a day to an email address (or multiple email addresses) with the days summary of time used and amount of money made. 4. A regular customer could come in and use the same login each time so that they could track everything over long periods of time, on a per customer basis. They might want to give discounts to these people and/or give away free stuff. Kind of likefor every minute someone has been on, they get one credit point. Those credit points can be used for purchasing extra time, or other products in the business. Now, if it is kept in a mysql database, than that would not be hard to pull. I know that there are cyber cafe's out there now, so I am assuming that I should not have to reinvent the wheel for this software. If not, how would somebody go about setting this up. Basically, if I could get it set up so that ALL IP addresses on the local network are not allowed in unless they sign in first, than what file would it have to put that IP address in and what would have to be restarted to allow that customer access? Preferably, I would like the program to work with RedHat Linux, PHP and MySQL. Thanks In Advance Steve Buehler -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: stupid error, please kick me (and send me a solution)
If this is truly the code you're using, you're missing the closing curly-brace after the else statement. I.e. this: } else { echo font size=+1Your Information has successfully been entered into the database!/fontbr; Should be this: } else { echo font size=+1Your Information has successfully been entered into the database!/fontbr; } HTH, Jason Soza - Original Message - From: Jule Slootbeek [EMAIL PROTECTED] Date: Monday, June 3, 2002 2:09 pm Subject: stupid error, please kick me (and send me a solution) Hey guys, i'm getting this error with the following sql script using php: --error-- Warning: Supplied argument is not a valid MySQL-Link resource in /var/www/phpquiz/register_user.php on line 12 --error-- --script-- $link_glob = mysql_connect('$host_glob', '$un_glob', '$pw_glob'); $query = INSERT INTO user values('0', '$fname', '$lname', '$email', '$username', PASSWORD('$password'); $result = mysql_db_query('$db_glob', '$query', $link_glob'); if (!$result) { echo font size=+1Your Information could not be entered into the database, Please contact the href=mailto:$webmasterwebmaster./fontbrbr . mysql_errno() . : . mysql_error() . brbr; } else { echo font size=+1Your Information has successfully been entered into the database!/fontbr; -- Jule Slootbeek [EMAIL PROTECTED] http://blindtheory.cjb.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: stupid error, please kick me (and send me a solution)
Do not use double kotes here. $link_glob = \mysql_connect(\'$host_glob\', \'$un_glob\', \'$pw_glob\')\; mysql_connect is a function. Regards, Laercio Fortes Citando Jason Soza [EMAIL PROTECTED]: If this is truly the code you\'re using, you\'re missing the closing curly-brace after the else statement. I.e. this: } else { echo \font size=+1Your Information has successfully been entered into the database!/fontbr\; Should be this: } else { echo \font size=+1Your Information has successfully been entered into the database!/fontbr\; } HTH, Jason Soza - Original Message - From: Jule Slootbeek [EMAIL PROTECTED] Date: Monday, June 3, 2002 2:09 pm Subject: stupid error, please kick me (and send me a solution) Hey guys, i\'m getting this error with the following sql script using php: --error-- Warning: Supplied argument is not a valid MySQL-Link resource in /var/www/phpquiz/register_user.php on line 12 --error-- --script-- $link_glob = \mysql_connect(\'$host_glob\', \'$un_glob\', \'$pw_glob\')\; $query = \INSERT INTO user values(\'0\', \'$fname\', \'$lname\', \'$email\', \'$username\', PASSWORD(\'$password\')\; $result = mysql_db_query(\'$db_glob\', \'$query\', $link_glob\'); if (!$result) { echo \font size=+1Your Information could not be entered into the database, Please contact the href=mailto:$webmasterwebmaster./fontbrbr\ . mysql_errno() . \: \ . mysql_error() . \brbr\; } else { echo \font size=+1Your Information has successfully been entered into the database!/fontbr\; -- Jule Slootbeek [EMAIL PROTECTED] http://blindtheory.cjb.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Fw: [PHP] keep alive refresh
It would help to know exactly what information you are gathering and for what reason are you storing it. -Kevin - Original Message - From: Mauro [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, June 03, 2002 2:35 PM Subject: [PHP] keep alive refresh Hello, I looked for some old questions about my problem in the m.l. archive but I did not find anything. I'm writing a php script which takes a couple of values from the web interface and then passes these values to a program which writes it's output on a file. Then the output of the file is published on the web page. The problem is that this program may take 1 minute up to 1 hour to write all the output on the file and the browser times out. Any suggestion on how to solve this? Many thanx Mauro -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Previous Next Navigation
The memory footprint of the 3k - 5k of records, even if the total memory needed for each record is 1k (which it is not), is 30k - 50k RAM, less than the size of most web pages. The LIMIT query, running on a slow server to simulate dial-up connections, takes anywhere from 1.3 to 2.2 minutes (been timing it a lot today) to execute. Ummm, maybe I've missed something here but I don't think a 'slow server' is an effective simulation of a dial-up connection. If your queries are getting bogged down then a faster server is going to be an effective solution. A slow dial-up just slows the rate at which the end user can receive the information but has no real effect on the speed at which the server physically generates it (ie. Back-end processing). If your query is as you describe then perhaps a more appropriate approach would be to use a scratch table in your database and, after having queried your large database, write the results back as a sub-set in a different table - then just carry a pointer variable from page to page within your site to query that scratch table - it should be a very fast query as the results will be precisely what you need and ordered ready to go. CYA, Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: stupid error, please kick me (and send me a solution)
[EMAIL PROTECTED] wrote: Do not use double kotes here. $link_glob = \mysql_connect(\'$host_glob\', \'$un_glob\', \'$pw_glob\')\; mysql_connect is a function. Regards, Laercio Fortes Citando Jason Soza [EMAIL PROTECTED]: If this is truly the code you\'re using, you\'re missing the closing curly-brace after the else statement. I.e. this: } else { echo \font size=+1Your Information has successfully been entered into the database!/fontbr\; Should be this: } else { echo \font size=+1Your Information has successfully been entered into the database!/fontbr\; } HTH, Jason Soza - Original Message - From: Jule Slootbeek [EMAIL PROTECTED] Date: Monday, June 3, 2002 2:09 pm Subject: stupid error, please kick me (and send me a solution) Hey guys, i\'m getting this error with the following sql script using php: --error-- Warning: Supplied argument is not a valid MySQL-Link resource in /var/www/phpquiz/register_user.php on line 12 --error-- --script-- $link_glob = \mysql_connect(\'$host_glob\', \'$un_glob\', \'$pw_glob\')\; $query = \INSERT INTO user values(\'0\', \'$fname\', \'$lname\', \'$email\', \'$username\', PASSWORD(\'$password\')\; $result = mysql_db_query(\'$db_glob\', \'$query\', $link_glob\'); if (!$result) { echo \font size=+1Your Information could not be entered into the database, Please contact the href=mailto:$webmasterwebmaster./fontbrbr\ . mysql_errno() . \: \ . mysql_error() . \brbr\; } else { echo \font size=+1Your Information has successfully been entered into the database!/fontbr\; -- Jule Slootbeek [EMAIL PROTECTED] http://blindtheory.cjb.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php changing that line to this: $link_glob = mysql_connect($host_glob, $un_glob, $pw_glob); doesn't make any difference... i still get the error.. could it be my setup? the $link_glob var is in globals.inc.php and i use this through require('globals.inc.php'); which has worked great in the past... the other two lines. Now: $query = INSERT INTO user values('0', '$fname', '$lname', '$email', '$username', PASSWORD('$password'); $result = mysql_db_query($db_glob, $query, $link_gob); are in register_user.php in which the first line is require('globals.inc.php'); I've used this method in the past also, and i've never experienced problems with it... thanks, Jule -- Jule Slootbeek [EMAIL PROTECTED] http://blindtheory.cjb.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: stupid error, please kick me (and send me a solution)
G r e g L a w r i e wrote: It would also appear you are missing a closing ) at the end of the '$query=...' line. You have two opening backets and only one closing. Greg -Original Message- From: Bruce Lewis [mailto:[EMAIL PROTECTED]] Sent: Tuesday, 4 June 2002 7:50 To: [EMAIL PROTECTED]; mysql; php-general Subject: Re: stupid error, please kick me (and send me a solution) Your missing your closing } at the end of the else statement. - Original Message - From: Jule Slootbeek [EMAIL PROTECTED] To: mysql [EMAIL PROTECTED]; php-general [EMAIL PROTECTED] Sent: Monday, June 03, 2002 5:09 PM Subject: stupid error, please kick me (and send me a solution) Hey guys, i'm getting this error with the following sql script using php: --error-- Warning: Supplied argument is not a valid MySQL-Link resource in /var/www/phpquiz/register_user.php on line 12 --error-- --script-- $link_glob = mysql_connect('$host_glob', '$un_glob', '$pw_glob'); $query = INSERT INTO user values('0', '$fname', '$lname', '$email', '$username', PASSWORD('$password'); $result = mysql_db_query('$db_glob', '$query', $link_glob'); if (!$result) { echo font size=+1Your Information could not be entered into the database, Please contact the a href=mailto:$webmasterwebmaster/a./fontbrbr . mysql_errno() . : . mysql_error() . brbr; } else { echo font size=+1Your Information has successfully been entered into the database!/fontbr; -- Jule Slootbeek [EMAIL PROTECTED] http://blindtheory.cjb.net - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php $query = INSERT INTO user values('0', '$fname', '$lname', '$email', '$username', PASSWORD('$password'); that should be all closed shouldn't it? my text editor colors code, and it doesn't show any mistakes.. thanks though Jule -- Jule Slootbeek [EMAIL PROTECTED] http://blindtheory.cjb.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] RE: stupid error, please kick me (and send me a solution)
It would also appear you are missing a closing ) at the end of the '$query=...' line. You have two opening backets and only one closing. Greg -Original Message- From: Bruce Lewis [mailto:[EMAIL PROTECTED]] Sent: Tuesday, 4 June 2002 7:50 To: [EMAIL PROTECTED]; mysql; php-general Subject: Re: stupid error, please kick me (and send me a solution) Your missing your closing } at the end of the else statement. - Original Message - From: Jule Slootbeek [EMAIL PROTECTED] To: mysql [EMAIL PROTECTED]; php-general [EMAIL PROTECTED] Sent: Monday, June 03, 2002 5:09 PM Subject: stupid error, please kick me (and send me a solution) Hey guys, i'm getting this error with the following sql script using php: --error-- Warning: Supplied argument is not a valid MySQL-Link resource in /var/www/phpquiz/register_user.php on line 12 --error-- --script-- $link_glob = mysql_connect('$host_glob', '$un_glob', '$pw_glob'); $query = INSERT INTO user values('0', '$fname', '$lname', '$email', '$username', PASSWORD('$password'); $result = mysql_db_query('$db_glob', '$query', $link_glob'); if (!$result) { echo font size=+1Your Information could not be entered into the database, Please contact the a href=mailto:$webmasterwebmaster/a./fontbrbr . mysql_errno() . : . mysql_error() . brbr; } else { echo font size=+1Your Information has successfully been entered into the database!/fontbr; -- Jule Slootbeek [EMAIL PROTECTED] http://blindtheory.cjb.net - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: stupid error, please kick me (and send me a solution)
Jule Slootbeek wrote: G r e g L a w r i e wrote: It would also appear you are missing a closing ) at the end of the '$query=...' line. You have two opening backets and only one closing. Greg -Original Message- From: Bruce Lewis [mailto:[EMAIL PROTECTED]] Sent: Tuesday, 4 June 2002 7:50 To: [EMAIL PROTECTED]; mysql; php-general Subject: Re: stupid error, please kick me (and send me a solution) Your missing your closing } at the end of the else statement. - Original Message - From: Jule Slootbeek [EMAIL PROTECTED] To: mysql [EMAIL PROTECTED]; php-general [EMAIL PROTECTED] Sent: Monday, June 03, 2002 5:09 PM Subject: stupid error, please kick me (and send me a solution) Hey guys, i'm getting this error with the following sql script using php: --error-- Warning: Supplied argument is not a valid MySQL-Link resource in /var/www/phpquiz/register_user.php on line 12 --error-- --script-- $link_glob = mysql_connect('$host_glob', '$un_glob', '$pw_glob'); $query = INSERT INTO user values('0', '$fname', '$lname', '$email', '$username', PASSWORD('$password'); $result = mysql_db_query('$db_glob', '$query', $link_glob'); if (!$result) { echo font size=+1Your Information could not be entered into the database, Please contact the a href=mailto:$webmasterwebmaster/a./fontbrbr . mysql_errno() . : . mysql_error() . brbr; } else { echo font size=+1Your Information has successfully been entered into the database!/fontbr; -- Jule Slootbeek [EMAIL PROTECTED] http://blindtheory.cjb.net - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php $query = INSERT INTO user values('0', '$fname', '$lname', '$email', '$username', PASSWORD('$password'); that should be all closed shouldn't it? my text editor colors code, and it doesn't show any mistakes.. thanks though Jule well it didn't fix it, but still thanks, Jule -- Jule Slootbeek [EMAIL PROTECTED] http://blindtheory.cjb.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Probs with MIME multipart/alternative generated with PEAR mime.php
mike, you could check out my example. it's a form in flash that sends multipart/alternative email. you should get a html formatted reply, plain text for those guys and a zip attachment with the source file. goto: http://www.bigjolt.com/mime/ i had a lot of trouble getting it to work. those pesky CRLF's! fairly happy with it now. only seems to crash on odd/less used email clients. let me know how you go. and if anyone else wants to test it - go ahead - more the better - please give bug reports if possible! cheers Henry Thanks for the reply. I tryed tweaking the pearMime.php class to handle correctly with no luck. As a temporary solution, I didtched the Mime.php class and just simpley added my own headers. For text email, I swapped the Content-Type to text/plain; charset=iso-8859-1. Fine, but multipart/alternative is much nicer. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] keep alive refresh
Raise the max execution time for your script. Either do it in PHP.ini or I think there is a function for it you can use in your script... ---John Holmes... -Original Message- From: Mauro [mailto:[EMAIL PROTECTED]] Sent: Monday, June 03, 2002 4:35 PM To: [EMAIL PROTECTED] Subject: [PHP] keep alive refresh Hello, I looked for some old questions about my problem in the m.l. archive but I did not find anything. I'm writing a php script which takes a couple of values from the web interface and then passes these values to a program which writes it's output on a file. Then the output of the file is published on the web page. The problem is that this program may take 1 minute up to 1 hour to write all the output on the file and the browser times out. Any suggestion on how to solve this? Many thanx Mauro -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Download Script - Newbie Alert
Store the files above your web root and use a PHP script to control access. Use header to set the appropriate header for the file, header(Content-Type: application/vnd.ms-excel; name='excel'); header(Content-Disposition: attachment; filename= . $filename . .xls); then use passthru() to send the contents of the file. Use a path for passthru that's above the web root. The key to this though, is to do some checking with PHP to make sure the person is authorized to download the file. Simply doing the above will still allow someone to link directly to file.php?id=23 or whatever, and get the contents. Start a session on another page, the one before the download, and then check for the session in this page, before you send the file. If the session doesn't exist (or a certain variable within it) then don't send the file. ---John Holmes... -Original Message- From: Philip Hess [mailto:[EMAIL PROTECTED]] Sent: Monday, June 03, 2002 6:09 PM To: [EMAIL PROTECTED] Subject: [PHP] Download Script - Newbie Alert Hello, I would like to allow visitors to my site to download documents created with MS office and .PDF files as well. In order to prevent linking from other sites I'd like to make or modify a script that hides the actual location of the files. A pointer in the right direction would be most appreciated. Thanks --- Philip Hess - Pittsburgh, PA USA - Computer Teacher E-mail: pjh_at_zoominternet.net Phil's Place (my web site) http://phil.mav.net/ PA School District Database: http://phil.mav.net/district.hts --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: stupid error, please kick me (and send me a solution)
At 18:09 -0400 6/3/02, Jule Slootbeek wrote: Hey guys, i'm getting this error with the following sql script using php: --error-- Warning: Supplied argument is not a valid MySQL-Link resource in /var/www/phpquiz/register_user.php on line 12 --error-- --script-- $link_glob = mysql_connect('$host_glob', '$un_glob', '$pw_glob'); Why is your mysql_connect() call enclosed within quotes? All you're doing here is assigning a string to $link_glob. The script can't possibly work. Note, too, that even if you take out the quotes, you don't check the return value from mysql_connect(), so you'll never find out if it fails. $query = INSERT INTO user values('0', '$fname', '$lname', '$email', '$username', PASSWORD('$password'); $result = mysql_db_query('$db_glob', '$query', $link_glob'); if (!$result) { echo font size=+1Your Information could not be entered into the database, Please contact the a href=mailto:$webmasterwebmaster/a./fontbrbr . mysql_errno() . : . mysql_error() . brbr; } else { echo font size=+1Your Information has successfully been entered into the database!/fontbr; -- Jule Slootbeek [EMAIL PROTECTED] http://blindtheory.cjb.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: stupid error, please kick me (and send me a solution)
Are you sure this is the correct file? This is full of syntax errors, you should be getting parse errors. A few tips: a) Don't post to multiple lists. This is a PHP issue, not MySQL. Hopefully this will end the mysql list thread. b) Don't use mysql_db_query() as it is deprecated. See: http://www.php.net/mysql_db_query Use mysql_select_db() and mysql_query() instead. c) Be 100% this is right file, or if this (what you gave us) is the exact code in that file. I doubt it is. d) If an error is on line 12, tell us what line #11-13 are. e) While developing, put error_reporting(E_ALL); on top of your script. f) Don't fully rely on syntax highlighting of your text editor as it will never be perfect. To narrow down the error, try this format: ?php if (!$conn = mysql_connect($host, $username, $password)) { print Could not connect: . mysql_error(); exit; } if (!mysql_select_db($dbname)) { print Could not select DB . mysql_error(); exit; } $sql = Your SQL goes here; if (!$result = mysql_query($sql)) { print Could not run query ($sql) : . mysql_error(); exit; } print Thank you for submitting the data, we got it; ? Basically, we are checking if these functions return false. If they do, an error will be sent and the script will exit. Instead of using exit each time, you may want to implement your own db error management so if a db error occurs you load a static page or your webmaster email or whatever. But the above should narrow down your error and is a good start. The original reason you got this error is, I assume, that you treated $link_glob as a simple string. Other replies discussed this a bit. Lastly: print $foo; // sexy print $foo; // not as sexy but will work (eww) print '$foo'; // literally prints a string $foo and // not the value of $foo. bad. Read/study this tutorial on using strings: http://www.zend.com/zend/tut/using-strings.php Good luck, you'll get the hang of it soon :) Regards, Philip Olson On Mon, 3 Jun 2002, Jule Slootbeek wrote: Jule Slootbeek wrote: G r e g L a w r i e wrote: It would also appear you are missing a closing ) at the end of the '$query=...' line. You have two opening backets and only one closing. Greg -Original Message- From: Bruce Lewis [mailto:[EMAIL PROTECTED]] Sent: Tuesday, 4 June 2002 7:50 To: [EMAIL PROTECTED]; mysql; php-general Subject: Re: stupid error, please kick me (and send me a solution) Your missing your closing } at the end of the else statement. - Original Message - From: Jule Slootbeek [EMAIL PROTECTED] To: mysql [EMAIL PROTECTED]; php-general [EMAIL PROTECTED] Sent: Monday, June 03, 2002 5:09 PM Subject: stupid error, please kick me (and send me a solution) Hey guys, i'm getting this error with the following sql script using php: --error-- Warning: Supplied argument is not a valid MySQL-Link resource in /var/www/phpquiz/register_user.php on line 12 --error-- --script-- $link_glob = mysql_connect('$host_glob', '$un_glob', '$pw_glob'); $query = INSERT INTO user values('0', '$fname', '$lname', '$email', '$username', PASSWORD('$password'); $result = mysql_db_query('$db_glob', '$query', $link_glob'); if (!$result) { echo font size=+1Your Information could not be entered into the database, Please contact the a href=mailto:$webmasterwebmaster/a./fontbrbr . mysql_errno() . : . mysql_error() . brbr; } else { echo font size=+1Your Information has successfully been entered into the database!/fontbr; -- Jule Slootbeek [EMAIL PROTECTED] http://blindtheory.cjb.net - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php $query = INSERT INTO user values('0', '$fname', '$lname', '$email', '$username', PASSWORD('$password'); that should be all closed shouldn't it? my text editor colors code, and it doesn't show any mistakes.. thanks though Jule well it didn't fix it, but still thanks, Jule -- Jule Slootbeek [EMAIL PROTECTED] http://blindtheory.cjb.net -- PHP General Mailing List (http://www.php.net/) To
Re: [PHP] stupid error, please kick me (and send me a solution)
try this jule.. $link_glob = mysql_connect('$host_glob', '$un_glob', '$pw_glob'); $temp= PASSWORD($password); $query = INSERT INTO user values('0', '$fname', '$lname', '$email', '$username', '$temp');; i think this will work..=) i hope ive done something. - Original Message - From: Jule Slootbeek [EMAIL PROTECTED] To: mysql [EMAIL PROTECTED]; php-general [EMAIL PROTECTED] Sent: Tuesday, June 04, 2002 6:09 AM Subject: [PHP] stupid error, please kick me (and send me a solution) Hey guys, i'm getting this error with the following sql script using php: --error-- Warning: Supplied argument is not a valid MySQL-Link resource in /var/www/phpquiz/register_user.php on line 12 --error-- --script-- $link_glob = mysql_connect('$host_glob', '$un_glob', '$pw_glob'); $query = INSERT INTO user values('0', '$fname', '$lname', '$email', '$username', PASSWORD('$password'); $result = mysql_db_query('$db_glob', '$query', $link_glob'); if (!$result) { echo font size=+1Your Information could not be entered into the database, Please contact the a href=mailto:$webmasterwebmaster/a./fontbrbr . mysql_errno() . : . mysql_error() . brbr; } else { echo font size=+1Your Information has successfully been entered into the database!/fontbr; -- Jule Slootbeek [EMAIL PROTECTED] http://blindtheory.cjb.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.360 / Virus Database: 199 - Release Date: 5/7/2002 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Download Script - Newbie Alert
Something else along these lines -- I really, really wish that more sites that use this method would test across multiple browsers and platforms. I agree with everything John is saying regarding testing access/permissions -- I've used this technique many times myself. However, if a user with Internet Explorer on Mac OS X clicks this link: www.domain.dom/file.php?id=23 They'll wind up with a file on their desktop called file.php. Not every browser pays close enough attention to the filename in the Content-Disposition header. Solution? www.domain.com/file.php/23/docname.xls I believe this will run file.php, which can then pull in the $PATH_INFO to determine what file is being requested, check session permissions, etc., can then spit out the right headers as John suggests, AND users will definitely wind up with a downloaded file called docname.xls. If your pages are dynamically generated, you can even do tricks like this to thwart external linking: ?php $bootLeech = date(U) / 2; echo a href=\http://www.domain.com/file.php/23/$bootLeech/docname.xls;download/a ; ? Then in your file.php script, do the following: - explode $PATH_INFO on / - check the $bootLeach array position with the same calculation ... Where you can allow a plus/minus error tolerance of 10 minutes. We use this trick on http://www.imagescentral.com ... Kids frequently want to build Geocities sites that leech all our images. Our image file URLs work *just* long enough for them to build their pages, and test that they look good. 30 hours later, all the leeched images are replaced with Images Central logos. : ) Fun! -Clay From: John Holmes [EMAIL PROTECTED] Organization: U.S. Army Reply-To: [EMAIL PROTECTED] Date: Mon, 3 Jun 2002 20:06:42 -0400 To: 'Philip Hess' [EMAIL PROTECTED], [EMAIL PROTECTED] Subject: RE: [PHP] Download Script - Newbie Alert Store the files above your web root and use a PHP script to control access. Use header to set the appropriate header for the file, header(Content-Type: application/vnd.ms-excel; name='excel'); header(Content-Disposition: attachment; filename= . $filename . .xls); then use passthru() to send the contents of the file. Use a path for passthru that's above the web root. The key to this though, is to do some checking with PHP to make sure the person is authorized to download the file. Simply doing the above will still allow someone to link directly to file.php?id=23 or whatever, and get the contents. Start a session on another page, the one before the download, and then check for the session in this page, before you send the file. If the session doesn't exist (or a certain variable within it) then don't send the file. ---John Holmes... -Original Message- From: Philip Hess [mailto:[EMAIL PROTECTED]] Sent: Monday, June 03, 2002 6:09 PM To: [EMAIL PROTECTED] Subject: [PHP] Download Script - Newbie Alert Hello, I would like to allow visitors to my site to download documents created with MS office and .PDF files as well. In order to prevent linking from other sites I'd like to make or modify a script that hides the actual location of the files. A pointer in the right direction would be most appreciated. Thanks --- Philip Hess - Pittsburgh, PA USA - Computer Teacher E-mail: pjh_at_zoominternet.net Phil's Place (my web site) http://phil.mav.net/ PA School District Database: http://phil.mav.net/district.hts --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] HUGE ERROR (was: [PHP] stupid error, please kick me (and send mea solution))
ok, i think i fixed up everything everybody told me (although some answers did contradict) and here is the entire script... Jule --script (globals.inc.php)-- ?php $host_glob = localhost; $db_glob = phpquiz; $un_glob = phpquiz; $pw_glob = phpquiz; $link_glob = mysql_connect($host_glob, $un_glob, $pw_glob); $webmaster = [EMAIL PROTECTED]; ? --script (globals.inc.php)-- --script (register_user.php)-- ?php session_start(); require(globals.inc.php); require(layout.fnct.php); html_header(Register a New User, Enter Information); /**/ if ($fname $lname $email $username $password $vpassword) { if ($password != $vpassword) { echo font size = +1 color = \#FF\Your passwords do not match, please try again/fontbr; } else { if (!$link_glob) { echo font size=+1 color=\#FF\You could not connect to the database.brPlease contact the a href=mailto:$webmasterwebmaster/a.brbr/font . mysql_errno() . : . mysql_error() . br; } else { if (!mysql_select_db($db_glob, $link_glob)) { echo font size=+1 color=\#FF\The Database could not be selectedbr Please contact the a href=mailto:$webmasterwebmaster/a.brbr/font . mysql_errno() . : . mysql_error() . br; } else { $table_user = user; $query = INSERT INTO $table_user values('0', '$fname', '$lname', '$email', '$username', PASSWORD('$password')); $result = mysql_query('$query', '$link_glob'); if (!$result) { echo font size=+1 color=\#FF\Your Information could not be entered into the database.br Please contact the a href=mailto:$webmasterwebmaster/a./fontbrbr . mysql_errno() . : . mysql_error() . br; } else { echo font size = +1 color=\#FF\Your Information has successfully been entered into the database!/fontbr; echo click a href=\manage_account.php\here/a to change your personal options and to add your first quiz!; html_footer(); exit; } } } } } echo font size=+1Please enter the required information/font; echo form method=post action=register_user.php Name: input type=text name=fname size=10 maxlength=10 input type=text name=lname size=20 maxlength=20br Email: input type=text name=email size=30 maxlength=100br UserName: input type=text name=username size=16 maclength=16br Password: input type=password name=password size=8 maxlength=8br Verify Password: input type=password name=vpassword size=8 maxlength=8brbr input type=submit value=\Register\input type=reset value=\Clear\ /form; /**/ html_footer(); ? --script (register_user.php)-- -- Jule Slootbeek [EMAIL PROTECTED] http://blindtheory.cjb.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] HUGE ERROR (was: [PHP] stupid error, please kick me (and sendme a solution))
ps: it was still not working.. -- Jule Slootbeek [EMAIL PROTECTED] http://blindtheory.cjb.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] HUGE ERROR (was: [PHP] stupid error, please kick me (andsend me a solution))
Please post: a) the error b) if the error is line #5, just post related lines line 4-6. I did see this: $result = mysql_query('$query', '$link_glob'); Which should be: $result = mysql_query($query, $link_glob); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] HUGE ERROR (was: [PHP] stupid error, please kick me (andsend me a solution))
Philip Olson wrote: Please post: a) the error b) if the error is line #5, just post related lines line 4-6. I did see this: $result = mysql_query('$query', '$link_glob'); Which should be: $result = mysql_query($query, $link_glob); OK that did fix the problem...:) I am now going to sit in a corner and be ashamed of myself thanks Philip and and everybody else... Jule -- Jule Slootbeek [EMAIL PROTECTED] http://blindtheory.cjb.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sablotron broken in 4.2.1 ?
hi I am using 4.2.1 and it works fine, I can't see your source code as web servers don't show it by design :) But from the error message it can't find your class file. I used the code below to test it. Tom $xsltproc = xslt_create(); $html = xslt_process($xsltproc, 'news.xml', 'news.xsl'); if (!$html) die('XSLT processing error: '.xslt_error($xsltproc)); xslt_free($xsltproc); echo $html; At 11:25 PM 3/06/2002 +0200, William S. wrote: Is Sablotron broken in 4.2.1 because none of the transformations have worked that I have tried. I am using: php 4.2.1 apache_1.3.24 expat-1.95.2 my files are: 'wget http://213.84.71.105/news.xml' 'wget http://213.84.71.105/news.xsl' 'wget http://213.84.71.105/news.php' If someone could tell me what to correct to make it right I would appreciate it. Note: Please disregard the content. It is copied from a site that I knew to be using XML with Sablotron and is not mine. -- Bill Amsterdam, NL -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Previous Next Navigation
Only querying the database once would result in you having to set a massive session, cookie, or something to hold the whole result in. Doesn't sound right to me... for starters, 3000 records / 30 per page = 100 pages... it seems unlikely that every user will make it through the 100 pages, so they (or the server) would be carrying around useless data. What you want to do is limit each query to 30 results on each page, using MySQL's LIMIT. SELECT FROM table WHERE something ORDER BY id LIMIT 0,30 (first page) SELECT FROM table WHERE something ORDER BY id LIMIT 30,60 (2nd page) etc. Justin French on 04/06/02 3:06 AM, Jay Blanchard ([EMAIL PROTECTED]) wrote: Howdy! I am working on a project where approximately 3k - 5k records are returned and need to be displayed 30 per page with 'previous' and 'next' navigation at the request of the users. Does anyone know of an efficient script that will do this in PHP (with MySQL) that will not query the database every time? I would like to place the records into an array after one query to the database and then navigate the array...both for efficiency and speed. Anyhow, if anyone knows, please let me know. Otherwise I will have to write what I am looking for, and I really have no desire to re-invent the whell on a Monday afternoon. TIA! Jay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Previous Next Navigation
If you don't want to query the database again, you could always write the results to a file. There's a matter of cleaning up old cache files though, but that's not what was asked... ;D -Original Message- From: Justin French [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 04, 2002 11:40 AM To: Jay Blanchard; [EMAIL PROTECTED] Subject: Re: [PHP] Previous Next Navigation Only querying the database once would result in you having to set a massive session, cookie, or something to hold the whole result in. Doesn't sound right to me... for starters, 3000 records / 30 per page = 100 pages... it seems unlikely that every user will make it through the 100 pages, so they (or the server) would be carrying around useless data. What you want to do is limit each query to 30 results on each page, using MySQL's LIMIT. SELECT FROM table WHERE something ORDER BY id LIMIT 0,30 (first page) SELECT FROM table WHERE something ORDER BY id LIMIT 30,60 (2nd page) etc. Justin French on 04/06/02 3:06 AM, Jay Blanchard ([EMAIL PROTECTED]) wrote: Howdy! I am working on a project where approximately 3k - 5k records are returned and need to be displayed 30 per page with 'previous' and 'next' navigation at the request of the users. Does anyone know of an efficient script that will do this in PHP (with MySQL) that will not query the database every time? I would like to place the records into an array after one query to the database and then navigate the array...both for efficiency and speed. Anyhow, if anyone knows, please let me know. Otherwise I will have to write what I am looking for, and I really have no desire to re-invent the whell on a Monday afternoon. TIA! Jay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] MacOSX / php.ini newbie question
Hi Apologies in advance if this question is simple. I haven't been able to find an answer... Is there no php.ini file in a php 4.1.2 install on MacOSX 10.1.4 (client not server) ? My php info/test page says that the path to the configuration file (php.ini) file is '/usr/lib', but it is not there (or anywhere else according to locate) Is this a file I can create myself or is there an example to be had somewhere? TIA, verdon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MacOSX / php.ini newbie question
Verdon, I'm a fellow PHP'er on Mac OS X (Server) 10.1.4. : ) You need to download the full distribution from php.net/downloads ... In there you will find a php.ini-dist file and php.ini-recommended file. Pick one that you like, edit as needed with BBEdit Lite (NOT TextEdit!), rename to php.ini and upload to /usr/lib. Restart Apache, and the newly installed php.ini file will be read in at that time. Good luck! -Clay From: Verdon Vaillancourt [EMAIL PROTECTED] Date: Mon, 03 Jun 2002 21:15:27 -0400 To: [EMAIL PROTECTED] Subject: [PHP] MacOSX / php.ini newbie question Hi Apologies in advance if this question is simple. I haven't been able to find an answer... Is there no php.ini file in a php 4.1.2 install on MacOSX 10.1.4 (client not server) ? My php info/test page says that the path to the configuration file (php.ini) file is '/usr/lib', but it is not there (or anywhere else according to locate) Is this a file I can create myself or is there an example to be had somewhere? TIA, verdon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] MacOSX / php.ini newbie question
have you tried doing a general search for that file? ie search all of ur hdd ... -Original Message- From: Verdon Vaillancourt [mailto:[EMAIL PROTECTED]] Sent: Tuesday, 4 June 2002 11:15 AM To: [EMAIL PROTECTED] Subject: [PHP] MacOSX / php.ini newbie question Hi Apologies in advance if this question is simple. I haven't been able to find an answer... Is there no php.ini file in a php 4.1.2 install on MacOSX 10.1.4 (client not server) ? My php info/test page says that the path to the configuration file (php.ini) file is '/usr/lib', but it is not there (or anywhere else according to locate) Is this a file I can create myself or is there an example to be had somewhere? TIA, verdon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_select_db problem
I use the following code for connection and selecting databases: $link = mysql_pconnect(localhost,$_SESSION['dbauser'],$_SESSION['dbapassword']) or die(Could not connect); print Connected successfullyP; mysql_select_db(stamps) or die(Could not select database); This works. Regards Peter Goggin - Original Message - From: PossumPal [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, June 03, 2002 4:40 AM Subject: [PHP] mysql_select_db problem Hi, I'm a newbie, so please have mercy on my silliness... I've checked my formats, and can't seem to understand why I can connect to the db, but not select the db that I want to use. The following code always returns the Couldn't select database error. If I use the mysql monitor, I can select the database directly without any problems. Could someone point out what I'm missing? ? $db_name=mydb; $table_name=my_table; $connection = @mysql_connect(localhost, user, password) or die (Couldn't connect.); $db = @mysql_select_db($db_name) or die (Couldn't select database); ? Regards, Carol -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_select_db problem
The following code always returns the Couldn't select database error. ? $db_name=mydb; $table_name=my_table; $connection = mysql_connect(localhost, user, password) or die (Couldn't connect.); $db = mysql_select_db($db_name) or die (Couldn't select database); ? Add some useful debugging: if (!$conn = mysql_connect($host, $user, $pass)) { print Cannot connect to DB : . mysql_error(); exit; } if (!@mysql_select_db($dbname)) { print Cannot select DB ($dbname) : . mysql_error(); exit; } The key here is mysql_error(). You could also use this function within your 'or die()' but personally I frown upon using 'or' like this, it's rather limiting. In the above, we are checking if the function returns false and if it does we do stuff, like print mysql_error() and exit the script. Do as you wish. On a related note, if you removed the '' from your code, odds are it'd shout an error too. '' can be useful for supressing errors so we can implement our own form of error management/trapping, like in the above. Regards, Philip Olson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_select_db problem
oops, i forgot a for mysql_connect() but oh well, you get the point :) Regards, Philip Olson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP-Windows2000 Server-Apache/Tomcat
On Mon, Jun 03, 2002 at 02:04:47PM -0700, Rick Kalifa wrote: I'm having trouble getting the PHP module installed on the Apache/Tomcat installation. I've set it up as a service. The documentation mentions editing the httpd.conf file but I cannot find that file with this installation. The only thing that I can find to configure the server is the server.xml... First, I see you're having problems setting line wrapping in Lookout Express. Be polite and set it to approximately 77 characters per line. So, you say you installed Jakarta Tomcat(http://jakarta.apache.org/). What's the full path to the location install it in? Now, do realize, the Apache HTTP Server, which uses the httpd.conf file (among others) for configuration is a WHOLE DIFFERENT THING (http://httpd.apache.org/). Did you actually install that? If so, what's the full path to the location you placed that? --Dan -- PHP classes that make web design easier SQL Solution | Layout Solution | Form Solution sqlsolution.info | layoutsolution.info | formsolution.info T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] ftp functions
Hi, I was just wondering given that only the standard FTP functions are supported by PHP, is there anyway to actually resume a download? The only thing that seems even capable of issuing any versatile commands is ftp_site, and that only issues site commands. I haven't had much luck with creating a socket connection to the server, and initiating the transfer that way. It has problems even logging in when I was testing it - not very promising. Any help/pointers would be appreciated, thanks Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Cronjob security
I'm using the following cronjob in my remote server: MAILTO=[EMAIL PROTECTED] 0 0 * * * wget -Ofile.log -q -T10 http://www.domain.com/script.php /dev/null the script.php is a normal php script. This is the only way I can run a cronjob successfully but I've read it is un-secure. Is this true? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Cronjob security
Sire: On Mon, Jun 03, 2002 at 11:47:50PM -0400, Edgard Berendsen wrote: I'm using the following cronjob in my remote server: MAILTO=[EMAIL PROTECTED] 0 0 * * * wget -Ofile.log -q -T10 http://www.domain.com/script.php /dev/null This is the only way I can run a cronjob successfully... If you don't have PHP as a stand alone binary, that's right. ... but I've read it is un-secure. Is this true? Depends. What happens if I go to that URI and try to run the script? If it would cause problems, then yes, it's insecure. If it doesn't matter, than no, it's not. So, what would happen if I hit your script with my web browser? --Dan -- PHP classes that make web design easier SQL Solution | Layout Solution | Form Solution sqlsolution.info | layoutsolution.info | formsolution.info T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] stupid error, please kick me (and send me a solution)
Please note that this only neccesarily applies to MySQL. I've run into a lot of problems by assuming double-quote syntax with postgres and mssql. A better solution is to stop writing your own queries and use an abstraction library. Cheers, Brad Sqlcoders.com Programming Dept wrote: Hiya, You're using single quotes around all your strings, for variables to be replaced with their values, you must use double quotes. Try replacing every ' with . HTH, Dw Sqlcoders.com Dynamic data driven web solutions - Original Message - From: Jule Slootbeek [EMAIL PROTECTED] To: mysql [EMAIL PROTECTED]; php-general [EMAIL PROTECTED] Sent: June 03 2002 03:09 PM Subject: [PHP] stupid error, please kick me (and send me a solution) Hey guys, i'm getting this error with the following sql script using php: --error-- Warning: Supplied argument is not a valid MySQL-Link resource in /var/www/phpquiz/register_user.php on line 12 --error-- --script-- $link_glob = mysql_connect('$host_glob', '$un_glob', '$pw_glob'); $query = INSERT INTO user values('0', '$fname', '$lname', '$email', '$username', PASSWORD('$password'); $result = mysql_db_query('$db_glob', '$query', $link_glob'); if (!$result) { echo font size=+1Your Information could not be entered into the database, Please contact the a href=mailto:$webmasterwebmaster/a./fontbrbr . mysql_errno() . : . mysql_error() . brbr; } else { echo font size=+1Your Information has successfully been entered into the database!/fontbr; -- Jule Slootbeek [EMAIL PROTECTED] http://blindtheory.cjb.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] email attachments and PHP
Hi all, I was wondering if there is a way to attach files to emails sent via a PHP script. I just checked the 'mail functions' chapter of the php manual, but it doesn't seem to mention attachments. The attached files will come from the same server that php is running on BTW. Thanks in advance. Brad Nel vino la verità, nella birra la forza, nell'acqua i bacilli -- In wine there is truth, in beer there is strenght, in water there are bacteria -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP can access the access database ??
php can access the microsoft access database ? what command the connection ? Roy Daniel , ST IT Developer System - PT BERCA COMPUTEL My E-mail : [EMAIL PROTECTED] and : [EMAIL PROTECTED] / [EMAIL PROTECTED] My ICQNumber : # 103507581 My Phone Cell : 0816-1192832 My Web site: http://www22.brinkster.com/roydaniel/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: email attachments and PHP
Check out: http://www.phpguru.org/mime.mail.html Works well... some good examples included. -J On Tue, 04 Jun 2002 17:09:12 +1200, Brad Wright wrote: Hi all, I was wondering if there is a way to attach files to emails sent via a PHP script. I just checked the 'mail functions' chapter of the php manual, but it doesn't seem to mention attachments. The attached files will come from the same server that php is running on BTW. Thanks in advance. Brad Nel vino la verità, nella birra la forza, nell'acqua i bacilli -- In wine there is truth, in beer there is strenght, in water there are bacteria -- Jason Morehouse ([EMAIL PROTECTED]) Netconcepts LTD - Auckland, New Zealand * Linux: Because rebooting is for adding hardware. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP can access the access database ??
On Tue, Jun 04, 2002 at 12:00:49PM +0700, [EMAIL PROTECTED] wrote: php can access the microsoft access database ? what command the connection Look at the ODBC functions in the manual. --Dan -- PHP classes that make web design easier SQL Solution | Layout Solution | Form Solution sqlsolution.info | layoutsolution.info | formsolution.info T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: email attachments and PHP
Or, if you're into doing it yourself, have a look at RFC2045 and RFC2046 http://rfc.sunsite.dk/rfc/rfc2045.html http://rfc.sunsite.dk/rfc/rfc2046.html -Original Message- From: Jason Morehouse [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 04, 2002 3:16 PM To: [EMAIL PROTECTED] Subject: [PHP] Re: email attachments and PHP Check out: http://www.phpguru.org/mime.mail.html Works well... some good examples included. -J On Tue, 04 Jun 2002 17:09:12 +1200, Brad Wright wrote: Hi all, I was wondering if there is a way to attach files to emails sent via a PHP script. I just checked the 'mail functions' chapter of the php manual, but it doesn't seem to mention attachments. The attached files will come from the same server that php is running on BTW. Thanks in advance. Brad Nel vino la verità, nella birra la forza, nell'acqua i bacilli -- In wine there is truth, in beer there is strenght, in water there are bacteria -- Jason Morehouse ([EMAIL PROTECTED]) Netconcepts LTD - Auckland, New Zealand * Linux: Because rebooting is for adding hardware. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: email attachments and PHP
Another really good one: http://phpmailer.sourceforge.net/ -Clay From: Jason Morehouse [EMAIL PROTECTED] Organization: Netconcepts LTD Date: Tue, 04 Jun 2002 17:15:58 +1200 To: [EMAIL PROTECTED] Subject: [PHP] Re: email attachments and PHP Check out: http://www.phpguru.org/mime.mail.html Works well... some good examples included. -J On Tue, 04 Jun 2002 17:09:12 +1200, Brad Wright wrote: Hi all, I was wondering if there is a way to attach files to emails sent via a PHP script. I just checked the 'mail functions' chapter of the php manual, but it doesn't seem to mention attachments. The attached files will come from the same server that php is running on BTW. Thanks in advance. Brad Nel vino la verità, nella birra la forza, nell'acqua i bacilli -- In wine there is truth, in beer there is strenght, in water there are bacteria -- Jason Morehouse ([EMAIL PROTECTED]) Netconcepts LTD - Auckland, New Zealand * Linux: Because rebooting is for adding hardware. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How can I call C or FORTRAN functions from PHP?
I have many useful functions written in C language. But now, I want to do some work on through Web browser. Can I call these C functions from PHP? -- Í·ÉÏÓÐÐÇ, ½ÅÏÂÓз ¡ï¡î¡î¡î¡î¡ï¡î¡î¡î¡î¡ï -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How can I call C or FORTRAN functions from PHP?
yep - I can see two ways of doing it - either using exec()/system() or compile the c/fortran code into a library file (.dll or .so depending on server type) and, in php, use dl() -Original Message- From: Cui Chenzhou [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 04, 2002 3:56 PM To: [EMAIL PROTECTED] Subject: [PHP] How can I call C or FORTRAN functions from PHP? I have many useful functions written in C language. But now, I want to do some work on through Web browser. Can I call these C functions from PHP? -- Í·ÉÏÓÐÐÇ, ½ÅÏÂÓз ¡ï¡î¡î¡î¡î¡ï¡î¡î¡î¡î¡ï -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php