Help! PHP page doesn't show up when selected!

I’ve edited this file for translation and after that it went wrong… doesn’t work anymore but haven’t figured out what’s wrong… Can someone help?

[php]<?php
if(isset($_POST[‘backfire’])) {
$set = number_format($_POST[‘backfire’], 0, ‘’, ‘’);
if($set < 0) {
$set = 0;
}
mysql_query(“UPDATE users SET backfire = '” . $set . “’ WHERE id = '” . $own[‘id’] . “’”);
echo “<div class=“dark”><font color=“green” style=“font-weight: bold”>Settings saved.
”;
$own[‘backfire’] = $set;
}
echo"
Edit here the backfire settings, this is the amount of bullets that you fire back during an attack. If you don’t have enough bullets you won’t fire back and keep the remaining bullets.

Fire back with bullets.

"; ?>[/php]

in the echo statement you use the same quotes without escaping them so its throwing up errors,
here is a fixed version of your echo statement:
[php]echo’
Edit here the backfire settings, this is the amount of bullets that you fire back during an attack. If you don’t have enough bullets you won’t fire back and keep the remaining bullets.

Fire back with bullets.

'; [/php] notice i changed the opening/closing quotes to a single quote ' as this is how it was coded originally (i can tell by the syntax of the value element) also notice i have escaped the quote mark in the words don't and won't..

that should fix it
:wink:

P.S i also notice your sending the form via post, but you don’t set where your posting it to??

Isn’t this what you mean? I’m still kinda rookie in PHP… That’s why I joined the forum…

[php]if(isset($_POST[‘backfire’])) {
$set = number_format($_POST[‘backfire’], 0, ‘’, ‘’);
if($set < 0) {
$set = 0;
}
mysql_query(“UPDATE users SET backfire = '” . $set . “’ WHERE id = '” . $own[‘id’] . “’”);
echo “<div class=“dark”><font color=“green” style=“font-weight: bold”>Settings saved.
”;
$own[‘backfire’] = $set;
}[/php]

Form goes via post… and if set post bigger than 0 it goes to mysql to the users settings backfire…

PS. I’m a rookie in this I’m creating a crime game from a dutch source as a hobby… I want to study webdesign and IT next year so I already started a bit… Thanks already btw!

BTW It’s working now! Thanks! :wink:

your welcome :wink:

Sponsor our Newsletter | Privacy Policy | Terms of Service