Jump to content

mrbean

Members
  • Posts

    85
  • Joined

  • Last visited

Everything posted by mrbean

  1. Thank you for your help, I will change my class after I fixed this. I have changed the code, and tried this: $userdata = mysql_query("SELECT `first_time`, `money`, `life` FROM users WHERE 'username' = 'demo'"); $user = mysql_fetch_object($userdata)or die("ERROR: ".mysql_error()); echo $user->money; Result: ERROR:
  2. I have a little problem i hope someone can help me with it. Here's the code: <?php session_start(); echo $_SESSION['username']; // result: demo include($_SERVER['DOCUMENT_ROOT']."/database.php"); $database = new database("mysql"); $database->query("SELECT `first_time`, `money`, `life` FROM `[users]` WHERE `username` = '".$_SESSION['username']."' ","userdata"); $user = mysql_fetch_object($checkfirstime); ?> Database: http://ctrlv.in/145476 Database.php: <?php class database { public function __construct($type) { global $server,$username,$password,$databasename,$querytype,$mysql,$mysqli,$mssql; if($type === "mysql") { $mysql = mysql_connect($server, $username, $password)or die("kan geen verbinding maken met de server, de volgende error is voortgekomen:".mysql_error()); mysql_select_db($databasename, $mysql)or die("kan geen verbinding maken met de database, de volgende error is voortgekomen:".mysql_error()); } else if($type === "mysqli") { $mysqli = new mysqli($server, $username, $password, $database); } else if($type === "mssql") { $mssql = mssql_connect($server, $username, $password); mssql_select_db($database, $mssql); } $querytype = $type; } public function query($query,$naam = "GEEN") { global ${$naam},$querytype; if($querytype === "mysql") { ${$naam} = mysql_query($query)or die('error in '.$naam.': '.mysql_error()); } else if($querytype === "mysqli") { ${$naam} = $mysqli->query($query)or die('error in '.$naam.': '.mysql_error()); } else if($querytype === "mssql") { ${$naam} = mssql_query($query)or die('error in '.$naam.': '.mysql_error()); } } } ?> The error I get:
  3. Does someone know what they mean by "channelURL" in: <div id="fb-root"></div> <script> // Additional JS functions here window.fbAsyncInit = function() { FB.init({ appId : 'YOUR_APP_ID', // App ID channelUrl : '//WWW.YOUR_DOMAIN.COM/channel.html', // Channel File status : true, // check login status cookie : true, // enable cookies to allow the server to access the session xfbml : true // parse XFBML }); // Additional init code here }; // Load the SDK Asynchronously (function(d){ var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0]; if (d.getElementById(id)) {return;} js = d.createElement('script'); js.id = id; js.async = true; js.src = "//connect.facebook.net/en_US/all.js"; ref.parentNode.insertBefore(js, ref); }(document)); </script> Does someone have also an example?
  4. It works, but I can't see my "likes" on my facebook page I liked my own page
  5. I know this sounds stupid/dump but i need your help. I've got this: I want this: In facebook developers page, they show some examples. I tried it but didn't get what I want. Can someone help me with it?
  6. I will explain it to you guys. I have 2 files. One is the file with the functions The other file will include the functions file. For example: The function file contains: <?php class sadasd { function function } class lsadasd { function function function with an error } ?> File that includes the function <?php $functions_file = @include(dirname(__FILE__)."/functions.php"); if(!($functions_file)) { $try_default_functions_file = @include(dirname(__FILE__)."/functions.php"); if(!($try_default_functions_file)) { echo "<h1>Error</h1><br>"; echo "kan de functies bestand niet vinden.<br>"; echo "Could not find the functions file.<br>"; exit; } echo "error with including file."; } $test = new function(); $test->something(); //this should return test echo "test"; ?> Because the function.php an error contains nothing is shown. I only want to suppress the function "include" if it fails trigger an custom error to prevent hackers to see further info. But not if there is an internal error in function.php
  7. Verry simple to explain: If i suppress the include function, everything whats in it will not trigger an error instead the page returns white. @include("filewitherrors.php"); How can I suppress the include function but not effect the file?
  8. So the best way, is to give it an sort of prefix like: login_ signup_ contact_ reply_
  9. for example I have 2 forms: <form id="login_form" action="submit.php"> <input type="text" name="username"> <input type="password" name="password"> </form> <form id="signup_form" action="submit.php"> <input type="text" name="username"> <input type="password" name="password"> </form> With php I want to determinate if one of them is submitted. If it is, do something with the password + username. Both have the same input name, but is it possible to select only the inputs of a specific form even if they have the same name as other forms? If yes, how?
  10. I did some research on 'clearfix' @ google and I found an solution. Thanks mahngiel for your help!
  11. Check the site again, I added header:after{margin-bottom} But no effect?
  12. Hi, I want to have some space between my header element and the slider. I searched on the internet and tried margin-bottom in the header element but it doesn't give me the result I want( I use chrome browser). Here's the code link: http://goo.gl/NNHU8
  13. I'm not on about the function definitions.. Then what are you talking about? I said you should not run jquery code outside of the doc ready. If you guys both interpreted that wrong fine, but that's what I said. I understand you should not do that. If you are talking to me?
  14. I'm not on about the function definitions.. Thanks for your replies Adam. Found it! $(document).ready(function() { test=function(){ alert(123); }; // global var });
  15. Could you please please be more friendly. And sorry for my english, I am not an expert in it. Like Adam said, I thought there is an function to import an external file. Just like java. example: import my.package.MyClass; @jesirose, It doesn't work. Why? Just like Adam said: ".....So when you define test() within document event, you're restricting it to just that anonymous function." And everytime I start a new: $(document).ready(function(){ }); It will create a new unique anonymous function. Those functions created in the anonymous function will be only available in the anonymous function itself. For example, this won't work: Index.html <html> <head> <script language="JavaScript" src="first.js"> </script> <script language="JavaScript" src="second.js"> </script> </head> <body> Just some content. </body> </html> First.js $(document).ready(function(){ function test(){ alert("This is a test"); } }); Second.js $(document).ready(function(){ test(); }); ERROR: start is not defined. I can define it outside of document ready, but I want to work within the document ready function. Just to wrap the code and be more organized. Sorry for my english.
  16. How can I include that? Do you have an example?
  17. My code is like this: $(document).ready(function() { function test(){} }); Out of the ready function I want to execute test(), so in another js file: test(); But if I run the code, I get an error that test(); is not defined. How to solve this?
  18. If I convert my code to hexadecimal or octal radix, would the browser run this code faster? Or is it the same like normal js code?
  19. Why doesn't this work? var candy = new Array(new Array()); for (var i = 0; i < 10; i++) { candy[i][i] = "Sweet!"; } The error that I get from chrome is: Uncaught TypeError: Cannot set property '0' of undefined I want to make an multidimensional array in an loop without knowing how long it can be.
  20. Oh god.. I spelled success wrong.. Sorry...
  21. I just found out that xml is undefined. What to do?
  22. My code is like this: http://pastebin.com/xnLYU37f The only alerts that I get is this: "starting load images." "copy" "done"
  23. I am not asking that, but it's already fixed
×
×
  • 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.