<?php
ini_set("log_errors", 1);
ini_set("error_log", "errorlog.log");
$recid= $_POST['recid'];
$username = $_POST['name'];
$email = $_POST['email'];
$ownername = $_POST['ownername'];
include ("connection.php");
$result = $db->query("UPDATE users SET verified='y' WHERE recid='$recid'");
$filename = str_replace(" ","_", trim($username));
mkdir("Business_Pages/". $filename."/");
$jquery = "<script src='http://code.jquery.com/jquery-1.9.1.min.js'> </script>";
$jqueryui = "<script src='http://code.jquery.com/ui/1.10.2/jquery-ui.js'> </script>";
$jquerycss = "<link rel='stylesheet' href='http://code.jquery.com/ui/1.10.2/themes/smoothness/jquery-ui.css'>";
$postdata = "<script src='../../Scripts/postdata.js'> </script>";
$pagecss = "<link rel='stylesheet' href='../../CSS/businesspages.css'>";
$wclogo = "<img src='../../wc.png' id='wc'>";
$postinput = "<input type='text' id='post' placeholder='Post' name='post'>";
$postdate = "<input type='text' id='date' placeholder='Enter Date' name='date'>";
$accountinfo = "<table id='accountinfo'> <tr> <td> <img src='../../testresteraunt.png' id='testresteraunt'> </td> </tr> <tr> <td> $username </td> </tr> <tr> <td> $ownername </td> </tr> </table>";
$links = "<table id='links'> <tr> <td> </td> <td> </td> </tr> </table> <div id='header'>";
$fp = fopen("Business_Pages/". $filename . "/" . $filename . ".html", "w");
fwrite($fp,"<?php session_start()");
fwrite($fp,"if(isset($_SESSION['id'])) { ?>");
fwrite($fp,"<!DOCTYPE html> <html> <head>");
fwrite($fp,"</head>");
fwrite($fp,"<body>");
fwrite($fp,"</body> </html>");
fwrite($fp,"<?php } ?>");
fclose($fp);
$to = "$email";
$subject = "Account Creation";
$message = "Congratulations you have been accepted to Wolfeboro Connection";
$from = "[email protected]";
$headers = "From:" . $from;
mail($to, $subject, $message, $headers)
?>
我只是在試圖顯示HTML,如果會話是有效的,但PHP是說,它的一個意想不到的if語句和
解析錯誤:語法錯誤,意想不到的T_ENCAPSED_AND_WHITESPACE,上線預計在T_STRING或T_VARIABLE或T_NUM_STRING /home/content/96/10688096/html/verify.php提前
感謝顯示頁面的HTML,如果存在會話
爲什麼你使用'fp'和'fwrite' ..你想顯示在瀏覽器頁面或希望它被寫入到文件...? – 2013-04-25 04:50:13
注意插值:根據腳本中的早期代碼,if(isset($ _ SESSION = ['id')){?>「'可能不會輸出您期望的內容。如果'$ _SESSION'是一個它應該是的數組,那麼輸出文件中的相關行會讀取'if(isset(array = ['id')){?>'。 – 2013-04-25 04:53:43
正確的,我想它fwrite來一個文件,我登錄轉到該文件,但我希望它不會去的文件,如果你不登錄 – 2013-04-25 04:58:11