Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Atahualpa 3 Wordpress theme (http://forum.bytesforall.com/forumdisplay.php?f=2)
-   -   Help with Javascript Calculator/Form (http://forum.bytesforall.com/showthread.php?t=3254)

SupraTT Sep 2, 2009 09:44 PM

Help with Javascript Calculator/Form
 
I hope someone can help me here. I been trying to get a javascript form for a calculator to work on a post or page.

I found this thread, where the OP had a similar question:

http://wordpress.org/support/topic/147154

Basically, the solution was to make a copy of single.php and hardcode the javascript form into the new template.php.

Can someone guide me in the righ direction in doing this with Atahualpa? I tried copying index.php to a new file named calc.php, but even before inserting my javascript code it will not even load (just produces errors).

Thank you

SupraTT Sep 2, 2009 10:28 PM

Okay, I actually figured out how to make the template page and put my code in. However, the problem I am having is that when I tryt submit the form, all I get is a "Not Found" page error. Is it because my php variables are not set or are lost when I submit the form?

I know the code works, because if I make a standalone .php page, I am able to use the calculator. I do have the following above the header for my .php page:

Code:

<?php
// Initialize the variables
if (isset($_POST['L'])) {
    $L = $_POST['L'];
}
if (isset($_POST['c'])) {
    $c = $_POST['c'];
}
if (isset($_POST['cp'])) {
    $cp = $_POST['cp'];
}
if (isset($_POST['n'])) {
    $n = $_POST['n'];
}
if (isset($_POST['P'])) {
    $P = $_POST['P'];
}
if (isset($_POST['Pp'])) {
    $Pp = $_POST['Pp'];
}
if (isset($_POST['p'])) {
    $p = $_POST['p'];
}
if (isset($_POST['Calculate'])) {
    $Calculate = $_POST['Calculate'];
}
?>



All times are GMT -6. The time now is 06:42 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.