473,769 Members | 6,120 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

outtputting dynamic link in xml tag using php

hi,
i am trying to create an xml tag ref to hold link.php?id=1; or
link.php?id=2 and so on.
I want the links for all the fields(id) in the databse so that when i
call them in my html page for google maps i have the whole link.The
tag in the php page i am using is

echo 'ref="link.php? id='.$row['id'] . '"';
the tag in html is
<a href="+ref+">" +"more info"+ "</a>"

Link.php takes in the id and runs a query and displays results based
on id.

Please tell me if what i am doing is rite or wrong.Also what is the
best way for me to go ahead with this.
Thanking You,
Prashant Kalyanraman
Jun 30 '08 #1
12 2836
prashant wrote:
hi,
i am trying to create an xml tag ref to hold link.php?id=1; or
link.php?id=2 and so on.
I want the links for all the fields(id) in the databse so that when i
call them in my html page for google maps i have the whole link.The
tag in the php page i am using is

echo 'ref="link.php? id='.$row['id'] . '"';
the tag in html is
<a href="+ref+">" +"more info"+ "</a>"

Link.php takes in the id and runs a query and displays results based
on id.

Please tell me if what i am doing is rite or wrong.Also what is the
best way for me to go ahead with this.
Thanking You,
Prashant Kalyanraman
As long as there are no security concerns with the data, it should work
fine.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===

Jul 1 '08 #2
On Jun 30, 5:45 pm, Jerry Stuckle <jstuck...@attg lobal.netwrote:
prashant wrote:
hi,
i am trying to create an xml tag ref to hold link.php?id=1; or
link.php?id=2 and so on.
I want the links for all the fields(id) in the databse so that when i
call them in my html page for google maps i have the whole link.The
tag in the php page i am using is
echo 'ref="link.php? id='.$row['id'] . '"';
the tag in html is
<a href="+ref+">" +"more info"+ "</a>"
Link.php takes in the id and runs a query and displays results based
on id.
Please tell me if what i am doing is rite or wrong.Also what is the
best way for me to go ahead with this.
Thanking You,
Prashant Kalyanraman

As long as there are no security concerns with the data, it should work
fine.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attgl obal.net
=============== ==
when i run the file it gives me the iutout with an errror. the two
equal to signs used in the same line r clashing.is there a work around?
Jul 1 '08 #3
prashant wrote:
On Jun 30, 5:45 pm, Jerry Stuckle <jstuck...@attg lobal.netwrote:
>prashant wrote:
>>hi,
i am trying to create an xml tag ref to hold link.php?id=1; or
link.php?id =2 and so on.
I want the links for all the fields(id) in the databse so that when i
call them in my html page for google maps i have the whole link.The
tag in the php page i am using is
echo 'ref="link.php? id='.$row['id'] . '"';
the tag in html is
<a href="+ref+">" +"more info"+ "</a>"
Link.php takes in the id and runs a query and displays results based
on id.
Please tell me if what i am doing is rite or wrong.Also what is the
best way for me to go ahead with this.
Thanking You,
Prashant Kalyanraman
As long as there are no security concerns with the data, it should work
fine.

when i run the file it gives me the iutout with an errror. the two
equal to signs used in the same line r clashing.is there a work around?
OK, I guess I don't understand just what you're trying to do then.

when you do

echo 'ref="link.php? id='.$row['id'] . '"';

You should get on your page (see the page source!)

ref="link.php?i d=42"

if $row['id'] is 42. Are you not getting this?

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===

Jul 1 '08 #4
Message-ID: <g4**********@r egistered.motza rella.orgfrom Jerry Stuckle
contained the following:
>OK, I guess I don't understand just what you're trying to do then.

when you do

echo 'ref="link.php? id='.$row['id'] . '"';

You should get on your page (see the page source!)

ref="link.php?i d=42"

if $row['id'] is 42. Are you not getting this?
Perhaps he wants :

<a href="link.php? id=<?php echo $row['id']; ?>">more info</a>
--
Geoff Berrow 011000100110110 0010000000110
001101101011011 001000110111101 100111001011
100110001101101 111001011100111 010101101011
Jul 1 '08 #5
Geoff Berrow wrote:
Message-ID: <g4**********@r egistered.motza rella.orgfrom Jerry Stuckle
contained the following:
>OK, I guess I don't understand just what you're trying to do then.

when you do

echo 'ref="link.php? id='.$row['id'] . '"';

You should get on your page (see the page source!)

ref="link.php?i d=42"

if $row['id'] is 42. Are you not getting this?

Perhaps he wants :

<a href="link.php? id=<?php echo $row['id']; ?>">more info</a>
Coule be, Jeff. I wish I knew. The code he has doesn't make a lot of
sense.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===

Jul 1 '08 #6
Jerry Stuckle wrote:
Geoff Berrow wrote:
>Message-ID: <g4**********@r egistered.motza rella.orgfrom Jerry Stuckle
contained the following:
>>OK, I guess I don't understand just what you're trying to do then.

when you do

echo 'ref="link.php? id='.$row['id'] . '"';

You should get on your page (see the page source!)

ref="link.php?i d=42"

if $row['id'] is 42. Are you not getting this?

Perhaps he wants :

<a href="link.php? id=<?php echo $row['id']; ?>">more info</a>

Coule be, Jeff. I wish I knew. The code he has doesn't make a lot of
sense.
Sorry, I mean Geoff...

Too early in the morning :-)

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===

Jul 1 '08 #7
On Jul 1, 3:45 am, Jerry Stuckle <jstuck...@attg lobal.netwrote:
Jerry Stuckle wrote:
Geoff Berrow wrote:
Message-ID: <g4c9dn$7a...@r egistered.motza rella.orgfrom Jerry Stuckle
contained the following:
>OK, I guess I don't understand just what you're trying to do then.
>when you do
>echo 'ref="link.php? id='.$row['id'] . '"';
>You should get on your page (see the page source!)
> ref="link.php?i d=42"
>if $row['id'] is 42. Are you not getting this?
Perhaps he wants :
<a href="link.php? id=<?php echo $row['id']; ?>">more info</a>
Coule be, Jeff. I wish I knew. The code he has doesn't make a lot of
sense.

Sorry, I mean Geoff...

Too early in the morning :-)

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attgl obal.net
=============== ===
sorry for not being clearer. the error is jus b4 county. i want to
display the output in xml form.

the output i get is
XML Parsing Error: not well-formed
Location: http://localhost/pra/newphpgend.php
Line Number 1, Column 119:<markers><m arker name="Newark, Memorial,
High" street="39375 Cedar Blvd." city="Newark" zip="94560"
ref="link.php?i d=1"county="Ala meda"

once agian my line of code is echo 'ref="link.php? id='.$row['id'] .
'"';
Jul 1 '08 #8
On Jul 1, 10:56 am, prashant <prashant.kalya nra...@gmail.co mwrote:
On Jul 1, 3:45 am, Jerry Stuckle <jstuck...@attg lobal.netwrote:
Jerry Stuckle wrote:
Geoff Berrow wrote:
>Message-ID: <g4c9dn$7a...@r egistered.motza rella.orgfrom Jerry Stuckle
>contained the following:
>>OK, I guess I don't understand just what you're trying to do then.
>>when you do
>>echo 'ref="link.php? id='.$row['id'] . '"';
>>You should get on your page (see the page source!)
>> ref="link.php?i d=42"
>>if $row['id'] is 42. Are you not getting this?
>Perhaps he wants :
><a href="link.php? id=<?php echo $row['id']; ?>">more info</a>
Coule be, Jeff. I wish I knew. The code he has doesn't make a lot of
sense.
Sorry, I mean Geoff...
Too early in the morning :-)
--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attgl obal.net
=============== ===
Thank you for all your help but i am still stuck
sorry for not being clearer. the error is jus b4 county. i want to
display the output in xml form.

the output i get is
XML Parsing Error: not well-formed
Location:http://localhost/pra/newphpgend.php
Line Number 1, Column 119:<markers><m arker name="Newark, Memorial,
High" street="39375 Cedar Blvd." city="Newark" zip="94560"
ref="link.php?i d=1"county="Ala meda"

once agian my line of code is echo 'ref="link.php? id='.$row['id'] .
'"';
I am using php to generate ouput in xml form using mysql as my
database.Then i am calling the xml output in my html page(this html
page is for google maps).Every school present in my xml file is
displayed in the form of markers in google map. when clicked on a
marker it displays lat,long,distri ct,county etc. I would also like to
have a link for every school i display on the map.initially i tried
making static pages and static links but it was too tedious. so i
created a page link.php which takes in id and displays the information
about school.

The dynamic link on either the php page or html page. i am trying to
make small changes to my php page to make it work since i wasnt able
to do it on tht html page.

so the code i wrote on my phph page is

echo '<markers>';

// Iterate through the rows, printing XML nodes for each
while ($row = @mysql_fetch_as soc($result)){
// ADD TO XML DOCUMENT NODE
echo '<marker ';
echo 'name="' . $row['name'] . '" ';
echo 'street="' . $row['street'] . '" ';
echo 'city="' . $row['city'] . '" ';
echo 'zip="' . $row['zip'] . '" ';
echo 'ref="link.php? id='.$row['id'] . '"';
echo 'county="' . $row['county'] . '" ';
echo 'earthquake="' . $row['earthquake'] . '" ';
echo 'lat="' . $row['lat'] . '" ';
echo 'lng="' . $row['lng'] . '" ';
echo 'type="' . $row['type'] . '" ';
echo '/>';

}
// End XML file
echo '</markers>';

?>
with other corresponding information on top.without the echo ref my
code works perfectly fine.

on my html page the imprtant functions i am using are

function load() {
if (GBrowserIsComp atible()) {
var map = new GMap2(document. getElementById( "map"));
map.addControl( new GSmallMapContro l());
map.addControl( new GMapTypeControl ());
map.setCenter(n ew GLatLng(37.6184 12, -122.041893), 10);

GDownloadUrl("n ewphpgen.php", function(data) {
var xml = GXml.parse(data );
var markers =
xml.documentEle ment.getElement sByTagName("mar ker");
for (var i = 0; i < markers.length; i++) {
var name = markers[i].getAttribute(" name");
var street = markers[i].getAttribute(" street");
var type = markers[i].getAttribute(" type");
var city = markers[i].getAttribute(" city");
var zip = markers[i].getAttribute(" zip");
var earthquake = markers[i].getAttribute(" earthquake");
var link = markers[i].getAttribute(" link");
var linkss = markers[i].getAttribute(" linkss");
var point = new
GLatLng(parseFl oat(markers[i].getAttribute(" lat")),

parseFloat(mark ers[i].getAttribute(" lng")));
var marker = createMarker(po int, name, type,link, linkss,
city, zip, street, earthquake);
map.addOverlay( marker);
map.setMapType( G_HYBRID_TYPE);
}
function createMarker(po int, name, type,link, linkss, city, zip,
street, earthquake) {
var marker = new GMarker(point, customIcons[type]);
//var html = "<b>" + name +"<br/></b>" + street + "<br/>"+ city
+"&nbsp;" + zip +"<br/><b>Earthquak e: " + earthquake + "</b><br/><a
href="+link+">" +"more info"+ "</a>";
currently i am suing static link to schools but now i hav a databse of
15000 records and making a link for every field would not be feasible.
can u please tell me what would be the best solution
Jul 1 '08 #9
Message-ID:
<6f************ *************** *******@i36g200 0prf.googlegrou ps.comfrom
prashant contained the following:
>
the output i get is
XML Parsing Error: not well-formed
So it's an XML problem then?

--
Regards,

Geoff Berrow
Jul 1 '08 #10

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

Similar topics

3
1733
by: Danny | last post by:
How do you guys make listings such as product listings and their detail pages more crawler friendly, if they are genrated using dynamic asp pages. If your ASP uses a format like this: www.mysite.com/products.asp?idnum=3444 to display detail pages, how can I apply SEO to this format?? I know unix hosts use the mod rewrite, but I do not have access to the server settings etc. BUt I can access a database etc. What are your thoughts?
4
4646
by: Daniel Keller | last post by:
Hello! I'm trying to set up a page system using "dynamic" SSI. That means that I normally use the following on my website: <!--#include virtual="file.inc" --> Now I want to make this "dynamic" and I don't have a clue how to do so. I want to link to a file using something like this: <a href="file.shtml?dynamic">Link</a>
6
2924
by: MikeY | last post by:
Hi Everyone, Does anyone know where I can get my hands on a sample with source code of a simple dynamic button control in C# Windows form. I am looking for a sample that uses a class library that sets the properties send/passed from the main windows form. I'm having problems with the class library, the button control collection and my referencing it ie this.Control.Add(aControl);. Any and all help is appreciated. Thanks in advance.
3
1863
by: WebBuilder451 | last post by:
I have a series of dynamic link buttons created based upon a datareader. I've added a click event and it calls the sub ok: example: "while loop through the reader" Dim ltrCtrl As New LiteralControl Dim lbtnCtrl As New LinkButton ltrCtrl.Text = "<br>" lbtnCtrl.Text = "WE: " & dtrCal(10).ToString lbtnCtrl.ToolTip = dtrCal(10).ToString & " these events" & dtrCal(1) lbtnCtrl.ID = "wecc" & i.ToString
2
6359
by: JWL | last post by:
Hi I need to create a bunch of sites with slightly dynamic CSS. Basically, all the image paths in the CSS need to be dynamic, depending on the values of certain ASP variables. I can think of 3 ways to do this: 1. Write a script to create a semi-dynamic CSS file, which will be run whenever we need to make changes to the ASP variables controlling the
5
3177
by: pittendrigh | last post by:
There must be millions of dynamically generated html pages out there now, built by on-the-fly php code (and jsp, perl cgi, asp, etc). Programatic page generation is transparently useful. But querying a database, negotiatinig lots of if-then-else logic and echo'ing html code out on port 80 every time a page is requested has to be a huge waste of resources. Why not use that logic to print static html instead of dynamic?
12
9508
by: Lazoris | last post by:
OK heres a newb question and I'm sorry for it, but im getting back into web design after like 5 years off and im stuck even though i should know the problem i cant seem to correct it atm. What I'm trying to do is create a page that pulls up a list of items in a DB page, lists the items and creates a dynamic link using the item_id making the item_name a link to a more detailed page. So that when they click the Item_name it uses the item_id...
2
1963
by: David W | last post by:
I need to include a style sheet link in the aspx page based on what user they are. Basically this functionality, but using code behind. Any idea how to change this line to code behind? This breaks once we include an AJAX control on the page. <head runat="server"> <link href="/textfiles/style<%= Session("partner_id") %>.css" rel="stylesheet" type="text/css">
3
3701
by: saritha2008 | last post by:
Hi, As part of migrating bugs from JIRA to BugZilla, below is the requirement: If there are multiple “version” tags in my input.xml file For open bugs (Resolved,Reopened,Inprogress,NeedInfo) > create multiple bugs, one for each “version". “Fix version” will be empty. For closed bugs > create multiple bugs, one for each “Fixed in” version. Use earliest “version" for all bugs. I tried using the apply-template in the XSLT for the above...
0
9424
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10223
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9866
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8879
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
7413
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
6675
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5310
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...
1
3968
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
3571
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.