PHP - This Is Retarded
This is what I have all it does is come up with blank page I've been working on this for 8 hours with no change looked everywhere no idea what to do.
Code: [Select] <?php // Connects to your Database mysql_connect("localhost", "name", "password") or die('Error: '.mysql_error()); mysql_select_db("database") or die(mysql_error()); if(isset($_COOKIE['ID_my_site'])) { //$username of login user $username = $_COOKIE['ID_my_site']; $pass = $_COOKIE['Key_my_site']; $check = mysql_query("SELECT * FROM users WHERE username = '$username'")or die(mysql_error()); while($info = mysql_fetch_array( $check )) { //fname is the first name of login user Print "<b>Name:</b> ".$info['fname'] . " "; }} ?> my database is all on one table id | username | password | fname | lname 1 | unsernam1 | **** | John | Doe 2 | unsernam2 | **** | Amy | Jane 3 | unsernam3 | **** | Doug | Smith I want it so that when the new page upons it finds the username (Like usernam2) in database and prints out the users first name etc in. Help? Similar TutorialsHi any clues as to why this doesn't work, probably real simple having a slow day. <?php $ReportType = mysql_real_escape_string($_GET['ReportType']); $sql = "SELECT id, username, score, class, Banned FROM users WHERE is_active = 1 ORDER BY $ReportType DESC LIMIT 25"; $query = mysql_query($sql) or die(mysql_error()); $i=0; while($users = mysql_fetch_array($query)) { $i++; ?> Everytime I make an announcement/post with a link like so: "This is an announcement with the following link: <a href="http://www.blah.asp">link</a>" It never goes to the actual webpage. It always goes to a "not found" page on my website like so: http://mywebsite.com/"http://www.blah.asp/" Code: [Select] $DB->query("SELECT g_title from ibf_groups where g_title NOT IN ('Validating','Guests') order by g_title"); while($group = $DB->fetch_row()){ $data[] = $group['g_title']; } echo $data[0]; var_dump($data); var dump Code: [Select] 'TITLE' => string 'Validating' (length=10) 'ICON' => null 0 => string 'Admin' (length=5) 1 => string 'Donor' (length=5) 2 => string 'Loser' (length=5) 3 => string 'Members' (length=7) 4 => string 'Members+' (length=8) 5 => string 'Moderator' (length=9) 6 => string 'Senior Moderator' (length=16) how do I get rid of Validating? and ICON? |