Board index   FAQ   Search  
Register  Login
Board index php forum :: Database mySQL & php coding

php open new window with sql result

Codes here !

Moderators: macek, egami, gesf

php open new window with sql result

Postby codesearcher » Thu Apr 24, 2014 7:10 am

I have this first page it has a text input type and a button input type.
What I want to achieve is to open a new windows where a list of departments from sql result are shown like this:

____________________________
deptid1 | deptname1 | button |
--------------------------------
deptid2 | deptname2 | button |
--------------------------------

Then, when I click the button, on deptid1 row, it will close this new window, and the value of deptname1, will be
the value of the text input type on the first page.

I dont see any example from google so I asked here instead.

I am only learning php on google tutorials, I hope you can share me your knowledge on this.
Please help me on my self study.
codesearcher is online now Add to codesearcher's Reputation Report Post Edit/Delete Message
codesearcher
New php-forum User
New php-forum User
 
Posts: 1
Joined: Thu Apr 24, 2014 7:07 am

Re: php open new window with sql result

Postby seandisanti » Fri Apr 25, 2014 10:10 pm

a combination of JQUERY and AJAX would be your best bet on that one. Any time you want to interact with the user, you want to use asynchronous scripting using jquery or javascript to handle the input. One thing you can do is simulate the new window with a styled div that appears when necessary using jquery toggle, here's a demonstration of hide/show with toggle: http://www.w3schools.com/jquery/eff_toggle.asp

Then once they've selected something in the window, you can use an ajax post to send a request to your server, and then receive and display the response without even having to leave the page. here's an example of that: http://www.w3schools.com/jquery/jquery_ ... t_post.asp
seandisanti
php-forum Fan User
php-forum Fan User
 
Posts: 838
Joined: Mon Oct 01, 2012 12:32 pm


Return to mySQL & php coding

Who is online

Users browsing this forum: Bing [Bot] and 1 guest

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