PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > alt.php > html code from folder
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
html code from folder

Réponse
 
LinkBack Outils de la discussion
Vieux 25/11/2007, 22h00   #1
eswa
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut html code from folder

How can I write a php code that when it is include in a html page it
create a menu link automatically, reading from a main folder its
subfolder and html files?

bye bye

EswA

--
ESWA

Censimento Rifiuti Salento: http://www.flickr.com/photos/15103736@N03/
MeetUpSalentiniUnitiConBeppeGrillo:
http://beppegrillo.meetup.com/167/boards/

PersonalSite: http://eswa.altervista.org
eMail: eswa@email.it
Skype: eswa79




  Réponse avec citation
Vieux 25/11/2007, 22h29   #2
NC
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: html code from folder

On Nov 25, 2:00 pm, eswa <e...@email.it> wrote:
>
> How can I write a php code that when it is include in a html page it
> create a menu link automatically, reading from a main folder its
> subfolder and html files?


You can't include PHP code into an HTML page.

Cheers,
NC
  Réponse avec citation
Vieux 26/11/2007, 01h02   #3
richard
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: html code from folder

On Sun, 25 Nov 2007 14:29:13 -0800 (PST), NC wrote:

> On Nov 25, 2:00 pm, eswa <e...@email.it> wrote:
>>
>> How can I write a php code that when it is include in a html page it
>> create a menu link automatically, reading from a main folder its
>> subfolder and html files?

>
> You can't include PHP code into an HTML page.
>
> Cheers,
> NC


No? suggest you read up on php. PHP is somewhat like javascript in that it
is incorporated into the html coding, except that you, the user, is not
aware that it is there.
  Réponse avec citation
Vieux 26/11/2007, 02h08   #4
Jerry Stuckle
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: html code from folder

richard wrote:
> On Sun, 25 Nov 2007 14:29:13 -0800 (PST), NC wrote:
>
>> On Nov 25, 2:00 pm, eswa <e...@email.it> wrote:
>>> How can I write a php code that when it is include in a html page it
>>> create a menu link automatically, reading from a main folder its
>>> subfolder and html files?

>> You can't include PHP code into an HTML page.
>>
>> Cheers,
>> NC

>
> No? suggest you read up on php. PHP is somewhat like javascript in that it
> is incorporated into the html coding, except that you, the user, is not
> aware that it is there.
>


Sorry, I agree with NC. You can't include php code in html pages,
unless you really screw up your configuration. You should include php
code in phyp files.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

  Réponse avec citation
Vieux 26/11/2007, 16h04   #5
Obiku
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: html code from folder

Jerry Stuckle schreef:
> richard wrote:
>> On Sun, 25 Nov 2007 14:29:13 -0800 (PST), NC wrote:
>>
>>> On Nov 25, 2:00 pm, eswa <e...@email.it> wrote:
>>>> How can I write a php code that when it is include in a html page it
>>>> create a menu link automatically, reading from a main folder its
>>>> subfolder and html files?
>>> You can't include PHP code into an HTML page.
>>>
>>> Cheers,
>>> NC

>>
>> No? suggest you read up on php. PHP is somewhat like javascript in
>> that it
>> is incorporated into the html coding, except that you, the user, is not
>> aware that it is there.
>>

>
> Sorry, I agree with NC. You can't include php code in html pages,
> unless you really screw up your configuration. You should include php
> code in phyp files.
>

If you put your php script between <script> tags, it can be in you html
  Réponse avec citation
Vieux 26/11/2007, 17h28   #6
Jerry Stuckle
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: html code from folder

Obiku wrote:
> Jerry Stuckle schreef:
>> richard wrote:
>>> On Sun, 25 Nov 2007 14:29:13 -0800 (PST), NC wrote:
>>>
>>>> On Nov 25, 2:00 pm, eswa <e...@email.it> wrote:
>>>>> How can I write a php code that when it is include in a html page it
>>>>> create a menu link automatically, reading from a main folder its
>>>>> subfolder and html files?
>>>> You can't include PHP code into an HTML page.
>>>>
>>>> Cheers,
>>>> NC
>>>
>>> No? suggest you read up on php. PHP is somewhat like javascript in
>>> that it
>>> is incorporated into the html coding, except that you, the user, is not
>>> aware that it is there.
>>>

>>
>> Sorry, I agree with NC. You can't include php code in html pages,
>> unless you really screw up your configuration. You should include php
>> code in phyp files.
>>

> If you put your php script between <script> tags, it can be in you html
>


The PHP parser won't parse them unless Apache tells it to.

Please show exactly how to configure Apache to perform this (without
parsing all .html files as PHP, that is).

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

  Réponse avec citation
Vieux 26/11/2007, 18h49   #7
Tom
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: html code from folder

On Sun, 25 Nov 2007 14:29:13 -0800 (PST), NC wrote...
>
>On Nov 25, 2:00 pm, eswa <e...@email.it> wrote:
>>
>> How can I write a php code that when it is include in a html page it
>> create a menu link automatically, reading from a main folder its
>> subfolder and html files?

>
>You can't include PHP code into an HTML page.
>
>Cheers,
>NC



Whether you configure your Apache to parse just .php files or also use .html,
there's a few functions in PHP you can use to get the files from a directory. If
you read up on the opendir(), scandir() and/or readdir() that may out with
what you're trying to do.

http://www.php.net/manual/en/function.opendir.php
http://www.php.net/manual/en/function.scandir.php
http://www.php.net/manual/en/function.readdir.php

Tom
--
NewsGuy Accounts Go Jumbo!
Extra NewsGuy increased from 30 to 50 GB of download capacity
http://newsguy.com/overview.htm

  Réponse avec citation
Vieux 26/11/2007, 19h54   #8
NC
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: html code from folder

On Nov 25, 5:02 pm, richard <s...@google.dom> wrote:
> On Sun, 25 Nov 2007 14:29:13 -0800 (PST), NC wrote:
> > On Nov 25, 2:00 pm, eswa <e...@email.it> wrote:

>
> > > How can I write a php code that when it is include in a html
> > > page it create a menu link automatically, reading from a main
> > > folder its subfolder and html files?

>
> > You can't include PHP code into an HTML page.

>
> No? suggest you read up on php. PHP is somewhat like javascript
> in that it is incorporated into the html coding, except that you,
> the user, is not aware that it is there.


I think you should follow your own suggestion: read up on PHP. PHP is
nothing like JavaScript; JavaScript is executed client-side, PHP,
server-side. By default, PHP code is only executed if it is located
inside a *.php file. You can configure your server to treat *.html
files as if they were *.php files, but this would preclude you from
using other server-side options available for use in HTML files, such
as SSI.

Cheers,
NC
  Réponse avec citation
Vieux 26/11/2007, 20h01   #9
NC
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: html code from folder

On Nov 26, 8:04 am, Obiku <obie...@xs4all.com> wrote:
>
> If you put your php script between <script> tags,
> it can be in you html


It can BE there. But it'll be useless, since it won't be executed.
The server will just spit it out as-is...

<script language="php"> ... </script> is functionally identical to <?
php ... ?>. Regardless of which tag you use, PHP code is executed
server-side, and by default the PHP interpreter is only invoked when a
*.php file is parsed.

Cheers,
NC
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 08h12.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,13988 seconds with 17 queries