Jump to content
iwato

Using <![CDATA[...]]> in an RSS Feed to Send a $_GET or $_POST Variable

Recommended Posts

OJBECTIVE:  My goal is to send a $_GET or $_POST variable from an RSS feed when the user clicks on a link housed within the <description> subelement of an <item> tag.  The data from the superglobal will be used to display content on a host webpage designed as an index for all <item>s hosted within the same and ultimately other channels.

CODE SAMPLE:

<item>
  .
  .
	<description>Grammar Captive Free Weekly Podcasts: <![CDATA[<a href='http://www.grammarcaptive.com/podcasting/podcasts.php?episode_no=003' title='Episode Title' target='_self'>Episode No. 003</a>]]></description>
  .
  .
</item>

QUESTION:  Will by placing the link with the intended address and appended http request code into a CDATA tag allow users to send the desire episode number to the designated PHP page for processing.

ADVANCED STRATEGY:  If the above is possible, do you have any suggestions in regard to the best way for the receiving PHP page to call up the material relevant to the designated episode?  For example, I am contemplating the use of a SWITCH statement that would route the incoming episode number to a block of PHP or Javascript code that would insert the contents of another webpage, whose URL is the episode number of the incoming HTTP_REQUEST, and whose content is dedicated to the episode corresponding to the incoming episode number, into another webpage (likely the same page that contains the SWITCH statement) that serves as an index for all completed and upcoming episodes.

Roddy

Share this post


Link to post
Share on other sites

The RSS item has a <link> field specifically for the URL of the resource you're sharing. An RSS reader may not necessarily parse HTML, so you should make use of the proper RSS fields.

You can't send POST variables from RSS, but a link can contain a query string from which PHP can create $_GET variables.

 

  • Like 1

Share this post


Link to post
Share on other sites

OK.  As always -- well, almost always -- you make good sense, and I like it.  

Is the $_GET variable not automatically created when a query string is sent, though?  

PHP is simply used to process the data that the variable contains.  Or, have I misunderstood.

Now, to the further strategy.  The model that I want to use is the one that you taught me when I wanted to view the PHP source code of one page by clicking on a link contained in another page.  In other words, click on a link on one page, send a query to another page, receive the query, make a choice with a SWITCH statement and display the desired page of code in the same window that was once filled with PHP code containing the SWITCH page .  This time, however, rather than displaying PHP code I want to display the contents of an HTML page.

Where I am unclear is how best to display the contents of the HTML document as content in another HTML page.  The destination for the content is the main section of the following page http://www.grammarcaptive.com/podcast_dev_copy.html.  Now, I have filled such space in the past by a variety of means including:

1) Hiding content already on the page and then making it appear.

2) Replacing it with a portion of another page that I have fetched with the Javascript .load( ) method.

3) Replacing swapping the content of an iframe.  

Of these three approaches I prefer number two, because I fill the section with whatever I want. The problem, as I imagine it, occurs, when I try to automate the process.   Using an iframe would be easy, because the iframe would simply fill with the content generated from HTTP query.  But, the procedure would only work so long as the page that receives the query and the iframe itself were present when the query were made.  What would happen, if the page were filled with something else when the query is made.

Also  clicking on a link hosted on someone else's page would automatically force a new page to open.  I would not want my user to be opened to the same page twice.

Can you help me think this through.  Have a provided enough information?

Roddy

 

Share this post


Link to post
Share on other sites

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.   Paste as plain text instead

  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.

Loading...

×
×
  • Create New...