Real Quick What is wrong with this code...?
Posted: Wed Jun 14, 2006 3:46 pm
This keeps returing the error message:
What is the error?
Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/www/submit.php on line 3
Code: Select all
<?php
if(isset($_POST['to']) && isset($_POST['from']) && isset($_POST['content'])){
$date = date("G""i""s""m""n""Y");
$filename = '' . $_POST['to'] . ''. $date . '' . $_POST['from'] . '';
$somecontent = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">/n<head>/n<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />/n<title>Message for' . $_POST['to'] . 'from' .$_POST['from'] . '</title>/n</head>/n<body>/n'. $_POST['content'] . '';
if (!$handle = fopen($filename, 'x')) {
echo "Cannot open file ($filename)";
exit;
}
if (fwrite($handle, $somecontent) === FALSE) {
echo "Cannot write to file ($filename)";
exit;
}
echo "Your message for ". $_POST['to'] .'was created!';
echo "You need to but this text in the comment to the user you want to send the message to: /n<textarea name=\"code\" cols=\"40\" rows=\"5\" id=\"textarea\">Your comment is here: <a href=\"http://myspacecomments.awardspace.com/" .$filename. "\">http://myspacecomments.awardspace.com/" . $filename . "</a> </textarea>";
fclose($handle);
} else {
print("Sorry, your missing data, please go back and try again");
}
print('<br><br><p align="center"><script type="text/javascript"><!--
google_ad_client = "pub-3154346307420490";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as_rimg";
google_cpa_choice = "CAAQiYaYhAIaCJ2wcuQYTrQ_KOm293M";
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<br />
<br>
<script type="text/javascript"><!--
google_ad_client = "pub-3154346307420490";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text_image";
google_ad_channel ="7349305414";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>');
?>