Jump to content

iStriide

Members
  • Posts

    78
  • Joined

  • Last visited

    Never

About iStriide

  • Birthday 02/22/1995

Profile Information

  • Gender
    Male
  • Location
    Statesboro

iStriide's Achievements

Member

Member (2/5)

0

Reputation

  1. Im trying to use the date(); php function to get the date, but it keeps saying its the 24th so I cheched phpinfo() and it showed the timezone as a europe one. Is there anyway I can change it to mine?
  2. I think IIS is messing with my xampp server and I won't let apache work so I cant use php. You guys know how to fix it. Everytime I go to the Internet Information Services on my computer I can't select the apache service anymore for some reason.
  3. I would get the ip address of the user that is on the site. I used $ip = $_SERVER['REMOTE_ADDR']; and it doesn't show my actual ip. Is it because im using an apache server on my computer.
  4. I have a file in a mysql database and when I echo it shows all of the php code from the file in the database on the page when it is echoed. How can I fix this problem. I notice a lot of websites coded from php have things like ?go=register or ?page=login something like that. Could you guys tell me how to do things like that. Im pretty sure when people do things like ?go=register the register is the code of a file in a mysql database.
  5. I have this code and I want to make it where I don't have to click the button to make the page update. So how will I make it where I don't have to click the button to update the page and make it where it automatically refreshes? Here's the code: <html> <head> <script type="text/javascript"> function showCustomer(str) { var xmlhttp; if (str=="") { document.getElementById("txtHint").innerHTML=""; return; } if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { document.getElementById("txtHint").innerHTML=xmlhttp.responseText; } } xmlhttp.open("GET","confirm.php?q=1",true); xmlhttp.send(); } </script> </head> <body> <button value='1' onclick="showCustomer(this.value)">Update</button> <br /> <div id="txtHint">Info will be listed here</div> </body> </html>
  6. I have no experience with ajax once so ever. So i'm hoping that one of you guys or girls can show me some code that will keep showing the recently updated version of a table value without refreshing the page or anything like that. I'm not sure if you use PHP for selecting the table value from the table, but if you do please use PHP and ajax. Thanks
  7. <?php $query = mysql_query("UPDATE 'page' SET title='$title', keywords='$keywords', description='$description', menu='$menu', content='$content' WHERE 'pageID'= $id"); // Should Be $query = mysql_query("UPDATE `page` SET title='$title', keywords='$keywords', description='$description', menu='$menu', content='$content' WHERE `pageID`= $id"); ?>
  8. I want the page to automatically refresh, I don't want to have to click a link.
  9. I found out what the problem was. I just need to reload the page after the queries are done. Is there any other way of refreshing the page besides headers?
  10. I'm having a problem where when I click the "use" link it only displays my check message which is "Hey", but for some reason I have to click it again for my queries to work. Here's a pick: . Here's the code: <?php if(isset($_SESSION['user'])){ include_once('connect.php'); $session = $_SESSION['user']; echo " <br/> <div class='profile-general-stats'> <table> <th>Item Name</th><th>Description</th><th>Use/Sell</th> "; $yo = "SELECT * FROM player_items WHERE Username = '$session' ORDER BY id ASC"; $check = mysql_query($yo) or die (mysql_error()); $num_of = mysql_num_rows($check); if($num_of > 0){ while ($is = mysql_fetch_array($check)){ $item_id = $is['id']; $item_name = $is['Name']; $item_type = $is['Type']; $item_value = $is['Value']; $item_description = $is['Description']; $item_sell_value = $is['Sell_Price']; echo " <tr> <td align='left' style='padding: 5px; padding-left: 25px;'><strong>$item_name</strong></td> <td align='left' style='padding: 5px;'>$item_description</td> <td align='middle' style='padding: 5px;'><a href='?use&id=$item_id&name=$item_name&type=$item_type&value=$item_value'>Use</a> | <a href='#sell_$item_name' id='$item_id'>Sell</a></td> </tr> "; } }else{ echo " <tr> <td align='left' style='padding: 5px; padding-left: 25px;'>No Items</td> <td align='left' style='padding: 5px;'>No Items</td> <td align='middle' style='padding: 5px;'>No Items</td> </tr> "; } echo " </table> </div> "; if(isset($_GET['use'])){ echo "Hey"; $use_id = $_GET['id']; $use_name = $_GET['name']; $use_type = $_GET['type']; $use_value = $_GET['value']; if($use_type == "Credits"){ $use_type = "Current_Credits"; } $check_item = "SELECT id FROM player_items WHERE id = '".mysql_real_escape_string($use_id)."' AND Username = '".$_SESSION['user']."'"; $run_check = mysql_query($check_item) or die(mysql_error()); $num_check = mysql_num_rows($run_check); $e = mysql_fetch_array($run_check); $item_stat = "SELECT `".$use_type."` FROM stats WHERE Username = '".$_SESSION['user']."'"; $run_stat = mysql_fetch_array(mysql_query($item_stat)) or die (mysql_error()); $new_stat = $run_stat[''.$use_type.'']; if($num_check == 1){ $new_stat = $new_stat + $use_value; mysql_query("UPDATE stats SET `".$use_type."` = '".mysql_real_escape_string($new_stat)."' WHERE Username = '".mysql_real_escape_string($_SESSION['user'])."'") or die(mysql_error()); mysql_query("DELETE FROM player_items WHERE id = '$use_id'") or die(mysql_error()); }else{ } }else{ } }else{ header("Location: index.php"); } ?>
  11. I'm using an array and adding it to a number. How can I make it add?
  12. I am getting this error: Fatal error: Unsupported operand types. <?php $new_player_credits = $player_credits + $game_credits; $new_player_exp = $player_exp + $game_exp; ?> I have absolutely no clue why I'm getting the error. Both of my variables are integers.
  13. I tried without the isset with the $session variable and it worked.
  14. I'm not sure what is going on in this code, but for some reason it is not echoing my variable. I'm probably just having a total brain fart right now. <?php <?php $opponent_check = isset($_POST['player_username']); $session = isset($_SESSION['user']); if($opponent_check){ include_once('connect.php'); $find_player = "SELECT * FROM stats WHERE Username = '$session'"; $s = mysql_fetch_array(mysql_query($find_player)) or trigger_error(mysql_error()); $player = $s['Username']; $player_HBS = $s['HBS']; $player_level = $s['Level']; $player_level_image = $s['Level_Image']; $player_skill = $s['Skill']; $player_attack = $s['Attack']; $player_defense = $s['Defense']; $player_strength = $s['Strength']; $player_speed = $s['Speed']; $player_accuracy = $s['Accuracy']; $player_range = $s['Range']; echo $player; }else{ echo " You didn't start a battle.<br/><br/> <a href='index.php'>Back to Matchmaking</a> <br/><br/> "; } ?> ?> My error is: Notice: in C:\xampp\htdocs\halobattles\headtohead.php on line 277 which is the fetch array line.
×
×
  • 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.