[PHP] MySQL Access
Can anyone suggest a strategy for importing data from MySQL to Access (it sucks I know, but I have to do it for my work). I was thinking of using a text-delimited file as an intermediate, but I am not quite sure on the logistics. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: MySQL Access
Christian Calloway wrote: Can anyone suggest a strategy for importing data from MySQL to Access (it sucks I know, but I have to do it for my work). I was thinking of using a text-delimited file as an intermediate, but I am not quite sure on the logistics. You can use the Mysql-ODBC driver, which can be downloaded from www.mysql.com, and then import the tables with access Grtz Erwin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] RE: redefining a function
how about http://www.php.net/manual/en/language.oop.php To be honest I can't remember what made classes first click for me but feel free to ask if there's anything there that you don't get. Classes and OOP seem self evident when you've been using them for a while but I seem to remember that that isn't always the case at first. Tim -Original Message- From: David T-G [mailto:[EMAIL PROTECTED]] Sent: 19 September 2002 17:13 To: PHP General list Cc: Tim Ward Subject: Re: redefining a function Tim, et al -- ...and then Tim Ward said... % % is using classes an option? I don't know. I suppose I need to learn about classes :-) Where do I start? % % Tim Ward % www.chessish.com TIA HAND :-D -- David T-G * It's easier to fight for one's principles (play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie (work) [EMAIL PROTECTED] http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] RE: PHP source code
then keep this info in a config file off root and use a data abstraction class to connect. Tim www.chessish.com -Original Message- From: Oliver Witt [mailto:[EMAIL PROTECTED]] Sent: 19 September 2002 19:15 To: [EMAIL PROTECTED]; Stephan Seidt Subject: Re: PHP source code Stephan Seidt schrieb: On Thu, 19 Sep 2002 16:50:16 +0200 [EMAIL PROTECTED] (Oliver Witt) wrote: Hi, Is there any way to read php source code? I didn't think so until I heard about people you have done that... Kind regards, Oliver If you mean php's source, download it ;) Well, but if I write a script with MySQl, there has to be my user name and password in the source code. If anybody could read it, anybody could have access to my databases! Oliver -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Unserialize stopped working after php db upgrade
Martin, MT If you're using serialised variables, I'd suggest serialising a MTfew simple ones and see what the output looks like so that you can MTsee when things are going amiss. An interesting suggestion. I have a set and forget data api which handles all these transformations in the background. So it is probably a year since I looked at a serialized string. Which meant that when I introduced a bug that sometimes double-serialized the string, I was at a loss about how to diagnose the problem. I will take your suggestion and become more familiar with the guts of the serialized string. Thanks again for helping out... -- Geoff Caplan Advantae Ltd mailto:[EMAIL PROTECTED] http://www.advantae.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Almost done with install under Linux
Hi all, Forgive me for making this off topic question here, but since I need to install PHP under Linux tonight and came across this problem, I guess some one from here can help me. I need my Red Hat 7.2 to read the contents of all my FAT32 partitions in order to transfer the PHP packages. If any one (awake) knows the answer or have the solution, please e-mail me privately to keep this things off the list. Thanks in advance, César Aracena On Dial-Up
[PHP] Sessions
Hi all, I'm having a problem with sessions. I use PHP version 4.2.2. The project I'm working on, only uses the global variables, $_GET, $_POST and $_SESSION. When I store something in the $_SESSION variable, everything goes well. I can print the contents of this array with print_r, and every variable I stored is there. But when I leave the page with the header(...) directive (or any other way), the session is empty! The session file contains no data (so it is created!), the $_SESSION variable is empty... Some extra information: - I've tried this on PHP 4.1.2, and that works OK - I've tried output_buffering (on and off) - I've tried registered_globals (on and off) - I've tried using session_write_close() before leaving the page - I've checked the session_start() statement (Yes, it's there :-) ) I hope someone can help me with this... Thanks in advance, Erwin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Changing the saturation of an image
I've looked through the docs but can't find what I want. Is there a function that will let me load a jpg image, change the saturation level and save the changed image as a new jpg? Jc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] HTML 2 TEXT
Does anybody know of a class or a solution to converting an HTML page to a text only page via PHP, but leaving in href links in and a certain degree of formatting. Cheers, Tim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: MySQL Access
In article [EMAIL PROTECTED], [EMAIL PROTECTED] says... Can anyone suggest a strategy for importing data from MySQL to Access (it sucks I know, but I have to do it for my work). I was thinking of using a text-delimited file as an intermediate, but I am not quite sure on the logistics. Google is your friend. Try http://www.google.co.nz/search?q=convert+access+to+mysql -- David Robley Temporary Kiwi! Quod subigo farinam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is php even right for this design?
William wrote: 1) Payroll apps require large tax libraries (federal, every state and locality). Split them into more files (diffrent states etc.) and include_once them when they are needed, and perhaps mysql can take part of the job. 4)Loosely Typed Variables. I fear it might be to simple in PHP to have a dollar amount converted to a string and become rounded or truncated, because php's loose type. This might be a smaller issue than I think? Is there a way to strictly enforce types/conversions so my numerics stay numerics? The issue is with floating point numbers, I encourage you to do the calculations in cents and round up when needed. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] HTML 2 TEXT
Try to remove all strings starting with and ending with . Be sure not to remove A href ... /A's. Also you need to format line endings via \n or BR. it might seem a little bit hard, but any other solution won't work rather than this. Tim Haynes wrote: Does anybody know of a class or a solution to converting an HTML page to a text only page via PHP, but leaving in href links in and a certain degree of formatting. Cheers, Tim -- Vehbi Sinan Tunalioglu * email : [EMAIL PROTECTED]* * email : [EMAIL PROTECTED] * * email : [EMAIL PROTECTED] * -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: HTML 2 TEXT
Feel free to use strip_tags() -- Nicos - CHAILLAN Nicolas [EMAIL PROTECTED] www.WorldAKT.com - Hébergement de sites Internet Tim Haynes [EMAIL PROTECTED] a écrit dans le message de news: [EMAIL PROTECTED] Does anybody know of a class or a solution to converting an HTML page to a text only page via PHP, but leaving in href links in and a certain degree of formatting. Cheers, Tim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Click....download and update
The Content-Type header changes, when uploading, you can get it from $HTTP_POST_FILES['userfile']['type'], also set the filename using header(Content-Disposition: attachment; filename='. $filename ); Christian Ista wrote: You'll need to prompt the download by sending the appropriate headers. Something like.. a href=http://www.mydomain.com/downloadmyfile.phpDownload/a ? // downloadmyfile.php header(Content-Type: application/zip); header(Content-Disposition: attachment); readfile(file.zip); ? It's not only .zip file but may be .exe or .rar That's change something in your code ? I can put the code to update a database field in the downloadmyfile.php ? Bye -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Search system
Hi, Can someone point me to the documentation to make the same search system as php.net like www.php.net/lala that will search on the manual. Thanks. -- Nicos - CHAILLAN Nicolas [EMAIL PROTECTED] www.WorldAKT.com - Hébergement de sites Internet -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Search system
I found it at http://www.php.net/urlhowto.php Thanks anyway. -- Nicos - CHAILLAN Nicolas [EMAIL PROTECTED] www.WorldAKT.com - Hébergement de sites Internet [EMAIL PROTECTED] a écrit dans le message de news: [EMAIL PROTECTED] Hi, Can someone point me to the documentation to make the same search system as php.net like www.php.net/lala that will search on the manual. Thanks. -- Nicos - CHAILLAN Nicolas [EMAIL PROTECTED] www.WorldAKT.com - Hébergement de sites Internet -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] FPDF and MySQL
If you look at the tutorial no. 5 on www.fpdf.org, all you need is to change LoadData function, example: function LoadData($condition) { $res=mysql_query(SELECT * FROM table WHERE 1 AND ($condition)); while($data[]=mysql_fetch_row($res) ) { } return $data; } Chuck Payne wrote: Hi, I found a free pdfclass called FPDF http://www.fpdf.org, that I can use with PHP to create pdf files with. Before someone tells me Read The Manual, I have read their page and used Google to search for notes on how called mysql into a PDF and I am lost. Does anyone know where there is a tutorial. Thanks, Chuck Payne Magi Design and Support -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 20 Sep 2002 11:06:53 -0000 Issue 1596
php-general Digest 20 Sep 2002 11:06:53 - Issue 1596 Topics (messages 116944 through 116992): Re: pass var through URL String 116944 by: Gary Re: PHP Execution Timer 116945 by: Beau Hartshorne Re: Stripping specific tags 116946 by: John Holmes 116965 by: John Holmes 116966 by: Justin French Re: Loop through POST-result 116947 by: John Holmes php_mcrypt library 116948 by: [-^-!-%- fopen() 116949 by: Donahue Ben 116951 by: Brad Bonkoski 116957 by: Jason Morehouse Re: Encrypting/Decrypting Data 116950 by: Evan Nemerson java in php4 on debian testing distribution? 116952 by: Monique Y. Herman MUST READ: ALL MySQL Newbies! 116953 by: Shane custom user login 116954 by: Daniel Negron/KBE 116973 by: Ivo Re: adding unix account via system command 116955 by: tim tom Re: Good OO PHP resources? Open Source APIs? 116956 by: Michael Sims MySQL errors in newer PHP 4.2.3 116958 by: Steven Roussey 116959 by: Steven Roussey 116960 by: Jocelyn Fournier 116972 by: Zak Greant 116975 by: Jocelyn Fournier Re: session cookies 116961 by: Jeff Bluemel Access MySQL 116962 by: Liam MacKenzie 116963 by: Peter Houchin syntax question - eregi() 116964 by: Anthony Ritter 116967 by: Philip Hallstrom Script Modificaton question 116968 by: Tom Ray 116969 by: John Holmes 116970 by: Tom Ray Re: Need some help please. 116971 by: Simon Angell Re: Apache not parsing without .php on url? 116974 by: Ivo MySQL Access 116976 by: Christian Calloway 116977 by: Erwin 116985 by: David Robley Re: redefining a function 116978 by: Tim Ward Re: PHP source code 116979 by: Tim Ward Re: Unserialize stopped working after php db upgrade 116980 by: Geoff Caplan Almost done with install under Linux 116981 by: César Aracena Sessions 116982 by: Erwin Changing the saturation of an image 116983 by: Jean-Christian Imbeault HTML 2 TEXT 116984 by: Tim Haynes 116987 by: SiTA WebMaster - VST 116988 by: nicos.php.net Re: Is php even right for this design? 116986 by: Marek Kilimajer Re: Clickdownload and update 116989 by: Marek Kilimajer Search system 116990 by: nicos.php.net 116991 by: nicos.php.net Re: FPDF and MySQL 116992 by: Marek Kilimajer Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] -- ---BeginMessage--- I was wrong, it is passing $bname. I have got it down to a syntax error by using. $sql = SELECT * FROM bugs WHERE bname = {$_GET['bname']}; gary Gary wrote: I don't think it is being passed. I think I am going to have to figure out how to pass bname in the link using pear.With pear bnname=0 while ($row = $res-fetchRow()){ $bname = $row[0]; $owner = $row[1]; echo lia href=\temp_page.php?bname=$bname\$bname/a by $ownerli ; } Gary Kevin Stone wrote: There's obviously something wrong with the way you're handeling the new variable. Do extract($_GET); and go back to the way you were handeling it before. echo $bname; -Kevin ---End Message--- ---BeginMessage--- This function: function getmicrotime() { list($usec, $sec) = explode( ,microtime()); return ((float)$usec + (float)$sec); } is provided on this page: http://www.php.net/manual/en/function.microtime.php and is needed for the code below to work properly. Beau ? $timerOn = 1; // set to 0 if you want to turn it off $timestart = getmicrotime(); ? Bottom: ? if($timerOn) { $timeend = getmicrotime(); $timer = $timeend - $timestart; echo timer: $timer; } ? Similar things could be done with MySQL quereies, but I haven't looked into it. Justin French -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ---End Message--- ---BeginMessage--- I was wondering is there a way to strip ONLY the tags that you specify from a page, rather than having to include all the tags you do want (using strip_tags() ) A regular expression or str_replace() would be best for this. Realize this isn't a good method, though. What if you're trying to strip images with an img tag, but a new spec comes out that allows image tags. Now you're not protected against it. That's a simple example, but it's a better policy to say X is good and allow it through, rather than to say, I know Y is bad, but I'll let everything else through and assume it's good. ---John Holmes... ---End
Re: [PHP] Apache not parsing without .php on url?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hey, I think what you're after is 'Options MultiViews' in your apache config.don't know about v2 though. http://httpd.apache.org/docs/mod/core.html#options HTH! ~Pauly On Thursday 19 September 2002 01:21 pm, Stefan wrote: Hello, I have a new Apache 2.0.40 with PHP 4.2.3 installation on a Solaris x86 box. Configered in httpd.conf with: AddType application/x-httpd-php .php and LoadModule Parsing url´s with .php works fine, but i can´t figure out why it dosen´t work if i leave out the .phpextension in the url? This works in my old apache 1 installation.! The file is named test.php in the abc directory. http://my.server.se/abc/test.php; works, but not http://my.server.se/abc/test; Any tips in what i missed out in configuration or how to fix this would be appreciated. best regards, Stefan - -- ~Paul Nicholson Design Specialist @ WebPower Design The webthe way you want it! [EMAIL PROTECTED] It said uses Windows 98 or better, so I loaded Linux! Registered Linux User #183202 using Register Linux System # 81891 -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE9iwjNDyXNIUN3+UQRAlJmAJ43X2Aitk+Qpo8wn1yjuqOr1SmW0wCgh5Z6 4AZvoaM6XP9gnE+7UJif+lA= =Nh4/ -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] about forms with php
Hi, I want to learn if anyone tried to use both of javasccript and php together ?Because when I tried to use them like this: form name=sign method=POST action=sign_up_.php onSubmit=checkemail(email.value);return false and when I click submit.. javascript is working but it is not going to the sign_up_ page ..How can I manage it?.. thanks alot.. by the way , by using javascript , I am checking if the email adress are written correctly ( '' ...).. thanks meltem -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
FW: [PHP] about forms with php
Hi, form name=sign method=POST action=sign_up_.php onSubmit=checkemail(email.value);return false and when I click submit.. javascript is working but it is not going to the sign_up_ page .. It's because of the return false: that means after running the checkemail function, cancel the form submission. I think you want to have your function return true or false depending on whether the email address is OK, and take the return out of the onsubmit handler. Don't forget to validate the email address on the server as well, otherwise people who turn off Javascript will be able to submit dodgy data. Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] about forms with php
Hi Meltem, Since you place return false in the onSubmit code, you cannot submit the form to the next page. What you need to do is that check if the email field is empty, if yes return false; if not return true. - Original Message - From: Meltem Demirkus [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, September 20, 2002 2:44 PM Subject: [PHP] about forms with php Hi, I want to learn if anyone tried to use both of javasccript and php together ?Because when I tried to use them like this: form name=sign method=POST action=sign_up_.php onSubmit=checkemail(email.value);return false and when I click submit.. javascript is working but it is not going to the sign_up_ page ..How can I manage it?.. thanks alot.. by the way , by using javascript , I am checking if the email adress are written correctly ( '@' ...).. thanks meltem -- 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] Date Concat?
I have two fields of type date in a MySQL table called training: start_date end_date I can format the date using a select, for example SELECT DATE_FORMAT(start_date, '%M %d, %Y') as start_date, DATE_FORMAT(end_date, '%M %d, %Y') as end_date FROM training This produces the following: start_date: September 16, 2002 end_date: Sepetember 20, 2001 Based on the above, I would like to echo out something like this: You will be in training September 16 - 20, 2002. Is this possible? Thanks in advance, Randy
[PHP] why isn
__ Post your free ad now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] about forms with php
but I also want to check @ and . characters.. ...checking only if the email field is empty or not is not what I want meltem - Original Message - From: Ferhat Can [EMAIL PROTECTED] To: Meltem Demirkus [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, September 20, 2002 2:49 PM Subject: Re: [PHP] about forms with php Hi Meltem, Since you place return false in the onSubmit code, you cannot submit the form to the next page. What you need to do is that check if the email field is empty, if yes return false; if not return true. - Original Message - From: Meltem Demirkus [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, September 20, 2002 2:44 PM Subject: [PHP] about forms with php Hi, I want to learn if anyone tried to use both of javasccript and php together ?Because when I tried to use them like this: form name=sign method=POST action=sign_up_.php onSubmit=checkemail(email.value);return false and when I click submit.. javascript is working but it is not going to the sign_up_ page ..How can I manage it?.. thanks alot.. by the way , by using javascript , I am checking if the email adress are written correctly ( '@' ...).. thanks meltem -- 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] why isn't this working?
This little code snippet is from a login system that I've made, which takes unconfirmed user-info out of a mysql table, and places it into a confirmed table (Uses email confirmation). Now, this has really got me baffled, because it seemed to be working fine yesterday. Can anyone please tell me what's wrong with the following code? Your help will be greatly appreciated. //confirm and register new user, get info from unconfirmed_user and put it in user, then delete from unconfirmed_user function confirmNewUser ($confirm_new_user) { include '../config.php'; global $DB_INCLUDE; include $DB_INCLUDE; $user_wait = select * from unconfirmed_user where username='$confirm_new_user'; $user_result = mysql_db_query ($database, $user_wait, $link); while ($user_row = mysql_fetch_array($user_result)) { $insert_user = insert into user values (' ','$user_row[name]','$user_row[email_address]','$user_row[password]','$user_row[access]','$user_row[username]','$user_row[description]','$user_row[homepage]','$user_row[online]','$user_row[image]'); if (mysql_db_query ($database, $insert_user, $link)) { $Query2 = delete from unconfirmed_user where user_id='$row[user_id]'; if (mysql_db_query ($database, $Query2, $link)) { include $SERVER_ROOT.'admin/email.php'; mail($row[email_address], Welcome to .$SITE_NAME.,$mail_content,From: News Bomber.$SITE_DOMAIN ,Reply-To: Auto Mailer); print centerRegistration Completebr /br /\n; print Welcome to .$SITE_NAME., .$row[name].. br /To make a news post, you must first h4a href=\index.php\Login/a/h4br /br /A welcome email has been sent to your email address.br / Check this out for info of interest about News Bomber.\n; }else{ print centerRegistration Failed/center\n; } }else{ print centerRegistration Failed/center\n; } } } __ Post your free ad now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] about forms with php
by the way If I remove return false .. script is checking the correctness but just after it is going to the page sign_up_ page .php ..I just want it to go to the page when the email is correct .. Is it possible to manage ? meltem - Original Message - From: Jon Haworth [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, September 20, 2002 2:48 PM Subject: FW: [PHP] about forms with php Hi, form name=sign method=POST action=sign_up_.php onSubmit=checkemail(email.value);return false and when I click submit.. javascript is working but it is not going to the sign_up_ page .. It's because of the return false: that means after running the checkemail function, cancel the form submission. I think you want to have your function return true or false depending on whether the email address is OK, and take the return out of the onsubmit handler. Don't forget to validate the email address on the server as well, otherwise people who turn off Javascript will be able to submit dodgy data. Cheers Jon -- 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: syntax question - eregi()
Thank you. TR -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] about forms with php
Hi, by the way If I remove return false .. script is checking the correctness but just after it is going to the page sign_up_ page .php ..I just want it to go to the page when the email is correct .. Is it possible to manage ? Yes. You need to have the return true or return false in the javascript function that checks the email. function checkEmail(email) { // do the check however you like // create a variable called check // that's either true or false, // then do something like: if (check) { return true; } else { return false; } } HTH Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] about forms with php
-Original Message- From: Meltem Demirkus [mailto:[EMAIL PROTECTED]] Sent: 20 September 2002 13:03 by the way If I remove return false .. script is checking the correctness but just after it is going to the page sign_up_ page .php ..I just want it to go to the page when the email is correct .. Is it possible to manage ? Two options: (1) Leave your onSubmit as is, and put a form.submit in the checkemail function once you've validated the address. (2) Change the onSubmit to onSubmit=return checkemail(email.value) and have checkemail return true or return false according as it does or doesn't validate the email.value passed. Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: java in php4 on debian testing distribution?
Monique, By default Debian does not come come with a recent JVM, due to the non-free-ness of Sun's license. So first thing is to see if you have any Java installed at all... When you type `java` at a shell it should give you an error about missing parameters... if you get the following: bash: java: command not found then you need to install a Java package for PHP4 to work with. The most useful Java package for Debian, is blackdown.org's non-free port of Java, do the following to get it do the following: to /etc/apt/sources.list add: # JDK -- mirrors http://www.blackdown.org/java-linux/mirrors.html deb http://www.mirror.ac.uk/sites/ftp.blackdown.org/ja va-linux/debian woody non-free then run: apt-get update; apt-get install j2sdk1.3 Once you've installed Blackdown's port of Java, your java.home var should be set (you may have to log-in again or reload your profile to see it). good luck, -Garth - Monique Y. Herman - 19 Sep 2002 19:48:01 -0400 I'd like to play with using java classes from within php, as is described in http://www.php.net/manual/en/ref.java.php ... I'm using the apache and php4 packages from the debian testing distribution. All of the documentation I've found on the web about installing the java extension seems to be oriented toward windows, making me think that maybe I don't need to specify an extension library on linux? I tried simply using ini_set (java.home, /usr/local/sun-j2sdk1.4.1); $systemInfo = new Java(java.lang.System); and got the following: Fatal error: Cannot instantiate non-existent class: java That seems fairly straightforward: My php doesn't know java from adam. So my questions are: Do I need to get an extension library for this functionality on linux? If not, does anyone know of a debian package of php4 that will give me this capability? I rather like being able to use packages wherever possible. Thanks in advance for any insight! -- monique -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Best practice question
-Original Message- From: Jon Haworth [mailto:[EMAIL PROTECTED]] Sent: 19 September 2002 18:18 What are peoples' thoughts on one should always return a value from a function, even if it's always going to be true? Unprintable!! There's no point in returning a value if there's no sensible value to return. Confusion can arise because PHP uses function for what, in some other languages, are distinguished into functions (which must return a value) and subroutines (which cannot). Anyone insisting that a function must return a result have probably been exposed only (or primarily) to such languages ;-Z !! Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] getimagesize error
Please can somebody help my, why i get this errormessage: Warning: getimagesize: Unable to open '../images/2002/11/jpg/' for reading. in C:\Webverzeichnis\docs\living_sports\living_sports\lsadmin\includes\image.handling.inc.php on line 852 While the echo $name says winter.jpg f.x.: echo $name; $size = getimagesize($path_to_dir.$images.$year.$month.$source.$name); if ($size[0] $size[1]) { $faktor = ($size[1]/120); $newWidth = ($size[0]/$faktor); $command = 'convert -size 120x'.$newWidth.' '.$path_to_dir.$images.$year.$month.$source.$name.' -resize 120x'.$newWidth.' +profile * '.$path_to_dir.$images.$year.$month.$thumbs.$name; system($command); $Query = UPDATE bild_db SET thumb = '.$year.$month.$thumbs.$name.' WHERE bild_db.name = '.$name.'; mysql_query($Query,$connect) or die(mysql_error()); } else { $faktor = ($size[0]/120); $newHeight = ($size[1]/$faktor); $command = 'convert -size '.$newHeight.'x120 '.$path_to_dir.$images.$year.$month.$source.$name.' -resize '.$newHeight.'x120 +profile * '.$path_to_dir.$images.$year.$month.$thumbs.$name; system($command); $Query = UPDATE bild_db SET thumb = '.$year.$month.$thumbs.$name.' WHERE bild_db.name = '.$name.'; mysql_query($Query,$connect) or die(mysql_error()); } Please gimme a hint Sascha
[PHP] How to check for data on a popen()ed FD?
I'm running a program using popen(), and I need to know when there's data to be read from this program. feof() will never return true, even with no data to be read. Is there any function that can set a timeout on a file descriptor returned by popen()? Or a function like feof(), but to check if there's data to be read from a popen() file descriptor? What I'm doing here is running Crafty (a chess engine), from my PHP script, and I need to get input from the user on stdin and from Crafty. Any help is appreciated! Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] getimageresize error
I found out, that always when my script ist executed, one $HTTP_REQUEST_FILE is empty. so the scripts writes the pics where I want it and tries to convert one none existing file. But why? Sascha
RE: [PHP] Search system
[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] scribbled; Hi, Can someone point me to the documentation to make the same search system as php.net like www.php.net/lala that will search on the manual. http://www.php.net/urlhowto.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Date Concat?
I have two fields of type date in a MySQL table called training: start_date end_date I can format the date using a select, for example SELECT DATE_FORMAT(start_date, '%M %d, %Y') as start_date, DATE_FORMAT(end_date, '%M %d, %Y') as end_date FROM training This produces the following: start_date: September 16, 2002 end_date: Sepetember 20, 2001 Based on the above, I would like to echo out something like this: You will be in training September 16 - 20, 2002. SELECT CONCAT( 'You will be training ', DATE_FORMAT(start_date,'%M %d'), ' - ', IF(MONTH(start_date)!=MONTH(end_date), DATE_FORMAT(end_date,'%M %d'), DATE_FORMAT(end_date,'%d')), ' ', YEAR(end_date)) FROM training Another option would be to just select out the individual month, day, and year out of the database, instead of a formatted date. Or select out a unix_timestamp and use date() to extract the individual parts and create your string... ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Search system
[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] scribbled; I found it at http://www.php.net/urlhowto.php Thanks anyway. Crap I just sent this to the list, I need a better email client that sorts by thread and not just subject :/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Sessions
You have session_start() on the second page, too, right?? -Original Message- From: Erwin [mailto:[EMAIL PROTECTED]] Sent: Friday, September 20, 2002 5:45 AM To: [EMAIL PROTECTED] Subject: [PHP] Sessions Hi all, I'm having a problem with sessions. I use PHP version 4.2.2. The project I'm working on, only uses the global variables, $_GET, $_POST and $_SESSION. When I store something in the $_SESSION variable, everything goes well. I can print the contents of this array with print_r, and every variable I stored is there. But when I leave the page with the header(...) directive (or any other way), the session is empty! The session file contains no data (so it is created!), the $_SESSION variable is empty... Some extra information: - I've tried this on PHP 4.1.2, and that works OK - I've tried output_buffering (on and off) - I've tried registered_globals (on and off) - I've tried using session_write_close() before leaving the page - I've checked the session_start() statement (Yes, it's there :-) ) I hope someone can help me with this... Thanks in advance, Erwin -- 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] adding unix account via system command
tim tom mailto:[EMAIL PROTECTED] scribbled; Dear Marek, Where do find that? I am no C programmer. -- tim --- Marek Kilimajer [EMAIL PROTECTED] wrote: It's a shell script, and your shell drops root privileges. Use a shell that doesn't or use a C-wraper. Make yourfile.c and put this in: main(argc,argv) int argc; char **argv; { execv(/your/program/here, argv); } then cc -o yourfile yourfile.c chown root.root yourfile chmod 4755 yourfile this will make it rwsr-xr-x -jesse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP source code
Michael Geier schrieb: PHP Source code is only available on the server, and will never be shown to the client (unless you create a tool to allow them to see the source; see show_source() ); And you can always put your authentication data (username/passwords) in an external include() file auth.inc: ? $username = foo; $password = bar; ? page.php: ? include ('[secure directory outside of web tree]/auth.inc'); mysql_connect(dbname,$username,$password); ? of course, if you are on a shared-host web server (multiple clients on the same server), you are only as secure as the weakest idiot that configures/administrates the server, IMHO. Won't the server ask for authorization if the included PHP script is in an directory accessible with .htaccess-Authorization? Oliver -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sessions
John Holmes wrote: You have session_start() on the second page, too, right?? Yes...the session_start() statement is in a global include file, which is included in all files which require it Grtz Erwin -Original Message- From: Erwin [mailto:[EMAIL PROTECTED]] Sent: Friday, September 20, 2002 5:45 AM To: [EMAIL PROTECTED] Subject: [PHP] Sessions Hi all, I'm having a problem with sessions. I use PHP version 4.2.2. The project I'm working on, only uses the global variables, $_GET, $_POST and $_SESSION. When I store something in the $_SESSION variable, everything goes well. I can print the contents of this array with print_r, and every variable I stored is there. But when I leave the page with the header(...) directive (or any other way), the session is empty! The session file contains no data (so it is created!), the $_SESSION variable is empty... Some extra information: - I've tried this on PHP 4.1.2, and that works OK - I've tried output_buffering (on and off) - I've tried registered_globals (on and off) - I've tried using session_write_close() before leaving the page - I've checked the session_start() statement (Yes, it's there :-) ) I hope someone can help me with this... Thanks in advance, Erwin -- 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] Sessions
I've had the same problem, and I resolved it by using html tags instead of headers, and the problem was resolved. there are some issues I still haven't been able to work out though (I want it to use cookies instead of SID's). John Holmes [EMAIL PROTECTED] wrote in message 001b01c260a7$cc6744c0$b402a8c0@mango">news:001b01c260a7$cc6744c0$b402a8c0@mango... You have session_start() on the second page, too, right?? -Original Message- From: Erwin [mailto:[EMAIL PROTECTED]] Sent: Friday, September 20, 2002 5:45 AM To: [EMAIL PROTECTED] Subject: [PHP] Sessions Hi all, I'm having a problem with sessions. I use PHP version 4.2.2. The project I'm working on, only uses the global variables, $_GET, $_POST and $_SESSION. When I store something in the $_SESSION variable, everything goes well. I can print the contents of this array with print_r, and every variable I stored is there. But when I leave the page with the header(...) directive (or any other way), the session is empty! The session file contains no data (so it is created!), the $_SESSION variable is empty... Some extra information: - I've tried this on PHP 4.1.2, and that works OK - I've tried output_buffering (on and off) - I've tried registered_globals (on and off) - I've tried using session_write_close() before leaving the page - I've checked the session_start() statement (Yes, it's there :-) ) I hope someone can help me with this... Thanks in advance, Erwin -- 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] adding unix account via system command
!!!WARNING - WARNING - WARNING - WARNING - WARNING!!! This will mean ANYONE can run this program AS ROOT. Read up on SUID. !!!WARNING - WARNING - WARNING - WARNING - WARNING!!! Make yourfile.c and put this in: main(argc,argv) int argc; char **argv; { execv(/your/program/here, argv); } then cc -o yourfile yourfile.c chown root.root yourfile chmod 4755 yourfile this will make it rwsr-xr-x -- Dan Hardiker [[EMAIL PROTECTED]] ADAM Software Systems Engineer First Creative Ltd -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] HTML 2 TEXT
There's a perfect example in the manual: http://www.php.net/manual/en/function.preg-replace.php HTH Justin on 20/09/02 9:16 PM, SiTA WebMaster - VST ([EMAIL PROTECTED]) wrote: Try to remove all strings starting with and ending with . Be sure not to remove A href ... /A's. Also you need to format line endings via \n or BR. it might seem a little bit hard, but any other solution won't work rather than this. Tim Haynes wrote: Does anybody know of a class or a solution to converting an HTML page to a text only page via PHP, but leaving in href links in and a certain degree of formatting. Cheers, Tim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Closing a browser's child window after user downloads a file
All, I have a page that displays results of a database search. The page contains a select dropdown box from which the user can pick different options including the ability to download an Excel or CSV file of the displayed results. Once the user selects an option from the dropdown, a Javascript onchange method will kick in, submit the form and process the selected option. If the option is one of the file download choices, then using Javascript a new, child window will be opened and the location of the child will be the PHP download script with the file to download. The script in the child window will force the browser's download dialog box to open up at which point the user can save, open, or cancel the file download. The issue that I have is that some browsers (IE6) will automatically close the child window when the user has made a selection from the download dialog box while other browsers (Mozilla) will leave the child window remaining open. I need to either come up with a way to close the child window once the user has finsished with the download dialog or force the download script to not run in a child window. I've thought about applying a timer somewhere but this isn't reliable because of the unknowns of file download time and user response time to the download dialog. I don't have a preference as to whether the solution is all PHP based, all Javascript, or a mix of both -- I just need a solution to close this child window when complete. Code is below. As usual, thanks in advance. Dave Merritt [EMAIL PROTECTED] Javascript code from the parent search results window opening the child window calling the PHP download script: ... SCRIPT type= text/javascript language=JavaScript !-- DownloadWindow = window.open(../functions/download.php/?Filename=?echo $Filename?, Download, toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars=0, resizable=0, copyhistory=0, width=200, height=200); //-- /SCRIPT ... download.php: if (isset($_GET['Filename'])) { if ( $_GET['Filename'] != '' ) { $Filename = $_GET['Filename']; header(Content-Disposition: inline; filename= . basename($Filename)); header(Content-Type: application/octet-stream); header(Content-Type: application/force-download); header(Content-Type: application/download); header(Content-Transfer-Encoding: binary); header(Content-Length: . filesize($Filename)); header(Pragma: public); header(Expires: 0); header(Cache-Control: must-revalidate, post-check=0, pre-check=0); readfile($Filename); } } ** Any views, opinions or authorizations contained in this email are solely those of the author and do not necessarily represent those of ArvinMeritor, Inc. If you are not familiar with the corporate authority of the author, please obtain confirmation in writing of the content of this email prior to taking any action on the basis of the information. If you are not the intended recipient, you are hereby notified that any disclosure, copying or distribution of the information enclosed is strictly prohibited. ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] HTML 2 TEXT
strip_tags() is the easiest way to remove HTML tags. If he wants to replace them, then he can use ereg_replace or preg_replace(). -- Nicos - CHAILLAN Nicolas [EMAIL PROTECTED] www.WorldAKT.com - Hébergement de sites Internet Justin French [EMAIL PROTECTED] a écrit dans le message de news: [EMAIL PROTECTED] There's a perfect example in the manual: http://www.php.net/manual/en/function.preg-replace.php HTH Justin on 20/09/02 9:16 PM, SiTA WebMaster - VST ([EMAIL PROTECTED]) wrote: Try to remove all strings starting with and ending with . Be sure not to remove A href ... /A's. Also you need to format line endings via \n or BR. it might seem a little bit hard, but any other solution won't work rather than this. Tim Haynes wrote: Does anybody know of a class or a solution to converting an HTML page to a text only page via PHP, but leaving in href links in and a certain degree of formatting. Cheers, Tim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Why isn't there much info on apache2?
I'm building a new server and would like to use: php4 apache 2.xxx mod_ssl MySQL mod_perl Is there any major hurdle? Thanks Pierre B. Samson CAMBAR -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Why isn't there much info on apache2?
Yeah, apache 2.0 and php don't like each other. Adam On Fri, 20 Sep 2002, pierre.samson wrote: I'm building a new server and would like to use: php4 apache 2.xxx mod_ssl MySQL mod_perl Is there any major hurdle? Thanks Pierre B. Samson CAMBAR -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Why isn't there much info on apache2?
Any particular reason... future plans or is apache2 is not worthy? Adam Williams [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Yeah, apache 2.0 and php don't like each other. Adam On Fri, 20 Sep 2002, pierre.samson wrote: I'm building a new server and would like to use: php4 apache 2.xxx mod_ssl MySQL mod_perl Is there any major hurdle? Thanks Pierre B. Samson CAMBAR -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Why isn't there much info on apache2?
The PHP coders are still working to have full compatability with apache 2.0. I know for example posting one variable in a form messes up, but posting 2 or more variables works fine. There is a entry n the bug database about this, so hopefully it will be fixed soon. Adam On Fri, 20 Sep 2002, pierre.samson wrote: Any particular reason... future plans or is apache2 is not worthy? Adam Williams [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Yeah, apache 2.0 and php don't like each other. Adam On Fri, 20 Sep 2002, pierre.samson wrote: I'm building a new server and would like to use: php4 apache 2.xxx mod_ssl MySQL mod_perl Is there any major hurdle? Thanks Pierre B. Samson CAMBAR -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Querying from PHP to a MySQL database
Howdy all! I've built a page in Dreamweaver MX that uses PHP for scripting. I can get data out of my mysql database but I need to be able to search for wildcards. currently it only matches 100% exact queries. Below is the code that is at the beggining of the PHP page. --- $varSort_search1 = %; if (isset($HTTP_POST_VARS[Sort])) { $varSort_search1 = (get_magic_quotes_gpc()) ? $HTTP_POST_VARS[Sort] : addslashes($HTTP_POST_VARS[Sort]); } $varText_search1 = %; if (isset($HTTP_POST_VARS[Text])) { $varText_search1 = (get_magic_quotes_gpc()) ? $HTTP_POST_VARS[Text] : addslashes($HTTP_POST_VARS[Text]); } mysql_select_db($database_CATCH, $CATCH); $query_search1 = sprintf(SELECT * FROM secureworks WHERE %s LIKE '%s', $varSort_search1,$varText_search1); $search1 = mysql_query($query_search1, $CATCH) or die(mysql_error()); $row_search1 = mysql_fetch_assoc($search1); $totalRows_search1 = mysql_num_rows($search1); - Does anyone have any ideas? Thanks, John Cole, TCISA -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Is php even right for this design?
The admin users will need to run long processes that take about 5-15 minutes each. They cannot timeout and they must be done throughout the day while general users are working in the application as well. Is there a big problem with this? What steps should I take to ensure these long processes complete and do not timeout. What about turning these long processes into perl scripts or C programs that can be exec()ed? They'll probably run faster, and they won't time out. I've never done this myself. It's just a suggestion -- does it make sense to do it this way? Beau -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Why isn't there much info on apache2?
Apache 2 isn't officially supported yet. If you get the latest version of both then you shouldn't hit to many hurdles but you should know that you'll get no official support and it isn't recommended for production environments. If you need Apache2 then you'll know why - if you don't know what the advantages are, you'll probably be better off with Apache 1.3.26 anyway. Danny. - Original Message - From: pierre.samson [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, September 20, 2002 4:00 PM Subject: Re: [PHP] Why isn't there much info on apache2? Any particular reason... future plans or is apache2 is not worthy? Adam Williams [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Yeah, apache 2.0 and php don't like each other. Adam On Fri, 20 Sep 2002, pierre.samson wrote: I'm building a new server and would like to use: php4 apache 2.xxx mod_ssl MySQL mod_perl Is there any major hurdle? Thanks Pierre B. Samson CAMBAR -- 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] Is php even right for this design?
Beau Hartshorne wrote: The admin users will need to run long processes that take about 5-15 minutes each. They cannot timeout and they must be done throughout the day while general users are working in the application as well. Is there a big problem with this? What steps should I take to ensure these long processes complete and do not timeout. What about turning these long processes into perl scripts or C programs that can be exec()ed? They'll probably run faster, and they won't time out. I've never done this myself. It's just a suggestion -- does it make sense to do it this way? Best would be a PHP extension since it wouldn't need to be constantly reloaded :) Cheers, Rob. -- .-. | Robert Cummings | :-`. | Webdeployer - Chief PHP and Java Programmer | :--: | Mail : mailto:[EMAIL PROTECTED] | | Phone : (613) 731-4046 x.109 | :--: | Website : http://www.webmotion.com | | Fax : (613) 260-9545 | `--' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Why isn't there much info on apache2?
Adam Williams [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] e.ms.us... Yeah, apache 2.0 and php don't like each other. Adam On Fri, 20 Sep 2002, pierre.samson wrote: I'm building a new server and would like to use: php4 apache 2.xxx mod_ssl MySQL mod_perl Is there any major hurdle? mod_ssl is also incompatible with apache 2.x according to www.modssl.org Well, unless they hide the 2.x compatible version. Plus mod_perl as far as I know has completely changed, so if you have old mod_perl scripts they gotta convert. Start here: http://perl.apache.org/docs/2.0/user/overview/overview.html -jesse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Why isn't there much info on apache2?
Danny Shepherd mailto:[EMAIL PROTECTED] scribbled; Mod_ssl is part of the standard Apache2 distro now. Ah, then it IS hidden ;) -jesse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Querying from PHP to a MySQL database
wildcard in SQL is %, so your query looks like: $query_search1 = SELECT * FROM secureworks WHERE $varSort_search1 LIKE '%$varText_search1%'; [EMAIL PROTECTED] wrote: Howdy all! I've built a page in Dreamweaver MX that uses PHP for scripting. I can get data out of my mysql database but I need to be able to search for wildcards. currently it only matches 100% exact queries. Below is the code that is at the beggining of the PHP page. --- $varSort_search1 = %; if (isset($HTTP_POST_VARS[Sort])) { $varSort_search1 = (get_magic_quotes_gpc()) ? $HTTP_POST_VARS[Sort] : addslashes($HTTP_POST_VARS[Sort]); } $varText_search1 = %; if (isset($HTTP_POST_VARS[Text])) { $varText_search1 = (get_magic_quotes_gpc()) ? $HTTP_POST_VARS[Text] : addslashes($HTTP_POST_VARS[Text]); } mysql_select_db($database_CATCH, $CATCH); $query_search1 = sprintf(SELECT * FROM secureworks WHERE %s LIKE '%s', $varSort_search1,$varText_search1); $search1 = mysql_query($query_search1, $CATCH) or die(mysql_error()); $row_search1 = mysql_fetch_assoc($search1); $totalRows_search1 = mysql_num_rows($search1); - Does anyone have any ideas? Thanks, John Cole, TCISA -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Why isn't there much info on apache2?
Well, I'm in no hurry, so I'll try to make it work. It just seemed to me that with ssl and mpm's incorporated it worth the upgrade. I was not sure if there was a held back on the use of apache2... Pierre Danny Shepherd [EMAIL PROTECTED] wrote in message 001201c260b9$7ebb8530$a201a8c0@DANNYS">news:001201c260b9$7ebb8530$a201a8c0@DANNYS... Apache 2 isn't officially supported yet. If you get the latest version of both then you shouldn't hit to many hurdles but you should know that you'll get no official support and it isn't recommended for production environments. If you need Apache2 then you'll know why - if you don't know what the advantages are, you'll probably be better off with Apache 1.3.26 anyway. Danny. - Original Message - From: pierre.samson [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, September 20, 2002 4:00 PM Subject: Re: [PHP] Why isn't there much info on apache2? Any particular reason... future plans or is apache2 is not worthy? Adam Williams [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Yeah, apache 2.0 and php don't like each other. Adam On Fri, 20 Sep 2002, pierre.samson wrote: I'm building a new server and would like to use: php4 apache 2.xxx mod_ssl MySQL mod_perl Is there any major hurdle? Thanks Pierre B. Samson CAMBAR -- 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] odbc_fetch_row()
Hi Fellas! I'm a little bit confused as to why does this not work right! It had to do with the odbc_fetch_row() function. When there is two or more rows, the odbc_fetch_row() return a True. When there's no row, the odbc_fetch_row() return a False. What so odd about it is when there is one row, odbc_fetch_row() return a False. It should return a True. This doesn't make sense. Is this a bug? Have anyone encountered this problem?? What is the workaround to it? Thanks! --clip-- $cid = odbc_connect('blah blah'); $ask7 = SELECT * FROM INQUIRIES; $R7 = odbc_exec($cid,$ask7); $result = odbc_result($R7,1); while (odbc_fetch_row($R7)) { odbc_fetch_into($R7,$inquiry,$inq_c); echo $inquiry[0], $inquiry[1]; } --cilp-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] RE: PHP source code
Oliver, I think I see your question. You are wanting to know if people can see *your* PHP code (it sounded like you were asking if you could read PHP's source code, which is why people responded like they did). I think another poster mentioned this, but the safest thing to do with your database access information is to store it in a separate PHP script outside of document root. This ensures that there is no way to access it from a URL. Then, you can use include() from your script(s) that need to connect to the database to include the access credentials. I think your question is whether you can see the source of a *.php file from a Web browser somehow, right? I'm not aware of any type of vulnerability that can allow this, once your Web server is setup to recognize these scripts as PHP. A possible source of your concern is that many people mistakenly store included modules under document root, name them *.inc, and don't configure the Web server to deny requests for a resource with a .inc extension. The best solution, even for this case, is to store your included modules outside of document root. This way you don't depend on access restrictions implemented in the Web server, nor do you have to worry about people executing your modules out of context (a danger, possibly greater danger, that exists when you simply name your modules *.php as a quick fix). Hopefully that explains some of this a bit more. Chris On Thu, 19 Sep 2002 16:50:16 +0200 [EMAIL PROTECTED] (Oliver Witt) wrote: Hi, Is there any way to read php source code? I didn't think so until I heard about people you have done that... Kind regards, Oliver If you mean php's source, download it ;) Well, but if I write a script with MySQl, there has to be my user name and password in the source code. If anybody could read it, anybody could have access to my databases! Oliver -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] array_merge_recursive
Hello! I'm fairly new to PHP and absolutely new to this mailing list. I subscribed and I'm writing because I observed some strange behavior with array_merge_recursive(). I'm using PHP version 4.1.2. Please look at the following code: $a = array('k' = array('a1')); $b = array('k' = array('b1')); $r = array_merge_recursive($a, $b); echo count($a['k']), 'br'; echo count($b['k']), 'br'; This will print 2 1 Apparently $a['k'] has been merged with $b['k'] and $a['k'] has been set to the resulting two-element array. I did not expect this behavior: I expected the function to make a new array, which contains both 'a1' and 'b1'. Only $r['k'] should refer to this new array. Otherwise, in my opinion, array_merge_recursive should not return a value, just modify the first argument. Should I file a bug report about this? Thank you, Michiel van Wessem Network Administrator -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] array_merge_recursive
Worked fine for me.. ?phpecho pre;print_r($r);echo /pre;?---Array ( [k] = Array ( [0] = a1 [1] = b1 ) ) ---Access the merged array with with $r['k']; with values at $r['k'][0] and $r['k'][1]. Is this not what you wanted? -Kevin - Original Message - From: Michiel van Wessem [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, September 20, 2002 10:14 AM Subject: [PHP] array_merge_recursive Hello! I'm fairly new to PHP and absolutely new to this mailing list. I subscribed and I'm writing because I observed some strange behavior with array_merge_recursive(). I'm using PHP version 4.1.2. Please look at the following code: $a = array('k' = array('a1')); $b = array('k' = array('b1')); $r = array_merge_recursive($a, $b); echo count($a['k']), 'br'; echo count($b['k']), 'br'; This will print 2 1 Apparently $a['k'] has been merged with $b['k'] and $a['k'] has been set to the resulting two-element array. I did not expect this behavior: I expected the function to make a new array, which contains both 'a1' and 'b1'. Only $r['k'] should refer to this new array. Otherwise, in my opinion, array_merge_recursive should not return a value, just modify the first argument. Should I file a bug report about this? Thank you, Michiel van Wessem Network Administrator -- 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] array_merge_recursive
Hello Kevin, Yes, and that's the good part. The bad part is that $a is affected (try print_r($a)). I don't think it should be. Michiel At 12:41 PM 9/20/2002, Kevin Stone wrote: Worked fine for me.. ?phpecho pre;print_r($r);echo /pre;?---Array ( [k] = Array ( [0] = a1 [1] = b1 ) ) ---Access the merged array with with $r['k']; with values at $r['k'][0] and $r['k'][1]. Is this not what you wanted? -Kevin - Original Message - From: Michiel van Wessem [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, September 20, 2002 10:14 AM Subject: [PHP] array_merge_recursive Hello! I'm fairly new to PHP and absolutely new to this mailing list. I subscribed and I'm writing because I observed some strange behavior with array_merge_recursive(). I'm using PHP version 4.1.2. Please look at the following code: $a = array('k' = array('a1')); $b = array('k' = array('b1')); $r = array_merge_recursive($a, $b); echo count($a['k']), 'br'; echo count($b['k']), 'br'; This will print 2 1 Apparently $a['k'] has been merged with $b['k'] and $a['k'] has been set to the resulting two-element array. I did not expect this behavior: I expected the function to make a new array, which contains both 'a1' and 'b1'. Only $r['k'] should refer to this new array. Otherwise, in my opinion, array_merge_recursive should not return a value, just modify the first argument. Should I file a bug report about this? Thank you, Michiel van Wessem Network Administrator -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.385 / Virus Database: 217 - Release Date: 9/4/2002 Network Administrator -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is php even right for this design?
I don't know if this is possible, but in VB (I'd like to find something similar in php) I would open a record set, and then filter / unfilter it for similar issues (in a loop). I'm assuming you could use a similar approach somehow in php. Robert Cummings [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Beau Hartshorne wrote: The admin users will need to run long processes that take about 5-15 minutes each. They cannot timeout and they must be done throughout the day while general users are working in the application as well. Is there a big problem with this? What steps should I take to ensure these long processes complete and do not timeout. What about turning these long processes into perl scripts or C programs that can be exec()ed? They'll probably run faster, and they won't time out. I've never done this myself. It's just a suggestion -- does it make sense to do it this way? Best would be a PHP extension since it wouldn't need to be constantly reloaded :) Cheers, Rob. -- .-. | Robert Cummings | :-`. | Webdeployer - Chief PHP and Java Programmer | :--: | Mail : mailto:[EMAIL PROTECTED] | | Phone : (613) 731-4046 x.109 | :--: | Website : http://www.webmotion.com | | Fax : (613) 260-9545 | `--' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is php even right for this design?
Jeff Bluemel wrote: I don't know if this is possible, but in VB (I'd like to find something similar in php) I would open a record set, and then filter / unfilter it for similar issues (in a loop). I'm assuming you could use a similar approach somehow in php. Sounds like a DB issue. Select your entries from your DB then loop through the result set with the same filtering mechanism. HTH, Rob. -- .-. | Robert Cummings | :-`. | Webdeployer - Chief PHP and Java Programmer | :--: | Mail : mailto:[EMAIL PROTECTED] | | Phone : (613) 731-4046 x.109 | :--: | Website : http://www.webmotion.com | | Fax : (613) 260-9545 | `--' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Is php even right for this design?
I don't know if this is possible, but in VB (I'd like to find something similar in php) I would open a record set, and then filter / unfilter it for similar issues (in a loop). I'm assuming you could use a similar approach somehow in php. Seems like a waste of resources. Why not do the filtering with the SQL query? Why are you selecting out more than you need? ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Binary Safety and Sockets
I'm working with the socket_* function (--enable-sockets) and have been seeing some wierd issues. I'm guessing it has to do with socket_recvfrom/sendto etc not being binary safe. This is 4.2.3 on FreeBSD 4.6.2. My question is: what functions, specifically socket_* functions, are binary safe? How can I tell? When will they be? And, while we're on the subject, in general, are PHP functions binary safe? Should I assume functions aren't binary safe unless noted otherwise - or should I assume the inverse? If anyone could shed some light on this, I'd appreciate it. Hans __ Do you Yahoo!? New DSL Internet Access from SBC Yahoo! http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] array_chunk() - use or not use?
Hi! I got this problem getting my uploaded pictures listed in a table 3 by 3. The script below works fine and make a nice listing vetically... Now, how the heck do I script so that I get 3 pictures in a row, in separat colums and adding a new row so next 3 pictures get the same formatting? I looked into array_chunk() but I cant figure out how to use it? should i split $pic_out and use a foreach on that array? or just $nr=count($pic_out); and then run an if-statment to see if I get it out...well I hope u can give me some help cuz this is driving me mad reg: cleaner TABLE ALIGN=left BORDER=1 CELLSPACING=0 CELLPADDING=0 WIDTH=100 ? $sql=SELECT namn,sokvag,id FROM data ORDER by 'id' DESC; $query=mysql_query($sql)or die(mysql_error()); while($pic_out=mysql_fetch_array($query)){ $name=$pic_out['name']; $id=$pic_out['id']; $path=$pic_out['sokvag']; $img_source=$path.$name; ? tr ? echo TD IMG SRC='$img_source' height='100' BORDER='0'TD; }//end While ? /tr /table -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] session problem
can anyone tell me where my false conf. in php.ini ? when i change the page it makes a new session ... instead of the first one ... cannot remember the first session data ... here is my infophp: Session Support enabled Directive Local Value Master Value session.auto_start Off Off session.cache_expire 180 180 session.cache_limiter nocache nocache session.cookie_domain no value no value session.cookie_lifetime -1 -1 session.cookie_path ./ ./ session.cookie_secure Off Off session.entropy_file no value no value session.entropy_length 0 0 session.gc_maxlifetime 1440 1440 session.gc_probability 1 1 session.name PHPSESSID PHPSESSID session.referer_check no value no value session.save_handler files files session.save_path c:/php/sessions c:/php/sessions session.serialize_handler php php session.use_cookies Off Off session.use_trans_sid 0 0 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: MySQL Access
I had the problem a few days ago. Here's some software that makes it easy as clicking a button - http://www.convert-in.com/sql2acc.htm Be warned though, it's only free to copy table structure. It requires registration to copy data. Christian Calloway [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Can anyone suggest a strategy for importing data from MySQL to Access (it sucks I know, but I have to do it for my work). I was thinking of using a text-delimited file as an intermediate, but I am not quite sure on the logistics. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] why php4.2.3 caches my pages?
Hi everyone, I'm using php 4.2.3 and putting the code that prevents caching. But this works in php4.1 but in 4.2.3 doesn't. I don't know if this is because I must change some directive in php.ini or if is someone that we can't change in php 4.2.3. Thanks in advance Rapha -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] my i ramble for a while?
I am posting this message to the php.general newsgroup because I used php to construct the dynamic portion of our site and because I value the opinions of many people who frequently post here. I hope that this will not be viewed as off-topic --if it is, I will take it elsewhere. At affero we are beginning to think in terms of publishing certain data to whomsoever might wish to use it for whatever reason. Here's a first cut attempt to provide such a service: http://pws.affero.net/hof/topPatrons returns an HTML table ... /table structure suitable for use as, say, a server side include. Another kind of data which we might publish is what we refer to as a 'dense reputation' or a 'reputation summary'. For an example of a dense reputation you can point a browser at this URL http://svcs.affero.net/user-history.php?u=Poole the dense reputation appears highlighted after the user id on the top line of the page. One of the things that concerns me lately is how to make data such as these available as widely as possible. I have looked in to RSS for a few days and, while I am somewhat confused, I have begun to come more or less to the conclusion that RSS is employed mainly for syndicated news feeds and probably is not appropriate for publishing tabular data and short strings. Maybe some kind of procedure call mechanism, eh? SOAP and XML-RPC seem to be competing technologies, though. If we support one of them, how many sites will be excluded from accessing the data which we wish to make available? Should we support both? XML seems attractive because it can be styled into so many different kind of presentations, but I just can't tell if this would be appropriate. I was wondering if anyone might be able to share thoughts or opinions or experience related to such issues. -lee -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Binary Safety and Sockets
Don't assume either way, especially since sockets are currently experimental. If you're worried it isn't binary safe, you could base64_encode() and base64_decode everything... Extra bandwidth, but at least it will work. On Friday 20 September 2002 10:10, Hans Zaunere wrote: I'm working with the socket_* function (--enable-sockets) and have been seeing some wierd issues. I'm guessing it has to do with socket_recvfrom/sendto etc not being binary safe. This is 4.2.3 on FreeBSD 4.6.2. My question is: what functions, specifically socket_* functions, are binary safe? How can I tell? When will they be? And, while we're on the subject, in general, are PHP functions binary safe? Should I assume functions aren't binary safe unless noted otherwise - or should I assume the inverse? If anyone could shed some light on this, I'd appreciate it. Hans __ Do you Yahoo!? New DSL Internet Access from SBC Yahoo! http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Import Stamp PDF's
Each evening I distribute a newsletter to approx 500 subscribers, and I want to stamp each copy I send with the name, email address and subscriber number of the recipient. I've not done any programmatic PDF manipulation, but could this be done using PDFlib? I receive the newsletter as a PDF from the publisher, it's not generated on my system. I envision it running as follows: Have fetched all this information from the database, while processing the result set .. Open a copy of todays_news.pdf Write the desired information to a certain block/watermark Save it Create the mail message attach PDF Send it Delete the copy Repeat Regards - Miles Thompson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How do you stop certain headers from going out?
I'm having problems with headers being sent out that cause generated images to become garbled, Does anypone have any ideas on how to stop certain headers, such as Connection, Keep-Alive and Transfer-Encoding from going out to the browser, or filtering them out of the output? Im running apache 1.3.26 on red hat with mod_headers installed and i have already set it to unset all of the headers in httpd.conf but that didn;t get rid of them, so I think php is causing the problem. Any Ideas/Tips/help on changing my config of php or filtering out headers would be appreciated -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Dynamic HTML Email
Hello, I am wondering how it would be possible to generate an html response email via a PHP script. I have tried and all that has happened is the html source code appears in the message body as plain text. I believe this is happening because the email needs an additional header stating the email needs to be parsed as html not plain text (or both). I am using the mail command. Can someone shed some light on the subject for me??? Thanks so much in advance! Mike Dunlop -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Dynamic HTML Email
Mike Dunlop mailto:[EMAIL PROTECTED] scribbled; Hello, I am wondering how it would be possible to generate an html response email via a PHP script. I have tried and all that has happened is the html source code appears in the message body as plain text. I believe this is happening because the email needs an additional header stating the email needs to be parsed as html not plain text (or both). You can try sending Content-Type: text/html\r\n to see if that helps, otehrwise the mail client may be set for text-only. -jesse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Dynamic HTML Email
Try this class: http://phpclasses.websapp.com/browse.html/package/9.html Regards, Daniel Kushner _ Need hosting? http://thehostingcompany.us -Original Message- From: Mike Dunlop [mailto:[EMAIL PROTECTED]] Sent: Friday, September 20, 2002 4:46 PM To: [EMAIL PROTECTED] Subject: [PHP] Dynamic HTML Email Hello, I am wondering how it would be possible to generate an html response email via a PHP script. I have tried and all that has happened is the html source code appears in the message body as plain text. I believe this is happening because the email needs an additional header stating the email needs to be parsed as html not plain text (or both). I am using the mail command. Can someone shed some light on the subject for me??? Thanks so much in advance! Mike Dunlop -- 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] Binary Safety and Sockets
Hrmm... Well the base64_* bit would work for the payload, but I'm working with raw sockets (ICMP at the moment) and of course the header needs to be really binary. Are the socket_*() planned on being binary safe in the near future? Anyone do traceroute/ping in PHP yet? Hans --- Evan Nemerson [EMAIL PROTECTED] wrote: Don't assume either way, especially since sockets are currently experimental. If you're worried it isn't binary safe, you could base64_encode() and base64_decode everything... Extra bandwidth, but at least it will work. On Friday 20 September 2002 10:10, Hans Zaunere wrote: I'm working with the socket_* function (--enable-sockets) and have been seeing some wierd issues. I'm guessing it has to do with socket_recvfrom/sendto etc not being binary safe. This is 4.2.3 on FreeBSD 4.6.2. My question is: what functions, specifically socket_* functions, are binary safe? How can I tell? When will they be? And, while we're on the subject, in general, are PHP functions binary safe? Should I assume functions aren't binary safe unless noted otherwise - or should I assume the inverse? If anyone could shed some light on this, I'd appreciate it. Hans __ Do you Yahoo!? New DSL Internet Access from SBC Yahoo! http://sbc.yahoo.com __ Do you Yahoo!? New DSL Internet Access from SBC Yahoo! http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: MySQL Access
Thanks. That's fine, it's either $55 for this or a couple of hundred to pay someone to do it manually. Go figure ;-) Cheers, Liam - Original Message - From: M1tch [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, September 21, 2002 3:51 AM Subject: [PHP] Re: MySQL Access I had the problem a few days ago. Here's some software that makes it easy as clicking a button - http://www.convert-in.com/sql2acc.htm Be warned though, it's only free to copy table structure. It requires registration to copy data. Christian Calloway [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Can anyone suggest a strategy for importing data from MySQL to Access (it sucks I know, but I have to do it for my work). I was thinking of using a text-delimited file as an intermediate, but I am not quite sure on the logistics. -- 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] Dynamic HTML Email
$header .= MIME-Version: 1.0\r\n; $header .= Content-Type: text/html; charset=iso-8859-1\r\n; $header .= From: $sender_email\r\n; mail($rcpt_email, $subject, $msg, $header); This works it is what I use. -Original Message- From: Mike Dunlop [mailto:[EMAIL PROTECTED]] Sent: Friday, September 20, 2002 2:46 PM To: [EMAIL PROTECTED] Subject: [PHP] Dynamic HTML Email Hello, I am wondering how it would be possible to generate an html response email via a PHP script. I have tried and all that has happened is the html source code appears in the message body as plain text. I believe this is happening because the email needs an additional header stating the email needs to be parsed as html not plain text (or both). I am using the mail command. Can someone shed some light on the subject for me??? Thanks so much in advance! Mike Dunlop -- 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] Reg Exp issue
Hello, I am trying to find a string in another string with mysql. Normally, this would work. select 'foo' REGEXP ('foo'); And that would simply return 1, since it found it. But, my strings are more complicated than that. One good random example is something like this..Ya i know, its wierd but go with me on this. ok/2.0 (hah 3.0; BAM oh 5.1; .hi CLR 1.0.4725) so you would do a select like.. select 'ok/2.0 (hah 3.0; BAM oh 5.1; .hi CLR 1.0.4725)' REGEXP ('ok/2.0 (hah 3.0; BAM oh 5.1; .hi CLR 1.0.4725)'); That of course doesnt work. All of the () 's, and /'s, and .'s, mess it all up. And suggestion on what to do? any function to convert all of the special regexp characters ()[];.^*$ etc to work correctly? Thank You, Taylor York -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] All Queries TRUE even when they should be FALSE
Even though I have no record in my MySQL DB with that has 005 in the ID field, the following statement always reverts to Record Found, or True, no matter what ID I use. What's wrong? I'm using PHP 4.2.2. Has something changed that makes this work differently? Thanks. $query = SELECT id FROM member WHERE id = 005; $connect = mysql_pconnect(localhost, dbname, password); $result = mysql_query( $query, $connect ); // Query DB. if ( !empty($result) ) { echo RECORD FOUND; } else { echo RECORD NOT FOUND; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Reg Exp issue
Not that familiar with MySQL's flavor of RegEx (and the documentation seems to be extremely bad ... or at least I can't seem to find any with casually searching) but have you tried escaping the RegEx special characters? eg REGEXP ('ok\/2.0 \(hah 3\.0; BAM oh 5\.1; \.hi CLR 1\.0\.4725\)'); -Peter -Original Message- From: Taylor York [mailto:[EMAIL PROTECTED]] Sent: Saturday, September 21, 2002 00:17 To: [EMAIL PROTECTED] Subject: [PHP] Reg Exp issue Hello, I am trying to find a string in another string with mysql. Normally, this would work. select 'foo' REGEXP ('foo'); And that would simply return 1, since it found it. But, my strings are more complicated than that. One good random example is something like this..Ya i know, its wierd but go with me on this. ok/2.0 (hah 3.0; BAM oh 5.1; .hi CLR 1.0.4725) so you would do a select like.. select 'ok/2.0 (hah 3.0; BAM oh 5.1; .hi CLR 1.0.4725)' REGEXP ('ok/2.0 (hah 3.0; BAM oh 5.1; .hi CLR 1.0.4725)'); That of course doesnt work. All of the () 's, and /'s, and .'s, mess it all up. And suggestion on what to do? any function to convert all of the special regexp characters ()[];.^*$ etc to work correctly? Thank You, Taylor York -- 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: All Queries TRUE even when they should be FALSE
Could be wrong, but the fact that $result isn't empty doesn't mean there are rows... it would be better to say: if ( !empty($result) ) { echo VALID QUERY; } else { echo INVALID QUERY; } Although you should probably check $result against TRUE and FALSE instead. If you want to know how many rows have been returned use mysql_num_rows() (or something very close to that). good luck! On Fri, 20 Sep 2002, Monty wrote: Even though I have no record in my MySQL DB with that has 005 in the ID field, the following statement always reverts to Record Found, or True, no matter what ID I use. What's wrong? I'm using PHP 4.2.2. Has something changed that makes this work differently? Thanks. $query = SELECT id FROM member WHERE id = 005; $connect = mysql_pconnect(localhost, dbname, password); $result = mysql_query( $query, $connect ); // Query DB. if ( !empty($result) ) { echo RECORD FOUND; } else { echo RECORD NOT FOUND; } -- 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] Why isn't there much info on apache2?
At 11:35 AM 9/20/02 -0400, pierre.samson wrote: Well, I'm in no hurry, so I'll try to make it work. It just seemed to me that with ssl and mpm's incorporated it worth the upgrade. From today's Apache week newsletter: the Apache 2.0 interface is still undergoing steady change, Don't expect to see a stable PHP for Apache 2 until the interfaces stop changing with almost every version. There is great work being done on PHP for Apache 2, but it seems to need to be updated with every new version of Apache, and they are coming out fast and furious. Rick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: All Queries TRUE even when they should be FALSE
you should use mysql_num_rows() to check for records returned instead of using mysql_query(). this is because if $query is a valid $sql statement, mysql_query() will always return a resource link. which evaluates to true. so this will work for you: if (mysql_num_rows($result)) echo record found; else echo record not found; --lance Monty wrote: Even though I have no record in my MySQL DB with that has 005 in the ID field, the following statement always reverts to Record Found, or True, no matter what ID I use. What's wrong? I'm using PHP 4.2.2. Has something changed that makes this work differently? Thanks. $query = SELECT id FROM member WHERE id = 005; $connect = mysql_pconnect(localhost, dbname, password); $result = mysql_query( $query, $connect ); // Query DB. if ( !empty($result) ) { echo RECORD FOUND; } else { echo RECORD NOT FOUND; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: java in php4 on debian testing distribution?
I have java 1.4 installed, and I've put it in /usr/local/sun-j2sdk1.4.1 -- that's why I use the ini_set() method. I've compiled and run apps using this java installation, so I'm pretty sure all is kosher there. I sincerely believe that the problem lies in my php installation, not in my java installation, which is why I'm asking whether the debian php4 package in the testing distribution, which is more specifically PHP/4.1.2 according to X-Powered-By in phpinfo(), has java support compiled in, whether I need a particular extension library file (.so), etc. If there's a reason you believe my setting java.home using ini_set() shouldn't work, please let me know. From the ini_set docs, I gather I'm using it appropriately. Thanks, monique Monique, By default Debian does not come come with a recent JVM, due to the non-free-ness of Sun's license. So first thing is to see if you have any Java installed at all... When you type `java` at a shell it should give you an error about missing parameters... if you get the following: bash: java: command not found then you need to install a Java package for PHP4 to work with. The most useful Java package for Debian, is blackdown.org's non-free port of Java, do the following to get it do the following: to /etc/apt/sources.list add: # JDK -- mirrors http://www.blackdown.org/java-linux/mirrors.html deb http://www.mirror.ac.uk/sites/ftp.blackdown.org/ja va-linux/debian woody non-free then run: apt-get update; apt-get install j2sdk1.3 Once you've installed Blackdown's port of Java, your java.home var should be set (you may have to log-in again or reload your profile to see it). good luck, -Garth - Monique Y. Herman - 19 Sep 2002 19:48:01 -0400 I'd like to play with using java classes from within php, as is described in http://www.php.net/manual/en/ref.java.php ... I'm using the apache and php4 packages from the debian testing distribution. All of the documentation I've found on the web about installing the java extension seems to be oriented toward windows, making me think that maybe I don't need to specify an extension library on linux? I tried simply using ini_set (java.home, /usr/local/sun-j2sdk1.4.1); $systemInfo = new Java(java.lang.System); and got the following: Fatal error: Cannot instantiate non-existent class: java That seems fairly straightforward: My php doesn't know java from adam. So my questions are: Do I need to get an extension library for this functionality on linux? If not, does anyone know of a debian package of php4 that will give me this capability? I rather like being able to use packages wherever possible. Thanks in advance for any insight! -- monique -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] HTML 2 TEXT
what he really needs is to completely remove script.../script, plus many many other examples. completely removing everything outside the body would be another option, perhaps saving the contents of title.../title since a script might also occur inside the body, this would not really work out as meant. Sascha -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: java in php4 on debian testing distribution?
I sincerely believe that the problem lies in my php installation, not in my java installation, which is why I'm asking whether the debian php4 package in the testing distribution, which is more specifically PHP/4.1.2 according to X-Powered-By in phpinfo(), has java support compiled in, whether I need a particular extension library file (.so), etc. You need the extension either compiled in _OR_ the library. ?php phpinfo(); ? will tell you also, if the extension is loaded. (There must be a 2 column box saying java support and enabled in it's head). Sascha -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] my i ramble for a while?
If *I* were publishing data for others to USE in their own web sites (often called a web service), I'd make the data available in one of a few ways: - raw text -- let them format it as they see fit - CSV a simple CSV file can hold a wealth of information, and it is easy for the receiver to munch up the CSV into meaningful, formatted data on a web page. I have one client who supplies me with two 5MB CSV files daily for an almost complete update of his site contents... easy. eg: Poole,125 greenman,35 hv,25 libert,25 loriwinslow,25 PHPnewbie,15 tunitas,15 bob,10 creed,10 malees,10 - XML, or some other form of structured data... even structure (but not formatted) HTML/XHTML would be great, because people could then format it to their own taste with style sheets, of which they could optionally download a default style sheet or skin from you, or create their own. eg users namePoole/nameamount125/amount namegreenman/nameamount35/amount namehv/nameamount25/amount namelibert/nameamount25/amount ... /users or some sort of unformatted HTML table with default classes. - formatted, branded and designed HTML, ready to go. I have a project on the go at the moment, where it looks like i might provide content for free to everyone, or at a cost to people who want to pay for me to design the contnt specifically for them... if they want a green background and blue text, then that's what the web service provides them each week. It early in the morning here, so the might be plenty of other options i'm not thinking of yet :) Justin on 21/09/02 4:32 AM, Lee Doolan ([EMAIL PROTECTED]) wrote: I am posting this message to the php.general newsgroup because I used php to construct the dynamic portion of our site and because I value the opinions of many people who frequently post here. I hope that this will not be viewed as off-topic --if it is, I will take it elsewhere. At affero we are beginning to think in terms of publishing certain data to whomsoever might wish to use it for whatever reason. Here's a first cut attempt to provide such a service: http://pws.affero.net/hof/topPatrons returns an HTML table ... /table structure suitable for use as, say, a server side include. Another kind of data which we might publish is what we refer to as a 'dense reputation' or a 'reputation summary'. For an example of a dense reputation you can point a browser at this URL http://svcs.affero.net/user-history.php?u=Poole the dense reputation appears highlighted after the user id on the top line of the page. One of the things that concerns me lately is how to make data such as these available as widely as possible. I have looked in to RSS for a few days and, while I am somewhat confused, I have begun to come more or less to the conclusion that RSS is employed mainly for syndicated news feeds and probably is not appropriate for publishing tabular data and short strings. Maybe some kind of procedure call mechanism, eh? SOAP and XML-RPC seem to be competing technologies, though. If we support one of them, how many sites will be excluded from accessing the data which we wish to make available? Should we support both? XML seems attractive because it can be styled into so many different kind of presentations, but I just can't tell if this would be appropriate. I was wondering if anyone might be able to share thoughts or opinions or experience related to such issues. -lee -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Date Time
Hi,, my server is located in the US and i live in Sweden, so when i try to run the following command i get a 8hour diffrence,, anyone got any idea of how to solve this? date(Y-m-j) regards Patrick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Date Time
Hi, Saturday, September 21, 2002, 12:30:48 PM, you wrote: P Hi,, P my server is located in the US and i live in Sweden, so when i try to run P the following command i get a 8hour diffrence,, anyone got any idea of how P to solve this? P date(Y-m-j) P regards P Patrick A quick fix that won't account for daylight saving differences unless Sweden uses the same dates as the US... date(Y-m-j,strtotime(+8 hours)); -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Dynamic HTML Email
Mike, Here is how I send an HTML e-mail. Say I have a contact form with the values $name, $email, and $message. The form submits to say. process.php. ? // process.php $message = stripslashes(nl2br($message)); $date = Date(F d, Y h:i a); $body = pfont color='#99' face='Arial, Helvetica, sans-serif'strongContact Us Submitted $date/strong/font/p table width='300' border='1' cellspacing='1' cellpadding='3' tr td width='113'font face='Arial, Helvetica, sans-serif'Name:/font/td td width='187'font face='Arial, Helvetica, sans-serif'$name/font/td /tr tr tdfont face='Arial, Helvetica, sans-serif'E-mail address/font/td tdfont face='Arial, Helvetica, sans-serif'$email/font/td /tr tr tdfont face='Arial, Helvetica, sans-serif'nbsp;/font/td tdfont face='Arial, Helvetica, sans-serif'nbsp;/font/td /tr tr tdfont face='Arial, Helvetica, sans-serif'Message:/font/td tdfont face='Arial, Helvetica, sans-serif'$message/font/td /tr /table ; $subject = Contact Us submission from your website; $to = John Doe [EMAIL PROTECTED] . , ; //note the comma /* To send HTML mail */ $headers = MIME-Version: 1.0\r\n; $headers .= Content-type: text/html; charset=iso-8859-1\r\n; /* This sets the 'from' field to the Name and E-mail that was just submitted $headers .= From: ; $headers .= $name; $headers .= ; $headers .= $email; $headers .= \r\n; /* Send it!! */ mail($to, $subject, $body, $headers); ? That's it. The key part are the two header lines that set the MIME-Version, and the Content-type. Other than that it's the same. Note... I changed all the double-quotes in the HTML code to single quotes. This way I could use double-quotes around the whole block of HTML, and simply insert the PHP variables where desired without have to chop apart the $body. (make sense?) Hope this helps. Joseph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Date Time
You have to add (or subtract) 28800 seconds to/from current time and use this as the 2nd input to date. echo date(Y-m-j, strtotime(now) + 28800); Sascha Hi,, my server is located in the US and i live in Sweden, so when i try to run the following command i get a 8hour diffrence,, anyone got any idea of how to solve this? date(Y-m-j) regards Patrick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Attack of the ghost double slash??
A few months ago, I wrote a bit of code to stripslash() PATH_TRANSLATED on a w2k box, because, php was reporting it with double slashes like C:\\winnt\\some_dir Today I noticed that the code is broken because PATH_TRANSLATED is now reported with one slash like C:\winnt\some_dir Does anyone know when paths contain double slashes on a w2k box, so that I can anticipate for them?? Thanks for any insight you may provide. -- Gerard Samuel http://www.trini0.org:81/ http://dev.trini0.org:81/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Attack of the ghost double slash??
Gerard, The most likely reason is a php.ini configuration called magic_quotes. When enabled, PHP will automatically add slashes to single and double quotes, as well as slashes themselves (to escape them). This is helpful in some environments to help protect against attacks that can be used to execute arbitrary database commands. However, this particular setting is one of the more annoying ones, in my opinion, because it makes it more difficult to write portable code. Hopefully this answers your question, and you can just check your php.ini. If you need to dynamically check the configuration, there is a function that will give you the setting of magic_quote. A quick reference in the manual will give it to you. Oh, also, you cannot disable this per script, because the slashes are added perior to the data being given to PHP, hence prior to your script's execution. Happy hacking. Chris Gerard Samuel wrote: A few months ago, I wrote a bit of code to stripslash() PATH_TRANSLATED on a w2k box, because, php was reporting it with double slashes like C:\\winnt\\some_dir Today I noticed that the code is broken because PATH_TRANSLATED is now reported with one slash like C:\winnt\some_dir Does anyone know when paths contain double slashes on a w2k box, so that I can anticipate for them?? Thanks for any insight you may provide. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: session cookies
still looking for some solutions on this - anybody else have any suggestions? Jeff Bluemel [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... OK guys... here's my question - I'm using 4.2.3 and apache 1.3.26, and I've got sessions setup. however, it seems to be using an SID attached to the URL, and I want to force it to use a cookie that points to a transparent SID on my system. I've got the following options in my php.ini, but the system doesn't seem to ever use a cookie, and the sessions don't die. (that's my biggest concern is that the user has to login to the system EVERY time he visits the site.) session.use_cookies = 1 session.use_only_cookies = 1 session.use_trans_sid = 1 -- Thanks, Jeff Bluemel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: session cookies
You've already posted this, and you never answered the questions that were asked. Thus, your question is every bit as unclear as the previous time. Perhaps if you put forth a little effort, we might also. Just a helpful suggestion, Chris Jeff Bluemel wrote: still looking for some solutions on this - anybody else have any suggestions? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php