Follow us on Twitter!
It is never to LATE to become what you never WERE.
Sunday, April 20, 2014
Navigation
Home
HellBoundHackers Main:
HellBoundHackers Find:
HellBoundHackers Information:
Learn
Communicate
Submit
Shop
Challenges
HellBoundHackers Exploit:
HellBoundHackers Programming:
HellBoundHackers Think:
HellBoundHackers Track:
HellBoundHackers Patch:
HellBoundHackers Other:
HellBoundHackers Need Help?
Other
Members Online
Total Online: 21
Guests Online: 19
Members Online: 2

Registered Members: 82843
Newest Member: hx47
Latest Articles
View Thread

HellBound Hackers | Computer General | Webmasters Lounge

Author

PHP Game Script


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 10-11-07 02:14
Hello, I am working on a game and I have a few error :(

Note: I always have errors...

Code

<?php
require_once "../htmlbegin.php";
include "../config.php";
if (isset($_SESSION['setuser']))
{
?>
<?php
$result = mysql_query("SELECT * FROM `users` WHERE user_id=".$_SESSION['setid']."");
$row = mysql_fetch_array($result);
if (!$result)
{
    die('Invalid query: ' . mysql_error());
}

if (($row['new']=="yes"))
{

?>
<center>
<b>
<h2>Configuration Form</h2>
<form name='config' id='config' method='post'>
[Set IP]
<input name='ip' id='ip' type='textbox' class='textbox'>
<hr />
[Set IP.ID]
<input name='ip_id' id='ip_id' type='textbox' class='textbox'>
<hr />
[Set Router IP]
<input name='router_ip' id='route_ip' type='textbox' class='textbox'>
<hr />
[Set Router ID]
<input name='router_id' id='route_id' type='textbox' class='textbox'>
<hr />
<input name='submit' id='submit' type='submit' class='submit' value='[SET]'>
</b>

<?php
if ($_POST['submit'])
{
$ip=stripslashes($_POST['ip']);
$ip_id=stripslashes($_POST['ip_id']);
$router_ip=stripslashes($_POST['router_ip']);
$router_id=stripslashes($_POST['router_id']);
mysql_real_escape_string($ip);
mysql_real_escape_string($ip_id);
mysql_real_escape_string($router_ip);
mysql_real_escape_string($router_id);
$ip_test = mysql_query("SELECT * FROM ip_info WHERE ip='$ip'")
or die ('Error: ' . mysql_error());
if ($row = mysql_fetch_array($ip_test))
{
echo 'This IP is already in use!';
}

$ip_id_test = mysql_query("SELECT * FROM ip_info WHERE ip_id='$ip_id'")
or die ('Error: ' . mysql_error());
if ($row = mysql_fetch_array($ip_id_test))
{
echo 'This ID is in use!';
}

}
else
{
$sql = "INSERT INTO ip_info(`ip`, `ip_id`, `router_ip`, `router_id`) VALUES ('{$_POST['ip']}', '{$_POST['ip_id']}', '{$_POST['router_ip']}', '{$_POST['router_id']}')";
mysql_query($sql)
or die('Error: ' . mysql_error());
echo 'Configuration Successful!;
}

}
else
{
echo ' ';
}
?>


<?php
}
else
{
echo "Refresh Script";
}

}
else
{
echo "Refresh Script";
}

require_once "../htmlend.php";
?>





What I was trying to do with it is fairly obvious, I do not understand why it is not working. If I remove the PHP in the middle it works...

