473,221 Members | 1,908 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,221 software developers and data experts.

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 2796
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*******@attglobal.net
==================

Jul 1 '08 #2
On Jun 30, 5:45 pm, Jerry Stuckle <jstuck...@attglobal.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...@attglobal.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...@attglobal.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?id=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*******@attglobal.net
==================

Jul 1 '08 #4
Message-ID: <g4**********@registered.motzarella.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?id=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 0110001001101100010000000110
001101101011011001000110111101100111001011
100110001101101111001011100111010101101011
Jul 1 '08 #5
Geoff Berrow wrote:
Message-ID: <g4**********@registered.motzarella.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?id=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*******@attglobal.net
==================

Jul 1 '08 #6
Jerry Stuckle wrote:
Geoff Berrow wrote:
>Message-ID: <g4**********@registered.motzarella.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?id=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*******@attglobal.net
==================

Jul 1 '08 #7
On Jul 1, 3:45 am, Jerry Stuckle <jstuck...@attglobal.netwrote:
Jerry Stuckle wrote:
Geoff Berrow wrote:
Message-ID: <g4c9dn$7a...@registered.motzarella.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?id=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...@attglobal.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><marker name="Newark, Memorial,
High" street="39375 Cedar Blvd." city="Newark" zip="94560"
ref="link.php?id=1"county="Alameda"

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.kalyanra...@gmail.comwrote:
On Jul 1, 3:45 am, Jerry Stuckle <jstuck...@attglobal.netwrote:
Jerry Stuckle wrote:
Geoff Berrow wrote:
>Message-ID: <g4c9dn$7a...@registered.motzarella.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?id=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...@attglobal.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><marker name="Newark, Memorial,
High" street="39375 Cedar Blvd." city="Newark" zip="94560"
ref="link.php?id=1"county="Alameda"

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,district,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_assoc($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 (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById("map"));
map.addControl(new GSmallMapControl());
map.addControl(new GMapTypeControl());
map.setCenter(new GLatLng(37.618412, -122.041893), 10);

GDownloadUrl("newphpgen.php", function(data) {
var xml = GXml.parse(data);
var markers =
xml.documentElement.getElementsByTagName("marker") ;
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(parseFloat(markers[i].getAttribute("lat")),

parseFloat(markers[i].getAttribute("lng")));
var marker = createMarker(point, name, type,link, linkss,
city, zip, street, earthquake);
map.addOverlay(marker);
map.setMapType(G_HYBRID_TYPE);
}
function createMarker(point, 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>Earthquake: " + 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**********************************@i36g2000prf. googlegroups.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
prashant wrote:
On Jul 1, 3:45 am, Jerry Stuckle <jstuck...@attglobal.netwrote:
>Jerry Stuckle wrote:
>>Geoff Berrow wrote:
Message-ID: <g4c9dn$7a...@registered.motzarella.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?id=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...@attglobal.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><marker name="Newark, Memorial,
High" street="39375 Cedar Blvd." city="Newark" zip="94560"
ref="link.php?id=1"county="Alameda"

once agian my line of code is echo 'ref="link.php?id='.$row['id'] .
'"';
So you have an xml problem. To me it looks like you need a space before
country.

Otherwise - check an XML group with your source to determine what's
wrong with the xml itself. Then adjust your PHP code to fix it.

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

Jul 1 '08 #11
On Jul 1, 2:12 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
prashant wrote:
On Jul 1, 3:45 am, Jerry Stuckle <jstuck...@attglobal.netwrote:
Jerry Stuckle wrote:
Geoff Berrow wrote:
Message-ID: <g4c9dn$7a...@registered.motzarella.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?id=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...@attglobal.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><marker name="Newark, Memorial,
High" street="39375 Cedar Blvd." city="Newark" zip="94560"
ref="link.php?id=1"county="Alameda"
once agian my line of code is echo 'ref="link.php?id='.$row['id'] .
'"';

So you have an xml problem. To me it looks like you need a space before
country.

Otherwise - check an XML group with your source to determine what's
wrong with the xml itself. Then adjust your PHP code to fix it.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attglobal.net
==================
thanx a lot for ur help i used a sql query and generated a dynamic
link using the concat command
Jul 2 '08 #12
prashant wrote:
On Jul 1, 2:12 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
>prashant wrote:
>>On Jul 1, 3:45 am, Jerry Stuckle <jstuck...@attglobal.netwrote:
Jerry Stuckle wrote:
Geoff Berrow wrote:
>Message-ID: <g4c9dn$7a...@registered.motzarella.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?id=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...@attglobal.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><marker name="Newark, Memorial,
High" street="39375 Cedar Blvd." city="Newark" zip="94560"
ref="link.php?id=1"county="Alameda"
once agian my line of code is echo 'ref="link.php?id='.$row['id'] .
'"';
So you have an xml problem. To me it looks like you need a space before
country.

Otherwise - check an XML group with your source to determine what's
wrong with the xml itself. Then adjust your PHP code to fix it.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attglobal.net
==================

thanx a lot for ur help i used a sql query and generated a dynamic
link using the concat command
My advice still stands, no matter how you generate the link.

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

Jul 3 '08 #13

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

Similar topics

3
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:...
4
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...
6
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...
3
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...
2
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...
5
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...
12
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...
2
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...
3
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) >...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

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.