Jump to content

u214

Members
  • Posts

    46
  • Joined

  • Last visited

    Never

Everything posted by u214

  1. Thanks both of y'all. It's working perfectly now and I also learned something new today =) Thanks once again!!
  2. Hello guys, I wasn't sure where exactly to post this, but it involves PHP ( I think ) so here I am. Ok, before starting, I did do some research and didn't find anything that could help me. Simple; I want the search results from a form to display on the same page! Here's the form: <form method="post" id="searchform" action="WHAT_TO_DO_HERE?"> <input type="text" value="" name="User" id="s" /> <input type="submit" id="searchsubmit" value="Search" /> </form> I want when the user hits the "Search" button, it will the display an image with the NAME of the use we searched for on that same page!!. Something like this: "[img_TAGS]http://website.com/image.php?Style=1&Username=USER_WE_SEARCHED_FOR[/img_TAGS]" (Just right below the search form) Yeah, something like that. I would be very pleased if someone could help me out with this!
  3. I need a search for like the one Firefox has. It automatically highlights what I'm trying to search on the page. Here's the page on where it will be used. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head profile="http://gmpg.org/xfn/11"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>=Famous= » Grand Theft Online «</title> <link rel="stylesheet" href="css/style.css" type="text/css" media="screen" /> <meta name="robots" content="index, follow" /> <script type='text/javascript' src="css/js/jquery-1.2.6.min.js-ver=2.8.4"></script> <link rel='index' title='=Famous=' #' /> <link rel="shortcut icon" href="css/images/favicon.ico?cb=1" /> <script type="text/javascript" src="css/js/custom.js"></script> </head> <body> <div id="wrapper"> <div id="top"> <div id="head"> <h12 id="logo"><a href="#">=Famous= » Grand Theft Online «</a></h12> <strong class="description">UCP ( User Control Panel )</strong> <ul id="nav"> <li><a href="#">Home</a></li> <li class="cat-item cat-item-72"><a href="#">Server Statistics</a> <ul class='children'> <li class="cat-item cat-item-75"><a href="#">#</a></li> <li class="cat-item cat-item-75"><a href="#">#</a></li> <li class="cat-item cat-item-75"><a href="#">#</a></li> </ul> </li> <li class="cat-item cat-item-73"><a href="#">#</a></li> <li class="cat-item cat-item-74"><a href="#">#</a></li> <li class="cat-item cat-item-75"><a href="#">#</a></li> <li class="cat-item cat-item-76"><a href="#">#</a></li> </ul> </div> <p class="breadcrumb">Connect to server now: <span class="copy">#</span> or click me: <a href="#"><strong>Connect Now</strong></a></p> <div class="content clearfix text"> <?php include("test.php"); $result = mysql_query("SELECT * FROM test ORDER BY TestName DESC",$connect); echo "<table width=720><tbody> <tr> <th width=20><span class='table-header'>Test Name:</span></th> <th width=20><span class='table-header'>Test IP:</span></th> <th width=70><span class='table-header'>Test Date:</span></th> <th width=20><span class='table-header'>Test Admin:</span></th> <th width=200><span class='table-header'>Test Reason:</span></th> </tr>"; while($myrow = mysql_fetch_assoc($result)) { echo "<tr> <td>";echo $myrow['Testname']; echo"</td> <td>";echo $myrow['TestIP']; echo"</td> <td>";echo $myrow['TestDate']; echo"</td> <td>";echo $myrow['TestAdmin']; echo"</td> <td><span class='ban-reason'>";echo $myrow['TestReason']; echo"</span></td> </tr>"; } echo "</tbody></table>"; ?> </div> <div class="footer"> <div class="footer_meta"> <span class="copy">©</span> 20<span class="copy">11</span> <a href="#">=Famous=</a> | UCP Coded by <a href="#">test</a> </div> </div> </div> </div> </body> </html> So once I start searching from something on that page, it will at least highlight it and or direct the page into that search input. Thank you!
  4. Hello guys. I'm back with a quick question that I don't seem to understand. How exactly you create a session? I know the very basics of it, and that includes: <form action="Logged.php" method="post" > <input type="text" name="User" /> <input type="password" name="Password" /> <input type="submit" value="Login" /> <input type="reset" value="Clear" /> </form> Start with my log-in form. This is called when you log-in: <?php include("config.php"); if(isset($_SESSION["Username"])) { $user = $_SESSION["Username"]; $pass = md5($_SESSION["Password"]); } else { $user = $_POST["User"]; $pass = md5($_POST["Password"]); $_SESSION['Username'] = $user; $_SESSION['Password'] = $pass; $escuser = mysql_real_escape_string($user); $escpass = mysql_real_escape_string($pass); } $result = mysql_query("SELECT * FROM testWHERE user = '$escuser'"); $num_rows = mysql_num_rows($result); if($num_rows == 0) { echo('That username does not exist...'); echo '<a href="something.php""> Go back!</a>'; unset($_SESSION['Username']); unset($_SESSION['Password']); die; } $row = mysql_fetch_row($result); if($row[1] !== $escpass) { echo('Wrong Password!...'); echo '<a href="something.php"> Go Back!</a>'; unset($_SESSION['Username']); unset($_SESSION['Password']); die; } ?> Like I said above, the very basics. On that Logged.php page ( Which I got the above code from ) does not have: <?php session_start(); ?> ^ That's what I am having trouble with. Am I supposed to add that on top of EVERY page I have? I just need a quick rough-draft on how it should be, you don't need to use my examples, I just need to see a small preview of a log-in and then you can be able to access every page WHILE still logged. Thanks.
  5. Hello guys. I'm in need of help. I want to know who to make a full working session. When a player logs in, the session starts. There will be a new button "My Page", he can go there at any time. When he logs off, that button disappears ( Session over ). I'm so bad at explaining stuff. Hope y'all really understood me. This piece of code is used to log the user in: <?php session_start(); include("config.php"); if(isset($_SESSION["Username"])) { $user = $_SESSION["Username"]; $pass = md5($_SESSION["Password"]); } else { $user = $_POST["User"]; $pass = md5($_POST["Password"]); $_SESSION['Username'] = $user; $_SESSION['Password'] = $pass; $escuser = mysql_real_escape_string($user); $escpass = mysql_real_escape_string($pass); } $result = mysql_query("SELECT * FROM playerinfo WHERE user = '$escuser'"); $num_rows = mysql_num_rows($result); if($num_rows == 0) { echo('That username does not exist...'); echo '<a href="http://yu-ki-ko.com/fsns/""> Go back!</a>'; unset($_SESSION['Username']); unset($_SESSION['Password']); die; } $row = mysql_fetch_row($result); if($row[1] !== $escpass) { echo('Wrong Password!...'); echo '<a href="http://yu-ki-ko.com/fsns/""> Go Back!</a>'; unset($_SESSION['Username']); unset($_SESSION['Password']); die; } ?> Not sure if its working properly or not. I'm stuck at that part.
  6. u214

    URL help

    Yes. Works now! Thanks y'all!!
  7. u214

    URL help

    Hello guys, I have this images where it displays info according to your nickname. Now, let's say my current url for an image is: www.test.com/image.php?Username=TEST That would of display an image with that name. I got that part ok. Now my question is, how to make different image styles? I was thinking something like this: www.test.com/image.php?Style=2?Username=TEST "Style=2" being the second choice. My current code is like this: $_GET['Username']; // This to get the name after Username.. //How to make it different styles? //This is what I tried, but didn't worked: $istyle = $_GET['Style']; if(istyle == 1) { $username = $_GET['Username']; // Display the image with THAT style ( Style 1 ) } else if($istyle == 2) { $username = $_GET['Username']; // Display the image with the second style } ... and so on I currently have that, and this would be the url: www.test.com/image.php?Style=2?Username=TEST That works correctly, but somehow it's not catching the "Username=TEST" part, so the image does not display the name.
  8. Thank you so much requinix. And about the font tag, I'm new to html/css stuff, that tip will help me with that. Thank you once again.
  9. Hello guys. I'm trying to improve my control panel system. I have this page where you input a player's name and when you hit "Search" it will display that user's information. Ok. This is the code: <form action="ShowStats.php" method="post"> <li><font color="#FF9933"><b>User's Name:</b></font> <input type="text" name="User" /></li> <p> </p> <p> </p> <input type="submit" value="Search" /></form> That's when you input the player's name and the Search button. Once you hit that button, I want the Address bar to display something like this: "www.test.com/ShowStats.php?User=SEARCHED_USER" Here's the $_POST ( and "fetch" user's info ) function inside "ShowStats.php" include("database.php"); if(!$con) { die('Could not connect: ' . mysql_error()); } $user = $_POST["User"]; $escuser = mysql_real_escape_string($user); $result = mysql_query("SELECT * FROM playerinfo WHERE user = '$escuser'"); $username_exist = mysql_num_rows($result); if($username_exist == 0) { echo('<b><font color="#C41F1F">That username does not exist</b></font>'); echo('<p><center><font face="Arial" color="#000080" size="2"><b><a href="http://yu-ki-ko.com/fsns/Stats.php">Go back</a></b></center></font></p>'); die; } $row = mysql_fetch_row($result); All I want is that when a user searches for the player, the address bar will be displayed like: "www.test.com/ShowStats.php?User=SEARCHED_USER" Thanks! If any more info is needed, let me know.
  10. OMG. How the hell did i miss the link :D Hehe, here you go: Click Me
  11. . Very nice. Thank you sooo much man. Works perfectly. I guess I should get into reading more about the PHP function parameters. imagejpeg - Parameters: Image, Filename, QUALITY Thank you so much once again!
  12. I've been working on this website for a little of about 1 month now. It's mainly a User Control Panel for an online game. It displays user's stats as well as other different stats. A google maps is in there, it works when a player joins my server, he would be shown on the map and you can interact with his info by clicking the little "icon" that appears once he's logged. ----- I like a combination of darkish colors. A greenish and black/greyish suits me the best. As you can see, the website still under development. I want good critique and or reviews about my site. Suggestions are always welcomed because it helps me improve. Thank you.
  13. So. I'm using this code right here: <?php $imagepath = "css/images/statspage.jpg"; $image = imagecreatefromjpeg($imagepath); $imgheight = imagesy($image); $color = imagecolorallocate($image, 255, 255, 255); imagestring($image, 5, 70, $imgheight-50, "This is a test", $color); header('Content-Type: image/jpeg'); imagejpeg($image); ?> It works like it should. Now my problem is, is that the image is being displayed at a very low quality! Here's the original image: Here's the image with the code above: RIGHT away you can tell the HUGE difference. I'm not sure what I'm doing wrong. Maybe i need a higher res image? If y'all guys know a different method THAT also achieves the same thing I'm trying to do. Please let me know ASAP!
  14. Thanks for your answer lalnfl, but lastkarrde's way works best. Sorry for kinda "ignoring" that method lastkarrde, i thought it was just a way to escape the string :s. Once again, thank you so much. It works wonders. Cheers mate!
  15. Opps, yeah forgot that. Thanks. Any answers to my question though? http://test.com/stats.php?user=NameToDetectHere How exactly would i write a code to detect "NameToDetectHere" then use his name to query and thus getting the stats?
  16. Hello guys. I'm so sorry if y'all feel like I'm bothering with this noob threads. I'm making a dynamic stats signature using info my mysql. It currently is working like its supposed to. But i want to have an image of a player's stats of each player. For example. A player types in the URL: www.test.com/stats.php?user=Username Now, when a player accesses that url, the default stats image will be show, and for stats. I want the "Username" to be the query and that gets the info. For example: mysql_query("SELECT * FROM players WHERE user = '$usernamehere' How can i detect the url username though? This is my current set up: mysql_query("SELECT * FROM players WHERE user = 'test' - It's working. But i want to use variable and give that "Username" ( From url ) it's stats. Here's my current code: <?php $imagepath="css/images/dog.JPG"; $image=imagecreatefromjpeg($imagepath); $imgheight=imagesy($image); $color=imagecolorallocate($image, 255, 255, 255); include("config.php"); $result = mysql_query("SELECT * FROM playerinfo WHERE user = 'Test'", $connect); while($myrow = mysql_fetch_row($result)) { // Not working properly. imagestring($image, 5, 50, $imgheight-50, $myrow[0], $color); imagestring($image, 3, 30, $imgheight-30, $myrow[2], $color); } // This line works like it should: //imagestring($image, 5, 50, $imgheight-50, "Using it like this works!", $color); header('Content-Type: image/jpeg'); imagejpeg($image); ?>
  17. I found the problem. It was a silly mistake. When requiring the string, it was to display ALL the info that it found with "Level" greater than 0. So everything was just displaying on top of each other, making the text un-readable. I changed it to: SELECT * FROM playerinfo WHERE user = 'test' And it gave just what I wanted.
  18. Use "||" Edit - Too late. Use the above way.
  19. Hello guys. I'm kinda new to PHP, I've been understanding everything so far. I have trouble with "imagestring" What I want is to query a row in MySQL. I want to display some of that info in the image. It's not working properly. Here's the code: <?php $imagepath="css/images/dog.jpg"; $image=imagecreatefromjpeg($imagepath); $imgheight=imagesy($image); $color=imagecolorallocate($image, 255, 255, 255); include("config.php"); $result = mysql_query("SELECT * FROM playerinfo WHERE Level > 0 ORDER BY Level DESC", $connect); while($myrow = mysql_fetch_row($result)) { // Not working properly. imagestring($image, 5, 50, $imgheight-50, $myrow[0], $color); } // This line works like it should: //imagestring($image, 5, 50, $imgheight-50, "Using it like this works!", $color); header('Content-Type: image/jpeg'); imagejpeg($image); ?> Any help will be GREATLY appreciated it. Thanks!
  20. Hi. As y'all notice, I'm new here. I am also new to the PHP coding stuff, but not to coding. Well, I tried watching other scripts to see how they are 'Coded'. I think they are in a disorderly way coded, which brings me to this question: How would you code this following piece of snippet? : <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Server</title> <meta http-equiv="Content-Language" content="en-us" /> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252" /> <link href="STFFR.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="header"> <h1><b>Server</b></h1> </div> <div id="nav"> <a href="Link1">Home</a> <a href="Link2">Forums</a> <a href="Link3">Search Players</a> <a href="Link4">Player Bans</a> </div> <div id="content"> <h2>Control Panel</h2> <b>Message:</b> <form action="Logged.php" method="post"> <p><center>User Name <input type="text" name="User" size="20" /> </p></center> <p><center>Password <input type="password" name="Password" size="20" /></p></center> <center><p> </center><input type="submit" /> <input type="reset" /> </p> <p><b><center><font color="#CF1111">Please login above!</font><center></b></p> </form> </div> <div id="footer">Footer Info.. <a href="Link"> Message Link</a></div> </body> </html> As y'all can see, code looks ugly ( In my way of scripting ), I just want to know. Is that how the code should be like? If not, can you please re do it, IN YOUR way? Thanks.
×
×
  • 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.