Return to iWEBTOOL

Go Back   iWEBTOOL Talk > The Web and your Website > Programming > PHP
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
 
Welcome to iWEBTOOL Talk, where you talk about webmaster-related stuff.
 
Discuss topics which interest you.
With over thousands of threads (topics), we're sure you'll find something that'll interest you.
Ask for help whenever you need it.
We have thousands of members who are available to help you if you need it.
It's absolutely FREE!

 1  Register           2  Browse the board           3  Discuss whatever may interest you!
 


Closed Thread
 
Thread Tools Search this Thread Display Modes
Old 03-30-2007, 04:49 AM   #1
detoam
Junior Guru
 
detoam's Avatar
 
Join Date: Feb 2007
Location: Canada
Posts: 663
detoam has a spectacular aura aboutdetoam has a spectacular aura about
Default inserting html into php

Can anyone tell me how to do that?
__________________

detoam is offline  
 
This is an Ad Revenue Sharing forum Place your advert here
SEO Checklist
Get yourself better ranking with
our "Do-it-Yourself" SEO Checklist.
Click Here
Old 03-30-2007, 06:00 AM   #2
kijakarn
Member
 
kijakarn's Avatar
 
Join Date: Jan 2007
Location: pattaya
Posts: 183
kijakarn will become famous soon enough
Default Re: inserting html into php

I'm also baby in php scripting ,anyone expert should point out

You can put any html in php
but any " should have backslash
like
example.php
<code>
<?php
echo "where are you \"mr.xx\" ?hmm";
?>
</code>
even more
you can have all html file
convert to php file
just change the extension !
example footer.html can be safely change to footer.php
in some server

you mean inserting = include external html in to your php script?
in this case
you can try script
$myUrl = "http://whatever/any.html";
$thefile = file_get_contents($myUrl );
$thefile = implode("", file($thefile));
$thefile = addslashes($thefile);
print $thefile;
__________________
I should have read the signature rules (4 links requires 1000 posts)
kijakarn is offline  
Old 03-30-2007, 06:09 AM   #3
detoam
Junior Guru
 
detoam's Avatar
 
Join Date: Feb 2007
Location: Canada
Posts: 663
detoam has a spectacular aura aboutdetoam has a spectacular aura about
Default Re: inserting html into php

I should have clarified. I need to insert a little piece of the code into PHP file. I have done that with my forum to create the static menu on the side, but I was able to because there was already pre-made with html code in it so all I did is add my little bit. But I think I am starting to get a general idea. although it's still is "greek" to me.
Thanks for the tip.
__________________

detoam is offline  
Old 03-30-2007, 06:58 AM   #4
dilzsaran
Junior Member
 
dilzsaran's Avatar
 
Join Date: Feb 2007
Posts: 12
dilzsaran is on a distinguished road
Default Re: inserting html into php

i think you want know about pattern matching you can use preg_match_all syntax...

----------
Software downloads
dilzsaran is offline  
Old 03-30-2007, 08:42 AM   #5
Katey
Senior Member
 
Katey's Avatar
 
Join Date: Apr 2006
Location: Hull, United Kingdom.
Posts: 317
Katey has much to be proud ofKatey has much to be proud ofKatey has much to be proud ofKatey has much to be proud ofKatey has much to be proud ofKatey has much to be proud ofKatey has much to be proud ofKatey has much to be proud of
Default Re: inserting html into php

Hi there,

To add php into a HTML file, all you need to do is;

1. Learn php
2. Insert the php code into the HTML code (by opening and closing the php start tags)
3. Upload onto a server with php installed

As long as your syntax is correct your php coding should work fine. If you are looking at learning php, you should go to http://www.w3schools.com/ .


Regards,
Kieran Taylor.
Katey is offline  
Old 03-30-2007, 03:30 PM   #6
detoam
Junior Guru
 
detoam's Avatar
 
Join Date: Feb 2007
Location: Canada
Posts: 663
detoam has a spectacular aura aboutdetoam has a spectacular aura about
Default Re: inserting html into php

Thank Kieran, but I am looking to do it the other way around. HTML into PHP.
I would learn PHP coding, but there is a limit to how much a person should know and/or capable to retain in their brain.
__________________

detoam is offline  
Old 03-30-2007, 03:38 PM   #7
Bagi Zoltán
iWEBTOOL Moderator
 Contributor 
 
Bagi Zoltán's Avatar
 
Join Date: Aug 2006
Location: Hungary
Posts: 1,862
Bagi Zoltán is a glorious beacon of lightBagi Zoltán is a glorious beacon of lightBagi Zoltán is a glorious beacon of lightBagi Zoltán is a glorious beacon of lightBagi Zoltán is a glorious beacon of light
Default Re: inserting html into php

Hi detoam, i will try to do my best but i think you should let us see the html code that would be inserted into php.
__________________
Time may come when you will need an excellent eCommerce shopping cart software
free seo related web directory precíziós mérleg Free shopping cart
Bagi Zoltán is online now  
Old 03-30-2007, 03:52 PM   #8
detoam
Junior Guru
 
detoam's Avatar
 
Join Date: Feb 2007
Location: Canada
Posts: 663
detoam has a spectacular aura aboutdetoam has a spectacular aura about
Default Re: inserting html into php

Thanks Bagi. It's a little script that goes into the <head> tag.

Code:
<style type="text/css"> <!-- A.ssmItems:link {color:black;text-decoration:none;} A.ssmItems:hover {color:black;text-decoration:none;} A.ssmItems:active {color:black;text-decoration:none;} A.ssmItems:visited {color:black;text-decoration:none;} //--> </style> <SCRIPT SRC="ssm.js" language="JavaScript1.2"> </SCRIPT> <SCRIPT SRC="ssmItems.js" language="JavaScript1.2"></SCRIPT>
__________________

detoam is offline  
Old 03-30-2007, 04:02 PM   #9
Bagi Zoltán
iWEBTOOL Moderator
 Contributor 
 
Bagi Zoltán's Avatar
 
Join Date: Aug 2006
Location: Hungary
Posts: 1,862
Bagi Zoltán is a glorious beacon of lightBagi Zoltán is a glorious beacon of lightBagi Zoltán is a glorious beacon of lightBagi Zoltán is a glorious beacon of lightBagi Zoltán is a glorious beacon of light
Default Re: inserting html into php

As I know every php script is opened with <?php and closed with ?>. After a closed script you can insert the quated code, or you can write a normal html <head> and place to the top of the code.
I'm not sure but i hope it will work properly.
__________________
Time may come when you will need an excellent eCommerce shopping cart software
free seo related web directory precíziós mérleg Free shopping cart
Bagi Zoltán is online now  
Old 03-30-2007, 04:06 PM   #10
detoam
Junior Guru
 
detoam's Avatar
 
Join Date: Feb 2007
Location: Canada
Posts: 663
detoam has a spectacular aura aboutdetoam has a spectacular aura about
Default Re: inserting html into php

Thank You. I have linked to Your blog at http://www.detoam.net. (Look in the sidebar)
__________________

detoam is offline  
Old 03-30-2007, 04:13 PM   #11
Bagi Zoltán
iWEBTOOL Moderator
 Contributor 
 
Bagi Zoltán's Avatar
 
Join Date: Aug 2006
Location: Hungary
Posts: 1,862
Bagi Zoltán is a glorious beacon of lightBagi Zoltán is a glorious beacon of lightBagi Zoltán is a glorious beacon of lightBagi Zoltán is a glorious beacon of lightBagi Zoltán is a glorious beacon of light
Default Re: inserting html into php

That's very kind of you!
__________________
Time may come when you will need an excellent eCommerce shopping cart software
free seo related web directory precíziós mérleg Free shopping cart
Bagi Zoltán is online now  
Old 03-30-2007, 04:16 PM   #12
jumpenjuhosaphat
 Contributor 
 
