WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. daniell
    Member
    Posted 7 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

    tankz

    <script language="javascript" type="text/javascript" src="./js/main.js"></script>
    </head>
    <body>
    <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" />
    </form>
    <div id="results">
    <div>Use the form above to check your PageRank and more!</div>
    </div>
    <?php if ($_GET['url']) { ?>
    <script language="javascript" type="text/javascript">
    window.onload = function () {
    getResults('<?php echo $_GET['url']; ?>');
    }
    </script>
    <?php } ?>
    </body>
    </html>

Topic Closed

This topic has been closed to new replies.

About this Topic