473,769 Members | 3,329 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to pass an xml string as a get parameter

I want to send an xml string as a get parameter,
where the xml is created from a runtime
database query. I try to avoid dynamic framesets,
but sometimes they're needed:

$xml = mysql_stuff($x, $y,$z);
echo "<frameset...>" ;
echo "<frame src=".$PHP_SELF ."?xml=".$xml." >";
snip....

That didn't work, so I tried urlencoding various pieces:
$xmlstr = urlencode($xml) ;
echo "<frameset .....>";
echo "<frame src=".$PHP_SELF ."%3Fxml=".$xml str.">"

.....then, at the other end of the recursive pipe:
$encodedXML = $_GET['xml'];
$xml = urldecode($enco dedXML);

But that causes trouble too.
I suppose I could serialize the xml and save it
as a session variable. There must be a way to pass
XML as a parameter, from one php process to another.
Jul 17 '05 #1
5 7712
"Salmo Bytes" <de*****@montan a-riverboats.com> wrote in message
news:a8******** *************** ***@posting.goo gle.com...
I want to send an xml string as a get parameter,
where the xml is created from a runtime
database query. I try to avoid dynamic framesets,
but sometimes they're needed:

$xml = mysql_stuff($x, $y,$z);
echo "<frameset...>" ;
echo "<frame src=".$PHP_SELF ."?xml=".$xml." >";
snip....

That didn't work, so I tried urlencoding various pieces:
$xmlstr = urlencode($xml) ;
echo "<frameset .....>";
echo "<frame src=".$PHP_SELF ."%3Fxml=".$xml str.">"

....then, at the other end of the recursive pipe:
$encodedXML = $_GET['xml'];
$xml = urldecode($enco dedXML);

But that causes trouble too.
I suppose I could serialize the xml and save it
as a session variable. There must be a way to pass
XML as a parameter, from one php process to another.


Why would you need to serialize the xml? It's already a string.

In this case the obvious answer is to pass $x, $y, and $z on the URL and
then retrieve the XML data from the database.
Jul 17 '05 #2
"Chung Leong" <ch***********@ hotmail.com> wrote in message news:<-4************** ******@comcast. com>...
"Salmo Bytes" <de*****@montan a-riverboats.com> wrote in message
news:a8******** *************** ***@posting.goo gle.com...
I want to send an xml string as a get parameter,
where the xml is created from a runtime
database query. I try to avoid dynamic framesets,
but sometimes they're needed:

$xml = mysql_stuff($x, $y,$z);
echo "<frameset...>" ;
echo "<frame src=".$PHP_SELF ."?xml=".$xml." >";
snip....

That didn't work, so I tried urlencoding various pieces:
$xmlstr = urlencode($xml) ;
echo "<frameset .....>";
echo "<frame src=".$PHP_SELF ."%3Fxml=".$xml str.">"

....then, at the other end of the recursive pipe:
$encodedXML = $_GET['xml'];
$xml = urldecode($enco dedXML);

But that causes trouble too.
I suppose I could serialize the xml and save it
as a session variable. There must be a way to pass
XML as a parameter, from one php process to another.
Why would you need to serialize the xml? It's already a string.


That was a guess: $xml = $_GET['xml'] doesn't retrieve the string
in useable format.
In this case the obvious answer is to pass $x, $y, and $z on the URL and
then retrieve the XML data from the database.


....because I want to have a page generation module that isn't
tied to mysql, so I can gather xml from any source and then transform
that into html on the fly.

I think I've figured out how to use Smarty Template to do what I want.
Jul 17 '05 #3
"Salmo Bytes" <de*****@montan a-riverboats.com> wrote in message
news:a8******** *************** ***@posting.goo gle.com...
...because I want to have a page generation module that isn't
tied to mysql, so I can gather xml from any source and then transform
that into html on the fly.


There are far better ways of keeping database code from mingling with
interface code. The simplest would be to write a function.

Passing page content on the URL is always wrong, because you're letting the
world+dog modify your site. I could fashion a URL with an XML containing,
say, a something about killing the US president, then dump the URL into
Google. Now anyone who chance upon that page will think that you want to
kill the pres.
Jul 17 '05 #4

Chung Leong wrote:
Passing page content on the URL is always wrong, because you're letting the world+dog modify your site.


