What in the world do you mean by "The HTML is executed"? I'm acting as a distant echo to nizsmo: please do tell us more.
Main Topics
Browse All TopicsHi,
I'm using the include statement to execute one PHP script from another, but I'm using smarty to separate HTML from PHP. The HTML is executed and the form posts back to the PHP file. The PHP code completes but does not return to the PHP script from which it was included.
What am I doing wrong?
Thanks,
Sean
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
<? php include('filename.php') ?>
let say.. index.php, header.php, and footer.php
you cannot load header.html or footer.html inside <? php include('header.html') ?> , just rename the header.html to header.php and try again..
i hope that make since.. to make it short and sweet.. if the extension is .html and you are calling it to include("filename.html') it will not work. just rename the filename.html to filename.php
anyway.. hope this help.. :)
Hi,
Yes of course. I didn't before because it would be overkill to include all my code. Here is the code relating to what I want to code.
UserSubmitJob.php
[CODE]
include( 'UserJobContactInfo.php' );
var_dump( $_POST );
[CODE]
UserJobContactInfo.php
[CODE]
if( !isset( $_POST['submitContactInfo'
{
$selfChanged = "UserJobContactInfo.php";
$smarty->assign( 'selfChanged', $selfChanged );
$smarty->display('jobs/Use
}
else
{
// Do lots of stuff here
echo "Here";
}
[/CODE]
The include works and [CODE]UserJobContactInfo.p
Hope this makes sense.
Thanks,
Sean
No because it completes fine when I run it independently of the script that includes it. It successfully prints out "here" and the only code after that is closing braces. I want to be able to include the UserJobContactInfo.php so that it displays the HTML form using a smarty template. Goes back to UserJobContactInfo.php to process the data and then access that data through $_POST in the PHP script that included it.
Couple of suggestions:
1) before var_dump (but after include) do something else like "echo('We're here.');"
2) after the var_dump, do "flush();".
Reasoning:
1) Perhaps $_POST is not assigned? Or var_dump does not work... or something :)
2) You should always flush after you go :) Seriously, there might be some output buffering turned on
If neither of these help, do you have access to the servers error log. If you do, is there anything that might hint at a reason why this is happening.
Business Accounts
Answer for Membership
by: nizsmoPosted on 2007-10-09 at 18:07:48ID: 20045753
Are you able to post a short sample of the code for us to better understand?