Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    PHP




Filtering RSS Content


I need to install an rss aggregator on a website. The catch is that it
should only pull in items from feeds which contain certain keywords.

Any idea how this can be done or if such a content managing software
already exists?




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Using The 'Content-type', 'Content-Disposition' And 'readfile'
I've been facing a problem I couldn't solve, I don't know how to serch for it in the list's old messages, so I'll tell you what it is and see if you can
help me. I have this lines:

if (isset($_GET['download']) && ($_GET['download'] >= 1)) {
if ($_GET['download'] == 1)
header('Content-type: application/doc');
else if ($_GET['download'] == 2)
header('Content-type: application/rtf');
else if ($_GET['download'] == 3)
header('Content-type: application/pdf');
header('Content-Disposition: attachment; filename="' . $_GET['file']
. '"');
readfile($_GET['file']);
}

It should show to the user an dialog to the user, so he can choose to
save the file or to open it directly. The dialog shows and the user chooses, and here comes the problem, by using the 'Content-type', 'Content-Disposition' and 'readfile' the content of the page I'm in is "attached" to the end of the file I'm downloading. When it's an DOC or RTF file, the content of the page
doesn't affect the funcioning, but if it's an PDF the string taht goes
"attached" in the end of the file happens to make the file useless.
All I want to do is to use some routine to let the user choose to save
the file or to read it directly, nothing more, nothing less.
I have been trying to solve this problem for at least some weeks, and
I couldn't find some information that could really help me.
BTW, at php.net I found the following example:

<?php
// We'll be outputting a PDF
header('Content-type: application/pdf');

// It will be called downloaded.pdf
header('Content-Disposition: attachment; filename="downloaded.pdf"');

// The PDF source is in original.pdf
readfile('original.pdf');
?>

I used (as can be seem) this example with some modifications, but not
too much, and it happens that it's useless for my needs, if someone
knows how to fiz it or some other way to do what I want please let me
know, I'll be very grateful.

XML Content Syndication And Content Management System
I have several folders of news stories in XML format on my server running PHP, MySQL, apache. What's the best way to dynamically grab the xml files and display them? Is there an existing news content management system that would allow me to specify which XML stories I want displayed? Allowing me to QC news stories and approve/ban them via an admin screen?

Filtering HTML With PHP
I am using PHP to set up a message board which interfaces with a mySQL database. I am trying to filter malicious HTML code that users would try to leave on the message board. I want to strip all HTML tags except the <A HREF> tag.

Filtering Out Bad Input
I am currently building a website, with a built in news and comment, so far i know have been able to filter out thing such as swear words, however is it possible to filter of say f someone held down the ===================================================== ============= key

Is there a way to prevent this or will i have to have some sort of statement that counts how many times the = or other char is grouped together?

Dirty Filtering
does any one has a list of dirty words, do not post in this forum, but show me url. PHP Code:

Username Filtering
I'm having problems with regular expressions. How could i check if a variable has only letters and numbers in it?

Price Filtering
I am having an issue with filtering price from a form variable so maybe someone can tell me how I'm screwing this up.

I have a search page that has 3 criterias for search - category 'cat', price 'price' and location 'area'. I am using Dreamweaver 8 for this project. I can create the query for both cat and area for the double filter, but when i get to price it removes all the records from view.

I removed the 2 working queries and am now focusing on the 'price' query. My SQL looks something like this: Code:

Filtering Data
I've got a question which is more aimed at drumming up some opinions/starting a discussion then looking for a "right answer".  I am writing an application and I wanted to hear some suggestions on how to handle the filtering of data from the user.  The data is all coming in through one class where it is then passed as arguments to methods down the hierarchy, so it seems to make sense to do the checking at that top point.

However what isn't as clear is whether the regular expressions (or some alternative) used should be exclusively set by the top level class.  For instance I see that Cake (a framework) has a protected _validation array which Models can set with their own regex.

I am not a huge fan of this approach because it leaves the array protected, and because it may be responsibility that goes past the role of the class.  In fact I'd prefer a method which didn't rely so heavily on regex in the first place as I find regex hard to maintain.

So what solutions have you come up with to handle input?  I'm looking for suggestions which are flexible enough to accomodate unforseen changes in security, but simple enough to be implemented in a single class (or a single method).

To kick this off here's my current solution (somewhat described above)
if (!is_array($this->_validation))
throw new Exception("Unable to validate data bad validation hash found");

$result = array();
foreach ($arguments as $key => $value)
{
$pattern = $this->_validation[$key];
if ($pattern == null)
throw new Exception("The submitted data has no corresponding pattern and can not be evaluated");
if (!preg_match($pattern, $value))
throw new Exception("The submitted data was invalid");
$result[$key] = $value;
}
return $result;

IP Filtering By Country
Does anyone know of some good ways to filter traffic by country?

I can only monetize US, UK, and Canada traffic, but must send them to a different thing for each country.

All other countries I would like to send somewhere else.

Filtering XML Results
I'm in the process of creating a page that displays multiple lines of inventory for a bunch of products (let's call them 'widgets'). The widgets are listed in XML format (they'll end up being pulled from a MySQL DB eventually). Code:

Filtering Of Characters
Does filtering of certain characters make a search engine more efficient?

Speical characters such as ~!@#$%^&*()_+

Error Filtering Bad Language
I have a dynamic shout box service, and I need to filter bad language, so i wrote a function on how it should work. PHP Code:

Filtering Out Keywords In A Search!
I have about 1100 movie titles in a database. I am trying to do a simple search engine and have seperated each keyword using the following code:

$q = $_GET['q'];
if ($q) {
$q = strtolower($q);
$k = split(" ", $q);
$num_keywords = count($k);
for ($i=0; $i<$num_keywords; $i++) {
if ($i) {
$search_string .= "OR moviename LIKE '%" . $k[$i] . "%' "; }
else {
$search_string .= "moviename LIKE '%" . $k[$i] . "%' "; }
} end for
$and .= "WHERE ($search_string) ";
} //end if

$querycount = "SELECT * FROM titles $and";

rest of code...
This works ok, but if I type something in like 'The Killer' it fetches everything with the word 'the' as well.

I have put the words into an array that I want to filter out.

$skipwords = array("the", "of", "and"); etc

Can I use that to filter out the words? I`ve been playing around with the in_array() function, but can`t seem to get it to work like I want it to.

Audio Filtering Via PHP, Program
I have been tasked with trying to find a way to complete this
project... I'm not sure if it is possible, but hopefully you guys can
provide some insight...

I need to create a web application that will allow a visitor to record
their voice into an audio file, then apply different filters/effects
to it (like robot, lady, etc.), and send it to a friend. I haven't the
slightest clue where to begin on doing something such as this. I
searched google for a similar functionality, and have come up empty
handed. Has anyone seen anything like this done, or an application
that would do something like this, PHP or otherwise?

Filtering A Db With A Start And End Date
I have a MySQL table with a datetime field. I need to make a PHP script that will take all rows whose datetime field falls within that of a user-specified begin and end time. Anyone have a code snippet to do that?

DVD Id Is Incorrect After Filtering Results
I am making a basic DVD shop and after having produced code which displays a
list of DVDs from my database, I implemented a search facility which enables
the user to search by title, director or actor.

The user can also browse the DVDs by genre. However, when the DVDs are
filtered, the id that is used to select a DVD and add it to the basket is
incorrect as they are output in a sequential manner and so the DVD placed
into the basket will be that matching the id. Here is the loop that outputs
the DVDs (I have a DVDID field as you probably have guessed):

if (mysql_num_rows ($getdvds_query))
{
for ($id = 0; $dvd[] = mysql_fetch_assoc ($getdvds_query); $id++)
{
echo "<tr>
";
echo "<td>{$dvd[$id][title]}</td>
";
echo "<td>{$dvd[$id][duration]}</td>
";
echo "<td>{$dvd[$id][rel]}</td>
";
echo "<td>{$dvd[$id][descr]}</td>
";
echo "<td>{$dvd[$id][genre]}</td>
";
echo "<td>{$dvd[$id][stock]}</td>
";
echo "<td>{$dvd[$id][price]}</td>
";

echo "<td><a href="$PHP_SELF?add=$id">add to basket</a></td>";
echo "</tr>
";
}
}

Here is the code that adds to the basket variable:

if (isset ($_GET['add']))
$_SESSION['trolley'][] = $_GET['add'];
else if ($_GET['op'] === 'clear')
$_SESSION['trolley'] = "";

HTTP Filtering With PHP & Apache ?
I am looking for a full example how I can achieve an http output
filtering with php on an apache 2 server. I found some hints that the
apache server supports to isntall and conifugrate such filters
http://httpd.apache.org/docs/2.0/mo...addoutputfilter
But I didn't found an example which is related to PHP.

I like to achieve for my shop using a template mechanism based on xml &
xsl with PHP. My idea is currently to use an output filter which does
the xsl transformation.
If anybody knows a tutorial or even some applicable frameworks in this
area please post me here the links.

User Input Filtering
I have a comments system. In this comment system, people can enter certain strings, and it will break my page layout. Such as repeated characters with no spaces. It will just blow the table way out of proportion and completely ruin my layout. How can I break their input up if such a thing happens? Also, how can you number an array of data that is being withdrawn from the database DESC? Such as..

Quote1. itemnumber1
2. itemnumber2
3. itemnumber3
4. itemnumber4

Filtering Results With Php Query
This code works, but I don't know how to filter the results to where only one person is displayed..it displays all records with similar address or state or city, I would like to know how to make it display only one person when multiple search fields are entered.

I'm using PHP5, and I have searched the forums but I'm not sure exactly if I found what I'm looking for...I don't know much about php or mysql. Code:

Filtering Message From The Database
i have a page where people can send in MMS pictures and they get uploaded and displayed on my page, they need to type a keyword in the MMS like "sendmms" to make it work. if they also write "sendmms hey look at me" it also works since "sendmms" was at the beginning of the message and "sendmms hey look at me" get's added to the row "message" in my database. the pictures get an ID in the database and saved with the same ID on the server.

so under each picture sent in i wanted to add the comment they added after the "senmms" part.

so in short, how do i make it filter out "sendmms" and only display "hey look at me" ? and if the Page ID is let's say 13 it should display the "messsage" column for the ID in the database that has the same ID as the page ID is.

Filtering User Input...
I want to take text that a user inputs and store it into a variable.  That's the easy part.
I have and array of 30 elements that I want to store the inputted text into.

So.. here's an example...
- I want a user to enter text.
- I'll store it into a variable like $inputText.
- I want to split the text from $inputText into 30 equal sections and store each section into an element in the variable.
- I don't care if the words get separated during the filter, as long as the whitespaces stay where they are.

Could anyone give me some tips to help me get started or point me towards a tutorial or something?

Filtering Results By DATE Value In Database
I have this code in my page for displaying some data from a database, sorted by date. i had posted a messed up version of this a while ago but I couldnt get it working even after a few suggestions. PHP Code:

Filtering A Recordset With A Session Variable
I have two forms, the Form1 and the Form2. One of the answers in the Form1 is saved in a session variable SesVar1.

In the Form2 there is a dynamic table build with a recordset. I need to filter the recordset of the Form2 with SesVar1.

I tryied to do this using a variable in the recordset window of dreamweaver, writing #SesVar1# in the run-time value of the variables for the recordset, but it didn't work.

Please HELP me out with this one. How can I filter that recordset using the value of a session variable? or the Form1's answer?

Image File Upload Filtering
I have made a file uploader,

I also made a filter, I can't make a good filter for jpeg files, but i can filter gif, can you advice, thanks

if ($_FILES["file".]["type"] == "image/gif")
bla bla bla

Filtering Selection In Multiple Drop Down Boxes
I want to allow a user to conduct a search on a database using multiple drop down boxes.
On the first page they will have a drop box filled with records from field A. Once they select which one they want, a second drop down box will then appear with records from field B which are present for field A (a filter).

What I want though is that the first dwon down box still appears on the second page, but shows the record that the user selected. What is happening now is that when the second page comes up, the first box shows the default selection rather than the selection that the user chose. My code for the drop down boxes is: PHP Code:

Filtering The Elements Of A Multi-dimensional Array
I would like to be able to filter every element of a multi-dimensional array
using htmlspecialchars() and to retain the structure of the array. I can't
see how to do this when I don't know how many dimensions the array has.

Dynamic Recursive/nested Foreach (part Deux) With Filtering
I originally wanted to figure a method to better implement a nested foreach to calculate all the permutations held within an array. After posting the topic and getting great responses an elegant solution was found. I then increased the difficulty by requesting that we also include a method to "filter" or "skip" certain values during permutation calculation. The original solution finder quickly came back with yet another code snippet listed below which acomplished the request...it was mere childs play it seems for them (sasa). I marked the topic solved as the original question had been solved.

I am creating this new thread as I am once again adding an additional layer of difficulty. The final previous solution is listed first as a reference, followed by the new and more complex problem underneath that one. My attempts to shunt in the functionality have all failed I think due to the recursive nature...any takers? Code:

How To Add Content By Url?
Anyone know an easy way to include content on a page by a field in the url? I am assuming this probably easy but I cant figure it out.

What I am trying to do is take a url like:
http://www.domain.com/dir/ag=default&display=widget
and make "widget" display on my page.

Get Content Of URL After #
A simple question:

If my PHP page is referenced thus: foo.php#bar

....what's the best way of getting the contents of the URL
after the hash - as a string ("bar")?

Should I get the URL, look for the "#" and then use
substring()?

I'd prefer something like:

$H = $_GET['#']; // reaching...

No Content Appear On WS
Ever had problem of contents or images that does not appear
[Unix/linux/PHP] ?

I developped a website with a team where now we have these problems :

1. Placing the site under the Browser Home-Page : 15% of the times the
page does not appear.

2. Placing the site under the Browser Home-Page : 15% of the times the
images do not appear.

3. Navigating through the website : 17% of the times there is a blanck
page.

Tested under different browsers, ISP, computers.
We have this problem for all sites hosted on the same server. All our
web-sites are unusable, non-operating due to this problem.

{content}
Ii am using an open source
site to learn the language.

<div id="maincol" >
<div class="content">
<!-- OR files go here -->
{content}
</div>

Obviously {content} contains the text on the body of the page...where is
this content usually?

Php Content Filter
I have made this script to filter content based on the given url.

i need to make all the links on the page go through this script, so i added an str_replace and its not working, the links don't get modified.

Dynamic Content In A <div>, Using Php
i have a <DIV> block, and I want the innerHTML to change at the click of a button. for those who don't know some javascript, if you have a dive with an id, <DIV id="myDiv"></DIV> you can change the content inside with a function call

myDiv.innerHTML = "some stuff";

however, i need my data to come from a mySQL database and thus needs to be outputted via php. so ideally i want something like

myDiv.innerHTML = "<?php echo "some stuff"; ?>";

of course that does not work because php is not client side, this is just to illustrate what i want. any ideas on how to do this without iframes?

Content Management
I've been looking a bit at PHP-based Content Management Solutions (CMS), including Midgard, PHPNuke, etc.

Has anyone dealt with these, and what do you find better in re. functionality, implementation, ect.?

We have a situation where we would have only about 4-5 content editors, with tasks like updating job postings, occasionally editing product info, adding new press releases, etc. Nothing terribly advanced.

Content Management
Does any one know a good content managment script written in PHP that would allow users to submit content like articles news and even blogs to my web site via remote computers through a web browser?

It would have to be user friendly (the users may not now how to code) and include imput areas for content such as:

Article Title:
Authors Name:
Article content:
Image:

It would also have to be be customisable on my own templates.

Gzipped Content
How can I differentiate between regular content and gzipped content on
websites? Are there any other kinds of contents I should refer to? (I'm talking
about websites-not applications).

Content Managment
I am creating a site which it's design has in it a constant header troughout the site now in this header I have a set of links. To make this header I am using a table so the site looks something like this (imagine this is a web page please)

header text (header cell)

link1 - link2 - link3 - link4 etc etc etc (links cell)

contents contents contents contents contents contents
contents contents contents contents contents contents
contents contents contents contents (contents cell)

is it possible by any way that by clicking any of the links the contents in the contents cell change keeping the 2 top cells? what I want to do is create 1 page with the header and all the linked pages contain only the content related with that link without creating a header for each page.

Rotating Content From Db?
I am using php & sql to display an image and information on a home page. I would like for this image and information to rotate every 5 or 6 seconds, using a different record in teh database. Right now, I am calling a record using RAND() LIMIT 1. I assume this will take two steps:

1. changing my query to build an array with the results

2. Using some sort of script to refresh this object on the page after so many seconds and move to the next record in the array.

Template Into Content
I've cleaned a whole site of 1995-era html into xhtml, but now would like to strip all its 'excess' (headers, footers, ad and spacer columns, etc) away to insert it into a php template. The thing is, I don't want to disturb the existing site map.

Would it be possible to designate a page's 'stripped content' as a variable, and call a (say, three column) template containing that variable -or in other words, have a page's content written into a called template - on the same page?

Controlling Content
I want to control the content that displays on certain days and times.. so example on monday-friday between 7 am and 10 am I want certain content displayed.. but later that day between 5 pm and 8 pm i want other content displayed.. and on weeekends between 7 am and 10 am i want to display different content than on m-f.. I know I need to probably use date() but I dont know how to specify the if statements.

Mail Content.
I have a problem on how to send an e-mail to a user to provide their login details. The users can have 2 different level of access so if they are registered once for each level i want to e-mail them the login details for both accounts. PHP Code:

Hiding The Content Of A Url
Does somebody know how to hide the information that's passed in a Url please? So instead of: http://www.whatever.com/newthread.php?action=newthread&forumid=4

the url will state only: http://www.whatever.com

...and the other vaiables will still be passed, except that they can't be seen by the user. Hidden fields I know of already, but these still show the variables and their values when the user 'views source'. Putting variables in the form action I know of already, but this doesn't solve the problem for links.

Content Retrieval
Can somebody tell me somthing about content retrieval? I would like to grab same text from one site and then print it on my site. How it's done?

Content Filter...
Would it be possible to make a PHP script that actted as a simple proxy server? I want to build a script that IE uses as a proxy, then i want to check the page for bad words and if its okay display it.

Content Management
I am trying to create a content managment system for my news section. Basically I just want a simple way to add new stories, then have older stories move down the page, and after a set amount of new stories are ahead of it move to another page, which will be linked in "<<prev 1 2 3 4 next>>" dynamically as new stories are added. Kinda like a blog but much much more simple.

I really have no idea where to start. I know some php, but mostly just what i pick up from this forum (thanks)and tutorials. If someone could point me in the right direction, or enlighten me on where to start, suggest a good tutorial, suggest another way to go about this, etc.. Any info at all would really be great.

Featured Content
i was wondering how i would be able to add a 'Featured Content' or random content like on some websites it has a random book and each time you refresh its a different book?

Cut The Content From A String
How can I cut the content from a string everything before the first space?

CMS With Content Types?
I'm looking for an open-source CMS which has the concept of
customizable content types and categories. It ideally needs to run on
a LAMP platform.

To give a specific example, part of the site I want to build will have
a discography for a recording artist so I'd like to be able to create
a "recording" content type which would have fields such as artist,
title, label etc etc. I'd then like to be able to build lists of this
content type using CMS functionality, eg: in portlets.

I've looked at opensourcecms.com and cmsmatrix.org but neither make it
very easy to work out whether a CMS has this sort of functionality...

Web Content Fetching
I have read the forum rules and checked out the sites listed as having possable answers to my problem but no luck. Here is my problem at the moment.

I have a php script that allows me to place information into an image, All in the hope of creating a site that grab content from another site and display it in the image in the form of a forum signature.

I have checked out a few web content fetching scripts but they dont seem to give me quite that I need. So basicley this is what I am hopeing to acheve.

1) A script that can fetch certain words from another site e.g. "Username: Dreg" I would like to fetch the word "Dreg"
2) I would like to be able to get the username and turn it into the value $user
3) I would then like to be able to use that value anywhere on my site.

If this is not possable then thanks for your time!


Copyright © 2005-08 www.BigResource.com, All rights reserved