DoorsRent Posted March 23, 2009 Share Posted March 23, 2009 I have a program that uses fopen() to read in a .html page. The html page is generated based off input from a textbox. Is it possible to use PHP to put text into that text box then use fopen() to read the output? If there's a way to open up a page and input into a text box then I can probably figure out the rest. Thank you Quote Link to comment Share on other sites More sharing options...
rhodesa Posted March 23, 2009 Share Posted March 23, 2009 do you mean enter text into an input, submit a form, and get the output from that? Quote Link to comment Share on other sites More sharing options...
waynewex Posted March 23, 2009 Share Posted March 23, 2009 <?php if(isset($_POST['value'])) echo 'value="'.htmlentities($_POST['value'],ENT_QUOTES,"utf-8").'"'; ?> Quote Link to comment Share on other sites More sharing options...
DoorsRent Posted March 23, 2009 Author Share Posted March 23, 2009 do you mean enter text into an input, submit a form, and get the output from that? Yes, but the form is processed with javascript. Quote Link to comment Share on other sites More sharing options...
waynewex Posted March 23, 2009 Share Posted March 23, 2009 do you mean enter text into an input, submit a form, and get the output from that? Yes, but the form is processed with javascript. What do you mean by processed? Surely you mean Ajax? Or are you talking about a client side validation check using JS? Post the code. Quote Link to comment Share on other sites More sharing options...
DoorsRent Posted March 23, 2009 Author Share Posted March 23, 2009 What do you mean by processed? Surely you mean Ajax? Or are you talking about a client side validation check using JS? Post the code. The form code is below. I need to enter text into the text box "TxtpCode" then submit the form and read the resulting hml page. <form action="/site/olspage.jsp?_DARGS=/site/en_US/checkout/olschkjlfindersearchform.jsp" name="frmjlsSearchForm" method="POST"><input value="ISO-8859-1" type="hidden" name="_dyncharset"> <input type="hidden" name="sourcePageURL" value="olspage.jsp?id=1202649765246&type=product"/> <input type="hidden" name="listingType" value="null"/> <input value="http://www.domain.com/site/olspage.jsp?id=cat14001&type=page&redirectAfterSessCatId=pcat17005&redirectAfterSessCatType=page" type="hidden" name="/domain/digiterra/h/lcd/formhandler/formatQuickjlsFormHandler.sessionExpiryURL"><input value=" " type="hidden" name="_D:/domain/digiterra/h/lcd/formhandler/formatQuickjlsFormHandler.sessionExpiryURL"> <input value="olspage.jsp?id=1202649765246&type=product" type="hidden" name="/domain/digiterra/h/lcd/formhandler/formatQuickjlsFormHandler.cancelURL"><input value=" " type="hidden" name="_D:/domain/digiterra/h/lcd/formhandler/formatQuickjlsFormHandler.cancelURL"> <input value="olspage.jsp?id=pcat17006&type=page" type="hidden" name="/domain/digiterra/h/lcd/formhandler/formatQuickjlsFormHandler.refreshURL"><input value=" " type="hidden" name="_D:/domain/digiterra/h/lcd/formhandler/formatQuickjlsFormHandler.refreshURL"> <input value="olspage.jsp?id=1202649765246&type=product" type="hidden" name="/domain/digiterra/h/lcd/formhandler/formatQuickjlsFormHandler.successURL"><input value=" " type="hidden" name="_D:/domain/digiterra/h/lcd/formhandler/formatQuickjlsFormHandler.successURL"> <div class="frame" style="margin-bottom:10px;"> <div class="content" style="padding-top:7px;"> <table cellpadding="0" cellspacing="0" blcd="0"> <tr> <td valign="bottom"> <span class='Body-Small'><b>p Code</b></span><br /> <input value="" maxlength="9" type="text" onkeypress="javascript:return handleQuickjlsSearchEnterKeyPress();" style="width:100px;" size="20" name="TxtpCode"><input value=" " type="hidden" name="_D:TxtpCode"> </td> <td width="30" > <span class='Body-Small'><b>OR</b></span> </td> <td valign="bottom"> <span class='Body-Small'><b>City</b></span><br /> <input value="" style="width:140px;" size="20" name="TxtCity"><input value=" " type="hidden" name="_D:TxtCity"> </td> <td valign="bottom"> <span class='Body-Small'><b>State</b></span><br /> <div id=hidethisdropdown> <input value=" " type="hidden" name="_D:DrpState"></input><select style="width:145px;" name="DrpState"><option value="" selected>Select State <option value="AL"> AL - Alabama<option value="AK"> AK - Alaska<option value="AP"> AP - Armed Forces Pacific<option value="AE"> AE - Armed Forces Europe<option value="AA"> AA - Armed Forces America<option value="AZ"> AZ - Arizona<option value="AR"> AR - Arkansas<option value="CA"> CA - California<option value="CO"> CO - Colorado<option value="CT"> CT - Connecticut<option value="DC"> DC - Washington D.C.<option value="DE"> DE - Delaware<option value="FL"> FL - Florida<option value="GA"> GA - Georgia<option value="GU"> GU - Guam<option value="HI"> HI - Hawaii<option value="ID"> ID - Idaho<option value="IL"> IL - Illinois<option value="IN"> IN - Indiana<option value="IA"> IA - Iowa<option value="KS"> KS - Kansas<option value="KY"> KY - Kentucky<option value="LA"> LA - Louisiana<option value="ME"> ME - Maine<option value="MD"> MD - Maryland<option value="MA"> MA - Massachusetts<option value="MI"> MI - Michigan<option value="MN"> MN - Minnesota<option value="MS"> MS - Mississippi<option value="MO"> MO - Missouri<option value="MT"> MT - Montana<option value="NE"> NE - Nebraska<option value="NV"> NV - Nevada<option value="NH"> NH - New Hampshire<option value="NJ"> NJ - New Jersey<option value="NM"> NM - New Mexico<option value="NY"> NY - New York<option value="NC"> NC - North Carolina<option value="ND"> ND - North Dakota<option value="OH"> OH - Ohio<option value="OK"> OK - Oklahoma<option value="OR"> OR - Oregon<option value="PA"> PA - Pennsylvania<option value="RI"> RI - Rhode Island<option value="SC"> SC - South Carolina<option value="SD"> SD - South Dakota<option value="TN"> TN - Tennessee<option value="TX"> TX - Texas<option value="UT"> UT - Utah<option value="VT"> VT - Vermont<option value="VA"> VA - Virginia<option value="VI"> VI - Virgin Islands<option value="WA"> WA - Washington<option value="WV"> WV - West Virginia<option value="WI"> WI - Wisconsin<option value="WY"> WY - Wyoming</select></div> </td> </tr> </table><br /> <input type="image" onclick="javascript:return clearlcdURL();" src="http://images.domain.com:80/domain_US/en_US/images/global/buttons/btnpa_findjl.gif" blcd="0" alt="Find Nearest jl" name="/domain/digiterra/h/lcd/formhandler/formatQuickjlsFormHandler.jlSearch"><input value=" " type="hidden" name="_D:/domain/digiterra/h/lcd/formhandler/formatQuickjlsFormHandler.jlSearch"> <input type="image" style="margin-right:10px;" src="http://images.domain.com:80/domain_US/en_US/images/global/buttons/btnsa_cancel.gif" blcd="0" alt="Cancel" name="/domain/digiterra/h/lcd/formhandler/formatQuickjlsFormHandler.cancelSearch"><input value=" " type="hidden" name="_D:/domain/digiterra/h/lcd/formhandler/formatQuickjlsFormHandler.cancelSearch"> <br /> </div> </div> <script> document.frmjlsSearchForm.TxtpCode.focus(); </script> <input value="/site/en_US/checkout/olschkjlfindersearchform.jsp" type="hidden" name="_DARGS"></form> Quote Link to comment Share on other sites More sharing options...
rhodesa Posted March 23, 2009 Share Posted March 23, 2009 well...if you break down the form, you should be able to gather all the parts (the page it posts too and all the input elements). then, you can use cURL to do a POST with all that and read the results http://www.php.net/curl Quote Link to comment Share on other sites More sharing options...
DoorsRent Posted March 23, 2009 Author Share Posted March 23, 2009 well...if you break down the form, you should be able to gather all the parts (the page it posts too and all the input elements). then, you can use cURL to do a POST with all that and read the results http://www.php.net/curl I'm confused on how to determine what page it posts to. I don't know much about javascript, but I've done similar things with html. As far as I can tell the page it posts to is a javascript function. Do you know how to handle that? That's the main thing I'm confused about - <input value="" maxlength="9" type="text" onkeypress="javascript:return handleQuickjlsSearchEnterKeyPress();" style="width:100px;" size="20" name="TxtpCode"><input value=" " type="hidden" name="_D:TxtpCode"> </td> Quote Link to comment Share on other sites More sharing options...
rhodesa Posted March 23, 2009 Share Posted March 23, 2009 no...that is an event fired as you type stuff in...my guess would be some sort of type ahead helper. the form posts to the action attribute of the form: /site/olspage.jsp?_DARGS=/site/en_US/checkout/olschkjlfindersearchform.jsp 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.