WordPress not recognizing simple Javascript file - php

Okay, so I've uploaded this super simple HTML page here:
http://medicaldevicesgroup.net/wp-content/themes/medicaldevicesgroup/test.html
It's utilizing LinkedIn's "Sign In" API. View the source. It's two lines of code. Nothing.
BUT
I created a home.php file in my child theme directory, and pasted this:
<?php require(CHILD_DIR.'/test.html'); ?>
This means that if you view the source at http://www.medicaldevicesgroup.net/, it's EXACTLY the same as the source at http://medicaldevicesgroup.net/wp-content/themes/medicaldevicesgroup/test.html. The only difference is that the home page is in WordPress, and the other URL isn't.
The home page script, however, doesn't work. WHY???? Help! Thanks.

The reason is because the LinkedIn API that you are using is for http://medicaldevicesgroup.net and not http://www.medicaldevicesgroup.net. Notice the "www" in 2nd URL. You need to change your URL in the LinkedIn API.
To see what I mean try going to http://www.medicaldevicesgroup.net/wp-content/themes/medicaldevicesgroup/test.html and it will not work there too.

Related

a href refers to site itself + link instead of the link itself

In Codeigniter, I have a database containing a link of a site.
Each item(event) has a link to the event page.
Site
But instead of going to the desired site, it just adds the link to the existing url like this: http://web.site.local/index.php/evenementen/www.referedsite.com
when checking the html code it shows the following:
Site
Does anyone know how to make it go to www.referedsite.com instead of making it add this to the existing link?
You need to put HTTP://
Site
In codeignitor you can use
echo anchor('', 'Site');
// Prints: Site
Read CI Anchor
try
Site

include() doesn't work when my page has GET param

I have a header.php file containing my DOCTYPE and all my links/scripts.
I use
<?php
// HTML DOCTYPE insert
include 'header.php';
?>
at top of all my pages to have only one header for everyone, and it works fine.
Now, I have another page that get from a database a summary of my products information. When someone click on the "read more" link:
<p>
read more...
</p>
another page opens with the full information displayed...
Actually that works...
BUT on my new page (display_product.php/id=[anynumber]) my included file doesn't work. So I have no nav bar, no scripts, no stylesheet. Only the text from my database.
AND the weird thing is that when I copy/paste the HTML of my generated display_product page and launch it on my browser, it works... O-o
So the generated code is good.
AND the second weird thing is that when I get rid of the /?id... my layout works fine (but I have no text anymore, of course)
Does one of you have an idea why this crazy things happens?
"Hi guys, Thanks very much Fred -ii this was it. it works perfectly. Thanks sergiodebcn for your concerne."
Since other answers were given and did not solve the actual problem, am posting my comment to an answer, in order to close the question.
Remove the slash from /?id
The slash is trying to instruct the server to probably find a folder after a filename, which technically looks like is what's happening here.
The ultimate solution for include and require functions with path issues, is to use the absolute filesystem path to the file that you want to include or require.
i.e you may say:
include("C:\\www\\app\\incs\\header.php");
Hint
To learn how to set the absolute path for include dynamically for your project, check the source code of two files of cakephp framework:
index.php
webroot/index.php

how can I make a page opening only into the iframe and not if it's called directly?

The content generate by list.php should be only opened into an iframe tag, on the index.php. But when it's called directly, it should not be possible to open it.
How can I obtain this?
In fact I already adopete this method:
<iframe title="frame" class="iframe" src="http://www.example.com/list.php?type=a&013acd2b6c1368f">[Your browser doesn%27;t support iframes]</iframe>
which works fine, thus if the file is called without the arguments ,it redirects to the index.
BUT if you call it directly in this way http://www.example.com/list.php?type=a&013acd2b6c1368f the content appears at full page. While I want that, being outside the tag , it redirects to Index.php
Is there any way please?
I'm sorry to any one.
After have written this message, I finally found the answer here and with small adaption it worked out perfectly.
I didn't find this post before.
Answer to my question

Issue with formulating a url php / html

I am trying to formulate a link to another page in my directory. It can either be done in the php code or the html. However for some strange reason, and only on this page, everytime i generate a url to a new page, the url generated is the page i am on + the url i want to go to.
For example, if i am on mysite.php and formulate a link to go to purchase.php then the generated url is mysite.php/purchase.php
Does anyone know why this might be?
<h1>Success</h1>
Link text
<?php
...
...
?>
this is essentially all i have with an echo saying hi! . What happens is, if i am currently on home.php the above url becomes path/home.php/page.php
You should create url for /purchase.php instead of purchase.php.
You can read more about what's the difference in here.

Getting facebox to work in the qcodo/qcube php framework

I am using a framework called qcodo (which forked as qcubed) and is a PHP framework.
I want to do a very simple popup using the Facebox jquery plugin.
When someone clicks on the link and shown below in line 47.
Here is the file: http://github.com/allyforce/AF-upload/blob/master/Templates/profile_activity.tpl.php
<a href="complete_profile_popup.php?allyId=<?= $this->objAllyUser->Id?>" rel="facebox" title="Complete Profile" >Invite as Ally</a><br />
The Facebook installation worked fine, tested it just opening plain html and php files.
I just want to be able to render a working page within the Facebox pop-up.
But the current error is that it cannot recognize the method, even though it appears it has been defined.
UPDATE: Per one suggestion, used iFrame, but still getting nothing:
You should print the error you get. I will try to guess: have you declared your method as public? In the template you can access only public properties and methods. This is a very common mistake.
This issue/topic is being discussed in depth at http://www.qcodo.com/forums/forum.php/3/4007/

Categories