Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-16-2013, 08:59 PM   PM User | #1
aaronoafc
New Coder

 
Join Date: Feb 2012
Posts: 74
Thanks: 7
Thanked 0 Times in 0 Posts
aaronoafc is an unknown quantity at this point
Strange Problem Driving me mad! Wamp or Include code

Hi Guys,

Basically I'm working on a website in my local host which is WAMP...the directory for the site is localhost/shirts4mike/index.php....This takes you too the homepage which works okay.

The problem is when you click on one of the links on the homepage..contacts...this should take you too the contract.php page...however it just doesn't take you anywhere and takes you too localhost/shirts4mike/#

What's also strange is...when you go too localhost/shirts4mike/contact.php it takes you too the correct page!

index.php code:

PHP Code:
<?php include('inc/header.php'); ?>

        <div class="section banner">

            <div class="wrapper">

                <img class="hero" src="img/mike-the-frog.png" alt="Mike the Frog says:">
                <div class="button">
                    <a href="#">
                        <h2>Hey, I&rsquo;m Mike!</h2>
                        <p>Check Out My Shirts</p>
                    </a>
                </div>
            </div>

        </div>

        <div class="section shirts latest">

            <div class="wrapper">

                <h2>Mike&rsquo;s Latest Shirts</h2>

                <ul class="products">
                    <li><a href="#">
                            <img src="img/shirts/shirt-108.jpg">
                            <p>View Details</p>
                        </a>
                    </li><li>
                        <a href="#">
                            <img src="img/shirts/shirt-107.jpg">
                            <p>View Details</p>
                        </a>
                    </li><li>
                        <a href="#">
                            <img src="img/shirts/shirt-106.jpg">
                            <p>View Details</p>
                        </a>
                    </li><li>
                        <a href="#">
                            <img src="img/shirts/shirt-105.jpg">
                            <p>View Details</p>
                        </a>
                    </li>                                
                </ul>

            </div>

        </div>

    </div>

    <div class="footer">

        <div class="wrapper">

            <ul>        
                <li><a href="http://twitter.com/treehouse">Twitter</a></li>
                <li><a href="https://www.facebook.com/TeamTreehouse">Facebook</a></li>
            </ul>

            <p>&copy;<?php echo date('Y'); ?> Shirts 4 Mike</p>

        </div>
    
    </div>

</body>
</html>
inc page which is header.php:

PHP Code:
<html>
<head>
    <title><?php echo"Shirts 4 Mike"?></title>
    <link rel="stylesheet" href="css/style.css" type="text/css">
    <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Oswald:400,700" type="text/css">
    <link rel="shortcut icon" href="favicon.ico">
</head>
<body>

    <div class="header">

        <div class="wrapper">

            <h1 class="branding-title"><a href="./">Shirts 4 Mike</a></h1>

            <ul class="nav">
                <li class="shirts"><a href="#">Shirts</a></li>
                <li class="contact"><a href="contact.php">Contact</a></li>
                <li class="cart"><a href="#">Shopping Cart</a></li>
            </ul>

        </div>

    </div>

    <div id="content">
contact.php code:

PHP Code:
<?php include('inc/header.php'); ?>

    <div class="section page">

        <h1>Contact</h1>

    </div>
Any ideas, its only something small but its driving me mad!
Attached Thumbnails
Click image for larger version

Name:	homepage.jpg
Views:	26
Size:	47.5 KB
ID:	11863   Click image for larger version

Name:	contactpage.jpg
Views:	15
Size:	41.9 KB
ID:	11864   Click image for larger version

Name:	whenyouclickcontact.jpg
Views:	16
Size:	46.6 KB
ID:	11865  
__________________
Don't Click Here!
aaronoafc is offline   Reply With Quote
Old 01-16-2013, 09:18 PM   PM User | #2
student101
Regular Coder

 
student101's Avatar
 
Join Date: Nov 2007
Posts: 610
Thanks: 80
Thanked 13 Times in 13 Posts
student101 is on a distinguished road
Thumbs up

try ../contact.php

Edit: Your header is inside a folder called inc
This exists in header.php
<li class="contact"><a href="contact.php">Contact</a></li>
that link means its in the same folder & not on the root, in this case the root folder being shirts4mike
__________________
Thanks for your support!
Update MySQL with checkboxes | Tell A Friend | Delete MySQL with checkboxes

Give thanks & resolve when done :thumbsup:

Last edited by student101; 01-16-2013 at 09:22 PM..
student101 is offline   Reply With Quote
Old 01-17-2013, 08:00 AM   PM User | #3
aaronoafc
New Coder

 
Join Date: Feb 2012
Posts: 74
Thanks: 7
Thanked 0 Times in 0 Posts
aaronoafc is an unknown quantity at this point
Quote:
Originally Posted by student101 View Post
try ../contact.php

Edit: Your header is inside a folder called inc
This exists in header.php
<li class="contact"><a href="contact.php">Contact</a></li>
that link means its in the same folder & not on the root, in this case the root folder being shirts4mike
I thought you had cracked it then but it's still not working!

It looks like it should, just to make sure if turned off the WAMP server and put back on again just to make sure that my browser wasn't displaying some kind of cached code but it still just resolves too localhost/shirts4mike/index.php# (when i click contact, the hash is added)

Any more ideas guys!?
__________________
Don't Click Here!
aaronoafc is offline   Reply With Quote
Old 01-31-2013, 10:46 PM   PM User | #4
student101
Regular Coder

 
student101's Avatar
 
Join Date: Nov 2007
Posts: 610
Thanks: 80
Thanked 13 Times in 13 Posts
student101 is on a distinguished road
Still unresolved?
__________________
Thanks for your support!
Update MySQL with checkboxes | Tell A Friend | Delete MySQL with checkboxes

Give thanks & resolve when done :thumbsup:
student101 is offline   Reply With Quote
Old 02-01-2013, 12:09 AM   PM User | #5
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,662
Thanks: 4
Thanked 2,452 Times in 2,421 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
This problem is neither the include nor the wamp, rather its an HTML or a browser issue.
Clear your browser cache and try again, or append a random querystring to force a non-cached request. I have no problem with running the above. You should be able to verify after forcing a non-cached request and clicking the link or viewing the HTML source code.
__________________
As of PHP 5.5, the MySQL library has been officially deprecated. It is recommended to move to either MySQLi or PDO libraries for your mysql connectivity. See here for help choosing which interface you prefer: http://php.net/manual/en/mysqlinfo.api.choosing.php
Fou-Lu is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:13 AM.


Advertisement
Log in to turn off these ads.