php-general Digest 31 Oct 2001 13:07:32 -0000 Issue 967
Topics (messages 72947 through 73007): Re: php & mysql prob... 72947 by: David Robley 72948 by: Jason Brooke 72949 by: sc 72950 by: David Robley 72953 by: sc 72955 by: Jim Lucas 72956 by: sc 72958 by: Jim Lucas 72966 by: Mike Frazer 72969 by: David Robley 72970 by: Mike Frazer 72995 by: Tim Ward FREE MEMBERSHIP (ADULTS) 10113 72951 by: leslieann4587.yahoo.com Re: show png in the browser 72952 by: Luz Lopez 72954 by: Jim Lucas 72959 by: Luz Lopez date problem 72957 by: Steve Tsai Re: PHP+MySQL=Help(?) 72960 by: turtle 72998 by: Justin French Re: Session handling with cookies?? 72961 by: Jason G. Re: Zipping a folder on a win2000 server with php4.06 72962 by: Matt Friedman 72994 by: Matt Williams sharing data stored in mysql with another site 72963 by: Matthew Delmarter 72964 by: David Robley 72965 by: Mike Frazer Total Newbie in over head 72967 by: J W W L (Warwick) Berg 72976 by: Jack Dempsey 72988 by: Peter I rest my case 72968 by: J W W L (Warwick) Berg 72971 by: Mike Frazer 72972 by: Tyler Longren 72973 by: David Robley 72974 by: J W W L (Warwick) Berg 72975 by: Jason Murray 72977 by: J W W L (Warwick) Berg 72978 by: David Robley 72979 by: Jason Brooke 72980 by: J W W L (Warwick) Berg 72981 by: David Robley 72986 by: Joseph Blythe question about variables... 72982 by: sc 72983 by: Hugh Danaher 72985 by: sc Re: Problems inserting single quote into Oracle database 72984 by: Hugh Danaher 72987 by: Thies C. Arntzen Re: Trouble with php generated images 72989 by: Jason G. using PHPMyAdmin with SQL 72990 by: Peter Array of classes 72991 by: Andrzej Roszkowski spliting results into 2 colomns 72992 by: Daniel Harik 73006 by: DL Neil 73007 by: Daniel Harik Problem with LDAP 72993 by: Carlo Todeschini Re: User Authentication against remote authentication serve r [ LDAP ] 72996 by: Stig Venaas PEAR DB Results 72997 by: Ralph Guzman CANADA, SUBSIDIES, GRANTS, LOANS, FINANCING 72999 by: MG PUBLISHING Popup Window Problems & Refresh 73000 by: Roger Bryant 73002 by: Matt Williams File upload 73001 by: Andrzej Roszkowski Thank You Friends 73003 by: Sondra Russell Re: Quick array question 73004 by: Christian Reiniger Asian fonts 73005 by: Daniel BI 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] ----------------------------------------------------------------------
On Wed, 31 Oct 2001 11:25, sc wrote: > Hi; > > i keep getting an error of: Warning: Supplied argument is not a valid > MySQL result resource in /datascripts/insertdata.php on line 17... > > Line 17 is: $row = mysql_fetch_assoc($test); > > and here is the rest of it (not all of it though): > > for ($p = 1; $p <= 24; $p++) { > $test = mysql_db_query("melbourne", "SELECT * FROM 'Port$p' WHERE > 'Port$p'.date='$yesterday'"); > $row = mysql_fetch_assoc ($test); > $yindata = $row['switchin']; > $youtdata = $row['switchout']; > $dinPort = '$inPort$p' - $yindata; > $doutPort = '$outPort$p' - $youtdata; > > Can anyone help me overcome this prob? i've prob missed something > without thinking but i cant seem to get it... > > Thx. > > sc Er, want to be a little patient? That is three requests in seven minutes? Your query is probably broken - do some error checking after your database call with mysql_error() and see what the problem is. Guess; the table name. -- David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA "I know all the wherefores," said Tom wisely.
Or the single quotes around the table name in the sql string > Your query is probably broken - do some error checking after your > database call with mysql_error() and see what the problem is. > > Guess; the table name.
Yeah sorry about that, didn't mean to send out 3... Ok i got it working... thanks for all the replys... -sc "David Robley" <[EMAIL PROTECTED]> wrote in message 01103111392904.28397@www">news:01103111392904.28397@www... > On Wed, 31 Oct 2001 11:25, sc wrote: > > Hi; > > > > i keep getting an error of: Warning: Supplied argument is not a valid > > MySQL result resource in /datascripts/insertdata.php on line 17... > > > > Line 17 is: $row = mysql_fetch_assoc($test); > > > > and here is the rest of it (not all of it though): > > > > for ($p = 1; $p <= 24; $p++) { > > $test = mysql_db_query("melbourne", "SELECT * FROM 'Port$p' WHERE > > 'Port$p'.date='$yesterday'"); > > $row = mysql_fetch_assoc ($test); > > $yindata = $row['switchin']; > > $youtdata = $row['switchout']; > > $dinPort = '$inPort$p' - $yindata; > > $doutPort = '$outPort$p' - $youtdata; > > > > Can anyone help me overcome this prob? i've prob missed something > > without thinking but i cant seem to get it... > > > > Thx. > > > > sc > > Er, want to be a little patient? That is three requests in seven minutes? > > Your query is probably broken - do some error checking after your > database call with mysql_error() and see what the problem is. > > Guess; the table name. > > -- > David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc > CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA > > "I know all the wherefores," said Tom wisely.
On Wed, 31 Oct 2001 11:47, Jason Brooke wrote: > Or the single quotes around the table name in the sql string > > > Your query is probably broken - do some error checking after your > > database call with mysql_error() and see what the problem is. > > > > Guess; the table name. That's what I meant - but I was hoping he'd do a bit of work :-) -- David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA This is Borg. <ESC> is futile <CTRL> is inevitable
ok i thought it would be working, but on testing it more it still isn't going for me.... i took off the ' ' from the table name and its still coming up with an error on line 17 with the same error message... the mysql_error() isn't echoing anything that has gone wrong.. (did before).. Any ideas? thx. -sc "Jason Brooke" <[EMAIL PROTECTED]> wrote in message 043f01c161a9$bf8d99a0$0100a8c0@co3040297a">news:043f01c161a9$bf8d99a0$0100a8c0@co3040297a... > Or the single quotes around the table name in the sql string > > > > Your query is probably broken - do some error checking after your > > database call with mysql_error() and see what the problem is. > > > > Guess; the table name. > > >
mysql_error() and mysql_errno() return the value. $error = mysql_error($dblink); $errno = mysql_errno($dblink); or echo mysql_error($dblink); echo mysql_errno($dblink); jim ----- Original Message ----- From: "sc" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, October 30, 2001 6:01 PM Subject: Re: [PHP] php & mysql prob... > ok i thought it would be working, but on testing it more it still isn't > going for me.... i took off the ' ' from the table name and its still coming > up with an error on line 17 with the same error message... the mysql_error() > isn't echoing anything that has gone wrong.. (did before).. > > Any ideas? > > thx. > > -sc > "Jason Brooke" <[EMAIL PROTECTED]> wrote in message > 043f01c161a9$bf8d99a0$0100a8c0@co3040297a">news:043f01c161a9$bf8d99a0$0100a8c0@co3040297a... > > Or the single quotes around the table name in the sql string > > > > > > > Your query is probably broken - do some error checking after your > > > database call with mysql_error() and see what the problem is. > > > > > > Guess; the table name. > > > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > >
mysql_error returns nothing, mysql_errno returns 0 "Jim Lucas" <[EMAIL PROTECTED]> wrote in message 03ad01c161b0$026caee0$[EMAIL PROTECTED]">news:03ad01c161b0$026caee0$[EMAIL PROTECTED]... > mysql_error() and mysql_errno() return the value. > > $error = mysql_error($dblink); > $errno = mysql_errno($dblink); > or > echo mysql_error($dblink); > echo mysql_errno($dblink); > > jim > ----- Original Message ----- > From: "sc" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Tuesday, October 30, 2001 6:01 PM > Subject: Re: [PHP] php & mysql prob... > > > > ok i thought it would be working, but on testing it more it still isn't > > going for me.... i took off the ' ' from the table name and its still > coming > > up with an error on line 17 with the same error message... the > mysql_error() > > isn't echoing anything that has gone wrong.. (did before).. > > > > Any ideas? > > > > thx. > > > > -sc > > "Jason Brooke" <[EMAIL PROTECTED]> wrote in message > > 043f01c161a9$bf8d99a0$0100a8c0@co3040297a">news:043f01c161a9$bf8d99a0$0100a8c0@co3040297a... > > > Or the single quotes around the table name in the sql string > > > > > > > > > > Your query is probably broken - do some error checking after your > > > > database call with mysql_error() and see what the problem is. > > > > > > > > Guess; the table name. > > > > > > > > > > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > >
are you pass the two functions you return link from mysql_connect() or mysql_pconnect() ?? jim ----- Original Message ----- From: "sc" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, October 30, 2001 6:15 PM Subject: Re: [PHP] php & mysql prob... > mysql_error returns nothing, mysql_errno returns 0 > "Jim Lucas" <[EMAIL PROTECTED]> wrote in message > 03ad01c161b0$026caee0$[EMAIL PROTECTED]">news:03ad01c161b0$026caee0$[EMAIL PROTECTED]... > > mysql_error() and mysql_errno() return the value. > > > > $error = mysql_error($dblink); > > $errno = mysql_errno($dblink); > > or > > echo mysql_error($dblink); > > echo mysql_errno($dblink); > > > > jim > > ----- Original Message ----- > > From: "sc" <[EMAIL PROTECTED]> > > To: <[EMAIL PROTECTED]> > > Sent: Tuesday, October 30, 2001 6:01 PM > > Subject: Re: [PHP] php & mysql prob... > > > > > > > ok i thought it would be working, but on testing it more it still isn't > > > going for me.... i took off the ' ' from the table name and its still > > coming > > > up with an error on line 17 with the same error message... the > > mysql_error() > > > isn't echoing anything that has gone wrong.. (did before).. > > > > > > Any ideas? > > > > > > thx. > > > > > > -sc > > > "Jason Brooke" <[EMAIL PROTECTED]> wrote in message > > > 043f01c161a9$bf8d99a0$0100a8c0@co3040297a">news:043f01c161a9$bf8d99a0$0100a8c0@co3040297a... > > > > Or the single quotes around the table name in the sql string > > > > > > > > > > > > > Your query is probably broken - do some error checking after your > > > > > database call with mysql_error() and see what the problem is. > > > > > > > > > > Guess; the table name. > > > > > > > > > > > > > > > > > > > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > >
I may be a little backward here but wasn't mysql_db_*() deprecated? Keep in mind it was a long day at work and I'm tired. I could be on fire right now and probably just want to open a window to cool off. :) Mike "Sc" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi; > > i keep getting an error of: Warning: Supplied argument is not a valid MySQL > result resource in /datascripts/insertdata.php on line 17... > > Line 17 is: $row = mysql_fetch_assoc($test); > > and here is the rest of it (not all of it though): > > for ($p = 1; $p <= 24; $p++) { > $test = mysql_db_query("melbourne", "SELECT * FROM 'Port$p' WHERE > 'Port$p'.date='$yesterday'"); > $row = mysql_fetch_assoc ($test); > $yindata = $row['switchin']; > $youtdata = $row['switchout']; > $dinPort = '$inPort$p' - $yindata; > $doutPort = '$outPort$p' - $youtdata; > > Can anyone help me overcome this prob? i've prob missed something without > thinking but i cant seem to get it... > > Thx. > > sc >
On Wed, 31 Oct 2001 15:40, Mike Frazer wrote: > I may be a little backward here but wasn't mysql_db_*() deprecated? > > Keep in mind it was a long day at work and I'm tired. I could be on > fire right now and probably just want to open a window to cool off. :) > > Mike Since 4.06, according to the docs. -- David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA Keyboard Not Found - Press [F1] to Continue
So I'm NOT stupid...just dumb! :) After two years of PHP/MySQL programming you'd think I would have been more sure about that... Mike "David Robley" <[EMAIL PROTECTED]> wrote in message 01103114530808.28397@www">news:01103114530808.28397@www... > On Wed, 31 Oct 2001 15:40, Mike Frazer wrote: > > I may be a little backward here but wasn't mysql_db_*() deprecated? > > > > Keep in mind it was a long day at work and I'm tired. I could be on > > fire right now and probably just want to open a window to cool off. :) > > > > Mike > > Since 4.06, according to the docs. > > -- > David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc > CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA > > Keyboard Not Found - Press [F1] to Continue
Your query is invalid, hence $test is false rather than a result set. I usually do if ($test = mysql_db_query( ... )) to trap this. Don't put quotes around table or field names, in your case 'Port$p' should be just Port$p and 'Port$p'.date just Port$p.date. Tim ---------- From: sc [SMTP:[EMAIL PROTECTED]] Sent: 31 October 2001 00:56 To: [EMAIL PROTECTED] Subject: php & mysql prob... Hi; i keep getting an error of: Warning: Supplied argument is not a valid MySQL result resource in /datascripts/insertdata.php on line 17... Line 17 is: $row = mysql_fetch_assoc($test); and here is the rest of it (not all of it though): for ($p = 1; $p <= 24; $p++) { $test = mysql_db_query("melbourne", "SELECT * FROM 'Port$p' WHERE 'Port$p'.date='$yesterday'"); $row = mysql_fetch_assoc ($test); $yindata = $row['switchin']; $youtdata = $row['switchout']; $dinPort = '$inPort$p' - $yindata; $doutPort = '$outPort$p' - $youtdata; Can anyone help me overcome this prob? i've prob missed something without thinking but i cant seem to get it... Thx. sc
TO THE 9 BEST PORN SITES ON THE WEB http://www.geocities.com/horstyqse/ JUST CLICK THE ABOVE LINK TO GET YOUR FREE HARDCORE ACCEESS AND I'LL SEE YOU INSIDE WARNING: This site contains explicit sexual material. You must be 18 or older to proceed. To be taken off this list please respond with "GET ME OFF" in the sub ject HEY SEXY, COME PLAY WITH ME GET YOUR FREE VIP PASS
Hi David, of course, I send of header: header("Content-type: image/png"); But the send me to save the file Thanks, Regards, >From: David Robley <[EMAIL PROTECTED]> >Reply-To: [EMAIL PROTECTED] >To: "Luz Lopez" <[EMAIL PROTECTED]>, [EMAIL PROTECTED] >Subject: Re: [PHP] show png in the browser >Date: Wed, 31 Oct 2001 11:28:02 +1030 > >On Wed, 31 Oct 2001 11:08, Luz Lopez wrote: > > Hi All > > > > I configured the php with thelibrary GD, zlib, jpeg and libpng, I hae a > > program that generate a image, I can to save this png image but in my > > borwser I can't to see this image, the browser send me to save to my > > hard disk this image. > > > > I need to show this image in the browser, How can I do it? > > > > Thanks in Advanced, > > > > Regards, > >You may need to send a header including the correct mime type. > >-- >David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc >CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA > > Help endangered species - adopt a KGB operative. _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
what type of browser are you using to view this image? jim ----- Original Message ----- From: "Luz Lopez" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, October 31, 2001 1:56 AM Subject: Re: [PHP] show png in the browser > Hi David, of course, I send of header: header("Content-type: image/png"); > But the send me to save the file > > Thanks, > > Regards, > > > > >From: David Robley <[EMAIL PROTECTED]> > >Reply-To: [EMAIL PROTECTED] > >To: "Luz Lopez" <[EMAIL PROTECTED]>, [EMAIL PROTECTED] > >Subject: Re: [PHP] show png in the browser > >Date: Wed, 31 Oct 2001 11:28:02 +1030 > > > >On Wed, 31 Oct 2001 11:08, Luz Lopez wrote: > > > Hi All > > > > > > I configured the php with thelibrary GD, zlib, jpeg and libpng, I hae a > > > program that generate a image, I can to save this png image but in my > > > borwser I can't to see this image, the browser send me to save to my > > > hard disk this image. > > > > > > I need to show this image in the browser, How can I do it? > > > > > > Thanks in Advanced, > > > > > > Regards, > > > >You may need to send a header including the correct mime type. > > > >-- > >David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc > >CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA > > > > Help endangered species - adopt a KGB operative. > > > _________________________________________________________________ > Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > >
Hi, I use Internet Explorer 5.003 Windows 2000 Profesional Regards, >From: "Jim Lucas" <[EMAIL PROTECTED]> >To: "Luz Lopez" <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]> >Subject: Re: [PHP] show png in the browser >Date: Tue, 30 Oct 2001 18:00:09 -0800 > >what type of browser are you using to view this image? > >jim >----- Original Message ----- >From: "Luz Lopez" <[EMAIL PROTECTED]> >To: <[EMAIL PROTECTED]> >Sent: Wednesday, October 31, 2001 1:56 AM >Subject: Re: [PHP] show png in the browser > > > > Hi David, of course, I send of header: header("Content-type: >image/png"); > > But the send me to save the file > > > > Thanks, > > > > Regards, > > > > > > > > >From: David Robley <[EMAIL PROTECTED]> > > >Reply-To: [EMAIL PROTECTED] > > >To: "Luz Lopez" <[EMAIL PROTECTED]>, [EMAIL PROTECTED] > > >Subject: Re: [PHP] show png in the browser > > >Date: Wed, 31 Oct 2001 11:28:02 +1030 > > > > > >On Wed, 31 Oct 2001 11:08, Luz Lopez wrote: > > > > Hi All > > > > > > > > I configured the php with thelibrary GD, zlib, jpeg and libpng, I >hae >a > > > > program that generate a image, I can to save this png image but in >my > > > > borwser I can't to see this image, the browser send me to save to my > > > > hard disk this image. > > > > > > > > I need to show this image in the browser, How can I do it? > > > > > > > > Thanks in Advanced, > > > > > > > > Regards, > > > > > >You may need to send a header including the correct mime type. > > > > > >-- > > >David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc > > >CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA > > > > > > Help endangered species - adopt a KGB operative. > > > > > > _________________________________________________________________ > > Get your FREE download of MSN Explorer at >http://explorer.msn.com/intl.asp > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
For reference: OS: OpenBSD 2.9 Web Server: Apache1.3.19 PHP Version: 4.0.6 My problem is that date() and all the other time functions return GMT instead of localtime. system("date") returns the correct localtime. Those functions used to return localtime since GMT. The problem seems to have started after daylight savings time changed. I hope someone has an idea of what's wrong and how to fix it. As for now, I'm adding time() - 3600 * 8 to all my scripts right now. Steve
"Kurt Lieber" > > You would use a while loop if/when you have multiple records to retrive. > From your original code example, it seemed as though you would only have one > record. (though, for safety's sake, you should code a LIMIT into your sql > statement) > Yes I only need one image location with height and width from the db file > > > This may be the problem as I now get "supplied argument not valid mysql > > result" on this line. > > $query = "select imglocation,height,width from img where > > imgname='$getimg'"; > > Two things to try: > > 1. Run that exact query on a mysql command line, substituting whatever > variable name you're trying to pass in the URL. Often times, I find that I > tihnk I have a PHP problem when, in fact, I screwed up my query syntax > somewhere. > Doing a command line query at a mysql prompt brings back the correct data select imglocation,height,width from img where imgname='alfstag1' returns: ./alf_760stag1.jpg (the image location) 544 (the height) 760 (the width) > 2. Explicitly define $getimg as something you know to be a valid image. If > that works, then you know it isn't getting passed from the url properly. > > > It looks like I might be able to use the GetImageSize function to do this > > same thing? maybe? All I am doing is getting the location (url) of an > > image and its height and width for an <img src= > statement..... maybe I > > am making this into a bigger job than necessary?? I think I have been > > working on it too long today and I need a long walk..... > > Actually, yes you can. > > $myImgSize = getImageSize('/unix/path/to/my/file.jpg'); should return the > image sizes in an array. You should then be able to do something like: > > <img src="file.jpg" $myImgSize[3]> > > Which should automatically include height/width parameters. (see this > function on the php site for more info -- also, that's untested, off-the-cuff > code I just wrote. Might not work perfectly. :) > > --kurt I found the GetImageSize while digging around the manual and tried to work it in without success. I have so far this evening re-written this with separate mysql_connect, mysql_select_db, and mysql_query functions and tested after each and that is as far as I can get without errors. I have tried mysql_fetch_array, mysql_fetch_object, and mysql_fetch_row... all have failed for some reason I am testing with an if (variable) set message then echo each message in the body... Here is a URL of a page where I pass the same variables manually and use them in the popup to give you an idea of what I am trying do to with a database holding this info http://www.bronze-gallery.com/French_Sculptors/Alfred_Barye/Stag_Scratching/ stag_scratching.html click on either image to get to the php popup this declares and passes the 3 variables in the url. so far the light bulb has not clicked on..... The php4 book you recommended is on order.... Mike
Hi, from this command line test: > select imglocation,height,width from img where imgname='alfstag1' it looks to me like your imgname field is *characters* rather than *numbers*. when ever I'm doing something like this (eg WHERE firstName="justin"), I do it with a LIKE statement, rather than with a "=". example: $query = "SELECT imglocation,height,width FROM img WHERE imgname LIKE \"$getimg\""; So, I'd recommend giving that a try. From my understanding (limited) of MySQL, use = in the case of $id=2, and LIKE in the case of firstName LIKE "justin". Justin French
Set the expire date to be 0. then the browser will delete them after the browser window is closed. -Jason Garber IonZoft.com At 02:39 PM 10/29/2001 +0100, Andy wrote: >Hello, > >I have developed a member login system with cookies. Now I have the prob, >that the session stayes existend when the browser is closed. This could >couse a problem in Internet caffes for example. As second thing, I have >realized, that it depends on the clients clock!! I am sending a cookie which >expires in time() + $expireseconds. Unfortunatelly the time command takes >the tim from the server and the cookie expires checking the client time. > >So... does anybody know how... > >1) I get the system to delete the cookie as soon as I leave the site, or >close it >2) How to work on the same time. > >Thanx for any help > > >Cheers Andy > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: [EMAIL PROTECTED]
There is a command line version of winzip. I don't know much about it, but a friend of mine was just saying the other day that he had used it to zip some files at the server in an ASP environment. In php you could call the winzip exectutable using exec. In asp you'd use some shell object or something like that. Matt. ----- Original Message ----- From: "Stefan Rusterholz" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, October 30, 2001 8:00 AM Subject: [PHP] Zipping a folder on a win2000 server with php4.06 Hi Does someone out there know, how I can zip a folder with some files in it? It should be readable for Winzip. Enviroment: Win2000 Server. VB was available if useful. Additional Components (applications, dll's or whatever) could be loaded if needed. I didn't find a usable entry in the manual, so if you tell me to rtfm - please point me to the corresponding entry also :) Thanks in advance Stefan Rusterholz, [EMAIL PROTECTED] ---------------------------------- interaktion gmbh Stefan Rusterholz Zürichbergstrasse 17 8032 Zürich ---------------------------------- T. +41 1 253 19 55 F. +41 1 253 19 56 W3 www.interaktion.ch ----------------------------------
pkzip's the name. M: > Does someone out there know, how I can zip a folder with some files in it? > It should be readable for Winzip. > > Enviroment: Win2000 Server. > VB was available if useful. > Additional Components (applications, dll's or whatever) could be loaded if > needed. > > I didn't find a usable entry in the manual, so if you tell me to rtfm - > please point me to the corresponding entry also :)
I have developed a site using PHP and MySQL. My question: How do I share the data stored in the database with another site? Regards, Matthew
On Wed, 31 Oct 2001 14:34, Matthew Delmarter wrote: > I have developed a site using PHP and MySQL. > > My question: > How do I share the data stored in the database with another site? > > Regards, > > Matthew If you mean to let another site access your mysql data directly, you'll need to set up appropriate permissions for mysql. Check the mysql docs, under Mysql User Account management. -- David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA My favourite mythical creature? The honest politician.
If the other site is on the same server, you can use the same method to log in (same username and password). If it's on a separate computer you need to either create a new user or change the existing user to have remote access. To create a user with remote access: GRANT [privileges] ON [database.table[, database.table, ... ]] TO user@host IDENTIFIED BY password; Example: GRANT ALL PRIVILEGES ON mydatabase.* TO [EMAIL PROTECTED] IDENTIFIED BY mypassword; Remember that you need admin access to set this up. Mike "Matthew Delmarter" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I have developed a site using PHP and MySQL. > > My question: > How do I share the data stored in the database with another site? > > Regards, > > Matthew >
Hi all Sorry about what is probably a total dickhead about to enter your midst, but I've never installed php or seen it much at all before but am trying to do it now. Using RH 7.1 and Apache 1.3.19 Want to install php4 and mysql combo and totally ignorant. Installed php rpm. Restarted apache in case that was needed. made hello.php and pointed browser at it. Got the text, rather than executing it. Can I surmise that apache isn't set up properly, and if so, could someone please point me towards relevant assistance. Got really confused with the "manual", etc. Not that bright I suppose ;-) Thanks in advance Warwick
Hi Warwick, Did you look at the install notes that come with PHP? It explains there how you have to configure Apache to recognize php files and give them to the php interpreter...checkout the README or INSTALL files that come with PHP... jack -----Original Message----- From: J W W L (Warwick) Berg [mailto:[EMAIL PROTECTED]] Sent: Tuesday, October 30, 2001 11:21 PM To: [EMAIL PROTECTED] Subject: [PHP] Total Newbie in over head Hi all Sorry about what is probably a total dickhead about to enter your midst, but I've never installed php or seen it much at all before but am trying to do it now. Using RH 7.1 and Apache 1.3.19 Want to install php4 and mysql combo and totally ignorant. Installed php rpm. Restarted apache in case that was needed. made hello.php and pointed browser at it. Got the text, rather than executing it. Can I surmise that apache isn't set up properly, and if so, could someone please point me towards relevant assistance. Got really confused with the "manual", etc. Not that bright I suppose ;-) Thanks in advance Warwick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
I am not sure if this helps , but I followed the instructions on the following URL for setting up PHP and SQL. It used an older version of Apache (Apache 1.3.12) and I think the author used something like RedHat 6. Well, anyways, I followed it and it was okay. Try taking a look at the following URL: http://www.devshed.com/Server_Side/PHP/SoothinglySeamless/print.html Peter On Wed, 31 Oct 2001, J W W L (Warwick) Berg wrote: > Hi all > > Sorry about what is probably a total dickhead about to enter your midst, > but I've never installed php or seen it much at all before but am trying to > do it now. > > Using RH 7.1 and Apache 1.3.19 > > Want to install php4 and mysql combo and totally ignorant. > > Installed php rpm. > > Restarted apache in case that was needed. > > made hello.php and pointed browser at it. > > Got the text, rather than executing it. > > Can I surmise that apache isn't set up properly, and if so, could someone > please point me towards relevant assistance. Got really confused with the > "manual", etc. Not that bright I suppose ;-) > > Thanks in advance > Warwick > > > > >
Hi all Sorry about what is probably a total dickhead about to enter your midst, but I've never installed php or seen it much at all before but am trying to do it now. Using RH 7.1 and Apache 1.3.19 Want to install php4 and mysql combo and totally ignorant. Installed php rpm. Restarted apache in case that was needed. made hello.php and pointed browser at it. Got the text, rather than executing it. Can I surmise that apache isn't set up properly, and if so, could someone please point me towards relevant assistance. Got really confused with the "manual", etc. Not that bright I suppose ;-) Thanks in advance Warwick
PHP is a server-parsed language. You need to add the right directives to your httpd.conf file in the global config section. They should be something *like* the following: AddType application/x-httpd-php .php4 .php3 .phtml .php AddType application/x-httpd-php-source .phps You may also need to add them to the individual VHost. Depends on your setup (for instance, Cobalt systems are backward and require them in the VHost, not the global config). If you don't add this as a server-parsed type, it will process it as just text - like it us doing for you now. Mike "J W W L Berg" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi all > > Sorry about what is probably a total dickhead about to enter your midst, > but I've never installed php or seen it much at all before but am trying to > do it now. > > Using RH 7.1 and Apache 1.3.19 > > Want to install php4 and mysql combo and totally ignorant. > > Installed php rpm. > > Restarted apache in case that was needed. > > made hello.php and pointed browser at it. > > Got the text, rather than executing it. > > Can I surmise that apache isn't set up properly, and if so, could someone > please point me towards relevant assistance. Got really confused with the > "manual", etc. Not that bright I suppose ;-) > > Thanks in advance > Warwick > > > > >
Hello Warwick, You're correct in assuming that Apache isn't set up right. It needs to be set to parse the .php files. Here's how to do this: Locate httpd.conf (/usr/local/apache/conf/httpd.conf for my compile). And uncomment/add these lines: AddType application/x-httpd-php .php .php3 AddType application/x-httpd-php-source .phps That tells apache to parse .php and .php3 files. The .phps files will show the syntax highlighted version of the code. Good luck, Tyler Longren Captain Jack Communications [EMAIL PROTECTED] www.captainjack.com On Wed, 31 Oct 2001 17:22:47 +1300 J W W L (Warwick) Berg <[EMAIL PROTECTED]> wrote: > Hi all > > Sorry about what is probably a total dickhead about to enter your midst, > but I've never installed php or seen it much at all before but am trying > to > do it now. > > Using RH 7.1 and Apache 1.3.19 > > Want to install php4 and mysql combo and totally ignorant. > > Installed php rpm. > > Restarted apache in case that was needed. > > made hello.php and pointed browser at it. > > Got the text, rather than executing it. > > Can I surmise that apache isn't set up properly, and if so, could > someone > please point me towards relevant assistance. Got really confused with > the > "manual", etc. Not that bright I suppose ;-) > > Thanks in advance > Warwick > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > -- +------------------------------+ | Tyler Longren | | Captain Jack Communications | | [EMAIL PROTECTED] | | www.captainjack.com | +------------------------------+
On Wed, 31 Oct 2001 14:52, J W W L (Warwick) Berg wrote: > Hi all > > Sorry about what is probably a total dickhead about to enter your > midst, but I've never installed php or seen it much at all before but > am trying to do it now. > > Using RH 7.1 and Apache 1.3.19 > > Want to install php4 and mysql combo and totally ignorant. > > Installed php rpm. > > Restarted apache in case that was needed. > > made hello.php and pointed browser at it. > > Got the text, rather than executing it. > > Can I surmise that apache isn't set up properly, and if so, could > someone please point me towards relevant assistance. Got really > confused with the "manual", etc. Not that bright I suppose ;-) > > Thanks in advance > Warwick Caveat - I have absolutely no experience with Dead Rat. However, your problem #1 sounds like an Apache configuration thing - to run php under apache you need at least some sort of addtype entry in your httpd.conf. I use: # AddType allows you to tweak mime.types without actually editing it, or to # make certain files to be certain types. # For PHP 4.x, use: AddType application/x-httpd-php .php .php3 .html which tells apache to use php to parse files with extensions listed. I don't know whether the redhat apache rpm uses DSO or not - ther may be problems there also. But check for the addtype entry first - and remember to 'apachectl graceful' to force a reread of the conf file if you change anything in it. -- David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA Useless Invention: Screen door on a submarine.
Hey thanks guys for the help, but it's still not happening. Apache had already the AddType lines mentioned by y'all. Any other ideas? Thanks Warwick J W W L Berg wrote: > Hi all > > Sorry about what is probably a total dickhead about to enter your midst, > but I've never installed php or seen it much at all before but am trying > to do it now. > > Using RH 7.1 and Apache 1.3.19 > > Want to install php4 and mysql combo and totally ignorant. > > Installed php rpm. > > Restarted apache in case that was needed. > > made hello.php and pointed browser at it. > > Got the text, rather than executing it. > > Can I surmise that apache isn't set up properly, and if so, could someone > please point me towards relevant assistance. Got really confused with the > "manual", etc. Not that bright I suppose ;-) > > Thanks in advance > Warwick > > > > > >
> Hey thanks guys for the help, but it's still not happening. > Apache had already the AddType lines mentioned by y'all. It's possible the AddType lines are inside a container that will ensure they're not executed. Backtrack to the <Block> element that the AddType lines are in, and see what it does. Jason
There is no <BLOCK> element in the httpd.conf. Is that where I should be looking? Warwick Jason Murray wrote: >> Hey thanks guys for the help, but it's still not happening. >> Apache had already the AddType lines mentioned by y'all. > > It's possible the AddType lines are inside a container that > will ensure they're not executed. Backtrack to the <Block> > element that the AddType lines are in, and see what it does. > > Jason >
On Wed, 31 Oct 2001 15:15, Jason Murray wrote: > > Hey thanks guys for the help, but it's still not happening. > > Apache had already the AddType lines mentioned by y'all. > > It's possible the AddType lines are inside a container that > will ensure they're not executed. Backtrack to the <Block> > element that the AddType lines are in, and see what it does. > > Jason Might also be the php module not being loaded; check for LoadModule and AddModule for entries like: LoadModule php4_module libexec/libphp4.so and AddModule mod_php4.c which should both be in the same relative position in the list of LoadModule and Addmodule items (probably last in both cases) If all else fails, I'll be in Auckland in six weeks :-) -- David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA I'm spending a year dead for tax purposes.
John, Jason didn't literally mean for you to search for the exact string '<Block>' - he was telling you to look through the various types of <ThisIsAnApacheDirective> tags found in your httpd.conf file, such as <Directory>, <File> etc etc > There is no <BLOCK> element in the httpd.conf. Is that where I should be > looking? > Warwick > > > Jason Murray wrote: > > >> Hey thanks guys for the help, but it's still not happening. > >> Apache had already the AddType lines mentioned by y'all. > > > > It's possible the AddType lines are inside a container that > > will ensure they're not executed. Backtrack to the <Block> > > element that the AddType lines are in, and see what it does. > > > > Jason
OK, there goes any pretense of intelligence that I may have been able to muster ;-) The AddType tag was found inside another as follows: <IfModule mod_php4.c> Is there some way I can check if this module is present, otherwise what you're saying is that the AddType isn't being executed if the <IfModule> is false, yes? What a pillock. I can see this is going to be some learning curve. Warwick Jason Brooke wrote: > John, Jason didn't literally mean for you to search for the exact string > '<Block>' - he was telling you to look through the various types of > <ThisIsAnApacheDirective> tags found in your httpd.conf file, such as > <Directory>, <File> etc etc > > >> There is no <BLOCK> element in the httpd.conf. Is that where I should be >> looking? >> Warwick >> >> >> Jason Murray wrote: >> >> >> Hey thanks guys for the help, but it's still not happening. >> >> Apache had already the AddType lines mentioned by y'all. >> > >> > It's possible the AddType lines are inside a container that >> > will ensure they're not executed. Backtrack to the <Block> >> > element that the AddType lines are in, and see what it does. >> > >> > Jason > > > >
On Wed, 31 Oct 2001 15:44, J W W L (Warwick) Berg wrote: > OK, there goes any pretense of intelligence that I may have been able > to muster ;-) > > The AddType tag was found inside another as follows: > > <IfModule mod_php4.c> > > Is there some way I can check if this module is present, otherwise what > you're saying is that the AddType isn't being executed if the > <IfModule> is false, yes? > > What a pillock. I can see this is going to be some learning curve. > Warwick > Well, now check if the Loadmodule and Addmodule lines are in the conf file. Pillock? How British :-) -- David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA Dynamic linking error: Your mistake is now everywhere.
Um! could they be commented out still? # AddType application/x-httpd-php .php4 .php3 .phtml .php # AddType application/x-httpd-php-source .phps Make sure you remove the hash signs whatever they called :) AddType application/x-httpd-php .php4 .php3 .phtml .php AddType application/x-httpd-php-source .phps Just a thought! Joseph -----Original Message----- From: J W W L (Warwick) Berg [mailto:[EMAIL PROTECTED]] Sent: Wednesday, 31 October 2001 3:15 PM To: [EMAIL PROTECTED] Subject: [PHP] Re: I rest my case Hey thanks guys for the help, but it's still not happening. Apache had already the AddType lines mentioned by y'all. Any other ideas? Thanks Warwick J W W L Berg wrote: > Hi all > > Sorry about what is probably a total dickhead about to enter your midst, > but I've never installed php or seen it much at all before but am trying > to do it now. > > Using RH 7.1 and Apache 1.3.19 > > Want to install php4 and mysql combo and totally ignorant. > > Installed php rpm. > > Restarted apache in case that was needed. > > made hello.php and pointed browser at it. > > Got the text, rather than executing it. > > Can I surmise that apache isn't set up properly, and if so, could someone > please point me towards relevant assistance. Got really confused with the > "manual", etc. Not that bright I suppose ;-) > > Thanks in advance > Warwick > > > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Hey all; If i have a variable say, $seat and i want to go through variables with a number, ie. $seat1 , $seat2 etc. how would i go about it? i have one setup where $p increments (so then you have $seat$p) but i cant get it to work properly (tried all sorts of combinations with ' and " and . etc.)...and cant seem to find any info on it (dont really know what to search for).. Anyone know how one can go about it? thx. -sc
SC What you want should look something like this: ${"seat".$p} where $p can be incremented in a loop. However, I was advised to use an array which would look something like this: $seat[$p] where $p can also be incremented in a loop. Hope this helps. hugh ----- Original Message ----- From: sc <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, October 30, 2001 9:40 PM Subject: [PHP] question about variables... > Hey all; > > If i have a variable say, $seat and i want to go through variables with a > number, ie. $seat1 , $seat2 etc. how would i go about it? i have one setup > where $p increments (so then you have $seat$p) but i cant get it to work > properly (tried all sorts of combinations with ' and " and . etc.)...and > cant seem to find any info on it (dont really know what to search for).. > > Anyone know how one can go about it? > > thx. > > -sc > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
the first one that you gave me works fine... thanks for that.. -sc "Hugh Danaher" <[EMAIL PROTECTED]> wrote in message 000d01c161cf$eb160d20$9106f4d8@win95">news:000d01c161cf$eb160d20$9106f4d8@win95... > > SC > What you want should look something like this: ${"seat".$p} > where $p can be incremented in a loop. > However, I was advised to use an array which would look something like this: > $seat[$p] > where $p can also be incremented in a loop. > Hope this helps. > hugh > > > ----- Original Message ----- > From: sc <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Tuesday, October 30, 2001 9:40 PM > Subject: [PHP] question about variables... > > > > Hey all; > > > > If i have a variable say, $seat and i want to go through variables with a > > number, ie. $seat1 , $seat2 etc. how would i go about it? i have one setup > > where $p increments (so then you have $seat$p) but i cant get it to work > > properly (tried all sorts of combinations with ' and " and . etc.)...and > > cant seem to find any info on it (dont really know what to search for).. > > > > Anyone know how one can go about it? > > > > thx. > > > > -sc > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > >
I don't know if this will work for Oracle but try putting a backslash before the single quote mark (e.g. it\'s) the ' should then taken as another character by php. Hope this works for you. Hugh ----- Original Message ----- From: Kevin Dewsnup <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, October 30, 2001 4:31 PM Subject: [PHP] Problems inserting single quote into Oracle database > I am having problems with inserting single quote's > into an oracle 8.1.7 database through a form. > > When inserting 'its' it works fine. > > When inserting 'it's' I get this error: > "OCIParse: ORA-01756: quoted string not properly > terminated in blah..." > > So then I try 'it''s' (which works in SQL*Plus) I get > this error: > "OCIStmtExecute: ORA-00911: invalid character in > blah..." > > Thank's in advance! > > -Kevin > > __________________________________________________ > Do You Yahoo!? > Make a great connection at Yahoo! Personals. > http://personals.yahoo.com > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
On Tue, Oct 30, 2001 at 09:54:19PM -0800, Hugh Danaher wrote: > I don't know if this will work for Oracle but try putting a backslash before > the single quote mark (e.g. it\'s) the ' should then taken as another > character by php. > Hope this works for you. single quotes are escaped using another single quote in oracle: $var = "it''s"; will do the job. tc > Hugh > ----- Original Message ----- > From: Kevin Dewsnup <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Tuesday, October 30, 2001 4:31 PM > Subject: [PHP] Problems inserting single quote into Oracle database > > > > I am having problems with inserting single quote's > > into an oracle 8.1.7 database through a form. > > > > When inserting 'its' it works fine. > > > > When inserting 'it's' I get this error: > > "OCIParse: ORA-01756: quoted string not properly > > terminated in blah..." > > > > So then I try 'it''s' (which works in SQL*Plus) I get > > this error: > > "OCIStmtExecute: ORA-00911: invalid character in > > blah..." > > > > Thank's in advance! > > > > -Kevin > > > > __________________________________________________ > > Do You Yahoo!? > > Make a great connection at Yahoo! Personals. > > http://personals.yahoo.com > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
Give ImagePNG a try... -Jason Garber At 10:22 PM 10/29/2001 -0800, costa wrote: >The text printed on this image looks sloppy and grainy. (This image is being >generated on a linux server RH 7.1, Apache 1.3.19, with GD 1.8) I remember >seeing something about adjusting the quality of the image, but I can't find >it now, and even if I did, I don't know how much help it would be, because I >also recall seeing that it defaulted to 100. My question is this, is there a >way to generate a quality image or improve the quality of this image, or am >I stuck? As a side note, images that don't contain text seem to generate >very cleanly. Would it be possible to make the background transparent, like >a transparent gif? > >-C > ><?php >################################################ >### draw an image for the header and print some stuff on it. >############################################### > >## tell the browser what it is >header("Content-type: image/jpeg"); > >## draw a new image >$width = 600; >$height = 100; >$image = imagecreate($width, $height); > >##make the background same as page >$backg = imagecolorallocate($image, 0, 51, 102); > >##make the text white >$text = imagecolorallocate($image, 255, 255, 255); > >imagefilledrectangle($image, 0, 0, $width, $height, $backg); >imagettftext($image, 30, 0, 200, 25, $text, > >## now let's print some text to the image >"/usr/share/fonts/ttf/GARAIT.TTF", "foo"); >imagettftext($image, 40, 0, 60, 75, $text, >"/usr/share/fonts/ttf/GARAIT.TTF", "some guy"); > >## off it goes >imagejpeg($image); > >## cleanup >imagedestroy($image); > >?> > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: [EMAIL PROTECTED]
Hi, I have installed PHPMyAdmin-2.2.0 on my webserver in a directory of one my virtual hosts. My machine is running Apache 1.3.12 and BIND DNS server. I have MySQL installed already and I have already tested successfully using the text commands. My Apache configuration has virtual host directives in it and my main page is a virtual host itself. On the browser when I type "www.mydomain.com/path_to_PHPMyadmin", to access it, I encounter an error message that says: MySQL Connection Fialed Host 'mydomain.com' is not allowed to connect this MySQL server. However when I type the host name on my browser 'ns.mydomain.com/path_to_PHPMyadmin', I can access PHPMyadmin successfully. Is there something that I have to set in MYSQL to allow it to recognize virtual host names? Can I do a cross server MySQL administration also. I mean put PHPMyAdmin on one server and have it administer the databases of a MySQL server located at a different machine with different IP? Thanks. Peter
Hi! I have to create array of classes. When I do it this way: f add($sth) $this->array[] = $sth; it doesn't work :( when i'm trying to get class from there it says that this is not an object. How to do it rigth way? ------------------------------------------------------------------------ Code reviews are like sex, just anyone can do it, but skill and training can make you a lot better at it." - LJ Thomas
Hello Guys I have following code, sorry it's pretty big for posting, i want to split the output into 2 colomns, been trying almost all still can't get it working here the link, with this code online http://funzz.cjb.net/itfaq/kbase.php -------------------------- <? include "mainfile.php"; $connection = mysql_connect ("127.0.0.1", "*****", "****"); if ($connection == false){ echo mysql_errno().": ".mysql_error(); exit; } $query = "select topicid,topicname from nuke_topics order by topicname"; $result = mysql_db_query ("postnuke", $query); if ($result){ echo "<table border=1>"; $numOfRows = mysql_num_rows ($result); for ($i = 0; $i < $numOfRows; $i++){ $topicid = mysql_result ($result, $i, "topicid"); $topicname = mysql_result ($result, $i, "topicname"); $result1 = mysql_query("select time from nuke_stories where topic=$topicid"); $counter=mysql_num_rows($result1); preg_match ("/([A-Z])/i", $topicname); $letter=$topicname[0]; if($lastletter!=$letter)echo "<tr><td><font size=5><b>$letter</b></font></td></tr>"; echo "<tr><td><a href=search.php?query=&topic=$topicid>$topicname </a> (<b>$counter</b>) </td></tr>"; $lastletter=$letter; } echo "</table>"; } else{ echo mysql_errno().": ".mysql_error()."<BR>"; } mysql_close (); include "footer.php"; ?> ---------- Thank You very much, in advance Have a nice day :-)
> I have following code, sorry it's pretty big for posting, i want to > split the output into 2 colomns, been trying almost all still can't > get it working Harik, First off, have you checked the manual (http://uk.php.net/manual/en/function.mysql-result.php) and the recommendations against the use of mysql_result()? In this situation, one of the mysql_fetch_... functions might be a better choice because both data fields could be extracted in one operation. Apart from 'efficiency', the other reason for my saying this (I have never used _result()) is that I can't see where the manual talks about what _result() returns when it gets to an end-of-data situation (the _fetch_ functions return FALSE and are thus perfect for use in controlling while loops). Now to logic. May I offer a short programming lesson? If you are an experienced programmer and this is 'talking down' to you, I apologise. However this question has been asked (in a few guises) a couple of times recently, so lets get an answer up on the FAQs/archives... This program requires two processing loops: one to cycle through the available topic data, the other to display results in a two-column HTML table. Most of us think in terms of starting at the beginning (get the data) and working through to the end (display the results) - from the script provided it seems a reasonable assumption that you have done exactly this, and that everything is working properly (up to that last step before "the end"). However computers are logical but not rational. Sometimes it is worth starting at the end and working back towards the beginning! The 'second" loop is described as being responsible for presenting the results (in this example, a table with two columns). There are three logical parts to the entire process: setting up the HTML code for the table, looping through the rows (and columns), closing off with the end of table HTML code. In pseudo code it looks like: prepare the web page (as necessary) and echo the <TABLE> tag for each row of the table echo the <TR> tag echo the first column (<TD>data</TD>) echo the first column (<TD>data</TD>) echo the </TR> tag echo the </TABLE> tag and close the web page Quick aside: with two columns the above is acceptable. If there were numerous columns, but also because the other processing required here brings added complexity, an inner loop might be appropriate, thus: prepare for each row <TR> for each column echo the <TD>data</TD> </TR> finish-off Now let's talk about the topic-data loop process. Again, divide the logic into three parts: setting up MySQL and SELECTing the primary data, looping through each of the SELECTed records, and cleaning up afterwards. The existing script is neatly laid out to show this. In pseudo code, the script's logic becomes: set-up db and query table for each row returned perform secondary query/assemble and format full report data present topicId, topicName, and counter close down That being the case, can all of the processing of individual (in-bound) data records be packaged into a user-defined function? (modular programming) If the function returns true/false as well as the next data record, then the boolean state can be used to detect the end-of-data condition: set up while ( not end-of-data ) getnextrow() close down OK, so much for all that, how do the two halves get put back together? There are two loops, one cycling through HTML table tags, and the other cycling through a DB recordset/resultset. Because the output format is the important part/has the higher number of logical components/subdivisions, it must dominate the logic. Thus the data-provisioning part should be inverted - instead of squirting out data like a hose, which the HTML then has to be 'fitted around'; it should be set up like an on-demand drip feed, so that when the HTML requires a 'squirt' of data, it is delivered, one swallow at a time! Let's do this in two stages - first of all, with no data processing (ie just reporting/important part first). Combine the two set up code-blocks, and the two close-down code blocks and outline the HTML processing: prepare the page (as necessary) and echo the <TABLE> tag set-up db and query table --- for each row of the table echo the <TR> tag for each column echo the column data (<TD>data</TD>) echo the </TR> tag --- echo the </TABLE> tag close down (the DB) But how do we know how many rows to put in the table? Answer: we don't, and so have to set up the loop controls accordingly. if you prefer to continue using for-loops you can control these by use of the numOfRows = mysql_num_rows ($result) code; or if you make the outer into a while-loop then the idea of the boolean (mentioned above) brings a process-while-there's-still-data logic into play: Function getnextrow(...) perform secondary query/assemble and format full report data present topicId, topicName, and counter set end-of-data true/false (if needed for while-loop control ) getnextrow() while ( not end-of-data) echo the <TR> tag while ( end-of-data) and (column is 1 or 2) echo the column data (<TD>data</TD>) getnextrow() echo the </TR> tag or for each row ( num_rows / 2 and rounded up ) echo the <TR> tag for each column if ( getnextrow() <> end of data) echo the column data (<TD>data</TD>) echo the </TR> tag In case you're wondering: why are there two getnextrow()-s in the 'while-loop' example solution? The first takes care of the nil-result scenario. The second getnextrow() is not getting the data for the row being output in the HTML, it is checking to see if there is more data for the next column-row and thereby feeding the boolean conditions that control that code. Note that if a nil-data result is acceptable, and if in that situation the table should not appear at all (avoiding the strange display of a 'table' with column headings but no data rows, for example) then the first getnextrow() should be part of the <TABLE> set up processing, and control if there is any such processing at all ! > Have a nice day :-) =and you, =dn
WoW, thank you very much DL Neil, this is the best reply i've ever got during my time on the web (since 1994).
I have a problem with php (4.0.6) and ldap (openldap sever 2.0.11): When I use this .ldif file from shell I can enter this value without problem: ------ dn: cn=pippo, dc=example, dc=it uid: pippo cn: pippo sn: pippo objectclass: person objectclass: account objectclass: posixAccount objectclass: top userpassword: {crypt}$1$a0811139$/xUzQIdsvChM1.mhBZx6j/ loginshell: /bin/bash uidnumber: 505 gidnumber: 505 homedirectory: /home/pippo ------ but when I use this php script: ------ [...] $ldap_bind = ldap_bind ($ldap_conn, $ldap_manager_dn, $ldap_password); $info ["objectClass"] = "person"; #ok $info ["uid"] = "pippo"; $info ["cn"] = "pippo"; #ok $info ["sn"] = "pippo"; #ok $info ["objectClass"] = "person"; $info ["objectClass"] = "account"; $info ["objectClass"] = "posixAccount"; $info ["objectClass"] = "top"; $info ["userPassword"] = "{crypt}$1$a0811139$/xUzQIdsvChM1.mhBZx6j/"; $info ["loginShell"] = "/bin/bash"; $info ["uidNumber"] = "505"; $info ["gidNumber"] = "505"; $info ["homeDirectory"] = "/home/pippo"; $ldap_bind = ldap_add ($ldap_conn, "cn=pippo, dc=example, dc=it", $info); ldap_close ($ldap_conn); [...] ------ I obtain tha following error message (in /var/log/httpd/error.log): ------ LDAP: Object class violation additional info: attribute not allowed ------ Note that if I use only entries tagged with the comment on the right the add is done... Why? Can anyone help me please? Thanx, tode [ [EMAIL PROTECTED] ]
On Mon, Oct 29, 2001 at 04:54:37PM -0700, Johnson, Kirk wrote: > Thanks for the link, Kurt. Can you also point to any authentication code > examples, or further discussion? The user comments in the manual suggest > there are at least a couple ways to code stuff, ldap_compare vs ldap_bind. > Any additional help appreciated. I might be able to help if you have some more precise questions, but basically there are two ways LDAP can be used. You can either use it as a data store or you can have LDAP make the authentication decision for you. If you want the user to supply username and password, the authentication can be done as follows: As data store: Hopefully the passwords are stored encrypted. Then there are two ways. If the password is stored encrypted with some unknown salt where the salt is stored together with the password (like the traditional UNIX way), your PHP script retrieves the encrypted password from LDAP, checks the salt, encrypts the user supplied password using the salt, and compare the two. If you don't use a salt you can encrypt the password from the user and just do an ldap_compare to check that it's the same as in the LDAP server. You get better security by not allowing people to read the encrypted passwords from LDAP. To store passwords "encrypted" in LDAP, SHA1 might be a good choice, PHP has this. As decision maker: You can simply bind to the server on behalf of the user, you use the user supplied username and password as arguments to ldap_bind(). If the bind succeeds, you let the user access your stuff. In this case you should consider using SSL/TLS for talking to the server. There are other ways to authenticate with LDAP, RFC 2829 gives a good overview. You can find it at for instance http://www.ietf.org/rfc/rfc2829.txt I could go into more detail, but to write a complete general overview would be a lot of work. You might also have a look at a really short presentation I've made at http://www.uninett.no/info/seminar/gnomis/ldapauth.pdf Stig
I am trying to do a joined query using PEAR DB? My code looks something like this: $sql = "SELECT wwwpages.pid,wwwpages.name,media.pid,media.name FROM wwwpages, media WHERE wwwpages.pid = '$pid'"; if(DB::isError($result = $db->query($sql))){ echo "ERROR:" . DB::errorMessage($result); } else { while($row = $result->fetchRow(DB_FETCHMODE_ASSOC)){ echo $row[wwwpages.name]; echo $row[media.name] } } When I specify '$row[wwwpages.name]' I get a blank result, and if I try '$row[name]', I am obviously not specifying a table therefore it results in name for wwwpages table. How do I go about displaying both? Thanks in advance.
MG PUBLISHING 4865 HWY 138,R.R 1 ST-ANDREWS WEST ONTARIO, KOC 2A0 PRESS RELEASE CANADIAN SUBSIDY DIRECTORY YEAR 2001 EDITION Legal Deposit-National Library of Canada ISBN 2-922870-01-4 M.G. Publishing is offering to the public a revised edition of the Canadian Subsidy Directory, a guide containing more than 1700 direct and indirect financial subsidies, grants and loans offered by government departments and agencies, foundations, associations and organizations. In this new 2001 edition all programs are well described. The Canadian Subsidy Directory is the most comprehensive tool to start up a business, improve existent activities, set up a business plan, or obtain assistance from experts in fields such as: Industry, transport, agriculture, communications, municipal infrastructure, education, import-export, labor, construction and renovation, the service sector, hi-tech industries, research and development, joint ventures, arts, cinema, theatre, music and recording industry, the self employed, contests, and new talents. Assistance from and for foundations and associations, guidance to prepare a business plan, market surveys, computers, and much more! To obtain the Canadian Subsidy Directory call one of the following distributors: Fureteur: 450-465-5597 Canadian Publications 866-322-3376 ALSO AVAILABLE U.S. SUBSIDY DIRECTORY To remove your e-mail from our mailing list contact us at: [EMAIL PROTECTED]
All, I am opening a popup window using the following code: <a href="" onClick="window.open('/gallery/upload_form.php3', 'triviaWnd', 'height=360,width=620,status=1,resizable=1,top=200,left=120'); return false; "><img src="gallery/images/bt_upload.gif" width="60" height="17" border="0" alt="Use upload to copy your own images to the web site"></a> My popup window then runs some PHP code and finally displays a status message with a close window button. When the close window button is clicked I need to close the popup window and refresh the parent window or alternatively (preferably) just recalling the PHP script. Here is the HTML for my popup window: <html> <head> <meta http-equiv="content-type" content="text/html;charset=ISO-8859-1"> <meta name="generator" content="Adobe GoLive 5"> <title></title> <link rel="stylesheet" href="../master.css"> </head> <tr><br><td>The file [<b>08lg.jpg</b>]<B>Has been Successfully uploaded to the SouthLondonKidz Website</td><body bgcolor="#ffffff" leftmargin="50" marginwidth="0" topmargin="0" marginheight="0" background="c:/program files/apache group/apache/kidz/images/bgs/bg_grid.gif"> <FORM METHOD="POST" ACTION = "../gallery01.php3" ><PRE><INPUT TYPE="submit" ALIGN=LEFT VALUE="Close Window" onClick="window.close()"></PRE></FORM></HTML> The action for the form is only fired if the onClick="window.close() is removed. My question is how can I close the window and refresh or reload the specified window. TIA, Roger
> The action for the form is only fired if the onClick="window.close() is > removed. My question is how can I close the window and refresh or reload > the specified window. > <script language="javascript"> function endWindow() { window.opener.location.reload(); window.close(); } </script> <a href="javascript:endWindow()">Close Window</a> M:
Hi! Where is file upload function? ;) From begining: some time I've found somewhere this handler: clearing_report_file is the input that is user sends to me. if(!isset($clearing_report_file)) { pp_xfer_trans(); } else { if (!@copy($clearing_report_file, $CFG["local_uri"]."/cfd-" . $batch .".txt")) { echo("\n<b>Something barfed, check the path to and the permissions for the upload directory</b>"); }else { // do domething exit(); } } but now, in php 4.0.5 this function don't want to work ;( i have allways something barfed message, even if i try to wrote to /tmp directory now i have this in phpinfo: HTTP_POST_FILES["userfile"] Array ( [name] => helyjon [type] => [tmp_name] => none [size] => 0 ) where is my file? $variables shows the same values, where are my contents? ------------------------------------------------------------------------ Code reviews are like sex, just anyone can do it, but skill and training can make you a lot better at it." - LJ Thomas
Dear Venerable PHP List, I hope this isn't viewed as impolite on this list. I just wanted to write all of you to thank you for the immeasurable contributions you have made to the project I've been working on for the last three months: http://www.readfrank.com/ It is a site supporting an English language literary magazine published here in Paris, and has new stories and articles every day. While it is hard to see through the pretty pictures and words to the infinitely recursing arrays (which this list helped me debug) and the amazing grep challenge 2000 (which this list polished for me), we all know how crucial those invisible little combinations of syntax can be to bringing beautiful things to the surface. Please feel free to visit the site *if you want*. I just wanted to let you ALL know that even though we've never met, you've made me a smarter person and have helped bring the work of perhaps otherwise obscured talented writers and artists to the masses. Thank You Friends, Sondra
On Tuesday 30 October 2001 20:33, David Yee wrote: > Well for that example I'm using 0 as the index for the first element of > the array, so deleting element #2 results in 3 being deleted. BTW to > correct myself in the second example I gave I want: > > $a = (1,2,4,5) instead of (1,2,3,4). > > > $a = array(1,2,3,4,5) > > > > unset($a[2]); > > > > $a now = (1, 2, NULL, 4, 5), but I want (1, 2, 3, 4). Now do you want (1, 2, 4, 5) or (1, 2, 3,4 ) ? If second: So you want the array always to contain a continuous list of numbers (1..n) ? So it's irrelevant *what* element of the array you delete, only *how many* elements you delete? Why not just store the maximum value then and use $MaxVal-- instead of unset ($a[something]), $Index - 1 instead of $a[$Index] ? If the first: remember that arrays in PHP are always associative. So you get (0 => 1, 1 => 2, 3 => 4, 4 => 5) if you want the keys "reordered" you could use array_values() on that.. -- Christian Reiniger LGDC Webmaster (http://lgdc.sunsite.dk/) "Never doubt that a small group of thoughtful, committed people can change the world... Indeed, it's the only thing that ever has." - Margaret Mead
Hi all! Any idea how to use (install) asian fonts on an english version of RH? I need them in the gd library, to generate an image with chinese/japanese text. any clue greatly appreciated! Daniel BI