Re: [PHP-DB] database or array?
On Thursday 29 August 2002 14:18, Bryan McLemore wrote: Should I design the program so that it will take all the information out of the database and put it into arrays and then print it? or should it directly acess the database? It probably depends on your situation. If you need to process the results it may be easier to read them all into an array first. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* When you're not looking at it, this fortune is written in FORTRAN. */ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] douplicate entry
Hi guys, I have a community site running, where members can upload images of themselves. The images are stored inside blobs of a mysql db. Now sometimes -no clue how they do it- it happens that I get an errormsg saying douplicate entry for bla.jpg I guess they do press the upload button twice or something similar. Of course there is a unique index on the column. My question is how to prevent this error? Thank you for any help on this. Andy -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] douplicate entry
Andy: If indeed it is the fact that users are clicking the 'upload' button twice, then you could incoporate a flood control script that dissallows multiple uploads for the same file and same IP Address for a specific time period (10 seconds perhaps). I used to have one of these, but have mislaid it. Perhaps you could ask for one here or go looking at hotscripts.com. Hope that's of some help... Russ -Original Message- From: Andy [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 29, 2002 3:06 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] douplicate entry Hi guys, I have a community site running, where members can upload images of themselves. The images are stored inside blobs of a mysql db. Now sometimes -no clue how they do it- it happens that I get an errormsg saying douplicate entry for bla.jpg I guess they do press the upload button twice or something similar. Of course there is a unique index on the column. My question is how to prevent this error? Thank you for any help on this. Andy -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] keeping form field data when reloading a form
yes thats right Russ [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]. .. Chip: Just use the names of the fields as the values too: input type='text' name='Email' value='$Email' / HTH :-) Russ -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 21, 2002 1:58 AM To: PHP_DB Subject: [PHP-DB] keeping form field data when reloading a form I have my email checker working now, and all the other fields are checked also, but when I do enter some wrong data the form is reloaded with all blank fields. I'm sure there is a way to keep the existing data in the fields so the end-user will only have to change the incorrect fields, and not have to re-enter all the data. But how? -- Chip Wiegand Computer Services Simrad, Inc www.simradusa.com [EMAIL PROTECTED] There is no reason anyone would want a computer in their home. --Ken Olson, president, chairman and founder of Digital Equipment Corporation, 1977 (They why do I have 9? Somebody help me!) -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] odbc data sort problem (i think) :)
hey guys ! I´m trying to use a if syntax to compare data and preselect radiobuttons. I tried it like that: if ($checked == Patch) $checked6 = bla; With numbers it works great but with char my $checked6 variable is empty ! I know php is case sensitive and I´m sure that problem is not the case sensitive so please help, im using a MS SQL Server 2000 (enterprise edition) and the odbc driver! thanks guys! - [EMAIL PROTECTED] - -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: odbc data sort problem (i think) :)
i got the problem. the odbc driver fills unuses spaces in a row with blanks. goddamn *g* cu Lukas Boldrino [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... hey guys ! I´m trying to use a if syntax to compare data and preselect radiobuttons. I tried it like that: if ($checked == Patch) $checked6 = bla; With numbers it works great but with char my $checked6 variable is empty ! I know php is case sensitive and I´m sure that problem is not the case sensitive so please help, im using a MS SQL Server 2000 (enterprise edition) and the odbc driver! thanks guys! - [EMAIL PROTECTED] - -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Script to control mysql users?
I need to add mysql users to some databases, but my dumb control panel (ensim) doesn't seem to have a feature to do that, and I'm nothing in the mysql database. Does anyone have a script to let me add them automaticly if I supply it with the root password? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Script to control mysql users?
read mysql.com's documentation on the GRANT command. Or install phpmyadmin and use that. Adam On Thu, 29 Aug 2002, Leif K-Brooks wrote: I need to add mysql users to some databases, but my dumb control panel (ensim) doesn't seem to have a feature to do that, and I'm nothing in the mysql database. Does anyone have a script to let me add them automaticly if I supply it with the root password? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] This is driving me insane!
HI all... I'm at my end, would some kind soul please help? I'm working on a database using SuSE 8.0, mysql, and PHP. All the standard installs. I need to use exec, unlink, etc. BUT the durn PHP is stuck in safe_mode and I can't get it out. I've looked in /etc/php.ini and it shows safe_mode as off, but when I use phpinfo() it is show on. Can anyone help? Thanks JIM -- Jim Hatridge Linux User #88484 -- BayerWulf Linux System # 129656 The Recycled Beowulf Project Looking for throw-away or obsolete computers and parts to recycle into a Linux super computer -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] This is driving me insane!
restart apache Adam On Thu, 29 Aug 2002, James Hatridge wrote: HI all... I'm at my end, would some kind soul please help? I'm working on a database using SuSE 8.0, mysql, and PHP. All the standard installs. I need to use exec, unlink, etc. BUT the durn PHP is stuck in safe_mode and I can't get it out. I've looked in /etc/php.ini and it shows safe_mode as off, but when I use phpinfo() it is show on. Can anyone help? Thanks JIM -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] This is driving me insane!
Have you looked at which configuration file you are using? That is also shown in phpinfo. I have often edited the wrong php.ini file and gone nuts when none of my changes took place. You might need to HUP httpd, though I'm not positive on that one. Give it a try though. Chip On Thu, 29 Aug 2002, James Hatridge wrote: HI all... I'm at my end, would some kind soul please help? I'm working on a database using SuSE 8.0, mysql, and PHP. All the standard installs. I need to use exec, unlink, etc. BUT the durn PHP is stuck in safe_mode and I can't get it out. I've looked in /etc/php.ini and it shows safe_mode as off, but when I use phpinfo() it is show on. Can anyone help? Thanks JIM -- Jim Hatridge Linux User #88484 -- BayerWulf Linux System # 129656 The Recycled Beowulf Project Looking for throw-away or obsolete computers and parts to recycle into a Linux super computer -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: Reload the page without losing variables
Hi, why don't you try to put your variables in an array and POST that array to PHP_SELF or POST the variables from results.php as HIDDEN to herself? In case of the array solution, would it be possible for you to arrange the order in the array and just read each time the array in the new sorted order? Damokles. Achilleas Maroulis [EMAIL PROTECTED] wrote in message 000801c24e87$1ac05900$cfffb482@achilles">news:000801c24e87$1ac05900$cfffb482@achilles... Hi. I have a little problem concerning passing variables or reloading the page. I have a search fom page (search.php) which POSTS some variables to another page displaying the results (results.php). What I want to do is to let the users change the order of appearance in the last page. I thought I should use a variable named $order and put it into the select string like this: SELECT fields... FROM tables... WHERE expresions ORDER BY $order ASC and then make a link of the header of each column like this: a href=\results.php?order=HEADER_NAME\HEADER_NAME/a This would force the page to reload with a new order of appearance of the results but if I do this I will lose all the other variables that came to this page by the previous form. I wonder if there is a better way to refresh the page, without losing my variables, than using sessions or by sending again all my variables through the url (it would become too big and ugly...) With a great respect to this list (it has helped me alot in the past), Achilles -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] how to hide source code??
hii im using php script with mysql. i want to hide the script from the admin or from the person who has privileges to access all the data. bcos i use ftp to upload the files. and i don't want anyone should be able to view the source. is it possible to do so? thnx and regds, smita. _ Send and receive Hotmail on your mobile device: http://mobile.msn.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] how to hide source code??
set you to owner of the script and then chmod 700 it Adam On Thu, 29 Aug 2002, Smita Manohar wrote: hii im using php script with mysql. i want to hide the script from the admin or from the person who has privileges to access all the data. bcos i use ftp to upload the files. and i don't want anyone should be able to view the source. is it possible to do so? thnx and regds, smita. _ Send and receive Hotmail on your mobile device: http://mobile.msn.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] how to hide source code??
Wouldn't that make php unable to read it as well? Then it is useless as well. Ryan -Original Message- From: Adam Williams [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 29, 2002 1:00 PM To: Smita Manohar Cc: [EMAIL PROTECTED] Subject: Re: [PHP-DB] how to hide source code?? set you to owner of the script and then chmod 700 it Adam On Thu, 29 Aug 2002, Smita Manohar wrote: hii im using php script with mysql. i want to hide the script from the admin or from the person who has privileges to access all the data. bcos i use ftp to upload the files. and i don't want anyone should be able to view the source. is it possible to do so? thnx and regds, smita. _ Send and receive Hotmail on your mobile device: http://mobile.msn.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] how to hide source code??
oh yeah duh me, set it 701 Adam On Thu, 29 Aug 2002, Ryan Jameson (USA) wrote: Wouldn't that make php unable to read it as well? Then it is useless as well. Ryan -Original Message- From: Adam Williams [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 29, 2002 1:00 PM To: Smita Manohar Cc: [EMAIL PROTECTED] Subject: Re: [PHP-DB] how to hide source code?? set you to owner of the script and then chmod 700 it Adam On Thu, 29 Aug 2002, Smita Manohar wrote: hii im using php script with mysql. i want to hide the script from the admin or from the person who has privileges to access all the data. bcos i use ftp to upload the files. and i don't want anyone should be able to view the source. is it possible to do so? thnx and regds, smita. _ Send and receive Hotmail on your mobile device: http://mobile.msn.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] how to hide source code??
Seems to me the truth is there is really no way to do this. Since an admin can take ownership any time he wants, and world read would allow anyone to view the source which is part of the problem. I've always thought that scripting languages should allow for source code encryption and have the parser program able to decrypt it based on a seed. No encryption is fool proof but it would be a step to protecting our intellectual property as coders. Compiled applications have this advantage already because once compiled to decompile it is an ugly process. In one case, in an ethically questionable situation, I chose to keep the applications guts on my own server, and had the customer's server request the page from my server using PHP's file() function. Checked things like requestor domain and such to validate the source of the request. It worked quite well, but added a point of failure to the system. It turned out I was correct to be concerned, the customer decided to not pay for it, and attempted to move the code to a production machine at which point it simply stopped working. :-) All they had was a few php files of only a few lines each. Ryan -Original Message- From: Adam Williams [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 29, 2002 1:06 PM To: Ryan Jameson (USA) Cc: [EMAIL PROTECTED] Subject: RE: [PHP-DB] how to hide source code?? oh yeah duh me, set it 701 Adam On Thu, 29 Aug 2002, Ryan Jameson (USA) wrote: Wouldn't that make php unable to read it as well? Then it is useless as well. Ryan -Original Message- From: Adam Williams [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 29, 2002 1:00 PM To: Smita Manohar Cc: [EMAIL PROTECTED] Subject: Re: [PHP-DB] how to hide source code?? set you to owner of the script and then chmod 700 it Adam On Thu, 29 Aug 2002, Smita Manohar wrote: hii im using php script with mysql. i want to hide the script from the admin or from the person who has privileges to access all the data. bcos i use ftp to upload the files. and i don't want anyone should be able to view the source. is it possible to do so? thnx and regds, smita. _ Send and receive Hotmail on your mobile device: http://mobile.msn.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] how to hide source code??
Em Qui, 2002-08-29 às 16:05, Adam Williams escreveu: oh yeah duh me, set it 701 Adam On Thu, 29 Aug 2002, Ryan Jameson (USA) wrote: Wouldn't that make php unable to read it as well? Then it is useless as well. Oh, please, setting x bit will permit what ? PHP has to READ the file to execute it. And, if the admin has root privileges, what you can do to prevent him to view the file (a plain text php file) ? One simple thing to do is to make the source so difficult to understand that people would consider it unreadable. I think the right term is to obfuscate the code. There is programs to do this to C, Perl, Tcl, etc., but I don't know if there is one for PHP. Encryption is not enough because PHP would need to decrypt it. Hmm, and if you make a PHP module (binary) and use its functions from the PHP plain text file ? -- Mateus Cordeiro Inssa [EMAIL PROTECTED] Hyperdrive Sistemas signature.asc Description: PGP signature
RE: [PHP-DB] how to hide source code??
The last idea is good, but it certainly is an excessive amount of effort. I've been coding PHP since 1998 and I have yet to need to build my own module. My goal with encryption would be to keep the average person out of the source code. I imagine if PHP were to allow for encrypted code within a month there would be a downloadable decrypter somewhere to be found. :-\ Ryan -Original Message- From: Mateus Cordeiro Inssa [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 29, 2002 1:26 PM To: [EMAIL PROTECTED] Subject: RE: [PHP-DB] how to hide source code?? Em Qui, 2002-08-29 às 16:05, Adam Williams escreveu: oh yeah duh me, set it 701 Adam On Thu, 29 Aug 2002, Ryan Jameson (USA) wrote: Wouldn't that make php unable to read it as well? Then it is useless as well. Oh, please, setting x bit will permit what ? PHP has to READ the file to execute it. And, if the admin has root privileges, what you can do to prevent him to view the file (a plain text php file) ? One simple thing to do is to make the source so difficult to understand that people would consider it unreadable. I think the right term is to obfuscate the code. There is programs to do this to C, Perl, Tcl, etc., but I don't know if there is one for PHP. Encryption is not enough because PHP would need to decrypt it. Hmm, and if you make a PHP module (binary) and use its functions from the PHP plain text file ? -- Mateus Cordeiro Inssa [EMAIL PROTECTED] Hyperdrive Sistemas -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] how to hide source code??
Forgive me for sticking my nose in the middle of this, but stupid question here: This sounds like more of an architectural thing. A further abstracted view of the information you're dealing with. You (Smita) stated that the admin needs to see all of the data and you're concerned about him (or her) seeing your code. Aren't the two separate? Application layer and data layer? This seems to suggest placing the data and application content in two separate areas of the web server and restricting rights to those directories. I believe this can be pulled off in the httpd.conf file if you're using Apache. I'm also pretty sure that's what the cgi-bin folder is for in most web hosting scenarios. As the admin of the site I can see what's in that folder, but nodody else can. I can't even see the folder from my browser. So I stick my scripts in there. Everything else goes in the public-html folder and users can see the source for that stuff, but they only see the results of the scripts executed on the server. Access to cgi-bin and public-html are both set in Apache's httpd.conf file. This would effectively differentiate between a data admin and the application admin (you). I haven't had to deal with this in the past and could definitely see it as a mjor concern down the road so I'm interested in what the real solution is. -Original Message- From: Ryan Jameson (USA) [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 29, 2002 3:18 PM To: [EMAIL PROTECTED] Subject: RE: [PHP-DB] how to hide source code?? Seems to me the truth is there is really no way to do this. Since an admin can take ownership any time he wants, and world read would allow anyone to view the source which is part of the problem. I've always thought that scripting languages should allow for source code encryption and have the parser program able to decrypt it based on a seed. No encryption is fool proof but it would be a step to protecting our intellectual property as coders. Compiled applications have this advantage already because once compiled to decompile it is an ugly process. In one case, in an ethically questionable situation, I chose to keep the applications guts on my own server, and had the customer's server request the page from my server using PHP's file() function. Checked things like requestor domain and such to validate the source of the request. It worked quite well, but added a point of failure to the system. It turned out I was correct to be concerned, the customer decided to not pay for it, and attempted to move the code to a production machine at which point it simply stopped working. :-) All they had was a few php files of only a few lines each. Ryan -Original Message- From: Adam Williams [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 29, 2002 1:06 PM To: Ryan Jameson (USA) Cc: [EMAIL PROTECTED] Subject: RE: [PHP-DB] how to hide source code?? oh yeah duh me, set it 701 Adam On Thu, 29 Aug 2002, Ryan Jameson (USA) wrote: Wouldn't that make php unable to read it as well? Then it is useless as well. Ryan -Original Message- From: Adam Williams [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 29, 2002 1:00 PM To: Smita Manohar Cc: [EMAIL PROTECTED] Subject: Re: [PHP-DB] how to hide source code?? set you to owner of the script and then chmod 700 it Adam On Thu, 29 Aug 2002, Smita Manohar wrote: hii im using php script with mysql. i want to hide the script from the admin or from the person who has privileges to access all the data. bcos i use ftp to upload the files. and i don't want anyone should be able to view the source. is it possible to do so? thnx and regds, smita. _ Send and receive Hotmail on your mobile device: http://mobile.msn.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
FW: [PHP-DB] how to hide source code??
hi Basically the answer is no. However Zend (www.zend.com) produce commercial software which compiles the php, making it run faster and the source unreadable, but it is not cheap so you need a good enough reason to spend the money. On the other hand it is the commercial arm of php so you are supporting php in the process. Not sure if there are any other options Peter --- Excellence in internet and open source software --- Sunmaia www.sunmaia.net tel. 0121-242-1473 --- -Original Message- From: Smita Manohar [mailto:[EMAIL PROTECTED]] Sent: 29 August 2002 18:59 To: [EMAIL PROTECTED] Subject: [PHP-DB] how to hide source code?? hii im using php script with mysql. i want to hide the script from the admin or from the person who has privileges to access all the data. bcos i use ftp to upload the files. and i don't want anyone should be able to view the source. is it possible to do so? thnx and regds, smita. _ Send and receive Hotmail on your mobile device: http://mobile.msn.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Help with code
I don't know if this is the place for a new programmer to get help. But here goes.. // list items and get input for today's item uses/receipts print (tr align=center valign=top\n); print (td align=left valign=topselect name=itemchoiceoptionChoose Item/o ption\n); I am using the following code to let my users choose from a list of inventory items: $userarray = mysql_fetch_array($resultuser); while ($itemarray = mysql_fetch_array($resultitem)) { print (option value=$itemarray[description]$itemarray[description]/option\n); } print (/select\n); print (/td\n); Some example items from which they choose areapple sauce, case, 12/8oz and Beef, Patties Lean, A627, 40#, gov. My problem is such. When they choose and item and submit the transaction. $qtrans = insert into $tbltrans values('0', 'daily', '$building', '$itemchoice', '0', '$count', '0', '$ddate', '$cat'); I am loosing all of item description after the first comma. Beef, Patties Lean, A627, 40, gov turns into Beef,. Can anyone help? Michael Cortes Fort LeBoeuf School District 34 East 9th Street PO Box 810 Waterford PA 16411-0810 814.796.4795 Fax1 814.796.3358 Fax2 978-389-1258 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Multiple outer joins submitted via ODBC driver to MS Access??
I am using PHP 4.1 with the ODBC driver on MS Windows 2000, running IIS. I am trying to submit a SQL statement with multiple outer joins to a MS Access database. Does anyone know the syntax for creating such MULTIPLE outer joins? As it is, my current SQL statement drops rows for which certain columns have NULL values. Thanks, Bill. My current, inner join syntax is: $class_query = SELECT sample.Sample, type.type_name, chon_class.class_name, chon_group.groupname, brecciation.brec_type FROM sample,type,chon_class,chon_group,brecciation WHERE sample.type = type.type AND sample.chon_class = chon_class.chon_class AND sample.chon_group = chon_group.chon_group AND sample.brecciation = brecciation.brecciation AND sample.type=$met_type AND chon_class.class_name LIKE '%$chondritic_class%' ORDER BY chon_group.groupname,brecciation.brec_type; -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] how to hide source code??
Apache can execute a file without reading it. Don't believe me? Make a file 701 and then open it in apache. Adam On 29 Aug 2002, Mateus Cordeiro Inssa wrote: Em Qui, 2002-08-29 às 16:05, Adam Williams escreveu: oh yeah duh me, set it 701 Adam On Thu, 29 Aug 2002, Ryan Jameson (USA) wrote: Wouldn't that make php unable to read it as well? Then it is useless as well. Oh, please, setting x bit will permit what ? PHP has to READ the file to execute it. And, if the admin has root privileges, what you can do to prevent him to view the file (a plain text php file) ? One simple thing to do is to make the source so difficult to understand that people would consider it unreadable. I think the right term is to obfuscate the code. There is programs to do this to C, Perl, Tcl, etc., but I don't know if there is one for PHP. Encryption is not enough because PHP would need to decrypt it. Hmm, and if you make a PHP module (binary) and use its functions from the PHP plain text file ? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] how to hide source code??
Em Qui, 2002-08-29 às 17:48, Adam Williams escreveu: Apache can execute a file without reading it. Don't believe me? Make a file 701 and then open it in apache. Oh, yes, so can apache bypass the kernel ? I don't think so, unless it is running as root or the file gets owned by the same user apache runs. The x bit means the O.S. will try to execute that file. Your argument it's like to say setting the x bit in .doc documents permit or not its reading. The x could do something usefull to cgi's, they are really executed (by execve system call). -- Mateus Cordeiro Inssa [EMAIL PROTECTED] Hyperdrive Sistemas signature.asc Description: PGP signature
RE: [PHP-DB] Help with code
Hi try echoing the actual query, after the variables have been converted to values $qtrans = insert into $tbltrans values('0', 'daily', '$building', '$itemchoice', '0', '$count', '0', '$ddate', '$cat'); echo $qtrans ; and see if a comma or quote mark is in the wrong place. HTH Peter --- Excellence in internet and open source software --- Sunmaia www.sunmaia.net tel. 0121-242-1473 --- -Original Message- From: Michael Cortes [mailto:[EMAIL PROTECTED]] Sent: 29 August 2002 20:33 To: [EMAIL PROTECTED] Subject: [PHP-DB] Help with code I don't know if this is the place for a new programmer to get help. But here goes.. // list items and get input for today's item uses/receipts print (tr align=center valign=top\n); print (td align=left valign=topselect name=itemchoiceoptionChoose Item/o ption\n); I am using the following code to let my users choose from a list of inventory items: $userarray = mysql_fetch_array($resultuser); while ($itemarray = mysql_fetch_array($resultitem)) { print (option value=$itemarray[description]$itemarray[description]/option\n); } print (/select\n); print (/td\n); Some example items from which they choose areapple sauce, case, 12/8oz and Beef, Patties Lean, A627, 40#, gov. My problem is such. When they choose and item and submit the transaction. $qtrans = insert into $tbltrans values('0', 'daily', '$building', '$itemchoice', '0', '$count', '0', '$ddate', '$cat'); I am loosing all of item description after the first comma. Beef, Patties Lean, A627, 40, gov turns into Beef,. Can anyone help? Michael Cortes Fort LeBoeuf School District 34 East 9th Street PO Box 810 Waterford PA 16411-0810 814.796.4795 Fax1 814.796.3358 Fax2 978-389-1258 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] how to hide source code??
I encourage you to create a file whatever.html and set it 701 and then look at it with a browsing by connecting to your webserver. http://server.com/~user/whatever.html will be displayed even though it is 701. I've done it many times. Adam On 29 Aug 2002, Mateus Cordeiro Inssa wrote: Em Qui, 2002-08-29 às 17:48, Adam Williams escreveu: Apache can execute a file without reading it. Don't believe me? Make a file 701 and then open it in apache. Oh, yes, so can apache bypass the kernel ? I don't think so, unless it is running as root or the file gets owned by the same user apache runs. The x bit means the O.S. will try to execute that file. Your argument it's like to say setting the x bit in .doc documents permit or not its reading. The x could do something usefull to cgi's, they are really executed (by execve system call). -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Help with code
If it is cutting off at the spaces (like is apple sauce, etc... cutting off after apple instead of the comma after sauce), try urlencode'ing the data before passing it to the next page. For your print option statement, try this: print (option value=urlencode($itemarray[description])$itemarray [description]/option\n); HTH Maureen Peter Lovatt [EMAIL PROTECTED] said: Hi try echoing the actual query, after the variables have been converted to values $qtrans = insert into $tbltrans values('0', 'daily', '$building', '$itemchoice', '0', '$count', '0', '$ddate', '$cat'); echo $qtrans ; and see if a comma or quote mark is in the wrong place. HTH Peter --- Excellence in internet and open source software --- Sunmaia www.sunmaia.net tel. 0121-242-1473 --- -Original Message- From: Michael Cortes [mailto:[EMAIL PROTECTED]] Sent: 29 August 2002 20:33 To: [EMAIL PROTECTED] Subject: [PHP-DB] Help with code I don't know if this is the place for a new programmer to get help. But here goes.. // list items and get input for today's item uses/receipts print (tr align=center valign=top\n); print (td align=left valign=topselect name=itemchoiceoptionChoose Item/o ption\n); I am using the following code to let my users choose from a list of inventory items: $userarray = mysql_fetch_array($resultuser); while ($itemarray = mysql_fetch_array($resultitem)) { print (option value=$itemarray[description]$itemarray[description]/option\n); } print (/select\n); print (/td\n); Some example items from which they choose areapple sauce, case, 12/8oz and Beef, Patties Lean, A627, 40#, gov. My problem is such. When they choose and item and submit the transaction. $qtrans = insert into $tbltrans values('0', 'daily', '$building', '$itemchoice', '0', '$count', '0', '$ddate', '$cat'); I am loosing all of item description after the first comma. Beef, Patties Lean, A627, 40, gov turns into Beef,. Can anyone help? Michael Cortes Fort LeBoeuf School District 34 East 9th Street PO Box 810 Waterford PA 16411-0810 814.796.4795 Fax1 814.796.3358 Fax2 978-389-1258 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: Script to control mysql users?
You can use the following command sequence to add admin user: shell mysql --user=root mysql mysql GRANT ALL PRIVILEGES ON *.* TO admin@localhost IDENTIFIED BY 'some_password' WITH GRANT OPTION; mysql GRANT ALL PRIVILEGES ON *.* TO admin@% IDENTIFIED BY 'some_password' WITH GRANT OPTION; mysql FLUSH PRIVILEGES You also can make a script executing this SQL-queries from root user. -- Mike Tsapenko Chief of Web-development Dept. AlarIT http://www.AlarIT.com Leif K-Brooks [EMAIL PROTECTED] ???/ ? ?: [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I need to add mysql users to some databases, but my dumb control panel (ensim) doesn't seem to have a feature to do that, and I'm nothing in the mysql database. Does anyone have a script to let me add them automaticly if I supply it with the root password? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: Novice to PHP. Database connection help needed
Ing. Rajesh Kumar wrote: Hi everybody I am normally working with ASP and ASPX. Now I want to try PHP. I installed and tried some simple scripts and they are running fine. Now it is time to working with database but i could not find something helpful in the manual. Can someone give me a link or better a code how to connect to a database (SQl and ACCESS) Thanks in advance Raja Nothing useful in the manual?? http://www.php.net/manual/en/ref.mssql.php Jason Friedland -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] obdc_pconnect problems
Have you tried with alternate drivers? Either way, you can capture an ODBC trace to see what is going on. The odbc.ini should have an entry for tracing that you can uncomment. Best regards, Andrew Hill OpenLink Software. On Friday, July 26, 2002, at 03:25 AM, Escuder Nicolas wrote: Hello, i don't use the cgi version i compile php with --with-apache :o) and the connection seem to be exist with netstat each time i use the web script, it reconnect and open a new tcp and let the previous open ... See you Nicolas. - Original Message - From: Andrew Hill [EMAIL PROTECTED] To: 'Escuder Nicolas' [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, July 25, 2002 7:34 PM Subject: RE: [PHP-DB] obdc_pconnect problems Nicolas, I believe the _pconnect functions all close connections if you close the script - they are most useful when you have multiple connections in a single page. Also, are you using the CGI version of PHP? Pconnects are not persistent with this version. Best regards, Andrew Hill Director of Technology Evangelism OpenLink Software http://www.openlinksw.com Universal Data Access Virtuoso Universal Server -Original Message- From: Escuder Nicolas [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 23, 2002 11:09 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] obdc_pconnect problems Hello, i use php as not a cgi it is include in my apache my odbc is a custom odbc driver so i try to use odbc_pconnect, the first time it connect to the db i saw the connection tcp by netstat and the next time (on the next page) i reuse pconnect with the same db user pass and sql cursor but it open a new connection, i see two connection with netstat ... and more connection if i go another page ... i don't understand why ... see you nicolas. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Re: odbc data sort problem (i think) :)
Lukas, Use varchar instead of char to avoid this issue - that is the behavior you should expect regardless of the driver or ODBC use. Best regards, Andrew Hill OpenLink Software On Thursday, August 29, 2002, at 05:07 AM, Lukas Boldrino wrote: i got the problem. the odbc driver fills unuses spaces in a row with blanks. goddamn *g* cu Lukas Boldrino [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... hey guys ! I¥m trying to use a if syntax to compare data and preselect radiobuttons. I tried it like that: if ($checked == Patch) $checked6 = bla; With numbers it works great but with char my $checked6 variable is empty ! I know php is case sensitive and I¥m sure that problem is not the case sensitive so please help, im using a MS SQL Server 2000 (enterprise edition) and the odbc driver! thanks guys! - [EMAIL PROTECTED] - -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] How to pass multiple checkbox values thru form??
hii i have one form in which i print records from mysql database. while displyaing those records i display one checkbox with each record. i want the user should select the checkbox corresponding to the record which s/he wants to delete. i display those records after running one query. hence each time no.of records are diff. so its difficult to hard code names for check boxes. for name attribute in input type=checkbox tag, i define one array. having same name as the key field in the table. and value for which is also set dynamically. FORM NAME = act_qmd_subj_frm METHOD = POST ACTION = confirm_delete.php while ($row = mysql_fetch_array($result)) { .. echo tr; //call function to display the contents of $row in table print_entry($row,subj_id,subj_name,subj_desc); print td valign=top align=centerinput type=checkbox name=\subj_id[]\ value=\.$row[subj_id].\ Yes, delete entry #.$row[subj_id]./td\n; ... } INPUT TYPE=submit NAME=del_but VALUE=Delete nbsp nbsp INPUT TYPE=submit NAME=modify_but VALUE=Modify nbsp nbsp INPUT TYPE=reset NAME=clear_but VALUE=Clear nbsp nbsp /FORM when i submit the form to confirm_delete.php i run one code there to print the array subj_id[] which is supposed to contain values of the checkboxes which are selected to delete or to modify. but the array subj_id[] contains no value at all. echo count($subj_id) gives 0. is there any other way to pass multiple checkbox values from the form??? i got the above trick from the book MySQL/PHP Database Applications (By, Jay Grrenspan and Brad Bulger) in one script they have passed checkbox value thru array by this way, and its working fine. can anyone PLS figure out what wrong im doing??? thnx and regds, smita. _ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] How to pass multiple checkbox values thru form??
Smita: input type='checkbox' name='YourFieldName[]' value=\$DataBaseValue\ / Then in the script that recieves the form POST or GET data, cycle through the array of chaeckbox values and do with them as you will. foreach($YourFieldName as $val) { //echo checkbox values to the page or do whatver you will with them.. echo checkbox value: $val; } :-) HTH Russ -Original Message- From: Smita Manohar [mailto:[EMAIL PROTECTED]] Sent: Friday, August 30, 2002 12:19 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] How to pass multiple checkbox values thru form?? hii i have one form in which i print records from mysql database. while displyaing those records i display one checkbox with each record. i want the user should select the checkbox corresponding to the record which s/he wants to delete. i display those records after running one query. hence each time no.of records are diff. so its difficult to hard code names for check boxes. for name attribute in input type=checkbox tag, i define one array. having same name as the key field in the table. and value for which is also set dynamically. FORM NAME = act_qmd_subj_frm METHOD = POST ACTION = confirm_delete.php while ($row = mysql_fetch_array($result)) { .. echo tr; //call function to display the contents of $row in table print_entry($row,subj_id,subj_name,subj_desc); print td valign=top align=centerinput type=checkbox name=\subj_id[]\ value=\.$row[subj_id].\ Yes, delete entry #.$row[subj_id]./td\n; ... } INPUT TYPE=submit NAME=del_but VALUE=Delete nbsp nbsp INPUT TYPE=submit NAME=modify_but VALUE=Modify nbsp nbsp INPUT TYPE=reset NAME=clear_but VALUE=Clear nbsp nbsp /FORM when i submit the form to confirm_delete.php i run one code there to print the array subj_id[] which is supposed to contain values of the checkboxes which are selected to delete or to modify. but the array subj_id[] contains no value at all. echo count($subj_id) gives 0. is there any other way to pass multiple checkbox values from the form??? i got the above trick from the book MySQL/PHP Database Applications (By, Jay Grrenspan and Brad Bulger) in one script they have passed checkbox value thru array by this way, and its working fine. can anyone PLS figure out what wrong im doing??? thnx and regds, smita. _ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php