Hi everyone, I need some help correctly adding some php code in an include file. What I am trying to do is have 2 include files: one with the php code to process a form and another separate file to hold the html/php code for the form itself. The php code and form work, however, when I try to include the php/html form for the form it does not work. The php/html form code that I'm trying to put into an include file is shown below: <form action="<?php htmlentities($_SERVER['PHP_SELF']); ?>" method="post" class="form_advertise"> <p> <input type="hidden" name="ip" value="<?php echo $ipi ?>" /> <input type="hidden" name="httpref" value="<?php echo $httprefi ?>" /> <input type="hidden" name="httpagent" value="<?php echo $httpagenti ?>" /> <div class="cell_container"> <div class="cell_one"> First Name: </div><!-- end class cell_one --> <div class="cell_two"> <input type="text" name="first_name" value='<?php echo "$first_name"; ?>' size="25" /> </div><!-- end class cell_two --> </div><!-- end class cell_container --> <br /> <div class="cell_container"> <div class="cell_one"> Last Name: </div><!-- end class cell_one --> <div class="cell_two"> <input type="text" name="last_name" value='<?php echo "$last_name"; ?>' size="25" /> </div><!-- end class cell_two --> </div><!-- end class cell_container --> <br /> <div class="cell_container"> <div class="cell_one"> Email: </div><!-- end class cell_one --> <div class="cell_two"> <input type="text" name="email" value='<?php echo "$email"; ?>' size="25" /> </div><!-- end class cell_two --> </div><!-- end class cell_container --> <br /> <div class="cell_container"> <div class="cell_one"> URL of Host: </div><!-- end class cell_one --> <div class="cell_two"> <div class="float_left">http://</div><!-- end class float_left --> <input type="text" name="host" value='<?php echo "$host"; ?>' size="25" /> </div><!-- end class cell_two --> </div><!-- end class cell_container --> <br /> <div class="cell_container"> <div class="cell_one"> URL of Hosted Website: </div><!-- end class cell_one --> <div class="cell_two"> <div class="float_left">http://</div><!-- end class float_left --> <input type="text" name="url" value='<?php echo "$url"; ?>' size="25" /> </div><!-- end class cell_two --> </div><!-- end class cell_container --> <br /> <div class="cell_container"> <div class="cell_one"> Message (DO NOT enter any HTML code in the message): </div><!-- end class cell_one --> <div class="cell_two"> <textarea name="message" cols="50" rows="10"> <?php echo "$message"; ?> </textarea> </div><!-- end class cell_two --> </div><!-- end class cell_container --> <br /> <div class="cell_container"> <div class="submit_button"> <input type="submit" name="send" value="Submit Form" /> </div><!-- end class submit_button --> </div><!-- end class cell_container --> </p> </form> HTML: Thanks Jose
You need to show us the rest of your code ( you said you have more than 1 file ) as the problem most probably isn't in HTML but PHP.
Confirm that the form works as one before splitting it into your inclusion files. Once it is working, as Brad.V says above, include('form.php') has to work.