Jump to content

how to make my <a> tag dynamic...


atimbiresteven

Recommended Posts

i have an xml file that has this format below:

 

<searches>

<search id ='1234'>

<name> somename </name>

<address> some address </address>

<sector> some sector </sector>

<contacts> 12345, me@me.com </contacts>

 

<search id ='3455'>

<name> somename </name>

<address> some address </address>

<sector> some sector </sector>

<contacts> 12345, me@me.com </contacts>

 

<searches>

 

this  loop below dynamically outputs all the name values in the file as links to the user.

<div>

<ul data-role="listview" data-inset="true" class="ui-listview ui-listview-inset    ui-corner-all ui-shadow">

<?php foreach($objj as $searches): ?>

<li><a href="selected.php?..." data-role="button"> <?php echo $searches -> name ?></a></li> 

<?php endforeach ?>

</ul>

</div>

 

QUESTIONS:

i want the href attribute to link to a page called "selected.php" and display the sector,contact and

address values for that particular anchor tag  that will be clicked. Every item has a unique id as in

the xml file above. only the other details of that particular link should be shown so that the user

can like,share on facebook or send it to a friend via email or sms on the new page. Thanx in advance. 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.