Re: [PHP-DB] meta tag inside php / redirect / refresh

2001-03-16 Thread Marck D. Pearlstone

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi Marc,

On 16 March 2001 at  23:09:48 -0500 (which was 04:09 where I  live)
Marc Bragg wrote to [EMAIL PROTECTED] and made these points:

MB Crazy after hours of syntax. How do you insert php code so that on
MB different results, 1 or 0, a different the resulting html page is
MB redirected or refreshed to a dfiferent url . . . . i tried:

MB ?php if(check_num == 0) meta http-equiv="refresh"
MB content="5;URL=http://www.chescolawyers.com/BB/index2.shtml"
?

You need to use the echo command to send the meta tag to the client
browser:

?php if(check_num == 0) echo( 'meta http-equiv="refresh"
content="5;URL=http://www.chescolawyers.com/BB/index2.shtml"');
?

- --
Cheers -- .\\arck D. Pearlstone -- Consultant Software Engineer
 
[ PGP Key ID: 0x929DCDA0 | www: http://www.silverstones.com  ]

 Where do forest rangers go to "get away from it all?"

-BEGIN PGP SIGNATURE-
Version: 6.5.8ckt (build 04)
Comment: PGP Sealed for freshness

iQA/AwUBOrHTzTnkJKuSnc2gEQL0XwCdHc4mQue9y6fj7/7MDSHv7DZTTAkAn2O0
2G925ybqEvrxDssa0Nd747+m
=jyQl
-END PGP SIGNATURE-




-- 
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] meta tag inside php / redirect / refresh

2001-03-16 Thread Paul Gardiner

Hi Marc,

Try this - untested and I'm very sleepy, but should get you closer ;o)

html
head
titleRefresh Test/title
?php if($check_num == 0) echo "META HTTP-EQUIV=\"REFRESH\"
CONTENT=\"5;URL=http://www.chescolawyers.com/BB/index2.shtml\"";
?
/head


Regards,
- Paul -



- Original Message - 
From: "Marc Bragg" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, March 16, 2001 4:09 AM
Subject: [PHP-DB] meta tag inside php / redirect / refresh


 Crazy after hours of syntax. How do you insert php code so that on
 different results, 1 or 0, a different the resulting html page is
 redirected or refreshed to a dfiferent url . . . . i tried:
 
 ?php if(check_num == 0) meta http-equiv="refresh"
 content="5;URL=http://www.chescolawyers.com/BB/index2.shtml"
 ?
 
  to no avail.
 
 help
 
 thanx
 
 
 
 -- 
 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]
 
 


-- 
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]




[PHP-DB] Using strings

2001-03-16 Thread Vanstaen Laurent

Hi all
  do you know how to delete the 2 first characters of a string. I have to put a 
string year in a database (4 digits year) and somewhere else I need only the 
last two digits. How do I get them from my string "year" ?
  
  Laurent Vanstaen

-- 
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] Website, Design, hosting and maintenance for only $999.00 per year

2001-03-16 Thread Norman Tan

Members of the list, I'd like to apologize for this and assure you 
that the email did NOT come from our domain nsmb.com. My headers 
are useless in tracking this person down, but if someone could please
offer assistance off the list, please email me.

Regards.

[EMAIL PROTECTED] wrote:
 
 Website, Design, hosting and maintenance for only $999.00 per year,
 by NetmarkDesign.
 
 Looking for a cost effective, professionally designed website?  Our program
 enables you to budget your internet base expenses upfront.  We offer
 in-house
 design, hosting and marketing.  Put all your internet operations under one
 roof.
 
 If you have an existing site and would like a quotation to convert, upgrade
 or redesign we offer 48 hour no obligation proposals tailored to your needs.
 
 See us at Top Ten Traffic Sites at www.greatfreesite.net/bestten where
 we've been ranked number 5 as the most cost effective website provider and
 take the next step to your success.
 
 NetmarkDesign

-- 
Norman Tan
North Shore Interactive
http://www.nsmb.com

-- 
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] Using strings

2001-03-16 Thread Stewart Taylor

$year2 = substr($year,2,2)

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: 16 March 2001 09:06
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Using strings


Hi all
  do you know how to delete the 2 first characters of a string. I have to
put a 
string year in a database (4 digits year) and somewhere else I need only the

last two digits. How do I get them from my string "year" ?
  
  Laurent Vanstaen

-- 
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]

-- 
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]




[PHP-DB] RE: syntax trouble

2001-03-16 Thread Rudolf Visagie

Publish first part of the php code so that we can see what's wrong in line
13 (or 12 sometimes).

Rudolf Visagie
[EMAIL PROTECTED]

-Original Message-
From: Marc S. Bragg [mailto:[EMAIL PROTECTED]]
Sent: 15 March 2001 10:39
To: [EMAIL PROTECTED]
Subject: syntax trouble


What does this mean?

Parse error: parse error, expecting `','' or `';'' in
/http/www/b/bidattorney.com/public_html/user/stest.phtml on line 13

--
Marc S. Bragg
[EMAIL PROTECTED]
Bialecki  Bragg, PC
p: 610-444-7508
f: 610-444-7548

http://www.chescolawyers.com/BB
"Chester County Legal Services" - "For All Your Legal Needs"


http://www.bloody100th.com "WWII 101st Airborne Division"
http://www.petercatalano.com "Soul of An Italian Artist"



-- 
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] syntax trouble

2001-03-16 Thread Russ Michell

As far as I can see:

What does this mean?
Parse error: parse error, expecting `','' or `';'' in
/http/www/b/bidattorney.com/public_html/user/stest.phtml on line 13

This means probably on line 12 you forgot a semi-colon...
and so php goes on to parse the lines past where it expected a 
semi-colon and finds incorrect syntax. (Due to lack of said-semi colon)

Go check it out!

HTH :)

Russ

#---#

 "Believe nothing - consider everything"

  Russ Michell
  Anglia Polytechnic University Webteam
  http://gertrude.sipu.anglia.ac.uk/webteam
  [EMAIL PROTECTED]
  +44 (0)1223 363271 ext 2331
  
  www.theruss.com

#---#


-- 
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]




[PHP-DB] Unix crypt

2001-03-16 Thread Vanstaen Laurent

Hi all,
   Do you know if the php "crypt" function really works like the unix one ??
I mean, when I compare my password on my system (crypted with unix crypt) and my 
password crypted with php crypt, it's not the same. And the php crypt doesn't 
send twice the same answer.

Laurent Vanstaen

-- 
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]




[PHP-DB] Lost connection to MySQL server during query

2001-03-16 Thread Ireneusz Piasecki

Hi evryone !
I have folowing error during execute my php3 script.

Warning: MySQL Connection Failed: Lost connection to MySQL server during query in 
/home/sw81/public_html/miss_wiosna_01/info.php3 on line 59

This happened somtimes.

Can i do something with it ??




Ireneusz Piasecki
webmaster www.b-c.pl
KomNet s.c
[EMAIL PROTECTED]
tel: 0 606 356 235
[EMAIL PROTECTED]



RE: [PHP-DB] Sessions in Functions

2001-03-16 Thread Allsebrook_Richard/askr
 BDY.RTF

-- 
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] Unix crypt

2001-03-16 Thread omar cromwell mercado


Salt is the first two characters in a DES-encrypted
password. It is used as a modifier to
regularly-encrypted passwords to avoid the same
encryptions for similar passwords. You must extract
the salt first for your reference password, then use
it as a salt to encrypt the password you want
compared.

Omar Mercado

--- Vanstaen Laurent [EMAIL PROTECTED] wrote:
 Yes I know that (I've read the doc :) ) but what is
 the salt exactly ??


__
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/

-- 
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]




[PHP-DB] If`s in MySQL.... Having some trouble here...

2001-03-16 Thread Trond Erling Hundal

Hi there...
I want to query two tables in my db. One containing a list of numbers
ranging from 1 - 10200, the other table is storing information that is
relative to some of the numbers:

Eks:
Table1.record1:  number=1

Table2.record1:  number=1 name=John

Now I want to query these to tables to show a table that has one column with
the numbers, and if there is a name stored in the other table for this
number, I want to display this.
(

So.

I have been doodling with an "if" thingy in MySQL, but I am having trouble
getting result I need.

select
table1.number,
IF(table1.number = table2.number AND table2.name = NULL,
'No name registered',
table2.name)
FROM table1,
 table2

LIMIT 0,30


What am I doing wrong here... It only displays the first name stored in the
table...?


- Trond -


-- 
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] Unix crypt

2001-03-16 Thread fabrizio . ermini

On 16 Mar 2001, at 10:53, Vanstaen Laurent wrote:

 Hi all,
Do you know if the php "crypt" function really works like the unix one ??
 I mean, when I compare my password on my system (crypted with unix crypt) and my 
 password crypted with php crypt, it's not the same. And the php crypt doesn't 
 send twice the same answer.
 
Because if you don't specify the salt, this will be randomly selected 
each time you call the function, so it will give different results each 
time.
As for the system password, keep in mind that different systems 
use different crypting algorithms; I guess that the right thing to do 
is carefully reading of both php's crypt manpage that the system's 
one. 

HTH, bye

/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

Fabrizio Ermini   Alternate E-mail:
C.so Umberto, 7   [EMAIL PROTECTED]
loc. Meleto Valdarno  Mail on GSM: (keep it short!)
52020 Cavriglia (AR)  [EMAIL PROTECTED]

-- 
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] If`s in MySQL.... Having some trouble here...

2001-03-16 Thread CC Zona

In article [EMAIL PROTECTED],
 [EMAIL PROTECTED] ("Trond Erling Hundal") wrote:

 I want to query two tables in my db. One containing a list of numbers
 ranging from 1 - 10200, the other table is storing information that is
 relative to some of the numbers:
 
 Eks:
 Table1.record1:  number=1
 
 Table2.record1:  number=1 name=John
 
 Now I want to query these to tables to show a table that has one column with
 the numbers, and if there is a name stored in the other table for this
 number, I want to display this.

Try:

select table1.number as num, name FROM table1
left join table2 using (number)

-- 
CC

-- 
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] 2 while loops - 2 tables

2001-03-16 Thread David

It is a little hard to advise on this without knowing the table schema, but
it is generally best to make the database do as much of the work as possible
rather than use logic in your script because databases are specifically
optimized for what they do.  If I were trying to do what you are talking
about, I would try to use a join in my query.  For help with join syntax,
see
http://www.mysql.com/documentation/mysql/bychapter/manual_Reference.html#JOI
N.

In your case, if the aptID field is shared, and there is a one-to-one
relationship between the tables (there is a row in each table for each
apartment), the query might look something like this:
$sql = "SELECT * FROM $table1, $table2 WHERE table1.aptID=table2.atpID AND
table1.apt_city = \"$apt_city\"  ";

Each row of the result set will include the data from both tables.




-- 
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]




[PHP-DB] dropdown menu

2001-03-16 Thread Liz Bander

Okay, maybe this is simple, but I'm at wit's end.  I have a drop down menu 
(code follows) and I want it to show full name (i.e. John Doe) ordered by 
last name.  Works fine under normal circumstances, but then I need it to 
write the email id associated with the full name to the database.  It won't 
do this.  Any ideas??? Code follows.

Thanks,

Liz

ldap table/db: cn= full name, sn= last name, uid= email id
orders table/db: req=email id

FROM SHOW_LIST.INC, CALLED BY ADD.PHP3

function show_users($users) {

   $query = "select uid, cn, sn from ldap order by sn ASC";

   $db_link = mysql_pconnect('10.10.10.10');
   mysql_select_db ('ldap', $db_link);
   $result = mysql_query ($query);

   if (($result)  (mysql_num_rows($result)  0)) {
 while ($line = mysql_fetch_row($result)) {
   $opts[$line[0]] = $line[1];
 }
   } else {
 $opts[0] = "Error in show_users()";
   }

   show_select($opts, $users);
}

FROM ADD.PHP3

function write_to_db() {

   $temp = explode('-', $GLOBALS["submitted"]);
   $submitted = $temp[2] . '-' . $temp[0] . '-' . $temp[1];
   $temp = explode('-', $GLOBALS["week_of"]);
   $week_of = $temp[2] . '-' . $temp[0] . '-' . $temp[1];

   $ins = "INSERT INTO orders (req, source, number, project, submitted, 
amount, status, week_of) VALUES ('" . $GLOBALS["req"] . "', '" . 
$GLOBALS["source"] . "', '" . $GLOBALS["number"] . "', '" . 
$GLOBALS["project"] . "', '$submitted', '" . $GLOBALS["amount"] . "', '" . 
$GLOBALS["status"] . "', '$week_of')";

   $message = '';

   $db_link = mysql_pconnect('10.10.10.10');
   mysql_select_db ('Order_Status', $db_link);

   $audit_message = "Created order number: " . $GLOBALS["source"] . 
$GLOBALS["number"];

   #$audit_sql = "INSERT INTO audittrail (reqnum, date, text) VALUES (" . 
$GLOBALS["req"] . ", '" . date('Y-m-d H:i:s') . "', '$audit_message')";

   if (mysql_query($ins)) {
 $message .= "ADDED " . $GLOBALS["source"] . $GLOBALS["number"] . " . ";

 #mysql_select_db ('op_requests', $db_link);
 #if (mysql_query($audit_sql)) {
 #  $message .= "AUDIT OK.";
 #} else {
 #  $message .= "AUDIT NOT.";
 #}
   } else {
 $message .= "ADD NOT. $ins";
   }

   return urlencode($message);

}


-- 
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] Login System with access levels

2001-03-16 Thread Ron Brogden

At 02:00 PM 3/16/2001 -0600, you wrote:
First, I would NOT store passwords in a database.  Rather, I'd store a hash
based upon the password and username.  Storing a password is dangerous as
regards security.

Just to be a little picky and *not* to start an argument (discussion yes), 
this really depends on the application don't you think?   If you are not 
using a secure web server and you are not doing anything particularly 
sensitive, I do not see a problem with plain text passwords.  Hashing them 
means you have to come up with alternative system for dealing with lost 
passwords which is probably just as likely to be a problem as having plain 
text passwords in the first place.  If you are not using a secure server 
you are still transmitting plain text values over the net so at best this 
seems a false sense of security.

If this is an e-commerce setup then I agree, go for the "hash" but if it is 
just a little community site or something, is the loss of usability (i.e. 
easy password recovery) worth the hassle for users and admins?  I have been 
wrestling with this a lot lately and am still not convinced that for a 
simple application this is justified. Can you suggest a reason why I should 
rethink this?

Finally, as far as a query:
   SELECT * FROM mytable WHERE access = $level;

Now this is just nitpicking but the above query could lead someone to 
create a security problem (since that is what we are concerned about 
here).  I think a better example would be something like:

$query=sprintf("SELECT table.cola,table.colb,table.colc FROM mytable WHERE 
access = %d",$level);

This way, nothing can be slipped into the query via "$level".

Cheers

-
Island Net AMT Solutions Group Inc.  Telephone:  250 383-0096
1412 Quadra  Toll Free:1 800 331-3055
Victoria, B.C.   Fax:250 383-6698
V8W 2L1  E-Mail:[EMAIL PROTECTED]
Canada   WWW:   http://www.islandnet.com/
-


-- 
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] 2 while loops - 2 tables

2001-03-16 Thread olinux

Do you mean JOIN the tables and then SELECT?



 The best way to do this is to structure your SQL statement to grab both
 apartment and
 feature information into one recordset... this simplifies the code alot
and
 makes it easier to use.

 Ryan Flynn
 Practical web development/design
 www.ryanflynn.com
- Original Message -
From: "Ryan Flynn" [EMAIL PROTECTED]
To: ""olinux"" [EMAIL PROTECTED]
Sent: Thursday, March 15, 2001 7:40 PM
Subject: Re: [PHP-DB] 2 while loops - 2 tables


 _
 Apartment 1  |   feature1
 apt_address1  |   feature2
 apt_address2  |   feature3
 _|_
 Apartment 2  |   feature1
 apt_address1  |   feature2
 apt_address2  |   feature3
 _|_
 Apartment 3  |   feature1
 apt_address1  |   feature2
 apt_address2  |   feature3
 _|_





_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


-- 
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]




[PHP-DB] dynamic columns

2001-03-16 Thread olinux

Greetings, 

I would like to put together a script that results similar to www.bestbuy.com 's 
compare feature.  Basically if you are looking in an item category you can select 
check boxes for each item you would like to compare.  The results display like this;

ITEM 1  ITEM 2  ITEM 3
FIELD1
FIELD2
FIELD3

So the problem for me in creating this is, how do you accomodate for sometimes 2 
items, and sometimes 3 or 4 being selected? It would be easy to show the table 
reversed (with fields at the top), but i like the way it is.  I have thought about it 
and wonder if something like this would work. (my code will be sloppy... but just to 
give an idea)

SELECT * FROM item_table WHERE item_ID = \"$item_ID\"

This would grab all of the records for the item ID's passed [which are passed from the 
checkboxes]
We would also need to get the field names.  I will assume that we have these. And then 
we need to use a while loop to get all variables.  Now we need to display it. The 
following would go at the end of the while loop

/*  $item_1_1 indicates the property of item 1 that corresponds to field_1  Thus,
 $item_1_2 indicates the property of item 1 that corresponds to field_2   */

/*  Now here we put an if statement that counts the number of records that were 
displayed and doe something based on that number */

$comparison_table = "
  TR
   TD$field_1/TD
   TD$item_1_1/TD";


I don't know! Now I am lost, please help me if you can.
Thanks

olinux



RE: [PHP-DB] dynamic columns

2001-03-16 Thread Larry Rivera


Are the fields always the same?

Ive used something similar, I usually fill an array with selection ids when
while loop them into querys- To get the table I ussualy create a container
table(one cell) and generate tables inside the container one for each item.


-Original Message-
From: olinux [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 16, 2001 1:43 PM
To: PHP-DB; [EMAIL PROTECTED]
Subject: [PHP-DB] dynamic columns


Greetings,

I would like to put together a script that results similar to
www.bestbuy.com 's compare feature.  Basically if you are looking in an item
category you can select check boxes for each item you would like to compare.
The results display like this;

ITEM 1  ITEM 2  ITEM 3
FIELD1
FIELD2
FIELD3

So the problem for me in creating this is, how do you accomodate for
sometimes 2 items, and sometimes 3 or 4 being selected? It would be easy to
show the table reversed (with fields at the top), but i like the way it is.
I have thought about it and wonder if something like this would work. (my
code will be sloppy... but just to give an idea)

SELECT * FROM item_table WHERE item_ID = \"$item_ID\"

This would grab all of the records for the item ID's passed [which are
passed from the checkboxes]
We would also need to get the field names.  I will assume that we have
these. And then we need to use a while loop to get all variables.  Now we
need to display it. The following would go at the end of the while loop

/*  $item_1_1 indicates the property of item 1 that corresponds to field_1
Thus,
 $item_1_2 indicates the property of item 1 that corresponds to field_2
*/

/*  Now here we put an if statement that counts the number of records that
were displayed and doe something based on that number */

$comparison_table = "
  TR
   TD$field_1/TD
   TD$item_1_1/TD";


I don't know! Now I am lost, please help me if you can.
Thanks

olinux


-- 
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]




[PHP-DB] Re: [PHP] RE: [PHP-DB] Login System with access levels

2001-03-16 Thread Jack Sasportas

Just a note...you can hash the password in the database.

Rick Emery wrote:

 First, I would NOT store passwords in a database.  Rather, I'd store a hash
 based upon the password and username.  Storing a password is dangerous as
 regards security.

 Second, if you're asking for syntax on how to add the security level column:
   ALTER TABLE mytable ADD access tinyint unsigned not null default "0";

 This will allow you to assigned security levels from 0 to 255.  You would
 set 0 as the lowest level and 255 (admin) as the highest.

 While you're at it, add the has security hash entry (discussed above):
   ALTER TABLE mytable ADD md5hash char(32) not null default "";

 Hashes are always 32 characters.

 Finally, as far as a query:
   SELECT * FROM mytable WHERE access = $level;

 This will permit the searcher to locate anything whereby the level is at
 $level or lower.
 -Original Message-
 From: Jordan Elver [mailto:[EMAIL PROTECTED]]
 Sent: Friday, March 16, 2001 1:28 PM
 To: PHP General Mailing List; PHP DB Mailing List
 Subject: [PHP-DB] Login System with access levels

 Hi,
 I've got a db with a username and password in it. I can let people log in,
 like SELECT * FROM table WHERE username = username AND password = password.

 But how can I add an access level column so that I can have different levels

 of security. So admin's can read everything, but users can only read certain

 sections.

 How could I add to my db and structure a query?

 Any ideas would be good,

 Cheers,

 Jord

 --
 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]

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

--
___
Jack Sasportas
Innovative Internet Solutions
Phone 305.665.2500
Fax 305.665.2551
www.innovativeinternet.com
www.web56.net



-- 
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] Login System with access levels

2001-03-16 Thread Rick Emery

First, I would NOT store passwords in a database.  Rather, I'd store a hash
based upon the password and username.  Storing a password is dangerous as
regards security.

Second, if you're asking for syntax on how to add the security level column:
  ALTER TABLE mytable ADD access tinyint unsigned not null default "0";

This will allow you to assigned security levels from 0 to 255.  You would
set 0 as the lowest level and 255 (admin) as the highest.

While you're at it, add the has security hash entry (discussed above):
  ALTER TABLE mytable ADD md5hash char(32) not null default "";

Hashes are always 32 characters.

Finally, as far as a query:
  SELECT * FROM mytable WHERE access = $level;

This will permit the searcher to locate anything whereby the level is at
$level or lower.
-Original Message-
From: Jordan Elver [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 16, 2001 1:28 PM
To: PHP General Mailing List; PHP DB Mailing List
Subject: [PHP-DB] Login System with access levels


Hi,
I've got a db with a username and password in it. I can let people log in, 
like SELECT * FROM table WHERE username = username AND password = password.

But how can I add an access level column so that I can have different levels

of security. So admin's can read everything, but users can only read certain

sections. 

How could I add to my db and structure a query? 

Any ideas would be good, 

Cheers,

Jord

-- 
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]

-- 
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]




[PHP-DB] Help with displaying rest of page after MySQL error

2001-03-16 Thread Chris Vargas

This has to be a basic question but I can't find it
answered anywhere; I'm probably not searching for the
right words or something.

I have a page that inserts some MySQL search results
in the middle of the page. My web hosting provider's
MySQL uptime is spotty. I'd like the rest of the page
to load if any of the calls to the database fails.

My first line of PHP code (embedded in HTML) has:

$db = mysql_connect("x","y","z") or
die("saysomethinghere");

If I have a connection problem, it does print the
"die" message and the connection error, but it also
stops the page right there: no more HTML is displayed.

I know about suppressing the error message with "@"
but this wouldn't seem to help this problem.

Do I need something to exit the embedded PHP and
continue on with the following HTML if $db ==
"" ?

Thanks.


__
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/

-- 
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] Help with displaying rest of page after MySQL error

2001-03-16 Thread Stuart J. Browne

 My first line of PHP code (embedded in HTML) has:

 $db = mysql_connect("x","y","z") or
 die("saysomethinghere");

 If I have a connection problem, it does print the
 "die" message and the connection error, but it also
 stops the page right there: no more HTML is displayed.

Well, you've mentioned your problem right here.  'or die (
"saysomethinghere" );'.  Die meaing just that. "Die".  Don't process
anything further.

 I know about suppressing the error message with "@"
 but this wouldn't seem to help this problem.

Try something like:

$db = mysql_connect("X", "Y", "Z");
$db_error = mysql_errno();
if ($db_error  0) {
print "Error conencting to the database";
$db_error = 1;
} else {
# Do the rest of your MySQL Queries etc. here
# or do checks to make sure $db_error is 0 prior
# to doing any...
}

hope this helps, or atleast points you in the right direction for
resolution.

bkx



-- 
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]




[PHP-DB] SQL Mysql - Informix

2001-03-16 Thread Jon V

Any idea how to extract table names for a database in informix - like the
sql for mysql SHOW TABLES;

??

J



-- 
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]