Scripts
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
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
  #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: 531 quiquedcode User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 23 h 41 m 33 sec
Reputation Power: 8
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
Mambo & Joomla Development - www.beza.com.ar
MSN: qbecerra @ hotmail.com
San Juan - Argentina

Reply With Quote
  #2  
Old September 24th, 2003, 08:54 PM
drgroove's Avatar
drgroove drgroove is offline
pushing envelopes, not pencils
Dev Shed God 2nd Plane (6000 - 6499 posts)
 
Join Date: Feb 2002
Posts: 6,223 drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Day 4 h 32 m 57 sec
Reputation Power: 174
Moved to the Scripts forum from PHP.
__________________
Give a person code, and they'll hack for a day; Teach them how to code, and they'll hack forever.
Analyze twice; hack once.
The world's first existential ITIL question: If a change is released into production without a ticket to track it,
was it actually released?


About DrGroove: ITIL-Certified IT Process Engineer - Enterprise Application Architect -
Freelance IT Journalist - Devshed Moderator - Funk Bassist Extraordinaire


Reply With Quote
  #3  
Old September 25th, 2003, 12:37 AM
Scorpions4ever's Avatar
Scorpions4ever Scorpions4ever is offline
Banned ;)
Dev Shed God 5th Plane (7000 - 7499 posts)
 
Join Date: Nov 2001
Location: Glendale, Los Angeles County, California, USA
Posts: 7,335 Scorpions4ever User rank is Brigadier General (60000 - 70000 Reputation Level)Scorpions4ever User rank is Brigadier General (60000 - 70000 Reputation Level)Scorpions4ever User rank is Brigadier General (60000 - 70000 Reputation Level)Scorpions4ever User rank is Brigadier General (60000 - 70000 Reputation Level)Scorpions4ever User rank is Brigadier General (60000 - 70000 Reputation Level)Scorpions4ever User rank is Brigadier General (60000 - 70000 Reputation Level)Scorpions4ever User rank is Brigadier General (60000 - 70000 Reputation Level)Scorpions4ever User rank is Brigadier General (60000 - 70000 Reputation Level)Scorpions4ever User rank is Brigadier General (60000 - 70000 Reputation Level)Scorpions4ever User rank is Brigadier General (60000 - 70000 Reputation Level)Scorpions4ever User rank is Brigadier General (60000 - 70000 Reputation Level)Scorpions4ever User rank is Brigadier General (60000 - 70000 Reputation Level)Scorpions4ever User rank is Brigadier General (60000 - 70000 Reputation Level) 
Time spent in forums: 4 Weeks 12 h 42 m 29 sec
Reputation Power: 662
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

Puzzle of the Month solved by sizeablegrin, etienne141 and L7Sqr, superior C/C++ programmers of the month

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: 531 quiquedcode User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 23 h 41 m 33 sec
Reputation Power: 8
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 5th Plane (7000 - 7499 posts)
 
Join Date: Nov 2001
Location: Glendale, Los Angeles County, California, USA
Posts: 7,335 Scorpions4ever User rank is Brigadier General (60000 - 70000 Reputation Level)Scorpions4ever User rank is Brigadier General (60000 - 70000 Reputation Level)Scorpions4ever User rank is Brigadier General (60000 - 70000 Reputation Level)Scorpions4ever User rank is Brigadier General (60000 - 70000 Reputation Level)Scorpions4ever User rank is Brigadier General (60000 - 70000 Reputation Level)Scorpions4ever User rank is Brigadier General (60000 - 70000 Reputation Level)Scorpions4ever User rank is Brigadier General (60000 - 70000 Reputation Level)Scorpions4ever User rank is Brigadier General (60000 - 70000 Reputation Level)Scorpions4ever User rank is Brigadier General (60000 - 70000 Reputation Level)Scorpions4ever User rank is Brigadier General (60000 - 70000 Reputation Level)Scorpions4ever User rank is Brigadier General (60000 - 70000 Reputation Level)Scorpions4ever User rank is Brigadier General (60000 - 70000 Reputation Level)Scorpions4ever User rank is Brigadier General (60000 - 70000 Reputation Level) 
Time spent in forums: 4 Weeks 12 h 42 m 29 sec
Reputation Power: 662
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: 531 quiquedcode User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 23 h 41 m 33 sec
Reputation Power: 8
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


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

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

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





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway