insert javascript and php into a wp-page (1 post)

  1. daniell
    Posted 9 years ago #

    Hi im trying to make a script that get info like pagerank and alexa rank work in my wordpress..

    i need to insert this a new page created in WP.. its a ajax script.. the other folders and files are already in server


    <script language="javascript" type="text/javascript" src="./js/main.js"></script>
    <form method="post" action="./" onsubmit="getResults(this.url.value); return false;">
    <input type="text" name="url" value="<?php echo ($_GET['url']) ? htmlspecialchars($_GET['url']) : 'http://www.google.com/'; ?>" size="40" />
    <input type="submit" value="Submit" />
    <div id="results">
    <div>Use the form above to check your PageRank and more!</div>
    <?php if ($_GET['url']) { ?>
    <script language="javascript" type="text/javascript">
    window.onload = function () {
    getResults('<?php echo $_GET['url']; ?>');
    <?php } ?>

Topic Closed

This topic has been closed to new replies.

About this Topic