This is the error I am getting:
Parse error: syntax error, unexpected ''', expecting ',' or ';' in /home/www/zbit.awardspace.com/alpha/game/config.new.php on line 75

Edited by spyware on 10-11-07 02:29
Author

RE: PHP Game Script


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 10-11-07 02:46
masta_hacks wrote:
VALUES ('{$_POST['ip']}', '{$_POST['ip_id']}', '{$_POST['router_ip']}', '{$_POST['router_id']}'Wink";


What in the bloody hell is that?


What I was trying to do with it is fairly obvious, I do not understand why it is not working.


Well, for a while, it was SOMEWHAT obvious... but, that just threw it all out of whack. I'd start looking at the line above.



Author

RE: PHP Game Script

spyware
Member



Posts: 4192
Location: The Netherlands
Joined: 14.04.07
Rank:
God
Warn Level: 90
Posted on 10-11-07 02:47
PHP errors = PHP fixes.

If not: world collapses.



img507.imageshack.us/img507/3580/spynewsig3il1.png
"The chowner of property." - Zeph
[small]
Widespread intellectual and moral docility may be convenient for leaders in the short term,
but it is suicidal for nations in the long term.
- Carl Sagan
“Since the grid is inescapable, what were the earlier lasers about? Does the corridor have a sense of humor?” - Ebert
[/s
http://bitsofspy.net
Author

RE: PHP Game Script


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 10-11-07 02:48
Hmm, I did't make that so I am not sure lol

Edited by on 10-11-07 02:55
Author

RE: PHP Game Script


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 10-11-07 02:51
masta_hacks wrote:
Hmm, I did make that so I am not sure lol


Umm... you mind rephrasing that for people that don't speak stupid?



Author

RE: PHP Game Script


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 10-11-07 02:54
It has to be that way or it does not work at all...
Author

RE: PHP Game Script


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 10-11-07 02:55
masta_hacks wrote:
It has to be that way or it does not work at all...


Obviously, it doesn't have to be that way, since it doesn't work, regardless.



Author

RE: PHP Game Script


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 10-11-07 03:15
I ment that line.
Author

RE: PHP Game Script

korg
Admin from hell



Posts: 2798
Location: ENDING YOUR ONLINE EXPERIENCE!
Joined: 01.01.06
Rank:
God
Posted on 10-11-07 03:18
Look at your error! it's really right in your face!


i57.photobucket.com/albums/g215/korg1269/shodan13.jpg

I deal in pain, All life I drain, I dominate, I seal your fate.
O R
Author

RE: PHP Game Script

korg
Admin from hell



Posts: 2798
Location: ENDING YOUR ONLINE EXPERIENCE!
Joined: 01.01.06
Rank:
God
Posted on 10-11-07 03:26
check here:
$ip_test = mysql_query("SELECT * FROM ip_info WHERE ip='$ip'")


i57.photobucket.com/albums/g215/korg1269/shodan13.jpg

I deal in pain, All life I drain, I dominate, I seal your fate.

Edited by korg on 10-11-07 03:39
O R
Author

RE: PHP Game Script


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 10-11-07 03:58
That line looks fine to me...
Author

RE: PHP Game Script


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 10-11-07 04:06
masta_hacks wrote:
That line looks fine to me...


Have you tried string concatenation with the variables in your SQL statements? Those have to be the most likely point of failure.



Author

RE: PHP Game Script


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 10-11-07 04:10
Please explain
Author

RE: PHP Game Script


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 10-11-07 04:22
masta_hacks wrote:
Please explain


Why don't you fucking Google "string concatenation PHP" and explain it to yourself, you lazy piece of shit?



Author

RE: PHP Game Script


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 10-11-07 04:44
when I change ' to " it doesn't work at all. And I know all that is working because thats the script I use for my Registration and it works fine there...
Author

RE: PHP Game Script


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 10-11-07 05:32
Read what Korg said and then read you error carefully, i don't know much Php but if you get an error it's never the computers fault it's yours.

[Edit]Apologies if i just posted a load of crap[/Edit]




Edited by on 10-11-07 05:33
Author

RE: PHP Game Script


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 10-11-07 11:44
omg masta_hacks, learn php properly. that is the single most disgustingly messy piece of php ive ever seen, and i know what youre doing, making a php hacking game right? ive done 50% of one of these myself, and its bloody hard and requires solid php knowledge, which tbh i dont think you fully have. you really should stop setting yourself stupid hard projects for your knowledge level then asking for help when errors appear.