Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

anup@xentrictechnologies.in on "wordpress default function is not working in my custom plugin,please help me."

$
0
0

i am new in plugin development.i am submitting a form in front end,after submitting i am showing a simple hello message.

but during form submission below error are showing:

Fatal error: Call to undefined function get_option() in C:\wamp\www\Anup\dating_world\wp-content\plugins\registration_form\registration_form.php on line 9
please help me
here is my plugin code:

<?php
/*
Plugin Name: Registration Form
Description: WordPress plugin for register user
Author: Anup
Version: 3.5.2
site:http://anupkoldhn.wix.com/anup
*/
$siteurl=get_option('siteurl');

define('REGISTER_FORM_FOLDER',dirname(plugin_basename(__FILE__)));
define('REGISTER_FORM_URL',$siteurl.'/wp-content/plugins/'.REGISTER_FORM_FOLDER);
define('REGISTER_FORM_FILE_PATH',dirname(__FILE__));
define('REGISTER_FORM_DIR_NAME',basename(REGISTER_FORM_FILE_PATH));

	add_action('front_display','front_display');
	add_shortcode('register','front_display');
function front_display()
{
	/*$user_data = array('ID' => '','user_pass' =>'anup123','user_login' => 'anup123','display_name' =>'anup123','first_name' =>'anup324','last_name' =>'baba44','role' =>'subscriber');
       echo "sggg".$user_id = wp_insert_user( $user_data );*/

	   if(isset($_REQUEST['submit']))
	   {
		   echo "hello";
	   }
?>

 	<table>
<form name="form" id="form" method="post" action="http://localhost/Anup/dating_world/wp-content/plugins/registration_form/registration_form.php" >
    <tr><td colspan="2" align="center"><span id="message"></span></td></tr>
    <tr><td>UserName:</td><td><input type="text" name="name" id="name" /></td></tr>
     <tr><td>Password:</td><td><input type="password" name="password" id="password" /></td></tr>
    <tr><td>Email:</td><td><input type="email" name="email" id="email" /></td></tr>
    <tr><td>Gender:</td><td><select id="gender" name="gender">
    							<option value="men">Men</option>
                           		 <option value="woman">Woman</option>
                             </select>
    </td></tr>
    <tr><td colspan="2" align="center"><input type="submit" value="Submit" name="submit" /></td></tr>
    </form>
    </table>

<?php

}
?>

[Please post code or markup between backticks or use the code button. Or better still - use a pastebin. Your posted code may now have been permanently damaged/corrupted by the forum's parser.]


Viewing all articles
Browse latest Browse all 8245

Trending Articles