AttackBunnyPro
New Member
- Messages
- 26
- Reaction score
- 0
- Points
- 0
PHP:
<?php
$forumName = $_POST['forumName'];
if(!$forumName){
echo "fail";
}
mysql_connect('localhost','username','password');
mysql_select_db('abp_main');
mysql_query("INSERT INTO forum_forums
VALUES(NULL, '$forumName')");
$affectedRows = mysql_affected_rows();
$query1 = mysql_query("SELECT * FROM forum_forums
WHERE forumName='$forumName'");
$forumData = mysql_fetch_array($query1);
/***************************************************************************************************
****************************************************************************************************/
$forumID = $forumData['forumID'];
$fo=fopen($forumID."/index.php","w");
$fileData='<html>
<head>
<title>'.$forumName.' forum on ABP</title>
</head>
<body>
<table>
<?php
mysql_connect("localhost","abp_phpacc","q!4PTy@&8");
mysql_select_db("abp_main");
$sql = "SELECT * FROM forum_threads
WHERE forumID='$forumID'");
$query2 = mysql_query($sql);
while($results = mysql_fetch_array($query)){
echo "<tr><td><a href='".$forumID."/".$results["threadID"]."'>".$results["threadName"]."</a></td><td>Created by ".$results["threadCreator"]."</td></tr>";
}
?>
</table>
</body>
</html>';
fwrite($fo,$fileData);
fclose();
header("Location: index.php");
?>
I try to do that, but when I do, I get this error:
Parse error: syntax error, unexpected T_VARIABLE in /home/abp/public_html/test/admin/addForum.php on line 36
Last edited: