FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » CLP - ON TOPIC! - Need PHP form email help, Please!
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: CLP - ON TOPIC! - Need PHP form email help, Please! [message #173211 is a reply to message #173209] Mon, 28 March 2011 03:08 Go to previous messageGo to previous message
P E Schoen is currently offline  P E Schoen
Messages: 86
Registered: January 2011
Karma:
Member
"Tim" wrote in message news:270320111530279327%batwzrd(at)hotmail(dot)com...

Paul, thanks for that link, I will try it out.

> Sadly, even I found several errors while cutting and pasting
> the code here. Here are some of the changes I have made.
> I am still working on it but I think this is closer.

> $page_name = $FTGfirstname . $FTGlastname . ".html";

> $string1 = "<html>\n
> .<head>\n
> .<title>$page_name</title>\n
> .</head>\n
> .<body>\n";

[snip]

> $new_profile = "profiles/$page_name";
> $fh = fopen($new_profile, 'w') or die("can't open file");
> fwrite($fh, $string1);

> Is this right? $new_profile = "profiles/$page_name";

> I've seen it done that way but it just seems wrong. I guess
> I could put everything in one string, as the original did, but
> it seemed so long I wanted to break it up.

That seems OK so far, but it is "ugly". A better way is to use a "nowdoc":

$nowdoc = <<<NOWDOC
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>$hTitle</title>
</head>
<body>
<h1>$title</h1>
$msg
</body>
</html>
NOWDOC;

$fh = fopen( "$new_profile", 'w' );
fwrite( $fh, $nowdoc );
fclose($fh);

Also, notice that I have quotes around the $new_profile file name. I'm not
sure that's necessary, but it works. I'm more of a hacker than an expert, so
you will have to use trial and error to get things working. I have also used
a "logfile" which writes certain variables and text messages at key points
in the script.

$fLog = fopen ($logfile, 'w');
// ....
fwrite( $fLog, $new_profile . "\n");
// ....
fclose( $fLog );
exit ;

HTH,

Paul
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: ip address of client
Next Topic: Islandnet.com dropping support for PHP4
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Nov 24 01:13:33 GMT 2024

Total time taken to generate the page: 0.04330 seconds