It looks like you're new here. If you want to get involved, click one of these buttons!
<html><head><title>PS2 Mall - Admin: Add A Game</title></head><body>
<?php
$form1 = "
<form name=\"addgame\" action=\"addprocess.php\" method=\"post\">
Please choose the category the game best fits into: <br />
<select name=\"category\">
<option value=\"catactionadventure.txt\">Action & Adventure</option>
<option value=\"catarcadeplatform.txt\">Arcade & Platform</option>
<option value=\"catclassicretro.txt\">Classic & Retro</option>
<option value=\"catdrivingracing.txt\">Driving & Racing</option>
<option value=\"catfamily.txt\">Family</option>
<option value=\"catfighting.txt\">Fighting</option>
<option value=\"catroleplaying.txt\">Role playing</option>
<option value=\"catsport.txt\">Sport</option>
<option value=\"catstrategysimulation.txt\">Strategy & Simulation</option>
<option value=\"catwarmilitary.txt\">War & Military</option>
</select>
<br /><br />
Please enter the game name WITH capital letters, spaces, etc: <br />
<input type=\"text\" name=\"fullname\" value=\"\" size=\"40\" maxlength=\"40\" />
<br /><br />
Please enter the game name WITHOUT capital letters, or spaces...: <br />
<input type=\"text\" name=\"codename\" value=\"\" size=\"40\" maxlength=\"40\" />
<br /><br />
Please enter the price of the game (eg \"£39.99\"): <br />
<input type=\"text\" name=\"price\" value=\"\" size=\"6\" maxlength=\"6\"/>
<br /><br />
Please enter the PASSWORD: <br />
<input type=\"text\" name=\"password\" value=\"\" size=\"40\" maxlength=\"62\"/>
<br /><br />
<input type=\"submit\" value=\"Submit\" />        <input type=\"reset\" value=\"Reset\" />
</form>";
$form2 = "
<form name=\"confirm\" action=\"process.php\" method=\"post\">
<b>Thanks<br>
Is this info Correct???</b><br><br>
Category: $category<br>
Full Name: $fullname<br>
Name without spaces and capitals etc: $codename<br>
Price: $price<br>
<input type=\"hidden\" name=\"category\" value=\"$category\">
<input type=\"hidden\" name=\"fullname\" value=\"$fullname\">
<input type=\"hidden\" name=\"codename\" value=\"$codename\">
<input type=\"hidden\" name=\"price\" value=\"$price\">
<input type=\"hidden\" name=\"password\" value=\"$password\">
</form>";
$form3 = "
<form name=\"error\" action=\"form.php\" method=\"post\">
<input type=\"hidden\" name=\"category\" value=\"$category\">
<input type=\"hidden\" name=\"fullname\" value=\"$fullname\">
<input type=\"hidden\" name=\"codename\" value=\"$codename\">
<input type=\"hidden\" name=\"price\" value=\"$price\">
</form>";
/// LOGIG BIT:
if($password!=poo){
print "ACCESS DENIED!<br>";
}
if($fullname==""){
print "Full Name field cannot be blank!<br>";
}
if($codetname==""){
print "Name without capitals etc field cannot be blank!<br>";
}
if($price==""){
print "Email field cannot be blank!<br>";
}
if($category==""){
print "Category field cannot be blank!<br>";
}
if($firstname=="" || $lastname=="" || $email1!=$email2 || $payment=="" || $terms!="agree"){
print "<br><br><br>$form3";
}
// everything OK - display details using $form2
// $form2 will call process.php through the post method
else{
print "$form2";
// comment the following line if you not want to provide the user a way out
print "<a href=\"avascript:history.back(1)\">Click here to modify...</a><br>";
}
}
}
?>
</body>
</html>
<?php
// modify these variables if the data files need to be kept in different locations
$datafilespath="./";
$generalfilepath=$datafilespath."catall.txt";
$productfilepath=$datafilespath.$category;
$row=
"<table style=/"position:relative;top:0px;left:0px;height:auto;width:500px;margin:0px 50px 5px 50px;border-style:none;border-width:1px;border-color:#AA0000;text-align:center;/">
<tr style=/"width:500px;border-style:solid;border-width:1px;border-color:#AA0000;/">
<td colspan=/"2/" style=/"width:500px;border-style:solid;border-width:1px;border-color:#AA0000;/">".$fullname."
</a></td>
</tr>
<tr>
<td style=/"width:500px;border-style:solid;border-width:1px;border-color:#AA0000;/">
".$price."
</td>
<td style=/"width:500px;border-style:solid;border-width:1px;border-color:#AA0000;/"><a href=/"/form.php?p=
".$codename."
/">Buy Now!</a></td>
</tr>
</table>"
// write to general file
// the a+ option will append new records to the end of the file and create a file if the file does not exist
$file=fopen($generalfilepath, "a+");
fwrite($file, $row);
fclose($file);
// write to product file
// the a+ option will append new records to the end of the file and create a file if the file does not exist
$file=fopen($productfilepath, "a+");
fwrite($file, $row);
fclose($file);
// send email
$to="webmaster@ps2mall.co.uk";
$subject="Game Added: ".$fullname.;
$header="From:you@yourdomain.com (HEADER?)";
//uncomment this line to activate email sending :)
mail($to, $subject, $row, $header);
// inform user
print "The Game Has Been Added!!<br><br><br>";
print "<a href=\"http://www.ps2mall.co.uk/all.html">See it here!!</a><br>";
?>
Parse error: parse error, unexpected '}' in /home/matsim68/public_html/PS2mall/addagame.php on line 74
Comments
2. From a quick glance in your code, your password is "poo" and it is hardcoded in your code? This may be seen by your customers
3. In any event, I'll get a working package up for you by tomorrow. I'll also put some thought into the password thing.
I'm stuck with reading my vBulletin manual now It's a headace reading...
As for the password: I didnt know of any other way of doing it...
If you can do it another way that would be ace!
Line 74 is a blank line.
Line 73:
Line 75:
Thanks
if($password!="poo"){
Then I saw this: and changed it to this:
And then I got a different erro about an unexpected "}" on line 107...
So I took it out and voila.
This is the new code for addagame.php:
The problem now is that when I go to that page, I don't see the form... It just gives me all the error messages... lol...
What have I dont wrong now?
Didn't have time to think about the password thingy - it can easily be solved if you've got a database though...
You've got to be more careful when you code - you got lots of syntax problems - e.g. missing " ; { etc
Anyway, try it out and tell me if you need any more changes.
I think this will ahve to do for now but I promise to try to learn sql etc soon.
As for my syntax - yeah. I know. I'm new to PHP and I understand most of the logic... it's the syntax I don't like
Thank again, daboss.