+ 1

Something is wrong with my code. Can Someone please help me out. thanks

1st. part of the code. <!Doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>Practice</title> <style media="screen"> header{ background: #e3e3e3; padding: 2em; text-align: center; } </style> </head> <body> <header> <h1> <?= $greeting; ?> </h1> </header> </body> </html> template. 2nd part of the code <?php $greeting ='Hello, Php World'; require 'index-tmp.php'; ?> When I load the site on my local machine to for testing I get an error. Not Found The requested resource / was not found on this server. <!doctype html><html><head><title>404 Not Found</title><style> body { background-color: #fcfcfc; color: #333333; margin: 0; padding:0; } h1 { font-size: 1.5em; font-weight: normal; background-color: #9999cc; min-height:2em; line-height:2em; border-bottom: 1px inset black; margin: 0; } h1, p { padding-left: 10px; } code.url { background-color: #eeeeee; font-family:monospace; padding:0 2px;} </style> </head><body><h1>Not Found</h1><p>The requested resource <code class="url">/</code> was not found on this server.</p></body></html>

27th May 2018, 11:28 PM
Dylan McKinstry
Dylan McKinstry - avatar
8 Respostas
+ 4
A 404 error generally means that a resource is missing, most of the times it involves files, be it HTML, images etc. Verify all your hyperlinks are valid, and all filenames referred to by links are there, in the specified path, I don't know how Mac file system works so I can't suggest you how to do verification, I hope you understand.
28th May 2018, 3:43 PM
Ipang
+ 3
The first part code must be saved as file index-tmp.php, you can save the second part code as file with any name, it only invoke the index-tmp.php anyways. And yet your question is incomplete, you said there's something wrong with your code, but you didn't specifically mention what it was.
27th May 2018, 11:55 PM
Ipang
+ 2
What are you running? XAMPP? or other? how did you load that site, I mean how you type the URL in the browser? post the URL please. And also have you checked all the files are there and given name proportionally?
28th May 2018, 3:31 PM
Ipang
+ 1
okay sorry about that
28th May 2018, 12:14 AM
Dylan McKinstry
Dylan McKinstry - avatar
+ 1
When I load the site on my local machine to for testing I get an error. Not Found The requested resource / was not found on this server. <!doctype html><html><head><title>404 Not Found</title><style> body { background-color: #fcfcfc; color: #333333; margin: 0; padding:0; } h1 { font-size: 1.5em; font-weight: normal; background-color: #9999cc; min-height:2em; line-height:2em; border-bottom: 1px inset black; margin: 0; } h1, p { padding-left: 10px; } code.url { background-color: #eeeeee; font-family:monospace; padding:0 2px;} </style> </head><body><h1>Not Found</h1><p>The requested resource <code class="url">/</code> was not found on this server.</p></body></html>
28th May 2018, 2:00 PM
Dylan McKinstry
Dylan McKinstry - avatar
+ 1
using Atom to do all the creation on. and running on localhost for now on my mac.
28th May 2018, 3:33 PM
Dylan McKinstry
Dylan McKinstry - avatar
0
you need to poot youor first name
6th Mar 2023, 6:31 PM
Kejuantaye Davis
Kejuantaye Davis - avatar
0
fuck you bitch
6th Mar 2023, 6:32 PM
Kejuantaye Davis
Kejuantaye Davis - avatar