<?xml version="1.0"?><!-- generator="bbPress" -->

<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
>

<channel>
<title>MachForm Community Forums Topic: Problem with validate_username function</title>
<link>https://www.machform.com/forums/</link>
<description>MachForm Community Forums Topic: Problem with validate_username function</description>
<language>en</language>
<pubDate>Mon, 04 May 2026 05:50:16 +0000</pubDate>

<item>
<title>yuniar on "Problem with validate_username function"</title>
<link>https://www.machform.com/forums/topic/problem-with-validate_username-function#post-10283</link>
<pubDate>Wed, 25 Aug 2010 19:56:19 +0000</pubDate>
<dc:creator>yuniar</dc:creator>
<guid isPermaLink="false">10283@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;jvarn -- yep, that works best indeed. As a matter of fact, I think we'll doing it that way for the next update.
&#60;/p&#62;</description>
</item>
<item>
<title>jvarn1 on "Problem with validate_username function"</title>
<link>https://www.machform.com/forums/topic/problem-with-validate_username-function#post-10273</link>
<pubDate>Tue, 24 Aug 2010 20:37:30 +0000</pubDate>
<dc:creator>jvarn1</dc:creator>
<guid isPermaLink="false">10273@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;It's a pain to have to remember to add:&#60;/p&#62;
&#60;p&#62;	mysql_select_db('your_wordpress_db_here'); //&#38;lt;-- this line&#60;/p&#62;
&#60;p&#62;Every time in the embed code.&#60;/p&#62;
&#60;p&#62;Instead I just did a search and replace on DB_NAME, DB_PASSWORD, DB_USER, and DB_HOST across all the MachForm files using Coda and replaced all occurrences with MF_DB_NAME, MF_DB_PASSWORD etc.&#60;/p&#62;
&#60;p&#62;This way I can still use the copy-and-pasteable embed code from within MachForms without having to add the additional line above.
&#60;/p&#62;</description>
</item>
<item>
<title>jolynnbraley on "Problem with validate_username function"</title>
<link>https://www.machform.com/forums/topic/problem-with-validate_username-function#post-9469</link>
<pubDate>Sun, 16 May 2010 06:53:19 +0000</pubDate>
<dc:creator>jolynnbraley</dc:creator>
<guid isPermaLink="false">9469@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Thanks Yuniar. My db's run on the same server but I also had to add in those other changes to the $link line of code after making the change in my php code in my WP page, and now the form is displaying in my WP page. &#60;/p&#62;
&#60;p&#62;It has a couple other issues and I'll work on those now, and then I want to connect it to Aweber. At least it's connecting to the db now though - progress is being made! :)&#60;/p&#62;
&#60;p&#62;JoLynn
&#60;/p&#62;</description>
</item>
<item>
<title>yuniar on "Problem with validate_username function"</title>
<link>https://www.machform.com/forums/topic/problem-with-validate_username-function#post-9467</link>
<pubDate>Sat, 15 May 2010 13:56:24 +0000</pubDate>
<dc:creator>yuniar</dc:creator>
<guid isPermaLink="false">9467@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;That code should be placed into your WordPress post/page, which you can do it from WordPress admin panel.
&#60;/p&#62;</description>
</item>
<item>
<title>jolynnbraley on "Problem with validate_username function"</title>
<link>https://www.machform.com/forums/topic/problem-with-validate_username-function#post-9463</link>
<pubDate>Sat, 15 May 2010 06:46:50 +0000</pubDate>
<dc:creator>jolynnbraley</dc:creator>
<guid isPermaLink="false">9463@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Hi, in your comment above where you wrote, &#34;also, adjust your php embed code, add the code to re-select your wordpress db. like this:&#34;, which is followed by the block of code underneath.....what is the exact name of the file that code is to be placed in? &#60;/p&#62;
&#60;p&#62;Thanks!
&#60;/p&#62;</description>
</item>
<item>
<title>bfkouba on "Problem with validate_username function"</title>
<link>https://www.machform.com/forums/topic/problem-with-validate_username-function#post-6492</link>
<pubDate>Tue, 07 Jul 2009 12:22:41 +0000</pubDate>
<dc:creator>bfkouba</dc:creator>
<guid isPermaLink="false">6492@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;This was helpful... this is the information you need (including that last step) if you're having trouble integrating with wordpress. Worked for me.
&#60;/p&#62;</description>
</item>
<item>
<title>yuniar on "Problem with validate_username function"</title>
<link>https://www.machform.com/forums/topic/problem-with-validate_username-function#post-4670</link>
<pubDate>Sat, 14 Feb 2009 17:19:31 +0000</pubDate>
<dc:creator>yuniar</dc:creator>
<guid isPermaLink="false">4670@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Ah.. I see. If that is the case, you need to edit another line of db-core.php file.&#60;/p&#62;
&#60;p&#62;Search for this line:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;$link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD) or die(&#38;#39;Could not connect: &#38;#39; . mysql_error());&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;change the DB_HOST, DB_USER and DB_PASSWORD above with a quoted string, exactly like DB_NAME
&#60;/p&#62;</description>
</item>
<item>
<title>idckamikaze on "Problem with validate_username function"</title>
<link>https://www.machform.com/forums/topic/problem-with-validate_username-function#post-4658</link>
<pubDate>Sat, 14 Feb 2009 04:50:03 +0000</pubDate>
<dc:creator>idckamikaze</dc:creator>
<guid isPermaLink="false">4658@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;I forgot to mention that the MachForm db and the Wordpress db are on separate servers (I'm on a virtual host). Would I need to define the parameters for the MachForm database in the db-core.php file, or could I import the config.php file into the db-core file?
&#60;/p&#62;</description>
</item>
<item>
<title>yuniar on "Problem with validate_username function"</title>
<link>https://www.machform.com/forums/topic/problem-with-validate_username-function#post-4652</link>
<pubDate>Fri, 13 Feb 2009 18:28:21 +0000</pubDate>
<dc:creator>yuniar</dc:creator>
<guid isPermaLink="false">4652@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Apparently, WordPress and MachForm are using the same constant name for the database. That's why it won't able to select machform database.&#60;/p&#62;
&#60;p&#62;To fix it, edit your &#34;includes/db-core.php&#34; file. Around line 12 you will find this:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;mysql_select_db(DB_NAME) or die(&#38;#39;Could not select database&#38;#39;);&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;change the DB_NAME above with your machform database name, example:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;mysql_select_db(&#38;#39;my_machform&#38;#39;) or die(&#38;#39;Could not select database&#38;#39;);&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;make sure to put quotes as above.&#60;/p&#62;
&#60;p&#62;also, adjust your php embed code, add the code to re-select your wordpress db. like this:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;?php
	require(&#38;quot;/appnitro/machform/machform.php&#38;quot;);
	$mf_param[&#38;#39;form_id&#38;#39;] = 519;
	$mf_param[&#38;#39;base_path&#38;#39;] = &#38;#39;http://example.com/machform/&#38;#39;;
	display_machform($mf_param);
	mysql_select_db(&#38;#39;your_wordpress_db_here&#38;#39;); //&#38;lt;-- this line
?&#38;gt;&#60;/code&#62;&#60;/pre&#62;</description>
</item>
<item>
<title>idckamikaze on "Problem with validate_username function"</title>
<link>https://www.machform.com/forums/topic/problem-with-validate_username-function#post-4647</link>
<pubDate>Fri, 13 Feb 2009 04:38:22 +0000</pubDate>
<dc:creator>idckamikaze</dc:creator>
<guid isPermaLink="false">4647@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;That worked and then I got a similar error on helper_functions.php, line 201, function show_message. I changed that to show_machform_message (also used in manage_form, not sure where else), but that only fixed the function conflicts.&#60;/p&#62;
&#60;p&#62;Now it seems like I'm getting SQL errors. This displays:&#60;br /&#62;
&#60;code&#62;select form_name, form_description, form_redirect, form_success_message, form_password, form_unique_ip, form_frame_height, form_has_css, form_active, form_captcha, form_review from ap_forms where form_id=&#38;#39;2&#38;#39; Query failed: Table &#38;#39;db273972956.ap_forms&#38;#39; doesn&#38;#39;t exist&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;The only thing I can figure is the query is trying to run on my WP database and not the MachForm database. It isn't critical that I use the PHP embedding feature, but I thought it would be nice to have Wordpress integration. Any thoughts would be appreciated.
&#60;/p&#62;</description>
</item>
<item>
<title>yuniar on "Problem with validate_username function"</title>
<link>https://www.machform.com/forums/topic/problem-with-validate_username-function#post-4632</link>
<pubDate>Thu, 12 Feb 2009 15:28:28 +0000</pubDate>
<dc:creator>yuniar</dc:creator>
<guid isPermaLink="false">4632@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Go to line 243 of &#34;includes/common-validator.php&#34; file. You'll find this line:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;function validate_username($value){&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;change it to become:&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;function validate_user_name($value){&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;or any other similar function name. Thanks for the suggestion on this.
&#60;/p&#62;</description>
</item>
<item>
<title>idckamikaze on "Problem with validate_username function"</title>
<link>https://www.machform.com/forums/topic/problem-with-validate_username-function#post-4616</link>
<pubDate>Wed, 11 Feb 2009 23:28:04 +0000</pubDate>
<dc:creator>idckamikaze</dc:creator>
<guid isPermaLink="false">4616@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;I installed the Exec-PHP plugin for Wordpress to be able to execute PHP on a certain page (where a MachForm would be displayed). When I try to embed the form using the code generated in my admin panel, it gives me an error in the validate_username() function.&#60;br /&#62;
&#60;code&#62;Cannot redeclare validate_username() (previously declared in /homepages/32/d239429970/htdocs/mdpc/wp-includes/registration.php:49) in /homepages/32/d239429970/htdocs/machform/includes/common-validator.php on line 242&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;I think this relates to my previous post about unique identifiers in XHTML. Wordpress has a registration.php file that uses the validate_username() function. MachForm also uses this function, however, I don't have enough coding knowledge to know how it relates to the ability to embed the form. I used the iframe code and I achieved what I set out to do, but I think this is an important point for future revisions of MachForm.
&#60;/p&#62;</description>
</item>

</channel>
</rss>
