Re: [PHP-DB] Fixed Quote Marks in Inputs

2002-01-04 Thread php3
** Reply to note from Bogdan Stancescu <[EMAIL PROTECTED]> Sat, 05 Jan 2002 05:39:46 +0200 > > Bogdan Stancescu wrote: > > > Ok, finally found a valid argument! :-) > > > > What if the user enters "I'm aware that 2>3!"? > > > > Bogdan > > Tested it - it works. However, you'll have big problems if

Re: [PHP-DB] Fixed Quote Marks in Inputs

2002-01-04 Thread Bogdan Stancescu
Bogdan Stancescu wrote: > Ok, finally found a valid argument! :-) > > What if the user enters "I'm aware that 2>3!"? > > Bogdan Tested it - it works. However, you'll have big problems if you'll ever need to echo the data. Consider this example: Enter description: The user enters "Edited by Bo

Re: [PHP-DB] match

2002-01-04 Thread David Yee
If you're trying to prevent HTML tags from being submitted then try htmlentities($your_variable). That'll convert for example to
.

David

- Original Message -
From: "louie miranda" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, January 04, 2002 6:22 PM
Subject: [PHP-DB] 

Re: [PHP-DB] match

2002-01-04 Thread Bogdan Stancescu
Why would this be a problem (i.e. the fact that a user may insert "" in a form field)? If you're worried about security (i.e. users adding JavaScript code) you can always htmlspecialchars() the string... Bogdan louie miranda wrote: > Hi is it possible to match a certain string when a user subm

[PHP-DB] match

2002-01-04 Thread louie miranda
Hi is it possible to match a certain string when a user submit's a form I mean, ex: i put "" on a form field, and php will match it and example deny it, oh well.. im new sorry.. :) thank you mysql_query ("INSERT INTO members (ircname, email, realname, asl, info) VALUES ('$ircname','$email','$rea

Re: [PHP-DB] Fixed Quote Marks in Inputs

2002-01-04 Thread Bogdan Stancescu
Ok, finally found a valid argument! :-) What if the user enters "I'm aware that 2>3!"? Bogdan Jonathan Hilgeman wrote: > And I apologize if I came off as ultra-defensive/rude. I had a bad day, a > bright idea, and then felt like someone was tearing it to pieces. This is > like the PHP soap ope

Re: [PHP-DB] How to insert to DB from txt??? Please help

2002-01-04 Thread Steven Dowd
you should maybe try the free dbtools mysql program from http://www.dbtools.com.br this can handle text file imports direct into a mysql db , also it can import or export from excell , access, paradox, foxpro , dbase or odbc data sources, very handy tool if all you ever use it for is the transfer

RE: [PHP-DB] How to insert to DB from txt??? Please help

2002-01-04 Thread ted
egrep_split? But then, there's the learning curve for grep... On Fri, 4 Jan 2002, Leotta, Natalie (NCI/IMS) wrote: > There are a few ways to split up text based on a delimiter. I recommend you > look at split and explode on the PHP.net site and see what seems to be best > for your situation.

RE: [PHP-DB] Fixed Quote Marks in Inputs

2002-01-04 Thread Jonathan Hilgeman
And I apologize if I came off as ultra-defensive/rude. I had a bad day, a bright idea, and then felt like someone was tearing it to pieces. This is like the PHP soap opera. - Jonathan -Original Message- From: Bogdan Stancescu [mailto:[EMAIL PROTECTED]] Sent: Friday, January 04, 2002 3:44

Re: [PHP-DB] Fixed Quote Marks in Inputs

2002-01-04 Thread Bogdan Stancescu
Ok, seems like I misjudged you and I apologize for that. I haven't changed my opinion about the very issue we've been discussing - only wanted to post the sentence above, just for the record. Bogdan Jonathan Hilgeman wrote: > Apparently, the experienced way is to store them with slashes, which

RE: [PHP-DB] Fixed Quote Marks in Inputs

2002-01-04 Thread Jonathan Hilgeman
Apparently, the experienced way is to store them with slashes, which is what I've followed for years. I consider years of programming to be a fair amount of experience, thus qualifying me to be experienced. ANYHOW, after finally thinking a bit outside the box and with some valuable input from some

Re: [PHP-DB] Fixed Quote Marks in Inputs

2002-01-04 Thread Bogdan Stancescu
Ok, as I said before, you can store whatever you please in your database. However, please don't "speak as an experienced web programmer" when not longer than three hours ago you finally found a solution to store quoted text in a database. Bogdan Jonathan Hilgeman wrote: > I realize that part -

RE: [PHP-DB] Fixed Quote Marks in Inputs

2002-01-04 Thread Jonathan Hilgeman
I realize that part - my whole point was that it didn't really matter how it was stored as long as it gets extracted/parsed correctly. With that in mind, instead of using 3 functions to store, extract, and parse the data, I can use one function to prepare the data to be stored in a format that can

Re: [PHP-DB] Fixed Quote Marks in Inputs

2002-01-04 Thread Bogdan Stancescu
Oh, one more thing - maybe you don't understand what the slashing is for: you don't store \" in the database -- the slash is there just so the MySQL statement is correct. MySQL knows about slashing and will replace your \" with " so what you store in the database is exactly what the user typed in

Re: [PHP-DB] Fixed Quote Marks in Inputs

2002-01-04 Thread Bogdan Stancescu
It seems obvious to me that you can do whatever you please - I was just suggesting what seems to me as the proper way to do it. Why I say it's the proper way to do the job is because you never know about future development and storing the data in ASCII seems to me as the most convenient approach

RE: [PHP-DB] Fixed Quote Marks in Inputs

2002-01-04 Thread Jonathan Hilgeman
How is it the \"proper\" way to do it and why does it have to remain the \"proper\" way of doing it? Simply because it retains the same character in the database? What good is that if the data will simply be extracted and unslashed at a later point anyway? How the data is kept internally should n

[PHP-DB] How to put data

2002-01-04 Thread Jeff Moncrieff
Hello How do you Normal put you mysql data in to a php table. Jef -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]

Re: [PHP-DB] Fixed Quote Marks in Inputs

2002-01-04 Thread Bogdan Stancescu
That would be because this way you'll end up with the proper data in the database instead of HTML-encoded strings. Plus it's the proper way to do it -- everybody does it this way and it's a good habit. Bogdan Jonathan Hilgeman wrote: > I thought I made it somewhat clear: > > when I'm dealing wi

RE: [PHP-DB] Fixed Quote Marks in Inputs

2002-01-04 Thread Jonathan Hilgeman
I thought I made it somewhat clear: > when I'm dealing with form inputs that can contain quote marks Why run 3 functions at separate times when you can run one once just before data is inserted into the database? - Jonathan -Original Message- From: Bogdan Stancescu [mailto:[EMAIL PROTEC

[PHP-DB] Re: Redirecting to a new page

2002-01-04 Thread Fred
Please note, that this is a very insecure way of determining which page a person gets to view. All they would have to do is enter the admin.php url in the browser and they get admin access even if they are not admins. Fred Matt Stewart <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">new

Re: [PHP-DB] Fixed Quote Marks in Inputs

2002-01-04 Thread Bogdan Stancescu
Those are two different things. You never mentioned your HTML problem, that's why nobody adressed it. So, the proper way to do it is: 1. Insert into the database using addslashes(); 2. Use stripslashes() after retrieving the data if you need to; 3. Use htmlspecialchars() for displaying the data i

[PHP-DB] Re: Array not supported for strings???

2002-01-04 Thread Andy
Here is the full code: ### # Get the name of the country: if (isset($country_id)){ //only if there are results for($i=0; $i< count($country_id); $i++){ $stmt= " SELECT country from $DB2.$geo_T1 where country_code =

RE: [PHP-DB] Fixed Quote Marks in Inputs

2002-01-04 Thread Jonathan Hilgeman
I've tried those methods, but they cause problems when the values are loaded back into INPUTs for editing. For instance, even if the database-stored value is Mark\'s Pet Named \"Flea Muffin\", try loading that value into an INPUT so it looks like: Or try double-quotes: You'll see what I mean

RE: [PHP-DB] Fixed Quote Marks in Inputs

2002-01-04 Thread Rick Emery
Another option is to use PHP's addslashes() and stripslashes() functions. These will add/remove slashes in front of quotes to make them database friendly. -Original Message- From: Jonathan Hilgeman [mailto:[EMAIL PROTECTED]] Sent: Friday, January 04, 2002 2:05 PM To: [EMAIL PROTECTED] Sub

[PHP-DB] Fixed Quote Marks in Inputs

2002-01-04 Thread Jonathan Hilgeman
I finally came up with a reliable solution that I can use when I'm dealing with form inputs that can contain quote marks (single or double quotes). To store quote marks, you can str_replace them with their HTML code equivalents. For single quote marks, this is ', and for double quote marks it's "

RE: [PHP-DB] Array not supported for strings???

2002-01-04 Thread Rick Emery
Need to show us more code... -Original Message- From: Andy [mailto:[EMAIL PROTECTED]] Sent: Friday, January 04, 2002 2:00 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] Array not supported for strings??? Hi there, I have a problem with an array: This code: $country[] = $row->country; Cre

[PHP-DB] Array not supported for strings???

2002-01-04 Thread Andy
Hi there, I have a problem with an array: This code: $country[] = $row->country; Creates following error msg: Fatal error: [] operator not supported for strings The wired thing is, that the same procedure works through my whole application, but not in this case. Did anybody make the sam

Re: [PHP-DB] Please help asap

2002-01-04 Thread Bogdan Stancescu
In the printf() line after "5 6 7" you try to print "%s" 24 times but only provide 10 values. That may have something to do with it... Bogdan Jeff Moncrieff wrote: > Hello > > I am trying make a script fatch my data form my mysql database. I use > this script but when execute it is says > Wa

[PHP-DB] Please help asap

2002-01-04 Thread Jeff Moncrieff
Hello I am trying make a script fatch my data form my mysql database. I use this script but when execute it is says Warning: printf(): too few arguments in /home/httpd/html/larken/database.php on line 47 any hints Thanks Jeff \n"; echo "Name of contactName of company AddressPostal

Re: Fwd: Re: [PHP-DB] How to querry two db in a single statement?

2002-01-04 Thread Daniel Barton
Hi all: AFAIK, it is possible in a bunch of database software to query multiple DBs through joining. I have a Foxpro background (so most of what I say is therefore, b.s.) but you can define your query tables using this notation: database.table Which allows you to query multiple DBs. You should

RE: [PHP-DB] How to querry two db in a single statement?

2002-01-04 Thread Jonathan Hilgeman
How about: SELECT c.country FROM db2.users u LEFT JOIN db1.countries c ON u.country_id=c.country_id GROUP BY c.country; This assumes the following layout: db1.countries | country_id | country | | 67 | USA | | 68 | Uganda | |

Re: [PHP-DB] How to insert to DB from txt??? Please help

2002-01-04 Thread Jason Wong
On Saturday 05 January 2002 00:44, Kelvin wrote: > Hi everyone, > > I have a txt file which is contained the following: > > ,aaa,ccc,ddd > ,aaa,ccc,ddd > .etc. > >Now, I need to read the data from that file and than insert it into the > table. > >inser

[PHP-DB] Re: Redirecting to a new page

2002-01-04 Thread George Nicolae
if ($myrow[Admin] == "Y"){ > header ("Location:admin.php"); > }else{ > header ("Location:user.php"); > } -- Best regards, George Nicolae IT Manager ___ X-Playin - Professional Web Design www.x-playin.f2s.com "Matt Stewart" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTE

RE: [PHP-DB] How to insert to DB from txt??? Please help

2002-01-04 Thread Nally, Tyler G.
How about LOAD DATA INFILE 'filename.txt' INTO TABLE Table FIELDS TERMINATED BY ',' < comma delimited for tabs use '\t' LINES TERMINATED BY '\n' < *nix line terminator, for Dos/Win use '\r\n' IGNORE 1 LINES < use if the first line of the file has col. hdrs. (colu

RE: [PHP-DB] How to insert to DB from txt??? Please help

2002-01-04 Thread Leotta, Natalie (NCI/IMS)
There are a few ways to split up text based on a delimiter. I recommend you look at split and explode on the PHP.net site and see what seems to be best for your situation. Once you go to one of them they link you to other functions that do similar things. I believe explode is faster but I can't

[PHP-DB] How to insert to DB from txt??? Please help

2002-01-04 Thread Kelvin
Hi everyone, I have a txt file which is contained the following: ,aaa,ccc,ddd ,aaa,ccc,ddd .etc. Now, I need to read the data from that file and than insert it into the table. insert into Table ("name","pass","phone","somethingelse") Could someon

RE: [PHP-DB] How to querry two db in a single statement?

2002-01-04 Thread Jonathan Hilgeman
If the two databases are on the same server, you can use joins to select data from multiple databases. For instance: Database 1, Table A: | id | name| | 1 | George | | 2 | Mark| | 3 | Harry | Database 2,

[PHP-DB] PHP4 + ODBC Openlink +ORACLE 8.1 on DIGITAL

2002-01-04 Thread Javalina
Hi to all...i have a problem when i try to connect from php to the oracle 8.1 on a DIGITAL ALPHA MAchine.. i did use openlink , when i try the connection with the SQL aplication test of the OPENLINK driver , function OK...the debug of this query is. oplrqb: 192.168.99.106 called (192.168.99.106.

Re: [PHP-DB] querystring text

2002-01-04 Thread Bogdan Stancescu
rawurlencode() does this trick. Matthew Tedder wrote: > Quick question for anyone who knows, > >Is there a PHP function to make data safe for sending in the query string? > > $var = "something or other"; > > // TODO: What is function to translate $var for querystring compatibility? > > print

Fwd: Re: [PHP-DB] How to querry two db in a single statement?

2002-01-04 Thread markus|lervik
Didn't notice that this didn't get cc:d to the list, so here it hoes. -- Forwarded Message -- Subject: Re: [PHP-DB] How to querry two db in a single statement? Date: Fri, 4 Jan 2002 15:58:35 +0200 From: markus|lervik <[EMAIL PROTECTED]> To: "Andy" <[EMAIL PROTECTED]> On Frida

RE: [PHP-DB] Re: [PHP] Sending variables between PHP pages

2002-01-04 Thread Rick Emery
Berlina, Are you attempting to set a variable in one page and use its value in the next page? If so, I'll show you how. -Original Message- From: Berlina [mailto:[EMAIL PROTECTED]] Sent: Friday, January 04, 2002 5:50 AM To: [EMAIL PROTECTED]; php-general-list; php-dev-list; php-db-list S

Re: [PHP-DB] Redirecting to a new page

2002-01-04 Thread Roel Mulder
Hi Matt, http://nl.php.net/manual/nl/function.header.php Note: HTTP/1.1 requires an absolute URI as argument to Location: including the scheme, hostname and absolute path. Thus, print "Location:http:/www.host.com/admin.php"; should work. Regards, Roel Mulder At 13:57 04-01-2002 +, you wro

Re: [PHP-DB] How to querry two db in a single statement?

2002-01-04 Thread George Lioumis
Try the following: I believe that this should work (I haven't tried it though!!!) May the force be with you!!! George - Original Message - From: "Andy" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, January 04, 2002 3:50 PM Subject: [PHP-DB] How to querry two db in a single

Re: [PHP-DB] Redirecting to a new page

2002-01-04 Thread Miles Thompson
Matt, Instead of "print" you want to issue a header(). Check the manual for various caveats. Miles At 01:57 PM 1/4/2002 +, matt stewart wrote: >Can't find the right instructions on php.net, basically, i want a page where >someone logs in, and then according to the database entry for them,

[PHP-DB] Redirecting to a new page

2002-01-04 Thread matt stewart
Can't find the right instructions on php.net, basically, i want a page where someone logs in, and then according to the database entry for them, either they are an admin user or a normal user, and it should then send them to a page depending on which they are. I've accessed the db ok, and checked

[PHP-DB] How to querry two db in a single statement?

2002-01-04 Thread Andy
Hi there, I would like to make a querry on 2 db. There is info in tables I would like to compare. As I know, there has first to be a conect on the db before the querry. But how to do this on 2 db?? Thanx for any help. Andy -- PHP Database Mailing List (http://www.php.net/) To unsubscribe,

[PHP-DB] How to compress a jpeg (qualitysetting) before saving it to the server?

2002-01-04 Thread Andy
Hi there, I am uploading jpegs in my app. How can I control the compression setting before saving? Currently my code looks like: $inputImg = ImageCreateFromJPEG($image); # old size $srcX = imagesx($inputImg); $

RE: [PHP-DB] Sending variables between PHP pages

2002-01-04 Thread Bjarte Husebø
> -Original Message- > From: markus|lervik [mailto:[EMAIL PROTECTED]] > Sent: Friday, January 04, 2002 1:29 PM > > > > Example: > > > > > # Include the file containing general variables/constants/funstions > > require ("general.inc"); > > > > # Open a connection to MySQL using varia

Re: [PHP-DB] Sending variables between PHP pages

2002-01-04 Thread markus|lervik
On Friday 04 January 2002 14:26, Bjarte Husebø wrote: > Another way of doing this, is including a file at the beginning of each > script: > > Example: > ># Include the file containing general variables/constants/funstions > require ("general.inc"); > > # Open a connection to MySQL using va

RE: [PHP-DB] Sending variables between PHP pages

2002-01-04 Thread Bjarte Husebø
Another way of doing this, is including a file at the beginning of each script: Example: Regards, -Bjarte- > -Original Message- > From: markus|lervik [mailto:[EMAIL PROTECTED]] > Sent: Friday, January 04, 2002 12:40 PM > To: Berlina > Cc: [EMAIL PROTECTED] > Subject: Re: [PHP-DB] Send

Re: [PHP-DB] phpmyadmin

2002-01-04 Thread Miles Thompson
That I can't help you with, as I've never worked with phpmyadmin, always manipulated the database at the MySQL console. By default MySQL stores the database in it's ../var directory, like so: /path/to/mysql/var /mysql - the database which contains info about the other databases

Re: [PHP-DB] Sending variables between PHP pages

2002-01-04 Thread markus|lervik
On Friday 04 January 2002 13:15, you wrote: > Hi users, > > how can I send a connection database variable, from one PHP page to other > PHP page, and maintance the database connection open during both pages? > > Thanks This is exactly what I've been fighting with for quite some time. Actually, wh

[PHP-DB] Re: [PHP] Sending variables between PHP pages

2002-01-04 Thread Berlina
Yes, Im thinking the same... :-(( Thanks again Intruder - Original Message - From: "Intruder" <[EMAIL PROTECTED]> To: "Berlina" <[EMAIL PROTECTED]>; "php-general-list" <[EMAIL PROTECTED]>; "php-dev-list" <[EMAIL PROTECTED]>; "php-db-list" <[EMAIL PROTECTED]> Sent: Friday, January 04, 20

[PHP-DB] RE: [PHP] Sending variables between PHP pages

2002-01-04 Thread Intruder
>> how can I send a connection database variable, from one PHP page to other >> PHP page, and maintance the database connection open during both pages? I don't think one can do that. There is NO need for that. You can write header.php file and include it in the beginning of each PHP page where yo

[PHP-DB] RE: [PHP] Sending variables between PHP pages

2002-01-04 Thread Intruder
>> Yes, thanks a lot, but i need to mantain the connection open for manage a >> transaction, an everytime that I open a new database connection, >> the system >> begins a new transaction and I lose the last one. >> Do you understand, me? >> Do you know the way for do that? I think it is imposimbl

[PHP-DB] Sending variables between PHP pages

2002-01-04 Thread Berlina
Hi users, how can I send a connection database variable, from one PHP page to other PHP page, and maintance the database connection open during both pages? Thanks -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAI

[PHP-DB] mysql_select_db api bug?

2002-01-04 Thread Jean-Pierre Arneodo
The function mysql_select_db set the db for one or for all link identifiers? The table my_table is in db1 but the active database seems to be test on link #8. Here the result with PHP 4.1.0 and MySQL 3.23.41-log: mysql_pconnect() id1=Resource id #8 mysql_select_db(db1,Resource id #8) mysql_pconn