Fine, but I'm not passing page content...only a few parameters,
collected however I want, and then passed around in xml format--it's a
convenient way to pass small but variable length lists of layout
parameters, server-side handles to images, text files etc. I can
specify
what eventually becomes a hundred lines of html in a dozen lines of xml
(I'm not talking about xslt)...I have my own ways of doing that.

The inherently predictable nature of XML makes it possible to
dynamically generate automatically operational data entry and data
query
GUI screens. That's the real reason to use XML as a parameter transport

mechanism. GUI screens that operate over relational data inevitably
require
manual, hand coded programming time. XML data can be manipulated by
entirely machine generated interfaces.

Take a look at http://neurosys.cns.montana.edu....to see a more
elaborate argument for using xml as a data transport mechanism.

Jul 17 '05 #5
I think what you want to do is use cURL - this enables you to pass
get and post statements via Curl, then you can parse the resonse from
the xml server, and use the variables in an object.

Phil

"castnblast " <de*****@montan a-riverboats.com> wrote in message news:<10******* **************@ c13g2000cwb.goo glegroups.com>. ..
Chung Leong wrote:
Passing page content on the URL is always wrong, because you're

letting the
world+dog modify your site.


Fine, but I'm not passing page content...only a few parameters,
collected however I want, and then passed around in xml format--it's a
convenient way to pass small but variable length lists of layout
parameters, server-side handles to images, text files etc. I can
specify
what eventually becomes a hundred lines of html in a dozen lines of xml
(I'm not talking about xslt)...I have my own ways of doing that.

The inherently predictable nature of XML makes it possible to
dynamically generate automatically operational data entry and data
query
GUI screens. That's the real reason to use XML as a parameter transport

mechanism. GUI screens that operate over relational data inevitably
require
manual, hand coded programming time. XML data can be manipulated by
entirely machine generated interfaces.

Take a look at http://neurosys.cns.montana.edu....to see a more
elaborate argument for using xml as a data transport mechanism.

Jul 17 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
14043
by: Belinda | last post by:
Hello All I have the following test.asp page which needs one parameter querystr but my querystr is a very long string value. When I send a long value the query string is getting truncated after some characters. Can you please kindly share the code segment to workaround how to pass such a long string value to a asp page. This is how I invoke the test page:
7
21634
by: Zlatko Matić | last post by:
Let's assume that we have a database on some SQL server (let it be MS SQL Server) and that we want to execute some parameterized query as a pass.through query. How can we pass parameters to the server ? Is it possible to use parameters in pass-through queries ? An additional question: Is it possible to connect to a database on MySQL or PostgreSQL using ADO ? Is it possible to execute pass-through queries with parameters, using ADO...
0
3322
by: Zlatko Matić | last post by:
Hi everybody! Recently I was struggling with client/server issues in MS Access/PostgreSQL combination. Although Access is intuitive and easy to use desktop database solution, many problems appear when someone is trying to use it as front-end for real server database systems such as PostgreSQL or MySQL. One of these problems is regarding pass-through queries and parameters. I wanted to have all the code on client, while executing it on...
1
23658
by: Dion Heskett | last post by:
How can I pass a Class as a parameter to in a method ? i.e. Private myMethod( string pram1, Classobject as pram2) { Classobject.DataSource = reader; Classobject.DataBind(); }
5
3749
by: Fresh Air Rider | last post by:
Hello Could anyone please explain how I can pass more than one arguement/parameter value to a function using <asp:linkbutton> or is this a major shortfall of the language ? Consider the following code fragments in which I want to list through all files on a directory with a link to download each file by passing a filename and whether or not to force the download dialog box to appear.
21
3314
by: vmsgman | last post by:
Here is a code sample ... int blah = ReadFile( defArray, defFileName, w, h); // Read File Contents into memory array and return for processing public int ReadFile( ref ushort nArray, string sFname, int w, int h) { FileStream fs = new FileStream(sFname, FileMode.Open, FileAccess.Read); BinaryReader br = new BinaryReader(fs); // Read data
3
5491
by: Brett | last post by:
I have several classes that create arrays of data and have certain properties. Call them A thru D classes, which means there are four. I can call certain methods in each class and get back an array of data. All four classes are the same except for the number of elements in their arrays and the data. I have a MainClass (the form), which processes all of these arrays. The MainClass makes use of third party objects to do this. There...
5
7822
by: David++ | last post by:
Hi folks, I would be interested to hear peoples views on whether or not 'pass by reference' is allowed when using a Web Service method. The thing that troubles me about pass-by-reference into a WebService is that essentially we are passing an address of an object which resides on the 'local machine' i.e. a local machine object address. Surely when the WebService method is called and run 'on the server', the reference type will be...
3
7186
by: Bob Speaking | last post by:
Hi at all, Is possible to pass a parameter though a delegate or to override it? (I'm newbie and I'm trying to understand delegates and their use in a real scenario) In my scenario I need to override System.Text.RegularExpression.MatchEvaluator delegate passing it another parameter. For a concrete sample I paste some lines of code : //my regexpression pattern;
12
11110
by: raylopez99 | last post by:
Keywords: scope resolution, passing classes between parent and child forms, parameter constructor method, normal constructor, default constructor, forward reference, sharing classes between forms. Here is a newbie mistake that I found myself doing (as a newbie), and that even a master programmer, the guru of this forum, Jon Skeet, missed! (He knows this I'm sure, but just didn't think this was my problem; LOL, I am needling him) If...
0
9587
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10045
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9993
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8870
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7406
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5298
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3958
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3561
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.