Re: [PHP-DB] forms and method POST - variables
Because I got some old scripts where I don´t have this setting.they worked on MS Win2000 - PWS and PHP 4.0 but now - with Apache 2.2.6, PHP 5.2 on WIN XP it doesn´t work. You might be using the old format of $HTTP_POST_VARS. Do a search for that string and change it to $_POST and the same for $HTTP_GET_VARS (change to $_GET). It could also be a side-effect of register_globals being enabled in php4.0 and not in php5.2. http://www.php.net/manual/en/security.globals.php -- Postgresql & php tutorials http://www.designmagick.com/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Webservices with PHP
SOAP stands for Simple Object Access Protocol and is, as its name implies, a protocol for accessing objects or in other words, a standard that defines how a possibly remote object can be communicated with. XML-RPC, with RPC standing for Remote Procedure Call, is a protocol to call remote procedures using XML. REST stands for REpresentational State Transfer and is an HTTP alternative to Web Service standards, based on the idea that the extra layer of these standards is obsolete because the HTTP protocol is able to handle similar purposes. Wikipedia.org has loads of info. You say you want to implement a Service Oriented Architecture. The reasons you have to do this define what type of standard(s) you should use, if any at all. Remember that if you only need to access your services through browser based clients (e.g. a website) that there is very little use in implementing any of the above mentioned standards and protocols. If you need your services to be accessible by a variety of clients you do need to explore web service standards (and stop reading on). A little more specific in the direction of services in PHP accessed by browser based clients (assuming you need that), without using web service standards. In general most web developers need a lightweight protocol to access services, methods and functions through JavaScript. For this I use the JavaScript Object Notation (JSON, check json.org). As a very simple example a service that appends an exclamation mark to all parameters you send and alerts them on success. I assume you use JavaScript, the json.org JavaScript library and created an XmlHttpRequest instance by the name of xhr (check w3schools.com if you need help initializing one or use a third party library such as Prototype): CLIENT SIDE: //index.html function callBack() { var response = JSON.parse(xhr.responseText); for (x in response) alert(x + ' = ' + response[x]); } var params = {i: 'need', to: 'use', services:'now'}; var parsed = JSON.stringify(params); xhr.onreadystatechange = function() { if (xhr.readyState == 4) callBack(); }; xhr.open ("GET", "service.php?params=" + params, true); xhr.send (null); SERVER SIDE: //service.php echo json_encode(MyService::do_call(json_decode($_REQUEST['params']))); ?> //myservice.php $value) $params [$key] .= '!'; return $params; } } ?> $P$ $T$ wrote: Hi, Sorry this may not be related to php-db list. I do not have much knowledge about webservices but would like to know, which is better way of implementing webservices with PHP-MySQL XML-RPC, SOAP, or REST And why? What are the parameters that we should be looking for before deciding on mechanism? Thanks, Pravin -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] forms and method POST - variables
On Jan 9, 2008 11:25 AM, Lukáš Moravec <[EMAIL PROTECTED]> wrote: > Hi, > > I have one question about forms and php (which I use for Mysql too). > > Do I need for variables from any form in html and method POST (then in php > script) to set these variables with: > > $variable=$_POST['variable']; [snip!] That's a question that should be asked on the PHP-General list, actually. I'm forwarding the response to that list with this message. Are you receiving any errors? Are any messages displayed when you have the following at the beginning of the script? $_GET and $_POST are predefined superglobal variables, which have been available in PHP since dinosaurs roamed the Earth. -- Daniel P. Brown Senior Unix Geek and #1 Rated "Year's Coolest Guy" By Self Since 1979.
RE: [PHP-DB] forms and method POST - variables
Well, it depends if you use an old version of PHP, in the latest version both arrays $_POST and $_GET are used to get passed variables!! I can't remember since what version PHP started to use these arrays!! MG -Original Message- From: Lukáš Moravec [mailto:[EMAIL PROTECTED] Sent: Miércoles, 09 de Enero de 2008 10:26 a.m. To: php-db@lists.php.net Subject: [PHP-DB] forms and method POST - variables Hi, I have one question about forms and php (which I use for Mysql too). Do I need for variables from any form in html and method POST (then in php script) to set these variables with: $variable=$_POST['variable']; For example: FORM Input something And then.in do_something.php DO SOMETHING Variable: ".$variable; ?> Because I got some old scripts where I don´t have this setting.they worked on MS Win2000 - PWS and PHP 4.0 but now - with Apache 2.2.6, PHP 5.2 on WIN XP it doesn´t work. Thank you for any advice. Lukas -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] forms and method POST - variables
Hi, I have one question about forms and php (which I use for Mysql too). Do I need for variables from any form in html and method POST (then in php script) to set these variables with: $variable=$_POST['variable']; For example: FORM Input something And then.in do_something.php DO SOMETHING Variable: ".$variable; ?> Because I got some old scripts where I don´t have this setting.they worked on MS Win2000 - PWS and PHP 4.0 but now - with Apache 2.2.6, PHP 5.2 on WIN XP it doesn´t work. Thank you for any advice. Lukas
Re: [PHP-DB] Webservices with PHP
so far i know, if u want to use web service with php and mysql, i suggest u use soap, because native php support this kind of webservice (php-soap), u can use function based service for this kind of webservice and also because of soap is XML-RPC with a lot of feature.(http://en.wikipedia.org/wiki/Web_service) . but if u use some framework wich support permalink, u can use REST like in Ruby On Rails. for SOAP, u can use some webservice helper like nuSOAP(deprecated with php5) or php2wsdl or php wshelper => www.jool.nl ( i use this to create wsdl based on class from database table). $P$ $T$ wrote: > Hi, > Sorry this may not be related to php-db list. I do not have much > knowledge about webservices but would like to know, which is better > way of implementing webservices with PHP-MySQL > > XML-RPC, SOAP, or REST > And why? What are the parameters that we should be looking for before > deciding on mechanism? > > Thanks, > Pravin > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Webservices with PHP
Hi, Sorry this may not be related to php-db list. I do not have much knowledge about webservices but would like to know, which is better way of implementing webservices with PHP-MySQL XML-RPC, SOAP, or REST And why? What are the parameters that we should be looking for before deciding on mechanism? Thanks, Pravin -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php