Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Software Development
Programming
Programming Q&A
PHP echo user data
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="bnmz4" data-source="post: 282956" data-attributes="member: 19564"><p><?php</p><p>include('config.php');</p><p>?></p><p><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "<a href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" target="_blank">http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</a>"></p><p><html xmlns="<a href="http://www.w3.org/1999/xhtml" target="_blank">http://www.w3.org/1999/xhtml</a>"></p><p> <head></p><p> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></p><p> <link href="<?php echo $design; ?>/style.css" rel="stylesheet" title="Style" /></p><p> </p><p> </head></p><p> <body></p><p> <div class="header"></p><p> <a href="<?php echo $url_home; ?>"><img src="<?php echo $design; ?>/images/logo.png" alt="Members Area" /></a></p><p> </div></p><p><?php</p><p>//We check if the user is logged</p><p>if(isset($_SESSION['username']))</p><p>{</p><p> //We check if the form has been sent</p><p> if(isset($_POST['username'], $_POST['password'], $_POST['passverif'], $_POST['email'], $_POST['avatar']))</p><p> {</p><p></p><p></p><p>if (!$user_row)</p><p>{</p><p> // User does not exist</p><p>}?></p><p></div></p><p><?php</p><p> }</p><p>}</p><p>else</p><p>{</p><p>?></p><p><div class="message">To access this page, you must be logged.<br /></p><p><a href="connexion.php">Log in</a></div></p><p><?php</p><p>}</p><p>?></p><p> </p><p></p><p><?php</p><p>/* Database Connection (MySQLi) */</p><p>$conn =new mysqli('localhost','root','fartface1','habbocreds');</p><p>$query = $conn->query("SELECT * FROM users WHERE id = '" . $userid . "'");</p><p>$result = $query->fetch_assoc();</p><p></p><p>/* Make Database Into Variables */</p><p>$ID = $result['id'];</p><p>$Username = $result['username'];</p><p>$Password = $result['password'];</p><p>$Email = $result['email'];</p><p>$NoCredits = $result['credits'];</p><p></p><p></p><p>/* Display */</p><p>// echo($ID); // ID</p><p>// echo($Username); // Username</p><p>// echo($Password); // Password</p><p>// echo($Email); // Email</p><p></p><p>?></p><p></p><p></p><p><div class="foot"><a href="<?php echo $url_home; ?>">You Have <?php echo($NoCredits);?> credits available to spend!</p><p></p><p></p><p></p><p></p><p></html></p><p></p><p></p><p></p><p>this is my code so what shall i change $userid to?</p></blockquote><p></p>
[QUOTE="bnmz4, post: 282956, member: 19564"] <?php include('config.php'); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[URL]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd[/URL]"> <html xmlns="[URL]http://www.w3.org/1999/xhtml[/URL]"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link href="<?php echo $design; ?>/style.css" rel="stylesheet" title="Style" /> </head> <body> <div class="header"> <a href="<?php echo $url_home; ?>"><img src="<?php echo $design; ?>/images/logo.png" alt="Members Area" /></a> </div> <?php //We check if the user is logged if(isset($_SESSION['username'])) { //We check if the form has been sent if(isset($_POST['username'], $_POST['password'], $_POST['passverif'], $_POST['email'], $_POST['avatar'])) { if (!$user_row) { // User does not exist }?> </div> <?php } } else { ?> <div class="message">To access this page, you must be logged.<br /> <a href="connexion.php">Log in</a></div> <?php } ?> <?php /* Database Connection (MySQLi) */ $conn =new mysqli('localhost','root','fartface1','habbocreds'); $query = $conn->query("SELECT * FROM users WHERE id = '" . $userid . "'"); $result = $query->fetch_assoc(); /* Make Database Into Variables */ $ID = $result['id']; $Username = $result['username']; $Password = $result['password']; $Email = $result['email']; $NoCredits = $result['credits']; /* Display */ // echo($ID); // ID // echo($Username); // Username // echo($Password); // Password // echo($Email); // Email ?> <div class="foot"><a href="<?php echo $url_home; ?>">You Have <?php echo($NoCredits);?> credits available to spend! </html> this is my code so what shall i change $userid to? [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Software Development
Programming
Programming Q&A
PHP echo user data
Top