
matthijs110
Members-
Posts
25 -
Joined
-
Last visited
Everything posted by matthijs110
-
Sure, LayoutController.php: function head(){ ?> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> <meta name="author" content="matthijs110"> <link href='//fonts.googleapis.com/css?family=Ubuntu:300,400,500,700,300italic,400italic,500italic,700italic' rel='stylesheet' type='text/css'> <link href='//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'> <!-- Bootstrap core CSS --> <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> <!-- FontAwesome Icons --> <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css"> <!-- Bootstrap Core JS --> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> <script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.0/jquery-ui.min.js"></script> <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script> <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> <meta name="apple-mobile-web-app-title" content="Panel"> <meta name="apple-mobile-web-app-capable" content="yes"> </head> </html> <?php } ?> And in my profile.php:
-
Hello, I've made a function that contains the html header (<head>). When I call that function in a other file, with the header file included, it puts the header function in the body. So all the meta tags are in the body, instead of the head. Would it be possible to load this all in the head? The head function does contain the html and head tags. However, without them, it still doesn't want to go to the head.
-
Hello, How can I select multiple SQL tables? For example like this: $result = mysqli_query($con, "SELECT Username, Wins FROM Table1, Table2 ORDER BY Wins DESC"); I want to use it in 1: while ($row = mysqli_fetch_assoc($result)) { I know this is possible, but I can't find a clear way.
-
Hello all, I made a table last night and was wondering: How can I get the latest NEW row from the SQL, put it on the place of Member1, move all old tables 1 to the right, and remove the latest table (Member 20). Its a bit hard to explain, but hopefully you know what I mean
-
Generate PHP profile page with PHP data
matthijs110 replied to matthijs110's topic in PHP Coding Help
I tried multiple staff to convert the arguments to friendly URL's. It doesn't seems to work. Mod_rewrite is enabled in Apache <IfModule mod_rewrite.c> RewriteEngine On RewriteRule /(.*)/$ player/index.php?user=$1 </ifModule> I moved some stuff, thats why player and index.php is there. You can see it here: https://github.com/matthijs110/Minecraft-User-Info -
Generate PHP profile page with PHP data
matthijs110 replied to matthijs110's topic in PHP Coding Help
I just tried PDO with the link you gave. when I use it, the variables I made can't be reached anymore because some are in functions. But I will look into this when I got the code finished and try to make use of it, Thanks for the info about it, never heard of it. I got it working now member.php?user=matthijs110 is printing the right info now. When a user does not exists, it returns User not found! as it should for now Now my last question that follows (and no its not new problem, I asked it in my first post ) How would I convert: http://localhost/Minecraft-User-Info/member.php?user=matthijs110 To http://localhost/Minecraft-User-Info/user/matthijs110 -
Generate PHP profile page with PHP data
matthijs110 replied to matthijs110's topic in PHP Coding Help
So like this? $data = mysql_query("SELECT * FROM Player_Data WHERE Username = {$MCUser} LIMIT 1;"); if ($data === false) { trigger_error(mysql_error(), E_USER_ERROR); } Its giving a other error indeed. When I browse to: member.php?user=matthijs110, it gives me this error: Fatal error: Unknown column 'matthijs110' in 'where clause' in /Applications/XAMPP/xamppfiles/htdocs/Minecraft-User-Info/member.php on line 19 Line 19 = trigger_error(mysql_error(), E_USER_ERROR); And this when going to member.php?user=username: Array ( [0] => matthijs110 [username] => matthijs110 [1] => 72bc0e6c93da4bacaa9b680936c4bd82 [uUID] => 72bc0e6c93da4bacaa9b680936c4bd82 [2] => IPHidden [iP] => IPHidden [3] => Owner [Rank] => Owner [4] => 12 [Tokens] => 12 ) I changed my IP address to IPHidden. How would I fix this? What comes after =, should be searched in the SQL database column: Username. If it has been found, it should return the other data ( I know how to do this). If it isn't found, then go back to the home page. -
Generate PHP profile page with PHP data
matthijs110 replied to matthijs110's topic in PHP Coding Help
I use the or die(mysql_error()) When developing the webpage. If its all done, I remove it because I don't expect issues. Outside of that, I actually appreciate the copy paste. Don't worry about learning it, I understand the code when I see it pretty quickly. Mainly because I code Java too. But I'm not saying you aren't right. -
Generate PHP profile page with PHP data
matthijs110 replied to matthijs110's topic in PHP Coding Help
When I do this, it results something, I used member.php?user=username. like you said, but then it returns: Array ( [0] => matthijs110 [username] => matthijs110 [1] => 72bc0e6c93da4bacaa9b680936c4bd82 [uUID] => 72bc0e6c93da4bacaa9b680936c4bd82 [2] => IPHidden [iP] => IPHidden [3] => Owner [Rank] => Owner [4] => 12 [Tokens] => 12 ) I changed my IP address to IPHidden. When I go to member.php?user=matthijs110, It returns: Unknown column 'matthijs110' in 'where clause' -
Generate PHP profile page with PHP data
matthijs110 replied to matthijs110's topic in PHP Coding Help
Okay, I tried it, and it kinda works This is my code so far: https://github.com/matthijs110/Minecraft-User-Info/blob/master/member.php But when I go to: http://localhost/Minecraft-User-Info/member.php?MCUser=about It returns: Notice: Undefined index: Username in /Applications/XAMPP/xamppfiles/htdocs/Minecraft-User-Info/member.php on line 2 This is the home page How can I fix this? And how can I check if the parameter that is given in the URL exists in a database row? -
Generate PHP profile page with PHP data
matthijs110 replied to matthijs110's topic in PHP Coding Help
I do this on the index.php file or member.php ? btw, I'm going to make this without login/register possibilities. I got a other way to push info TO the MySQL database. -
Generate PHP profile page with PHP data
matthijs110 replied to matthijs110's topic in PHP Coding Help
Okay, I'm stuck now. I just don't know how to get that parameter after the member.php :/ -
Generate PHP profile page with PHP data
matthijs110 replied to matthijs110's topic in PHP Coding Help
I do know how to get info from the Database. How do you mean: for the name from the URL? -
Generate PHP profile page with PHP data
matthijs110 replied to matthijs110's topic in PHP Coding Help
The only code I have is a login/register page that works fine after you registered. I don't know how to do that what you said I have to do. Thats why I'm asking it here. But here is my code with the working login/register code: https://github.com/matthijs110/Login-Project -
Generate PHP profile page with PHP data
matthijs110 replied to matthijs110's topic in PHP Coding Help
Ah right, you make exactly clear what I mean So my question follows: How would I do that? -
Generate PHP profile page with PHP data
matthijs110 replied to matthijs110's topic in PHP Coding Help
Yes I know it, I actually never work with it. But how would I make a URL with it, IF there is a new row in the database and gets the info from a column? -
Hello all, I'm wondering, how can I generate a PHP page when a new row has been added to the SQL database. For example: If I add a row in my database with this info: Username: matthijs110 PHP should look to the row Username, and when there one be added, it should generate a URL like this: http://domain.com/profile/matthijs110 --- I also got a other question about this what might be more complex, but first I want to know if this is possible
-
Print error on different part of the website
matthijs110 replied to matthijs110's topic in PHP Coding Help
Woops, my mistake o: Forgot to change it xD Thank you very much for your help. I really appreciate it -
Print error on different part of the website
matthijs110 replied to matthijs110's topic in PHP Coding Help
For some reason when I hit Register, it says: Failed to run query: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'salt' in 'field list' It is in my SQL database -
Print error on different part of the website
matthijs110 replied to matthijs110's topic in PHP Coding Help
I had that line before in the file. But I deleted it because of this error: -
Print error on different part of the website
matthijs110 replied to matthijs110's topic in PHP Coding Help
Okay, thats working now But when I clicked "Register", it gives me the following error: Notice: Undefined variable: db in /Applications/XAMPP/xamppfiles/htdocs/Login-Project-3/register.php on line 24 Fatal error: Call to a member function prepare() on a non-object in /Applications/XAMPP/xamppfiles/htdocs/Login-Project-3/register.php on line 24 But it is defined. $query = " SELECT 1 FROM users WHERE username = :username "; $stmt = $db->prepare($query); -
Print error on different part of the website
matthijs110 replied to matthijs110's topic in PHP Coding Help
Yes it does But now I found my next problem Registering. When I hit Register, it opens the forum, if I click on the Register button of that form, it results to: -
Print error on different part of the website
matthijs110 replied to matthijs110's topic in PHP Coding Help
Well I combined them. https://github.com/matthijs110/Login-Project Which file should have the processing of the login? Index.php? It has the login fields. -
Print error on different part of the website
matthijs110 replied to matthijs110's topic in PHP Coding Help
So I put this code into the Jumotron? EDIT: I just tried this, but it results in: when I access the site This is my complete project if you want the full overview: https://github.com/matthijs110/Login-Project if($login_ok){ unset($row['salt']); unset($row['password']); $_SESSION['user'] = $row; header("Location: member.php"); die("Redirecting to: member.php"); } else{ print('<div class="alert alert-danger">Login failed!</div>'); $submitted_username = htmlentities($_POST['username'], ENT_QUOTES, 'UTF-8'); } -
Hello all! I got a login/register script. Its all working fine . When I click on Login, and didn't fill in the fields. It prints the error as it should. As you can see, its forced to print out under the menubar. But I want it into the Jumbotron. How can I do this? This code is defined on the top of the page to print the error: if($login_ok){ unset($row['salt']); unset($row['password']); $_SESSION['user'] = $row; header("Location: member.php"); die("Redirecting to: member.php"); } else{ print('<div class="alert alert-danger">Login failed!</div>'); $submitted_username = htmlentities($_POST['username'], ENT_QUOTES, 'UTF-8'); } But how can I print this somewhere else? I tried to move the code and I tried this on the place where it should print: if(!$login_ok){ print('<div class="alert alert-danger">Login failed!</div>'); $submitted_username = htmlentities($_POST['username'], ENT_QUOTES, 'UTF-8'); } Unfortunately that didn't worked Hopefully someone can help me out