+ Reply to Thread
Results 1 to 3 of 3

Thread: PHP in HTML help

  1. #1
    stan77 is offline x10Hosting Member stan77 is an unknown quantity at this point
    Join Date
    Nov 2009
    Posts
    1

    Unhappy PHP in HTML help

    I'm trying to embed flash into a webpage. No problem there. But for the source I want to have a variable from php or something else. So far I have:

    <?php
    $source ='http://www.somethingsomething.com';
    ?>

    <embed src="<?php $source ?>"></embed>


    But when I put that in the html editor it screws it up. Could anyone help?
    Last edited by stan77; 12-02-2009 at 09:45 AM.

  2. #2
    Mr. DOS is offline x10 Sophmore Mr. DOS is an unknown quantity at this point
    Join Date
    Oct 2009
    Location
    Nova Scotia, Canada
    Posts
    228

    Re: PHP in HTML help

    To write the URL into the HTML, you need to do this:
    PHP Code:
    <embed src="<?php echo($source); ?>"></embed>
    --- Mr. DOS
    I've written a couple articles on automatic application of AlphaImageLoader in IE6 using nothing but IE6-specific CSS rules.

  3. #3
    xav0989's Avatar
    xav0989 is offline Community Public Relation xav0989 is just really nice
    Join Date
    Jul 2008
    Location
    ifk
    Posts
    4,438

    Re: PHP in HTML help

    To output something in php, you need to use either the echo construct or the print function. They are basically the same.

    Also, when putting code on the forums, use the [code] [/code], [html] [/html], [php] [/php] tags to properly display and format the code you post.
    Last edited by xav0989; 12-02-2009 at 11:28 PM.
    Xavier L | Community Public Relations Manager (Free Hosting Support)
    █ Yes, my position is too cool to even exist!
    How am I helping? Rate this post by clicking the icon below! (this is even better than "liking" a post)
    Terms of Service | Acceptable Use Policy | x10Hosting Wiki

+ Reply to Thread

Similar Threads

  1. Copying HTML tags into PHP script, problem with quotes and //
    By dmoneyman in forum Programming Help
    Replies: 8
    Last Post: 04-04-2009, 07:12 AM
  2. Corriendo una funcion de php en file html
    By oregonsv in forum Ayuda Web
    Replies: 11
    Last Post: 10-28-2008, 01:19 PM
  3. Ads in basic PHP (HTML)
    By fmjnax in forum Free Hosting
    Replies: 4
    Last Post: 05-01-2008, 12:23 PM
  4. Including PHP script in HTML
    By chrisv in forum Free Hosting
    Replies: 7
    Last Post: 08-31-2007, 08:10 PM
  5. php vs html
    By conmark in forum Scripts & 3rd Party Apps
    Replies: 25
    Last Post: 07-12-2005, 02:14 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers