To put into WordPress I copy/pasted the Javascript part of the fiddle into a Code Manager JS file and put that shortcode at the top of the page then copy/pasted the HTML from fiddle after that.
I also put the script in the header of the theme with no luck.
]]>i’m here to ask if anyone would be so nice to help me understanding something i can’t get alone.
I would need to add a HTML form i made which redirect to a PHP script the data doing something like sending email, and other things. I wrote everithing in HTML and PHP and is running on my simple HTML website, now i would like to move the website to worldpress but i got lot of problems doing this because of this form.
what should i set as action?
where the php page has to be insered?
would be nice if i could send my files to someone so to understand what i’m saying.
Thank you for reading, is much appreciated any help and sorry for my english.
Thanks,
Teo.
]]>What I need to do is create a form where the customer can put in their name and their order number and it will show the status of their repair.
I know the basic idea is to match the input info with the values of the custom fields, but I don’t know how to match those input values and pull and show the “repair status” value.
Any code samples you can throw my way would be much appreciated!
]]>https://www.ads-software.com/plugins/membership/
]]><form method="get" action="" id="real-estate-search">
<?php
wp_dropdown_categories('show_option_none=Select a State&show_count=1&hierarchical=1&taxonomy=State');
wp_dropdown_categories('show_option_none=Select a County&show_count=1&hierarchical=1&taxonomy=County');
wp_dropdown_categories('show_option_none=Select a City&show_count=1&hierarchical=1&taxonomy=City');
wp_dropdown_categories('show_option_none=Select a Company&show_count=1&hierarchical=1&taxonomy=Company');
wp_dropdown_categories('show_option_none=Agent Type&show_count=1&hierarchical=1&taxonomy=Agent');
echo '<input id="searchsubmit" class="searchsubmit" type="submit" value="Search Real Estate Agents">';
echo '</form>';
]]>$table_name = $wpdb->prefix . "imlisteningto";
When the plugin is activated.
The database itself has three columns, set up when the plugin is activated:
$sql = "CREATE TABLE $table_name (
id mediumint(9) AUTO_INCREMENT,
album VARCHAR(50),
artist VARCHAR(50),
PRIMARY KEY (id)
);";
I am trying to insert data (by creating a new row) into this database from a php form.
Within the WordPress admin, I create a new page which has the very simple form:
<form action="/wp-content/plugins/listeningto/formhtml.php" method="post">
Album: <input type="text" name="album" />
Artist: <input type="text" name="artist" />
<input type="submit">
</form>
Which as you can see calls formhtml.php, which is:
<?php
global $wpdb;
$wpdb->insert( $table_name, array( 'album' => $_POST['album'], 'artist' => $_POST['artist'] ), array( '$s', '$s' ) );
?>
When I submit the form, I get an Error 500.0 when running the plugin in Worpdress on IIS7.0, and a “Page Not Found” when running on another web server which runs apache.
If I change formhtml.php to:
<?php
echo $_POST['album'];
echo $_POST['artist'];
?>
Works fine – I get the album and artist that I put in the form. Obviously something I’m doing wrong when inserting the data (in a new row) into the database.
Then, during testing, I did this – if I update formhtml.php with this (include the config file):
<?php
require_once('../../../wp-config.php');
$table_name = $wpdb->prefix . "imlisteningto";
$wpdb->insert( $table_name, array( 'album' => $_POST['album'], 'artist' => $_POST['artist'] ), array( '$s', '$s' ) );
?>
I no longer get an error message, but data still doesn’t get put into the database.
I also tried
<?php
require_once('../../../wp-config.php');
global $wpdb;
$table_name = $wpdb->prefix . "imlisteningto";
$wpdb->insert( $table_name, array( 'album' => $_POST['album'], 'artist' => $_POST['artist'] ), array( '$s', '$s' ) );
?>
]]>Hoping you might be able to help me out.
I am playing around with plugin development and would like to take data from a form and put into a database that I have created.
The database is called music (or wp_music after adding the prefix when creating the database upon plugin activation, following this: https://codex.www.ads-software.com/Creating_Tables_with_Plugins). It has three columns, ID (primary key), Album, Artist. ID is set to auto increment.
The plugin creates its own page in admin, which is an html doc in which has a very small, easy form:
htmlform.html
<form action="formhtml.php" method="post">
Album: <input type="text" name="album" />
Artist: <input type="text" name="artist" />
<input type="submit" />
</form>
formhtml.php
<?php
global $wpdb
$album=$_POST['album'];
$artist=$_POST['artist'];
$wpdb->insert( 'music', array( 'album' => $album, 'artist' => $artist ), array( '%s', '%s' ) )
?>
And I get an Error 500 internal server error.
I’ve tried replacing ‘music’ with ‘wp_music’ too.
Perhaps someone can steer me in the right direction? let me know if you need any info!
Many thanks,
Mat
Site is currently here.
]]>For example, if I have 2 dropdown menus and I call one of them Menu1 and the other Menu2
Menu1 has 3 items: “Pizza”, “Hamburger” and “Sushi”
Menu2 has 8 items: “Calzone”, “Hawaii”, “Capricciosa” “Big Mac”, “Whopper Pepper”,
“Big Sushi Plate”, “Rice with salmon”
If I select Pizza from Menu1 I will only get to choose between Calzone, Hawaii and Capricciosa from the Menu2 dropdown list.
If I chose Hamburger from Menu1 I will only get to choose betwen Big Mac and Whopper Pepper at the second dropdown menu(menu2).
So in other words. The values in menu2 changes depending on what have been selected at menu1.
]]>I created some months ago a complex PHP form. Nowadays it is working fine, but now I want to integrate the same PHP form inside a Page in WordPress. I tried to include the code inside a Template copying the same structure but it doesn’t work.
I think it must be easy to do it but I don’t know how!
Can anybody help me?
Here is the original PHP form link:
Here the 2 PHP files I worked with, before trying to include them in WordPress:
[PLEASE PASTE CODE IN A PASTEBIN AND REPORT LINK BACK HERE]
And here the mess I did ^__^U with the template:
[PLEASE PASTE CODE IN A PASTEBIN AND REPORT LINK BACK HERE]
Thank you people
]]>