Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 11 of 11
  1. #1
    Senior Coder
    Join Date
    Jun 2008
    Location
    Cornwall
    Posts
    2,088
    Thanks
    296
    Thanked 12 Times in 12 Posts

    Exclamation is it possible to link some buttons to my data?

    Hi Guys n Girls,

    sorry the title isn't very descriptive, but im not sure how to describe this

    i am displaying several rss feeds on my test page
    here

    and i have added a button to each item, my question is can i make the button pass on the individual item name to another page using php or will i have to add all this info into a database? and then pull out the data from that... if so how do i go about updating the database data would i simply overwrite the current data each time the page is loaded? or some how do it every hour?

    any help would be appreciated

    many thanks
    Luke
    Last edited by LJackson; 05-05-2009 at 12:32 PM.

  • #2
    New to the CF scene
    Join Date
    May 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Can you please post the script you are using to display the data on the page.

  • #3
    Senior Coder
    Join Date
    Jun 2008
    Location
    Cornwall
    Posts
    2,088
    Thanks
    296
    Thanked 12 Times in 12 Posts
    yeah sure mate.

    PHP Code:
    <div id='header'>
        <div id='logo'>
        <h1>
        <a href="index.php" target="_self">
        <img src='images/logo/thelogo2.png' 
        title="Kernow Connect - 
        Online Shopping &amp; Price Comparision - For the smarter shopper" 
        alt="Kernow Connect - 
        Online Shopping &amp; Price Comparision - For the smarter shopper"
        border='0' /></a></h1>
    </div>

    <div class="slogantext">
    <h1>Online Shopping And Price Comparison</h1>
    </div>

    </div>

    <div id="wrapper">
      
    <div id="navlink">
        
        <div class='link'>
        <img src="images/links/entertainmentlink.png" />
        </div>
        <div class='link'>
        <img src="images/links/computinglink.png" />
        </div>
        <div class='link'>
        <img src="images/links/electronicstlink.png" />
        </div>
        <div class='link'>
        <img src="images/links/clothinglink.png" />
        </div>
        <div class='link'>
        <img src="images/links/misclink.png" />
        </div>
        
    </div>

    <div class="category_name"><h1>DVD</h1></div>
    <div class="catsections">
    <div class="cattop">
    <div class="cattop_header">Kernow Connect Pick Of The Week</div>
    <div class="cattop_item"></div>
    <div class="cattop_desc"></div>
    </div>
    <div class="top5">
    <div class="catheader_top"><img src="images/catdesc.jpg" /></div>
    <?php
    $count 
    2;
    $xml simplexml_load_file("http://www.amazon.co.uk/rss/bestsellers/dvd/ref=pd_nr_rss_link");
    foreach (
    $xml->channel->item as $item) {
    $title get_string_between($item->title':','[');
    $photosource get_string_between($item->description'<img src="','"');
        if(
    $count >= 0){
         echo
    "
         <div class='individual5'>
         <img src='$photosource' width='100' border='0' hspace='0' vspace='0' alt='$title' title='$title'/>
         </div>
         
         <div class='individual5info'>
         <div class='individualitem'>
         <h2>$title</h2>
         </div>
         <div class='individualcompare'><img src='images/compare.gif' alt='Compare Prices For $title' title='Compare Prices For $title'/></div>
         </div>"
    ;
         
    $count--;
         
         }
         }
         
    ?>
    </div></div>
    that is for one of the sections the rest of the code is the same but with different urls being loaded.

    cheers

  • #4
    New to the CF scene
    Join Date
    May 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    To be honest if this was me and its just me, i would rather dump all that rss data in to a MySQL database. When you are setting up the database make sure you have a primary key as this will allow you to have an ID for each row in the DB, then pull the data from the Database and make the unique primary key the link to more description and so on. This probably doesnt come across to clear. If not let me know and ill re word it.

  • #5
    Senior Coder
    Join Date
    Jun 2008
    Location
    Cornwall
    Posts
    2,088
    Thanks
    296
    Thanked 12 Times in 12 Posts
    hi mate i totally agree,

    i have been working on setting this up but am not getting anywhere fast
    im rally confusing myself and making things much harder than they need to be.

    i have 15 feeds on the page which i need to pull out the first 3 items and add them to the database,

    so i am setting up and array which contains all the feeds to pull the data out of (does that sound ok?) and then at the moment im trying to display the 3 top items from each feed on the php page just to see if its working but its not

    here is my code
    PHP Code:
        $feeds = array("http://www.amazon.co.uk/rss/bestsellers/dvd/ref=pd_nr_rss_link","http://www.amazon.co.uk/rss/new-releases/dvd/ref=pd_nr_rss_link","http://www.amazon.co.uk/rss/most-gifted/dvd/ref=pd_mg_rss_link");
        
        foreach(
    $feeds){
        
        
    $count 2;
          
    $feedreader simplexml_load_file
        
    ("$feeds");
        foreach (
    $feedreader->channel->item as $item) {
        
    $photosource get_string_between($item->description'<img src="','"');

        if(
    $count >= 0){
        echo
    "$item->title <br> $photosource<p> ";
        
    $count --;
        }
        }
        
        
    ?> 
    cheers

  • #6
    Senior Coder
    Join Date
    Jun 2008
    Location
    Cornwall
    Posts
    2,088
    Thanks
    296
    Thanked 12 Times in 12 Posts
    ok i have managed to get the top 3 items from the feeds as so

    PHP Code:
        $feeds = array("http://www.amazon.co.uk/rss/bestsellers/dvd/ref=pd_nr_rss_link","http://www.amazon.co.uk/rss/new-releases/dvd/ref=pd_nr_rss_link","http://www.amazon.co.uk/rss/most-gifted/dvd/ref=pd_mg_rss_link");
        
        foreach (
    $feeds as $feed){
        
        
    $count 2;
          
    $feedreader simplexml_load_file
        
    ("$feed");
        foreach (
    $feedreader->channel->item as $item) {
        
    $photosource get_string_between($item->description'<img src="','"');

        if(
    $count >= 0){
        echo
    "$item->title <br> $photosource<p> ";
        
    $count --;
        }
        }
        }
        
    ?> 
    next step would be to add the data into the database?

    "thinking aloud" how do i add more data to the array because i currently dont know which feeds these are for e.g dvd, cd etc nor do i know if they are for the recommended, newreleases, or mostgifted? this would need to be entered into the database to so that i can display the correct info in the correct place. how could i do this?

    thanks for your help
    Luke

  • #7
    New to the CF scene
    Join Date
    May 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Ok just one thing i want to clear up, are you creating a site based on amazons results or building a site based on your own site results. As this will determine where to go from here.

  • #8
    Senior Coder
    Join Date
    Jun 2008
    Location
    Cornwall
    Posts
    2,088
    Thanks
    296
    Thanked 12 Times in 12 Posts
    it will be based on my own results, im going to compare prices from several stores including amazon.

    i want the item name to be passed to another page where i can have the php to find all items in a database which are like the item clicked on.

    the amazon feeds are just being used to display top items from several categorys and as they update hourly i thought it was the best solution

    hope this helps
    Luke

  • #9
    Senior Coder
    Join Date
    Jun 2008
    Location
    Cornwall
    Posts
    2,088
    Thanks
    296
    Thanked 12 Times in 12 Posts
    also i will soon have access to a database containing all the products from the most of the stores i want to compare which will save me a lot of work which is always a good thing...

  • #10
    New to the CF scene
    Join Date
    May 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    To be honest i would have to say put your efforts in to the database version of your application because i just think that it is going to get very ver messy with all those rss feeds coming in and i have to say i dont like them, if you want to pm me and maybe i can give you a hand with the databse version of your app, more than willing to help but at the moment i dont think that the rss feeds alone will give you good results on your pages. But thatsa just my opinion.

  • #11
    Senior Coder
    Join Date
    Jun 2008
    Location
    Cornwall
    Posts
    2,088
    Thanks
    296
    Thanked 12 Times in 12 Posts
    ok thanks mate i have PM'd you

    cheers
    Luke


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •