homeGeek CultureWebstoreeCards!Forums!Joy of Tech!AY2K!webcam

The Geek Culture Forums


Post New Topic  New Poll  Post A Reply
my profile | directory login | | search | faq | forum home
  next oldest topic   next newest topic
» The Geek Culture Forums   » Other Geeky Stuff   » Ask a Geek!   » Returning a html file with php?

 - UBBFriend: Email this page to someone!    
Author Topic: Returning a html file with php?
Stibbons
SuperBlabberMouth!
Member # 2515

Member Rated:
5
Icon 1 posted May 14, 2007 00:14      Profile for Stibbons   Author's Homepage     Send New Private Message       Edit/Delete Post   Reply With Quote 
Hey guys

I'm looking for a way to return a single .htm file from a php script. I'm taking people's name, email, etc and generating a signature for them according to our new corporate(!) identity.

I can do the basic thing - returning it as part of the script - see it in action here. But I want to embed it in our CMS, and return the signature as a link to a "signature.htm" file. I'm guessing php can do this, but I don't have the knowledge to do so (and googling just returns lots and lots of pages on turning your dynamic site into html files.

Any help out there?
TIA
Stibbons

Posts: 1143 | From: UK | Registered: Dec 2003  |  IP: Logged
dragonman97

SuperFan!
Member # 780

Member Rated:
4
Icon 1 posted May 14, 2007 08:59      Profile for dragonman97   Author's Homepage     Send New Private Message       Edit/Delete Post   Reply With Quote 
*sigh*
I probably know how to do that in Perl, but not in PHP.

I'm kind of busy right now, so let me just point you in the direction of 'Content-Disposition' [Smile]

Regards,
dragon

--------------------
There are three things you can be sure of in life: Death, taxes, and reading about fake illnesses online...

Posts: 9332 | From: Westchester County, New York | Registered: May 2001  |  IP: Logged
drunkennewfiemidget
BlabberMouth, a Blabber Odyssey
Member # 2814

Member Rated:
4
Icon 1 posted May 14, 2007 09:43      Profile for drunkennewfiemidget     Send New Private Message       Edit/Delete Post   Reply With Quote 
I'm not entirely sure what it is you're looking for based on your post, but it appears passthru() might be what you're looking for.
Posts: 4897 | From: Cambridge, ON, Canada | Registered: Jun 2004  |  IP: Logged
WinterSolstice

Solid Nitrozanium SuperFan
Member # 934

Member Rated:
3
Icon 1 posted May 14, 2007 09:50      Profile for WinterSolstice     Send New Private Message       Edit/Delete Post   Reply With Quote 
Maybe I'm looking at this wrong, but it sounds like you're just looking to create a link to pre-existing file dynamically?

Perhaps all you need is to just write the href for the link using document.write or whatnot. Sounds like it'd be easy in PHP = I know it's cake in perl.

--------------------
An operating system should be like a light switch... simple, effective, easy to use, and designed for everyone.

Posts: 1192 | From: Los Angeles | Registered: Oct 2001  |  IP: Logged
dragonman97

SuperFan!
Member # 780

Member Rated:
4
Icon 1 posted May 14, 2007 11:06      Profile for dragonman97   Author's Homepage     Send New Private Message       Edit/Delete Post   Reply With Quote 
I'm pretty sure what he's trying to do is to dynamically generate a file for each person who uses the system to download to their hard drive to use in an e-mail application or something of the sort.

i.e. Click 'Download signature' and one's browser should show "Download file: signature.html: Open / Save / Cancel ?"

If you made a form post button, or a simple GET/HREF, the page called should return a Content-Disposition with a suggested file name, and /maybe/ a Content-Type of text/html, but sometimes those need to be application/'foo' to get *cough* Windows *cough* to save them instead of open them.

--------------------
There are three things you can be sure of in life: Death, taxes, and reading about fake illnesses online...

Posts: 9332 | From: Westchester County, New York | Registered: May 2001  |  IP: Logged
GameMaster
BlabberMouth, a Blabber Odyssey
Member # 1173

Member Rated:
4
Icon 1 posted May 14, 2007 14:27      Profile for GameMaster   Author's Homepage     Send New Private Message       Edit/Delete Post   Reply With Quote 
1. HTML signatures? Seriously? Ah man! I am beginging to think my friend wasn't crazy when he adjusted his filter to block all HTML messages, and e-mail back the reciepiant saying:

"This is an automatically generated message. The attached e-mail you sent was in HTML. I only accept plain text e-mail. If it is something you want me to see, please send in plain text. Thanks, ..."

2. Do you mean to create a static sig on the server for each user. If so, your looking to use fopen()
http://us2.php.net/fopen
Followed by a fwrite() or two
http://us2.php.net/manual/en/function.fwrite.php

Then a fflush() (optional, but I'm anal, the close should do a fflush anyway) and a fclose().
http://us2.php.net/manual/en/function.fclose.php

Then mail a link to the page to the user.

I stand by sigs, and e-mail in general, being plain text. Especially if the only thing you gain is a couple of links (which most text programs would make into text auto-magically and some green text.... Anywho....

Personally, I think a simple memo on what their sig should look like is a better idea than a silly app. Moreover, I understand united front and all that, but I'll never conform to placing signing anything in any way other than the way I feel I should sign it.

edit:You could also output the text to a string and dump it into an e-mail if your using a mail module and have a mail server available to you.

Posts: 3038 | From: State of insanity | Registered: Mar 2002  |  IP: Logged
dragonman97

SuperFan!
Member # 780

Member Rated:
4
Icon 1 posted May 14, 2007 21:14      Profile for dragonman97   Author's Homepage     Send New Private Message       Edit/Delete Post   Reply With Quote 
Haha...yeah, that is quite true. I got swept up in the problem without sticking by my disdain for HTML mail. ;-)

The worst is Google Reader's new HTML mail gizmo...the plain text version has *nothing* useful in it - no plain text links to get automagically linkified. This means that if I send it to my work account and read it in Thunderbird, I'm SOL. Sadly, I haven't gotten around to complaining through official channels...so this is a pointless rant, I suppose.

--------------------
There are three things you can be sure of in life: Death, taxes, and reading about fake illnesses online...

Posts: 9332 | From: Westchester County, New York | Registered: May 2001  |  IP: Logged
Stibbons
SuperBlabberMouth!
Member # 2515

Member Rated:
5
Icon 1 posted May 15, 2007 00:06      Profile for Stibbons   Author's Homepage     Send New Private Message       Edit/Delete Post   Reply With Quote 
quote:
Originally posted by dragonman97:
I'm pretty sure what he's trying to do is to dynamically generate a file for each person who uses the system to download to their hard drive to use in an e-mail application or something of the sort

Exactly that [thumbsup]

quote:
Originally posted by GameMaster:
1. HTML signatures? Seriously? Ah man!

Tell me about it [Roll Eyes] It's all part of our new corporate identity - we have to have standard signatures across the organisation. Which is all well and good, but does it really need to be html? And in colours that people are often colourblind to? Apparently, yes. Though if you're sensible and use plaintext and make enough of a stink about it ( [Big Grin] ) then they let you off, if only because you out technical the design team.

quote:
2. Do you mean to create a static sig on the server for each user.
Not really. A one-off generated page that they can download/copy-n-paste would work just fine (plus I've had interest in using it from people outside our little division, and don't want to clog up university servers.

quote:
Personally, I think a simple memo on what their sig should look like is a better idea than a silly app.
Tried it. Multiple times. Hence why it's come down to this [Frown]

Well, I'll give it a go and see what happens!

Posts: 1143 | From: UK | Registered: Dec 2003  |  IP: Logged


All times are Eastern Time  
Post New Topic  New Poll  Post A Reply Close Topic    Move Topic    Delete Topic next oldest topic   next newest topic
 - Printer-friendly view of this topic
Hop To:

Contact Us | Geek Culture Home Page

2015 Geek Culture

Powered by Infopop Corporation
UBB.classicTM 6.4.0



homeGeek CultureWebstoreeCards!Forums!Joy of Tech!AY2K!webcam