How do I get contents of another page using PHP?

Elizabeth

New member
I am designing a website for a client who wants a dropdown box of all their products as a 'Search' function at the top of every page. Now I have created this in HTML it is quite large, so I was wondering if I could save it as a seperate file and use PHP to call it to the pages to save space.

Do I have to save the form as a php or an html file? What php command do I need to use? I have tried:

<?php include("Search.php");?>

and

<?php
$search = file_get_contents('Search.php');
echo $search;
?>

I am really new to php and would be chuffed if I could make just this little thing work! Thanks for any help
Thanks for answering Sergey! I tried that and it hasn't worked. Should I be laying out my header.php file like a normal html file or is it literally just the form with <?php ?> around it?
 
Back
Top