我已创建正面注册表,如下所示
<?php
/* ------------------------------------------------------------------------------------------------------------
Template Name: newForm-template
------------------------------------------------------------------------------------------------------------ */
get_header(); ?>
<div id="content" class="clearfix">
<?php while ( have_posts() ) : the_post(); ?>
<div class="column column-title">
<?php get_template_part( \'breadcrumb\' ); ?>
<?php the_title( \'<h1 class="title-header">\', \'</h1>\' ); ?>
</div><!-- end .column-title -->
<div class="column column-narrow">
<?php dynamic_sidebar( \'sidebar-4\' ); ?>
</div><!-- end .column-narrow -->
<div class="column column-content single">
<?php get_template_part( \'content\', \'page\' );
comments_template(); ?>
</div><!-- end .column-content -->
<div class="column column-narrow column-last">
<?php dynamic_sidebar( \'sidebar-5\' ); ?>
</div><!-- end .column-narrow -->
<?php endwhile; ?>
<!-- Form to be display on user side -->
<?php
global $post;
// clear the cashe data meance not repeat a post, when refresh the page
if(isset($_POST[\'submit\']) ){
global $wpdb; // to connect a database
//store array arg in database
$custompost = array(\'post_status\' => \'publish\', \'post_type\' => \'post\', \'post_author\' => $user_ID,
\'ping_status\' => get_option(\'default_ping_status\'), \'post_parent\' => 0,
\'menu_order\' => 0,\'post_content_filtered\' => \'\', \'post_excerpt\' => \'\', \'import_id\' => 0,
\'post_content\' => $_POST[\'content\'], \'post_title\' => $_POST[\'contactTitle\']);
//var_dump($id);
$postId = wp_insert_post($custompost);
?>
<div id="postbox">
<form action="<?php echo $_SERVER[\'REQUEST_URI\']?>" method="post" >
<table border="0">
<tr>
<td><h2>Registration Form</h2></td>
</tr>
<tr><td><label for="name">Name:</label></td>
<td><input type="text" id="name" value="" tabindex="1" size="20" name="name" />
</td></tr>
<tr>
<td><label for="designation">Designation/Class:</label></td>
<td><input type="text" id="designation" value="" tabindex="1" size="20" name="designation" /></td>
<td><label for="sex">Sex:</label>
<input type="radio" name="sex" value="male">Male
<input type="radio" name="sex" value="female">Female</td>
</tr>
<tr>
<td><label for="organization">Organization:</label></td>
<td><input type="text" id="organization" value="" tabindex="1" size="20" name="organization" /></td>
</tr>
<tr>
<td><label for="postaladdress">Postal Address</label></td>
<td><textarea id="postaladdress" tabindex="3" name="postaladdress" cols="25" rows="3"></textarea></td>
</tr>
<tr>
<td><label for="telephoneoffice">Telephone Office:</label></td>
<td><input type="text" id="telephoneoffice" value="" tabindex="1" size="20" name="telephoneoffice" /></td>
<td><label for="mob">Mob:</label>
<input type="text" id="Mob" value="" tabindex="1" size="20" name="mob" /></td>
</tr>
<tr>
<td><label for="emailaddress">Email Address:</label></td>
<td><input type="text" id="emailaddress" value="" tabindex="1" size="20" name="emailaddress" /></td>
</tr>
<tr>
<td><label for="academicqualification">Academic Qualification:</label></td>
<td><input type="text" id="academicqualification" value="" tabindex="1" size="20" name="academicqualification" /></td>
</tr>
<tr>
<td><label for="experience">Experience Teaching / Industry:</label></td>
<td><input type="text" id="experience" value="" tabindex="1" size="20" name="experience" /></td>
</tr>
<tr>
<td><label for="titleofpaper">Title of Paper(s)</label></td>
<td><textarea id="titleofpaper" tabindex="3" name="titleofpaper" cols="25" rows="3"></textarea></td>
</tr>
<tr>
<td><label for="participationas">Participation as:</label></td>
<td><input type="text" id="participationas" value="" tabindex="1" size="20" name="participationas" /></td>
</tr>
<tr>
<td><label for="participationas">Participation as:</label></td>
<td><select>
<option value="faculty">Faculty</option>
<option value="research">Research Scholar</option>
<option value="under">Under Graduate Student</option>
<option value="industrial">Industrial Participant</option>
<option value="participant">Participant Outside India</option>
</select></td>
</tr>
<tr align="center">
<td colspan="2"><button type="submit" name="submit">Submit</button>
<input type="hidden" name="submitted" id="submitted" value="true" /></td>
</tr>
</table>
</form>
</div><!-- end #content -->
<?php get_footer(); ?> **Line 142 this**
但它给了我:
Parse error: 语法错误,意外的$end in/wp content/themes/academica/new template。php在线142
有人能建议我如何解决这个错误吗?