Jump to content
Larry Ullman's Book Forums


  • Content Count

  • Joined

  • Last visited

Everything posted by Cofa

  1. Thanks again Hartley San. I have decided to avoid the complicated regular express approach. For purposes of sharing with the forum, my solution to allow user to add links in their message (an ad page), is to have them fill in up to 9 sets of input fields. Each set consists of one "caption" field and one "full url" field. When the page is loaded, those links (if any) will be listed at the bottom, apart from the message block (each link is rendered by combining a caption and a full url in pair). It's not fancy at all but should serve the needs of most users of our services.
  2. Sorry it looks like I am making things complicated. To make it easier to understand what I wish to do I am rewording my question again: Say if I send an email message to introduce a website to my friend. I would simply type (or copy and paste) the URL in text: "Visit this site to find out: www.sitename.com." When the message is received in the reader's browser, the URL will become a "clickable link" - this feature is seen in Gmail and many email services. And this is what I try to accomplish with my site: User can type any number of URLs in the textarea input area (I assume they
  3. Hi HartleySan, thanks for your response. What I mean is that the entry will be stored to database using this code: $message = mysql_real_escape_string(htmlspecialchars(trim($_POST['message']))); When the entry is retrieved from database I use this code to print the message on the webpage: echo nl2br($row['message']); The effect is that all HTML tags (if any) will be printed in text strings. For example, the <a href...> tag will become <a href...> and the anchor tag will have no effect as a clickable link. But the goal of my question is to see how I could cha
  4. I have a textarea in a form to collect user message to a database. When the entry is stored to database all html tags are converted into text. Users can include any number of URLs in the message. With my current settings all the URLs will be printed on the webpage as static character strings (i.e., they are not "clickable."). I wonder how I could make those URLs become clickable links when the message is retrieved from database and printed on a webpage, using purely PHP coding?
  5. Anyone who is familiar with the topic "MLS® data feed" and all of the components in the subject line? I want to develop a program that can fetch MLS listing data from the appropriate MLS data servers in Canada and in the US for use by multiple user. My initial research shows that none of the "data feed" sources and specifications have anything to do with PHP and MySQL. Could anyone give me an idea how big the difference is between the specifications of RETS, IDX, DDF, XML and the specifications of PHP and MySQL? Thanks.
  6. Thanks HartleySan. I notice that (as from real test), the SELECT `AUTO_INCREMENT` code will get the *future* ID to be inserted if I subsequently execute an insert query. I assume there would be a chance my actual insert would generate a member_id that's different than the value being captured in the first query, IF there's another transaction that has been executed in between my two queries - is this possible (although extremely slim)? Anyway, I found your second suggestion much easier for me, and with these advantages: 1) Everything is inserted in just one query (i.e., only the
  7. I have a membership table which contains the following fields (as example): member_id (primary key, auto increment = 123) lastname (= Smith) firstname (= David) publicname (= 123SD) Note that the value of the field publicname is in fact the combination of the member_id and the first characters of the fields lastname and firstname, respectively. I manage to insert the values of the first three fields to create a new record as the first step, then create the value for field publicname and insert it into the newly created record as the second step. My question is, whether it is
  8. Mmmm. Each combination of m_id and other columns can be a unique record (listing). If we don't have l_id (listing id), how could we call (identify) a record from the table then? I must miss something here and am interested in knowing more. Thanks.
  9. Hi HartleySan, thanks for your comments. The l_id in the listings table is the primary key (auto assigned and auto incremented whenever a new listing is created). In the listings table each record will have many more other columns (property age, price, room measurements, etc, etc) that are not shown here. For my learning sake, I don't understand why you see m_id in the listings table could be unique, as each member ('m_id') can have many unique listings in the table (only the 'l_id' is unique). Thanks.
  10. Below is my final result of this topic - four tables and two query options... members m_id m_name 1 David 2 Jennifer 3 Mary groups g_id g_name 1 Group1 2 Group2 mem_group m_id g_id 1 1 2 2 3 1 3 2 listings l_id m_id type 1 1 House 2 3 Condo 3 1 Condo 4 1 Townhouse 5 3 Condo 6 2 Condo 7 3 Condo ----------------------- SUCCESSFUL QUERY CODE: ----------------------- SELECT l.* FROM listings AS l LEFT JOIN members AS m ON l.m_id = m.m_id LEFT JOIN mem_group AS mg ON m.m_id = mg.m_id WHERE mg.g_id = 2 ORDER BY l
  11. Thanks for following up on this. I'll check out the query code when have chance and update here again. Have a great day!
  12. After some thinking, I still don't understand why the need of "another table between members and listings," since I already have table listings consisting of this relationship. Any hint please? (Note: the table listings will also consist of other columns like property_type, address, age, etc.) I still haven't had a chance to experiment the query as I have not built the tables yet. But I have yet already had another query code (below) - wonder if there is any error. Thanks. SELECT m.id, g.id FROM members AS m, groups AS g WHERE g.id = 2 ##We are to get all listings of group 2 GROUP BY
  13. Thanks again for the quick reply! I think I'll need some time to figure out how to do the query part.It's good to know the direction so far. Have a great day!
  14. Thanks HartleySan for the quick reply (and how are you? it's been a while ) ! I have not set up the database tables yet but figure that what I need to do next could be as follows... I'll set up a listings table and use the SQL query to retrieve the listings of a specified group, like this: listings id member_id 1 1 2 3 3 1 4 1 5 3 6 2 SELECT l.*, m.id, g.id, mg.group_id FROM listings l, members m, groups g, members_groups mg WHERE g.id = '2' ##We are to get all listings of group 2 AND mg.group_id = g.id AND l.member_id = mg.member_id GROUP BY l.id ORDE
  15. Hello all, I have been wondering if this is even possible: Say, a) I have a database containing real estate licensees ("members") and their real estate listings; members can form groups and each group will have a unique group name ("team1", "team2", etc); c) listings of a members that are linked to a particular group name of that member can be displayed in the website of other members of the group (e.g., listings that are linked to the group name "team1" of all members of the group can be retrieved by any member in the group using the "team1" group name); and d) I store th
  16. Hello HartleySan, (and those who might be interested) I found the Javascript from this page likely to be able to achieve what I wanted: http://www.quirksmode.org/js/popup.html I have modified the code from the above page a bit, and the result seems to be close to what I want. Here are two files containing my modified code... 1) PARENT PAGE HTML CODE: --------------------------------------------- <!doctype html> <html> <head> <meta charset="utf-8"> <title></title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <
  17. thanks Hartleysan, i did thought that a js code could achieve my goal but didn't expect that complicated. yes, using the banners the way they were designed seems to be the only way for my site for now. and again, thanks for trying to help!
  18. Hi HartleySan, That is too complicated for me - I simply am not at that grade yet. But again, thank you for looking into the question and trying to help. I really appreciate it!
  19. Hi HartleySan, The plain text (html) files are in my #9 message - I now repeat them below with their code in the quotes, for your easy reference: See samples modified from your files: PAGE HOLDING THE IFRAME: http://www.cofatsui.com/h5/00-h5banner-c.html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>iframe demo</title> </head> <body style="margin:0; padding:0; background-color:transparent;"> <iframe style="width:300px; height:250px; background-color:transparent;" name=
  20. Hi HartleySan, With your new message, I think I might understand what you mean. But then the problem is on my part: I know what to do up to the iframe part; but I have no knowledge to do with the JS part in the banner ("after that JS executes, there will be..."). Looks like a client side JavaScript is more complicated than I thought so I may just let those banners open the windows the way they were designed. Anyway, thanks for looking into my question.
  21. Thanks HartleySan, I am sorry but I am not sure if the "grab the contents of an iframe" approach could achieve my goal - My thinking is that in the case of a Flash banner or an H5 banner, there is a JS file built-in and it is this JS file that would control the opening of the target window, not the contents of the iframe. Contents of the iframe: <iframe style="width:300px; height:250px; background-color:transparent;" name=inline src="/h5/testa09/testa-c.html" frameBorder=0 scrolling=no allowtransparency="true"> Contents of the H5 banner "/testa-c.html" in the above iframe: &
  22. Thanks HartleySan, but no that's not what I am looking for. The part in your example b.html: [A TAG]Google (this window)[A TAG END] or the code between the BODY tags, is that I have no control of if the banner file is from a third party (same for your "c.html"). If you refer back to message #5, code for the URL "/testa09.html" you'll see that the contents between the BODY tags are the code that will deliver the h5 banner or Flash banner, which also controls how the target link will be opened. In other word, if you replace the code [A TAG]Google (new window)[A TAG END] in your
  23. Hi HartleySan, It is because I plan to go with the new trend of using html5 banners on my site, which will ultimately avoid using Flash or other forms of media for the banner ads. With h5 banners, one of the vision I see is that at some point advertisers will be able to modify the contents of their banners from a web-based interface any time they need (just like today's modifying an html ad page via form submission). Since we will take h5 banners from third parties, I think that it would be nice to have a control to force how a target webpage would open - I still wonder if this can
  24. Hello HartleySan, Thanks for the stackoverflow link - I found that link and tried that before, but it didn't work... The banners are all stored in the same folder where the file of the parent page and the file in the iFrame are stored as well, as you can see from this: www.cofatsui.com/h5/00-h5banner2.php <!doctype html> <!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]--> <!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]--> <!--[if IE 8]> <html class="no-js l
  • Create New...