+ Reply to Thread
Results 1 to 4 of 4
Like Tree2Likes
  • 1 Post By vrufusx65v
  • 1 Post By misson

Thread: WordPress PHP form plugin help...

  1. #1
    vrufusx65v's Avatar
    vrufusx65v is offline x10Hosting Member vrufusx65v is an unknown quantity at this point
    Join Date
    Aug 2009
    Location
    Dublin, Ireland
    Posts
    74

    Question WordPress PHP form plugin help...

    I'm trying to use a WordPress form builder plugin and it says to input this line of code into the template:

    PHP Code:
    echo do_shortcode ("[jigowatt_form]"); 
    and i'm not sure where to plug the line of code into, i basically just copied the contact form template page, renamed it and uploaded it. so i have the page template, i just don't understand PHP well enough to know where the line of code goes.

    My question is: where do i place the line of code above in the page template below as the main content of the page?

    Here's the entire page template to understand:

    PHP Code:
    <?php /*
    Template Name: Site Request Form
    */ 
    ?>
    <?php
    $status 
    "";
    if(isset(
    $_POST['cf_text']) ) 
    {
      
    $email_adress_where_send $lcp_cf_yourmail;
      require_once 
    "scripts/class.phpmailer.php";
      
    $mail = new PHPMailer();
        
    $mail->IsMail();
        
    $mail->IsHTML(true);    
        
    $mail->CharSet  "utf-8";
        
    $mail->From     $_POST['cf_mail'];
        
    $mail->FromName $_POST['cf_name'];
        
    $mail->WordWrap 50;    
        
    $mail->Subject  =  st_option('st_cf_subject');
        
    $mail->Body     =  $_POST['cf_text']; //
        
    $mail->AddAddressget_option('st_cf_yourmail') );
        
    $mail->AddReplyTo($_POST['cf_mail']);
      if(!
    $mail->Send()) {  // send e-mail
        
    $status =  st_option('st_cf_send_ko');
      }
      else
      {
         
    $status =  st_option('st_cf_send_ok');
      }
    }
    //allows the theme to get info from the theme options page
    /*global $options;
    foreach ($options as $value) {
        if (lcp_option( $value['id'] ) === FALSE) { $$value['id'] = $value['std']; }
        else { $$value['id'] =lcp_option( $value['id'] ); }
         $$value['id'] = stripslashes($$value['id']); 
        }                                             */
    ?>
    <?php
     get_header
    ();
    ?>
    <?php 
    ////////////////////////////////////////////////////////////////////////////////
    // INTRO (category info)
    ////////////////////////////////////////////////////////////////////////////////
    ?>
    <div id="intro_wrapper">
        <div class="intro_page">
        <h2><?php            
             
    echo $post->post_title;
        
    ?></h2>
        <div class="page_meta_box"><?php echo stripslashes(get_post_meta($post->ID'Description'true));?></div>
        </div><!-- END "div.intro_home" -->
    </div><!-- END "div#intro_wrapper" -->
    <?php 
    ////////////////////////////////////////////////////////////////////////////////
    // END INTRO
    ////////////////////////////////////////////////////////////////////////////////
    ?>

    <?php 
    ////////////////////////////////////////////////////////////////////////////////
    // CONTENT WRAPPER
    ////////////////////////////////////////////////////////////////////////////////
    ?>
    <div id="content_wrapper">
     <div class="content_shadow_right">
        <div id="content" class="content_page">

    <?php
    // >>>>>>>>>>>>>>>>> WIDGET SIDEBARS >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
        
    include 'sidebar.php';        // external link to showtime sidebar processor
    // <<<<<<<<<<<<<<<<< END WIDGETS SIDEBARS <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
    ?>            

            <div id="page" class="page_template_blog">


    <?php 
    ////////////////////////////////////////////////////////////////////////////////
    // CONTACT START
    ////////////////////////////////////////////////////////////////////////////////
    if(!isset($_POST['cf_text']) ) 
    {
    ?>

                      <?php the_post(); the_content();  ?>
                       <form class="contact_form" method="post" id="commentform" action="">
                                <p><input type="text" id="cf_name" name="cf_name" /><label for="name"><?php echo st_option('st_cf_name'); ?></label></p>

                                <p><input type="text" id="cf_mail" name="cf_mail" /><label for="mail"><?php echo st_option('st_cf_email'); ?></label></p>
                                <p><textarea rows="10" name="cf_text" id="cf_text" cols="10"></textarea></p>

                                <p><input name="submit" type="submit"  class="btn_a"  id="submit_contactform" tabindex="5" value="<?php echo get_option('st_cf_send'); ?>" /></p>
                            </form>

    <?php 
    }
    else
    {
      echo 
    $status;
    }
    ////////////////////////////////////////////////////////////////////////////////
    // CONTACT END
    ////////////////////////////////////////////////////////////////////////////////
    ?>
            </div><!-- END "div#page" -->
            <div class="clear"></div>
        </div><!-- END "div#content" -->

    </div><!-- END "div.content_shadow_right" -->    
    </div><!-- END "div#content_wrapper" -->
    <?php 
    ////////////////////////////////////////////////////////////////////////////////
    // END CONTENT WRAPPER
    ////////////////////////////////////////////////////////////////////////////////
    ?>


    <?php
     get_footer
    ();
    ?>
    dinomirt96 likes this.

  2. #2
    misson is offline x10 Spammer misson is a jewel in the rough
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,506

    Re: WordPress PHP form plugin help...

    I'm afraid I don't quite get the difficulty. You should place it wherever in the HTML source you want the form to be. Just make sure it's within <?php ... ?> tags.
    Last edited by misson; 02-11-2011 at 08:36 PM. Reason: clarified what "it" is
    karimirt47 likes this.
    Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.
    Misson, not Mission.

  3. #3
    vrufusx65v's Avatar
    vrufusx65v is offline x10Hosting Member vrufusx65v is an unknown quantity at this point
    Join Date
    Aug 2009
    Location
    Dublin, Ireland
    Posts
    74

    Re: WordPress PHP form plugin help...

    okay, well im not well versed with PHP so im not sure where to place the line of code in the above post, i cant get much more general than that.

    here's what im thinking when reading misson's post:

    place the line of code:

    PHP Code:
    echo do_shortcode ("[jigowatt_form]"); 

    into wherever you want to see HTML, so get rid of this code:

    PHP Code:
     <?php the_post(); the_content();  ?> 
                       <form class="contact_form" method="post" id="commentform" action=""> 
                                <p><input type="text" id="cf_name" name="cf_name" /><label for="name"><?php echo st_option('st_cf_name'); ?></label></p> 

                                <p><input type="text" id="cf_mail" name="cf_mail" /><label for="mail"><?php echo st_option('st_cf_email'); ?></label></p> 
                                <p><textarea rows="10" name="cf_text" id="cf_text" cols="10"></textarea></p> 

                                <p><input name="submit" type="submit"  class="btn_a"  id="submit_contactform" tabindex="5" value="<?php echo get_option('st_cf_send'); ?>" /></p> 
                            </form>
    and instead have this:

    PHP Code:
    <?php

    echo do_shortcode ("[jigowatt_form]");  

    ?>
    is this somewhat correct?

    ---------- Post added at 01:23 AM ---------- Previous post was at 01:16 AM ----------

    nvm, i just placed the code in just like i explained it and it worked. YES! i learned more PHP!!! =]

  4. #4
    misson is offline x10 Spammer misson is a jewel in the rough
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,506

    Re: WordPress PHP form plugin help...

    It can help to think in terms of host and embedded languages (which is also useful for SQL injection). The host language is simply the primary language that's being processed. When the PHP interpreter is running, PHP is the host language and things like HTML, Javascript, CSS and SQL are embedded languages. Your question then becomes "Where amidst the embedded language statements should I put this host language statement?"

    <?php switches to the host language, and ?> switches to an embedded language. You can also think of <?php ?> tags as surrounding statements in the host language (this perspective results in more readable code).


    PHP treats anything outside of PHP tags as if they were in an echo statement, except for some special handling of whitespace around PHP tags (a newline is ignored when it directly follows a PHP close tag (?>)). The script:
    PHP Code:
    <select>
      <?php for ($i=0$i<5; ++$i): ?>
        <option value="<?php echo $i?>"><?php echo $i?></option>
      <?php endfor; ?>
    </select>
    is equivalent to:

    PHP Code:
    echo "<select>\n";
    for (
    $i=0$i<5; ++$i) {
        echo 
    '      <option value="'$i'">'$i"</option>\n";
    }
    echo 
    "</select>\n"
    Last edited by misson; 02-11-2011 at 09:02 PM.
    Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.
    Misson, not Mission.

+ Reply to Thread

Similar Threads

  1. StatPress (Wordpress plugin)
    By techairlines in forum Free Hosting
    Replies: 3
    Last Post: 10-11-2009, 12:52 PM
  2. diggclone plugin for wordpress?
    By galaxyAbstractor in forum Scripts & 3rd Party Apps
    Replies: 1
    Last Post: 09-19-2009, 10:52 AM
  3. Help Using Cform plugin on wordpress
    By free4dezign in forum Scripts & 3rd Party Apps
    Replies: 2
    Last Post: 06-19-2009, 08:34 PM
  4. wordpress plugin
    By animewatch in forum Scripts & 3rd Party Apps
    Replies: 3
    Last Post: 06-21-2008, 09:58 AM
  5. Looking 4 a Wordpress Forum Plugin
    By pgames in forum Scripts & 3rd Party Apps
    Replies: 5
    Last Post: 03-06-2008, 06:59 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers