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 8 years ago.
Improve this question
I am making a website using HTML. I am not familiar with PHP. I need the navigation and header part to be in a single place. i.e., Once I change the menus in one place it should reflect in all other pages. Kindly help me on this.
Thanks in Advance.
You could use include or require to add your Menu-Html file in every page you wish.
you could add something like this:
<?php
include('menu.html');
?>
wherever your menu should appear in your HTML, having a menu.html file of course.
and you'll need an apache server or any other that can 'read' your php files.
include php documentations
require php documentations
Related
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 4 years ago.
Improve this question
I am trying to make this page:
https://mediastreet.ie/media-jobs/role-65678
same as this page using htaccess:
https://mediastreet.ie/media-jobs/role
So basically /role-65678 is a parameter like role-{parameter}. So when on /role-65678 i have a script that fetches this (65678) and displays the job according to it.
Rather than editing your htaccess file, I would just reccomend sticking with a good old get method.
Use https://mediastreet.ie/media-jobs/role?id=65678
Then in the index.php file in the directory "role", use the get functionality as shown below.
<?PHP
$id = $_GET["id"];
//Code to follow
?>
Past experiance tells me this will save alot of htaccess headaches!
All the Best.
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 want something like Wordpress's system. I want to get header code from header.php so I will not have to edit all of the pages when I'm going to edit something.
You can never get the code because one the php page is render, it gets converted into HTML so you will always see html.
I understand, you need header component.
1)Create a file header.php (add navigation bar or logo or whatever you want).
2)Include it in other php files as include("header.php");
so all the pages will be using this one header.php file and you can modify it and the changes would get reflected all over the web app.
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've just begun to learn PHP and there is something that is bugging me. I often see php pages, which load content the following way:
index.php?id=16
What does this mean? Is there a single index.php file and the content of a different file (in this case 16) is loaded into this page? Is this advantageous?
And: how do I create such id-pages?
I've already googled it and made a search here, but couldn't find any answers...
If you could simply tell me how this function is called it would already help me a lot!
Thanks in advance!
This means you are calling your index.php file, and you pass it a parameter called id with the value 16. You can access this value like this
$_GET['id']
It allows you to have dynamic content in your page for example.
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 8 years ago.
Improve this question
I made an HMTL menu and I want to add it to the page using PHP(I have some HTML and some PHP files).
If I use:
include('menu.html');
there is always something that isn't right.
So, how can I add the HTML menu using PHP? The menu must be on top, and the same as it is in HTML.
Have a look at this question: Question about including html page in PHP
If you have problems with the .css because they are included with relative path you need to set the relative path "relative" to the .php file
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 8 years ago.
Improve this question
I want the admin can change the contents of the html page after successful login.
How can I show the contents of html page in an editable format fetching all the contents from the html page.
So that admin can modify contents and then save it to change the front end.
Thanks for your time.
The easiest thing to do is to set up an CMS upfront.
Anyway, you can try out this link http://www.techsling.com/2011/12/10-ways-to-convert-a-simple-htmlcss-website-into-a-content-management-system/. I personally have some experience with Surreal, but I would not recommend it.
If you really think of content management, you should go with a CMS (one of the big 3: Wordpress, Joomla, Drupal).
Hope that helps