How can i display a navigation bar across multiple webpages? [closed] - php

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I know CSS and HTML to a reasonable degree, but I've never built a multi-page website before.
I have a header area of my site coded, and want it to display it across multiple webpages. How can I do this?

Save it as header.php/header.html whichever one you need. Then, from every file you code from then on, you can <?php include('header.php');?>. The files you include in HAVE to be .php or it wont work.

Same applies to jsp if for any reason php didnt work or you fancied a change of pace
Create a file called header.jsp then use the tag below when you want to include it on a page.
<jsp:include page="{header.jsp}"/>
This is maybe of no use to you but who knows it may help someone. Some people find this easier and some find this harder it depends on your programming background.

Use a web programming language (PHP / ASP.Net / Whatever you like) to include the navigation bar in all the pages. There are template languages like Twig that can do that for you in a smarter way and provide you with additional template features, if you might need them.

Related

Edit a css file from the live website [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
so i want to develop a mini website builder within my website. Have a control panel where users can edit the text in their websites, i want each of those html pages to have its own css file attached to it. Now, i want it so that the user sees something like a button saying "Edit Background color" they are prompted with a color picker and on hitting save, the css file is updated without them knowing that css even exists.
I would like to know what language i can use to make the previous example happen. And if possible a hint of code.
I appreciate your answers, Braulio :)
I didn't downvote you but just for informational purposes, the reason you were probably downvoted is due to the scope of your question, The language you choose depends on what platform you are running your site on. And it is likely possible to do what you want in tons of different languages assuming your platform supports them. For an easy solution check out .net languages like c# with ajax controls for live updates without refreshes. But then again you could use ruby with rails. Or you could do most of it in the client side with jquery and javascript then send the results to the server which could utilize php. It is just to broad a question to really answer without writing the whole thing for you which nobody is going to do.

Combining one webpage section into other webpage [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I have downloaded a several nulled website templates for testing purposes.
I was wondering if I could combine them into one webpage?
For example, take category page layout from one webpage and implement it to other webpage. Is it possible to create webpage using php and html files combined, lets say index.html and contact.php?
Thank You in advance.
YES, you can. But, it's fairly not easy though.
When you are combining two different templates, each have seperate stylesheets and possible Javascript/JQuery scripts, which conflicts between the two.
And you can combine php and html files in same file.
Just use <?php at the beginning of php code and ?> at the end of php code.
Hope this helps. :)
Yes, it's just a matter of copying the section of code from one file and pasting it in the other. Which is why templates are available in the first place. But notice that you can't go copying PHP code and placubgit in a .html file.

How to make a dynamic timeline using bootstrap? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I'm trying to make a dynamic timeline like facebook that can post pictures and descriptions with dates using mysql php for database. I put bootstrap because I like their design, and it's easy to use.
My problem is i don't know where to begin or where do I study it.
Here's an example of what I'm talking about:
Any suggestions?
What a generic question... this seems to me an impossible question to answer but maybe you need just some little advices to begin studying the right languages which you can use to achieve what you want.
First of all please provide an image of what you want to do and more important the fundamental languages that you have to know are HTML (obviously), CSS, Javascript and PHP for some server side script.
Talking specifically about your problem, here is where you can see some open examples with well commented code that allows you to understand everything.
http://www.jqueryrain.com/2015/05/ideabox-jquery-timeline-news-ticker/
http://www.jqueryrain.com/2014/11/vertical-timeline-css3-jquery/

Separating PHP and HTML [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I apologize for asking such a beginner question, but i'm unsure on where else I could go to get such help. I'm currently creating a php website using GoggleApp Engine. I've created a very simple form using html in the same file as my PHP. Now, I know this isn't good practice, so I want to break up my html into it's own file. My only question is, how would I re-write this code assuming that my html is in it's own file?
It is perfectly fine to place your PHP code in the same file as your HTML code. However, if you are going to duplicate code, it would be best to have separate files (maybe say a header and footer file).
That way you can use require_once("header.php") and require_once("footer.php") in each file that wants to use the top and bottom portions of your code.
As Sven mentioned, you can look into templating. You can also look into coding habits such as MVC (Model View Controller) and similar methods.

Showing some parts of a external website and modifing HTML/CSS [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I would like to know what is the best approach, based on good programming practices to show an external webpage (say Facebook or Twitter) on my website while being able to modify the HTML and CSS before showing it.
I know that I could use an iFrame however based on some opinions the iFrame does not seem to be a good programming practice (width issues, ugly scrollbars, etc).
Is there a better approach?
Update: Question was put on "too broad", in order to limit the possible answers I would like to know if it possible to change the CSS (and only CSS) of an iFrame, the user Muhammad Umer commented that it would be possible but provided no more details. Someone knows how to achieve this?
This can be done in PHP. First I want to suggest to look for API's. Facebook has some nice API's which allow you to show them on your website, with some options to customize is.
The more difficult (and lots of work to maintain) is using file_get_contents() and using some parsers and regex to get the parts you want. Allthough facebook (and some other sites) might prove difficult, they load some parts via JS, so file_get_contents cant get everything
Again, API's are the way to go.

Categories