Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

1 Neutral

About gerkintrigg

  • Rank
  • Birthday 05/18/1980

Contact Methods

  • Website URL

Profile Information

  • Gender
  • Location
    Bristol, UK
  • Age
  1. Thanks for the very comprehensive reply. I've tried your code and seem to be getting a problem with this line: $pdo = new pdo("mysql:host=$DB_HOST;dbname=$DB_NAME;charset=$DB_ENCODING",$DB_USER,$DB_PASS);
  2. Oh my oh my. The mysqli protocols confuse me. I know php4 inside out but I’ve been out of the game for many years and need to work out how the hell mysqli works. All I need is a simple syntax to grab a record from a table and output it using an echo command. Can anyone help me? All the websites I’ve visited seem to get too deep into it too quickly and I end up getting lost.
  3. It seems so many of these topics cross over, so I hope it's in the right place. I've got a site using minicart.js to add things to the shopping cart. I love the way it works so-far, but I want to now output it using PHP variables so I can link it to PayPal. All I want is a dump into a PHP script. I don't care how, particularly... ideally an array of some kind with item ID and quantity... but anything. Once it's in PHP, I'm good... I can do the rest, but I'm a ludite with Javascript. Please help.
  4. Hi, I've tried to program a shopping cart App and it works fine on my Mac and my Android Phone, but on the IPad, it's not adding the items to the shopping cart. I've used a free template that does most of the hard work for me, but used some database stuff to get the shop actually listing stuff. My URL is: http://www.bristolmagicshop.com/single.php?id=14 So-far, so-good, but the iPad issue is starting to bug me now. Any suggestions? Neil
  5. I hope this is in the right place, if not, please redirect. Since Google's update to rank mobile-friendly sites higher than mere mortals, I made a website to accomodate the new rules. It's acting weird though. Google are indexing everything correct for the homepage, but the URL they've got is for a random blog article I wrote. I have no clue why these are being mixed. The Javascript screen resolution redirect is working fine and doesn't take me to that article. There are no htaccess issues and the php scripts work fine for everything I test on. Do we know about any issues that might cause this? Neil
  6. No offence taken... It's not my script. I just changed it. Was RSS around 12+ years ago? The error is found with the output: error on line 42 at column 8: Encoding error But this is found at: http://www.tingifts.co.uk/RSS/blog_feed.xml
  7. Hi everyone. I'm not too up on XML (shame on me!) I've written the following class, but it keeps getting an encoding error... I know the other elements of the procedure (the other scripts) are right... or at least I think they are. I've narrowed the issue down to somewhere in this script (probably the first few lines) Can anyone help? I'm lost! Thanks, Neil <?php class RSSFeed { // VARIABLES // channel vars var $channel_url; var $channel_title; var $channel_description; var $channel_lang; var $channel_copyright; var $channel_date; var $channel_creator; var $channel_subject; // image var $image_url; // items var $items = array(); var $nritems; // FUNCTIONS // constructor function RSSFeed() { $this->nritems=0; $this->channel_url=''; $this->channel_title=''; $this->channel_description=''; $this->channel_lang=''; $this->channel_copyright=''; $this->channel_date=''; $this->channel_creator=''; $this->channel_subject=''; $this->image_url=''; } // set channel vars function SetChannel($url, $title, $description, $lang, $copyright, $creator, $subject) { $this->channel_url=$url; $this->channel_title=$title; $this->channel_description=$description; $this->channel_lang=$lang; $this->channel_copyright=$copyright; $this->channel_date=date("Y-m-d").'T'.date("H:i:s").'+01:00'; $this->channel_creator=$creator; $this->channel_subject=$subject; } // set image function SetImage($url) { $this->image_url=$url; } // set item function SetItem($url, $title, $description) { $this->items[$this->nritems]['url']=$url; $this->items[$this->nritems]['title']=$title; $this->items[$this->nritems]['description']=$description; $this->nritems++; } // output feed function Output() { $output .= '<?xml version="1.0" encoding="UTF-8" ?>'."\n"; $output .='<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" version="2.0">'."\n"; $output .= '<channel>'."\n"; # rdf:about="'.$this->channel_url.'">'."\n"; $output .= '<title>'.$this->channel_title.'</title>'."\n"; $output .= '<atom:link href="http://www.tingifts.co.uk/blog/" rel="self" type="application/rss+xml"/>'."\n"; $output .= '<link>'.$this->channel_url.'</link>'."\n"; $output .= '<description>'.$this->channel_description.'</description>'."\n"; $output .= '<lastBuildDate>'.$this->channel_date.'</lastBuildDate>'."\n"; $output .= '<language>'.$this->channel_lang.'</language>'."\n"; $output .= '<sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency>'."\n"; $output .= '<generator>http://www.tingifts.co.uk</generator>'."\n"; $output .= '<item>'."\n"; for($k=0; $k<$this->nritems; $k++) { $output .= '<title>'.$this->items[$k]['title'].'</title>'."\n"; $output .= '<link>'.$this->items[$k]['url'].'</link>'."\n"; $output .= '<image>'."\n"; $output .= ' <url>'.$this->image_url.'</url>'."\n"; $output .= ' <title>'.$this->items[$k]['title'].'</title>'."\n"; $output .= ' <link>'.$this->items[$k]['url'].'</link>'."\n"; $output .= '</image>'; $output .= '<description>'.$this->items[$k]['description'].'</description>'."\n"; }; $output .= '</item>'."\n"; $output .= '</channel>'."\n"; $output .= '</rss>'."\n"; return $output; } }; ?>
  • 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.