RE: [PHP-DB] Getting data on last INSERTed row

2003-06-24 Thread Ryan Marrs
Daniel, good luck in your endeavor, next time, just filter those with
attitudes out.  Many people on this list are very helpful.  A few are not.

I had a complete lose the attitude speech written out, but I think I'll
just let you figure it out.

Thanks for making this the great list it is Jason!

removes self

___
Ryan Marrs
Web Developer
Sandler  Travis Trade Advisory Services, Inc.
248.474.7200 x 183
248.474.8500 (fax)
www.strtrade.com


-Original Message-
From: Jason Wong [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, June 24, 2003 7:43 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Getting data on last INSERTed row


On Tuesday 24 June 2003 19:37, Daniel wrote:

 I'm wondering if there's an easy and non-system-demanding way to get 
 data on an INSERTed row in PHP/MySQL?

 Specifically, I want the value of an auto-incremented primary key 
 cell, uid. I'm INSERTing a new person into a table, and need to 
 return this value to a Javascript function that maintains an array of 
 all persons in this table. I want to avoid a full SELECT query that 
 would rebuild the array from scratch and put unnessecary load on the 
 SQL server.

 I first thought of mysql_affected_rows, but as far as I can read, it 
 only returns the value of rows affected, i.e. 1 on any INSERT 
 statement executed?

 Any ideas?

Yeah, did it ever cross your mind to read the manual? 

mysql_insert_id()

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-db
--

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

2003-06-19 Thread Ryan Marrs
DBTools - www.dbtools.com.br

___
Ryan Marrs
Web Developer
Sandler  Travis Trade Advisory Services, Inc.
248.474.7200 x 183
248.474.8500 (fax)
www.strtrade.com


-Original Message-
From: Michael Lewis [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 19, 2003 10:48 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] mysql Editor


A free alternative that works very well is sqlyog. Google it as I don't have
the url handy (it may be www.webyog.com or .org). I also use MySQL Front as
it still works fine. But I'm switching over to sqlyog because I want to
ensure that I am compatible with future releases of MySQL.

Michael Lewis



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

2003-01-24 Thread Ryan Marrs
?
function stripdomain($string)
{
if(stristr($string, co.))
{
$string = ereg_replace(.co., .,
$string);
}
$end = strrpos($string, .);
$string = substr($string, 0, $end);
while(strchr($string, .))
{
$start = strpos($string, .);
$string = substr($string, $start+1);
}
return $string;
}
?

There we go.  This one also parses .co.uk, which frustrated me there for a
minute, but oh well, I'm over it.  I don't believe there are any others that
will slip by this, but of course I can't be certain.

Give it a shot, see if it does what you need.  I tested it with:

Print
stripdomain(this.will.irritate.me.if.I.don't.figure.it.out.soon.co.uk);
It returned with soon

___
Ryan Marrs
Web Developer
Sandler  Travis Trade Advisory Services, Inc.
248.474.7200 x 183
248.474.8500 (fax)
www.strtrade.com


-Original Message-
From: heilo [mailto:[EMAIL PROTECTED]] 
Sent: Friday, January 24, 2003 1:27 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] function needed

Hi!

I hope I understood you right... I would use PCREs:

?php

function getdomainname($string)
{
$pattern = '#(([[:alnum:]]+)(\.))?(.+)(\.)([[:alnum:]]+)#i';
$replace = '\\4';
return preg_replace($pattern, $replace, $string);
}

$var = $_SERVER['SERVER_NAME'];

echo getdomainname($var);

?


.ma

Shahar Tal [EMAIL PROTECTED] [EMAIL PROTECTED] 18:44 Uhr:

 Hey
 
 I'm looking and wondering for a function, as i'm trying to do something,
and
 here it is.
 
 I'm using the SSI call :
 !--#echo var=HTTP_HOST --.
 to get the domain name I am on. this will output
 
 www.domain.com.
 
 I would like to use PHP in order to take this string, the output, and cut
 the www. and the .com from it, so only the domain will remain.
 ofcourse we can also have situations whith .org and .net and even
where
 there's no www. but the main thing I need is to remove whats
 after the second dot and before the first dot, along with the dots.
 
 I don't mind writing all the posibilities to the function, ie, all the
 possible extenstions that the function may need to cut, I just need it to
 take
 the text from the SSI, and cut everything but the domain part, which is
 the address itself.
 
 what would be the best way to do it?
 thank you!!
 
 



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

2003-01-24 Thread Ryan Marrs
Well I lost the race as well, because I failed to account for .com.br, or
.com.at, or any of those other rarely used ones.

Bah...

___
Ryan Marrs
Web Developer
Sandler  Travis Trade Advisory Services, Inc.
248.474.7200 x 183
248.474.8500 (fax)
www.strtrade.com


-Original Message-
From: 1LT John W. Holmes [mailto:[EMAIL PROTECTED]] 
Sent: Friday, January 24, 2003 2:02 PM
To: 1LT John W. Holmes; heilo; [EMAIL PROTECTED]
Subject: Re: [PHP-DB] function needed

But what about www.domain.co.uk, you ask? Well, it'll fail with this. :)

Just filter out the 'co.' like the other function that was posted and this
will still work.

---John Holmes...

- Original Message -
From: 1LT John W. Holmes [EMAIL PROTECTED]
To: heilo [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Friday, January 24, 2003 1:58 PM
Subject: Re: [PHP-DB] function needed


 You could also use this:

 function getdomainname($name)
 {
 $parts = explode('.',$name);
 return $parts[count($parts)-2];
 }

 which will always return the second to last section when divided up by the
 periods. So it will return 'domain' for all of the following:

 www.domain.com
 www.subdomain.domain.org
 subdomain.domain.org
 domain.museum

 ---John Holmes...

 - Original Message -
 From: heilo [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Friday, January 24, 2003 1:27 PM
 Subject: Re: [PHP-DB] function needed


  Hi!
 
  I hope I understood you right... I would use PCREs:
 
  ?php
 
  function getdomainname($string)
  {
  $pattern = '#(([[:alnum:]]+)(\.))?(.+)(\.)([[:alnum:]]+)#i';
  $replace = '\\4';
  return preg_replace($pattern, $replace, $string);
  }
 
  $var = $_SERVER['SERVER_NAME'];
 
  echo getdomainname($var);
 
  ?
 
 
  .ma
 
  Shahar Tal [EMAIL PROTECTED] [EMAIL PROTECTED] 18:44 Uhr:
 
   Hey
  
   I'm looking and wondering for a function, as i'm trying to do
something,
 and
   here it is.
  
   I'm using the SSI call :
   !--#echo var=HTTP_HOST --.
   to get the domain name I am on. this will output
  
   www.domain.com.
  
   I would like to use PHP in order to take this string, the output, and
 cut
   the www. and the .com from it, so only the domain will remain.
   ofcourse we can also have situations whith .org and .net and even
 where
   there's no www. but the main thing I need is to remove whats
   after the second dot and before the first dot, along with the dots.
  
   I don't mind writing all the posibilities to the function, ie, all the
   possible extenstions that the function may need to cut, I just need it
 to
   take
   the text from the SSI, and cut everything but the domain part, which
 is
   the address itself.
  
   what would be the best way to do it?
   thank you!!
  
  
 
 
 
  --
  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 Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP-DB] insert form data

2003-01-08 Thread Ryan Marrs
Or a redirect after submitting:

Header(Location: pagetogoto.php);



___
Ryan Marrs
Web Developer
Sandler  Travis Trade Advisory Services, Inc.
248.474.7200 x 183
248.474.8500 (fax)
www.strtrade.com


-Original Message-
From: Mignon Hunter [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, January 08, 2003 3:34 PM
To: 1LT John W. Holmes
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] insert form data

Actually, I dont need these variables in the rest of the form, I just
need to go to the next page...Like a hyperlink on the submit button
maybe ???

Seems like I've seen that...

Mignon


On Wed, 2003-01-08 at 14:12, 1LT John W. Holmes wrote:
  When I post to my next page in the survey in the form action, instead of
  this page, the data doesnt go into the database.  
  
  Does anyone know a way around this other than rewriting all the pages
  into one page?
 
 Use sessions or hidden form fields to transfer the data between pages.
 
 ---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] Re: Get Last ID Inserted

2002-11-21 Thread Ryan Marrs
I do see that picking up the incorrect ID, which is why we created a stored
procedure which returned the affected row.


-Original Message-
From: Adam Voigt [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, November 21, 2002 11:13 AM
To: David Elliott
Cc: Adam Voigt on PHP-DB
Subject: Re: [PHP-DB] Re: Get Last ID Inserted

But if there are heavy operations on the site, will this not also pick
up a different last inserted id, if in the split milisecond between the
insert and the next mssql_query which has the @@identity say, another
user does an insert?

On Thu, 2002-11-21 at 11:03, David Elliott wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 Hello Adam
 
 On 21 November 2002 at 10:47:15 -0500 (which was 15:47 where I live) Adam
 Voigt wrote
 
  Using Microsoft SQL does anyone know how to get the id of the row that
  you just inserted without clumsily trying to select the id back based on
  the same criteria of your insert (which might be overlapping)?
 
 select @@identity
 
 - --
  Cheers,   ___
   David   |David  Elliott|   Software Engineer
|
  _| [EMAIL PROTECTED] | PGP Key ID 0x650F4534
|
 | No dinner with Mel Gibson?! - Dot Warner
|
 
 -BEGIN PGP SIGNATURE-
 Version: 6.5.8ckt http://www.ipgpp.com/
 
 iQA/AwUBPd0DwfmK8eZlD0U0EQI3fACgsv52o5AvhuroJIVYblYXTnkiDZYAn2Ao
 y1AeA+bR4KPOwZhZTAa2x7kr
 =f/lr
 -END PGP SIGNATURE-
 
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
-- 
Adam Voigt ([EMAIL PROTECTED])
The Cryptocomm Group
My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP-DB] Count and group ?

2002-05-01 Thread Ryan Marrs

assuming these are your fields:

post_id
admin_id

code would look something like:

?
Mysql_pconnect(host,user,pass);
Mysql_select_db(db);
$totaladmins=3;
For($i=1;$i=$totaladmins;$i++)
{
$query = select count(post_id) as Admin1 where
Admin_id=$i;
$result = mysql_query($query);
$object = mysql_fetch_object($result);
$Admin[$i] = $object - admin_id;
print(Admin $i has $Admin[$i] posts.);
}
?
___
Ryan Marrs
Web Developer

Sandler  Travis Trade Advisory Services, Inc.
248.474.7200 x 183
248.474.8500 (fax)
www.strtrade.com


-Original Message-
From: Dave Carrera [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, May 01, 2002 8:03 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Count and group ?

Hi All

 

I have added a row to my table which inputs which admin user has amended
a record in a table on my db.

 

I have this working but what I would like to do is count how many
instances of the admin id I have stored.

 

So if my list looks like this..

 

Admin_id

1

2

2

2

3

3

3

3

3

2

1

1

Then the result I would like to display is this..

 

Admin (1) = 3 posts

Admin (2) = 4 posts

Admin (3) = 5 posts

 

Basically displaying the total post each admin has made

 

Any help or guidance is very appreciated and thank you in advance

 

Dave Carrera

Php Developer

http://davecarrera.freelancers.net

http://www.davecarrera.com

 

 


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] Date Returns

2002-03-15 Thread Ryan Marrs

Does anyone know if the date function returns false if it cannot convert the
specified date/time to the format?  If not, does anyone have a rule set they
use to verify the date is a valid convertible date?  I need to update a row
in MSSQL, and it will fail if the date is incorrect.  I've validated for the
basic things, but just am not sure what the best way would be to validate
the actual date itself.  I was thinking of RegExp, but not certain if that
would really work for multiple date formats for example:

March 15, 2002
03/15/2002
3/15/2002

and so on and so forth.  The field actually requests a dd/mm/yy format, but
you know how people follow instructions.

Thanks guys,

Ryan

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP-DB] Display in drop-down box

2002-03-01 Thread Ryan Marrs

Let me give this a shot :P

?
Mysql_connect(sqlserver,user,pass);
Mysql_select_db(db);
$resultset = mysql_query(select DISTINCT identifier, displayname from
table);
for($i=1;$i=mysql_num_rows($resultset);$i++)
{
$object = mysql_fetch_object($resultset);
$identifier = $object - identifier;
$displayname= $object - displayname;

print option value=\$identifier\$displayname/option;
}
?

I do believe that should do it.  Correct me if I missed anything.

Ryan

-Original Message-
From: Leotta, Natalie (NCI/IMS) [mailto:[EMAIL PROTECTED]] 
Sent: Friday, March 01, 2002 2:10 PM
To: PHP
Subject: RE: [PHP-DB] Display in drop-down box

Try doing a select distinct on that field and then loop through the results,
adding each one to your drop-down box as you go.

I don't have the exact code anymore because we stopped doing it that way,
but that's the basic idea of how to go about it.

I hope it helps!

-Natalie

 -Original Message-
 From: Alvin Ang [SMTP:[EMAIL PROTECTED]]
 Sent: Friday, March 01, 2002 2:07 PM
 To:   PHP
 Subject:  [PHP-DB] Display in drop-down box
 
 Hi there,
 
 I was wondering if anyone would be kind enough to show me how to select a
 field from a table in mysql and display it in a drop-down combo box?
 
 I am trying to show my users a list of all the parts from a table so that
 they can edit or delete it.
 
 Thanks!
 
 Alvin
 
 
 -- 
 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] Protecting php scripts from source being downloaded

2002-01-09 Thread Ryan Marrs

Or you could do something like:

if(!empty($PHP_SELF))
{
if(stristr($PHP_SELF, config.php))
{ 
header(Status: 404 Not Found);
}
}

that's assuming you use the register_globals.  If not, then you could simply
grab $PHP_SELF from the environment variables.

Ryan


-Original Message-
From: Neil Thomson [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, January 09, 2002 12:31 PM
To: Tom; [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Protecting php scripts from source being downloaded

u can download a php page from a download manager ? i just tryed with
flashget...  it phrased the php page into html first.. ? ?

if you want to protect your say.. variables file from some1 trying in the
address of it. heres a simple way. in the variables file include
@header(status: error 404); (or how ever that code goes). then in the page u
want to include this. start the html tag first html then include this
page. the @ will make it not report errors. so u can inclue the page
perfectally..  when people try to look @ it, it will say it doesnt exist.

Neil

- Original Message -
From: Tom [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, January 09, 2002 8:00 AM
Subject: [PHP-DB] Protecting php scripts from source being downloaded


 Hi, im kinda new to this so be kind :)

 Im using mysql and php to create test databases (guestbook etc, basic
 stuff), but it doesnt seem so secure, people can just use a download
manager
 to download the php files and steal the mysql passwords. Is there anyway
to
 make it so they can see the php files through the brower but not download
my
 homecrafted php?

 Ive looked through many websites and the history of this, all I could find
 was one post which was to encript the files (this isnt really suitable for
 me as I edit bits and bobs as I go along). Is there anyway I can setup
 access as said in the above? Or just hid the password somehow? Im using
IIS
 5.1.

 thanks
 tom



 --
 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 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] Input to DB from form

2002-01-03 Thread Ryan Marrs

Are you even calling the mysql_query() function?

Should look something like this:

Mysql_connect(localhost,cloft,spring);
mysql_select_db(countryloft);

$sql = INSERT INTO catalogreq
(BFNAME,BLNAME,ADD1,ADD2,BCITY,BZIPA,BSTATE,BCTRY,BTELO,DATE) VALUES
('$BFNAME','$BLNAME','$BADD1','$BADD2','$BCITY','$BZIPA','$BSTATE','$BCTRY',
'$BTELO','$TODAY');

Mysql_query($sql);


--Ryan

-Original Message-
From: James Kupernik [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, January 03, 2002 01:52 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Input to DB from form

I'm trying to input that data entered into a form into a table in my DB.
Here is the code I have.

$db = mysql_connect(localhost,cloft,spring);

  mysql_select_db(countryloft,$db);

  $sql = INSERT INTO catalogreq
(BFNAME,BLNAME,ADD1,ADD2,BCITY,BZIPA,BSTATE,BCTRY,BTELO,DATE) VALUES
('$BFNAME','$BLNAME','$BADD1','$BADD2','$BCITY','$BZIPA','$BSTATE','$BCTRY',
'$BTELO','$TODAY');

This is embedded in an HTML document and loads the entire document, but
doesn't add the information to the table. Any help would be wonderful!

James



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




RE: [PHP-DB] Decrypting PASSWORD() from MySQL

2001-12-20 Thread Ryan Marrs

Or what may be even better at that point (to keep someone from pestering
another user and changing their password.  Email them a randomly generated
string based on their username, store that in a database, then send them to
a page to enter the string (or pass it through the url.)

IE.

I'm Joe, I lost my password, I click Lost Password.  It emails me this:

http://this.domain.com/passwordreset.php?un=joegen=2lkfh4j2lk34klb25bmn425k
l23k5b

Then it will change my password to a randomly generated string and email it
to me.  
After that, it will allow me to change my password.

That way you don't have a schmuck in there guessing usernames, or pestering
people they don't like by clicking Lost Password.  If someone doesn't
check their mail quite frequently, they'll just get Incorrect Password and
be emailing you for support every 5 minutes.



 Ryan Marrs
 Web Developer
 Sandler and Travis Trade Advisory Services, Inc.
 248.474.7200 x 183
 http://www.strtrade.com
 
 

-Original Message-
From: Zach Curtis [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, December 20, 2001 11:15 AM
To: matt stewart
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Decrypting PASSWORD() from MySQL

This is how I'm going to work things.

Store the password using PASSWORD() in the table. Allow user to request
their forgotten username and/or password. If the password is requested, I
will reset the password to a random value and store this in the table using
PASSWORD(). The username and/or password will then be emailed to the user. I
will also provide a location where the user can change their password once
they are authenticated in the members area.

I think this approach allows the password to maintain a certain level of
security and give the user the greatest flexibility on maintaining their
password.


Zach

-Original Message-
From: matt stewart [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 20, 2001 2:19 AM
To: 'Zach Curtis'; [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Decrypting PASSWORD() from MySQL


I would go for the generate new random password approach - email the new
random password to the registered email address, then they can log in using
it and reset it to whatever they want. probably easier than using lots of
code encrypting and decrypting things?
Let me know what you decide on, and if you do enc/decrypt stuff, i'd be
interested in seeing the code for a similar thing myself!
Matt

-Original Message-
From: Zach Curtis [mailto:[EMAIL PROTECTED]]
Sent: 19 December 2001 20:27
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Decrypting PASSWORD() from MySQL


Thanks for the suggestions.

I guess I can try to:

A) Store the password in plaintext if I need to retrieve the password.
B) Store the password using PASSWORD() and then generate a new random
password if needed, replacing the old password.
C) Look into mcrypt, ENCODE()/DECODE(), encipher/decipher

Thanks,


Zach

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 19, 2001 12:56 PM
To: Zach Curtis
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Decrypting PASSWORD() from MySQL


Yet another example of ted's out-to-lunchness...

Use the mcrypt functions on the password...




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

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.307 / Virus Database: 168 - Release Date: 11/12/01


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.307 / Virus Database: 168 - Release Date: 11/12/01



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




RE: [PHP-DB] Getting apache to recognizeindex.php....

2001-12-04 Thread Ryan Marrs

You were correct as to the file to look in.  The directive passed is:
DirectoryIndex index.html

Change this to read:

DirectoryIndex index.html index.php

And that should be it.  You may need the Apache Module mod_dir, but I'm not
entirely sure, here's what my config looks like:

# DirectoryIndex: Name of the file or files to use as a pre-written HTML
# directory index.  Separate multiple entries with spaces.
# 
IfModule mod_dir.c
DirectoryIndex index.html index.php index.htm
/IfModule




 Ryan Marrs
 Web Developer
 Sandler and Travis Trade Advisory Services, Inc.
 248.474.7200 x 183
 http://www.strtrade.com
 
 

-Original Message-
From: Vincent Beaulieu [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, December 04, 2001 11:23 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Getting apache to recognizeindex.php

Can anyone tell me where to configure apache so that it recognizes
index.php as the index of a directory?  I tried looking through the
httpd.conf file for the option to add an extension...couldn't see
anything! My server treats index.html files correctly...(but is not
working with index.php)!

HELP!

Thank you,

Vincent


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

2001-10-24 Thread Ryan Marrs

I'm attempting to do basic authentication through PHP and am having little
success.  I have a login screen which requests a username and password, and
I need to have that check against a Windows domain.  IE:

Domain:  ALPHA
Login:  testusername
Password: TestPassword

SUBMIT

Then PHP needs to check against the ALPHA domain if the username and
password is correct.  Is there anyway to do this without popping up a
standard basic authentication form box?

Thanks!

Ryan

-- 
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] Tablename issue..

2001-08-30 Thread Ryan Marrs

What about using a view?
(Not entirely sure if Oracle supports them, but I don't see why not)

Ryan

-Original Message-
From: Tom Wallace [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, August 29, 2001 5:13 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Tablename issue..


 Tried this - same errors --  Also tried the following permutations
(courtesy of Trevor Lanyon) --

You can try to encapsulate the table name with hard bracket
[Table - Name]

You can escape the character with a slash (I don't think this will work):

Table\ \- Name

You can escape the characters with the hexidecimal url encoding (I know this

only to work with one try of database, and I think the client is actually

stripping it off)

Table%20%2D%20Name



The ODBC source I'm trying to connect to is a Remedy (Action Request System)
4.5 system running on top of a Oracle 8 database.

Thanks - Tom

Ryan Marrs [EMAIL PROTECTED] wrote in message
EA9290E62E6CD311859200805F85164902FB13DE@EXCHANGE">news:EA9290E62E6CD311859200805F85164902FB13DE@EXCHANGE...
 Try putting Brackets [] around the spaces.  This will typically fix the
 problem, ie:

 $sql2 = odbc_exec($conn,SELECT [Character Field] FROM [ABC - Table]);

 Let me know if it works!

 Ryan

 -Original Message-
 From: Tom Wallace [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, August 29, 2001 3:06 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] Tablename issue..

 Hola,

   I'm having a difficult time figuring out the syntax here -- my table
name
 has spaces  dashes in it..Unfortunately I can't permanently change the
 tablename.. I've tried a half dozen different ways to access the table,
each
 return an error similar to this:

 Warning: SQL error: [ISAM]No data found, SQL state S00 in SQLExecDirect in
 c:\inetpub\wwwroot\test8.php on line 14

 but removing the spaces from the tablename and updating the php fixes it..

  any ideas?

 $sql2 = odbc_exec($conn,SELECT Character_Field FROM ABC - Table);

 Thanks,
 -Tom




 --
 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 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] GET a html page via php....

2001-08-28 Thread Ryan Marrs

If it uses basic authentication, you should be able to do:

Fopen(http://username:[EMAIL PROTECTED],r;)


Ryan Marrs
[EMAIL PROTECTED]
Web Applications Developer / IT
Sandler  Travis Trade Advisory Services, Inc.
www.strtrade.com
248-474-7200 x 183


-Original Message-
From: Eduardo Vela [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, August 28, 2001 8:49 AM
To: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] GET a html page via php

I am also interested in this matter...

Is there a way to open a file in a site which require usename and password?

thks.
-Mensaje original-
De: * RzE: [mailto:[EMAIL PROTECTED]]
Enviado el: Martes, 28 de Agosto de 2001 06:31 a.m.
Para: Koutsogiannopoulos Karolos; PHP Database Mailinglist
Asunto: Re: [PHP-DB] GET a html page via php


Original message
From: Koutsogiannopoulos Karolos [EMAIL PROTECTED]
Date: Tue, Aug 28, 2001 at 02:15:56PM +0300
Message-ID: [EMAIL PROTECTED]
Subject: [PHP-DB] GET a html page via php

 Hello averyone... i have a question to make and any help is more than
 welcome...

 Is there a way to connect with php to a foreign site and retrieve an
 html page and then to extract a specific value from this page

 Many thanks in advance...

/Original message

Reply

Take a look at the functions as: fopen()
(http://www.php.net/manual/en/function.fopen.php)

Eg: $fp = fopen (http://www.php.net/;, r);

With that function, and what you'll find there you'ld be able to
achieve what you want.

/Reply

--

* RzE:


-- 
-- Renze Munnik
-- DataLink BV
--
-- E: [EMAIL PROTECTED]
-- W: +31 23 5326162
-- F: +31 23 5322144
-- M: +31 6 21811143
--
-- Stationsplein 82
-- 2011 LM  HAARLEM
-- Netherlands
--
-- http://www.datalink.nl
-- 

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


_
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 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] CSV TO MYSQL

2001-08-27 Thread Ryan Marrs

Don't forget you can just as easily replace the ; with any character you may
be separating the email addresses using (for instance a comma)

Ryan

-Original Message-
From: Chris Hobbs [mailto:[EMAIL PROTECTED]] 
Sent: Monday, August 27, 2001 11:16 PM
To: PHP-DB List
Subject: Re: [PHP-DB] CSV TO MYSQL

How about this:

?php
$emailstring = [EMAIL PROTECTED];[EMAIL PROTECTED];[EMAIL PROTECTED];
@emails = explode(;, $emailstring);
foreach($emails as $email) {
 echo INSERT INTO news VALUES('$email');\n;
}
?

Rupert wrote:

 Ok, this is my issue - hope someone can help.  Suppose I also need to get
 this out of  the way too - I am a Newbie (god..I hate that word...but it's
 true.grin!)
 
 Anyway, I have a list of email address that I want to dump into a database
 called (news) - eg.
 [EMAIL PROTECTED]
 [EMAIL PROTECTED]
 [EMAIL PROTECTED]
 [EMAIL PROTECTED]
 etc..
 I separated them with (;'s) like so - [EMAIL PROTECTED]; [EMAIL PROTECTED];
 [EMAIL PROTECTED]; [EMAIL PROTECTED]; etc..
 (I suppose I could use commas instead - no prob there)
 This is what I want to accomplish:
 Each email address is a separate entry that needs to be downloaded into
the
 database.
 Just like this:
 # 
 #
 # Table structure for table 'news'
 #
 CREATE TABLE news (
 email char(255) NOT NULL,
 PRIMARY KEY (email),
 UNIQUE email (email)
 );
 #
 # Dumping data for table 'news'
 #
 INSERT INTO news VALUES ( '[EMAIL PROTECTED]');
 INSERT INTO news VALUES ( '[EMAIL PROTECTED]');
 INSERT INTO news VALUES ( '[EMAIL PROTECTED]');
 INSERT INTO news VALUES ( '[EMAIL PROTECTED]');
 INSERT INTO news VALUES ( 'etc..');
 
 I have a script that gets me to this point:
 INSERT INTO news VALUES (,[EMAIL PROTECTED], [EMAIL PROTECTED],
 [EMAIL PROTECTED],[EMAIL PROTECTED],etc..);
 But that is not what I want.  I can attach the script for analysis or if
 anyone has a better idea.  I would appreciated it very
 much.  Thanks..
 Rupert
 
 
 
 
 


-- 
Chris Hobbs   Silver Valley Unified School District
Head geek:  Technology Services Coordinator
webmaster:   http://www.silvervalley.k12.ca.us/~chobbs/
postmaster:   [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 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] establish mysql server....install

2001-08-23 Thread Ryan Marrs

Check the socket specified in the configuration file, and make sure it
exists, I forget the details exactly, but I had the same problem, and the
directory which it tried to create the socket wasn't in the directory it was
looking for it.  I just created a symbolic link to it, and it works.

Ryan

-Original Message-
From: haikal [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, August 23, 2001 12:56 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] establish mysql serverinstall

Hello...

 I just installing RedHat linux 7.1, i have problem in starting mysql 
server
 the Mysql hadbeen installed throgh RedHatPackageManager...but when i 
start it and error message can't connect throgh port server. 
issued .
 when i use command safe_mysqld  , it runs just a second before stops 
automatically.
 Any body know how to solve my problem?
 i'm still newbie here
 help

 thankyou

-- 
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] Random Password Generation/MSSQL

2001-07-12 Thread Ryan Marrs

Having an issue with this script, the generator works if I just echo out the
password, however when I attempt to update the table, it times-out in IIS.
I've bumped the IIS Timeout up to over 20 minutes, and it still times out.
This is on a database with approximately 29,000 entries.  Any ideas?

Ryan



function rand_pass() {
$array = array(
 a,b,c,d,e,f,g,h,i,j,k,l,
 m,n,o,p,q,r,s,t,u,v,w,x,y,
  z,1,2,3,4,5,6,7,8,9
 );

  $num_letters = 10;
  $uppercased = 3;
  mt_srand ((double)microtime()*100);
  for($i=0; $i$num_letters; $i++)
$pass .= $array[mt_rand(0, (count($array) - 1))];
  for($i=1; $istrlen($pass); $i++) {
if(substr($pass, $i, 1) == substr($pass, $i-1, 1))
  $pass = substr($pass, 0, $i) . substr($pass, $i+1);
  }
  for($i=0; $istrlen($pass); $i++) {
if(mt_rand(0, $uppercased) == 0)
  $pass = substr($pass,0,$i) . strtoupper(substr($pass, $i,1)) .
substr($pass, $i+1);
  }
  $pass = substr($pass, 0, $num_letters);
  return($pass);
  }


MSSQL_CONNECT(XXX,XX,X);
MSSQL_SELECT_DB(X);

$query=SELECT * FROM TABLE;
$return=MSSQL_QUERY($query);
$count=MSSQL_NUM_ROWS($return);
$insertquery=UPDATE TABLE SET FIELD='$password' WHERE
DUNSNumber='$DUNSNumber';
$row=MSSQL_FETCH_OBJECT($return);

for($i=1;$i=$count;$i++){
$DUNSNumber=$row-DUNSNumber;

echo rand_pass().br;
MSSQL_QUERY($insertquery);
}
MSSQL_CLOSE();


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