Jump to content

killah

Members
  • Posts

    234
  • Joined

  • Last visited

    Never

Everything posted by killah

  1. I'm making my site as efficient as possible. And mysql query's are never 100% safe to execute with session's etc.
  2. I have not really looked into this matter. But im sure it's also pretty easy. I want to stop multiple login's on same account. But i do not want to use mysql querys. Maybe session registered function to check if the session is registered for that account? I do not want to use cookie's because cookies are not 100% safe to go through. Any idea's or any pointer's on how i can do it?
  3. Clicked the link above. took about 3 - 7 second's to load. The design look's simple but effective. And attractive. Overall i would say 7/10. I normaly do not go this high. But don't count my rating. Count what the others have to say.
  4. Yet again.. i find this much easier: <?php $product = implode(',', $products); $select = mysql_query("SELECT name FROM `products` WHERE `id` IN(".$product.")"); //Reason for only selecting name: //Because why fetch the entire table when we only trying to display one row? //more efficient while ($soc = mysql_fetch_assoc($select)) { echo $soc['name'].'<br>'; } ?>
  5. $q = mysql_query("SELECT name FROM `products` WHERE `id` IN(".$products.")") or die(mysql_error()); while($b = mysql_fetch_assoc($q)) { echo $b['name'].'<br>'; } Reference => MySQL IN() function.
  6. With fair knowledge it's do able. I just do not have time right now to do exactly what you want. Maybe later on i will make some thing if no one else has.
  7. Here's a simply hi low to the way i know it. <?php session_start(); error_reporting( E_ALL ); echo '<h2>Hi Low Game</h2>'; //Settings $max = 10; $min = 1; function show_page() { global $max,$min; echo '<br><br>'; if( isset($_SESSION['hi.lo']) ) { echo 'Winnings: '.$_SESSION['hi.lo'].'<br><br>'; } else { //Do nothing } echo 'Pick a number between '.$min.' & '.$max.'.<br><br> <form action="'.$_SERVER['PHP_SELF'].'" method="post"> <input type="text" name="btn"> <br> <input type="submit" value="Lets Play!"> </form>'; } if( isset($_POST['btn']) ) { $post = abs(@intval($_POST['btn'])); if($post > $max) { echo 'Your number is higher than '.$max.'.'; exit; } if($post < $min) { echo 'Your number is lower than '.$min.'.'; exit; } $srad = rand($min,$max); if($post == $srad) { echo 'You guessed right!'; if( isset($_SESSION['hi.lo']) ) { $_SESSION['hi.lo']++; } else { $_SESSION['hi.lo'] = 1; } } show_page(); } else { show_page(); } ?> Just coded that right now while i was bored.
  8. Step one: # You add a upgrade name, purchase type, upgrade image, type of upgrade and select the houses the upgrade is purchasable for Step two: # You have the upgrade name, purchase type, upgrade image, type of upgrade, selected houses. Now you want to set a different price, will and upkeep per house selected. Step three: # You insert the row's in the table with the price, will, upkeep per house inputed along with the upgrade name, purchase type, upgrade image, type of upgrade and the selected houses My problem is with step two and step three. Step two does not work and i can not asign it to step three. What i am trying to do is explained above. But i will explain in better bellow: I have my first page (step one) where i input upgrade name, purchase type, upgrade type and a checkbox to select multiple houses the upgrades can be purchased for. Then on hittin "Next" button it give's me my second page (step two). In step two i have a while function bringing the selected houses with input's next to them for the will, upkeep, and price. How ever when clicking on the submit taking me to page three (step three). I can not get it there. Because it is going like: 1,2,3,4,5,6,7 While the house id's are like 1,5,6,7,8,9,10 What i want to do is make it so the input's on second page follows the house ID like so Houses: 1,5,6,7,8,9,10 Inputs: 1,5,6,7,8,9,10 Any more info i can explain
  9. Here $str = $arr; echo 'Str: <pre>'; print_r($str); echo '</pre>';
  10. Is anyone going to be able to help me with this? It's very urgent.
  11. Is both the code on the same .php page? and in the same function? If not then it will not work.
  12. I actualy noticed that when i first saw the first page. But since it's solved. Good luck.
  13. Yes i have been requesting alot of help lately. But i have never done anything like this. I have this script: $soc_houses = mysql_query("SELECT hNAME,hID FROM `houses` WHERE `hID` IN(".$house.")"); while($soc = mysql_fetch_assoc($soc_houses)) { echo $soc['hNAME'].' => Price: <input type="text" name="price[]"> | Will: <input type="text" name="will[]"> | UpKeep: <input type="text" name="keep"><br>'; } What i am trying to do is set a different price + will + upkeep per house. It's for a RPG Game. And how would i go about displaying it and inserting it into a different database table?
  14. User table structure: userIDNameAttendance 1Joe1,7,8,9,10,17,18 Now when clicking that a user was at the meeting just add a ,ID to the Attendance table. Make a attendance table like so: meetingIDmeetingTIME 1unix_timestamp() Then go through a call back via the code to display the user's or simply use a left join.
  15. $errno = $soc['oUPGRADES']; if( strpos($errno,$soc['upID']) !== FALSE ) { echo ' <option value="null">'.$soc['upNAME'].' (Already Bought)</option>'; } Work's so far. Just got to second mysql error. So i will post back when fixed. Work's
  16. There's a way to find out who own's the dedicated server and which datacenter it belong's to. Have you ran a whois on the domain to find it's nameserver's?
  17. I would normaly use something like this: if( !isset($_GET['id']) ) { $xid = 'default'; } else { $xid = strtolower($_GET['id']); } switch($xid) { case 'default': include('indexhome.php'); break; case 'page2': include('pages/page2'); break; case 'spage1: include('pagespage1.php'; break; } include('./indexbottom.php');
  18. Problem is $soc['oUPGRADES'] is always updated with more number's. And each time a number is added it put's it like this $OLD = '98,76,3,4'; $new_n = '1'; $NEW = $OLD.','.$new_n; $NEW = '98,76,3,4,1';
  19. switch(strtolower(isset($_GET['id']))) // 'content'
  20. Is there any php function that i can use to check if a number is in a string? I have this code $errno = array($soc['oUPGRADES']); if( in_array($soc['upID'], $errno[0]) ) { echo ' <option value="null">'.$soc['upNAME'].' (Already Bought)</option>'; } but it does not seem to work I am trying to do something like this in other word's. if( 1 is in (9,7,1, ) { //already bought } Any help would be appreciated.
  21. Figured that out already. I have also solved my solution with the above mysql query.
  22. I know what my error mean's. But why? The oID is in the house_owned table. CREATE TABLE IF NOT EXISTS `house_owned` ( `oID` bigint(255) NOT NULL auto_increment, `oHOUSE` int(25) NOT NULL default '0', `oOWNER` int(25) NOT NULL default '0', `oWILL` int(25) NOT NULL default '0', `oUPGRADES` varchar(255) collate latin1_general_ci NOT NULL, `oUPKEEP` int(25) NOT NULL default '0', `oRENTED` int(25) NOT NULL default '0', `oIMAGE` varchar(255) collate latin1_general_ci NOT NULL default '', PRIMARY KEY (`oID`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=76 ; Now tell me oID does not exist
×
×
  • 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.