|
|
|
#1 |
|
Messages: n/a
Hébergeur: |
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 |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
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/ |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
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 |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
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/ |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
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, > |
|
|
|
#6 |
|
Messages: n/a
Hébergeur: |
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 |
|
![]() |
| Outils de la discussion | |
|
|