Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently October 11th, 2024, 2:32 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: PHP script
PostPosted: April 17th, 2006, 9:30 am 
Offline

Joined: April 1st, 2005, 6:59 pm
Posts: 98
Location: Maastricht, The Netherlands
Opus: V7
OS: Mac OS X 10.7.2 | Windows 8 Dev
System: i5 2.7 | 8G Ram | 1 T HD
Hello,

I'm trying to get data from our server with a variable from Opus. It checks the field "memo" on our server with the variable "user" set in opus.

I use this PHP-script :

Code:
<?php

$user = $HTTP_POST_VARS['user'];

$DBhost = "localhost";
$DBuser = "lxxxx";
$DBpass = "xxxxx";
$DBName = "lxxxx";

$connect = mysql_connect($DBhost,$DBuser,$DBpass);
$db = mysql_select_db($DBName,$connect);
$query = "SELECT * FROM klanten WHERE memo='$user'"; 
$result = mysql_query($query, $connect);

$row = mysql_fetch_array($result );
$data = "&first=".$row['first']."&last=".$row['last']."&address=".$row['address']."&position=".$row['position']."&aanhef=".$row['aanhef']."&memo=".$row['memo'];
echo $data
?>


I set the source to string "memo" and variable to "user", in the destination I set the fields "first" and "last" but no data is returned.

If there is somebody that can help it woul'd be great...

Thanks

Ronnie


Top
 Profile Visit website  
 
 Post subject:
PostPosted: April 17th, 2006, 12:03 pm 
Offline

Joined: October 26th, 2004, 10:23 am
Posts: 666
Location: Digital Workshop
If you are using the Variable option on the Post Web Data, the data is passed as a POST variable called 'data'. Your script needs to look for
Code:
$user = $HTTP_POST_VARS['data'];


From the help:
When you send this information to a Server, the contents of the variable are sent to the server with the string name data. Therefore, the cgi-script that processes the data should be looking for the name data – see Using Name-Value Pairs in the Post Web Data action for more information.

_________________
ddww Opus Developer


Top
 Profile Visit website  
 
 Post subject:
PostPosted: April 17th, 2006, 12:29 pm 
Offline

Joined: April 1st, 2005, 6:59 pm
Posts: 98
Location: Maastricht, The Netherlands
Opus: V7
OS: Mac OS X 10.7.2 | Windows 8 Dev
System: i5 2.7 | 8G Ram | 1 T HD
Thanks Ducan,

:P That did the job work.

cheers

Ronnie


Top
 Profile Visit website  
 
 Post subject: Sorry
PostPosted: April 17th, 2006, 7:21 pm 
Offline

Joined: April 1st, 2005, 6:59 pm
Posts: 98
Location: Maastricht, The Netherlands
Opus: V7
OS: Mac OS X 10.7.2 | Windows 8 Dev
System: i5 2.7 | 8G Ram | 1 T HD
:oops: It has to be Duncan.....

cheers

Ronnie


Top
 Profile Visit website  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 13 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group