PHP

Moderators: None (Apply to moderate this forum)
Number of threads: 1848
Number of posts: 5016

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Problem in WordPress plugin source Posted by jobromedia on 18 Sept 2008 at 8:49 AM
So this is my plugin.

<?php
/*
Plugin Name: Before maintainence
Plugin URI: http://jbm.net76.net/?p=119
Description: Shows a message that site goes into maintainence soon.
Author: Johan Brodd
Version: 1
Author URI: http://jbm.net76.net/?p=119
*/

function hello_world() {
 $hello = get_option(’hello_global’);
 Print(”$hello”);
}

function modify_menu() {
 add_options_page(
  ‘Hello World’,
  ‘Hello World’,
  ‘manage_options’,
  _File_,
  ‘admin_hello_options’
 );
}

function admin_hello_options(){
Print(”<h2>Hello World Plugin</h2>”);
if ($_REQUEST['submit']){
 upate_hello_options();
}
print_hello_form();
}

function upate_hello_options(){
if ($_REQUEST['hello_global']) {
update_option(’hello_global’,$_REQUEST['hello_global']);
}
}

function print_hello_form() {
$default_greeting = get_option(’hello_global’);
Print (”<form method=’post’><label for=’hello_global’>Greeting:
<input type=’text’ name=’hello_global’ value=’$default_greeting’>
</label>
<br />
<input type=’submit’ name=’submit’ value=’Submit’ >
</form>”);
}

?>

This code generates an unexpected TVariable error. But I cannot find what the problem is.
Report
Re: Problem in WordPress plugin source Posted by jobromedia on 25 Sept 2008 at 9:28 PM
: So this is my plugin.
:
:
: <?php
: /*
: Plugin Name: Before maintainence
: Plugin URI: http://jbm.net76.net/?p=119
: Description: Shows a message that site goes into maintainence soon.
: Author: Johan Brodd
: Version: 1
: Author URI: http://jbm.net76.net/?p=119
: */
: 
: function hello_world() {
:  $hello = get_option(’hello_global’);
:  Print(”$hello”);
: }
: 
: function modify_menu() {
:  add_options_page(
:   ‘Hello World’,
:   ‘Hello World’,
:   ‘manage_options’,
:   _File_,
:   ‘admin_hello_options’
:  );
: }
: 
: function admin_hello_options(){
: Print(”<h2>Hello World Plugin</h2>”);
: if ($_REQUEST['submit']){
:  upate_hello_options();
: }
: print_hello_form();
: }
: 
: function upate_hello_options(){
: if ($_REQUEST['hello_global']) {
: update_option(’hello_global’,$_REQUEST['hello_global']);
: }
: }
: 
: function print_hello_form() {
: $default_greeting = get_option(’hello_global’);
: Print (”<form method=’post’><label for=’hello_global’>Greeting:
: <input type=’text’ name=’hello_global’ value=’$default_greeting’>
: </label>
: <br />
: <input type=’submit’ name=’submit’ value=’Submit’ >
: </form>”);
: }
: 
: ?>
:
: This code generates an unexpected TVariable error. But I cannot find
: what the problem is.

And no response so far... I am waiting.



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.