Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

How to Implement search option in PHP

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

How to Implement search option in PHP

Postby stephenrodrics » Mon Aug 19, 2013 4:29 am

How to Implement search option in PHP

I want to load employee details once his employee ID is entered in Textbox and user press Enter key, how can I implement such a thing in PHP
stephenrodrics
New php-forum User
New php-forum User
 
Posts: 57
Joined: Thu Mar 14, 2013 6:10 am

Re: How to Implement search option in PHP

Postby sandeep605085 » Tue Aug 20, 2013 11:50 am

You can create a form like
<form action='get_employee_details.php' method='post'>
<input type='text' name='employee_id' />
<input type='submit' name='submit' value='submit' />
</form>

then when user enter the id in text box and click submit it will go to employee_detail.php and post the form values in that page.

so in employee_details.php you can write
<?php
$empId = mysql_real_escape_string($_POST['employee_id']);

/*then you can use this $empId value to get the result either from database or array or any storage where you are saving the employee_details and load on the browser whatever format you prefer */
?>

Thanks,
Sandeep Agrawal
Mindfire Solutions
User avatar
sandeep605085
New php-forum User
New php-forum User
 
Posts: 44
Joined: Tue Feb 26, 2013 6:00 am
Location: Mindfire Solutions


Return to PHP coding => General

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron