Jump to content

ronnie88

Members
  • Posts

    153
  • Joined

  • Last visited

    Never

Everything posted by ronnie88

  1. thanks but now i am having another problem.... I submit the form and i get this: Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/great/public_html/admin.php on line 77 entire code: <?php session_start(); include("database.php"); if($_SESSION['username']) { $query = "SELECT * FROM info WHERE username='{$_SESSION['username']}'"; $result = mysql_query($query); $row = mysql_fetch_row($result); } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>GreatDiscountedGames Admin Page</title> <meta http-equiv="Content-Style-Type" content="text/css"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <link href="style.css" type="text/css" rel="stylesheet"> <body id="page1"> <table style="width:766px" align="center"> <tr> <td><? if ((isset($_SESSION['username'])) && ($_SESSION['username'] != "")) { echo "ยท Welcome <b>$_SESSION[username]</b>, you are logged in. <a href=\"logout.php\">Logout</a>"; } else { echo "<b><a href='index.php'>Login</a> | <a href='register2.php'>Register</a></b>"; } ?> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,24" width="766" height="433"> <param name="movie" value="flash/header_v8.swf?button=1"> <param name="quality" value="high"> <param name="menu" value="false"> <!--[if !IE]> <--> <object data="flash/header_v8.swf?button=1" width="766" height="433" type="application/x-shockwave-flash"> <param name="quality" value="high"> <param name="menu" value="false"> <param name="pluginurl" value="http://www.macromedia.com/go/getflashplayer"> FAIL (the browser should render some flash content, not this). </object> <!--> <![endif]--> </object> </td> </tr> <tr> <td style="height:375px"> <table> <tr> <td> <table style="height:207px"> <tr> <td style="width:36px"></td> <td class="col1"> <br style="line-height:6px"> <img src="images/t1_1.gif" alt="">NEWS<br> <br style="line-height:16px"> <ul> <li> <a href="#"><span>2008-08-03 /</span> GREATDISCOUNTEDGAMES IS OPEN!</a></li> <li> <a href="http://www.sup-clan.com"><span>2008-08-03 /</span> CLIENT .:SUP:. Completed</a></li> </ul> <div class="right"><a href="#"><img src="images/view_archive.gif" alt="" border="0"></a></div> </td> <td class="col2" > <br style="line-height:6px"> <img src="images/t1_2.gif" alt=""><br> <br style="line-height:19px"> <? include("admin2.php"); ?> <td style="width:30px"></td> </tr> </table> </td> </tr> <tr> <td class="border"></td> </tr> <tr> <td class="block"> <table> <tr> <td style="height:28px"></td> </tr> <tr> <td> <table style="height:101px"> <tr> <td class="newsletter"> <div> <img src="images/t1_3.gif" alt=""><br> <br style="line-height:7px"> <? include("login2.php"); ?> <br> </div> </td> <td style="width:36px"></td> <td style="width:383px"> <img src="images/t1_4.gif" alt=""><br> <br style="line-height:18px"> <img src="images/lapka.gif" alt="" align="left" style="margin-top:3px"> <div style="margin-left:22px"> <strong>Quote by .:SUP:.</strong> I ask Ronnie aka Vital to make a multiplayer map for my clan called SUP <a href="http://www.SUP-Clan.com">Link</a>, he had it completed within 8 hours! Fast easy and reliable.<img src="images/lapka1.gif" style="vertical-align:middle" alt=""> <br><br><br><strong>ScreenShots</strong><br><br> <a href="images/cell1.jpg"><img src="images/cell1.jpg" width="200" height="85"></a> <br> <a href="images/cell2.jpg"><img src="images/cell2.jpg" width="200" height="85"></a> </div> </td> <td style="width:30px"></td> </tr> </table> </form> </td> </tr> <tr> <td class="col3"> <div class="right"> <a href="#"><img src="images/learn_more.gif" alt="" border="0"></a> </div> </td> </tr> </table> </td> </tr> <tr> <td class="border"></td> </tr> </table> </td> </tr> <tr> <td class="footer"><img src="images/imagination.gif" alt=""><img src="images/line.gif" alt=""><a href="admin.php">Admin Login</a></td> </tr> </table> </body> </html> the admin2.php <?php if($_SESSION['username'] == ronnie) { ?> <form action="reginsert.php" method="post">" <br><tr><td>Name:</td><td><input type="text" name="name" maxlength="25"></td> <tr><td>Registration Code:</td><td><input type="text" name="key" maxlength="25"></td><br> <td><input name="add" type="submit" id="add" value="Set Registration Key"></td> <form></tr> <? } else{ echo "YOU ARE NOT AN ADMIN!"; } ?> the reginsert.php <?php session_start(); include 'database.php'; $regis = $_POST['regis']; $usa = $_POST['name']; if(!strstr($_SERVER['HTTP_REFERER'],"greatdiscountedgames.com/site_flash/admin.php")) { echo "ERROR: YOU CANNOT ACCESS THIS FILE MANUALLY"; } else { $query = "UPDATE info SET regis = '$regis' WHERE username = '$usa'"; mysql_query($query) or die(mysql_error()); header('Location: http://www.greatdiscountedgames.com/admin.php'); } ?> line 77 of admin.php include("admin2.php");
  2. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key = 'registrationkey' WHERE username = 'ronnie'' at line 1 ideas? thanks
  3. all i get is query failed. Yes database is correct <?php session_start(); include 'database.php'; $key = $_POST['key']; $usa = $_POST['name']; if(!strstr($_SERVER['HTTP_REFERER'],"greatdiscountedgames.com/site_flash/admin.php")) { echo "ERROR: YOU CANNOT ACCESS THIS FILE MANUALLY"; } else { $query = "UPDATE info SET key = '$key' WHERE username = '$usa'"; mysql_query($query) or die('Error, query failed'); header('Location: http://www.greatdiscountedgames.com/admin.php'); } ?> and the form <?php if($_SESSION['username'] == ronnie) { ?><form action="reginsert.php" method="post">" <br><tr><td>Name:</td><td><input type="text" name="name" maxlength="25"></td> <tr><td>Registration Code:</td><td><input type="text" name="key" maxlength="25"></td><br> <td><input name="add" type="submit" id="add" value="Set Registration Key"></td> <form></tr> <? } else{ echo "YOU ARE NOT AN ADMIN!"; } ?>
  4. i've also tried this now: while($row = mysql_fetch_assoc($result)) { if ($row['admin'] == 'admin'){ echo "ADMIN"; } } ?>
  5. if i put that in there it messes up the whole script, but it should be working since I tried echoing the row admin and it outputs what I have in there.
  6. i've tried this now too <?php session_start(); include("database.php"); if($_SESSION['username']) { $query = "SELECT * FROM virtuala WHERE username='{$_SESSION['username']}'"; $result = mysql_query($query); } $admin = "{$row['admin']}"; ?> <?php if($admin == 'admin'){ echo "test1"; } else{ echo "help me"; } ?> but no luck
  7. still no luckall it does is just keeps putting out the else if i echo the $admin it does say admin
  8. i tried using a variable such as: <?session_start(); include("database.php"); if($_SESSION['username']) { $query = "SELECT * FROM virtuala WHERE username='{$_SESSION['username']}'"; $result = mysql_query($query); } $admin = $row['admin']; ?> if($admin == 'admin'){ echo "test1"; } else{ echo "help me"; } ?> but still no luck.. and tried using a mysql error no errors..
  9. no session is started
  10. yea, but how would i go about developing the if session code... is equal to the username and so and so admin column..? i tried this [code] if($row['admin']== 'admin'){ echo "test1"; } and added admin to the admin column and the top of the page if(isset($_SESSION['username']) && !empty($_SESSION['username'])) { $query = "SELECT va, cash, forum, admin FROM virtuala WHERE username='{$_SESSION['username']}'"; $result = mysql_query($query); } ?> but no luck[/code]
  11. i'm trying to make if a column in the mysql table says admin it will show extra capablities
  12. <? ############################################################# # # -=[ MySQL Search Class ]=- # # version 1.5 # # (c) 2002 Stephen Bartholomew # # Functionality to search through a MySQL database, across # all columns, for multiple keywords # # Usage: # # Required: # $mysearch = new MysqlSearch; # $mysearch->setidentifier("MyPrimaryKey"); # $mysearch->settable("MyTable"); # $results_array = $mysearch->find($mysearchterms); # # Optional: # This will force the columns that are searched # $mysearch->setsearchcolumns("Name, Description"); # # Set the ORDER BY attribute for SQL query # $mysearch->setorderby("Name"); # ############################################################## class MysqlSearch { function find($keywords) { # Create a keywords array $keywords_array = explode(" ",$keywords); # Select data query if(!$this->searchcolumns) { $this->searchcolumns = "*"; $search_data_sql = "SELECT ".$this->searchcolumns." FROM ".$this->table; } else { $search_data_sql = "SELECT ".$this->entry_identifier.",".$this->searchcolumns." FROM ".$this->table; } # Run query, assigning ref $search_data_ref = mysql_query($search_data_sql); # Define $search_results_array, ready for population # with refined results $search_results_array = array(); if($search_data_ref) { while($all_data_array = mysql_fetch_array($search_data_ref)) { # Get an entry indentifier $my_ident = $all_data_array[$this->entry_identifier]; # Cycle each value in the product entry foreach($all_data_array as $entry_key=>$entry_value) { # Cycle each keyword in the keywords_array foreach($keywords_array as $keyword) { # If the keyword exists... if($keyword) { # Check if the entry_value contains the keyword if(stristr($entry_value,$keyword)) { # If it does, increment the keywords_found_[keyword] array value # This array can also be used for relevence results $keywords_found_array[$keyword]++; } } else { # This is a fix for when a user enters a keyword with a space # after it. The trailing space will cause a NULL value to # be entered into the array and will not be found. If there # is a NULL value, we increment the keywords_found value anyway. $keywords_found_array[$keyword]++; } unset($keyword); } # Now we compare the value of $keywords_found against # the number of elements in the keywords array. # If the values do not match, then the entry does not # contain all keywords so do not show it. if(sizeof($keywords_found_array) == sizeof($keywords_array)) { # If the entry contains the keywords, push the identifier onto an # results array, then break out of the loop. We're not searching for relevence, # only the existence of the keywords, therefore we no longer need to continue searching array_push($search_results_array,"$my_ident"); break; } } unset($keywords_found_array); unset($entry_key); unset($entry_value); } } $this->numresults = sizeof($search_results_array); # Return the results array return $search_results_array; } function setidentifier($entry_identifier) { # Set the db entry identifier # This is the column that the user wants returned in # their results array. Generally this should be the # primary key of the table. $this->entry_identifier = $entry_identifier; } function settable($table) { # Set which table we are searching $this->table = $table; } function setsearchcolumns($columns) { $this->searchcolumns = $columns; } } ?>
  13. I'm trying to add a admin mod on a php login it uses the session how would i do something like this?: if(isset($_SESSION['username']) == admin is admin } so if the mysql column admin has admin in it... it will show the text
  14. thanks had to change asc to desc thanks again
  15. <?php include 'database.php'; $query = "SELECT va, cash FROM virtuala ORDER BY cash ASC LIMIT 20"; $result = mysql_query($query); while($row = mysql_fetch_array($result, MYSQL_ASSOC)) { echo " VA Name :<b>{$row['va']}</b> <br>" . "Cash : {$row['cash']} <br>"; } ?> How would I going about putting cash in order? from highest to lowest? thanks
  16. thanks very much works great
  17. Hi I need help again.... I know this is probley all wrong..... <?php session_start(); include 'database.php'; if(!strstr($_SERVER['HTTP_REFERER'],"virtualairlineonline.com/blue_sky/flying2h.php")) { echo "ERROR: YOU CANNOT ACCESS THIS FILE MANUALLY"; } $cash = ({$row['cash']} + 600); $query = "SELECT cash FROM virtuala WHERE username='{$_SESSION['username']}'"; $result = mysql_query($query); $query = "UPDATE virtuala SET cash = '$cash' WHERE username = '{$_SESSION['username']}'"; mysql_query($query) or die('Error, query failed'); echo "$_SESSION[username] your virtual airline has been set to $va Press the back button"; ?> I'm trying to add 600 to the column cash any help would be great....
  18. okay well i included the first file into the second one: <? include("flying2h.php"); if(!defined("SESAMOPEN")){ echo "What are you doing here? You're not allowed to be here, be gone you pest!"; exit(); } ?> but just keeps repeating lol
  19. well i placed this at the top of the file where i am coming from: <? define(ALLOW_PAGE_LOAD, true); ?> then i placed this the file I am going to: <? if (!ALLOW_PAGE_LOAD) die ("You're not allowed to view this page directly"); ?> but nothing happens
×
×
  • 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.