Results 1 to 5 of 5

 

Thread: wordpress/javascript problem

  1. #1
    Registered User

    Status
    Offline
    Join Date
    Sep 2007
    Posts
    1,351
    Thanks
    43
    Thanked 72 Times in 63 Posts


    i am calling a php file from within a wordpress page that is a form and uses javascript , i have added the javascript source to the wordpress header but the form doesnt work , yet if i call the php file from a sidebar wideget the form works?

    any ideas why it wont work from a wordpress page?

    any help/ideas would be great
    cheers

  2. #2
    Registered User

    Status
    Offline
    Join Date
    Feb 2010
    Posts
    1,392
    Thanks
    62
    Thanked 142 Times in 131 Posts
    Use a plug-in called PHP Execution but make sure you save the page in code view otherwise it is likely to be deleted when you publish.

  3. #3
    Registered User

    Status
    Offline
    Join Date
    Sep 2007
    Posts
    1,351
    Thanks
    43
    Thanked 72 Times in 63 Posts
    Quote Originally Posted by dc000000 View Post
    Use a plug-in called PHP Execution but make sure you save the page in code view otherwise it is likely to be deleted when you publish.
    cheers, already using that plugin for the php

    so the form works in widegets but not a page .

  4. #4
    scriptmonkey's Avatar
    Oranges & Lemons

    Status
    Offline
    Join Date
    Jan 2009
    Location
    Worthing
    Posts
    1,603
    Thanks
    110
    Thanked 253 Times in 192 Posts
    One thing to do is to create your own page template and place your php code in that.

    To create a page template copy your page.php to formpage.php, at the top of your new template replace the original page.php definition with your own, like this:

    PHP Code:
    <?php
    /* 
    Template Name: FormPage 
    */ 
    ?>
    Add your php code to this new template and use the template when you write the page.
    The trouble with the rat race is that even if you win you're still a rat.
    Time passes. Listen. Time passes. Dylan Thomas
    Ebay Alerts to your inbox

  5. #5
    Registered User

    Status
    Offline
    Join Date
    Sep 2007
    Posts
    1,351
    Thanks
    43
    Thanked 72 Times in 63 Posts
    Quote Originally Posted by scriptmonkey View Post
    One thing to do is to create your own page template and place your php code in that.

    To create a page template copy your page.php to formpage.php, at the top of your new template replace the original page.php definition with your own, like this:

    PHP Code:
    <?php
    /* 
    Template Name: FormPage 
    */ 
    ?>
    Add your php code to this new template and use the template when you write the page.
    cheers, will try that



Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
To Top

Content Relevant URLs by vBSEO 3.5.0 RC2