Inserting PHP code on a web site -...

User 2126250 Photo


Registered User
5 posts

Hi all,

I have read all of the messages in the forum and couldn't find an answer. Ok. What I am trying to do is list the current prices for commodities on my website from http://www.fx-track.com/en/public/. This is the code they say to put in my site:

<?PHP
readfile('http://www.fx-track.com/en/public/x1.php?size=7&fontcolor=110033&bg=ffffff');
?>

I have tried to put it into a RSS feed, adding it to an html area and nothing seems to work. I do not know HTML or PHP very well at all (which may be part of my problem). I am using Godaddy on a Linux server with PHP support. Any information would be greatly appreciated.

Thank-You,

Ed
User 122279 Photo


Senior Advisor
14,647 posts
Online Now

If you insert php code into a html file, you have to rename the html file to whatever.php.
Ha en riktig god dag!
Inger, Norway

My work in progress:
Components for Site Designer and the HTML Editor: https://mock-up.coffeecup.com


User 38401 Photo


Senior Advisor
10,951 posts

Do keep in mind Ed, that once you do this, you won't be able to see your changes in the editors without setting up a local server type thing for it. Since I haven't yet gotten my head around doing the server setup thingy myself I've found a way to work around the issue temporarily lol.

I add the code in, change the extension to .php, make sure it all works like it should (upload it test it etc.) and then if I have a lot of other things to do on the page that I want to be able to see in the editors, I just take that code out again, rechange the extension back to .html and work on it till I'm ready to put the code back in (basically when the page is pretty much done). Just my little quirky way around it for now if it helps any :)
User 282670 Photo


Registered User
3,940 posts

can I ask or maybe suggest something? why not make a php file, use the add files to add it to VSD, then Iframe it using the html tool. :|




User 122279 Photo


Senior Advisor
14,647 posts
Online Now

Ed, setting up a WAMP server is very easy, if you want to view the result locally. You find it here: http://www.wampserver.com/en/. You save your files in the www folder and view it using the browser pointing to http://localhost/.

You can of course also upload it to your internet server for each change. If you want to keep it out of public sight, then name the file 'somethingelse.php' so that it is not linked to anything.
Ha en riktig god dag!
Inger, Norway

My work in progress:
Components for Site Designer and the HTML Editor: https://mock-up.coffeecup.com


User 2126250 Photo


Registered User
5 posts

Hi all,

Thank-You for your feedback.

When you say "If you insert php code into a html file, you have to rename the html file to whatever.php. "

Are you saying in an HTML editor (as I have not used that yet). I am not sure how this would be done.

I believe I have tried this:

"can I ask or maybe suggest something? why not make a php file, use the add files to add it to VSD, then Iframe it using the html tool."

What I did is created a HTML file using MSWORD that had this:

<p style="color:#FF0000; ">
<?php include($DOCUMENT_ROOT . "goldprices.php"); ?>
</p>

I uploaded the file "goldprices.php" (only one file and may be why it is not working). The file had this:

<?PHP
readfile('http://www.fx-track.com/en/public/x1.php?size=7&fontcolor=110033&bg=ffffff');
?>

I have also tried to insert html in VSD with the code above and it doesn't show anything. Do I need the HTML editor? And if so, how do I add that to the "iframe" or "insert html" area of my website?

I am really new to website designing and would really appreciate any help.

Thank-You,

Ed

User 42578 Photo


Ambassador
1,176 posts

1. Never use MSWord to write HTML or PHP files. It adds its own code to the page.
2. You can use a text editor to write PHP code as it is just text (as is HTML)
3. Suggest you do get an HTML editor, download the trial version of CC HTML editor to see if you like it.

Mike...
..........................................
http://www.wpdfd.com
User 38401 Photo


Senior Advisor
10,951 posts

4. Keep in mind that you cannot go back to VSD with pages that you have altered outside of the VSD Program so once you start editing in an HTML editing program of any sort, you must continue on that way from that point on and no more VSD.
**Disclaimer** unless it's some small change that you can do manually every time you update your site that is hehe. Sometimes making a couple small changes outside of VSD is worth the bother, but when it gets too large of a job then it's no longer as feasible and best to use the code editor all the way**
User 122279 Photo


Senior Advisor
14,647 posts
Online Now

Bruzer wrote:
can I ask or maybe suggest something? why not make a php file, use the add files to add it to VSD, then Iframe it using the html tool. :|


Have you tried this, Bruzer and do you know if it works? Since there was no mention of which programme Ed is using when I submitted my first answer, I assumed it was the CC Editor, because I can't quite picture VSD creating php files...

I'm not on my own computer right now and can't try your suggestion myself.
Ha en riktig god dag!
Inger, Norway

My work in progress:
Components for Site Designer and the HTML Editor: https://mock-up.coffeecup.com


User 282670 Photo


Registered User
3,940 posts

Hi Inger,
I have tried this, and looks like their website is made with VSD
http://www.mimismetals.com/
View Visual Attempt!
http://www.myofficialnewbie.com/tutorials/STocks.html





Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.