Using php variable inside a wordpress page through admin interface - php

I have a wordpress page in which i have a form(used machform which redirects & stores data in session) submitting it redirects to another wordpress page. Now i want to use session value in the second page. I am new to wordpress, can i use php tags inside a page through admin interface so that i can retrieve the session value?
Please help me on this
Thanks

get the exec-php plugin

Related

Send $_POST data to custom Wordpress plugin

I have a custom Wordpress plugin that handles many things including download pages for my products. The links are not the path to the actual PHP page to my plugin. For example...
http://myurl.com/download/product
But the path to my plugin that actually handles the download function is this path:
http://myurl.com/wp-content/plugins/myplugin/myplugin.php
I have built an app that uses these download links to grant a user the ability to download a product after purchase. But now I need to send extra data along with the url. How can I send some additional $_POST data when the users click on the download link. I have tried
http://myurl.com/download/product?id=2345&user=tom
But when I try to echo out the variables in myplugin.php I get nothing.
echo $_GET['id'];
echo $_GET['user'];
I have also tried to use a form and send hidden inputs but still the same result.
Any help would be greatly appreciated.
Create a new shortcode (maybe empty that does nothing) and put it on some page you created from WordPress.
Then, form action will be the URL to new page where you send data you need to send and method will be post.
You can handle the data you sent in new shortcode function in your plugin using $_POST['data']
This might help you as an alternative solution.

Adding functionality to view in admin mode

I am developing a website, and I need to give 'admin' user CRUD(create/read/update/delete) functionality.
I am developing using php and CodeIgniter.
I have a view called gallery.php which display thumbnails, as grid.
each thumbnail have 2 buttons below(edit,delete) the thumbnail.
I want...
admin user - need to see those 2 buttons.
all rest wont see those 2 buttons.
I what to use the same view(not to duplicate it...) and just hide those buttons in case user is not admin.
What do I need to do? passing $is_admin to gallery.php seems to be a little ugly i guess.
Thx
when you login check its admin or not than store into session variable.
no need to create same page again & again ..
no need to pass variable into url..
just use session variable for checking its admin or not.

nyroModal AJAX and Wordpress Data

I'm currently using nyroModal to pull a HTML form page. This form's values are automatically pre filled with the current user's data when the user is logged in, as well as information from the current page. I'm using the typical nyroModal call script so
$('#get_deal, #contact_first').nyroModal();
The form loads just fine when I have just the form with no Wordpress functions, however when I call the Wordpress function get_currentuserinfo(); it errors out and gives me the error call to undefined function. When I go to the particular page it is showing the data being pulled correctly.
I figure it has to do with it being AJAX, but not sure how to correct it. Should I be loading a separate script once the nyroModal has finished loading? If so any tips on how to do this?
Thank you for your help!
Adam

Pass form data from block to a page view in Drupal

I am using the location module and views module for a postcode search, which works fine in a page display using views.
However I want the user to be able to enter their postcode into a block on the homepage and clicking submit my module sends them to the page created in views and the postcode is set as a session S_SESSION['postcode'] before sending to this page, next I want the location page to load but using the session to display the locations automatically.
Any ideas I am using hook_form_submit() and inside that declaring the $form_state as a session and then using $form_state['redirect'] to sent to the views page path.
Ok the way to do this, is to create a mini panel and assign the view to that mini panel and then select the submit handler to go to the views page.

Php form for registered users in joomla

I am using joomla cms for my website, I need to add a php form for example to edit their profile details of registered users. I have created a separate php form to do so. I could use the wrapper module to display this form for registered users. But when i copy the link for ex, http://localhost/joomla/edit-your-profile.php , public user can still view and use that form. So I need to check whether user logged in or not using session/$my variable details. Is it possible?
SEE Joomla Login Session Tutorial
(via Custom Sessions with Joomla which should also be helpul.
You can also use a form builder. You will only need to create a PHP form by means of an intuitive interface and generate a code that can be easily copied and pasted to any web page.

Categories