Jump to content

mrbean

Members
  • Posts

    85
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

mrbean's Achievements

Member

Member (2/5)

0

Reputation

  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 });
×
×
  • 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.