[PHP-DB] Re: can OCIBindByName bind an in/out placeholder of plsql
I discovered recently that it was impossible to bind an output placeholder plsql (an input work only). Configuration 1 : Suse + Oracle 8i17 + oci (oracle) + PHP4.2.3 Configuration 2 : HPUX11 + Oracle 8i17 + oci(oracle) + PHP4.2.3 Configuration 3 : HPUX11 + Oracle 8i17 + oci(oracle) + PHP4.2.2 With script : inoutdemo.sql CREATE OR REPLACE PROCEDURE inoutdemo (par_in IN VARCHAR2, par_in_out IN OUT VARCHAR2, par_out OUT VARCHAR2) IS BEGIN par_out:=par_in; par_in_out:=par_in||' '||par_in_out;END; $db=OCILogon(usr_adm,adm_inv); $stmt=OCIParse($db,BEGIN inoutdemo(:in,:inout,:out);END;); OCIBindByName($stmt,:in,$in,32); OCIBindByName($stmt,:inout,$inout,32); OCIBindByName($stmt,:out,$out,32); $in=Hello ; $inout=World!; OCIExecute($stmt); echo $in.\n.$inout.\n.$out.\n; //Result Warning: OCIStmtExecute: ORA-06550: line 1, column 17: PLS-00553: character set name is not recognized ORA-06550: line 0, column 0: PL/SQL: Compilation unit analysis terminated in /opt/apache/htdocs/fab.php4 on line 58 Hello World! I tested this script with the 3 configuration but it's the same error I changed $in, inout , out into $in, $out, $inout but it's the same error Please help me !!! Fabien JOSEPH -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: can OCIBindByName bind an in/out placeholder of plsql
I discovered recently that it was impossible to bind an output placeholder plsql (an input work only). Configuration 1 : Suse + Oracle 8i17 + oci (oracle) + PHP4.2.3 Configuration 2 : HPUX11 + Oracle 8i17 + oci(oracle) + PHP4.2.3 Configuration 3 : HPUX11 + Oracle 8i17 + oci(oracle) + PHP4.2.2 With script : inoutdemo.sql CREATE OR REPLACE PROCEDURE inoutdemo (par_in IN VARCHAR2, par_in_out IN OUT VARCHAR2, par_out OUT VARCHAR2) IS BEGIN par_out:=par_in; par_in_out:=par_in||' '||par_in_out;END; $db=OCILogon(usr_adm,adm_inv); $stmt=OCIParse($db,BEGIN inoutdemo(:in,:inout,:out);END;); OCIBindByName($stmt,:in,$in,32); OCIBindByName($stmt,:inout,$inout,32); OCIBindByName($stmt,:out,$out,32); $in=Hello ; $inout=World!; OCIExecute($stmt); echo $in.\n.$inout.\n.$out.\n; //Result Warning: OCIStmtExecute: ORA-06550: line 1, column 17: PLS-00553: character set name is not recognized ORA-06550: line 0, column 0: PL/SQL: Compilation unit analysis terminated in /opt/apache/htdocs/fab.php4 on line 58 Hello World! I tested this script with the 3 configuration but it's the same error I changed $in, inout , out into $in, $out, $inout but it's the same error Please help me !!! Fabien JOSEPH -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: can OCIBindByName bind an in/out placeholder of plsql
I discovered recently that it was impossible to bind an output placeholder plsql (an input work only). Configuration 1 : Suse + Oracle 8i17 + oci (oracle) + PHP4.2.3 Configuration 2 : HPUX11 + Oracle 8i17 + oci(oracle) + PHP4.2.3 Configuration 3 : HPUX11 + Oracle 8i17 + oci(oracle) + PHP4.2.2 With script : inoutdemo.sql CREATE OR REPLACE PROCEDURE inoutdemo (par_in IN VARCHAR2, par_in_out IN OUT VARCHAR2, par_out OUT VARCHAR2) IS BEGIN par_out:=par_in; par_in_out:=par_in||' '||par_in_out;END; $db=OCILogon(usr_adm,adm_inv); $stmt=OCIParse($db,BEGIN inoutdemo(:in,:inout,:out);END;); OCIBindByName($stmt,:in,$in,32); OCIBindByName($stmt,:inout,$inout,32); OCIBindByName($stmt,:out,$out,32); $in=Hello ; $inout=World!; OCIExecute($stmt); echo $in.\n.$inout.\n.$out.\n; //Result Warning: OCIStmtExecute: ORA-06550: line 1, column 17: PLS-00553: character set name is not recognized ORA-06550: line 0, column 0: PL/SQL: Compilation unit analysis terminated in /opt/apache/htdocs/fab.php4 on line 58 Hello World! I tested this script with the 3 configuration but it's the same error I changed $in, inout , out into $in, $out, $inout but it's the same error Please help me !!! Fabien JOSEPH -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: can OCIBindByName bind an in/out placeholder of plsql
I discovered recently that it was impossible to bind an output placeholder plsql (an input work only). Configuration 1 : Suse + Oracle 8i17 + oci (oracle) + PHP4.2.3 Configuration 2 : HPUX11 + Oracle 8i17 + oci(oracle) + PHP4.2.3 Configuration 3 : HPUX11 + Oracle 8i17 + oci(oracle) + PHP4.2.2 With script : inoutdemo.sql CREATE OR REPLACE PROCEDURE inoutdemo (par_in IN VARCHAR2, par_in_out IN OUT VARCHAR2, par_out OUT VARCHAR2) IS BEGIN par_out:=par_in; par_in_out:=par_in||' '||par_in_out;END; $db=OCILogon(usr_adm,adm_inv); $stmt=OCIParse($db,BEGIN inoutdemo(:in,:inout,:out);END;); OCIBindByName($stmt,:in,$in,32); OCIBindByName($stmt,:inout,$inout,32); OCIBindByName($stmt,:out,$out,32); $in=Hello ; $inout=World!; OCIExecute($stmt); echo $in.\n.$inout.\n.$out.\n; //Result Warning: OCIStmtExecute: ORA-06550: line 1, column 17: PLS-00553: character set name is not recognized ORA-06550: line 0, column 0: PL/SQL: Compilation unit analysis terminated in /opt/apache/htdocs/fab.php4 on line 58 Hello World! I tested this script with the 3 configuration but it's the same error I changed $in, inout , out into $in, $out, $inout but it's the same error Please help me !!! Fabien JOSEPH -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: Newbie-Question: What's that @?
there is no difference between the two! quote: @mysql_query($query) and @mysql_query($query)? haha but seriously, the @ supresses error messages from php, so these will not be outputted. No information on why or how, the query in this case, it failed. you can do this on a per function basis with the @ or for the whole script with error_reporting() function. -- Rolf Vreijdenberger De Pannekoek en De Kale Maystraat 6 2593 VW Den Haag T: 06-24245719 E: [EMAIL PROTECTED] W: www.depannekoekendekale.nl Marcus Fleige [EMAIL PROTECTED] schreef in bericht news:php.db-22830;news.php.net... hi there, i've got a general question about php-scripts: whats the difference between @mysql_query($query) and @mysql_query($query)? is it the same as in batch programming? like, ignore all return messages? thanks and greetings from germany, marcus -- ^v^ [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Add column to a table
Hi, Please could someone tell me what the syntax is to add a column to a table? Thanks -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Add column to a table
For mysql: Alter table tablename add column column-name columntype; Regards, Marcel -Original Message- From: Shaun Thornburgh [mailto:shaun;mania.plus.com] Sent: 31 October 2002 13:39 To: [EMAIL PROTECTED] Subject: [PHP-DB] Add column to a table Hi, Please could someone tell me what the syntax is to add a column to a table? Thanks -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- If you have received this e-mail in error or wish to read our e-mail disclaimer statement and monitoring policy, please refer to http://www.drkw.com/disc/email/ or contact the sender. -- -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Add column to a table
ALTER TABLE TableName ADD COLUMN columnParametersHere E.g: ALTER TABLE UserTable ADD COLUMN userName varchar(255); Aaron -Original Message- From: Shaun Thornburgh [mailto:shaun;mania.plus.com] Sent: Thursday, October 31, 2002 7:39 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] Add column to a table Hi, Please could someone tell me what the syntax is to add a column to a table? Thanks -- 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] need help with SHOW Colums
mysql_select_db(filterseveuk); $query = ( SHOW COLUMNS FROM user ); $result = mysql_query ( $query ) or die( mysql_error () ); while ( $row = mysql_fetch_array ($result) ){ $x = 0 ; echo $row[$x] ; $x++ ; } I would like to replace the table name user with a variable $table, that wil automatically take the value of the selected table. I have tried many times but cannot get the correct sql syntax, it keeps saying you have an error in your sql syntax near 'user' line 1 when i try it with $table. any ideas?? thank's, dave rice ([EMAIL PROTECTED]) _ Choose an Internet access plan right for you -- try MSN! http://resourcecenter.msn.com/access/plans/default.asp -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] cookie trouble
Hi everyone, I'm having some trouble configuring a cookie (first time doing this): I have a login-script and this sets a session cookie. What I really want is to pass a cookie so that returning-people don't have to log in every time, but I'm not sure how to do what part is passing on the cookie (I think $_HTTP_SESSION_VARS=['PHP_SELF'] ) How can I change this to a cookie that stores username and password for a time set by me (infinite). Here is my loginscript: ?php if(isset($_POST['submit'])) { // if form has been submitted /* check they filled in what they were supposed to and authenticate */ if(!$_POST['uname'] | !$_POST['passwd']) { print 'form action=index.php method=post div align=left input class=test name=uname type=text size=8 maxlength=8 input class=test type=password size=8 maxlength=8 name=passwd input name=submit type=submit value=Login br span class=welcomeplease fill in the required fields./span/div /form '; } // authenticate. if(!get_magic_quotes_gpc()) { $_POST['uname'] = addslashes($_POST['uname']); } $check = $db_object-query(SELECT username, password FROM users WHERE username = '.$_POST['uname'].'); if(DB::isError($check)) { print 'form action=index.php method=post div align=left input class=test name=uname type=text size=8 maxlength=8 input class=test type=password size=8 maxlength=8 name=passwd input name=submit type=submit value=Login br span class=welcomeusername doesn\'t exist./span a class=header href=javascript:loadPage(\'mainlayer\',null,\'login/signup.php\')sign up here/a/div /form '; } $info = $check-fetchRow(); // check passwords match $_POST['passwd'] = stripslashes($_POST['passwd']); $info['password'] = stripslashes($info['password']); $_POST['passwd'] = md5($_POST['passwd']); if($_POST['passwd'] != $info['password']) { print 'form action=index.php method=post div align=left input class=test name=uname type=text size=8 maxlength=8 input class=test type=password size=8 maxlength=8 name=passwd input name=submit type=submit value=Login br span class=welcomewrong password, try again/span/div /form '; } // if we get here username and password are correct, register session variables and set // last login time. $date = date('m d, Y'); $update_login = $db_object-query(UPDATE users SET last_login = '$date' WHERE username = '.$_POST['uname'].'); $_POST['uname'] = stripslashes($_POST['uname']); $_SESSION['username'] = $_POST['uname']; $_SESSION['password'] = $_POST['passwd']; $db_object-disconnect(); ? span class=welcomeWelcome a class=header href=javascript:loadPage('mainlayer',null,'users/edit.php?user=?=$_SESSION ['username']??PHP print PHPSESSID=.session_id(); ?')font color=white?=$_SESSION['username']?/font/abra class=header href=login/logout.phpLogout/a /span ?php } else { // if form hasn't been submitted ? form action=?=$HTTP_SESSION_VARS['PHP_SELF']? method=post div align=left input class=test name=uname type=text size=8 maxlength=8 input class=test type=password size=8 maxlength=8 name=passwd input name=submit type=submit value=Login br a class=header href=javascript:loadPage('mainlayer',null,'login/signup.php')sign up here/a /div /form ?php } ? Thanx, Jacco -- http://seabird.jmtech.ca Attitude is Everything! But Remember, Attitudes are Contagious! Is Yours worth Catching -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] need help with SHOW Colums
So show us the code that you tried with. This code doesn't do us any good because it's not causing the error. ---John Holmes... - Original Message - From: David Rice [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, October 31, 2002 11:31 AM Subject: [PHP-DB] need help with SHOW Colums mysql_select_db(filterseveuk); $query = ( SHOW COLUMNS FROM user ); $result = mysql_query ( $query ) or die( mysql_error () ); while ( $row = mysql_fetch_array ($result) ){ $x = 0 ; echo $row[$x] ; $x++ ; } I would like to replace the table name user with a variable $table, that wil automatically take the value of the selected table. I have tried many times but cannot get the correct sql syntax, it keeps saying you have an error in your sql syntax near 'user' line 1 when i try it with $table. any ideas?? thank's, dave rice ([EMAIL PROTECTED]) _ Choose an Internet access plan right for you -- try MSN! http://resourcecenter.msn.com/access/plans/default.asp -- 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] IIS question
offtopic You guys are so smart! Can anyone tell me why IIS gives a 404 error on any file with a .dat extension? Thanks.. /offtopic Ryan -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] IIS question
Mystery solved: http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q309508; IIS Lockdown did it... to fix go to windir\System32\Inetsrv\Urlscan\urlscan.ini and remove the .dat line or other necessary extension. -Original Message- From: Ryan Jameson (USA) Sent: Thursday, October 31, 2002 10:45 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] IIS question offtopic You guys are so smart! Can anyone tell me why IIS gives a 404 error on any file with a .dat extension? Thanks.. /offtopic Ryan -- 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] mail()
I know this is off topic to the db list but.. I am attempting to use the mail function. I have set the smtp in the php.ini file to my smtp server but when I run the script, I get the error Warning: Failed to Connect in c:\program files\apache group\apache\htdocs\lg\nuser2.php on line 50 where line 50 is where the mail function is called. Why is it still pointing to my localhost? I am running it through apache and Win98. Thanks, Eddie -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] mail()
did you restart apache? epeloke@echoma n.com (EdwardTo: [EMAIL PROTECTED] Peloke) cc: Subject: [PHP-DB] mail() 10/31/2002 02:53 PM I know this is off topic to the db list but.. I am attempting to use the mail function. I have set the smtp in the php.ini file to my smtp server but when I run the script, I get the error Warning: Failed to Connect in c:\program files\apache group\apache\htdocs\lg\nuser2.php on line 50 where line 50 is where the mail function is called. Why is it still pointing to my localhost? I am running it through apache and Win98. Thanks, Eddie -- 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] mail()
Did you restart the server? Are you sure you modified the right php.ini? On Thu, 2002-10-31 at 14:53, Edward Peloke wrote: I know this is off topic to the db list but.. I am attempting to use the mail function. I have set the smtp in the php.ini file to my smtp server but when I run the script, I get the error Warning: Failed to Connect in c:\program files\apache group\apache\htdocs\lg\nuser2.php on line 50 where line 50 is where the mail function is called. Why is it still pointing to my localhost? I am running it through apache and Win98. Thanks, Eddie -- 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] OCISaveLob, OCILoadLob, OCISaveFile?
Hello, Who know haw to use those functions:OCISaveLob, OCILoadLob, OCISaveFile? Where can I find documentation and sample about this general purpose: 'lob object manipulation with oracle Thanks. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: MAIL()
If your sending it from your Server/Computer and then to another server/www . YOu probally don't have permissions to send the mail.
RE: [PHP-DB] mail()
yep and I still get the same error...I modified the ini file in my windows directory..I assume that is the right one. Eddie -Original Message- From: Marco Tabini [mailto:marcot;tabini.ca] Sent: Thursday, October 31, 2002 2:24 PM To: Edward Peloke Cc: [EMAIL PROTECTED] Subject: Re: [PHP-DB] mail() Did you restart the server? Are you sure you modified the right php.ini? On Thu, 2002-10-31 at 14:53, Edward Peloke wrote: I know this is off topic to the db list but.. I am attempting to use the mail function. I have set the smtp in the php.ini file to my smtp server but when I run the script, I get the error Warning: Failed to Connect in c:\program files\apache group\apache\htdocs\lg\nuser2.php on line 50 where line 50 is where the mail function is called. Why is it still pointing to my localhost? I am running it through apache and Win98. Thanks, Eddie -- 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] mail()
this may be dumb but I for the smtp setting, I simply put in what every is under smtp when I open up the info in outlook...do I need to put it in quotes or anything? -Original Message- From: [EMAIL PROTECTED] [mailto:Jeffrey_N_Dyke;Keane.com] Sent: Thursday, October 31, 2002 2:31 PM To: Edward Peloke Cc: [EMAIL PROTECTED] Subject: Re: [PHP-DB] mail() did you restart apache? epeloke@echoma n.com (EdwardTo: [EMAIL PROTECTED] Peloke) cc: Subject: [PHP-DB] mail() 10/31/2002 02:53 PM I know this is off topic to the db list but.. I am attempting to use the mail function. I have set the smtp in the php.ini file to my smtp server but when I run the script, I get the error Warning: Failed to Connect in c:\program files\apache group\apache\htdocs\lg\nuser2.php on line 50 where line 50 is where the mail function is called. Why is it still pointing to my localhost? I am running it through apache and Win98. Thanks, Eddie -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: cookie trouble
I got this fixed, but how do I reverse a md5 encryption? this way I can log people in again. Jacco -- http://seabird.jmtech.ca Attitude is Everything! But Remember, Attitudes are Contagious! Is Yours worth Catching Seabird [EMAIL PROTECTED] wrote in message news:20021031165410.94762.qmail;pb1.pair.com... Hi everyone, I'm having some trouble configuring a cookie (first time doing this): I have a login-script and this sets a session cookie. What I really want is to pass a cookie so that returning-people don't have to log in every time, but I'm not sure how to do what part is passing on the cookie (I think $_HTTP_SESSION_VARS=['PHP_SELF'] ) How can I change this to a cookie that stores username and password for a time set by me (infinite). Here is my loginscript: ?php if(isset($_POST['submit'])) { // if form has been submitted /* check they filled in what they were supposed to and authenticate */ if(!$_POST['uname'] | !$_POST['passwd']) { print 'form action=index.php method=post div align=left input class=test name=uname type=text size=8 maxlength=8 input class=test type=password size=8 maxlength=8 name=passwd input name=submit type=submit value=Login br span class=welcomeplease fill in the required fields./span/div /form '; } // authenticate. if(!get_magic_quotes_gpc()) { $_POST['uname'] = addslashes($_POST['uname']); } $check = $db_object-query(SELECT username, password FROM users WHERE username = '.$_POST['uname'].'); if(DB::isError($check)) { print 'form action=index.php method=post div align=left input class=test name=uname type=text size=8 maxlength=8 input class=test type=password size=8 maxlength=8 name=passwd input name=submit type=submit value=Login br span class=welcomeusername doesn\'t exist./span a class=header href=javascript:loadPage(\'mainlayer\',null,\'login/signup.php\')sign up here/a/div /form '; } $info = $check-fetchRow(); // check passwords match $_POST['passwd'] = stripslashes($_POST['passwd']); $info['password'] = stripslashes($info['password']); $_POST['passwd'] = md5($_POST['passwd']); if($_POST['passwd'] != $info['password']) { print 'form action=index.php method=post div align=left input class=test name=uname type=text size=8 maxlength=8 input class=test type=password size=8 maxlength=8 name=passwd input name=submit type=submit value=Login br span class=welcomewrong password, try again/span/div /form '; } // if we get here username and password are correct, register session variables and set // last login time. $date = date('m d, Y'); $update_login = $db_object-query(UPDATE users SET last_login = '$date' WHERE username = '.$_POST['uname'].'); $_POST['uname'] = stripslashes($_POST['uname']); $_SESSION['username'] = $_POST['uname']; $_SESSION['password'] = $_POST['passwd']; $db_object-disconnect(); ? span class=welcomeWelcome a class=header href=javascript:loadPage('mainlayer',null,'users/edit.php?user=?=$_SESSION ['username']??PHP print PHPSESSID=.session_id(); ?')font color=white?=$_SESSION['username']?/font/abra class=header href=login/logout.phpLogout/a /span ?php } else { // if form hasn't been submitted ? form action=?=$HTTP_SESSION_VARS['PHP_SELF']? method=post div align=left input class=test name=uname type=text size=8 maxlength=8 input class=test type=password size=8 maxlength=8 name=passwd input name=submit type=submit value=Login br a class=header href=javascript:loadPage('mainlayer',null,'login/signup.php')sign up here/a /div /form ?php } ? Thanx, Jacco -- http://seabird.jmtech.ca Attitude is Everything! But Remember, Attitudes are Contagious! Is Yours worth Catching -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Re: cookie trouble
You cannot reverse the encryption of an md5 hash. Nor should you want to. You don't want to know their password which is why you encrypt it. When you seyup an account you convert the password to an md5 has(I assume you have done so). When they log back in.. You convert the password to an md5 hash and compare that value against the stored md5 password. If a match - log the user in. If not - kick an error page. Aaron -Original Message- From: Seabird [mailto:jacco;vliegt.nl] Sent: Thursday, October 31, 2002 9:49 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] Re: cookie trouble I got this fixed, but how do I reverse a md5 encryption? this way I can log people in again. Jacco -- http://seabird.jmtech.ca Attitude is Everything! But Remember, Attitudes are Contagious! Is Yours worth Catching Seabird [EMAIL PROTECTED] wrote in message news:20021031165410.94762.qmail;pb1.pair.com... Hi everyone, I'm having some trouble configuring a cookie (first time doing this): I have a login-script and this sets a session cookie. What I really want is to pass a cookie so that returning-people don't have to log in every time, but I'm not sure how to do what part is passing on the cookie (I think $_HTTP_SESSION_VARS=['PHP_SELF'] ) How can I change this to a cookie that stores username and password for a time set by me (infinite). Here is my loginscript: ?php if(isset($_POST['submit'])) { // if form has been submitted /* check they filled in what they were supposed to and authenticate */ if(!$_POST['uname'] | !$_POST['passwd']) { print 'form action=index.php method=post div align=left input class=test name=uname type=text size=8 maxlength=8 input class=test type=password size=8 maxlength=8 name=passwd input name=submit type=submit value=Login br span class=welcomeplease fill in the required fields./span/div /form '; } // authenticate. if(!get_magic_quotes_gpc()) { $_POST['uname'] = addslashes($_POST['uname']); } $check = $db_object-query(SELECT username, password FROM users WHERE username = '.$_POST['uname'].'); if(DB::isError($check)) { print 'form action=index.php method=post div align=left input class=test name=uname type=text size=8 maxlength=8 input class=test type=password size=8 maxlength=8 name=passwd input name=submit type=submit value=Login br span class=welcomeusername doesn\'t exist./span a class=header href=javascript:loadPage(\'mainlayer\',null,\'login/signup.php\')si gn up here/a/div /form '; } $info = $check-fetchRow(); // check passwords match $_POST['passwd'] = stripslashes($_POST['passwd']); $info['password'] = stripslashes($info['password']); $_POST['passwd'] = md5($_POST['passwd']); if($_POST['passwd'] != $info['password']) { print 'form action=index.php method=post div align=left input class=test name=uname type=text size=8 maxlength=8 input class=test type=password size=8 maxlength=8 name=passwd input name=submit type=submit value=Login br span class=welcomewrong password, try again/span/div /form '; } // if we get here username and password are correct, register session variables and set // last login time. $date = date('m d, Y'); $update_login = $db_object-query(UPDATE users SET last_login = '$date' WHERE username = '.$_POST['uname'].'); $_POST['uname'] = stripslashes($_POST['uname']); $_SESSION['username'] = $_POST['uname']; $_SESSION['password'] = $_POST['passwd']; $db_object-disconnect(); ? span class=welcomeWelcome a class=header href=javascript:loadPage('mainlayer',null,'users/edit.php?use r=?=$_SESSION ['username']??PHP print PHPSESSID=.session_id(); ?')font color=white?=$_SESSION['username']?/font/abra class=header href=login/logout.phpLogout/a /span ?php } else { // if form hasn't been submitted ? form action=?=$HTTP_SESSION_VARS['PHP_SELF']? method=post div align=left input class=test name=uname type=text size=8 maxlength=8 input class=test type=password size=8 maxlength=8 name=passwd input name=submit type=submit value=Login br a class=header href=javascript:loadPage('mainlayer',null,'login/signup.php') sign up here/a /div /form ?php } ? Thanx, Jacco -- http://seabird.jmtech.ca Attitude is Everything! But Remember, Attitudes are Contagious! Is Yours worth Catching -- 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: cookie trouble
On October 31, 2002 02:48 pm, Seabird wrote: I got this fixed, but how do I reverse a md5 encryption? this way I can log people in again. Jacco You can't reverse md5. All you need to do is compare an md5'ed copy of what the user entered to what you have in your database (or wherever you store the encrypted copy). If they are the same, then they have entered the right password. -- Mark Nenadov, Freelance Software Developer web: http://www.freelance-developer.com e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Multiple table select, but still returning row if no record exists in second table?
The query should look similar to this: SELECT table1.col as [column_a], table2.col as [column_b] FROM table1 LEFT JOIN (or LEFT OUTER JOIN) table2 ON table2.some_key_col = table1.some_key_col ... for all required keysWHERE search condition -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Multiple table select, but still returning row if no record exists in second table?
The query should look similar to this: SELECT table1.col as [column_a], table2.col as [column_b] FROMtable1 LEFT JOIN (or LEFT OUTER JOIN) table2 ON table2.some_key_col = table1.some_key_col ... for all required keys WHERE search condition -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Restarting Mysql
I'm debugging a script that locks tables as part of an INSERT script (using Linux 7.1). Mysql frequently locks out the tables involved when there is an error (never gets to UNLOCK command. I have been rebooting until now. Using % mysqladmin shutdown works. safe_mysqld doesn't. Any suggestions on getting around the reboot? Thanks. Michael Conway [EMAIL PROTECTED] (703) 968-8875
Re: [PHP-DB] need help with SHOW Colums
$table=user; $query = SHOW COLUMNS FROM $user ; $result = mysql_query ( $query ) or die( mysql_error () ); while ( $row = mysql_fetch_array ($result) ){ $x = 0 ;// i don't know what you're trying to do here, but it's wrong!! It keeps resetting$x to zero and does nothing with the update echo $row[$x] ; $x++ ;// } -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] string
you can do this as a part of your db query check the string functions available for your rdbms. mysql would use something like; SELECT SUBSTRING(monthname(blah), 0, 3) AS monthAbbrev FROM tablename from memory HTH beau // -Original Message- // From: John Coder [mailto:jcoder;insightbb.com] // Sent: Friday, 1 November 2002 9:47 AM // To: [EMAIL PROTECTED] // Subject: [PHP-DB] string // // // I want to list months found in db by the first three letters as in an // abbrevaition of the months i.e.: // Jan // Feb // Mar // Apr // and so forth // I can get the names by monthname(blah) but am stuck on converting // strings to first three letters Ive been trying explode(,$blah) but // that doesn't work. I'm at a loss here I can't find the correct string // function for this. help would be greatly appreciated. // // John Coder // // // // // -- // 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] string
DATE_FORMAT(your_column,'%b') or SUBSTRING() ---John Holmes... -Original Message- From: John Coder [mailto:jcoder;insightbb.com] Sent: Thursday, October 31, 2002 8:47 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] string I want to list months found in db by the first three letters as in an abbrevaition of the months i.e.: Jan Feb Mar Apr and so forth I can get the names by monthname(blah) but am stuck on converting strings to first three letters Ive been trying explode(,$blah) but that doesn't work. I'm at a loss here I can't find the correct string function for this. help would be greatly appreciated. John Coder -- 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] string
Didn't even think of looking for a mysql function to accomplish this. Thanks. On Thu, 2002-10-31 at 20:52, Beau Lebens wrote: you can do this as a part of your db query check the string functions available for your rdbms. mysql would use something like; SELECT SUBSTRING(monthname(blah), 0, 3) AS monthAbbrev FROM tablename from memory HTH beau // -Original Message- // From: John Coder [mailto:jcoder;insightbb.com] // Sent: Friday, 1 November 2002 9:47 AM // To: [EMAIL PROTECTED] // Subject: [PHP-DB] string // // // I want to list months found in db by the first three letters as in an // abbrevaition of the months i.e.: // Jan // Feb // Mar // Apr // and so forth // I can get the names by monthname(blah) but am stuck on converting // strings to first three letters Ive been trying explode(,$blah) but // that doesn't work. I'm at a loss here I can't find the correct string // function for this. help would be greatly appreciated. // // John Coder // // // // // -- // 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] Fw: Dows anyone know why this was bounced?
Does anyone know why all mail that I send to any aspect of the php-db list is bounced when it is sent from the address below? -- bob - Original Message - From: Robert Twitty [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, October 31, 2002 9:39 PM Subject: Returned mail: see transcript for details (fwd) -- Forwarded message -- Date: Thu, 31 Oct 2002 19:45:12 -0500 (EST) From: Mail Delivery Subsystem [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Returned mail: see transcript for details The original message was received at Thu, 31 Oct 2002 19:45:12 -0500 (EST) from neutron.ushmm.org [207.77.113.18] - The following addresses had permanent fatal errors - [EMAIL PROTECTED] (reason: 553 This entry was last confirmed open on 2/16/2002) - Transcript of session follows - ... while talking to pair1.php.net.: RCPT To:[EMAIL PROTECTED] 553 This entry was last confirmed open on 2/16/2002 550 5.1.1 [EMAIL PROTECTED]... User unknown ---BeginMessage--- ---End Message--- -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Am I doing This Right?
?php function war3_replays_submit() { if ( isset($replay_file) ) { $htmlHead = ; pgHead('Shadow Legion :: Warcraft III Replays', $htmlHead); // Get Current DB Entrys $rDB = mysql_query(select * from war3_replays where 1); // Select The Next Entry ID For Newly Uploaded Replay $db_count = sizeof($rDB); $db_nextid = $db_count + 1; // Define Date Dubmitted $rDate = date(m-d-y); // Define HTTP_POST_FILES Variables $rTemp = $HTTP_POST_FILES['replay_file']['tmp_name']; $rName = $HTTP_POST_FILES['replay_file']['name']; $rSize = $HTTP_POST_FILES['replay_file']['size']; // Define Replay Upload DIR and FILE name $rFile = $db_nextid._.$HTTP_POST_FILES['replay_file']['name']; $rLoc = files/war3-replays/$rFile; // DB Query For Inserting File Information into DB // DB Layout [ id | user | date | url | size | type | replaytitle | version | replayname | downloads ] $q1 = INSERT INTO war3_replays VALUES ( $db_nextid, '$replay_submitter', '$rDate', '$rLoc', '$rSize', '$replay_type', '$replay_version', '$replay_mapname', 0 ) ; // Check If The File Was Moved And Renamed Properly if ( !move_uploaded_file($HTTP_POST_FILES['replay_file']['tmp_name'], $rLoc) ) { print 'centerSorry, file not correctly uploaded.'; pgMid(); nav('war3-replays-submit'); pgFoot(); exit(); // If File Was Moved And Renames Properly } else { // Check If The Database Information Was Inserted Properly if ( !mysql_query($q1) ) { print 'Failed to insert the Replay Information into the database.'; pgMid(); nav('war3-replays-submit'); pgFoot(); exit(); // If The DB Was Updated Properly... Make The User Happy !!! } else { print 'Thank you for submitting your replay '.$replay_submitter.'!br The view replay will be up within the next few days.pThanks again!/p'; } } } else { $htmlHead = 'script Language=Javascript type=text/javascript src=/files/upload.js/script'; pgHead('Shadow Legion :: Warcraft 3 Replays',$htmlHead); print 'pbr/p centerUpload Your Replay form enctype=multipart/form-data action=?q=war3-replays-submit method=post table border=1 cellpadding=0 cellspacing=0 width=400 borderColor=#99 tr td valign=topcenterfont size=-1Replay File /font:/center/td td valign=topinput name=replay_file type=file /td /tr tr td valign=topcenterfont size=-1Replay Title /font/center/td td valign=topinput type=text maxlength=50 name=replay_title/td /tr tr td valign=topcenterfont size=-1Category/font: /center/td td valign=topselect name=replay_typeoption value=-Type.../optionoption value=soloSolo/optionoption value=ffaFree For All/optionoption value=teamTeam/optionoption value=umsUse Map Settings/option/select/td /tr tr td valign=topcenterfont size=-1Map Name/font: /center/td td valign=topinput type=text maxlength=50 size=20 name=replay_mapname/td /tr tr td valign=topcenterfont size=-1War3 Versionbr When Replay Recorded:/font/center/td td valign=topselect name=replay_version id=replay_versionoption value=-Version.../optionoption value=1.03 v1.03/optionoption value=1.02v1.02/optionoption value=1.01v1.01 /optionoption value=1.00v1.00/option/select/td /tr tr td valign=topcenterfont size=-1Member/font: /center/td td valign=topinput type=text maxlength=20 name=replay_submitter id=replay_submitter/td /tr tr td valign=top colspan=2centertextarea name=replay_disc cols=40 rows=7/textarea/center/td /tr tr td valign=top colspan=2centerinput type=button onClick=javascript:uploadCheck(); value=Upload nbsp; input type=reset value=Start Over/center/td /tr /table /form /center pbr/p hr width=75% size=1 color=#99 p/p'; pgMid(); nav('war3-replays-submit'); pgFoot(); } } ?
Re: [PHP-DB] Restarting Mysql
On Friday 01 November 2002 09:04, Michael Conway wrote: I'm debugging a script that locks tables as part of an INSERT script (using Linux 7.1). Mysql frequently locks out the tables involved when there is an error (never gets to UNLOCK command. I have been rebooting until now. Using % mysqladmin shutdown works. safe_mysqld doesn't. Any suggestions on getting around the reboot? Write a script that UNLOCKs the table(s) and run it when the error occurs. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Fatal error right in front of screen */ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Am I doing This Right?
On Friday 01 November 2002 15:05, [EMAIL PROTECTED] wrote: ?php function war3_replays_submit() { if ( isset($replay_file) ) { Doing what right? Where/what is the problem? -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* See - the thing is - I'm an absolutist. I mean, kind of ... in a way ... */ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php