Jump to content

Matt B

Members
  • Posts

    19
  • Joined

  • Last visited

    Never

Everything posted by Matt B

  1. The PHP web site is under-construction so it is not online. The HTML web site that is online ranks very high in all search engines. I do not want to use a trial-and-error approach to this...if the site will lose ranking I need to know before it goes LIVE. Someone (maybe not yourself) must have experience with PHP and Search Engine Rankings in terms of using Template Files!?! I need to know what will happen before it goes LIVE! Matt.
  2. Hi, The reason I decided to use .htaccess ModReWrite was so that Search Engines would crawl the site properly (Index All Pages). And also make URL's more friendly for people wanting to remember them. A web site designer told me today that with PHP, as I am using a single page as a template page for all product pages, search engines will only find and hence only rank one page! I thought that all web pages were designed using the PHP and then Search Engines crawl all pages that result from the PHP code. Can anyone tell me (preferably from experience) whether all the web sites pages will be ranked by the likes of Google, Bing, Yahoo...etc.. I want to maintain (if not better) the ranking of the current HTML web site online at the moment. Look forward to your replies, Matt.
  3. www.site.com/product-name looks better than www.site.com/product-name.htm and www.site.com/product-name.php but what would rank highest in Search Engines??? I will use one of these by implementing a Mod ReWrite. Matt.
  4. Matt B

    CSS with PHP

    Hello again. The PHP code is not complete but you should get the idea of it. It is a left navigation bar whereby the category you click gets listed first (at the top) in the navigation with a submenu below. Followed by the remaining categories. A couple of the categories have a number of sub categories (more depth) in the navigation bar. How would CSS style the main menu links different to the submenu links? Would I just use the code below with <?php and ?> breaking up the code with bits of CSS styling/coding? If the php is broken up will it know where is 'last finished' and where it is 'carrying-on-from'? I do not want the same styling for the whole navigation bar! Code is below. Matt. $res = mysql_query("SELECT * FROM categories"); while($row = mysql_fetch_array($res)) { $cats[$row['categoryid']] = $row['categoryname']; } if(isset($_GET['category'])) { $selcat = $_GET['category']; } if(isset($_GET['product'])) { $prod_info = mysql_fetch_array(mysql_query("SELECT * FROM products WHERE productid = ".$_GET['product'])); //Prod_Info now gets stored for use in the main display. $selcat = $prod_info['categoryid']; } if(isset($_GET['subcategory'])){ $option_info = mysql_fetch_array(mysql_query("SELECT * FROM products WHERE subcategoryid = ".$_GET['subcategory'])); $selcat1 = $option_info['categoryid']; } if(isset($_GET['subcategory1'])){ $option_info1 = mysql_fetch_array(mysql_query("SELECT * FROM products WHERE subcategory1id = ".$_GET['subcategory1'])); $selcat2 = $option_info1['subcategoryid']; } if(isset($selcat)) { echo "<a href='categorylist.php?category=".$selcat."'>".$cats[$selcat]."</a>"; unset($cats[$selcat]); //Gets rid of it for later. $res = mysql_query("SELECT productid,name FROM products WHERE categoryid = ".$selcat); while($row = mysql_fetch_array($res)) { echo "<a href='product.php?product=".$row['productid']."'>".$row['name']."</a>"; } } if(isset($selcat1)) { $smh = mysql_query("SELECT subcategoryid,name FROM products WHERE subcategory1id = ".$selcat1); echo "<a href='categorylist.php?category=".$selcat1."'>".$cats[$selcat1]."</a>"; unset($cats[$selcat2]); //Gets rid of it for later. $res = mysql_query("SELECT subcategoryid,name FROM products WHERE subcategory1id = ".$selcat1); while($row = mysql_fetch_array($res)) { echo "<a href='subcategory1id.php?subcategory1=".$row['subcategoryid']."'>".$row['name']."</a>"; } } if(isset($selcat2)) { $smh = mysql_query("SELECT name FROM products WHERE subcategoryid = ".$_GET['subcategory1']); while($row = mysql_fetch_array($smh)){ echo "<a href='categorylist.php?category=".$row['name']."'>".$row['name']."</a>"; unset($cats[$selcat2]); //Gets rid of it for later. } $res = mysql_query("SELECT subcategory1id,name FROM products WHERE subcategoryid = ".$selcat2); while($row = mysql_fetch_array($res)) { echo "<a href='subcategory1id.php?subcategory1=".$row['subcategory1id']."'>".$row['name']."</a>"; } } foreach($cats AS $key => $cat) { echo "<a href='categoryview.php?category=".$key."'>".$cat."</a>"; }
  5. Hi, I am am looking to develop further the code below. This code allows me to display a left navigation bar with Main Links and then if you click a Main link, that link is listed first in the list and its' submenu appears below. For the majority of links in the navigation bar this is fine. But for about 2 of the Main links this basic navigation is not suitable. I need the navigation for 2 of the links to offer more depth. So, for example, if you click Accessories in: Shoes Trousers Shirts Accessories Looks like this if Accessories is clicked: Accessories Belts Cuff Links Wallets Shoes Trousers Shirts Looks like this if belts is clicked (Main link name changed and submenu changed): Accessories - Belts Brown leather Black Leather Multicolour Designs All casual All formal Shoes Trousers Shirts Looks like this is Brown Leather is clicked: Brown Leather Belts Armani Brown Leather Belt 32" Armani Brown Leather Belt 34" Hugo Boss Brown Leather Belt 32" Hugo Boss Brown Leather Belt 34" Shoes Trousers Shirts Currently the code does not allow for this depth in the navigation bar. Any ideas how it could be done? Do I need additional tables for each subcategory. How do I ensure the category clicked does not appear in the rest of the navigation bar, as in the code I have at the moment? Currently the code is: $res = mysql_query("SELECT * FROM categories"); while($row = mysql_fetch_array($res)) { $cats[$row['categoryid']] = $row['categoryname']; } if(isset($_GET['category'])) { $selcat = $_GET['category']; } if(isset($_GET['product'])) { $prod_info = mysql_fetch_array(mysql_query("SELECT * FROM products WHERE productid = ".$_GET['product'])); //Prod_Info now gets stored for use in the main display. $selcat = $prod_info['categoryid']; } if(isset($selcat)) { echo "<a href='categorylist.php?category=".$selcat."'>".$cats[$selcat]."</a>"; unset($cats[$selcat]); //Gets rid of it for later. $res = mysql_query("SELECT productid,name FROM products WHERE categoryid = ".$selcat); while($row = mysql_fetch_array($res)) { echo "<a href='product.php?product=".$row['productid']."'>".$row['name']."</a>"; } } foreach($cats AS $key => $cat) { echo "<a href='categoryview.php?category=".$key."'>".$cat."</a>"; } Thank you for looking at this post, Matt.
  6. OK - thanks - I won't store images in the database! Matt.
  7. Hi, Should I store images within a MySQL Database. Or should I include 4-6 fields for image names like pic001.jpg, etc.? Or should I name all my images Product-Name-001.jpg, Product-Name-002.jpg, etc.. and then use the "Product Name" field, add the hypen using php coding and then have the remaining "-001.jpg", "-002.jpg", etc.. within the template php file?? I think the best is the quickest to load but I do not know which way is quickest. What do you recommend? Matt.
  8. Hi, A web site designed about 5 years ago is doing well in search engines but I am designing a new web site using PHP, CSS and MySQL. The old site was HTML and CSS. Do you have any design tips for Search Engines Optimisation when using PHP and MySQL? --- I will start coding soon, so all tips will be used. Thanks, Matt.
  9. I think I'll try what you suggest. But I have a query to ask: I am designing a template to be populated depending what link is clicked. So this would mean if you clicked: www.site.com/products.php?id=best-belt it would load the best belt page. But if I design the site the way you are suggesting I would need to send 'best-belt' and 'belts' through the URL so that 1) the best belt page loads and 2) the belts navigation menu appears - this would make the URL longer. Furthermore when I Mod Rewrite my URL using .htaccess file to something like www.site.com/best-belt I would need to miss out the 'belts' reference in the URL. Any ideas how to get around this potential problem? Matt.
  10. Matt B

    CSS with PHP

    Hi, I have read about PHP and how to use it and I have read about CSS and how to use it. But I have not read about how to use CSS with PHP!? For example, if I use an array in PHP and then add coding to the array for PHP purposes where does the CSS come in? Does CSS normally appear within PHP coding? I am guessing my CSS file contains all my CSS coding and then the CSS styling and positioning is called using div's (which call the CSS from the web page)... but does this coding get inserted in between the PHP coding...or do designers keep PHP and CSS separate. Furthermore, so far I have only added PHP to the top of a PHP file. Is it possible to add PHP code followed by CSS code followed by PHP code followed by CSS code, for example? I just thought when I access my Database using MYSQL QUERY at the top of the page maybe all the PHP needs to be at the top of the page. But then how does the CSS relate back to the top of the page? Hopefully someone has experience and knows the best-practice? Matt.
  11. Hi, I have heard of Word Press but it seems to me they just supply templates for web sites. I am designing my web site using PHP, MySQL with DreamWeaver so Word Press is not useful to me, right? Any other opinions...advice... Thanks, Matt.
  12. I understand that now. But how do I ensure the 'link clicked appears first with its' submenu'? If I had Socks Shoes Trousers Belts and I clicked belts I would want something like this to appear Belts 28" waist 30" waist 32" waist 34" waist Socks Shoes Trousers The if statement would not be enough to always include it at the top?! Would this sort of navigation benefit from passing more that 1 identity through the URL link? Thanks, Matt.
  13. I was thinking of using both a database and arrays. The array would feature products from the database. This might sound a bit cumbersome but I thought it would be smarter to keep all content in the database rather than at web pages. Perhaps you disagree? In the code example above, the 'if' function is used. Does this 'if' function mean 'if shoes is clicked'? I am a beginner and I thought PHP was only used to get information from a database to appear online (at a web page). Can it dynamically understand what is clicked using the 'if' function? Thanks, Matt.
  14. Hi, I have been told it is possible to use PHP to design a left navigation bar which features a submenu for each link clicked on. So if you click "shoes" in the left navigation bar it will then display all the left navigation bar links but below shoes it might have a sub menu saying "Size 5", "Size 6", "Size 7", "Size 8", "Size 9", "Size 10". What function in PHP allows me to include submenus? I think I need to define a 'Foreign Key' and use categories but I do not know what function to use to alter the menu depending on what the user clicks/selects??! Any ideas? Matt.
  15. OK - Another thing about this PHP URL issue... Do you know the process by which the pages are crawled by Search Engines? Do Search Engines create a hypothetical person who clicks all links of the web site and then publish all created pages to the Search Engine. Or do I have to do something myself to ensure all the pages are crawled by Search Engines, since how can Search Engines search a template page? Matt.
  16. FURTHERMORE... see http://www.jiffymix.com/product.php/12/Corn_Muffin_Mix as an example. How do they do it? Product.php is the template? 12 is the reference for MySQL? The rest of the link Corn_Muffin_Mix is just keywords since if you delete it (or just delete some of the last letters) the link still works. Any ideas?
  17. Hi there, I am designing a PHP MYSQL web site and I want all pages to appear in search engines. I have seen a web site listed in a search engine with a link like: www.website.co.uk/product.php/4478/ If the number is changed to 4477 then a different product is loaded. How does this work? I thought the link needed a question mark (?) in the link to pass the information and I thought this was bad news in terms of SearchEngineOptimisation? I am aware that if the link passed 4478 in the URL along with a question mark (?) in the URL it would load that product also but IT WOULD NOT APPEAR IN SEARCH ENGINES. Is this a common way around the search engine issue and how does it work??? Are there other, perhaps better ways to design my links and also the Search Engine prospects for the web site I am creating? Thanks, Matt.
  18. I have two questions regarding that. 1. If I use a template page which asks for the information from the row in the MySQL database how much do I have to 'add to the link'??? Just use a Query and Where Function??? How does this link communicate with my Template page? 2. Would my template page be populated for the Search Engines??? I want all pages accessible to Search Engines. I look forward to your reply, Matthew.
  19. Hi, Is it possible to build a PHP Template page that selects and publishes a row of data from a MySQL Database when a linked is clicked? I would design: Template.php Text links (perhaps on homepage of navigation bar): ProductA, ProductB and ProductC If you click link ProductA Template.php would display data for ProductA and likewise for ProductB and ProductC. I would also like search engines for find ProductA, ProductB and ProductC PHP pages. (Not just my single Template.php) Any ideas as to how this could be done without designing individual PHP pages for each product? Kind regards, Matthew.
×
×
  • 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.