php-general Digest 17 Jul 2012 03:22:48 -0000 Issue 7891

Topics (messages 318486 through 318492):

Simplepie characters not showing
        318486 by: muad shibani
        318487 by: Daniel Brown

Creating drop-down menus
        318488 by: Ramiro Barrantes
        318489 by: Jen Rasmussen
        318490 by: Tim Streater
        318491 by: Daevid Vincent

SOAP and Php question about authentication
        318492 by: James Newman

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-gene...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
Hi all

I used SimplePie to collect news feed from 100 Arabic websistes everything
is fine
but when I transfer the website into a new server some feed titles and
descriptons show only numbers or special   characters  if there are some of
them inside the title.

the new server is 5.2.17 while the old is 5.2.2
simplepie version is 1.3 the latest one

I set the PHP header to uft-8

where is the problem?

--- End Message ---
--- Begin Message ---
On Mon, Jul 16, 2012 at 9:18 AM, muad shibani <muad.shib...@gmail.com> wrote:
> Hi all
>
> I used SimplePie to collect news feed from 100 Arabic websistes everything
> is fine
> but when I transfer the website into a new server some feed titles and
> descriptons show only numbers or special   characters  if there are some of
> them inside the title.
>
> the new server is 5.2.17 while the old is 5.2.2
> simplepie version is 1.3 the latest one
>
> I set the PHP header to uft-8
>
> where is the problem?

    This is something you'll need to discuss with the SimplePie folks,
as it's not necessarily a general PHP issue.

-- 
</Daniel P. Brown>
Network Infrastructure Manager
http://www.php.net/

--- End Message ---
--- Begin Message ---
Hello,

I am making an application using PHP/Javascript/mysql and had a question.

Sometimes I need to use javascript to fill a drop down box based on the value 
of a previous drop down box.  However, the information to fill the latter is 
stored in mysql and can be a lot, what I have been doing is that, using PHP, I 
create hidden fields with all the possible information that might be needed to 
fill the second drop down.

For example, the user chooses a bank from a drop down, and then a list of 
clients is displayed on the following drop down.  I use PHP to read all clients 
from all the banks and put that as hidden fields on the html page.  It is very 
cumbersome.

I do not want to read the database (which changes dynamically) from javascript 
directly due to confidentiality and because a lot of care has been taken to 
create the appropriate  queries with checks and protect misuse of the 
information using PHP.

My questions are:
1) Do people just normally use hidden fields to store possible information to 
fill the drop downs?
2) any suggestions?

Thanks in advance,
Ramiro


--- End Message ---
--- Begin Message ---
-----Original Message-----
From: Ramiro Barrantes [mailto:ram...@precisionbioassay.com] 
Sent: Monday, July 16, 2012 3:17 PM
To: php-gene...@lists.php.net
Subject: [PHP] Creating drop-down menus

Hello,

I am making an application using PHP/Javascript/mysql and had a question.

Sometimes I need to use javascript to fill a drop down box based on the
value of a previous drop down box.  However, the information to fill the
latter is stored in mysql and can be a lot, what I have been doing is that,
using PHP, I create hidden fields with all the possible information that
might be needed to fill the second drop down.

For example, the user chooses a bank from a drop down, and then a list of
clients is displayed on the following drop down.  I use PHP to read all
clients from all the banks and put that as hidden fields on the html page.
It is very cumbersome.

I do not want to read the database (which changes dynamically) from
javascript directly due to confidentiality and because a lot of care has
been taken to create the appropriate  queries with checks and protect misuse
of the information using PHP.

My questions are:
1) Do people just normally use hidden fields to store possible information
to fill the drop downs?
2) any suggestions?

Thanks in advance,
Ramiro

**

You could also store the information as a session variable.

Jen




--- End Message ---
--- Begin Message ---
On 16 Jul 2012 at 21:19, Jen Rasmussen <j...@cetaceasound.com> wrote: 

> Sometimes I need to use javascript to fill a drop down box based on the
> value of a previous drop down box.  However, the information to fill the
> latter is stored in mysql and can be a lot, what I have been doing is that,
> using PHP, I create hidden fields with all the possible information that
> might be needed to fill the second drop down.
>
> For example, the user chooses a bank from a drop down, and then a list of
> clients is displayed on the following drop down.  I use PHP to read all
> clients from all the banks and put that as hidden fields on the html page.
> It is very cumbersome.

Well it would be. This approach doesn't scale.

> I do not want to read the database (which changes dynamically) from
> javascript directly due to confidentiality and because a lot of care has
> been taken to create the appropriate  queries with checks and protect misuse
> of the information using PHP.

I doubt if you can read it from JavaScript.

> My questions are:
> 1) Do people just normally use hidden fields to store possible information
> to fill the drop downs?
> 2) any suggestions?

