rubing Posted February 4, 2008 Share Posted February 4, 2008 Hey dudez, I am trying to write a php script that searches opens a new browser window & search engine query string, depending on user input. If the user presses 1, i want to iterate through the array and start the next search. however, if the user presses 0, i want to skip this query and proceed to ask the user about the next one. I cannot find anything about waiting for user input in php. Does something like this exist. THanks all!!! Quote Link to comment Share on other sites More sharing options...
mikefrederick Posted February 4, 2008 Share Posted February 4, 2008 never attempted something like that with php because php is server side and does not interact without reloading a page, usually this type of things requires javascript or a client-side language. Quote Link to comment Share on other sites More sharing options...
rubing Posted February 4, 2008 Author Share Posted February 4, 2008 yeah, but I don't know javascript. and i don't care if it's fast. come on!!! pleaze tell me how to do it!!! Quote Link to comment Share on other sites More sharing options...
haku Posted February 4, 2008 Share Posted February 4, 2008 As the previous poster said, this can't be done with PHP. Its a Javascript issue. Quote Link to comment Share on other sites More sharing options...
rubing Posted February 4, 2008 Author Share Posted February 4, 2008 hey, i'm not leaving this forum till you tell me how to do it. Quote Link to comment Share on other sites More sharing options...
mikefrederick Posted February 4, 2008 Share Posted February 4, 2008 you're going to be here for a long time. if you want help with javascript let me know. Quote Link to comment Share on other sites More sharing options...
rubing Posted February 4, 2008 Author Share Posted February 4, 2008 One time I fell asleep and dreamed I was an RSS feed. Why can't php be more like that, able to do anything!!!!??? I hate php!! it's a dirty whore. OK, frederick you're a nice guy. i guess i have no other choice. YES!!! I would definitely appreciate some help with javascript. even though i really don't have good feelings about this javascript thing. Quote Link to comment Share on other sites More sharing options...
mikefrederick Posted February 4, 2008 Share Posted February 4, 2008 do you have any code or link yet so I can see what you're getting at? Quote Link to comment Share on other sites More sharing options...
haku Posted February 4, 2008 Share Posted February 4, 2008 Why can't php be more like that, able to do anything!!!!??? Because its a server side language, and as a result cannot do client side functions. Same as Javascript is a client side language and cant do server side functions. Quote Link to comment Share on other sites More sharing options...
rubing Posted February 4, 2008 Author Share Posted February 4, 2008 ok my website is www.birminghammusiclive.com If you click on a day you'll see a list of music events some of them have links and some do not. I want to issue a mysqlfetcharray query to my database and return one at a time bands which are not yet hyperlinked. They should open in a new tab as a yahoo! search query: "music profile" "BANDS NAME" and then the script should wait for my input, while I go off to find the band's myspace home page. I haven't coded anything yet cause I knew that i really just needed to figure out how to get user input and the rest would be simple. Quote Link to comment Share on other sites More sharing options...
haku Posted February 4, 2008 Share Posted February 4, 2008 You need an AJAX function to be able to do this. Google 'ajax tutorials' to get on your way. Its not easy programming by any means, but it will allow you to use a combination of javascript (client-side) and php (server-side) in order to do what you want. I haven't coded anything yet cause I knew that i really just needed to figure out how to get user input and the rest would be simple. Unfortunately its not going to be simple at all. Quote Link to comment Share on other sites More sharing options...
mikefrederick Posted February 4, 2008 Share Posted February 4, 2008 setup of the table? two fields, band name and hyperlink? if you need ajax then im not understanding what you want to do correctly. you want to display all band names without hyperlinks and when you click on them go to yahoo search for music profile band name and then what will the page wait for you to do? if you need it to go through the next php row with no hyperlink then yea you have to use ajax because the keyboard function is js whereas the database info is php but why do you even want to do that? if this is just for you as the admin of the site then its just as quick to just display all the links to the yahoo search instead. Quote Link to comment Share on other sites More sharing options...
rubing Posted February 4, 2008 Author Share Posted February 4, 2008 yes! that's what i want to do. i guess you are suggesting that i am lazy, by not just printing out all the links and then copying and pasting them??? well....i just think it would save me a lot of time to have it automated. Quote Link to comment Share on other sites More sharing options...
mikefrederick Posted February 4, 2008 Share Posted February 4, 2008 no it is easy to have the links automated, no copy and paste, just not easy to integrate the keyboard commands. 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.