Jump to content

ldb358

Members
  • Posts

    199
  • Joined

  • Last visited

    Never

Everything posted by ldb358

  1. what version of php are you using when i run it on 5.3 it works but if i would have to guess i would say your on an older version of php because if you look here http://php.net/manual/en/language.oop5.static.php it says that the first method of calling a static function was added in 5.3
  2. okay post the code and ill take a look
  3. no you should just create one column and store the $tag variable in it and then you'll have a list of tags that you can later search
  4. change the name of them to: <input name="tag[]" type="checkbox" value="accident" /> <input name="tag[]" type="checkbox" value="airport"/> <input name="tag[]" type="checkbox" value="airtoair"/> then you can loop through it like so: $tags = new Array(); foreach($_POST['tag'] as $tag){ if($tag){ tags[] = $tag; } } $tag = implode(',',$tags); then inset the $tag variable in your database as text
  5. UPDATE users SET id=id-1 WHERE id>$post_id Where $post_id = the id of the post deleted
  6. your condition should look like this: if ($random == 0) { $a = 0; $a++; }
  7. try: <?php $data = 'Pulp Fiction'; $out = substr($data, 0, 7); if(strlen($data > 7){ $out .= '...'; } echo $out; ?>
  8. you could do something like this: <?php $string = "The quick brown fox jumps over the moon to discover that it really wasn't the moon at all but a big rock in the ground"; $delimiter = "discover"; $maxlenth = 15; $new = substr($string,strpos($string,$delimiter)-$maxlenth,$maxlenth*2+strlen($delimiter)); ?>
  9. okay thanks i am reading up on openVZ, it seems to be exactly what i was looking for. What exactly do you mean by this? I am assuming you mean site traffic, which should be pretty low as i will only be running a portfolio and blog on it
  10. i dont get what your asking i guess because if the value != 0 that is what it is supposed to output
  11. I currently have a desktop that was great but after i got my laptop has gotten little use, so i am thinking about making it into a vps web server where i will provide the server and my friends will pay for the internet connection the specs are: 750gb hard drive (would like to partion it in to 3 separate vps') 8gb ram 2.2 amd quadcore my questions are: a)Are these specs good enough? (i would assume so but you never know) b)what software would i need to do this?(i want to run a ubuntu server) c)Any other advise?
  12. try: $test = $database->query($status); $row = mysql_fetch_array($test); if($row['status'] == '0'){ if that doesn't work what mysql class are you using?
  13. try adding: $test = $database->query($status); echo $database->error; //check if there is a mysql error var_dump($test); //check if its returning an object
  14. if i understand your question properly you can connect to the same mysql server from different site
  15. you have a typo: $q2 = mysql_query("INSRET INTO `players` (id, timestamp, gameid, players) VALUES ('NULL', 'NULL', '$gameid', '$players')") or die(mysql_error()); //should be $q2 = mysql_query("INSERT INTO `players` (id, timestamp, gameid, players) VALUES ('NULL', 'NULL', '$gameid', '$players')") or die(mysql_error());
  16. your checking whether the object == 0 you need to add: $test = $database->query($status); $row = $test->fetch_object(); if($row->status == '0'){
  17. by links do you mean the ones on the menu bar, side bar or all of them?
  18. hey i just launched my new site and im looking for some feed back both on the design and the content it is located here: http://lanesportfolio.com/blog/ thanks in advance
  19. as stated above use simpleXML a quick example: $xmlfile = 'file.xml'; $xml = simplexml_load_file($xml); $images = array(); foreach($xml->pic as $link){ $images[] = $link->image; }
  20. okay your setting it in the wrong place, what you need to do is replace: session_register($myusername); session_register($mypassword); //with $_SESSION['username'] = $myusername; $_SESSION['password'] = $mypassword; so your final script would look like: <?php ob_start(); $host="localhost"; // Host name $username="xx"; // Mysql username $password="xx"; // Mysql password $db_name="xx"; // Database name $tbl_name="members"; // Table name // Connect to server and select databse. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); // Define $myusername and $mypassword // To protect MySQL injection $myusername = stripslashes($myusername); $mypassword = stripslashes($mypassword); $myusername = mysql_real_escape_string($myusername); $mypassword = mysql_real_escape_string($mypassword); $sql="SELECT * FROM $tbl_name WHERE username='$myusername' and password='$mypassword'"; $result=mysql_query($sql); // Mysql_num_row is counting table row $count=mysql_num_rows($result); // If result matched $myusername and $mypassword, table row must be 1 row if($count==1){ // Register $myusername, $mypassword and redirect to file "login_success.php" $_SESSION['username'] = $myusername; $_SESSION['password'] = $mypassword; header("Location: /clients/".$myusername."/"); } else { echo "Wrong Username or Password"; ob_end_flush(); ?> and your other script should look like: session_start(); if(isset($_SESSION['username']){ header("location:../../index.php"); }
  21. i'm 17 now and when i joined i was 16
×
×
  • 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.