You could use ajax to request the information needed to load the second drop 
down. Once the user chooses their bank, then your JavaScript makes an ajax 
request to a PHP script that returns the clients list. You use this to populate 
the second drop down.

--
Cheers  --  Tim

--- End Message ---
--- Begin Message ---
AJAX.

Your page calls a PHP 'ajax' routine that pulls the data, sends it back as a
JS array, and you re-populate the second select box. Welcome to the year
2000. Using frameworks like jQuery, this is pretty trivial these days.
You're not trading any security since the PHP gets whatever parameters and
checks whatever $_SESSION or other authentication and only sends back
whatever data is needed. You can add some caching (memcached or whatever
else) to make subsequent calls lightning fast.

> -----Original Message-----
> From: Ramiro Barrantes [mailto:ram...@precisionbioassay.com]
> Sent: Monday, July 16, 2012 1:17 PM
> To: php-gene...@lists.php.net
> Subject: [PHP] Creating drop-down menus
> 
> Hello,
> 
> I am making an application using PHP/Javascript/mysql and had a question.
> 
> Sometimes I need to use javascript to fill a drop down box based on the
> value of a previous drop down box.  However, the information to fill the
> latter is stored in mysql and can be a lot, what I have been doing is
that,
> using PHP, I create hidden fields with all the possible information that
> might be needed to fill the second drop down.
> 
> For example, the user chooses a bank from a drop down, and then a list of
> clients is displayed on the following drop down.  I use PHP to read all
> clients from all the banks and put that as hidden fields on the html page.
> It is very cumbersome.
> 
> I do not want to read the database (which changes dynamically) from
> javascript directly due to confidentiality and because a lot of care has
> been taken to create the appropriate  queries with checks and protect
misuse
> of the information using PHP.
> 
> My questions are:
> 1) Do people just normally use hidden fields to store possible information
> to fill the drop downs?
> 2) any suggestions?
> 
> Thanks in advance,
> Ramiro



--- End Message ---
--- Begin Message ---
I'm having a few authentication issues and I'm not sure if it's my code or
the web service I'm connecting to.  The code below shows what I'm working
with not sire if I'm going about it the right way.

This is the error I get!

Fatal error: Uncaught SoapFault exception: [soap:Client]
System.Web.Services.Protocols.SoapException: Authentication error. Username
and/or Password are incorrect at
F2CPaymentWS.Shared.Exceptions.ExceptionManager.RaiseSoapException(String
ErrorMessage, Int32 ErrorNumber, ExceptionType Type, FaultCode WhosFault,
String Method) at F2CPaymentWS.PaymentWS.ProcessPayment(String Username,
String Password, Int32 TxType, Int32 AccountId, Decimal Amount, String
Reference, String Particular, String Email, String CardNumber, String
CardType, String CardExpiry, String CardHolderName, String CardCSC, Boolean
StoreCard) at F2CPaymentWS.PaymentWS.ProcessPurchase(String Username,
String Password, Int32 AccountId, Decimal Amount, String Reference, String
Particular, String Email, String CardNumber, String CardType, String
CardExpiry, String CardHolderName, String CardCSC, Boolean StoreCard) in
C:\Development\website\includes\class\Flo2cash_API.php:50 Stack trace: #0
C:\Development\allaboutauckland.com\includes\class in
C:\Development\website\includes\class\Flo2cash_API.php on line *50*
*
*
Can someone point me in the right direction?

$data = array(
'Username' =>'********',
 'Password' =>'********',
'AccountId' =>'********',
 'Amount' =>'10.00',
'Reference' =>'00010',
 'Particular'=>'Test Payment',
'Email' =>'james.new...@gmail.com',
 'CardNumber'=>'5123456789012346',
'CardType' =>'MC',
 'CardExpiry'=>'0513',
'CardHolderName'=>'JamesNewman',
 'CardCSC' =>'111',
'StoreCard' =>'true'
 );
 $vars = array(
 'login'=> '********',
'password' => '********',
 'trace' => 1,
'exceptions' => true,
        'cache_wsdl' => WSDL_CACHE_NONE,
        'features' => SOAP_SINGLE_ELEMENT_ARRAYS);
 $client = new SoapClient("http://demo.flo2cash.co.nz/ws/paymentws.asmx?WSDL";,
$vars);
 $text = array('Username' =>'********',
  'Password' =>'********',
  'AccountId' =>'********',
  'Amount' =>'10.00',
  'StoreCard' =>'false');

$out = $client->ProcessPurchase($data);
 var_dump($client->__getFunctions());
var_dump($client->__getLastRequestHeaders());
 var_dump($client->__getTypes());
print_r($client);
  exit;

--- End Message ---

Reply via email to