Jump to content

Dimwhit

Members
  • Posts

    23
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Dimwhit's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Sure. The originating site is www.adoptidaho.org. Here's a test page of the feed I'm trying to post: http://www.idahowednesdayschild.org/testrss.php The script is in my first post (the one that parses the rss file for use on the other site).
  2. Dang, didn't work. I really thought it would, too. I also, to make sure, created a new article (the originating site is a WordPress site) to test, and the quotes and apostrophes were messed up in that one, too. So it's definitely not a copy/paste issue from Word (which is what I originally thought it would be).
  3. I'll give that a shot. I do know it's not a Word issue. I specifically wiped it out and typed the original text in from scratch and it still showed up. Thanks.
  4. I'm in the process of displaying an rss feed from one of my sites to another. I downloaded a nice, simple php script to display the feed, and it works great. With one exception. I get this: “Screaming Parrots†The Wendy’s... instead of this: "Screaming Parrots" The Wendy's The RSS displays find in a normal reader, so I'm confident it's not happening on the RSS end of things. I think it's something with the script I'm using that it isn't properly handling the quotes and apostrophes. I've played around with various functions to try to take care of it, but nothing is working. Here is the part of the script I'm using (again, I didn't write this, but I can't find any way to contact the guy who did): $RSS_Content = array(); function RSS_Tags($item, $type) { $y = array(); $tnl = $item->getElementsByTagName("title"); $tnl = $tnl->item(0); $title = $tnl->firstChild->data; $tnl = $item->getElementsByTagName("link"); $tnl = $tnl->item(0); $link = $tnl->firstChild->data; $tnl = $item->getElementsByTagName("description"); $tnl = $tnl->item(0); $description = $tnl->firstChild->data; $y["title"] = $title; $y["link"] = $link; $y["description"] = $description; $y["type"] = $type; return $y; } function RSS_Links($url, $size) { global $RSS_Content; $page = "<ul>"; RSS_RetrieveLinks($url); if($size > 0) $recents = array_slice($RSS_Content, 0, $size); foreach($recents as $article) { $type = $article["type"]; if($type == 0) continue; $title = $article["title"]; $link = $article["link"]; $page .= "<li><a href=\"$link\">$title</a></li>\n"; } $page .="</ul>\n"; return $page; } Any suggestions are greatly appreciated. Thanks.
  5. OK, Got it to work. I had to use thebadbad's suggested, because the other one wasn't working. But I had some bad invisible characters that were causing the problem. Thanks for the help!
  6. I'm obviously missing something (and given that I'm still learning my way through php, that's not surpnising). But this is the entirety of the php code I'm working with: <?php $searchcriteria = array(); $searchcriteriausingquotes = array(('file')); if (array_key_exists('file', $_GET)) { $file = $_GET['file']; if (strlen($file)) $searchcriteria['file'] = $file; } $str = $file; if (ctype_digit($str[0]) === TRUE ) { echo 'Starts with a number'; } else { echo 'Starts with a non-number'; } ?> I tried a hybrid of the two suggestions above, but I'm getting an 'unexpected T_String' error on the following line: if (ctype_digit($str[0]) === TRUE ) { Any thoughts on why?
  7. OK, I'm not having luck with either these. Let me start with the first one. I'm assuming that in the following: $str = "123abc"; I need to plug in my variable for '123abc', so it would look something like: $str = "$filename"; Right? That should get the actual filename text (or numbers) for the script to work with. I keep getting the 'unexpected T_Variable error on that line (in both examples) every time. Thanks for the help.
  8. I'm not sure how to word this well enough to even perform a search, but here's what I want to do: I have a field whose value is a filename. I want to look at that name and return one set of code if the name starts with a letter (a-z) and another if it's a number (1-9). Something like: if ($filename starts with letter) { echo "code 1"; } else if ($filename starts with number) { echo "code 2"; } I just don't know how, or if, that's doable. Is there something boneheadedly simple I'm don't know about?
  9. OK, so I tried that, and it didn't work. Then as I was getting ready to copy the code to show you, I noticed something odd with it (how it escaped me until now I'll never know). Tried a fix, and it's working now! I'm not sure why it picked now (after more than a year) and only this record to show me it didn't like what I did, but I think it's fixed now. Thanks!
  10. Sorry. It's the online form I use for entering new records. HTML/PHP form that inputs into the MySQL database.
  11. Not too stupid. I'll give that a shot. A pasted directly into phpMyAdmin, but I didn't try typing directly into it.
  12. I have a database table that current has about a hundred entries. There are twenty or so fields in the table. I have one particular record that I just cannot figure out. One of the fields is a longtext field where a text narrative is placed. With this problem record, when I go in to edit it later, the narrative field is grayed out and won't let me edit it. I checked it today, and the db actually dropped the contents of that field so that it was empty! I was then able to re-past the narrative, but sure enough, it was uneditable when I went back in (I'm sure it will disappear eventually). So I'm at a loss. No other record is doing this. I thought that I maybe had a hidden character that was causing this. So I retyped the entire thing in a plain text editor. Didn't help. Then I tried just deleting the entire record and re-entering it (I'm coding all these pages with php, obviously--MySQL for the db). Same problem. But I've since entered other records and haven't had this problem. So I thought that maybe the colons in the narrative were the problem--don't know why they would be, but you never know. Nope, that wasn't it. Anyone have an idea of what I should try next? There's something about this particular record and it's narrative that my db just does not like, and I can't figure out what that is.
  13. I'm self-taught in all this, and as such, I know very little. Here's what I'm working with: - adoption-related website with records of families wanting to adopt. They've listed gender, age, and number of children preferences. I'm looking for a way to sort through these records based on those criteria. Here's what I have so far: - I'm able to do most of this by passing the variable through the url. For example view.php?gender=Girl&age=LT9 Will return only records of families looking to adopt a girl under 9 years old. So I now have 2 questions. 1. Can I pass an 'OR' function this way? The gender options are Boy, Girl, and Either, so I need to be able to pass 2 of those. e.g. view.php?gender=Girl OR gender=Either. I'm not sure how to do that, or if there's even a way. Maybe I need to input the data into the db differently in the first place. 2. I'd like a simple form where the age, gender, and number if children can be entered, then sorted. I've tried to find some tutorials explaining this, but I haven't found any that I've been able to understand. I'm not looking for someone here to give me a detailed explanation on how to do it...just to maybe point me to a tutorial that's geared toward relative newbies like me.
  14. Bingo! That was the problem. I just changed the field name for that one. Works fine now. That thought didn't even occur to me. Thanks for all the help, everyone!
  15. OK. I echoed the query and added the error reporting. This is what came back: I'm not sure what syntax problem it's referring to. Particularly since I'm using the same in other scripts just fine. That make sense to anyone? Edit: I also fixed the numrows problem and added 'PHP' to the <? code. Neither helped in this instance.
×
×
  • 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.