anon Posted May 24, 2007 Share Posted May 24, 2007 Can anyone give me the code for a simple 'Search' button, which has an action tied to it. Such as a PHP action. ??? ??? Link to comment https://forums.phpfreaks.com/topic/52804-solved-code-for-submit-button/ Share on other sites More sharing options...
Lumio Posted May 24, 2007 Share Posted May 24, 2007 <?php if (isset($_POST['search_sent'])) { print_r($_POST); } ?><form name="search_form" action="<?= htmlspecialchars($_SERVER['PHP_SELF']) ?>" method="POST"> <input type="text" name="search" value="" /><input type="submit" name="go" value="Search" /> <input type="hidden" name="search_sent" value="1" /> </form> Link to comment https://forums.phpfreaks.com/topic/52804-solved-code-for-submit-button/#findComment-260684 Share on other sites More sharing options...
anon Posted May 24, 2007 Author Share Posted May 24, 2007 <?php if (isset($_POST['search_sent'])) { print_r($_POST); } ?><form name="search_form" action="<?= htmlspecialchars($_SERVER['PHP_SELF']) ?>" method="POST"> <input type="text" name="search" value="" /><input type="submit" name="go" value="Search" /> <input type="hidden" name="search_sent" value="1" /> </form> THANKS ALOT, but how would i get the search box to be bigger? Link to comment https://forums.phpfreaks.com/topic/52804-solved-code-for-submit-button/#findComment-260689 Share on other sites More sharing options...
craygo Posted May 24, 2007 Share Posted May 24, 2007 add the size to the input <input type="text" name="search" size=50 value="" /> Ray Link to comment https://forums.phpfreaks.com/topic/52804-solved-code-for-submit-button/#findComment-260693 Share on other sites More sharing options...
anon Posted May 24, 2007 Author Share Posted May 24, 2007 add the size to the input <input type="text" name="search" size=50 value="" /> Ray <Thank you, will try/> Link to comment https://forums.phpfreaks.com/topic/52804-solved-code-for-submit-button/#findComment-260699 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.