2
There is include with parameter?
I have a page .php
containing the following code:
<ul class="nav nav-tabs">
<li class="active"><a data-toggle="tab" href="#segunda">Segunda-Feira</a></li>
<li><a data-toggle="tab" href="#terca">Terça-Feira</a></li>
<li><a data-toggle="tab" href="#quarta">Quarta-Feira</a></li>
<li><a data-toggle="tab" href="quinta">Quinta-feira</a></li>
<li><a data-toggle="tab" href="#sexta">Sexta-feira</a></li>
<li><a data-toggle="tab" href="#sabado">Sábado</a></li>
</ul>
The Nav Nav-tabs form 6 tabs and in each ABA I show the times of FULANINHO.
- In the ABA MONDAY I show the Monday schedules of FULANINHO
- In the TAB TUESDAY I show the Tuesday schedules of FULANINHO
- And so on and so forth.
When I started making the code I saw that it would be a repetition of everything, where I would only change the day of the week and the name of FULANINHO that comes from the previous page via POST.
So I thought of something like include('segunda.php',$id_fulaninho)
.
That’s possible?
If not, it would have some shape that I still don’t know (I’m new to the php
) to reduce this absurd amount of code repeated?
make the include and on the set include the time and the name of the John or the time and the name of Ciclaninho etc... according to what comes from the post. In order to help it would be good to post the code of the previous page of the post and include and how to get the data of the fulaninho, etc..
– user60252
Why don’t you encapsulate the code in a function that receives the parameters and instead of giving the
include
to display the HTML, you include the file with the function and call where you want to display the result.– Woss
Good morning Leo Caracciolo and Anderson Carlos... Thank you for your attention. As I said I am new to the dialect "peagapes";) I will study your words carefully and try to do what you have indicated :)
– Ricardo M.Souza