[PHP-DB] How to Check Directory exist in Specific Folder
Dear all Does php have any script which can check if a directory exist in specific folder? Thx a lot Jack -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Have fun! 3 Days for free! or for one month! every day 24 hours!
Show this line! http://www.tgpfriendly2.com/members/switzerland/pussyline/ it\'s an switzerline Have fun! Days for free! http://www.tgpfriendly2.com/members/switzerland/pussyline/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] How to Check Directory exist in Specific Folder
Dear all Does php have any script which can check if a directory exist in specific folder? Thx a lot Jack if (is_dir (/path/to/your/folder) ) echo Dir exists; else echo Dir doesn't exist; Regards Joakim - This message contains information that may be privileged or confidential and is the property of Cyber Com and may be exempt from disclosure under applicable law. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. This agreement shall be governed by the law where the sender has its place of business. Any attachment(s) to this e-mail has been checked for viruses, but please rely on your own virus-checker and procedures. - -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] MySql security
Hi, Since i dont know any mysql group, i will try here - it is anyway related to php. When i want to make php/mysql application i have mysql on the server and i connect to it with mysql_pconnect(localhost,root,) and it works. I assume that any user or hacker could connect to mysql database like this. So, i want to create my database and i want to limit access to this database for some usernames and passwords. I know MSSQL or Interbase can do it - but how i do this in mysql. If this is offtopic can someone point me to any mysql newsgroup. Other question is: if i need to make application which uses credit cards, how can i increase security for it. I have heard about https protocol, but dont know much about it. Any link would be appreciated. Thanks, Radovan -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] MySql security
Hi, Since i dont know any mysql group, i will try here - it is anyway related to php. When i want to make php/mysql application i have mysql on the server and i connect to it with mysql_pconnect(localhost,root,) and it works. I assume that any user or hacker could connect to mysql database like this. So, i want to create my database and i want to limit access to this database for some usernames and passwords. I know MSSQL or Interbase can do it - but how i do this in mysql. If this is offtopic can someone point me to any mysql newsgroup. I would say this is very offtopic, but this query should do the trick: GRANT select, update, insert ON your_db_name.* TO your_username@localhost IDENTIFIED BY 'your_password' Take a look in the MySQL manual for more details on GRANT. To set a password for root you can use the mysqladmin command: mysqladmin -u root password your_new_pwd Note that the word password here really is the word password! Or you could run this query on the mysql db. SET PASSWORD FOR root@localhost=PASSWORD('your_new_pwd'); Other question is: if i need to make application which uses credit cards, how can i increase security for it. I have heard about https protocol, but dont know much about it. Any link would be appreciated. You have to look in your webserver's manual for this. Regards Joakim - This message contains information that may be privileged or confidential and is the property of Cyber Com and may be exempt from disclosure under applicable law. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. This agreement shall be governed by the law where the sender has its place of business. Any attachment(s) to this e-mail has been checked for viruses, but please rely on your own virus-checker and procedures. - -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Email Encryption?
Hi All, I want to thank everyone for their suggestion. A short term solution we're simply going to remove the username from the email. This way if a hacker does obtain the email they don't have the complete details to gain access to the users account. I would like to know more about the code supplied below though. How does this work? As long as they HAVE a string that gets compared in the DB then what good is this? They can still gain access to the users account. Thanks again. Aaron -Original Message- From: Jeremy Wilson [mailto:[EMAIL PROTECTED]] Sent: November 16, 2002 1:08 PM To: 'Aaron Wolski'; 'Jason Vincent'; [EMAIL PROTECTED] Subject: RE: [PHP-DB] Email Encryption? $encrypted_string = md5(base64_encode($var.'secret key')); Pass the user name or password to $var and place text in to replace the words 'secret key'. -Original Message- From: Aaron Wolski [mailto:[EMAIL PROTECTED]] Sent: Friday, November 15, 2002 8:45 AM To: 'Jason Vincent'; [EMAIL PROTECTED] Subject: RE: [PHP-DB] Email Encryption? Well. Its not what they want.. it what one of their clients want (very big corporation with very unrealistic security standards - you'd think they were NASA or something *grumble*) Their thought is that someone could hack the received email, login to the store using the publically displayed logins details and reek havoc on the store, etc. *shrugs* Sadly this isn't open for debate as a solutions IS required. Any thoughts? Aaron -Original Message- From: Jason Vincent [mailto:[EMAIL PROTECTED]] Sent: November 15, 2002 11:42 AM To: Aaron Wolski; [EMAIL PROTECTED] Subject: RE: [PHP-DB] Email Encryption? Why email? If the Admin tool uses SSL, that is all you need. Regards, J -Original Message- From: Aaron Wolski [mailto:[EMAIL PROTECTED]] Sent: Friday, November 15, 2002 11:39 AM To: 'Aaron Wolski'; [EMAIL PROTECTED] Subject: RE: [PHP-DB] Email Encryption? Just thinking here.. PGP is not an option as it would mean EACH user being setup would need the company's public key to decrypt. Not possible as they setup a few hundred accounts each month. Hmm.. anything else? Argh :( Aaron -Original Message- From: Aaron Wolski [mailto:[EMAIL PROTECTED]] Sent: November 15, 2002 11:36 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] Email Encryption? OFFTOPIC Sorry for the off topic guys.. But I've just been informed that an application we developed for a client whereby they use an Admin tool to setup user accounts into their store needs to have the login (username and password) encrypted. I am thinking PGP for this but to be honest I've never really worked with PGP and wouldn't have the first clue. Does anyone have any experience with this or can offer and advise at all? Again, sorry for the OT discussion. Aaron -- 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] MySql security
how i do this in mysql. If this is offtopic can someone point me to any mysql newsgroup. I would say this is very offtopic, but this query should do the trick: GRANT select, update, insert ON your_db_name.* TO your_username@localhost IDENTIFIED BY 'your_password' Take a look in the MySQL manual for more details on GRANT. Thank you for the answers, i will explore little bit more about this. Radovan -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] HTML Forms question...
I know that this is not the forum for this question, I am only looking for a pointer in the right direction here. I need to gain a better understanding of HTML forms, specifically checkboxes. What I am looking for is once I present a list of checkboxes and the user makes his selections, how is this presented to the subsequent pages? Does anyone know of a website that has a tutorial or good explanation of how this works? Thanks in advance. Scott Nipp Phone: (214) 858-1289 E-mail: [EMAIL PROTECTED] Web: http:\\ldsa.sbcld.sbc.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] HTML Forms question...
input type=checkbox name=checkbox1 value=scoobydoo if this is checked the value scoobydoo will be put into the array with index checkbox1 which array is dependant on which method your form uses. :-) If it is not checked then there is no entry. in PHP with register_globals on the variable $checkbox1 will equal scoobydoo and not be set if the box is not checked. hope this helps... Ryan -Original Message- From: NIPP, SCOTT V (SBCSI) [mailto:[EMAIL PROTECTED]] Sent: Tuesday, November 19, 2002 9:28 AM To: '[EMAIL PROTECTED]' Subject: [PHP-DB] HTML Forms question... I know that this is not the forum for this question, I am only looking for a pointer in the right direction here. I need to gain a better understanding of HTML forms, specifically checkboxes. What I am looking for is once I present a list of checkboxes and the user makes his selections, how is this presented to the subsequent pages? Does anyone know of a website that has a tutorial or good explanation of how this works? Thanks in advance. Scott Nipp Phone: (214) 858-1289 E-mail: [EMAIL PROTECTED] Web: http:\\ldsa.sbcld.sbc.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] formatted text, php and mysql
Hi, hopefully someone can help me out with this.. I need to be able to copy text from a document, keeping carriage returns and white space chars, into a database and output the same to a web page. I have a field in a mysql table of type 'longtext' into which i can load text and keep the white space and carriage return characters intact. I can output this field to a page using php in a similarly formatted way by using the pre tag in an echo statemnet : - echo trpre$content/pre/tr; however, by using the pre tag all individual lines of text are printed on a single line and the sizing of my table is ignored, i.e. the text won't wrap. pre width=20 for example doesn't work. Is there a 'proper' way of doing something like this with php without relying on printing out html tags with the string? cheers Dan -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] HTML Forms question...
OK. If I am using the POST method and the checkbox 'name' for all of the checkboxes is 'system', how do I access the results? I am researching on the PHP site trying to figure out what this array is, and how I access this if the index name is the same for all elements. I am hoping that this data will be in an array and I can simply loop through the contents of the array. If this data is stored in a hash (Perl word for this type of array, not sure if it's the same in PHP), how do I access this data since the index for every element would be the same? I am SURE that I am probably missing some important conceptual issues here, but still learning as I go. Unfortunately, this probably means that I will be completely rewriting this application at least once in the future. Oh well, live and learn. Thanks again for the help. -Original Message- From: Ryan Jameson (USA) [mailto:[EMAIL PROTECTED]] Sent: Tuesday, November 19, 2002 10:35 AM To: [EMAIL PROTECTED] Subject: RE: [PHP-DB] HTML Forms question... input type=checkbox name=checkbox1 value=scoobydoo if this is checked the value scoobydoo will be put into the array with index checkbox1 which array is dependant on which method your form uses. :-) If it is not checked then there is no entry. in PHP with register_globals on the variable $checkbox1 will equal scoobydoo and not be set if the box is not checked. hope this helps... Ryan -Original Message- From: NIPP, SCOTT V (SBCSI) [mailto:[EMAIL PROTECTED]] Sent: Tuesday, November 19, 2002 9:28 AM To: '[EMAIL PROTECTED]' Subject: [PHP-DB] HTML Forms question... I know that this is not the forum for this question, I am only looking for a pointer in the right direction here. I need to gain a better understanding of HTML forms, specifically checkboxes. What I am looking for is once I present a list of checkboxes and the user makes his selections, how is this presented to the subsequent pages? Does anyone know of a website that has a tutorial or good explanation of how this works? Thanks in advance. Scott Nipp Phone: (214) 858-1289 E-mail: [EMAIL PROTECTED] Web: http:\\ldsa.sbcld.sbc.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 Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] HTML Forms question...
OK. If I am using the POST method and the checkbox 'name' for all of the checkboxes is 'system', how do I access the results? I am researching on the PHP site trying to figure out what this array is, and how I access this if the index name is the same for all elements. I am hoping that this data will be in an array and I can simply loop through the contents of the array. If this data is stored in a hash (Perl word for this type of array, not sure if it's the same in PHP), how do I access this data since the index for every element would be the same? I am SURE that I am probably missing some important conceptual issues here, but still learning as I go. Unfortunately, this probably means that I will be completely rewriting this application at least once in the future. Oh well, live and learn. Thanks again for the help. If you have multiple checkboxes with the same 'name' then you should name then with brackets, [], such as 'system[]'. This will tell PHP to make the results an array when the form is submitted. For any of the 'submit[]' checkboxes that are checked, they will be present in PHP array on the processing page. Those unchecked will not be present. Say you have the following. input type=checkbox name=submit[] value=1One input type=checkbox name=submit[] value=2Two input type=checkbox name=submit[] value=3Three If the method on your form is POST, and the user checks One and Three, then you'll have the following values in PHP on the ACTION page of the FORM. $_POST['submit'][0] == 1 $_POST['submit'][1] == 3 From that data, though, there's no way to tell that checkbox Two was not checked, unless you go through and check all of the values. That's fine for small forms, but a hassle for large ones. You could also name your checkboxes like this: input type=checkbox name=submit[1] value=1One input type=checkbox name=submit[2] value=2Two input type=checkbox name=submit[3] value=3Three and if the user checks one and three again, you'll get $_POST['submit'][1] == 1 $_POST['submit'][3] == 3 Hopefully that clears some things up. If you have any other questions, just ask. ---John Holmes... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] formatted text, php and mysql
Have you looked at the nl2br() function? echo trtd . nl2br($content) . /td/tr; That may give you the output you're looking for. ---John Holmes... - Original Message - From: Griffiths, Daniel [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, November 19, 2002 11:50 AM Subject: [PHP-DB] formatted text, php and mysql Hi, hopefully someone can help me out with this.. I need to be able to copy text from a document, keeping carriage returns and white space chars, into a database and output the same to a web page. I have a field in a mysql table of type 'longtext' into which i can load text and keep the white space and carriage return characters intact. I can output this field to a page using php in a similarly formatted way by using the pre tag in an echo statemnet : - echo trpre$content/pre/tr; however, by using the pre tag all individual lines of text are printed on a single line and the sizing of my table is ignored, i.e. the text won't wrap. pre width=20 for example doesn't work. Is there a 'proper' way of doing something like this with php without relying on printing out html tags with the string? cheers Dan -- 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] HTML Forms question...
If you name the checkbox as name=system[] then PHP will automatically create an array of the checkbox values which can be subsequently accessed via $_POST['system'][n] - be warned however that the '[]' can screw up any JavaScript code that refers to the checkbox object... HTH Rich -Original Message- From: NIPP, SCOTT V (SBCSI) [mailto:[EMAIL PROTECTED]] Sent: 19 November 2002 08:53 To: 'Ryan Jameson (USA)'; [EMAIL PROTECTED] Subject: RE: [PHP-DB] HTML Forms question... OK. If I am using the POST method and the checkbox 'name' for all of the checkboxes is 'system', how do I access the results? I am researching on the PHP site trying to figure out what this array is, and how I access this if the index name is the same for all elements. I am hoping that this data will be in an array and I can simply loop through the contents of the array. If this data is stored in a hash (Perl word for this type of array, not sure if it's the same in PHP), how do I access this data since the index for every element would be the same? I am SURE that I am probably missing some important conceptual issues here, but still learning as I go. Unfortunately, this probably means that I will be completely rewriting this application at least once in the future. Oh well, live and learn. Thanks again for the help. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] formatted text, php and mysql
great, works like a dream! many thanks Dan -Original Message- From: 1LT John W. Holmes [mailto:[EMAIL PROTECTED]] Sent: 19 November 2002 17:12 To: Griffiths, Daniel; [EMAIL PROTECTED] Subject: Re: [PHP-DB] formatted text, php and mysql Have you looked at the nl2br() function? echo trtd . nl2br($content) . /td/tr; That may give you the output you're looking for. ---John Holmes... - Original Message - From: Griffiths, Daniel [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, November 19, 2002 11:50 AM Subject: [PHP-DB] formatted text, php and mysql Hi, hopefully someone can help me out with this.. I need to be able to copy text from a document, keeping carriage returns and white space chars, into a database and output the same to a web page. I have a field in a mysql table of type 'longtext' into which i can load text and keep the white space and carriage return characters intact. I can output this field to a page using php in a similarly formatted way by using the pre tag in an echo statemnet : - echo trpre$content/pre/tr; however, by using the pre tag all individual lines of text are printed on a single line and the sizing of my table is ignored, i.e. the text won't wrap. pre width=20 for example doesn't work. Is there a 'proper' way of doing something like this with php without relying on printing out html tags with the string? cheers Dan -- 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] retriving values from two tables
Hi all, I am karthik. I am using using php with mysql. i am stuck with a qury. Pls hep me out. i have two tables. Here is table with sample data Table Name : Links linkid header 1 yahoo.com 2 google.com 3 php.net 4 sai.org 5 mysql.net Table Name : subLinks linkid childid 1 2 3 5 4 3 I want to fetch the linkid and header from links table based on condition that i select only the main links. which are not under any link In our example it is 1 and 4 Pls help out with the query..Its Urgent Thanks Jai Sairam Karthikeyan.S - Do you Yahoo!? Yahoo! Web Hosting - Let the expert host your site
Re: [PHP-DB] retriving values from two tables
Hi all, I am karthik. I am using using php with mysql. i am stuck with a qury. Pls hep me out. i have two tables. Here is table with sample data Table Name : Links linkid header 1 yahoo.com 2 google.com 3 php.net 4 sai.org 5 mysql.net Table Name : subLinks linkid childid 1 2 3 5 4 3 I want to fetch the linkid and header from links table based on condition that i select only the main links. which are not under any link In our example it is 1 and 4 Pls help out with the query..Its Urgent Thanks Jai Sairam Karthikeyan.S How about: SELECT l.linkid, l.header FROM Links l LEFT JOIN subLinks s ON l.linkid = s.childid WHERE s.childid IS NULL I think that'll work. ---John Holmes... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] retriving values from two tables
I'm not clear on what you're considering the 'main links'. You can use the linkid value to match the header in the Links table to the childid in the subLinks table. SELECT Links.header, subLinks.childid FROM Links, subLinks WHERE Links.linkid = subLinks.linkid; This should return values like this: - | header | childid| - | yahoo.com | 2 | | php.net| 5 | | sai.org| 3 | - You could narrow down the results returned by adding WHERE subLinks.childid = $value in your query. Hope this helps! Shannon Johnston On Tue, 2002-11-19 at 10:22, karthikeyan wrote: Hi all, I am karthik. I am using using php with mysql. i am stuck with a qury. Pls hep me out. i have two tables. Here is table with sample data Table Name : Links linkid header 1 yahoo.com 2 google.com 3 php.net 4 sai.org 5 mysql.net Table Name : subLinks linkid childid 1 2 3 5 4 3 I want to fetch the linkid and header from links table based on condition that i select only the main links. which are not under any link In our example it is 1 and 4 Pls help out with the query..Its Urgent Thanks Jai Sairam Karthikeyan.S - Do you Yahoo!? Yahoo! Web Hosting - Let the expert host your site -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] HTML Forms question...
You learn something new every day! I'll have to remember the [] thing. My way of handling this situation that does not screw up JavaScript is to assign the names sequentially, so instead of all the checkboxes being system they would be system0,system1,... Since PHP is so wonderfully easy to use for referencing variable variable names I simply loop through: for($i=0;$iNUMBEROFCHECKBOXES;$i++){ $var = system$i; $val = $$var; if (isset($$var)) //--- I think this works. echo $var = $valbr; else echo $var is not checked.; } Since I always end up creating the form in PHP I just have the algorithm put a hidden field in the form that contains the number of checkboxes, in fact my PHP usually creates the JavaScript code as well, so it ends up being pretty flexible. Ryan -Original Message- From: Rich Gray [mailto:[EMAIL PROTECTED]] Sent: Tuesday, November 19, 2002 6:13 PM To: NIPP, SCOTT V (SBCSI); [EMAIL PROTECTED] Subject: RE: [PHP-DB] HTML Forms question... If you name the checkbox as name=system[] then PHP will automatically create an array of the checkbox values which can be subsequently accessed via $_POST['system'][n] - be warned however that the '[]' can screw up any JavaScript code that refers to the checkbox object... HTH Rich -Original Message- From: NIPP, SCOTT V (SBCSI) [mailto:[EMAIL PROTECTED]] Sent: 19 November 2002 08:53 To: 'Ryan Jameson (USA)'; [EMAIL PROTECTED] Subject: RE: [PHP-DB] HTML Forms question... OK. If I am using the POST method and the checkbox 'name' for all of the checkboxes is 'system', how do I access the results? I am researching on the PHP site trying to figure out what this array is, and how I access this if the index name is the same for all elements. I am hoping that this data will be in an array and I can simply loop through the contents of the array. If this data is stored in a hash (Perl word for this type of array, not sure if it's the same in PHP), how do I access this data since the index for every element would be the same? I am SURE that I am probably missing some important conceptual issues here, but still learning as I go. Unfortunately, this probably means that I will be completely rewriting this application at least once in the future. Oh well, live and learn. Thanks again for the help. -- 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] HTML Forms question...
-Original Message- From: Rich Gray [mailto:[EMAIL PROTECTED]] Sent: 20 November 2002 01:13 If you name the checkbox as name=system[] then PHP will automatically create an array of the checkbox values which can be subsequently accessed via $_POST['system'][n] - be warned however that the '[]' can screw up any JavaScript code that refers to the checkbox object... G' -- not this old chestnut again! It only screws up your JavaScript if you don't write your JavaScript to allow for it. It's really very simple: *by* *definition* in JavaScript, the notation a.b is *identical* to a[b] Thus, if you have a single checkbox named with name=system, then you can access it in either of these ways: document.form.system document.form[system] By extension, if you have multiple checkboxes all named with name=system[], you can refer to them as: document.form[system[]][0] document.form[system[]][1] document.form[system[]][2] etc... I know this works because I've been using it for years (even before I started programming with PHP!). Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] HTML Forms question...
Not only does Mike's description below work really well for a single page, if you write all of your JS stuff like this, you can very easily use the same script on multiple pages. Portability! Works great for me. -Original Message- From: Ford, Mike [LSS] [mailto:[EMAIL PROTECTED]] Sent: Tuesday, November 19, 2002 1:35 PM To: 'Rich Gray'; NIPP, SCOTT V (SBCSI); [EMAIL PROTECTED] Subject: RE: [PHP-DB] HTML Forms question... -Original Message- From: Rich Gray [mailto:[EMAIL PROTECTED]] Sent: 20 November 2002 01:13 If you name the checkbox as name=system[] then PHP will automatically create an array of the checkbox values which can be subsequently accessed via $_POST['system'][n] - be warned however that the '[]' can screw up any JavaScript code that refers to the checkbox object... G' -- not this old chestnut again! It only screws up your JavaScript if you don't write your JavaScript to allow for it. It's really very simple: *by* *definition* in JavaScript, the notation a.b is *identical* to a[b] Thus, if you have a single checkbox named with name=system, then you can access it in either of these ways: document.form.system document.form[system] By extension, if you have multiple checkboxes all named with name=system[], you can refer to them as: document.form[system[]][0] document.form[system[]][1] document.form[system[]][2] etc... I know this works because I've been using it for years (even before I started programming with PHP!). Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP 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] HTML Forms question...
Let me append my earlier post. If you write a function like this: function myfunction(name){ document.form.name.do_something_legal_to_this_object } All you have to do on subsequent pages is pass the name of the object into the function and you're good to go (e.g. onClick=javascript:myfunction(objectName)) as long as the function is included in the page. Sorry for any confusion. -Original Message- From: Hutchins, Richard [mailto:[EMAIL PROTECTED]] Sent: Tuesday, November 19, 2002 1:45 PM To: [EMAIL PROTECTED] Subject: RE: [PHP-DB] HTML Forms question... Not only does Mike's description below work really well for a single page, if you write all of your JS stuff like this, you can very easily use the same script on multiple pages. Portability! Works great for me. -Original Message- From: Ford, Mike [LSS] [mailto:[EMAIL PROTECTED]] Sent: Tuesday, November 19, 2002 1:35 PM To: 'Rich Gray'; NIPP, SCOTT V (SBCSI); [EMAIL PROTECTED] Subject: RE: [PHP-DB] HTML Forms question... -Original Message- From: Rich Gray [mailto:[EMAIL PROTECTED]] Sent: 20 November 2002 01:13 If you name the checkbox as name=system[] then PHP will automatically create an array of the checkbox values which can be subsequently accessed via $_POST['system'][n] - be warned however that the '[]' can screw up any JavaScript code that refers to the checkbox object... G' -- not this old chestnut again! It only screws up your JavaScript if you don't write your JavaScript to allow for it. It's really very simple: *by* *definition* in JavaScript, the notation a.b is *identical* to a[b] Thus, if you have a single checkbox named with name=system, then you can access it in either of these ways: document.form.system document.form[system] By extension, if you have multiple checkboxes all named with name=system[], you can refer to them as: document.form[system[]][0] document.form[system[]][1] document.form[system[]][2] etc... I know this works because I've been using it for years (even before I started programming with PHP!). Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP 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] HTML Forms question...
Great piece of advice Mike. Thanks. Far from obvious. I was stuck with this problem since a few days. Will that also apply to n-dimensional array, like: document.form[system[]][0][1] ? Ignatius - Original Message - From: Ford, Mike [LSS] [EMAIL PROTECTED] To: 'Rich Gray' [EMAIL PROTECTED]; NIPP, SCOTT V (SBCSI) [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Tuesday, November 19, 2002 7:35 PM Subject: RE: [PHP-DB] HTML Forms question... -Original Message- From: Rich Gray [mailto:[EMAIL PROTECTED]] Sent: 20 November 2002 01:13 If you name the checkbox as name=system[] then PHP will automatically create an array of the checkbox values which can be subsequently accessed via $_POST['system'][n] - be warned however that the '[]' can screw up any JavaScript code that refers to the checkbox object... G' -- not this old chestnut again! It only screws up your JavaScript if you don't write your JavaScript to allow for it. It's really very simple: *by* *definition* in JavaScript, the notation a.b is *identical* to a[b] Thus, if you have a single checkbox named with name=system, then you can access it in either of these ways: document.form.system document.form[system] By extension, if you have multiple checkboxes all named with name=system[], you can refer to them as: document.form[system[]][0] document.form[system[]][1] document.form[system[]][2] etc... I know this works because I've been using it for years (even before I started programming with PHP!). Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP 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] HTML Forms question...
Javascript... What's that??? Just kidding. I know what it is, but that is about the extent of my knowledge. Thanks for all the great feedback. I was actually just looking to be pointed in the right direction as this was a bit outside the scope of this group. You guys come through in shining fashion though and solve the problem for me. Now just to figure out the next 73 issues/steps/challenges/problems. :) -Original Message- From: Ryan Jameson (USA) [mailto:[EMAIL PROTECTED]] Sent: Tuesday, November 19, 2002 11:44 AM To: [EMAIL PROTECTED] Subject: RE: [PHP-DB] HTML Forms question... You learn something new every day! I'll have to remember the [] thing. My way of handling this situation that does not screw up JavaScript is to assign the names sequentially, so instead of all the checkboxes being system they would be system0,system1,... Since PHP is so wonderfully easy to use for referencing variable variable names I simply loop through: for($i=0;$iNUMBEROFCHECKBOXES;$i++){ $var = system$i; $val = $$var; if (isset($$var)) //--- I think this works. echo $var = $valbr; else echo $var is not checked.; } Since I always end up creating the form in PHP I just have the algorithm put a hidden field in the form that contains the number of checkboxes, in fact my PHP usually creates the JavaScript code as well, so it ends up being pretty flexible. Ryan -Original Message- From: Rich Gray [mailto:[EMAIL PROTECTED]] Sent: Tuesday, November 19, 2002 6:13 PM To: NIPP, SCOTT V (SBCSI); [EMAIL PROTECTED] Subject: RE: [PHP-DB] HTML Forms question... If you name the checkbox as name=system[] then PHP will automatically create an array of the checkbox values which can be subsequently accessed via $_POST['system'][n] - be warned however that the '[]' can screw up any JavaScript code that refers to the checkbox object... HTH Rich -Original Message- From: NIPP, SCOTT V (SBCSI) [mailto:[EMAIL PROTECTED]] Sent: 19 November 2002 08:53 To: 'Ryan Jameson (USA)'; [EMAIL PROTECTED] Subject: RE: [PHP-DB] HTML Forms question... OK. If I am using the POST method and the checkbox 'name' for all of the checkboxes is 'system', how do I access the results? I am researching on the PHP site trying to figure out what this array is, and how I access this if the index name is the same for all elements. I am hoping that this data will be in an array and I can simply loop through the contents of the array. If this data is stored in a hash (Perl word for this type of array, not sure if it's the same in PHP), how do I access this data since the index for every element would be the same? I am SURE that I am probably missing some important conceptual issues here, but still learning as I go. Unfortunately, this probably means that I will be completely rewriting this application at least once in the future. Oh well, live and learn. Thanks again for the help. -- 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] Inserting Picture into the image field in sybase db
Hello, all: I have one probelm about inserting picture into the image field in sybase db. Now, I could insert 15K picture into Sybase db, but just only 15K size. I have on idea how to make the size larger, at least expand it to be 60K. Does anyone have this experience? Does the image field in Sybase have size limitation? Or, does the sybase_query() have size limitation? Any suggestion would welcome. Thanks in advance. Jien-zhong Liu -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] HTML Forms question...
OK. This has been most helpful, but now I am getting something strange. The first element of the array of data is behaving strangely. For the code snippet below I am not getting the first selected element displayed: ?php ... Some stuff snipped... $a = 0; ? ?php while (isset($_POST['system'][$a])) { $a++; echo $_POST['system'][$a]; } ? The second, third, and so forth selections all print, just not the first one. Also, I can test the contents of the first element by placing an echo before the while loop. Thanks in advance. -Original Message- From: 1LT John W. Holmes [mailto:[EMAIL PROTECTED]] Sent: Tuesday, November 19, 2002 11:11 AM To: NIPP, SCOTT V (SBCSI); 'Ryan Jameson (USA)'; [EMAIL PROTECTED] Subject: Re: [PHP-DB] HTML Forms question... OK. If I am using the POST method and the checkbox 'name' for all of the checkboxes is 'system', how do I access the results? I am researching on the PHP site trying to figure out what this array is, and how I access this if the index name is the same for all elements. I am hoping that this data will be in an array and I can simply loop through the contents of the array. If this data is stored in a hash (Perl word for this type of array, not sure if it's the same in PHP), how do I access this data since the index for every element would be the same? I am SURE that I am probably missing some important conceptual issues here, but still learning as I go. Unfortunately, this probably means that I will be completely rewriting this application at least once in the future. Oh well, live and learn. Thanks again for the help. If you have multiple checkboxes with the same 'name' then you should name then with brackets, [], such as 'system[]'. This will tell PHP to make the results an array when the form is submitted. For any of the 'submit[]' checkboxes that are checked, they will be present in PHP array on the processing page. Those unchecked will not be present. Say you have the following. input type=checkbox name=submit[] value=1One input type=checkbox name=submit[] value=2Two input type=checkbox name=submit[] value=3Three If the method on your form is POST, and the user checks One and Three, then you'll have the following values in PHP on the ACTION page of the FORM. $_POST['submit'][0] == 1 $_POST['submit'][1] == 3 From that data, though, there's no way to tell that checkbox Two was not checked, unless you go through and check all of the values. That's fine for small forms, but a hassle for large ones. You could also name your checkboxes like this: input type=checkbox name=submit[1] value=1One input type=checkbox name=submit[2] value=2Two input type=checkbox name=submit[3] value=3Three and if the user checks one and three again, you'll get $_POST['submit'][1] == 1 $_POST['submit'][3] == 3 Hopefully that clears some things up. If you have any other questions, just ask. ---John Holmes... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] HTML Forms question...
I think it's because you're incrementing $a BEFORE you echo it out. That would cause your echo statement to start at the second item [1]. -Original Message- From: NIPP, SCOTT V (SBCSI) [mailto:[EMAIL PROTECTED]] Sent: Tuesday, November 19, 2002 3:36 PM To: '1LT John W. Holmes'; 'Ryan Jameson (USA)'; [EMAIL PROTECTED] Subject: RE: [PHP-DB] HTML Forms question... OK. This has been most helpful, but now I am getting something strange. The first element of the array of data is behaving strangely. For the code snippet below I am not getting the first selected element displayed: ?php ... Some stuff snipped... $a = 0; ? ?php while (isset($_POST['system'][$a])) { $a++; echo $_POST['system'][$a]; } ? The second, third, and so forth selections all print, just not the first one. Also, I can test the contents of the first element by placing an echo before the while loop. Thanks in advance. -Original Message- From: 1LT John W. Holmes [mailto:[EMAIL PROTECTED]] Sent: Tuesday, November 19, 2002 11:11 AM To: NIPP, SCOTT V (SBCSI); 'Ryan Jameson (USA)'; [EMAIL PROTECTED] Subject: Re: [PHP-DB] HTML Forms question... OK. If I am using the POST method and the checkbox 'name' for all of the checkboxes is 'system', how do I access the results? I am researching on the PHP site trying to figure out what this array is, and how I access this if the index name is the same for all elements. I am hoping that this data will be in an array and I can simply loop through the contents of the array. If this data is stored in a hash (Perl word for this type of array, not sure if it's the same in PHP), how do I access this data since the index for every element would be the same? I am SURE that I am probably missing some important conceptual issues here, but still learning as I go. Unfortunately, this probably means that I will be completely rewriting this application at least once in the future. Oh well, live and learn. Thanks again for the help. If you have multiple checkboxes with the same 'name' then you should name then with brackets, [], such as 'system[]'. This will tell PHP to make the results an array when the form is submitted. For any of the 'submit[]' checkboxes that are checked, they will be present in PHP array on the processing page. Those unchecked will not be present. Say you have the following. input type=checkbox name=submit[] value=1One input type=checkbox name=submit[] value=2Two input type=checkbox name=submit[] value=3Three If the method on your form is POST, and the user checks One and Three, then you'll have the following values in PHP on the ACTION page of the FORM. $_POST['submit'][0] == 1 $_POST['submit'][1] == 3 From that data, though, there's no way to tell that checkbox Two was not checked, unless you go through and check all of the values. That's fine for small forms, but a hassle for large ones. You could also name your checkboxes like this: input type=checkbox name=submit[1] value=1One input type=checkbox name=submit[2] value=2Two input type=checkbox name=submit[3] value=3Three and if the user checks one and three again, you'll get $_POST['submit'][1] == 1 $_POST['submit'][3] == 3 Hopefully that clears some things up. If you have any other questions, just ask. ---John Holmes... -- 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] HTML Forms question...
DUH!!! I'm an idiot. That was quite obvious. Thanks. Sorry for the stupid question. -Original Message- From: Hutchins, Richard [mailto:[EMAIL PROTECTED]] Sent: Tuesday, November 19, 2002 2:40 PM To: NIPP, SCOTT V (SBCSI); [EMAIL PROTECTED] Subject: RE: [PHP-DB] HTML Forms question... I think it's because you're incrementing $a BEFORE you echo it out. That would cause your echo statement to start at the second item [1]. -Original Message- From: NIPP, SCOTT V (SBCSI) [mailto:[EMAIL PROTECTED]] Sent: Tuesday, November 19, 2002 3:36 PM To: '1LT John W. Holmes'; 'Ryan Jameson (USA)'; [EMAIL PROTECTED] Subject: RE: [PHP-DB] HTML Forms question... OK. This has been most helpful, but now I am getting something strange. The first element of the array of data is behaving strangely. For the code snippet below I am not getting the first selected element displayed: ?php ... Some stuff snipped... $a = 0; ? ?php while (isset($_POST['system'][$a])) { $a++; echo $_POST['system'][$a]; } ? The second, third, and so forth selections all print, just not the first one. Also, I can test the contents of the first element by placing an echo before the while loop. Thanks in advance. -Original Message- From: 1LT John W. Holmes [mailto:[EMAIL PROTECTED]] Sent: Tuesday, November 19, 2002 11:11 AM To: NIPP, SCOTT V (SBCSI); 'Ryan Jameson (USA)'; [EMAIL PROTECTED] Subject: Re: [PHP-DB] HTML Forms question... OK. If I am using the POST method and the checkbox 'name' for all of the checkboxes is 'system', how do I access the results? I am researching on the PHP site trying to figure out what this array is, and how I access this if the index name is the same for all elements. I am hoping that this data will be in an array and I can simply loop through the contents of the array. If this data is stored in a hash (Perl word for this type of array, not sure if it's the same in PHP), how do I access this data since the index for every element would be the same? I am SURE that I am probably missing some important conceptual issues here, but still learning as I go. Unfortunately, this probably means that I will be completely rewriting this application at least once in the future. Oh well, live and learn. Thanks again for the help. If you have multiple checkboxes with the same 'name' then you should name then with brackets, [], such as 'system[]'. This will tell PHP to make the results an array when the form is submitted. For any of the 'submit[]' checkboxes that are checked, they will be present in PHP array on the processing page. Those unchecked will not be present. Say you have the following. input type=checkbox name=submit[] value=1One input type=checkbox name=submit[] value=2Two input type=checkbox name=submit[] value=3Three If the method on your form is POST, and the user checks One and Three, then you'll have the following values in PHP on the ACTION page of the FORM. $_POST['submit'][0] == 1 $_POST['submit'][1] == 3 From that data, though, there's no way to tell that checkbox Two was not checked, unless you go through and check all of the values. That's fine for small forms, but a hassle for large ones. You could also name your checkboxes like this: input type=checkbox name=submit[1] value=1One input type=checkbox name=submit[2] value=2Two input type=checkbox name=submit[3] value=3Three and if the user checks one and three again, you'll get $_POST['submit'][1] == 1 $_POST['submit'][3] == 3 Hopefully that clears some things up. If you have any other questions, just ask. ---John Holmes... -- 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 update a text BLOB in ODBC?
hi, i am having the devil of a time with this. have been researching it for 3 weeks. have posted to php.faqts.com (no answer), looked a million times on php.net, and www.borland.com/interbase, written people email (no response!) and even tried to get the people at easysoft to answer (they are working on it).. but it's been 3 weeks now and i cannot seem to get this question answered, and our project is waiting.. the question simply is: how to write a BLOB (sub-typwith ODBC in PHP? fyi, it shouldn't make a difference, but i am using interbase 6.0 as the back end, and the blob is SUB-TYPE 1 (text). *reading* the blob is trivial with php Unified ODBC. I just use a normal SQL select statement: == $sql = select note from note_tbl where pkey = '45'; # get result $result = @odbc_exec($conn, $sql); # assign values if ( @odbc_fetch_into($result, $row)) { $note = $row[0]; } == (where notes is the BLOB field). pretty simple. however, when i try to *write* it back: == $sql = insert into note_tbl (note) values ('${note}') where pkey = '45'; $result = odbc_exec($conn, $sql); == i get an error message: == Invalid modify request. Conversion error from string BLOB == .. so apparently i cannot simply write the string back out to the BLOB. (tho' IMHO if i can read in a SUB-TYPE 1 (text) BLOB that easily, then i should be able to write it back out that easily). apparently this is not just at the PHP Unified ODBC level.. if i run easysoft's isql program at the command prompt and try to run the same commands, while i don't get as specific an error message, it does return an error: == SQL update notes_tbl set note = 'hello there' where pkey = '16784' [ISQL]ERROR: Could not SQLExecute SQL _ == does anyone have some example code for how to do this (in PHP)? i'd be most grateful.. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] how to update a text BLOB in ODBC?
Jeff, Check your SQL. Shouldn't $sql = insert into note_tbl (note) values ('${note}') where pkey = '45'; be UPDATE where pkey = '45' ? Or, do a delete where pkey = '45' followed by an insert. In that case check the synatx of your insert 'cause it doesn't look correct. HTH - Miles Thompson At 04:42 PM 11/19/2002 -0800, Jeff Stern wrote: hi, i am having the devil of a time with this. have been researching it for 3 weeks. have posted to php.faqts.com (no answer), looked a million times on php.net, and www.borland.com/interbase, written people email (no response!) and even tried to get the people at easysoft to answer (they are working on it).. but it's been 3 weeks now and i cannot seem to get this question answered, and our project is waiting.. the question simply is: how to write a BLOB (sub-typwith ODBC in PHP? fyi, it shouldn't make a difference, but i am using interbase 6.0 as the back end, and the blob is SUB-TYPE 1 (text). *reading* the blob is trivial with php Unified ODBC. I just use a normal SQL select statement: == $sql = select note from note_tbl where pkey = '45'; # get result $result = @odbc_exec($conn, $sql); # assign values if ( @odbc_fetch_into($result, $row)) { $note = $row[0]; } == (where notes is the BLOB field). pretty simple. however, when i try to *write* it back: == $sql = insert into note_tbl (note) values ('${note}') where pkey = '45'; $result = odbc_exec($conn, $sql); == i get an error message: == Invalid modify request. Conversion error from string BLOB == .. so apparently i cannot simply write the string back out to the BLOB. (tho' IMHO if i can read in a SUB-TYPE 1 (text) BLOB that easily, then i should be able to write it back out that easily). apparently this is not just at the PHP Unified ODBC level.. if i run easysoft's isql program at the command prompt and try to run the same commands, while i don't get as specific an error message, it does return an error: == SQL update notes_tbl set note = 'hello there' where pkey = '16784' [ISQL]ERROR: Could not SQLExecute SQL _ == does anyone have some example code for how to do this (in PHP)? i'd be most grateful.. -- 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] mysql_num_rows()
Hi, I have been having some trouble with this, I mysql_num_rows() to find out how many rows there are and do an insert statement in the for loop for every row returned. So, if mysql_num_rows returns 17 then the for loops does an insert statement for every instance, when the 17 turns into zero the loop stops. For some reason the $insert never recieves any value. Thanks in advance, Tyler Whitesides East Valley School District WebAdministrator -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] standart variabels melfunction
Hi all, I have a problem with my settings of Apache and PHP i think.. When i call for example ($PHP_SELF) instead of ($_SERVER[PHP_SELF]) i get no output, just like when i call the url www.servername.tld/test.php?mode=test And i want to call the mode like this: print($mode); I just get a empty string. But when i call: print($_GET[mode]); I get the real output... I tried to walk troug the hole php.ini the httpd.conf file, but nothing came up, so i relly hope that you can help me out here...! Sorry if it's a little off topic.. And THANKS A LOT!! Regards Martin Allan Jensen
RE: [PHP-DB] standart variabels melfunction
[php.ini] register_globals=On Beau // -Original Message- // From: Martin Allan Jensen [mailto:[EMAIL PROTECTED]] // Sent: Wednesday, 20 November 2002 12:41 PM // To: [EMAIL PROTECTED] // Subject: [PHP-DB] standart variabels melfunction // // // Hi all, // // I have a problem with my settings of Apache and PHP i think.. // // When i call for example ($PHP_SELF) instead of // ($_SERVER[PHP_SELF]) i get no output, just like when i call the url // www.servername.tld/test.php?mode=test // And i want to call the mode like this: // print($mode); // I just get a empty string. // But when i call: // print($_GET[mode]); // I get the real output... // // I tried to walk troug the hole php.ini the httpd.conf // file, but nothing came up, so i relly hope that you can help // me out here...! // // Sorry if it's a little off topic.. // // And THANKS A LOT!! // // Regards // Martin Allan Jensen // -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] mysql_num_rows()
On Wednesday 20 November 2002 09:11, Tyler Whitesides wrote: Hi, I have been having some trouble with this, I mysql_num_rows() to find out how many rows there are and do an insert statement in the for loop for every row returned. So, if mysql_num_rows returns 17 then the for loops does an insert statement for every instance, when the 17 turns into zero the loop stops. For some reason the $insert never recieves any value. Please post your code. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* I don't believe there really IS a GAS SHORTAGE.. I think it's all just a BIG HOAX on the part of the plastic sign salesmen -- to sell more numbers!! */ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] $_get 2 variables
Hi, I'm wanting to retrieve data from my database using 2 conditions in the WHERE clause. How do i pick up 2 different variables from the URL? i can get just 1 variable easily (eg: http://localhost/myscript.php?var1=blah) My question essentially is: what string do do i need to type into the URL to pick up the 2 variables like this: $var1 = $_GET['var1']; $var2 = $_get['var2']; Do I need to start messing around with strings? or is there an easy way? Thanks, Gav This e-mail and any attachments are intended solely for the named addressee, are confidential and may contain legally privileged information. The copying or distribution of them or of any information they contain, by anyone other than the addressee, is prohibited. If you received this e-mail in error, please notify us immediately by return e-mail or telephone +61 2 9413 2944 and destroy the original message. Thank you. As Email is subject to viruses we advise that all Emails and any attachments should be scanned by an up to-date Anti Virus programme automatically by your system. It is the responsibility of the recipient to ensure that all Emails and any attachments are cleared of Viruses before opening. KSG can not accept any responsibility for viruses that maybe contained here in. Please advise KSG by return Email if you believe any Email sent by our system may contain a virus. It should be noted that most Anti Virus programmes can not scan encrypted file attachments (example - documents saved with a password). Thus extra care should be taken when opening these files. Liability limited by the Accountants Scheme, approved under the Professional Standards Act 1994 (NSW). Level 4 54 Neridah StreetPO Box 1290 CHATSWOOD NSW 2067 CHATSWOOD NSW 2057 Ph: +61 2 9413 2944 Fax: +61 2 9413 9901 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] $_get 2 variables
Quoting Gavin Amm [EMAIL PROTECTED]: Hi, I'm wanting to retrieve data from my database using 2 conditions in the WHERE clause. How do i pick up 2 different variables from the URL? i can get just 1 variable easily (eg: http://localhost/myscript.php?var1=blah) My question essentially is: what string do do i need to type into the URL to pick up the 2 variables like this: $var1 = $_GET['var1']; $var2 = $_get['var2']; Do I need to start messing around with strings? or is there an easy way? Thanks, Gav Try: http://localhost/myscript.php?var=foovar2=bar '' is the default url parameter seperator. The rest of your code looks fine. (course there are lots of other ways to go about it). --Ryan -- Ryan T. Gallagher [EMAIL PROTECTED] International Studies Abroad http://www.studiesabroad.com (512)480-8522 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] $_get 2 variables
http://localhost/myscript.php?var1=blahvar2=blah2 Ignatius - Original Message - From: Gavin Amm [EMAIL PROTECTED] To: Php-Db (E-mail) [EMAIL PROTECTED] Sent: Wednesday, November 20, 2002 7:30 AM Subject: [PHP-DB] $_get 2 variables Hi, I'm wanting to retrieve data from my database using 2 conditions in the WHERE clause. How do i pick up 2 different variables from the URL? i can get just 1 variable easily (eg: http://localhost/myscript.php?var1=blah) My question essentially is: what string do do i need to type into the URL to pick up the 2 variables like this: $var1 = $_GET['var1']; $var2 = $_get['var2']; Do I need to start messing around with strings? or is there an easy way? Thanks, Gav This e-mail and any attachments are intended solely for the named addressee, are confidential and may contain legally privileged information. The copying or distribution of them or of any information they contain, by anyone other than the addressee, is prohibited. If you received this e-mail in error, please notify us immediately by return e-mail or telephone +61 2 9413 2944 and destroy the original message. Thank you. As Email is subject to viruses we advise that all Emails and any attachments should be scanned by an up to-date Anti Virus programme automatically by your system. It is the responsibility of the recipient to ensure that all Emails and any attachments are cleared of Viruses before opening. KSG can not accept any responsibility for viruses that maybe contained here in. Please advise KSG by return Email if you believe any Email sent by our system may contain a virus. It should be noted that most Anti Virus programmes can not scan encrypted file attachments (example - documents saved with a password). Thus extra care should be taken when opening these files. Liability limited by the Accountants Scheme, approved under the Professional Standards Act 1994 (NSW). Level 4 54 Neridah StreetPO Box 1290 CHATSWOOD NSW 2067 CHATSWOOD NSW 2057 Ph: +61 2 9413 2944 Fax: +61 2 9413 9901 -- 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 update a text BLOB in ODBC?
thanks for the correction, miles and martin.. just an email typo. i still have the problem though. :( -- Jeff Stern 949-824-2326 [EMAIL PROTECTED] Social Sciences Computing Services University of California, Irvine 3151 Social Science Plz Irvine CA 92697-5100 On Tue, 19 Nov 2002, Miles Thompson wrote: Jeff, Check your SQL. Shouldn't $sql = insert into note_tbl (note) values ('${note}') where pkey = '45'; be UPDATE where pkey = '45' ? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] standart variabels melfunction
Martin, what you are experiencing is the normal way to call form variables. There is no problem. You should use register_globals=Off whenever possible. better security. Ignatius - Original Message - From: Beau Lebens [EMAIL PROTECTED] To: 'Martin Allan Jensen' [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Wednesday, November 20, 2002 5:46 AM Subject: RE: [PHP-DB] standart variabels melfunction [php.ini] register_globals=On Beau // -Original Message- // From: Martin Allan Jensen [mailto:[EMAIL PROTECTED]] // Sent: Wednesday, 20 November 2002 12:41 PM // To: [EMAIL PROTECTED] // Subject: [PHP-DB] standart variabels melfunction // // // Hi all, // // I have a problem with my settings of Apache and PHP i think.. // // When i call for example ($PHP_SELF) instead of // ($_SERVER[PHP_SELF]) i get no output, just like when i call the url // www.servername.tld/test.php?mode=test // And i want to call the mode like this: // print($mode); // I just get a empty string. // But when i call: // print($_GET[mode]); // I get the real output... // // I tried to walk troug the hole php.ini the httpd.conf // file, but nothing came up, so i relly hope that you can help // me out here...! // // Sorry if it's a little off topic.. // // And THANKS A LOT!! // // Regards // Martin Allan Jensen // -- 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 update a text BLOB in ODBC?
Quoting Jeff Stern [EMAIL PROTECTED]: thanks for the correction, miles and martin.. just an email typo. i still have the problem though. :( On Tue, 19 Nov 2002, Miles Thompson wrote: Jeff, Check your SQL. Shouldn't $sql = insert into note_tbl (note) values ('${note}') where pkey = '45'; be UPDATE where pkey = '45' ? With MSSQL the blobs (text/image) can be handled with READ_IMAGE/READ_TEXT and WRITE_IMAGE/WRITE_TEXT. This writes/reads from the paged resource directly, bypassing the transaction log etc etc. I don't know if your DB possibly has a similiar method? Aside: Insert and Update work normally as well... but are fully logged. -- Ryan T. Gallagher [EMAIL PROTECTED] International Studies Abroad http://www.studiesabroad.com (512)480-8522 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] how to update a text BLOB in ODBC?
Hi Jeff, Just a question - why are you using ODBC instead of PHP's native Interbase connectivity? ODBC is definitely slower. I don't know anything about BLOBs under ODBC, but I could help you with direct Interbase connectivity, which I use extensively (but not for text fields - it makes it difficult and slow to search). Let me know if you need help with direct connection BLOB handling under Interbase. I am using Firebird, not that it should make any difference. HTH David Russell IT Support Manager Barloworld Optimus (Pty) Ltd Tel: +2711 444-7250 Fax: +2711 444-7256 e-mail: [EMAIL PROTECTED] web: www.BarloworldOptimus.com -Original Message- From: Jeff Stern [mailto:[EMAIL PROTECTED]] Sent: 20 November 2002 08:24 AM To: Miles Thompson; Martin Allan Jensen Cc: [EMAIL PROTECTED] Subject: Re: [PHP-DB] how to update a text BLOB in ODBC? thanks for the correction, miles and martin.. just an email typo. i still have the problem though. :( -- Jeff Stern 949-824-2326 [EMAIL PROTECTED] Social Sciences Computing Services University of California, Irvine 3151 Social Science Plz Irvine CA 92697-5100 On Tue, 19 Nov 2002, Miles Thompson wrote: Jeff, Check your SQL. Shouldn't $sql = insert into note_tbl (note) values ('${note}') where pkey = '45'; be UPDATE where pkey = '45' ? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php smime.p7s Description: application/pkcs7-signature