473,473 Members | 1,924 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

trouble with php, url and hyperlink

n8kindt
221 New Member
i'm having problems with
1) putting a url into xml using php
and once it is in a url
2) parsing it as a hyperlink...

i've tried using &amp; and = to parse the url but i keep getting the 'XML Parsing Error: not well-formed' which points to the &amp; and = signs. or if i'm using <!CDATA it will point to the '<!CDATA'...

if i just try using a simple url (say 'www.google.com') it parses but it won't display as a hyperlink although by looking at the page source, you would think it would.

i figure rather than me pulling my hair out over it i'd have u guys look at it and see if there are any obvious suggestions


Expand|Select|Wrap|Line Numbers
  1.     private function getItems()
  2.     {
  3.         $itemsTable = "store_tranlog";
  4.         $this->dbConnect($itemsTable);
  5.         $query = 'SELECT * FROM `store_tranlog` ORDER BY `date` DESC LIMIT 0,30';
  6.         $result = mysql_db_query (DB_NAME, $query, LINK);
  7.         $items = '';
  8.                while($row = mysql_fetch_array($result))
  9.         {
  10.            $url = 'http://www.xxx.com/admin/index.php?page=orders&action=viewoldorder&cartid='. $row["cartid"];
  11.             $items .= '<item>
  12.                 <title>'. $row["date"] .'</title>
  13.  
  14.                 <link><html><a href="'.$url.'">'.$row["cartid"].'</a></html></link>
  15.                 //tried cdata... didn't work <![CDATA['.$url.']]>
  16.                 <description></description>
  17.             </item>';
  18.         }
  19.         $items .= '</channel>
  20.                 ';
  21.         return $items;
  22.     }
  23.  
  24. }
also, here's my stylesheet info (dunno if that matters or not)
Expand|Select|Wrap|Line Numbers
  1. rss {
  2. display: block;
  3. font-family: verdana, arial;
  4. }
  5. title {
  6. display: block;
  7. margin: 5px;
  8. padding: 2px;
  9. color: gray;
  10. border-bottom: 1px solid silver;
  11. }
  12. link {
  13. display: block;
  14. font-size: small;
  15. padding-left: 10px;
  16. }
  17. item {
  18. display: block;
  19. padding: 2px 30px 2px 30px;
  20. }
  21. docs {
  22. display: block;
  23. background-color: #ffffe6;
  24. margin: 20px;
  25. text-align: center;
  26. padding: 5px;
  27. color: #7f7f7f;
  28. border: 1px solid silver;
  29. }
  30. /* all hidden elements */
  31. language, lastBuildDate, ttl, guid, category, description, pubDate {
  32. display: none;
  33. }
Jul 31 '08 #1
2 3593
Dormilich
8,658 Recognized Expert Moderator Expert
what about
Expand|Select|Wrap|Line Numbers
  1. <link><html><a href="'.htmlspecialchars($url).'">'.$row["cartid"].'</a></html></link>
?
Aug 21 '08 #2
n8kindt
221 New Member
what about
Expand|Select|Wrap|Line Numbers
  1. <link><html><a href="'.htmlspecialchars($url).'">'.$row["cartid"].'</a></html></link>
?
oh wow. i was obviously just learning php when i posted this. i hadn't revisited in this problem a while and if i did, i would have/should have known to use that. thanks for the reply! i'm sure it will work.
Sep 9 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: David Shadovitz | last post by:
I'm new to PHP and can use some help with avoiding HTML entity trouble. I've got a page which creates a hyperlink as follows: printf('<a href="%s?txtFilter=%s">%s</a>', $_SERVER, $txtFilter,...
1
by: Alex Peng | last post by:
I have the following code. For IE 6, I can get link one and link two in two separated lines, but not in Netscape 7. I try to set display:block for A.ccMenu; however, the hyperlink excess ccMenuBox...
1
by: Badboy36 | last post by:
Hello user from googlegroups, i made a microsoft access database with front and backend. i created the backend in microsoft access97. for the frontend i made two versions (one for microsoft...
2
by: pemigh | last post by:
If I type www.microsoft.com into the control txtSearchString which is bound to a hyperlink field, I can click it and automatically zoom off to the web page. But if I try to set the field with...
0
by: Ryan Harvey | last post by:
Hi all, I have written a web user control that contains a repeater control. the ItemTemplate for this control is basically 6 Hyperlinks in a row, that are dynamically allocated one of 7 gif...
5
by: Martin Dew | last post by:
Having some problems getting a hyperlink object to work in my repeater control, It displays the text I have asked it to for the hyperlink, but it does not act as a link. My repeater code is below...
2
by: mikepolitowski | last post by:
Hi folks, I am have been trying to solve this problem for quite some time now and would appreciate any advice. I have been trying to call a code-behind function that is defined in my aspx.cs...
20
by: tshad | last post by:
I had posted this problem earlier and just noticed that the Hyperlink is the problem. Apparently, it doesn't figure out the path correctly. It uses the path of the file it is in, even if it is...
4
by: Jeff | last post by:
hi asp.net 2.0 I have created a custom web control, here is it's header: <%@ Control Language="C#" AutoEventWireup="true" CodeFile="EditUserBox.ascx.cs" Inherits="Controls_EditUserBox" %> ...
0
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...
0
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,...
0
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...
0
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,...
0
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.