Hi, I was wondering, if it is possoble (or how to) include a php file with a get form value passed.

For Example: states.php?state=NY.

This file would be incuded into another php file so that it would display only the items that would be in NY state.

Anyone know how to do this??

Help is greatly appreciated.

Recommended Answers

All 2 Replies

Hi, I was wondering, if it is possoble (or how to) include a php file with a get form value passed.

For Example: states.php?state=NY.

This file would be incuded into another php file so that it would display only the items that would be in NY state.

Anyone know how to do this??

Help is greatly appreciated.

There are probably several ways of accomplishing this. One would be to simply use file_get_contents to load the file text into a string and then do whatever you like with it.

Not sure just why you want to do things this way. At the very least you should sanitize the user input so you don't end up squirting back sensitive files. For instance someone might try to browse to

states.php?state=.htaccess or states.php?state=mybusinessdata.db

Hi, Sorry I didn't post back earlier. I finaly figured out how to do what I wanted. Thanks.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.