-1

I'm using the w3.css framework to build a site. Most of the problems I've had have only been with my own code, but I've run in to a problem with a part of the w3.css, I think, that I can't get around.

I'm using a template that was already built by w3. I'm taking a link they have built and just adding a path to it.

My folder structure looks like this:

C:\Users\USER\Desktop\HTML :: this is where the index.html file resides C:\Users\USER\Desktop\HTML\source :: this is where the login.php file resides.

The HTML reads as follows:

<!-- Navbar -->
<ul class="w3-navbar w3-blue w3-card-2 w3-top w3-left-align w3-large w3-bottombar w3-border-yellow">
  <li class="w3-hide-medium w3-hide-large w3-opennav w3-right">
    <a class="w3-padding-large w3-hover-white w3-large w3-blue" href="javascript:void(0);" onclick="myFunction()" title="Toggle Navigation Menu"><i class="fa fa-bars"></i></a>
  </li>
  <li><a href="#" class="w3-padding-large w3-white">Home</a></li>
  <li class="w3-hide-small"><a href="source/login.php" class="w3-padding-large w3-hover-white">Login</a></li>
  <li class="w3-hide-small"><a href="#" class="w3-padding-large w3-hover-white">Register</a></li>
  <li class="w3-hide-small"><a href="#" class="w3-padding-large w3-hover-white">About Us</a></li>
  <li class="w3-hide-small"><a href="#" class="w3-padding-large w3-hover-white">The Crate</a></li>
</ul>

And the w3.css library can be found here:

http://www.w3schools.com/lib/w3.css

When I click on the Login button on the site, it downloads the login.php file rather than redirecting the page to it. I've played with the target parameter but have had no luck with it. This is true in both Firefox and Chrome. I've tried variations of ./ and ../ trying to see if maybe it doesn't know what I'm asking for, but those links take me to blank pages. That tells me that the /source is being found when it tries to download, but something is wrong with the CSS somewhere or something that is not redirecting to a new page. I've scanned the framework for a few hours, as well as my changes and the HTML for the template, and haven't come up with anything that could cause this.

Does anyone have any idea why this won't just change to the login.php page?

UPDATE: To be clear, I am launching the index.html file from both the Live Preview in Brackets and also opening the index.html file directly in Chrome/Firefox/IE and each browser or method of opening the index.html file tries to download the login.php file to my PC. When I load my currently active domain and click the Login button I have set up (on the same computer on the same browsers) it opens the login.php page and displays the login form etc.

My active domain is all hand built, it is not using w3.css. The only difference between the two is the w3 framework and template.

Thanks.

lol2dubs
  • 67
  • 1
  • 8
  • It's not a dup of that. Not at all. The .php file is working when I launch it from my hand built website, but it won't run when I launch it from the w3.css template. That means it has nothing to do with Apache or PHP or anything of the sort. It has to be a bug in the html/css somewhere and I can't seem to find it. Sorry about the comments. – lol2dubs May 19 '16 at 03:09
  • your story keeps change in your comments, work out the question before asking it –  May 19 '16 at 03:14
  • how do you launch a php file from a css template? –  May 19 '16 at 03:15
  • See update in main post. – lol2dubs May 19 '16 at 03:18
  • your running a webserver with php on your pc? –  May 19 '16 at 03:21
  • I'm an idiot. Sorry. – lol2dubs May 19 '16 at 03:23
  • I suggest deleting the question. –  May 19 '16 at 03:26
  • I can see it as helpful to someone. I struggled with this for hours before realizing, after discussion with you, that it was because I wasn't hosting my own .php processing solution. I'll leave it up to the administrators to decide, but this thread could have saved me hours had it been something I found when I originally searched hours ago. – lol2dubs May 19 '16 at 03:27

1 Answers1

0

This was happening due to the fact that I was NOT hosting a web server on my PC, nor did I have any platform for PHP processing installed. This was confusing to me because it was working on my live domain, hosted by a provider. In my inexperience, it seemed that it should work on my local machine if it was displayed via the domain, but it will not.

In reality, the domain server is processing the .php file and displaying the results for me on my local machine. This means that trying to view a .php file on my local machine does not produce the same results as trying to display the same .php file on my hosted domain.

lol2dubs
  • 67
  • 1
  • 8