[PHP-DB] Re: problem with php oracle on linux

2005-06-16 Thread PHP - NEWS

TEST your connection :

if ($c=OCILogon(user, password, db)) {
  echo Successfully connected to Oracle.\n;
} else {
  $err = OCIError();
  echo Oracle Connect Error  . $err[text];
}

if you have an error try to add other putenv() as :

putenv(ORACLE_BASE=/home/oracle);
putenv(ORACLE_HOME=/home/oracle/OraHome);
putenv(ORACLE_SID=TEST);
putenv(NLS_LANGUAGE=FRENCH_FRANCE.WE8ISO8859P1);
putenv(TNS_ADMIN=/home/oracle/OraHome/network/admin);
putenv(TNS_ADMIN=/home/oracle/OraHome/);
putenv(ORA_NLS33=/home/oracle/OraHome/ocommon/nls/admin/data);
putenv(LD_LIBRARY_PATH=/home/oracle/OraHome/lib:/home/oracle/OraHome/network/l$
putenv(TWO_TASK=TEST-ORCL);

GL

Anom a crit :
i have configured and compiled php 4.11 with oracle client 10g (not instant 
client) on linux and works fine. the client connects well with the oracle 
server which reside on other machine.


but the problem arise when i used php, i've got the following warning :
*Warning*: ocilogon(): _oci_open_server: Error while trying to retrieve text 
for error ORA-12154


what have i missed? i've set the ORACLE_HOME and ORACLE_SID env variable in 
the linux box.


well i hope someone could help me solve the problem.

TiA



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



[PHP-DB] [PHP] ORA-28582: direct connection not allow

2005-06-16 Thread PHP - NEWS
I test my script PHP on Debian(sarge) Oracle9.0.2 , and a mandrake 
Oracle 9.0.2 . On Mandrake all is OK, but on Debian, i have this message :


 ORA-28582: a direct connection to this agent is not allowed

I search on Google, faqoracle, oracle.com, without finding any answers 
or way of solutions.


CODE PHP:
i need to add this on debian, if i want to have any message :

[code]
putenv(ORACLE_BASE=/home/oracle);
putenv(ORACLE_HOME=/home/oracle/OraHome);
putenv(ORACLE_SID=STOR);

[/code]

SCRIPT GLOBAL :

[code]

echo TESTBRBR;

if ($c=OCILogon(storeland, storeland, TEST-ORCL)) {
  echo Successfully connected to Oracle.\n;
} else {
  $err = OCIError();
  echo Oracle Connect Error  . $err[text];
}

$query = select * from articles;

$stmt = ociParse($c, $query);

if (!ociExecute($stmt)){
echo  NOK;
return FALSE;
}else{
echo OKbr;
}

while ($succ = OCIFetchInto($stmt, $row)) {
foreach ($row as $item) {
echo $item. ;
}
echo br\n;
}

[/code]

I create a new topic, as my problem is different.

Thanks a lot for your help.

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



[PHP-DB] registration form with activation code sent to user

2005-06-16 Thread babu
Hi ,

I have seen many forums, where the user can  register and a message will be 
displayed that the user will get an activation code through email, by which he 
can complete his registration.
How this can be done using php.I am eager to know.

Thanks.




-
How much free photo storage do you get? Store your holiday snaps for FREE with 
Yahoo! Photos. Get Yahoo! Photos

RE: [PHP-DB] registration form with activation code sent to user

2005-06-16 Thread Bastien Koert

Since you couldn't google for it...here is the link

http://www.zend.com/zend/tut/tutorial-mehmet1.php

Bastien


From: babu [EMAIL PROTECTED]
To: php-db@lists.php.net
Subject: [PHP-DB] registration form with activation code sent to user
Date: Thu, 16 Jun 2005 14:18:02 +0100 (BST)

Hi ,

I have seen many forums, where the user can  register and a message will be 
displayed that the user will get an activation code through email, by which 
he can complete his registration.

How this can be done using php.I am eager to know.

Thanks.




-
How much free photo storage do you get? Store your holiday snaps for FREE 
with Yahoo! Photos. Get Yahoo! Photos


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



Re: [PHP-DB] registration form with activation code sent to user

2005-06-16 Thread Joseph Crawford
i dont think a capcha is what they are looking for, rather a way to create a 
md5 or something that they can email a link to users to a page such as 
confirm.php?validate=MD5-HERE so that they can validate thier email.

Steps to do this
1.) Create the string maybe an MD5 based on the email they choose or 
something like that
2.) Store that string to the database somewhere
3.) Email the mail to the address specified with the url to the confirm page
3.) The user will check thier email and click the link to your confirm page, 
this will confirm that they did in fact check thier email.
4.) Mark the user as confirmed.

-- 
Joseph Crawford Jr.
Codebowl Solutions
[EMAIL PROTECTED]


Re: [PHP-DB] registration form with activation code sent to user

2005-06-16 Thread babu
Ya joseph u r right, i am thinking of the url to be generated to be send to the 
user.
I followed u r steps but did not understand some points.

2.) Store that string to the database somewhere
where to store in database, i mean when the user clicks the activation 
code how to check the users identity.?
3.) Email the mail to the address specified with the url to the confirm page
  one must send the email manually or is there any automatic generator for 
email sending to users.?
this will confirm that they did in fact check thier email.
 how exactly, can explain little bit.?

thanks
 


-- 
Joseph Crawford Jr.
Codebowl Solutions
[EMAIL PROTECTED]



-
How much free photo storage do you get? Store your holiday snaps for FREE with 
Yahoo! Photos. Get Yahoo! Photos

Re: [PHP-DB] Security and MYSQL databases

2005-06-16 Thread Paul R. Strong

Here's a few payment processors.
Some of them are located in United States and others in United Kingdom.
Haven't tried all of them personally, but many professionals have 
recommended them.

PayPal is still the best way to go because of its low cost.
VeriSign is probably the most secure of all but it's also one of the most 
expensive.


Datacash has a very usefull test service for testing out your transactions.
You can perform test transactions using so-called magic credit card 
munbers supplied by DataCash, which will accept or decline transactions 
without performing any actual financial transactions. This is fantastic for 
development purposes, because you don't want to use your own credit cards 
for testing.


Hope they are of use

Gateway Services:

United States  URLUnited Kingdom 
URL


CyberCash http://www.cybercash.com/  Arcot 
http://www.arcot.com


First Data   http://www.firstdata.com/ WorldPay 
http://www.worldpay.com/


Cardservicehttp://www.cardservice.com/DataCash 
http://www.datacash.com/

International

VeriSign http://www.verisign.com/   ICVerify 
http://www.icverify.com/

Payflow Pro   products/payflow/pro

CyberCash
- Original Message - 
From: I. Gray [EMAIL PROTECTED]

To: php-db@lists.php.net; Bastien Koert [EMAIL PROTECTED]
Sent: Tuesday, June 14, 2005 9:36 AM
Subject: Re: [PHP-DB] Security and MYSQL databases



Thanks,

I kind of suspected this, but it's good to be told.  I wouldn't want to 
like to think my CC details were held on some database somewhere where it 
can get hacked into.  Apart from paypal are there any other 3rd party 
payment processors that anyone recommends?  I think we're perhaps going a 
little off topic here, so sorry.


Bastien Koert wrote:
You should never [almost never ever] store cc details from your users. 
Integrate a 3rd party payment processor into your site and process the 
payments immediately. It will cut down on fraud and chargebacks by the 
users. Its also more secure since the cc details are not stored on your 
machine. What you get back is a payment confirmation number which you can 
store in your systemto reord that payment was approved...and if you don't 
get one, you know immediately its been disallowed so you can stop the 
process at that point.


The issues against it are:
1. its not completely secure. You don't have direct control of the server 
and therefore can't assure yourself that the system is locked down tight 
and kept updated.

2. Your db may not be secure enough
3. Your code may allow for holes that allow hackers to gain access to the 
data.
4. The liability for your business, should your data become compromised. 
Don't say it can't happen. Ask Playboy.com. Hackers access 8million 
accounts and had all the details.


If you can't use a 3rd party processor, then you still shouldn't store 
the data on the server, but send an encrypted email (using pgp) to 
yourself with the account / order  details for processing. But I strongly 
recommend using a 3rd party processor.


Bastien


From: I. Gray [EMAIL PROTECTED]
To: php-db@lists.php.net
Subject: [PHP-DB] Security and MYSQL databases
Date: Tue, 14 Jun 2005 14:36:50 +0100

Hello.

Simple question. An SSL server and a standard a shared MYSQL server that 
I have with my hosts.  If I am to set up a shopping cart system, is this 
a secure way of handling credit card details.  What is the best way of 
receiving the details? I assume an email is not a good way as these can 
be intercepted. Is MYSQL secure enough in this way?


--
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] registration form with activation code sent to user

2005-06-16 Thread Joseph Crawford
#2
Well when the user registers there will have to be a database table for 
members i assume, why not make a column confirmation or something and store 
this string there?

#3
Check into the mail() function, this will allow you to send custom headers 
etc.. You just create the body of the message something like this

$body = 'Thank you for registering with usbr';
$body .= 'You must now confirm your email address by clicking
herehttp://yourdomain.com/[EMAIL PROTECTED]code=sdjfhasf80g7ad9fgfg

the actual url for the clicking here link you need to create maybe something 
like a href=
yourdomain.com/[EMAIL 
PROTECTED]code=sdjfhasf80g7ad9fgfghttp://yourdomain.com/[EMAIL 
PROTECTED]code=sdjfhasf80g7ad9fgfgclicking
here/a

then you use the mail() function to send the mail to the users email 
address...

on the confirm.php page you should grabe the code and email using 
$_GET['code'] and $_GET['email'] then check the database for the users email 
and make sure the code matches the one in the database. If it does mark them 
as confirmed and let them proceed, if not well do nothing.

-- 
Joseph Crawford Jr.
Codebowl Solutions
[EMAIL PROTECTED]


[PHP-DB] xml parsing

2005-06-16 Thread Wendell Frohwein
Hello everyone. I got this script that sends XML data to United Parcel
Service (UPS) to receive rates.
XML data is sent to the server, and a response is sent back also in XML.

The problem is the parser, the data gets fed into it by url only, and I
would like to feed data to it via a variable that is filled by the curl
process of sending / receiving the XML.

Here is the parser and how I retrieve the data from it:



function startElement($parser, $name, $attrs=''){
  global $ary_path;
  array_push($ary_path, $name);
}

function endElement($parser, $name, $attrs=''){
  global $ary_path;
  array_pop($ary_path);
}

function characterData($parser, $data){
  global $ary_parsed_file, $ary_path, $int_starting_level;
  $str_trimmed_data = trim($data);
  if (!empty($str_trimmed_data)) {
$str_array_define = '$ary_parsed_file';
  for ($i = $int_starting_level; $i  count($ary_path); $i++) {
$str_array_define .= '[\'' . $ary_path[$i] . '\']';
  }
  $str_array_define .=  = ' . $str_trimmed_data . ';;
  eval($str_array_define);
   
  // DEBUG
  //echo \n . $str_array_define;
   
  } // if
}


$ary_path = array();
$ary_parsed_file = array();
$int_starting_level = 1;

$xml_file =
'http://www.domain.com/rates.php?zip='.$_SESSION[shipto_zip].'session
='.session_id().shiptype=.$_SESSION[shiptype];

$type = 'UTF-8';

$xml_parser = xml_parser_create($type);
xml_parser_set_option($xml_parser, XML_OPTION_CASE_FOLDING, true);
xml_parser_set_option($xml_parser, XML_OPTION_TARGET_ENCODING, 'UTF-8');
xml_set_element_handler($xml_parser, 'startElement','endElement');
xml_set_character_data_handler($xml_parser, 'characterData');

if (!($fp = fopen($xml_file, 'r'))) {
   die(Could not open $xml_file for parsing!\n);
}



while ($data = fread($fp, 1024000)) {
   if (!($data = utf8_encode($data))) {
   echo 'ERROR'.\n;
   }
   if (!xml_parse($xml_parser, $data, feof($fp))) {
   die(sprintf( XML error: %s at line %d\n\n,
   xml_error_string(xml_get_error_code($xml_parser)),
   xml_get_current_line_number($xml_parser)));
   }
}
xml_parser_free($xml_parser);

//print_r($ary_parsed_file);


#/ This loads up retrieves values into sessions for use in the
shopping cart.
$_SESSION[shipping_price]=$ary_parsed_file['RATEDSHIPMENT']['TOTALCHAR
GES']['MONETARYVALUE'];
$_SESSION[shipping_weight]=$ary_parsed_file['RATEDSHIPMENT']['BILLINGW
EIGHT']['WEIGHT'];




The file this script is connecting to (rates.php) is the actual script
and curl process that sends / receives the XML data to and from ups's
servers. The above code is just the parser.



Thank you in advance for any help.

-Wendell Frohwein

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



[PHP-DB] General UPDATE question

2005-06-16 Thread Ron Piggott
Does the UPDATE command only change one row or each occurance if the the
criteria repeat itself through the table?

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