banago / simple-php-website Goto Github PK
View Code? Open in Web Editor NEWAn introductory example of how to build a simple and minimal website built with PHP.
An introductory example of how to build a simple and minimal website built with PHP.
i wanna clone your code to my local machine, can i push it to my github account?
Thank you for this simple and amazing code,
however, I notice that if the files are not in root directory ex: **www.mysite.com/phpsite/**index.php, the links of content doesn’t work.
How can be this resolved?
Thank you
When I put the pretty uri option to true, the content doesn't change when I change the page and stays to the homepage content and title.
I don't know php, I need some suppot , please help me
This question may be stupid I had install the xampp. . But i cannot run the file . Nothing appear in browser it just come out coding of the files. I want to see the interface of the project.
hello, may you please assist me with building your php website. i am new to php
Hey Mate,
Thanks for sharing the code. First of all, I am not very familiar with PHP. Trying to host a simple website. I am hosting it on my localhost on port 8080. I have updated the site_url field with "http://localhost:8080". I can access the indexpage just fine, however, when I click on the About Us, Products etc, get a blank page. On inspecting code, I am getting a blank html page back. Any ideas on what I could be doing wrong ?
I very much appreciate your code and it inspired me.
how to use the url below
http://localhost/articles/124 or http://localhost/articles/124.html
instead of
http://localhost/show_article.php?id=124
I tried to add the below code in .htaccess , but it always jump to 404 page, please advise, thanks.
RewriteRule ^/articles/([0-9]+).html /show_article.php?id=$1
Any help would be greatly appreciated!
$ php -S localhost:8080
PHP 5.4.16 Development Server started at Mon May 10 13:23:27 2021
Listening on http://localhost:8080
Document root is /home/si.roy/simple-php-website
Press Ctrl-C to quit.
[Mon May 10 13:23:32 2021] PHP Parse error: syntax error, unexpected '?' in /home/si.roy/simple-php-website/includes/functions.php on line 36
[Mon May 10 13:23:32 2021] ::1:46572 [200]: / - syntax error, unexpected '?' in /home/si.roy/simple-php-website/includes/functions.php on line 36
From Another host :
[si.roy@jenkins ~]$ curl http://localhost:8080
Parse error: syntax error, unexpected '?' in /home/si.roy/simple-php-website/includes/functions.php on line 36
[si.roy@jenkins ~]$
PHP Version :
$ php -v
PHP 5.4.16 (cli) (built: Oct 29 2019 09:56:22)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
Can we able to run this application inside the container?
Also why this docker is running only under the folder /var/www/html/. could you please explain I'm new to docker
Well,
being a github noob like a pro, so opening the issue for a signle misspelling.
content > about-us.phtml : 2:2
is :
Hi,
We are very new to php and planned to use this project for CICD. Hence to build the project through Jenkins we need build.xml file.
Could you please provide for the same.
Hi,
Thank you for your code!
I copied all the site to c9 and the homepage opens just like it should, but all other links lead to:
Not Found
The requested URL /about-us was not found on this server.
Apache/2.4.7 (Ubuntu) Server at php-test-ruja.c9users.io Port 443
What might be the problem? Also tried copying one page to the root-directory, this did not help.
Tried the solution to delete the "/" from the navmenu, this did not help either.
Best, Jan
I think there is an issue with the nav menu links. When I click on a nav menu link (for instance about-us) I get redirected to the localhost directory, when actually I should get: http://localhost/simple_php_website/about-us. I think it has to do with the website path which is not clearly defined.
line 29 template.php
<?php echo date('Y'); ?>
In some servers without setting the timezone if date function is used it may lead to problems ( improper time ).
Can you please add a om file for maven compiler
I have forked & fixed the URLs as necessary, with MR #17 👍
how do I start the project and what I suppose to do in the first stage give me some instruction.
Hello there. First of all, thanks for this great resource. I am having some slight user error when it comes to the nav menu. I want to set it up so that an active class is added to the nav item when you are on that page, making it different from the rest. I have tried to do something like that with this code:
`/**
Website navigation.
*/
function navMenu($sep = ' | ')
{
$nav_menu = '';
foreach (config('nav_menu') as $uri => $name) {
$nav_menu .= '<a class="nav-link'.(($name==$page)?' active':"").'" href="'.(config('pretty_uri') || $uri == '' ? '' : '?page=').$uri.'">'.$name.'';
}
echo trim($nav_menu, $sep);
}`
There is not an error, but it does not add the active element. I would be grateful for your help, if there's an effective way to do this.
Thanks.
Hi friends,
Thanks for your code, it is pretty nice for me to learn more php.
I try to change everything to have the data of the template.php in the index.php. After that everything works, but not the navigation. "requested url not on the server". The links of the navigation looks the same.....
Why do i want this? Because i wanted to include header, sidebar and footer, instead of to have them directly in the template.php file. But this does'nt work in the original code, it did'nt find my including files. When i chance everything from template.php to index.php it works, but not the navigation, like i write.
If you like, you can have a look at my project in: https://github.com/eversthomas/fritz
Greetz ... Tom.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.