prcollin Posted July 5, 2007 Share Posted July 5, 2007 I am adding forms and a search engine into my website. I have created to form for the search engine (The search input field) now do i put the php script after the html code then close it and then open another php script in order to run separate processes on same page <html> Search html Content <$php PHP Content $></html> <html> Form Content <$php PHP Content $></html> Should it look something generally like that or can i keep the php tag open until the very end. Quote Link to comment Share on other sites More sharing options...
per1os Posted July 5, 2007 Share Posted July 5, 2007 First off it is <?php not <$php <?php // search content and php content, just put them in a string ?> <html> <?php echo $search_content; ?> Form Content <?php echo $form_content; ?> </html> I find it better to put output into variable and then echo them where you need them exactly in the code. This can save some heartache later on with session, headers and cookies. Quote Link to comment Share on other sites More sharing options...
prcollin Posted July 5, 2007 Author Share Posted July 5, 2007 so for form content it would be the html format and the search would be the php code for the search bar correct? First off it is <?php not <$php <?php // search content and php content, just put them in a string ?> <html> <?php echo $search_content; ?> Form Content <?php echo $form_content; ?> </html> I find it better to put output into variable and then echo them where you need them exactly in the code. This can save some heartache later on with session, headers and cookies. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.