Go Back   Webmaster Malaysia Forum » Website Design & Development » Website Programming

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 09-09-2003, 06:30 PM
New kid on the block
 
Join Date: Sep 2001
Location: Currently at Puchong
Posts: 2
Rep Power: 0
wooncc is on a distinguished road
Send a message via ICQ to wooncc Send a message via Yahoo to wooncc
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????
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 09-09-2003, 06:31 PM
New kid on the block
 
Join Date: Sep 2001
Location: Currently at Puchong
Posts: 2
Rep Power: 0
wooncc is on a distinguished road
Send a message via ICQ to wooncc Send a message via Yahoo to wooncc
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 10-09-2003, 10:03 AM
Novice Webmaster
 
Join Date: Nov 2001
Location: JHR
Posts: 89
Rep Power: 85
r0kawa is on a distinguished road
Send a message via Yahoo to r0kawa
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 .
__________________
<a href="http://www.php.net.my">www.php.net.my</a>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 10-09-2003, 10:06 AM
lcf's Avatar
lcf lcf is offline
Pro-Blogger
 
Join Date: Feb 2003
Location: Kluang, Johor
Posts: 2,376
Rep Power: 115
lcf will become famous soon enough
Send a message via ICQ to lcf Send a message via MSN to lcf Send a message via Yahoo to 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.
__________________
LiewCF | Malaysia Bloggers Forum
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 10-09-2003, 11:03 AM
Ben-davis's Avatar
Senior Webmaster
 
Join Date: Jan 2002
Location: SoObHanG JhaYa
Posts: 501
Rep Power: 91
Ben-davis is on a distinguished road
Send a message via ICQ to Ben-davis Send a message via Yahoo to Ben-davis
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>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 10-09-2003, 12:11 PM
lcf's Avatar
lcf lcf is offline
Pro-Blogger
 
Join Date: Feb 2003
Location: Kluang, Johor
Posts: 2,376
Rep Power: 115
lcf will become famous soon enough
Send a message via ICQ to lcf Send a message via MSN to lcf Send a message via Yahoo to lcf
ya... use PHP escape.
__________________
LiewCF | Malaysia Bloggers Forum
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 11-09-2003, 08:35 PM
hymns's Avatar
Senior Webmaster
 
Join Date: Nov 2001
Location: Johor
Posts: 768
Rep Power: 98
hymns is on a distinguished road
Send a message via ICQ to hymns Send a message via Yahoo to hymns
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 14-09-2003, 03:51 AM
haba's Avatar
New kid on the block
 
Join Date: Aug 2003
Location: KL
Posts: 3
Rep Power: 0
haba is on a distinguished road
<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>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 24-09-2003, 03:24 PM
white_neck's Avatar
Senior Webmaster
 
Join Date: Jan 2003
Location: dreamland
Posts: 240
Rep Power: 73
white_neck is on a distinguished road
Send a message via Yahoo to white_neck
Quote:
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
HTML & JavaScript marcoenie Website Design 8 15-02-2006 12:03 PM
insert php in html sloth Website Programming 7 26-08-2005 07:34 PM
[need help] HTML coding.. [the][matrix] Website Design 2 30-05-2005 12:56 AM
include RSS in html alvinhan Website Design 8 07-05-2005 08:04 PM
embed mp3 to site ckita Mamak Stall 15 16-11-2004 06:30 PM



All times are GMT +8. The time now is 01:37 AM. Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0 vBulletin skin by ForumMonkeys.com.


WebmasterMalaysia.com is Proudly Hosted by Exabytes Semi Dedicated Server.

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