Jump to content

Wierd Error Please help


Demonic

Recommended Posts

Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in C:\thephp\xampp\htdocs\nevux130RC1\install\install1.php on line 29

[quote=linke29]$user = $_POST['databaseuname']\;[/quote]


[full script]
[code]
<html>
<head>
<style type="text/css">
a:link, a:visited, a:active {text-decoration: underline;color: #FFFFFF; }
a:hover {text-decoration: underline;color: #ABC0DA; }
.linkheader{border-right:1px solid #000;border-left:1px solid #000;font-weight:bold;text-align:center;height:30px;width:100%;background-image: url(./../skin/category.gif)}
.linkbody{border-right:1px solid #000;border-left:1px solid #000;text-align:center;background-color: #5385B4;width:100%;}
body,html{text-align:center;background-color: #4F4F4F;}
.lastcatrow{height:10px;background-image: url(./../skin/category.gif);border:1px solid black;}
</style>
</head>
<body>
<table class='linkheader' width='100%'>
<tr>
<td>Create Config File</td>
</tr>
<table>
<?php
if(isset($_POST['createfile'])){
if($_POST['dbpassword'] != $_POST['dbpasswordc']){
echo "<table class='linkbody' width='100%' colspan='2'><tr><td>Database Passwords are not matching<a href='install2.php'> here</a>.</td></tr></table><table class='lastcatrow'><tr><td></td></tr></table>";
exit;
}
$config = "./../config.php";
$database = "database.php";
$handling = fopen($config, 'w');
$StringData = "<?php
ob_start()\;
$user = $_POST['databaseuname']\;
$pass = $_POST['dbpassword']\;
$database = $_POST['databasename']\;
mysql_connect(\"localhost\",$user,$pass) or die(mysql_error())\;
mysql_select_db($database) or die(mysql_error())\;
$cookieid = htmlspecialchars($_COOKIE[uid])\;
$cookiepass = htmlspecialchars($_COOKIE[upass])\;
$logged = mysql_query(\"SELECT * FROM users WHERE id='$cookieid' AND password='$cookiepass' \")\;
$logged = mysql_fetch_array($logged)\;
?>
";
fwrite($handling, $StringData);
$handling2 = fopen($database, 'w');
$StringData2 = "<?php
$user = $_POST['databaseuname']\;
$pass = $_POST['dbpassword']\;
$database = $_POST['databasename']\;
mysql_connect(\"localhost\",$user,$pass) or die(mysql_error())\;
mysql_select_db($database) or die(mysql_error())\;
?>
";
fwrite($handling2, $StringData2);
echo "<table class='linkbody' width='100%' colspan='2'><tr><td>Database information was complete go to next step <a href='install2.php'> here</a>.</td></tr></table>";
}else{
?>
<form method='post'>
<table class='linkbody' width='100%' colspan='2'>
<tr>
<td>
Database Name:
</td>
<td>
<input type='text' name='databasename'>
</td>
</tr>
<tr>
<td>
DB Password:
</td>
<td>
<input type='password' name='dbpassword'>
</td>
</tr>
<tr>
<td>
DB Password Check:
</td>
<td>
<input type='password' name='dbpasswordc'>
</td>
</tr>
<tr>
<td>
Database Username:
</td>
<td>
<input type='text' name='databaseuname'>
</td>
</tr>
<tr>
<td>
Create Config File:
</td>
<td>
<input type='submit' name='createfile' value='Create DB File'>
</td>
</tr>
</table>
</form>
<? } ?>
<table class='lastcatrow' width='100%'>
<tr><td></td></tr>
</table>
</body>
</html>
[/code]

now i updated script and when i did this:

[code]
$StringData = "<?php
ob_start()\;
\$user = \$_POST['databaseuname']\;
\$pass = \$_POST['dbpassword']\;
\$database = \$_POST['databasename']\;
mysql_connect(\"localhost\",\$user,\$pass) or die(mysql_error())\;
mysql_select_db(\$database) or die(mysql_error())\;
\$cookieid = htmlspecialchars(\$_COOKIE[uid])\;
\$cookiepass = htmlspecialchars(\$_COOKIE[upass])\;
\$logged = mysql_query(\"SELECT * FROM users WHERE id='\$cookieid' AND password='$cookiepass' \")\;
\$logged = mysql_fetch_array(\$logged)\;
?>
";
[/code]

it worked BUT
i get this in the database file also in Config.php file:

[code]
<?php
$user = $_POST['databaseuname'];
$pass = $_POST['dbpassword'];
$database = $_POST['databasename'];
mysql_connect("localhost",$user,$pass) or die(mysql_error())\;
mysql_select_db($\database) or die(mysql_error())\;
?>
[/code]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.