|
| |||||||
![]() | Welcome to iWEBTOOL Talk, where you talk about
webmaster-related stuff.
1 Register
2 Browse the board
3 Discuss whatever may interest you! | |||||||||||||
![]() |
| | Thread Tools | Search this Thread | Display Modes |
| | #1 |
| Junior Guru Join Date: Feb 2007 Location: Canada
Posts: 663
![]() ![]() | Can anyone tell me how to do that? |
| |
|
| |||||||
| | #2 |
| Member Join Date: Jan 2007 Location: pattaya
Posts: 183
![]() | 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) |
| |
| | #3 |
| Junior Guru Join Date: Feb 2007 Location: Canada
Posts: 663
![]() ![]() | 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. |
| |
| | #4 |
| Junior Member Join Date: Feb 2007
Posts: 12
![]() | i think you want know about pattern matching you can use preg_match_all syntax... ---------- Software downloads |
| |
| | #5 |
| Senior Member Join Date: Apr 2006 Location: Hull, United Kingdom.
Posts: 317
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 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. |
| |
| | #6 |
| Junior Guru Join Date: Feb 2007 Location: Canada
Posts: 663
![]() ![]() | 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. |
| |
| | #7 |
| iWEBTOOL Moderator Contributor Join Date: Aug 2006 Location: Hungary
Posts: 1,862
![]() ![]() ![]() ![]() ![]() | 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 |
| |
| | #8 |
| Junior Guru Join Date: Feb 2007 Location: Canada
Posts: 663
![]() ![]() | Thanks Bagi. It's a little script that goes into the <head> tag. Code:
|
| |
| | #9 |
| iWEBTOOL Moderator Contributor Join Date: Aug 2006 Location: Hungary
Posts: 1,862
![]() ![]() ![]() ![]() ![]() | 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 |
| |
| | #10 |
| Junior Guru Join Date: Feb 2007 Location: Canada
Posts: 663
![]() ![]() | Thank You. I have linked to Your blog at http://www.detoam.net. (Look in the sidebar) |
| |
| | #11 |
| iWEBTOOL Moderator Contributor Join Date: Aug 2006 Location: Hungary
Posts: 1,862
![]() ![]() ![]() ![]() ![]() | 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 |
| |
| | #12 |
| Contributor Join Date: Jun 2006 Location: Denver
Posts: 4,459
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 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... ![]() |
| |
| | #13 |
| Junior Guru Join Date: Feb 2007 Location: Canada
Posts: 663
![]() ![]() | 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"? |
| |
| | #14 |
| Contributor Join Date: Jun 2006 Location: Denver
Posts: 4,459
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | He's doing good....Sleeping right now, but he likes to keep me up at night... Thanks for the gesture. |
| |
| | #15 |
| Newcomer Join Date: Mar 2007
Posts: 5
![]() | 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....:) |
| |
(Threads which have no activity for more than 30 days are automatically closed.) |
| Quick Reply | ||
|
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
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 |