Yup I really can't see why you are trying to include a file and then echo a value within the include statement. If you want to use another file to echo a value, you can do this:
PHP Code:
include("page.php?aid=some_value");
THEN, within your page.php script, you can do this:
Yup I really can't see why you are trying to include a file and then echo a value within the include statement. If you want to use another file to echo a value, you can do this:
PHP Code:
include("page.php?aid=some_value");
THEN, within your page.php script, you can do this:
where $id; would pull the user id from the database and show certain information for that user on a new page ex: url output would have been http://example.com/page.php?aid=234 234 would be for user John D and show his information. Now I'm just trying to open it in a simple modal window by triggering the modal and within the modal body theres a php include of the url so the output would show the same information but I am having the issue of pulling the $id because it is already with <?php ?> and trying echoing the $id within the include only comes blank within the modal box body. A little winded writing but trying to give as much info as I can and thanks again for your help.
Yup I really can't see why you are trying to include a file and then echo a value within the include statement. If you want to use another file to echo a value, you can do this:
PHP Code:
include("page.php?aid=some_value");
THEN, within your page.php script, you can do this:
where $id; would pull the user id from the database and show certain information for that user on a new page ex: url output would have been http://example.com/page.php?aid=234 234 would be for user John D and show his information. Now I'm just trying to open it in a simple modal window by triggering the modal and within the modal body theres a php include of the url so the output would show the same information but I am having the issue of pulling the $id because it is already with <?php ?> and trying echoing the $id within the include only comes blank within the modal box body. A little winded writing but trying to give as much info as I can and thanks again for your help.
thanks but thats not working either when the modal is triggered it is still blank and doesnt pull the data. Sorry for making it alittle confusing. the original file worked fine just didnt want to move away from the page when trying to view the data trying to make it where a modal is opened and the data populates into the model window.
You can't use include this way. Check the example #3 of the manual for more details.
You could just use the variable $id in the included script but I don't recommend it.
PHP Code:
<?php // page1.php $id = "test"; include "page2.php";
PHP Code:
<?php // page2.php echo $id;
A better solution would be a function or method call to do the job.
Sorry I've just read the question again. I think you may want this:
PHP Code:
<?php include 'page.php?aid={$id}'; ?>
That passes the information to your page.php script.
No it does not. If its a URL, yes, if its a local file then no it will not pass any url parameters. It will just include the local file as a file with no url parameters.
Why?
Think about it LC. The url parameters are processed by the WEB SERVER and passed to PHP.
When including a local file, PHP accesses the file system directly - not a web server. With no web server involved in the process, how are the url parameters going to be processed? They won't.
@eureka: You can't use another set of <?php ?> tags inside existing <?php ?> tags. It just doesn't work - you are already in php mode.
//Please don't use this for your form processing:
if (isset($_POST['submit']))
//Internet explorer has a bug and does not always send the submit value.
No it does not. If its a URL, yes, if its a local file then no it will not pass any url parameters. It will just include the local file as a file with no url parameters.
Actually, it will try to include the file without success because there is no file named 'page.php?aid=some_value' on the local filesystem.
//Please don't use this for your form processing:
if (isset($_POST['submit']))
//Internet explorer has a bug and does not always send the submit value.