DEVILofDARKNESS Posted September 12, 2009 Share Posted September 12, 2009 I also want to let people Bèta test my site, I've worked hard on it, and I like it (doesn't mean you have to like it). So I want to make it safe, easy to use I want to let people test if everything works like you should expect... only at the register page you should be sure your names start with a capital, because the script doesn't give any error yet and you can't move on to the next page I also know that the centered text isn't beautifull. ninv (test account username:IRA pass: IRA) for moderators: http://www.ninv.be/phpfreaks.txt is to show I'm the owner Link to comment https://forums.phpfreaks.com/topic/173986-ninv/ Share on other sites More sharing options...
xcoderx Posted September 12, 2009 Share Posted September 12, 2009 Their went something wrong... "; switch($id){ case 1: echo "You forgot to choose a target and/or a region from where you want to attack."; break; case 2: echo "You didn't make step 1,2 and 4"; break; case 3: echo "You don't have that many rockets!"; break; case 4: echo "You didn't choose a weapon and/or an ammount"; break; default: echo "Their was an unknown problem..."; break; } echo " return"; ?> Link to comment https://forums.phpfreaks.com/topic/173986-ninv/#findComment-917232 Share on other sites More sharing options...
darkfreaks Posted September 12, 2009 Share Posted September 12, 2009 abit of advice use mysql_real_escape_string() and PDO in your application. if your not sure read up on how to use it. this will weed out all SQL injection you may have now Link to comment https://forums.phpfreaks.com/topic/173986-ninv/#findComment-917242 Share on other sites More sharing options...
DEVILofDARKNESS Posted September 13, 2009 Author Share Posted September 13, 2009 Yes I didn't do anything against sql-injections yet, that should be on my list! if I do $_GET['id'] and then a switch($id) is that safe enough or should I htmlspecialchars the variable? Link to comment https://forums.phpfreaks.com/topic/173986-ninv/#findComment-917522 Share on other sites More sharing options...
trq Posted September 13, 2009 Share Posted September 13, 2009 if I do $_GET['id'] and then a switch($id) is that safe enough Sorry, but that makes no sense. Link to comment https://forums.phpfreaks.com/topic/173986-ninv/#findComment-917552 Share on other sites More sharing options...
DEVILofDARKNESS Posted September 13, 2009 Author Share Posted September 13, 2009 Why? Link to comment https://forums.phpfreaks.com/topic/173986-ninv/#findComment-917633 Share on other sites More sharing options...
darkfreaks Posted September 13, 2009 Share Posted September 13, 2009 use some PDO in your SQL queries this will escape SQL injection Example: <?php $db = new PDO('mysql:host=localhost;dbname=school', 'username', 'password'); $stmt = $db->prepare('INSERT INTO Students (name) VALUES (:name)'); try { $stmt->execute(array('name' => $_POST['student_name'])); echo 'Success.'; } catch(PDOException $e) { echo 'Insertion failed. Please try again.'; } ?> Link to comment https://forums.phpfreaks.com/topic/173986-ninv/#findComment-917638 Share on other sites More sharing options...
DEVILofDARKNESS Posted September 13, 2009 Author Share Posted September 13, 2009 I will google myself what PDO is, but I'm not familiar with the $db->prepare : is it the same as mysql_query ??? Link to comment https://forums.phpfreaks.com/topic/173986-ninv/#findComment-917641 Share on other sites More sharing options...
darkfreaks Posted September 13, 2009 Share Posted September 13, 2009 no it is not , i suggest you google and read up on it and then apply it to your application. Link to comment https://forums.phpfreaks.com/topic/173986-ninv/#findComment-917645 Share on other sites More sharing options...
DEVILofDARKNESS Posted September 13, 2009 Author Share Posted September 13, 2009 How is it called? because if I do php -> or php $db-> google just drops the -> because it's not alphanumeric. Link to comment https://forums.phpfreaks.com/topic/173986-ninv/#findComment-917657 Share on other sites More sharing options...
darkfreaks Posted September 13, 2009 Share Posted September 13, 2009 code please otherwise we dont know what you are doing Link to comment https://forums.phpfreaks.com/topic/173986-ninv/#findComment-917673 Share on other sites More sharing options...
DEVILofDARKNESS Posted September 13, 2009 Author Share Posted September 13, 2009 Nono I'm not using any code, I asked what '->' means and you said Google it. but if I fill in the searshbar: 'php ->' Google makes it: 'php' without the '->' So my question was: Is there a special name for '->'? Link to comment https://forums.phpfreaks.com/topic/173986-ninv/#findComment-917674 Share on other sites More sharing options...
darkfreaks Posted September 13, 2009 Share Posted September 13, 2009 what are you trying to do? Link to comment https://forums.phpfreaks.com/topic/173986-ninv/#findComment-917677 Share on other sites More sharing options...
DEVILofDARKNESS Posted September 13, 2009 Author Share Posted September 13, 2009 I want to know what $db->prepare does Link to comment https://forums.phpfreaks.com/topic/173986-ninv/#findComment-917680 Share on other sites More sharing options...
darkfreaks Posted September 13, 2009 Share Posted September 13, 2009 it fetches the query and prepares it thus stripping it of SQL injection then executes it Link to comment https://forums.phpfreaks.com/topic/173986-ninv/#findComment-917751 Share on other sites More sharing options...
Coreye Posted September 13, 2009 Share Posted September 13, 2009 How is it called? because if I do php -> or php $db-> google just drops the -> because it's not alphanumeric. http://www.phpfreaks.com/forums/index.php/topic,95867.0.html. Link to comment https://forums.phpfreaks.com/topic/173986-ninv/#findComment-917781 Share on other sites More sharing options...
trq Posted September 13, 2009 Share Posted September 13, 2009 Why not look up pdo in the manual, its as easy as typing http://php.net/functionname. http://php.net/pdo Link to comment https://forums.phpfreaks.com/topic/173986-ninv/#findComment-917893 Share on other sites More sharing options...
Recommended Posts