Results 1 to 9 of 9

Thread: Embed PHP into HTML.. HELP...

  1. #1
    Join Date
    Sep 2001
    Location
    Currently at Puchong
    Posts
    2
    Rep Power
    0

    Question Embed PHP into HTML.. HELP...

    Hi there..
    i faced with some problem now..
    let say i have a HTML file
    with this table code...

    <table bordercolor=#ff7f00 align=center bgcolor=#fce0c4 height=60 cellspacing=0 cellpadding=3 width=180 border=1>
    <tbody><tr>
    <td valign=center align=middle bgColor=#ff7f00 height=20>
    <font face="Verdana, Arial, Helvetica, sans-serif" color=#ffffff size=1>
    <b>Say Something Here</b></font></td></tr>
    <tr><td>

    <-- I need to run a PHP here.. what should i put here??? -->

    </td></tr></tbody></table><br>
    <center><IMG SRC="line.gif"></center><br>

    as you can see from the code, i need to put a php script there.. my script name is test.php so how should i put it and run it there..
    however, my page is still in HTML extension..

    --------------------------------------------------------

    The another methodi tried is by converting all my HTML into PHP..
    however.. there some error, because my page load with JAVA script, after converted to php.. the java all seems to be wrong..
    cannot loaded..

    what should i do????

  2. #2
    Join Date
    Sep 2001
    Location
    Currently at Puchong
    Posts
    2
    Rep Power
    0

    continue..

    Oya.. this is the php code looks like

    <?

    require ("required.php");

    echo "<HTML>\n";
    echo " <HEAD>\n";
    echo " <LINK rel=\"stylesheet\" type=\"text/css\" href=\"tagboard.css\">\n";
    echo " </HEAD>\n";
    echo " <BODY bgcolor=\"#EEEEEE\">\n";
    echo " <FORM action=\"post.php\" method=\"POST\" target=\"tagboard\" name=\"post\" id=\"post\">\n";
    echo " <TABLE cellpadding=\"0\" cellspacing=\"2\" width=\"1%\">\n";
    echo " <TR>\n";
    echo " <TD>\n";
    echo " <B>$scriptname v$version:</B>\n";
    echo " </TD>\n";
    echo " </TR>\n";
    echo " <TR>\n";
    echo " <TD align=\"center\">\n";
    echo " <IFRAME src=\"tagboard.php\" width=\"100%\" height=\"200\" frameborder=\"0\" scrolling=\"auto\" name=\"tagboard\"></IFRAME>\n";
    echo " </TD>\n";
    echo " </TR>\n";
    echo " <TR>\n";
    echo " <TD align=\"center\">\n";
    echo " <INPUT type=\"text\" name=\"nick\" size=25 value=\"nick\" maxlength=\"$nicklength;\">\n";
    echo " </TD>\n";
    echo " </TR>\n";
    echo " <TR>\n";
    echo " <TD align=\"center\">\n";
    echo " <INPUT type=\"text\" name=\"message\" size=\"25\" value=\"message\" maxlength=\"$messagelength\">\n";
    echo " </TD>\n";
    echo " </TR>\n";
    echo " <TR>\n";
    echo " <TD align=\"center\">\n";
    echo " <INPUT type=\"submit\" value=\"Tag It!\" name=\"submit\">\n";
    echo " <CENTER><IMG src=\"./images/wooncc.jpg\" width=\"140\"></CENTER>\n";
    if ($emoticon=="1")
    echo " <BR>[ <A href=\"emoticons.php\">EmotICON Help</A> ]\n";

    echo " </TD>\n";
    echo " </TR>\n";
    echo " </TABLE>\n";
    echo " </FORM>\n";
    echo " </BODY>\n";
    echo "</HTML>\n";

    ?>

    i save it to a file name as test.php

  3. #3
    Join Date
    Nov 2001
    Location
    MLK
    Posts
    119
    Rep Power
    219
    how about you just use embed PHP into HTML the correct way (or maybe it's my way.


    <html>
    <head>
    <title>bleh</title>
    </head>
    <body>
    <form action=''>
    <?php echo $scriptname ?>
    <input type="text" value="<?php echo $ayam ?>" />
    </form>

    only use the php tag when necessary, PHP != Perl .

  4. #4
    Join Date
    Feb 2003
    Location
    Kluang, Johor
    Posts
    2,367
    Rep Power
    248
    I do not understand why you want to use PHP tags to write HTML codes in test.php...

    anyway, replace:

    <!-- I need to run a PHP here.. what should i put here??? -->

    with:
    PHP Code:
    <?php include 'test.php'?>
    done.

  5. #5
    Join Date
    Jan 2002
    Location
    SoObHanG JhaYa
    Posts
    501
    Rep Power
    225
    one more thing, i can see you used "echo" too much...
    <form name="jump">
    <select name="menu" onChange="location=document.jump.menu.options[document.jump.menu.selectedIndex].value;" style="border:1px #393F31 solid;color:#393F31;font:10px Verdana;font-weight:bold;" >
    <option value="0" style="background: #9CC8FE" selected>*SELECT-LINKS</option>
    <option value="http://www.gengturbo.org/" style="background: #FF0000">GENGTURBO</option>
    <option value="http://www.phixelgrafix.com/" target="new" style="background: #C6D607">PHIXELGRAFIX</option>
    <option value="http://dailydigital.phixelgrafix.com/" style="background: #FCBC45">OLD-BLOG</option>
    <option value="http://www.mesrahosting.net/" style="background: #FF99CC">WEBHOSTING</option>
    </select>
    </form>

  6. #6
    Join Date
    Feb 2003
    Location
    Kluang, Johor
    Posts
    2,367
    Rep Power
    248
    ya... use PHP escape.

  7. #7
    Join Date
    Nov 2001
    Location
    Johor
    Posts
    772
    Rep Power
    232
    ya aku sokong si lcf kata.

    to wooncc:

    don't used 'echo' to much coz it make slower exec ur php code & use more resource =)
    I hate when:

    vBulletin Message:
    Sorry! The administrator has specified that users can only post one message every 60 seconds

  8. #8
    Join Date
    Aug 2003
    Location
    KL
    Posts
    3
    Rep Power
    0
    <table bordercolor=#ff7f00 align=center bgcolor=#fce0c4 height=60 cellspacing=0 cellpadding=3 width=180 border=1>
    <tbody><tr>
    <td valign=center align=middle bgColor=#ff7f00 height=20>
    <font face="Verdana, Arial, Helvetica, sans-serif" color=#ffffff size=1>
    <b>Say Something Here</b></font></td></tr>
    <tr><td>

    <?
    // put your script here and name the file as .php
    ?>

    </td></tr></tbody></table><br>
    <center><IMG SRC="line.gif"></center><br>

  9. #9
    Join Date
    Jan 2003
    Location
    dreamland
    Posts
    240
    Rep Power
    207
    Originally posted by lcf
    I do not understand why you want to use PHP tags to write HTML codes in test.php...

    anyway, replace:

    <!-- I need to run a PHP here.. what should i put here??? -->

    with:
    PHP Code:
    <?php include 'test.php'?>
    done.
    betul ler tuh... caya laa...
    tp kan yg dalam test.php tu...
    banyak sangat echo"";
    so macam tak beh... sbb kalau ko open dlm dreamweaver mesti tak der interface..
    so susah ler kalau ko nak oter interface...
    cara yg baik ko pakai <?php echo "taip ler aper2"; ?> cam cara rOkawa tuh
    so senang ler skit
    tak ler bterabur
    ^_^ <== stay happy

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Youtube Disabled Embed Plugin for Wordpress
    By rathakovn in forum Webmaster Tools
    Replies: 0
    Last Post: 20-03-2008, 10:43 PM
  2. rel in html
    By yipguseng in forum Website Programming
    Replies: 3
    Last Post: 06-05-2007, 04:26 AM
  3. .html dan .inc
    By redzanime in forum Website Design
    Replies: 1
    Last Post: 05-05-2007, 11:59 PM
  4. PHP into HTML
    By arthermax in forum Website Programming
    Replies: 4
    Last Post: 18-04-2007, 07:03 PM
  5. embed mp3 to site
    By ckita in forum Mamak Stall
    Replies: 15
    Last Post: 16-11-2004, 06:30 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
  •  

Search Engine Optimization by vBSEO 3.5.0 RC1 PL1

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112