Tuesday, May 26, 2009

[phpXperts] Re: how to pass variables in wordpress post or page



I have tried with permalink and custom templete but result is same...here is the code...

<?php
/*
Plugin Name:test

*/

//creating the form class//

if (!class_exists('Form'))
{
class Form
{



//constructor//
function Form()
{

add_shortcode('process',array(&$this,'process'));
}



function process()
{
echo "result is";
print $_GET[name];
print $_GET[age];

}
}

$Form=new Form();

//register the function//

if (isset($Form))
{

register_activation_hook('_FILE_',array($Form,'process'));

}
}

I have made the plugin to print the $_GET variables from url...The shortcode is [process].the page permalink is http://localhost/wordpress/archives/7.IF i give the address such as http://localhost/wordpress/archives/7?name=galib&age=10 it shows "error 404".I am beginner and I think my process is wrong...Is there any other process to do it?same result is in $_POST methods.

--- In phpexperts@yahoogroups.com, Sabuj Kundu <manchumahara@...> wrote:
>
> For action use *permalink*(page or post id), hope this will give u right url
> for action.
>
> pls check in codex that the function name is correct.
>
>
> check the $_POST or $_GET or $_REQUEST on that action page outside the loop.
>
> the action page should be custom theme file or u need to add php code in
> page and need to install any plugin who allows to executed in wp pages(page
> contents that is inserted from admin)
>
>
> let's check again and pls reply is that working or not.
>
> can u show here the two files(or just as sample) that u are using.
>
> thanks
> ........................
> Sabuj Kumar Kundu
> About Me: http://blog.manchumahara.com/about/
> http:/blog.manchumahara.com
> http://forum.amaderprojukti.com
> http://gallery.amaderprojukti.com
> http://mkabya.page.tl
>
>
>
> On Mon, May 25, 2009 at 4:08 PM, Md.asadullah-hel galib <
> galib_setu@...> wrote:
>
> >
> >
> > thanks sabuj vai....bt my problems in passing variables to pages...not
> > running php code in pages or post..if I want to pass variables by form,then
> > wat will be action field of the form...?
> > page A= localhost/wp/?p=1.then I gave the action field like following..
> > <form action="localhost/wp/?p=1">
> > bt its not working in GET/POST methods...result is:there is no such post...
> >
> > please help me.......
> >
> >
> > --- In phpexperts@yahoogroups.com <phpexperts%40yahoogroups.com>, Sabuj
> > Kundu <manchumahara@> wrote:
> > >
> > > 1. There are some plugin for wordpress which let's u execute php code in
> > > post or page's content.
> > > 2. You can set custom theme file for any page. Like create a page like
> > > single.php and give any other name that is not used as any standard theme
> > > file. Now put these lines at the top of the file
> > >
> > > <?php
> > > /*
> > > Template Name: any_name_here
> > > */
> > > ?>
> > > While creating ur required page select custom template from right side
> > and
> > > choose any_name_here template.
> > >
> > >
> > > now u can do any thing with this file/page. U can put custom code like
> > any
> > > php file .
> > > Note: if u write any thing in that page while creating from admin then
> > you
> > > can get it in *LOOP. and write ur custom code outside the loop any where
> > in
> > > that file.
> > >
> > > thanks
> > > *........................
> > > Sabuj Kumar Kundu
> > > About Me: http://blog.manchumahara.com/about/
> > > http:/blog.manchumahara.com
> > > http://forum.amaderprojukti.com
> > > http://gallery.amaderprojukti.com
> > > http://mkabya.page.tl
> > >
> > >
> > >
> > > On Sun, May 24, 2009 at 6:47 PM, Md.asadullah-hel galib <
> > > galib_setu@> wrote:
> > >
> > > >
> > > >
> > > > dear experts,I am facing some problems with WP.I have 2 pages A and B.
> > > > A contains a form.how can I pass the form variables from page A to page
> > B
> > > > or other posts?let the urls of pages are:
> > > >
> > > > page A=localhost/wordpress/?p=1
> > > > page B=localhost/wordpress/?p=2
> > > >
> > > > simply the ques is how can I pass variables between two posts or pages
> > in
> > > > wordpress.....??
> > > > waiting for repy....thanks in advance.....
> > > >
> > > >
> > > >
> > >
> >
> >
> >
>

__._,_.___
Visit phpXperts website at www.phpxperts.net
Recent Activity
Visit Your Group
Give Back

Yahoo! for Good

Get inspired

by a good cause.

Y! Toolbar

Get it Free!

easy 1-click access

to your groups.

Yahoo! Groups

Start a group

in 3 easy steps.

Connect with others.

.

__,_._,___

No comments: