judeddokoinu Posted April 14, 2006 Share Posted April 14, 2006 I'll do my best to explain this, forgive me if it is confusing.I have a remote server which contains a page of ever-changing data. On this page are HTML forms next to each entry on the page (about 20 are shown, if I remember correctly) Each HTML form is just a simple:[code]<form method="POST" action="http://foo.com/view.php?id=342452346"> <input type="hidden" name="password" value="yourpass"> <input type="submit" name="submit" value="submit"></form>[/code]So, I mirrored this page using a fopen() call to the URL. The reason I'm mirroring is that I want it to auto-refresh, which I can do on my own server via PHP. ALL OF THAT IS DONE, by the way. The page works fine.***What I'm wanting to do now is have the ability for the user(me) to enter a search term, and if one of the entries on the screen contains that term, then tell the browser to submit the form and load the next page.***Entering the search term is simple. I can get that setup and into a variable, and I can even flag when it finds it. What I DON'T know is how I can "submit" the form - possibly using a redirect, but how do I get the form's fields into the URL to redirect to? Isn't a hidden field not shown in the URL? Quote Link to comment https://forums.phpfreaks.com/topic/7405-redirect-with-form-possible/ Share on other sites More sharing options...
wildteen88 Posted April 14, 2006 Share Posted April 14, 2006 If you want to submit your form data over the URL then change your method attribute in your form to GET then any thing you submit via the form will places in the URL instead in this format:www.example.com?password=yourpass&submit=submitpassword and submit are you form elements and any think after the equals sign is the value. Quote Link to comment https://forums.phpfreaks.com/topic/7405-redirect-with-form-possible/#findComment-26984 Share on other sites More sharing options...
arifsor Posted April 14, 2006 Share Posted April 14, 2006 you need java script to post the form fields.simply write the java script function with container the following[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]function submitform(){frm.submit();}[/quote]and at the end of you php script call the java script function.[quote] Quote Link to comment https://forums.phpfreaks.com/topic/7405-redirect-with-form-possible/#findComment-26985 Share on other sites More sharing options...
judeddokoinu Posted April 14, 2006 Author Share Posted April 14, 2006 The problem with changing post to get is that the remote server uses the post vars, and not get vars. I don't have the options of changing the remote server's code.The JS option would work, but it seems that the entire page would have to load, then be examined by JS, and then the form could be submitted. I would like it to be silent - invisible... Basically:[code]1. Get listing2. Parse into variables3. If variable == search term a. submit form b. halt4. Show listings5. Refresh[/code]I've got all of it completed except for 3a Quote Link to comment https://forums.phpfreaks.com/topic/7405-redirect-with-form-possible/#findComment-26989 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.