Note that there are some explanatory texts on larger screens.

plurals
  1. POPHP website to pass specific information only when queried
    text
    copied!<p>I'm having trouble trying to come up with a clever way to do what I need to do. Quite basically I have a general site, created by a custom build CMS editor, everything is fine. What I want to have happen, is when the user is in our CMS editor, via AJAX request in the background, it will quickly query the page the user is viewing and return back special instructions depending on the data that is received. Such as:</p> <p>The contact page has some special instructions to the CMS, maybe that everything needs to have a title and a subtitle. So those triggers are coded into the contact.php, but not displayed to the regular joe viewing the website. No fields.</p> <p>But when the user is in our CMS, I want it to send a special request to <a href="http://www.something.com/contact.php" rel="nofollow">http://www.something.com/contact.php</a>, and contact.php will know its the CMS knocking on its door, and will reply back with special instructions. Whethor it be JSON, or XML, something, I'm not fussy.</p> <p>The real issue I am coming across is having contact.php display either versions of itself. I can return a JSON string, but jQuery Ajax doesnt know howto handle it as there are other elements in the response. If jQuery->Ajax could ignore the whole page and just grab the JSON that should be fine.</p> <pre><code>&lt;html&gt; &lt;body&gt; &lt;h1&gt;blah blah&lt;/h1&gt; ...etc ...etc &lt;script&gt;var requiredSettings = {[json blah blah blha ]};&lt;/script&gt; &lt;p&gt;loreum ipsum etc..&lt;/p&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>That is what I have to work with, how can an jQuery->Ajax request ignore all the wqrong headers and the html junk and only use the JSON.</p> <p>I am very open to other methods, so long as the contact.php can remain intact and visible by users but play double duty and report back to the CMS when the CMS requests information.</p> <p>The CMS and contact.php will be on different servers.</p> <p>Thank you for your time.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload