Jump to content

barefootsanders

Members
  • Posts

    24
  • Joined

  • Last visited

    Never

Everything posted by barefootsanders

  1. Hey all, does anyone have/know of a small script to fetch the weather based off an zip code input? Thanks!
  2. ID3 tags, right, got it.. Thanks for the help!
  3. How would I extract metadata from the fopen() response? Thanks!
  4. So I attempted to use this method and I got random code like this, "!©ªâêzhÌsù¼,˜Ie×kk‰". How can I specify or parse out the metadata that I would need? Thanks!
  5. Hey everyone, Is there anyway to extract the metadata i.e. title, artist, album, from audio files using PHP?? Thanks for any help in advance. -Barefoot
  6. Hey everyone, I'm attempting to set up my own web server with apache2 and php5. I set up apache fine and it works. My problem is that when i install php5 my apache wont start. I just get an error message saying "The requested operation has failed." I attached both the httpd.config file along with the php.ini file. Ihave checked all the paths and they are all correct. For some reason apache does not want to load the php5 module. Does anyone have any suggestions?? Thanks, Barefoot [attachment deleted by admin]
  7. So I have HTML blocks of code stored in my database as a field, type text. I'm having problems printing it to the screen. Is there anything I should do to format the html i.e. addslashes($text) etc?? Any suggestions would be much appreciated. An example code of what is stored in the database is the following: <p>HELLO! - <a target="_blank" href="LINK_HERE.html">Click Here</a></p>
  8. Hey thanks for the help. I have been taking in as much as I can over the past few weeks about AJAX. My only concern is the problem I am having with the "table/arena" system. I to have say a few arenas where only 2 people can join in, so the effect would be when two people join the arena, no one else would be able to do so. Then the would fight and then leave and that arena would reopen to all so more people could fight. I believe I can code the PvP part of it, its just creating the separate arena's that I am a bit confused on. How can I implement this? Would I need separate files for each or even separate tables on my database? Thanks again for the help and I hope you can help me overcome my problems:)
  9. Hey everyone. I have been developing an online MUD(Multi user dungeon) and I want to create a battle arena for users to fight each other in player vs player battles. I know this is possible with PHP and AJAX, however I do not really know where to start. I am very experienced with PHP any MySQL(what the site is currently programmed in) but AJAX is new to me. What I would like to have is some sort of table system, like online poker, where people can "sit in" and battle each other in a turn based system. When the winner kills the other user, the winning user would have a certain amount of money earned or experience points, etc. I was wondering if anyone could help me figure out how to proceed. Thanks!
  10. Hey guys. Ive been working on an online game and Im attempting to code the attack arena. Basically what i want is people to be able to "sit down" at some sort of "table" (kinda like online poker) then they would battle it out at that "table" or arena etc. Is there a way to do that using PHP or would I have to pick up something like ajax? Thanks.
  11. How do you know if you have access to the shell console on linux?
  12. It has nothing to do with mysql. You can write a script in PHP (or other languages) which connects to mysql and edits records, then have a cron run that script periodically. I understand that, however I am unsure on how to write a cron and how to enable that cron through phpmyadmin. Any help would be apprecaited.
  13. Is there a way to set one of these up through phpmyadmin or can you only create one through direct MySQL inputs?
  14. Hey everyone. I'm programming a game in which I would like an event to happen every hour. For example I would like to update a certain stat by one every hour. Can anyone point me in the right direction as in how to achieve this? Thanks.
  15. I've seen the functions get_magc_quotes_gpc() and mysql_real_escape_string() before but I am unsure what they do. I've read up on php.net but its kind of hard to understand. Could you just elaborate on what it is exactly doing? Thanks a bunch though!
  16. Hey guys. I've been programing a PHP based game and all over my site I have strings like $userid = $_GET['userid']. Then based on that variable I run the function from the database class, $database->getUserInfo($userid); which will return an array with all the users info from the database based on the $userid. I've heard this is not very secure so I was hoping someone could point me in the right direction as to secure it. I have lots of these type of things around my site in order to return arrays of information regarding a particular information. Thanks in advance for any help!
  17. I see where this could help however I wanted each user to have a unique ID that could be used to access ones profile. So say one wanted to view another profile I wanted to just have the user click on their profile which would give the user their own profile and then they could just change the number to the certain ID they wanted to view. Is this not a secure way to do things??
  18. Well I read somewhere that the command $_GET was not all that secure along with include() statements. This my center <div> which loads the correct page based on what someone clicked. The links are set up like this: <li><a href="index.php?page=userinfo&id=<?php echo $session->userid;?>">My Account</a></li> And heres the code: <?php $page = $_GET['page']; switch ($page) { case register: //Register was clicked include("register.php"); break; case welcome: //The main home page include("welcome.php"); break; case userinfo: //User info page include("userinfo.php"); break; case useredit: //User edit page include("useredit.php"); break; case levelup: include("levelup.php"); break; case attack: //Attack page include("attack.php"); break; case admincenter: //Admin center - FOR ADMINS ONLY! include("admin/admin.php"); break; case newfamily: //Create a new family page include("newfamily.php"); break; case familyinfo: include("familyinfo.php"); break; case familyinvite: include("familyinvites.php"); break; case editfamily: include("editfamily.php"); break; case travel: include("travel.php"); break; case viewmap: include("viewmap.php"); break; case forgotpass: //Forgot password was clicked include("forgotpass.php"); break; default: include("welcome.php"); } ?>
  19. Hey everyone. I have been developing a 2d browser based game with PHP and MySQL. It is not finished yet but it is close. I was hoping someone experienced in PHP could help me make it as secure as possible. I am good with PHP however I don't have very good knowledge with PHP security. If anyone is willing to help please shoot me an email at solidgold10287@aol.com. Thanks!
  20. Hey guys. I have a program that when i button is clicked it should increase an attribute by one and decrease a stat point by one. For some reason it dosent decrease the stat point by one, it sets it to -1 but it does increase the attribute by one. I dont know what im doing wrong.. Below is the code for the function along with the functions that it calls. Any suggestions?? function addOneAtt($uname, $attname) { //Get current number of attribute point and stat points $dbarray = $this->getUserInfo($session->username); $attpts = $dbarray['$attname']; $statpts = $dbarray['stat_pts']; //Add one to the current number of attribute points $attpts = $attpts + 1; //Subtract one from the current number of stat points $statpts = $statpts - 1; //Update attribute and stat points in database //function updateUserField($username, $field, $value) $this->updateUserField($uname, $attname, $attpts); $this->updateUserField($uname, stat_pts, $statpts); return; } function getUserInfo($username) { $q = "SELECT * FROM ".TBL_USERS." WHERE username = '$username'"; $result = mysql_query($q, $this->connection); //Error occurred, return given name by default if(!$result || (mysql_numrows($result) < 1)) { return NULL; } /* Return result array */ $dbarray = mysql_fetch_array($result); return $dbarray; } function updateUserField($username, $field, $value) { $q = "UPDATE ".TBL_USERS." SET ".$field." = '$value' WHERE username = '$username'"; return mysql_query($q, $this->connection); }
  21. WOW, i cant believe i did that. Thanks for catching my silly spelling error. Works like a charm now:)
  22. Hey all. I'm having problems with my site. I'm trying to return information on a certain "family" or clan and the string my query returns is empty. Below is the familyinfo.php page which calls the function and below that is the function from database.php. If anyone has any suggestions it would be much appreciated. Thanks! <?php //familyinfo.php //Inform user of successfull faimly creation only on first time if($_SESSION['newfamily'] == true) { $_SESSION['newfamily'] = false; echo "Congratulations! You created a new family. Click here to continue to your families info page.<br>"; echo "<a href\"index.php?page=familyinfo\">Family Home Page</a>"; } else { //Get family ID your are viewing and family info array $req_famID = 14; $req_family = $database->getFamilyInfo($req_famID); //User is in family if(strcmp($session->family_id,$req_famID)) { echo "<h2 id=\"topper\">Your Family</h2><br>"; echo $req_family_info['family_name']; } //User is not in family else { echo "<h2 id=\"topper\">"; echo $req_family_info['family_name']; echo "</h2><br>"; } echo $req_family_info['family_desc']; } ?> //database.php function getFamilyInfo($id) { $q = "SELECT * FROM ".TBL_FAMILIES." WHERE faimly_id = '$id'"; $result = mysql_query($q, $this->connection); //Error occurred, return given name by default if(!$result || (mysql_numrows($result) < 1)) { return NULL; } /* Return result array */ $dbarray = mysql_fetch_array($result); return $dbarray; }
  23. Hey everyone. I've been stuck on this problem for some time now. I have a web server that I run on my computer and I have been developing my own user login database. The problem that I am having is viewing the user info page. Each user has their own unique user ID and I would like to have that ID used in the link for their userinfo page. Here is the format of my page. I have a main index.php. On each click the page is reloaded and in the center I have the following switch statement. <?php $page = $_GET['page']; switch ($page) { case register: //Register was clicked include("register.php"); break; case welcome: //The main home page include("welcome.php"); break; case forgotpass: //Forgot password was clicked include("forgotpass.php"); break; case userinfo: //User info page include("userinfo.php?id"); break; case useredit: //User edit page include("useredit.php"); break; case admincenter: //Admin center - FOR ADMINS ONLY! include("admin/admin.php"); break; default: include("welcome.php"); } ?> Links are set up like this: echo "<a href=\"index.php?page=userinfo\">My Account</a>"; Now I have been trying for about a week or so to incorporate the ID's into the link but to no avail. I have tried to include things like: echo "<a href=\"index.php?page=userinfo?id=$_SESSION['userid']\">My Account</a>"; But it does not work. At the top of my userinfo page I would like to take the id passed through the link clicked and use that to search the database and retrieve the array with the userinfo. Using this array I would print to the screen the information stored in that array. Has anyone else seen this type of navigation before and if so could you show me how to get through this?? Thanks a lot in advance.
×
×
  • 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.