Scripts
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb Site ManagementScripts

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 24th, 2003, 08:52 PM
quiquedcode's Avatar
quiquedcode quiquedcode is offline
webber
Dev Shed Novice (500 - 999 posts)
 
Join Date: Oct 2000
Location: San Juan - Argentina
Posts: 594 quiquedcode User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 Days 10 h 25 m 20 sec
Reputation Power: 13
Send a message via ICQ to quiquedcode Send a message via MSN to quiquedcode Send a message via Yahoo to quiquedcode
Unhappy html2php

hi ppl
i'm in urgent need of an util like this...
i gotta transform lot of HTML designs to
print '.....';
and i'll become mad if i do it line per line...

i saw this one, it is perfect, but its author doesnt want 2 give it
http://quasarcr.com/html2php/

this one is nice too
http://www.html2php.com/frahtm2php.html

and this seems 2 work not so good
http://www.linuxlogin.com/tools/html2php.php

i got the perl script from hostscripts.com but dont have perl and wont install it 4 this...

plz... does some1 have some of these nice scripts?

thanks...
A LOT
__________________
Enrique Becerra
CodeIgniter, Joomla & Java Development
www.itexa.com.ar

Reply With Quote
  #2  
Old September 24th, 2003, 08:54 PM
drgroove's Avatar
drgroove drgroove is offline
Moderator Emeritus
Dev Shed God 5th Plane (7000 - 7499 posts)
 
Join Date: Feb 2002
Location: Scottsdale, AZ
Posts: 7,174 drgroove User rank is General 17th Grade (Above 100000 Reputation Level)drgroove User rank is General 17th Grade (Above 100000 Reputation Level)drgroove User rank is General 17th Grade (Above 100000 Reputation Level)drgroove User rank is General 17th Grade (Above 100000 Reputation Level)drgroove User rank is General 17th Grade (Above 100000 Reputation Level)drgroove User rank is General 17th Grade (Above 100000 Reputation Level)drgroove User rank is General 17th Grade (Above 100000 Reputation Level)drgroove User rank is General 17th Grade (Above 100000 Reputation Level)drgroove User rank is General 17th Grade (Above 100000 Reputation Level)drgroove User rank is General 17th Grade (Above 100000 Reputation Level)drgroove User rank is General 17th Grade (Above 100000 Reputation Level)drgroove User rank is General 17th Grade (Above 100000 Reputation Level)drgroove User rank is General 17th Grade (Above 100000 Reputation Level)drgroove User rank is General 17th Grade (Above 100000 Reputation Level)drgroove User rank is General 17th Grade (Above 100000 Reputation Level)drgroove User rank is General 17th Grade (Above 100000 Reputation Level) 
Time spent in forums: 6 Days 23 h 48 m 33 sec
Reputation Power: 2131
Moved to the Scripts forum from PHP.
__________________
DrGroove, Devshed Moderator | New to Devshed? Read the User Guide | Need ServiceNow consulting or ITIL process design? Connect with me on LinkedIn

Reply With Quote
  #3  
Old September 25th, 2003, 12:37 AM
Scorpions4ever's Avatar
Scorpions4ever Scorpions4ever is offline
Banned ;)
Dev Shed God 9th Plane (9000 - 9499 posts)
 
Join Date: Nov 2001
Location: Woodland Hills, Los Angeles County, California, USA
Posts: 9,387 Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 4 Weeks 1 Day 21 h 39 m 3 sec
Reputation Power: 4080
Erm, can't you just do something like this (necessary PHP code inserted in bold text over the HTML)
Code:
<?
print <<<END_OF_HTML
<html>
  <head>
    <title>Hello World</title>
  </head>
  <body>
    <h1>Hello World!</h1>
    Pick up your balls and load up your cannon<br>
    For a 21 gun salute<br>
    <i>For Those About To Rock (We Salute You)</i>
  </body>
</html>

END_OF_HTML;
?>


As you can see, it works over multiple lines and thus you don't have to insert a print '...'; on each line of HTML. Also, you can put PHP variables in the middle and it'll interpolate them just fine. So, with this approach, all you have to do is insert the bold text at the top and bottom of any HTML file and voila!
__________________
Up the Irons
What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
"Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
Down with Sharon Osbourne

Last edited by Scorpions4ever : September 25th, 2003 at 12:39 AM.

Reply With Quote
  #4  
Old October 2nd, 2003, 12:56 PM
quiquedcode's Avatar
quiquedcode quiquedcode is offline
webber
Dev Shed Novice (500 - 999 posts)
 
Join Date: Oct 2000
Location: San Juan - Argentina
Posts: 594 quiquedcode User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 Days 10 h 25 m 20 sec
Reputation Power: 13
Send a message via ICQ to quiquedcode Send a message via MSN to quiquedcode Send a message via Yahoo to quiquedcode
it worked great scrorpions4ever, but plz let me ask u now another question. i use lot of sending mail with php, and i want to do following:

$var = 'hello world!';

$html = '
<html>
<head>
<title>Hello World</title>
</head>
<body>
<h1>Hello World!</h1>
Pick up your balls and load up your cannon<br>
For a 21 gun salute<br>
<i>For Those About To Rock (We Salute You)</i>
<br><br>$var
</body>
</html>
';

but when i do

echo 'this is the content<br>'.$html;

I cannot see the $var's value...

what da ya advice me to do in that case?
itd be great i can make the html design with the vars & copy / paste like the 1st example u gave me... thanks

Reply With Quote
  #5  
Old October 3rd, 2003, 06:56 PM
Scorpions4ever's Avatar
Scorpions4ever Scorpions4ever is offline
Banned ;)
Dev Shed God 9th Plane (9000 - 9499 posts)
 
Join Date: Nov 2001
Location: Woodland Hills, Los Angeles County, California, USA
Posts: 9,387 Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 4 Weeks 1 Day 21 h 39 m 3 sec
Reputation Power: 4080
You should use double quotes(") instead of single quotes ' in this statment. i.e
$html = "
...
$var
";

instead of what you have now
$html = '
...
$var
';

Single quotes don't allow interpolated variables, i.e. they render the string as you see it. Double quotes allow interpolated variables, i.e. they replace all $ variables with the actual values.

Better still, use <<<END_OF_HTML style coding instead. Why, you ask? - Well, if you had any double quotes in your html, you would have needed to escape them with a \ character. With the <<< style, you don't need to do that. The following code illustrates this:
Code:
<?
$var = 'hello world!';

$html = <<<END_OF_HTML
<html>
  <head>
    <title>Hello World</title>
  </head>
<body>
<h1>Hello World!</h1>
Pick up your balls and load up your cannon<br>
For a 21 gun salute<br>
<i>For Those About To Rock (We Salute You)</i><br>                            
Isn't this a great "test"        
<br><br>$var                                   
</body>                               
</html>                              
END_OF_HTML;
                                                 
echo 'This is the content2<br>'. $html;
?>

Replace the END_OF_HTML code with single or double quotes and it won't work any more, since the HTML has " and ' within it (which you'll need to escape as \" and \\' to make them work). With END_OF_HTML style syntax, you don't have to escape them. BTW you don't have to call the tag as END_OF_HTML. You can use any string you like. Just remember the following simple rules:
(a) The last END_OF_HTML should be on its own line with a ; at the end
(b) The last END_OF_HTML; should have no leading or trailing spaces. That means no spaces after the ;
(c) Match your tags. This means, if you do this
$html = <<<FOO
then your HTML code should end with a corresponding:
FOO;

[edit] Looks like the VB code doesn't render \\' correctly. You need to \\ it to work with ' and show up correctly on the forum[/edit]

Last edited by Scorpions4ever : October 3rd, 2003 at 07:30 PM.

Reply With Quote
  #6  
Old October 3rd, 2003, 07:17 PM
quiquedcode's Avatar
quiquedcode quiquedcode is offline
webber
Dev Shed Novice (500 - 999 posts)
 
Join Date: Oct 2000
Location: San Juan - Argentina
Posts: 594 quiquedcode User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 Days 10 h 25 m 20 sec
Reputation Power: 13
Send a message via ICQ to quiquedcode Send a message via MSN to quiquedcode Send a message via Yahoo to quiquedcode
hey man...
what do u do to be SO quick & efficient?
incredible, awesome, and im very thankful 2 ya
great! still astonished...

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb Site ManagementScripts > html2php

Developer Shed Advertisers and Affiliates



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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap