PHWinfo banniere

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

Réponse
 
LinkBack Outils de la discussion
Vieux 05/01/2008, 12h23   #1
Alain Roger
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut menu andfolder question

Hi,

Serveral web sites have a menu and when you pass your mouse over a link, the
browser statusbar only shows the folder where is located the file link, not
the complete address including the file link.

i mean if you take web site : http://www.zend.com/en/
when you pass your mouse cursor over "Company" link, it displays only : "
http://www.zend.com/en/company" in the statusbar of your browser.
how is it possible whereas the link points to "company/index.htm" ?

thanks a lot,

--
Alain
------------------------------------
Windows XP SP2
PostgreSQL 8.2.4 / MS SQL server 2005
Apache 2.2.4
PHP 5.2.4
C# 2005-2008

  Réponse avec citation
Vieux 05/01/2008, 12h29   #2
chris smith
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] menu andfolder question

On Jan 5, 2008 10:23 PM, Alain Roger <raf.news@gmail.com> wrote:
> Hi,
>
> Serveral web sites have a menu and when you pass your mouse over a link, the
> browser statusbar only shows the folder where is located the file link, not
> the complete address including the file link.
>
> i mean if you take web site : http://www.zend.com/en/
> when you pass your mouse cursor over "Company" link, it displays only : "
> http://www.zend.com/en/company" in the statusbar of your browser.
> how is it possible whereas the link points to "company/index.htm" ?


In that example the link takes you to http://www.zend.com/en/company/
- not http://www.zend.com/en/company/index.htm

index.htm is the default file it looks for based on apache config.

See http://httpd.apache.org/docs/2.2/mod/mod_dir.html for more info.
You can set it to whatever you like, but as a rule apache uses
index.html or index.htm or index.php and asp/asp.net uses default.asp
or default.aspx.

--
Postgresql & php tutorials
http://www.designmagick.com/
  Réponse avec citation
Vieux 05/01/2008, 12h36   #3
Alain Roger
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] menu andfolder question

ok, maybe i did not write my question well.
i already used it because i setup the DirectoryIndex to index.php,
index.html

my concern for now, how to have the same behavior on my local computer
(development computer) ?
my computer has IP 200.170.1.2 (for example)
so in my brower i type : 200.170.1.2/myWebSite

this load my firt index.php webpage to browser... if i pass my mouse cursor
over menu link "Company", it displays
http://200.170.1.2/myWebSite/200.170.1.2/company
which is not great :-(

here is the code i use :
print "<div class='MenuItem4'><a
href='".$_SERVER['SERVER_NAME']."/company'>Company</a></div>";

thanks for .

A.

On Jan 5, 2008 12:29 PM, chris smith <dmagick@gmail.com> wrote:

> On Jan 5, 2008 10:23 PM, Alain Roger <raf.news@gmail.com> wrote:
> > Hi,
> >
> > Serveral web sites have a menu and when you pass your mouse over a link,

> the
> > browser statusbar only shows the folder where is located the file link,

> not
> > the complete address including the file link.
> >
> > i mean if you take web site : http://www.zend.com/en/
> > when you pass your mouse cursor over "Company" link, it displays only :

> "
> > http://www.zend.com/en/company" in the statusbar of your browser.
> > how is it possible whereas the link points to "company/index.htm" ?

>
> In that example the link takes you to http://www.zend.com/en/company/
> - not http://www.zend.com/en/company/index.htm
>
> index.htm is the default file it looks for based on apache config.
>
> See http://httpd.apache.org/docs/2.2/mod/mod_dir.html for more info.
> You can set it to whatever you like, but as a rule apache uses
> index.html or index.htm or index.php and asp/asp.net uses default.asp
> or default.aspx.
>
> --
> Postgresql & php tutorials
> http://www.designmagick.com/
>




--
Alain
------------------------------------
Windows XP SP2
PostgreSQL 8.2.4 / MS SQL server 2005
Apache 2.2.4
PHP 5.2.4
C# 2005-2008

  Réponse avec citation
Vieux 05/01/2008, 12h43   #4
chris smith
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] menu andfolder question

On Jan 5, 2008 10:36 PM, Alain Roger <raf.news@gmail.com> wrote:
> ok, maybe i did not write my question well.
> i already used it because i setup the DirectoryIndex to index.php,
> index.html
>
> my concern for now, how to have the same behavior on my local computer
> (development computer) ?
> my computer has IP 200.170.1.2 (for example)
> so in my brower i type : 200.170.1.2/myWebSite
>
> this load my firt index.php webpage to browser... if i pass my mouse cursor
> over menu link "Company", it displays
> http://200.170.1.2/myWebSite/200.170.1.2/company
> which is not great :-(
>
> here is the code i use :
> print "<div class='MenuItem4'><a
> href='".$_SERVER['SERVER_NAME']."/company'>Company</a></div>";


In your case it's taking the existing url and tacking the rest on
which is not what you want.

If you print out $_SERVER['SERVER_NAME'] - it doesn't include the
http[s]:// at the start to make it a complete absolute url. It also
doesn't include your current directory (myWebSite) so even with
http:// at the start you'd end up with http://ip.address/company - not
what you want either.

You should probably have a variable or define for your application url
in your config file so you can:

print "<a href='" . APPLICATION_URL . "/company'>Company</a>";

It's much safer this way than relying on any $_SERVER variables (which
believe it or not are suspect to XSS attacks/vulnerabilities).

--
Postgresql & php tutorials
http://www.designmagick.com/
  Réponse avec citation
Vieux 05/01/2008, 13h07   #5
John Gunther
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: menu andfolder question

Unless I misunderstand your question, this is normal behavior. The page
designer purposely enters the link in the simpler form:
http://www.zend.com/en/company
because the web server is configured to assume that index.htm is the
default page in that folder and correctly displays it.

Alain Roger wrote:
> Hi,
>
> Serveral web sites have a menu and when you pass your mouse over a link, the
> browser statusbar only shows the folder where is located the file link, not
> the complete address including the file link.
>
> i mean if you take web site : http://www.zend.com/en/
> when you pass your mouse cursor over "Company" link, it displays only : "
> http://www.zend.com/en/company" in the statusbar of your browser.
> how is it possible whereas the link points to "company/index.htm" ?
>
> thanks a lot,
>

  Réponse avec citation
Vieux 05/01/2008, 17h22   #6
Alain Roger
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] menu andfolder question

this is how i solved my issue :-)

On Jan 5, 2008 4:28 PM, jeffry s <paragasu@gmail.com> wrote:

>
>
> On Jan 5, 2008 7:36 PM, Alain Roger <raf.news@gmail.com> wrote:
>
> > ok, maybe i did not write my question well.
> > i already used it because i setup the DirectoryIndex to index.php,
> > index.html
> >
> > my concern for now, how to have the same behavior on my local computer
> > (development computer) ?
> > my computer has IP 200.170.1.2 (for example)
> > so in my brower i type : 200.170.1.2/myWebSite
> >
> > this load my firt index.php webpage to browser... if i pass my mouse
> > cursor
> > over menu link "Company", it displays
> > http://200.170.1.2/myWebSite/200.170.1.2/company
> > which is not great :-(
> >
> > here is the code i use :
> > print "<div class='MenuItem4'><a
> > href='".$_SERVER['SERVER_NAME']."/company'>Company</a></div>";
> >
> > thanks for .
> >
> > A.
> >
> > On Jan 5, 2008 12:29 PM, chris smith <dmagick@gmail.com> wrote:
> >
> > > On Jan 5, 2008 10:23 PM, Alain Roger <raf.news@gmail.com> wrote:
> > > > Hi,
> > > >
> > > > Serveral web sites have a menu and when you pass your mouse over a

> > link,
> > > the
> > > > browser statusbar only shows the folder where is located the file

> > link,
> > > not
> > > > the complete address including the file link.
> > > >
> > > > i mean if you take web site : http://www.zend.com/en/
> > > > when you pass your mouse cursor over "Company" link, it displays

> > only :
> > > "
> > > > http://www.zend.com/en/company" in the statusbar of your browser.
> > > > how is it possible whereas the link points to "company/index.htm" ?
> > >
> > > In that example the link takes you to http://www.zend.com/en/company/
> > > - not http://www.zend.com/en/company/index.htm
> > >
> > > index.htm is the default file it looks for based on apache config.
> > >
> > > See http://httpd.apache.org/docs/2.2/mod/mod_dir.html for more info.
> > > You can set it to whatever you like, but as a rule apache uses
> > > index.html or index.htm or index.php and asp/asp.net uses default.asp
> > > or default.aspx.
> > >
> > > --
> > > Postgresql & php tutorials
> > > http://www.designmagick.com/
> > >

> >
> >
> >
> > --
> > Alain
> > ------------------------------------
> > Windows XP SP2
> > PostgreSQL 8.2.4 / MS SQL server 2005
> > Apache 2.2.4
> > PHP 5.2.4
> > C# 2005-2008
> >

>
> omg.. i don't know someone will care enough to ask something like this..
> if you want the status bar to display the index.htm or index.php
> simply write the index.php or index.html in the link
>
> for example instead of this
>
> print "<div class='MenuItem4'><a
> href='".$_SERVER['SERVER_NAME' ]."/company'>Company</a></div>";
>
> do it like this
>
> print "<div class='MenuItem4'><a
> href='".$_SERVER['SERVER_NAME']."/company/index.htm'>Company</a></div>";
>
> the taskbar will display the whole link in href when you point the mouse
> over that link,.
>
>



--
Alain
------------------------------------
Windows XP SP2
PostgreSQL 8.2.4 / MS SQL server 2005
Apache 2.2.4
PHP 5.2.4
C# 2005-2008

  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 13h38.


É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,21983 seconds with 14 queries