phoenixx Posted November 11, 2011 Share Posted November 11, 2011 I'm trying to send a submission to the following Craigslist form that uses javascript to trigger an auto submit. The user selects "For Sale" on my form and it will pass the data in a hidden div to the proper selection on the craigslist page. Heres the page it would be passing to. I know I will have to pass it in the URL. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <base href="https://post.craigslist.org"> <title>houston craigslist | choose type</title> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <link type="text/css" rel="stylesheet" media="all" href="/styles/craigslist.css?v=9"> </head> <body id="pp"> <table width="100%" id="header" summary="header"> <tr valign="top"> <td><a href="http://houston.craigslist.org/"><b>houston craigslist</b></a> > choose type<br></td> <td width="10%" class="highlight" style="text-align: right; white-space: nowrap;"> <font size="2" face="sans-serif" color="#7a7a7a">[ logged in as <a href="https://accounts.craigslist.org/login"><b>kennymahaffey@gmail.com</b></a> ] [ <a href="https://accounts.craigslist.org/logout">logout</a> ]</font> <br></td> </tr> </table> <hr> <blockquote> <div class="highlight"> <i>Please post to a single geographic area and category only -- cross-posting to multiple cities or categories is not allowed</i> </div> <h4>What type of posting is this:</h4> <form action="https://post.craigslist.org/k/kInfxI4M4RGIA7PWTF5SWg/HjdlJ" method="POST"> <blockquote> <label> <input type="radio" name="id" value="jo" onclick="form.submit(); return false;">job offered </label> <br> <label> <input type="radio" name="id" value="jw" onclick="form.submit(); return false;">resume / job wanted </label> <br> <br> <label> <input type="radio" name="id" value="ho" onclick="form.submit(); return false;">housing offered </label> <br> <label> <input type="radio" name="id" value="hw" onclick="form.submit(); return false;">housing wanted </label> <br> <br> <label> <input type="radio" name="id" value="fs" onclick="form.submit(); return false;">for sale </label> <i>(please do not post prohibited <sup><a target="_blank" href="http://www.craigslist.org/about/prohibited.items">[?]</a></sup> or recalled <sup><a target="_blank" href="http://www.craigslist.org/about/recalled_items">[?]</a></sup> items)</i> <br> <label> <input type="radio" name="id" value="iw" onclick="form.submit(); return false;">item wanted </label> <br> <br> <label> <input type="radio" name="id" value="go" onclick="form.submit(); return false;">gig offered </label> <i>(I'm hiring for a short-term, small or odd job)</i> <br> <label> <input type="radio" name="id" value="so" onclick="form.submit(); return false;">service offered </label> <br> <br> <label> <input type="radio" name="id" value="p" onclick="form.submit(); return false;">personal / romance </label> <br> <br> <label> <input type="radio" name="id" value="c" onclick="form.submit(); return false;">community </label> <br> <label> <input type="radio" name="id" value="e" onclick="form.submit(); return false;">event </label> <br> <br> </blockquote> <input type="hidden" name="U2FsdGVkX:18yNDg2NDI0O:A8dZroeLa8K5Y677RwK4hzBe2OPdD3XxLUDb5lS9LllELhxNpMqXZIwAWDxJ.7Wo4A" value="U2FsdGVkX18yNDg2NDI0OFjS1qgWn_NKgmgnh5qCZ9aK2m7eOmS-uAAM_Pwu8VHN"> <button type="submit" name="go" value="Continue">Continue</button> </form> </blockquote> Quote Link to comment https://forums.phpfreaks.com/topic/250947-passing-variable-value-to-external-site-that-uses-a-javascript-onclick-trigger/ Share on other sites More sharing options...
ManiacDan Posted November 11, 2011 Share Posted November 11, 2011 The reason why craigslist uses JS is to prevent people like you from doing things like this. Quote Link to comment https://forums.phpfreaks.com/topic/250947-passing-variable-value-to-external-site-that-uses-a-javascript-onclick-trigger/#findComment-1287406 Share on other sites More sharing options...
phoenixx Posted November 11, 2011 Author Share Posted November 11, 2011 We're writing an app for the housing industry. These are paid ads - not the freebie stuff - we're just trying to simplify the process. Quote Link to comment https://forums.phpfreaks.com/topic/250947-passing-variable-value-to-external-site-that-uses-a-javascript-onclick-trigger/#findComment-1287415 Share on other sites More sharing options...
phoenixx Posted November 11, 2011 Author Share Posted November 11, 2011 And, I might add is 100% Craigslist TOS Compliant. Again, we pay for our ads, we don't spam - I'll just figure it out - didn't come for criticism. That's why I don't frequent PF as much as I used to. Quote Link to comment https://forums.phpfreaks.com/topic/250947-passing-variable-value-to-external-site-that-uses-a-javascript-onclick-trigger/#findComment-1287419 Share on other sites More sharing options...
ManiacDan Posted November 11, 2011 Share Posted November 11, 2011 1) Automated submission and retrieval tools absolutely are a violation of the TOS unless each submission is explicitly typed out by hand. If that's what your tool does, then there';s no real reason for it to exist. However, if that's what you want and it conforms to their TOS (each entry is manually typed out by your users every time it's to be submitted) then fine, we can help. 2) There is no javascript on the page you showed aside from the form.submit() in all the onclick attributes. If that's all you want to emulate, use snoopy or curl to submit the form directly to the action itself. -Dan Quote Link to comment https://forums.phpfreaks.com/topic/250947-passing-variable-value-to-external-site-that-uses-a-javascript-onclick-trigger/#findComment-1287427 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.