PHP - Meta Tags For Each Catagory In Php?
hello guys, i have a php website, which is: www.hireasunbed.co.uk
the middle is like an iframe but im wondering how can i get each catagory have diffrent meta keywords and descriptions. Is this possible? Similar TutorialsHow do you give pages that are generated using the _Get method it's own meta tags? Not sure if I'm explaining this properly so allow me to elaborate: When a visitor clicks on an article on my site, they get redirected to a new page (index.php?action=article1) within the original page (index.php). Now, since it's more or less the same page, the meta tags are the same, but I was wondering if there is a way I could make it to where each article has it's own unique tags so when a visitor, for instance, clicks "share on facebook", the title and description of that article appears. Does anyone know what I'm talking about? If so, is there a way to do this? Hello again:] I am wondering where should i put valid doctype <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> and meta tags <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> in a php file like this. Code: [Select] <?php session_start(); // Session starts here if(!isset($_SESSION['username'])) // If there is no session then... { die ("<div align='center'><img src='images/LOGINKITTEN.jpg'/><br /><a href='index.php'><img src='images/Login.jpg'/></a></div>"); // ...Die! } $id = $_GET['id']; ?> <html> <head> <link rel="stylesheet" type="text/css" href="jamcss.css" /> </head> <body> <img src="images/jamspace.jpg" /> <div id="jamcontainer"> <b><a href="main.php">Home</a> || <a href="members.php">Members</a> || <a href="jams.php">Jams</a> || <a href="uploadjamform.php">Upload Jam</a> || <a href="myprofile.php">My profile</a> || <a href="about.php">About</a> || <a href="adminindex.php">Moderators</a> || <a href="logout.php">Logout</a></b> You are logged in as <?php echo $_SESSION['username']; ?> <br /><br /> <?php $connection = mysql_connect("lol.com", "loldb", "lol00") or die ("Could not connect"); mysql_select_db("loldb", $connection) or die("Could not connect"); // mysql query to get the username $query = mysql_query("SELECT * FROM news ORDER BY id DESC"); $numrows = mysql_num_rows($query); if ($numrows!=0) { // fetching data from the database to variable while ($row = mysql_fetch_assoc($query)) { $title = $row['title']; $post_owner = $row['post_owner']; $post = $row['post']; echo "<b>" . $title . "</b><br />"; echo "Posted by <b>" . $post_owner . "</b><br /><br />"; echo $post . "<hr></hr><br /><br />"; } } ?> </div> </body> </html> Hi there. Having a little trouble getting Open Graph working with my facebook like button. I can put text in fine but I want the following variables to be represented in the head information so that I can edit the head data periodically. Would appreciate any help. I've tried "<?php echo $blahblah ?>" which doesn't seem to work. Confirmed that nothing was being pulled by Facebook's linter... Code: [Select] //Variable for Head. $id = '1'; $promo_id = $id; //Change this to be variable with function... $promo_title = "Goody Bag"; $promo_text = cms::string('copy.goody_bag.sub_title'); $promo_image = "/assets/images/goody_bag/goody_bag_small_bg.png";//Change this to be variable with function... $promo_description = cms::string('copy.goody_bag.text'); //These are to be put into the head information but will need to be made variable using either the controller or the iframe.php ?> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:og="http://opengraphprotocol.org/schema/" xmlns:fb="http://www.facebook.com/2008/fbml"> <head> <title></title> <meta property="og:title" content="Goody Bag"/> <meta property="og:type" content="website"/> <meta property="og:url" content="http://apps.facebook.com/ztoa_dev/like/show_like/1"/> <meta property="og:image" content="http://apps.facebook.com/ztoa_dev/assets/images/goody_bag/goody_bag_small_bg.png?2"/> <meta property="og:site_name" content="Z to A by Sunsilk"/> <meta property="fb:admins" content=""/> <meta property="og:description" content="Blah Blah Blah"/> </head> hi everyone, did not know what to make the subject, but here is what I want to do: I have a string, which gets returned to me from a linux app on my server, it looks something like this: Code: [Select] <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8"> <TITLE> </TITLE> <META NAME="GENERATOR" CONTENT="OpenOffice.org 3.2 (Linux)"> <META NAME="AUTHOR" CONTENT="Administrator"> <META NAME="CREATED" CONTENT="20110106;14170000"> <META NAME="CHANGEDBY" CONTENT="HOD"> <META NAME="CHANGED" CONTENT="20110522;16540000"> <STYLE TYPE="text/css"> <!-- @page { margin: 0.26in } P { margin-bottom: 0.15in; direction: ltr; color: #000000; line-height: 0.15in; text-align: justify; widows: 2; orphans: 2 } P.western { font-family: "Arial", sans-serif; font-size: 10pt; so-language: en-US } P.cjk { font-family: "Batang", "바탕", serif; font-size: 10pt } P.ctl { font-family: "Times New Roman", serif; font-size: 10pt; so-language: ar-SA } A:link { color: #0000ff } --> </STYLE> </HEAD> <BODY LANG="en-US" TEXT="#000000" LINK="#0000ff" DIR="LTR" STYLE="border: 5.05pt double #000000; padding: 0.67in 0.92in"> <P>I want this and the tags around it, just not the html, head, body and their closing tags.</P> </BODY> </HTML> within the body, the tags are each styled for example: <p style="color: red"></p> so I cannot just get rid of all html, I want to get only all the content within the body tags, but without the body tags obviously strip_tags does not work as i need, I only want to strip certain tags. If someone can help me with this i will much appreciate it. I am asking out of curiosity, how does this problem usually get solved, when using a tag system to sort content, and users enter similar tags. For example: flower and flowers... which means the difference between singular and plural. Judging by other sites which are around, this problem is not solved at all, they simply let you add as many tags as you want and then rank the most used tags, it indeed is a solution, but seems more like a walk-around solution to me. Any ideas how somebody could approach to solve this one? EDIT: My suggestion would be an analysis function, which analyzes the entered tag and then suggests the user that similar tags have been already entered and perhaps he wants to choose one of those which have been already entered. This does work though with a high traffic websites what can happen is the following: php and php5 You can end up with two similar tags which are both widely used though have different meanings to the user base. This one could be solved by simply prohibiting similar tags with little additions or changes, and so to speak "forcing" the user to choose something which is already there. May be a way, though it can turn out as a bad solution as well. Do anyone know how i can put the html tags in the same line as the other html tags? Here's an example: Code: [Select] Images | Link | Delete | Enabled On my code, it break the tags to the new line without put on the same line as the other tags. Here's the code: Code: [Select] [code]<?php session_start(); define('DB_HOST', 'localhost'); define('DB_USER', 'myusername'); define('DB_PASSWORD', 'mypass'); define('DB_DATABASE', 'mydbtable'); $errmsg_arr = array(); $errflag = false; $link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD); if(!$link) { die('Failed to connect to server: ' . mysql_error()); } $db = mysql_select_db(DB_DATABASE); if(!$db) { die("Unable to select database"); } function clean($var){ return mysql_real_escape_string(strip_tags($var)); } $username = clean($_GET['user']); $password = clean($_GET['pass']); if($username == '') { $errmsg_arr[] = 'username ID missing'; $errflag = true; } if($password == '') { $errmsg_arr[] = 'PASSWORD ID missing'; $errflag = true; } if($errflag) { $_SESSION['ERRMSG_ARR'] = $errmsg_arr; echo implode('<br />',$errmsg_arr); } else { $qry="SELECT * FROM members WHERE username='$username' AND passwd='$password'"; $result=mysql_query($qry) or die('Error:<br />' . $qry . '<br />' . mysql_error()); if(mysql_num_rows($result) > 0) { $qrytable1="SELECT images, id, public FROM members WHERE username='$username'"; $result1=mysql_query($qrytable1) or die('Error:<br />' . $qry . '<br />' . mysql_error()); while ($row = mysql_fetch_array($result1)) { echo '<p id="images"> <a href="images.php?id='.$row['id'].'">Images</a></td> | <a href="http://' . $row["links"] . '">Link</a> </td> | <a href="delete.php?id='.$row['id'].'">Delete</a> </td> | <p> <p id="test">'.$row['Public'].'</td>''; } } } ?>[/code] Say I have the following text stored in a MySQL database... Code: [Select] <b>Classic Quote from movie</b> and I retrieve it into a variable called $text, how do I properly echo that so that it keeps the bold tags and actually display the text "Classic quote from movie" in BOLD? I'm doing something wrong somewhere along the line (simply doing "echo $text;") because it displays on the page as... Code: [Select] <b>Classic Quote from movie</b> Instead of... Classic Quote from movie Any info on properly storing and echoing back HTML would be very appreciated. I would like to be able to have my meta data pick out the information of a page and insert it into the meta tags. I have a controller class which has the coding to get the data, which is this: controller.class.php Code: [Select] function get_title(){ $title=''; if (isset($this->_params['item']['meta_title']) && !empty($this->_params['item']['meta_title'])){ $title=$this->_params['item']['meta_title']; } $title=strip_tags($title); $title=str_replace('"', '\'', $title); $title=trim($title); if (strlen($title)>150){ $end_of_last_sentence=strpos($title, '.', 150)+1; if ($end_of_last_sentence<150){ $end_of_last_sentence=150; } $title=substr($title, 0, $end_of_last_sentence); } return $title; } function get_description(){ $description=''; if (isset($this->_params['item']['meta_description']) && !empty($this->_params['item']['meta_description'])){ $description=$this->_params['item']['meta_description']; } $description=strip_tags($description); $description=str_replace('"', '\'', $description); $description=trim($description); if (strlen($description)>150){ $end_of_last_sentence=strpos($description, '.', 150)+1; if ($end_of_last_sentence<150){ $end_of_last_sentence=150; } $description=substr($description, 0, $end_of_last_sentence); } return $description; } function get_keywords(){ $keyword=''; if (isset($this->_params['item']['meta_keyword']) && !empty($this->_params['item']['meta_keyword'])){ $keyword=$this->_params['item']['meta_keyword']; } $keyword=strip_tags($keyword); $keyword=str_replace('"', '\'', $keyword); $keyword=trim($keyword); if (strlen($keyword)>150){ $end_of_last_sentence=strpos($keyword, '.', 150)+1; if ($end_of_last_sentence<150){ $end_of_last_sentence=150; } $keyword=substr($keyword, 0, $end_of_last_sentence); } return $keyword; } Then I have a pages.controller which has the coding for the home page pages.controller.php Code: [Select] public function home(){ //instantiate a model $galleries_model = new galleries_model('galleries'); $galleries = $galleries_model -> get_all(); foreach($galleries as $gallery){ //how to loop through an image so that only the first //image is selected $sql = "SELECT image_path FROM gallery_images WHERE gallery_id = {$gallery['id']} ORDER BY order_by"; $image = $this->_model->get_one($sql); $gallery['image'] = $image; $this->_params['list'][] = $gallery; } $this->_params['item'] = $this->_model->get(array("pages.name = 'home'")); } Code: [Select] galleries.controller.php public function galleries(){ $galleries = $this->_model->get_all(); $this->_params['list'] = $galleries; } public function view($gallery_id){ $this->_params['item'] = $this->_model->get($gallery_id); $this->_params['item'] ; //die; } This is my default page where I want the meta tags to echo out the relevent information default.php Code: [Select] !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title><?php echo $this->get_title(); ?></title> <meta name="Description" content="<?php echo $this->get_description(); ?>" /> <meta name="Keywords" content="<?php echo $this->get_keywords(); ?>" /> <title>Welcome to the Framework</title> <?php $this->_page->add_javascript('/vendor/lightbox/js/jquery.lightbox-0.5.min.js'); $this->_page->add_stylesheet('/vendor/lightbox/css/jquery.lightbox-0.5.css'); echo $this->page('stylesheets'); echo $this->page('javascripts'); ?> </head> <body> <h1> Welcome to the My site </h1> <?php echo $this->page('view');?> </body> </html> In the pages.controller.php I managed to get it to work using $this->_params['item'] = $this->_model->get(array("pages.name = 'home'")); I want to be able to do the same thing on different pages but I can't get it to work. I hope I explained it clearly. Thank you Hi I have the following code, this code is suppose to get the data from the galleries table and the pages table. I think my problem is the sql statement but I'm not sure. Code: [Select] public function galleries(){ foreach($this->_params['list'] as $gallery){ $id = $gallery['id']; $name = $gallery['name']; $select = "SELECT * FROM pages, galleries WHERE pages.name = {$gallery['name']}"; $this->_params['item'] = $this->_model->get(array("pages.name = 'galleries.name'")); } the code Code: [Select] $this->_params['item'] = $this->_model->get(array("pages.name = 'galleries.name'")); works just fine with the home page and all the other pages. I have 2 galleries called gallery 1 and gallery 2, now my problem is that I need the sql to go through the galleries table look for the name and then look through the pages table and get the meta data from the same name. There is no foreign id because I only need it for the galleries and nothing else. Thank you Hi there, Please forgive my ignorance as i am a noob. I have a website and the page title, keywords and description are taken from this .conf file: base = /home/websitem/public_html/worms/ url = http://www.websitemakeover.co.za/worms/ host = localhost user = websitem_worms pass = ***** data = websitem_worms subject = The Organic Grow Shop shop_email = do-not-reply@organicgrowshop.co.uk shop_name = The Organic Grow Shop domain = websitemakeover.co.uk admin_email = ron@rondarby.com subjectToClient = Your Purchase from The Organic Grow Shop subjectToAdmin = A purchase was made on the website pay_email = ron_1320155944_biz@rondarby.com pay_currency = GBP #pay_url = https://www.paypal.com/cgi-bin/webscr pay_url = https://www.sandbox.paypal.com/cgi-bin/webscr [home] title = Buy worm castings, perlite, vermiculite, clay pebbles keywords = Worm castings, perlite, guano, organic gardening, hydroponic growing media, soil mixes, plagron, bio bizz, all-mix, organic fertilisers, organic nutrients, hydroponics. description = We sell organic fertilisers, worm castings, guano, perlite, vermiculite, clay pebbles, soil enhancers and conditioners to make your own soil mixes [about] title = About Us keywords = Worm castings, perlite, guano, organic gardening, hydroponic growing media, soil mixes, plagron, bio bizz, all-mix, organic fertilisers, organic nutrients, hydroponics. description = We sell organic fertilisers, worm castings, guano, perlite, vermiculite, clay pebbles, soil enhancers and conditioners to make your own soil mixes [contact] title = Contact Us keywords = Worm castings, perlite, guano, organic gardening, hydroponic growing media, soil mixes, plagron, bio bizz, all-mix, organic fertilisers, organic nutrients, hydroponics. description = Contact The Organic Grow Shop here. An organic grow shop representative will be in touch shortly. [casting] title = Worm Castings - Buy worm castings, organic soil mix at The Organic Grow Shop. Made in the UK! Keywords = Worm castings, worm tea, worm poop for hydroponics, soil mixes, plagron bat mix, organic fertiliser, vermicompost, worm castings uk, organic soil mix cannabis, organic soil, worm cast, organic soil mix, soil mixes, organic soils, natural fertilisers. description = Worm castings - mmm, wormy goodness. We've teamed up with our local worm farm to bring your this fantastic 100% natural organic plant fertilser and soil conditioner to make your own soil mixes. [perlite] title = Perlite - Buy Perlite, Vermiculite. [cart] title = Shopping Basket [checkout] title = Details to Checkout [paypal] title = Redirect to PayPal I have tried editing it but the titles don't change?? Do i need to do something else to get this to change? Your help would be really appreciated, desperately need to get this sorted! Matt hi guys what is the difference between setting the php charset header, and setting the html meta charset? I am using a script that get the field names from a table in a database. It works, however, when I try to remove the underscore(_) from the name. I get an error message. Quote Parse error: syntax error, unexpected '=' in C:\xampp\htdocs\CMS\admin\includes\get_table.php on line 76 This is the section of code that I am using it with Code: [Select] $i = 2; while ($i < mysql_num_fields($fieldnamesquery_result)) { $meta = mysql_fetch_field($fieldnamesquery_result, $i); // This is the line of code that I am having problems with $meta.name = str_replace("_", " ", $meta.name); if (!$meta) { echo "No information available"; } $tablecolumn .= "<p>" . $meta->name . ":<input type='text' name='" . $meta->name . "' id='" . $meta->name . "'/></p>"; $i++; so i set names for every pages, like $pageName = 'home'; //index page Code: [Select] if($pageName == 'categories'){ $find = "Birds & Bees"; $result = strpos($title,$find); echo '1'; }else if($pageName == 'categories'){ $find1 = "Money & Honey"; $result = strpos($title,$find1); echo '2'; } now the issue is with categories.php page, which is just one page but displays different title and according to matching title i wish to change the description but its not happening, everywhere only 1 prints, why? Hi I am trying to pull title and meta description from an URL.. To pull the URL I am using the code from http://www.dreamincode.net/code/snippet4625.htm... function getTitle($Url){ $str = file_get_contents($Url); if(strlen($str)>0){ preg_match("/\<title\>(.*)\<\/title\>/",$str,$title); return $title[1]; } } //Example: echo getTitle("http://www.cnn.com"); And to pull the meta description I am using the code from http://php.net/manual/en/function.get-meta-tags.php. // Assuming the above tags are at www.example.com $tags = get_meta_tags('http://www.cnn.com/') or die("Could not fetch meta tags"); // Notice how the keys are all lowercase now, and // how . was replaced by _ in the key. echo $tags['author']; // name echo $tags['keywords']; // php documentation echo $tags['description']; // a php manual echo $tags['geo_position']; // 49.33;-86.59 So my complete code looks like this: <html> <head> </head> <body> <?php function getTitle($Url){ $str = file_get_contents($Url); if(strlen($str)>0){ preg_match("/\<title\>(.*)\<\/title\>/",$str,$title); return $title[1]; } } //Example: echo getTitle("http://www.cnn.com"); // Assuming the above tags are at www.example.com $tags = get_meta_tags('http://www.cnn.com/') or die("Could not fetch meta tags"); // Notice how the keys are all lowercase now, and // how . was replaced by _ in the key. echo $tags['author']; // name echo $tags['keywords']; // php documentation echo $tags['description']; // a php manual echo $tags['geo_position']; // 49.33;-86.59 ?> Test! </body> </html> But it wont work... All I get is "Could not fetch meta tags".. I've tried different URLs and such but still wont work .. Anyone have an idea? Ok so i'm not a programmer of any kind however I'm trying to enter what I believe is HTML generated metadata into the header.php of my wordpress theme here is how the wordpress header reads ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>> <head profile="http://gmpg.org/xfn/11"> <title><?php if ( is_single() ) { single_post_title(); } elseif ( is_home() || is_front_page() ) { bloginfo('name'); print ' | '; bloginfo('description'); get_page_number(); } elseif ( is_page() ) { single_post_title(''); } elseif ( is_search() ) { bloginfo('name'); print ' | Search results for ' . wp_specialchars($s); get_page_number(); } elseif ( is_404() ) { bloginfo('name'); print ' | Not Found'; } else { bloginfo('name'); wp_title('|'); get_page_number(); } ?></title> <meta http-equiv="content-type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" /> AND HERE IS WHAT I WANT TO PLACE I just don't know where I put it. It gives me Syntax errors when I paste just above the last title tag....does it need to be in php form and if so how do i change it? thanks for anyones help, sorry if this is a lame question but I've been slapping my head against a wall for 4 hours now Page: http://www.dylanpatrickarts.com/ <title>NYC Headshots, Lifestyle Portraits, Corporate, PR, Live Music</title> <meta name="description" content="Providing quality affordable NYC Headshots to the working actor, as well as Lifestyle Photography, Corporate Photography, Public Relations Photography, and much more! I strive to push my creative potential at all times, while having fun doing it!"> <meta name="keywords" content="photography,wedding photography,headshots,headshot,actors headshot,headshots nyc,nyc headshots,new york city headshot photography,headshot photographers in new york city,portraits,portrait,portrait photographer,hospitality photography,live music photography,public relations photography"> ==================================================================================================================== Page: http://www.dylanpatrickarts.com/galleries/headshots/ <title>NYC Headshots</title> <meta name="description" content="A collection of NYC Headshots for actors, dancers, and models"> <meta name="keywords" content="headshots,headshot,good headshots examples,actors headshots,actors headshot,headshots nyc,nyc headshots,new york city headshot photography,headshot photographers in new york city,new york headshots,actors,headshot photography,headshot photography in nyc,affordable headshots,affordable headshots nyc"> ==================================================================================================================== Page: http://www.dylanpatrickarts.com/galleries/ <title>Portfolio</title> <meta name="description" content="A collection of NYC Headshots, People Photography, Live Music Photography, Scenic Photography, and Public Relations Photography, as well as a gallery for you to buy prints!"> <meta name="keywords" content="headshots,actors headshots,actors headshot,headshots nyc,headshot photographers in nyc,portrait photography,abstract photography,scenic stock photography,live music photography,music photography,hospitality photography,hotel photography,public relations,cocktail photography,buy print photography"> ==================================================================================================================== Page: http://www.dylanpatrickarts.com/galleries/people/ <title>People</title> <meta name="description" content="A collection of Portraits, Candids, and Outtakes"> <meta name="keywords" content="people photography,people stock photography,black white photography of people,portrait photography,family portrait photography,headshots,headshot,actors headshot,actors headshots,photographers in new york city,new york city corporate photographer,headshot photographers in new york city,dylan,candids"> ==================================================================================================================== Page: http://www.dylanpatrickarts.com/galleries/live-music/ <title>Live Music</title> <meta name="description" content="A collection of Live Music work in NYC"> <meta name="keywords" content="music photography,photography,live music photography,live music nyc,new york city live rock music,bleecker street"> ==================================================================================================================== Page: http://www.dylanpatrickarts.com/galleries/pr-work/ <title>PR Work</title> <meta name="description" content="A collection of public relations and hospitality work. "> <meta name="keywords" content="public relations,public relations photography,hospitality,hospitality photography,cocktails,cocktail,dylan,bentley,clients,empire"> ==================================================================================================================== Page: http://www.dylanpatrickarts.com/galleries/tear-sheets/ <title>Tear Sheets</title> <meta name="description" content="A collection of published work"> <meta name="keywords" content="tear sheets,photography,actors headshots,actors headshot,headshot,headshots,headshots nyc,nyc headshots"> ==================================================================================================================== Page: http://www.dylanpatrickarts.com/galleries/scenic-artistic/ <title>Scenic & Artistic</title> <meta name="description" content="A collection of scenic and artistic work. Certain photos also available for purchase!"> <meta name="keywords" content="scenic stock photography,scenic photography,scenic photography for sale,abstract photography,artistic photography,hdr photography,hdr photography galleries,examples of hdr photography,scenic,new york city,new york city skyline,san francisco,idaho"> ==================================================================================================================== Page: http://www.dylanpatrickarts.com/galleries/buy-prints/ <title>Buy Prints</title> <meta name="description" content="A collection of available prints for purchase."> <meta name="keywords" content="web site shopping cart,shopping cart,buy photography,buy scenic photography"> ==================================================================================================================== Page: http://www.dylanpatrickarts.com/your-shoot/ <title>Your Shoot</title> <meta name="description" content="Details about your headshot session."> <meta name="keywords" content="headshots nyc,nyc headshots,headshots,headshot,actors headshots,actors headshot,information,clients,consultation,dylan,people,portfolio,testimonials"> ==================================================================================================================== Page: http://www.dylanpatrickarts.com/pricing/ <title>Pricing</title> <meta name="description" content="Pricing information for headshot sessions"> <meta name="keywords" content="headshot pricing,pricing information,nyc headshots,headshots,headshot,actors headshot,photography prices,digital photography prices,prices for photography,headshot photography prices,nyc headshot photography prices,wardrobe,session"> ==================================================================================================================== Page: http://www.dylanpatrickarts.com/testimonials/ <title>Testimonials</title> <meta name="description" content="Testimonials from some of my wonderful clients!"> <meta name="keywords" content="testimonials,testimonial,photographer testimonials,headshots,headshot,actors headshots,actors headshot,headshot photographers in nyc,headshot photography in nyc,nyc headshot photographers,headshots nyc,nyc headshots,photographer,dylan,amazing"> ==================================================================================================================== Page: http://www.dylanpatrickarts.com/resources/ <title>Resources</title> <meta name="description" content="A few links to photographers, and some cool places"> <meta name="keywords" content="photography links,headshots,headshot,actors headshot,actors headshots,headshot photographers in nyc,nyc headshot photographers,acting schools links,the empire hotel,the empire hotel new york"> ==================================================================================================================== Page: http://www.dylanpatrickarts.com/blog/ <title>Blog</title> <meta name="description" content="Official Blog for Dylan Patrick Photography"> <meta name="keywords" content="blog,photography blogs,blogs on photography,photography,portraits,portrait,portrait photographer,portrait photographers,headshot photographers in nyc,headshot photographers in new york city,nyc headshot photographers,headshots nyc,nyc headshots,headshots,headshot"> ==================================================================================================================== Page: http://www.dylanpatrickarts.com/about/ <title>About Dylan</title> <meta name="description" content="A short bio about Dylan Patrick"> <meta name="keywords" content="nyc headshots,dylan patrick arts,dylan patrick photography,headshot photographers in nyc,headshot photographers in new york city,nyc headshot photographers,headshot,headshots,actors headshot,actors headshots"> ==================================================================================================================== Page: http://www.dylanpatrickarts.com/contact/ <title>Contact</title> <meta name="description" content="Contact information for Dylan Patrick"> <meta name="keywords" content="contact info,headshot photographers in nyc,headshot photographers in new york city,nyc headshot photographers,portraits,portrait,portrait photographers"> ==================================================================================================================== Page: http://www.dylanpatrickarts.com/shopping-cart/ <title>Shopping Cart</title> <meta name="description" content="Your Shopping Cart"> <meta name="keywords" content="web site shopping cart,shopping cart,buy photography,buy scenic photography"> Hi guys,
I have a problem with my code.
It connects with the database but it doesn't execute anything.
I am trying to update a value in a table but I really don't know what I am doing wrong.
I am trying to change the price based on the meta_value GF-1370
Thank you very much.
Here is Table (Taken from myphpadmin)
meta_id post_id meta_key meta_value
18538
4356
_sku
GF-1370
18541
4356
_price
2.343
and here is my code:
<?php $link = mysql_connect('server', 'username', 'password'); if (!$link) { die('Could not connect: ' . mysql_error()); } echo 'Connected successfully'; mysql_select_db(wordpress_i12dhflgoa); $sql="update `wp_pzvy_postmeta` set `_price` = 5 WHERE `_sku` = 'GF-1370'"; ?> I have a page with an iframe in it like so. <iframe src="page.php" width="100" height="100"></iframe> The page.php file, I have a meta refresh in it. <meta http-equiv="refresh" content="2; url=http://www.blah.com"> Now when I load the website, it doesn't refresh the page.php iframe. It just stays loaded without refreshing. How can I reload an iframe without the user clicking on a link inside the iframe?? I also tried a header redirect but that didn't work. Thanks. Hello Every one Please see my code <?php include ("includes/config.php"); $afurl = $_SERVER['REQUEST_URI']; $afurl = preg_replace('/\/+/', '', $afurl); $afurl = preg_replace('/\;+/', '', $afurl); $afurl = preg_replace('/\&+/', '', $afurl); $afurl = preg_replace('/\#+/', '', $afurl); $afurl = preg_replace('/\|+/', '', $afurl); $afurl = preg_replace('/\@+/', '', $afurl); $afurl = preg_replace('/\%5B+/', '', $afurl); $afurl = preg_replace('/\%5D+/', '', $afurl); $afurl = preg_replace('/\%27+/', '', $afurl); $afurl = preg_replace('/\%C2+/', '', $afurl); $afurl = preg_replace('/\%BB+/', '', $afurl); $afurl = preg_replace('/quot+/', '', $afurl); $afurl = preg_replace('/\%E2+/', '', $afurl); $afurl = preg_replace('/\%80+/', '', $afurl); $afurl = preg_replace('/\%93+/', '', $afurl); $afurl = preg_replace('/\$+/', 'c', $afurl); $afurl = preg_replace('/\"+/', '', $afurl); $afurl = preg_replace('/\?+/', '', $afurl); $afurl = preg_replace('/\.html+/', '', $afurl); $afurl = preg_replace('/\-+/', ' ', $afurl); $queryArray = explode(" ", $afurl); for ($i=0; $i< count($queryArray); $i++) { $keyworddd = mysql_real_escape_string($queryArray[$i]).","; echo $keyworddd; } ?>I Want Set $keyworddd at he <meta name="keywords" content="$keyworddd"> Can anyone tell me how to do this please? Hi Everyone, I need some help which I think should not take long to figure out but I need help with it regardless. This is through wordpress. My issue is that my navigation has categories. Like Web design, Web Marketing, and Graphic design. I downloaded All in one SEO pack and everything is great up to the point where I can't add a title to the categories. When you click on the categories in the navigation the title doesn't change to what I set it to. But the description and all other meta tags are fine. I do have: Code: [Select] <head profile="http://gmpg.org/xfn/11"> <link rel="shortcut icon" href="http://www.newmediasources.ca/images/pt-logo.png"/> <title><?php wp_title('«', true, 'right'); ?> <?php bloginfo('name'); ?></title> <?php wp_head(); ?> <link href="<?php bloginfo('template_directory'); ?>/style.css" rel="stylesheet" type="text/css" /> <link href="<?php bloginfo('template_directory'); ?>/css/ddsmoothmenu.css" rel="stylesheet" type="text/css" /> <link href="<?php bloginfo('template_directory'); ?>/css/prettyPhoto.css" rel="stylesheet" type="text/css" /> <link href="<?php bloginfo('template_directory'); ?>/css/nivo-slider.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/jquery-1.4.2.min.js"></script> <script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/jquery.form.js"></script> <script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/ddsmoothmenu.js"></script> <script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/jquery.nivo.slider.pack.js"></script> <script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/jquery.prettyPhoto.js"></script> <script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/custom.js"></script> <script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/cufon-yui.js"></script> <script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/Museo_Slab_500_400.font.js"></script> <!-- Cufon init --> <script type="text/javascript"> <?php if(get_option('boldy_cufon')!="no"):?> Cufon.replace('h1',{hover: true})('h2',{hover: true})('h3')('.reply',{hover:true})('.more-link'); <?php endif ?> </script> <script type="text/javascript"> $(document).ready(function(){ $('#quickContactForm').ajaxForm(function(data) { if (data==1){ $('#success').fadeIn("slow"); $('#bademail').fadeOut("slow"); $('#badserver').fadeOut("slow"); $('#contact').resetForm(); } else if (data==2){ $('#badserver').fadeIn("slow"); } else if (data==3) { $('#bademail').fadeIn("slow"); } }); }); </script> <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" /> <?php wp_get_archives('type=monthly&format=link'); ?> <?php //comments_popup_script(); // off by default ?> </head> in header.php so it should be okay. I tried removing the title tag thinking it will add it itself but it didn't. Any ideas? Thank you for your time. This topic has been moved to HTML Help. http://www.phpfreaks.com/forums/index.php?topic=322718.0 |