Output another X.PHP file on Y.php

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
DiscoDave
Forum Newbie
Posts: 4
Joined: Mon Oct 26, 2009 8:15 am

Output another X.PHP file on Y.php

Post by DiscoDave »

Hi lads,

Just wondering if anyone culd help me.

I have a file form.php. This has checkboxes and textfields etc in it.
When the form is processed it directs to process.php where it checks for errors and shows them.
What I want to be able to do is to show the form.php under the errors in the process.php form IF there are any errors.

Anyone be able to shed some light on this ? Is this the include() function?

Thanks,
Dave
davegmpd
Forum Newbie
Posts: 14
Joined: Tue Oct 27, 2009 9:42 am
Location: London

Re: Output another X.PHP file on Y.php

Post by davegmpd »

Simple answer is - almost certainly yes! You do want to use the include if your aim is to pull in a section of HTML / PHP and execute.

However, if you're "form" PHP file contains a FULL HTML document, eg: <head></head> etc.. then you will have a problem. It really depends on exactly what the files contain.

Suggestion -> try it!

Dave
Post Reply