PHP and type of hyperlink


#1

I have a problem when I test a site in local

This site have a link in the form: http://www.mysite.com/index.php/another … unct_param

where:
another_file = is a php file that it wants to be execute
function_name = is a function present in the “another_file”
funct_param = is a parameter for the “function_name”

The problem is when I test to navigate the site in local, this type of link NON function (the “another_file” is not execute and comes execute the index.php file). WHY?
I suppose that the PHP or Apache configuration in NOT correct.
I have enable PATH_INFO in PHP but his value ( $_SERVER[‘PATH_INFO’] ) is null. WHY?

Enyone can help me?

thank you.


#2

I am sorry. I just don’t understand what you are trying to ask.


#3

I have a problem I am unable to solve on a local php website.

This site contains links in this form: http://domain/file.php/value1/value2/value3
where:
“file.php” is an existing php file of the site, for instance index.php
“value1” is another php file of the site (it looks like a redirect of some kind)
“value2” is the name of a function which is defined in the value1 php file
“value3” is a parameter of the above-mentioned function

Unfortunately, after clicking on these links nothing happens (only the “file.php” file is executed).
I most likely have some configuration issue in PHP or in Apache, causing the link not to be interpreted correctly, but I have no idea on how to solve it.
I’ll really appreciate all help you could give me.

Thank you very much.

Note: using PHP5 and Apache 2.2.


#4

well, maybe I am still misunderstanding, but that isn’t even a valid link, even if those values were real, there would be no know way any browser or web server would understand what you are tryin to do…

http://www.mydomain.com/folder/folder/file.php is the only way you can have URLs.

http://www.mydomain.com/file.php/folder/folder/ isn’t valid as you are trying to look in a file for a directory which isn’t possible.

Unless you trying something like this the following:

http://www.mydomain.com/file.php?myvalu … am=myparam

The above is just a guess, but if it something are looking for than you would need something like $_GET[’’]; To pull those values out of the URL to use in your page.


#5

I thought it was possible on Apache with mod_rewrite or something to have the path in the URL indicate which page with which variables to access. But don’t ask me how, I have no experience when it comes to that.


#6
I thought it was possible on Apache with mod_rewrite or something to have the path in the URL indicate which page with which variables to access. But don't ask me how, I have no experience when it comes to that.

yes, I was speaking to someone else on this and they did mention something about apache mod_rewrites, but then I guess i just figured since it was in a PHP forum, they probably weren’t talking about that.

But they probably are and I am just assuming to much! :-?


#7

Yes it was possible on Apache with mod_rewrite.

Example if your url

http://www.mypage.com/index.php?page=pagename like this

With mod_rewrite putting this code into .htaccess file

RewriteEngine on
RewriteRule ^([A-Za-z0-9-]+)/?$ index.php?page=$1 [L]

You can see like this

http://www.mypage.com/pagename

When you type http://www.mypage.com/pagename in the adress line you will see the same page.