Not sure why that is happening. Yes you use your WordPress login credentials.
Background:
Basically the URL in IQY is trying to get through the login form and redirect to a page that generates an HTML table of the data for Excel to consume. The “log=” and “pwd=” stuff in the IQY file correspond to telling Excel to prompt for these values and set them in the URL. In the login screen, “log” and “pwd” are the INPUT tag names on the login FORM. There is also a “redirect” parameter that WordPress accepts with the login submission to automatically go to a specific page.
Either (1) login fails or (2) nav to the page with data fails.
(1) Do you have any plugin that adds anything to the login page or changes how one logs into WordPress? From what you describe, it seems like you are getting through the login. If you put in a bad login, you should get something different (like the login error page shown in Excel).
(2) When you put the URL form the .iqy file in a browser and click through the login page (putting in your credentials), do you get a table of your form data?
Next, take that URL and add on the end “&log=<user>&pwd=<password>” (substituting in your actual user/password) and see what you get. Verify that that URL is less than 255 characters (max allowed by browser).
Thread Starter
mcvlot
(@mcvlot)
Not sure if I get through the login. It may not reach the login.
When I use the whole url in the iqy file in the browser wordpress reacts as if I requested a page that does not exist. I.e. a 404 but then with the wordpress page for bad url.
Here it is (without the login data obviously):
http://040energie.nl/wp-login.php?redirect_to=wp-admin%2Fadmin-ajax.php%3Faction%3Dcfdb-export%26form%3DZonnepanelenactie%2Bregistratie%26enc%3DHTMLBOM%26action%3Dcfdb-export
question: what is the url composed of; seems to redirect to wp-admin/admin-ajax.php?action=….
It looks like your login page is this:
http://040energie.nl/wp040/wp-login.php
whereas the URL is missing wp040:
http://040energie.nl/wp-login.php
try adding the wp040 into the URL in the .iqy file.
Thread Starter
mcvlot
(@mcvlot)
Hi Michael,
Yes both 2nd and third work. Strangely enough on its own http://040energie.nl/wp-admin works so I did not suspect that.
Super for this help.
Did I misconfigure your plugin since it is generating the wrong iqy file; where is the wp040 lost? Or does it require a patch in your plugin?
It is quite normal that wordpress gets installed in a specific directory of the main web server directory.
Thread Starter
mcvlot
(@mcvlot)
Hi Michael,
Found the php code for this in ExportToIqy.php.
echo (
"WEB
1
$url/wp-login.php?redirect_to=$encRedir
log=[\"Username for $url\"]&pwd=[\"Password for $url\"]
Selection=1
Formatting=All
PreFormattedTextToColumns=True
ConsecutiveDelimitersAsOne=True
SingleBlockTextImport=False
DisableDateRecognition=False
DisableRedirections=False
");
It needs a fix. Checking your code I think you need to change the following in the code in ExportToIqy.php:
class ExportToIqy implements CFDBExport {
public function export($formName, $options = null) {
header('Content-Type: text/x-ms-iqy');
header("Content-Disposition: attachment; filename=\"$formName.iqy\"");
$url = get_bloginfo('url');
Last line change to:
$url = get_bloginfo('wpurl');
I checked it; works on my installation.
Hope this helps!
I’ll make that change. Thanks for figuring that out.
Thread Starter
mcvlot
(@mcvlot)
Many thanks to you as well for making this plugin.
The iqy export is really helpful for importing the webdata repeatedly and conveniently into a PC sapplication for further processing in a straightforward way.