Using php

Pierre Sahores psahores at easynet.fr
Wed Sep 22 00:52:55 EDT 2004


Le 21 sept. 04, à 21:28, david at anon.nu a écrit :

> Pierre Sahores wrote:
>
>> Yes, it's a server side app directly speaking trought html forms on 
>> the client side and binded to a rock solid SQL databases server on 
>> the back-end. It works as a remplacement solution (and paradigm !) to 
>> the less stuitable Java-based stuffs built to run on top of Tomcat or 
>> JBoss servers.
>
> Got the picture :)
>
>> To have an eye on what it does (whithout writting anything in this 
>> real production state app, please !), you can test it on line in both 
>> "filling datas mode" (login : 0931213N ; password: sais0093) and 
>> "reporting mode" (login : synt0734 ; password: collecte) by visiting 
>> <http://acacia93.dyndns.org/classpac.xml>.
>
>
> Thanks Pierre had a good butchers (look) as they say over here. The 
> basic thing I want to be clear on is what would a function in php look 
> like that i can call from a php scrip to set a variable? Let's take an 
> example. Below is a php script for getting data from a mysql database 
> and setting some variables for use in a smarty template, the key bit 
> is not really the database stuff which is what we would replace by 
> calling Rev to act as middle ware, but the php function that could be 
> written to talk to the socket listening Rev app and get the results 
> back so as to set a variable in php (ie the 
> $smarty->assign("url",$url); bit). I am thinking that we could have 
> one generic php function that takes the name of a Rev based object to 
> call and maybe some params, passes the usual post day suitable 
> packaged, and then returns data (maybe as an array)?

Did you have a look to the PHP sockets listener/translator script I 
provide along the example app you can get below ? It's possibly this 
kind of stuff you are watching for. See the "wmc.xml" file (not xml at 
all but a simple php script witch don't say its name to the 
sad-side-of-the-force hackers...)

>> To get it, just type
>> <http://acacia93.dyndns.org/rev_web_app.zip> from
>> within your prefered Web browser.

Let me know if that helps.

Best, Pierre :-)

>
> <?
> /*     	PHP script, sends mysql result to a Smarty template
> */ 	
> require_once("Smarty.class.php");
> $smarty = new Smarty;
>
> // connect db
> mysql_connect('localhost', 'test', 'test');
> mysql_select_db('test');
>
>
> $query = "select link, descr, DATE_FORMAT(date_added, '%e %M %Y') as 
> date, name from intranet_links";
>
> // search for $s
> if ($s)
> 	$query .= " where (descr like '%$s%' or link like '%$s%')";
>
>
> $result = mysql_query($query);
> while ($data = mysql_fetch_array ($result)) {
> 	$url[] .= $data[link];
> 	$descr[] .= $data[descr];
> 	$name[] .= $data[name];
> 	$date[] .= $data[date];
> }
> $smarty->assign("url",$url);
> $smarty->assign("descr",$descr);
> $smarty->assign("name",$name);
> $smarty->assign("date",$date);
>
>
> $smarty->display("mysql.tpl");
>
>
> // close db
> mysql_close();
> ?>
>
>
> _______________________________________________
> metacard mailing list
> metacard at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/metacard
>
>
-- 
Bien cordialement, Pierre Sahores

100, rue de Paris
F - 77140 Nemours

psahores+ at +easynet.fr

GSM:   +33 6 03 95 77 70
Pro:      +33 1 64 45 05 33
Fax:      +33 1 64 45 05 33

WEB/EAI services & ACID DB over IP
"Mutualiser les deltas de productivité"



More information about the metacard mailing list