Embed a form from an external website

Permalink
Hi

Is it possible to embed a form from an third party site within a form block?

The reason I ask is because I have sourced a form with another website company but when I embed the code it does not recognise that a user is logged in. To overcome this at the moment I instruct the user to enter their username again. This doesn't make sense to them and I could lose users because of it.

Any ideas?

Regards

Barry

misebaz
View Replies:
Hypocrite replied on at Permalink Reply
Hypocrite
Do you mean that you want to save the username from your site to the external form?

Maybe you could use an iframe and pass the username as a GET parameter?

Something like:
<?php
  $u = new User();
  $username = $u->getUserName();
?>
<iframe height="300" frameborder="0" scrolling="no" width="300" src="http://www.formsite.com/?username=<?php echo $username; ?>"></iframe>


Then you need to ask the other company to add the GET parameter value to the form.
misebaz replied on at Permalink Reply
misebaz
Hi Hypocrite,

Would the above code mean that a username will be in the URL once they Log In/Register. How and where exactly would I implement the above code? I reckon this would need to be attached to the Log In/Register box, am I right, and how is this done?

Thanks

Barry
Hypocrite replied on at Permalink Reply
Hypocrite
The username would be in the iframe URL.

I think the easiest way to achieve would be to create a single page for this purpose:
http://www.concrete5.org/documentation/developers/pages/single-page...

You can then add the form iframe to this page with the PHP code which adds the username of the logged in user.
misebaz replied on at Permalink Reply
misebaz
Hi Hypocrite,

I have added the single page. I've followed the instructions in the link you provided but it I am not sure I am doing it right. I have pasted the newly created php file to the concrete theme folder as instructed but it is not allowing me to add blocks like other pages.

Then, how/where do I add php code to pull the name of the user?

Thanks

Barry
Hypocrite replied on at Permalink Reply
Hypocrite
You don't add blocks to single pages. You can add direct HTML or PHP code. You need to place the single page file to the single_pages folder, not the theme folder.

Then the content from the file is used in the single pages you have created through Dashboard.

Read the instructions for single pages again to understand how they work. :)
misebaz replied on at Permalink Reply
misebaz
I misread the instructions :-o. I thought it was saying to place the single page within the theme folder.

Have it in the Single page folder and copied the php code from the theme php file and pasted it to the single page php file.

Looks perfect now.

Thanks for your help.

Barry
misebaz replied on at Permalink Reply
misebaz
Hi Hypocrite,

On a similar vein to my original question, is it possible to have the website recognise when a user is signed on at all times i.e. the username is reflected in the url on every page until the user signs out.

Thanks

Barry