jumpenjuhosaphat's Avatar
 
Join Date: Jun 2006
Location: Denver
Posts: 4,459
jumpenjuhosaphat has much to be proud ofjumpenjuhosaphat has much to be proud ofjumpenjuhosaphat has much to be proud ofjumpenjuhosaphat has much to be proud ofjumpenjuhosaphat has much to be proud ofjumpenjuhosaphat has much to be proud ofjumpenjuhosaphat has much to be proud ofjumpenjuhosaphat has much to be proud of
Default Re: inserting html into php

So basically, if you need to place the HTML within the <?php and ?> tags, you would do it like this:

echo'
<html>code goes here</html>
';

Use the single quotes, and that way you don't need to worry about escaping your HTML double quotes.

If it's outside of the PHP tags, then you don't need the echo part, or the quotes, you can just place your code in the document.

If you can give us the PHP code that you want to insert that HTML into, I could do it for you. Just tell me where in the PHP you want to insert the HTML...
__________________
Storage Sheds
Lost Forum
jumpenjuhosaphat is offline  
Old 03-30-2007, 04:23 PM   #13
detoam
Junior Guru
 
detoam's Avatar
 
Join Date: Feb 2007
Location: Canada
Posts: 663
detoam has a spectacular aura aboutdetoam has a spectacular aura about
Default Re: inserting html into php

Thank you jumpenjuhosaphat. I had to remove the forum for now as I was having some difficulty with the instalation and will reinstall it manually. I can insert it myself, but thanks for the offer.
Your link goes to the main site as well.
By the way how is the little "jumpen"?
__________________

detoam is offline  
Old 03-30-2007, 04:26 PM   #14
jumpenjuhosaphat
 Contributor 
 
jumpenjuhosaphat's Avatar
 
Join Date: Jun 2006
Location: Denver
Posts: 4,459
jumpenjuhosaphat has much to be proud ofjumpenjuhosaphat has much to be proud ofjumpenjuhosaphat has much to be proud ofjumpenjuhosaphat has much to be proud ofjumpenjuhosaphat has much to be proud ofjumpenjuhosaphat has much to be proud ofjumpenjuhosaphat has much to be proud ofjumpenjuhosaphat has much to be proud of
Default Re: inserting html into php

He's doing good....Sleeping right now, but he likes to keep me up at night... Thanks for the gesture.
__________________
Storage Sheds
Lost Forum
jumpenjuhosaphat is offline  
Old 03-30-2007, 04:57 PM   #15
phpgator
Newcomer
 
phpgator's Avatar
 
Join Date: Mar 2007
Posts: 5
phpgator is on a distinguished road
Default

Actually another note that may make your life easier... php doesn't all have to be together. Below is valid and works fine, probably even the preferred way of doing it:

<?php
$var = 0; <- Create a variable, value is 0.
while ($var < "5") { <-- begin while loop.
$var++; <-- variable + 1;
?>
<b>hi</b>
<?php } ?> <- Close out the while loop.

?>

Last edited 04-04-2007 at 09:57 AM. Reason: I fixed if for you....:)
phpgator is offline  
 
This is an Ad Revenue Sharing forum Place your advert here
Webmaster Tools Webmaster Tools Click Here
Closed Thread

(Threads which have no activity for more than 30 days are automatically closed.)



Quick Reply
Message:

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

Advanced Search
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
HTML validator Chart Music Search Engine Optimization (SEO) 1 03-12-2007 03:21 PM
Html dummy evocombat Programming 8 01-30-2007 11:58 AM
Basic HTML Help sagecs Programming 4 11-04-2006 11:20 AM
html m@m HTML 2 10-02-2006 03:11 AM
Will HTML Disappear? Zack HTML 4 03-15-2006 08:41 PM


All times are GMT. The time now is 02:46 PM.


Powered by vBulletin v3.6.7 © 2008, Jelsoft Enterprises Ltd. SEO by vBSEO © 2006, Crawlability, Inc.