Jump to content

.josh

Staff Alumni
  • Posts

    14,780
  • Joined

  • Last visited

  • Days Won

    43

Everything posted by .josh

  1. A host is a computer. When you "get a host" that means you pay someone and they let you use some of the space on their computer, use some of the programs on their computer, allow a certain amount of "traffic" (bandwidth) etc.. Apache is a program that runs on the host, to allow people to for instance, go to your website. It turns a regular computer into a "server" as in, it "serves" files etc.. to people who request something from it. So in order to have a webpage up, you need a host with server software on it (apache is the most popular choice atm), and if you want your forum script to run, you need the software that parses it installed on the host also (like asp, php, perl, cgi, etc..). You can set all this up on your own computer if you want, and have people access your webpage by directly accessing your computer. There are "all-in-one" packages out there like wamp and xampp that have everything you need for a basic server setup, including apache, php, mysql (database) and they practically install themselves right out the box. A lot of developers like to setup something like that on their own computer for developing/testing their stuff, but there are a lot of advantages to having someone host your site for you to consider.
  2. probably be better off asking on a law(yer) type forum...
  3. by crop do you mean snip the picture down to 177x120 or do you mean scale it down to 177x120? crop means to ch op it down. scale means to make it smaller.
  4. Basic Database Handling
  5. Well that's because Ajax is not a language it's a method. Therefore people think they are super cool for doing it. WEB 2.0 FTW!!!?!?!!ONE!!?!?!
  6. Oh god. I can't believe you're actually seriously suggesting that.
  7. well it isn't that complicated if you use a clientside language but you're wanting to throw a serverside language into the mix so what do you expect? In a basic ajax tutorial 99% of it is javascript and it's just a couple of functions to set it up and you don't really have to mess with it just c/p it into your file.
  8. If you want someone to write a script for you post asking for it in the freelance section, along with how much you're willing to pay. Yes, pay.
  9. hmm well you could manually close the connection with mysql_close($connection); but php automatically does that when the script is done. Same with the vars. I mean, php is a server-side script same as asp; stuff won't be sent off to the client until the script is done executing, so I don't really think that will make a difference. ...
  10. Well I don't know what to tell you man, there's only 1 reason you get those errors and that's if there's output somewhere. Can't even have blank lines or spaces. Nothing. You claim there's nothing but there's no other reason you'd be getting those errors.
  11. one simple query shouldn't be yielding several second delays like that. You'll have to post some code.
  12. well obviously there's output somewhere, otherwise you wouldn't be getting those errors. Is the file being included in something else?
  13. searched for hours on end, huh... http://www.phpfreaks.com/forums/index.php/topic,37442.0.html
  14. well i can't be sure since you didn't bother to use indentation, but it looks like your delete query isn't in any kind of loop.
  15. yes, "stuff the user will see." you can do any kind of code you want but you can't echo/print anything or have whitespaces before code tags or regular text/html/whatever etc.. before it.
  16. you use it to directly refer to a method or property inside a class, like from another class.
  17. header("Location: http://www.blah.com/somepage.php"); note: can't have any output before sending stuff to header
  18. I interpreted it as him wanting quote being one color, source being another: <?php $database="****"; mysql_connect ("localhost", "****", "****"); @mysql_select_db($database) or die( "Unable to select database"); $result = mysql_query( "SELECT quote,source FROM movies" ) or die("SELECT Error: ".mysql_error()); $num_rows = mysql_num_rows($result); print "<table width=200 border=0>\n"; $color1 = '#ffffff'; $color2 = '#dddddd'; while ($get_info = mysql_fetch_row($result)){ print "<tr>\n"; print "\t<td><font face=arial size=2 color=$color1/>{$get_info[0]}</font><br />"; print "<font face=arial size=2 color=$color2/>{$get_info[1]}</font></td>\n"; print "</tr>\n"; } print "</table>\n"; ?>
  19. though I suggest you look into using xml... <?php // get contents of file into an array $lines = file( "data.txt" ); // store your info in a 2d array foreach($lines as $l) { $data = explode( '×', $l); $row[] = array('date' => $data[0], 'url' => $data[1], 'user' => $data[2], 'desc' => $data[3], 'hits' => $data[4]); } // end foreach // function to sort a 2d array by specified element // taken from http://www.php.net/manual/en/function.sort.php#76547 function msort($array, $id="id", $sort_ascending=true) { $temp_array = array(); while(count($array)>0) { $lowest_id = 0; $index=0; foreach ($array as $item) { if (isset($item[$id])) { if ($array[$lowest_id][$id]) { if ($item[$id]<$array[$lowest_id][$id]) { $lowest_id = $index; } // end if } // end if } // end if $index++; } // end foreach $temp_array[] = $array[$lowest_id]; $array = array_merge(array_slice($array, 0,$lowest_id), array_slice($array, $lowest_id+1)); } // end while if ($sort_ascending) { return $temp_array; } else { return array_reverse($temp_array); } // end else } // end function /******example output**********/ print_r($row); // dumps out your current info echo "<br><br>"; // call msort // msort(array, element, boolean); // true = ascending order, false = descending order $sorted_by_hits = msort($row, 'hits', false); print_r($sorted_by_hits); // /*******end example output ***********/ ?>
  20. in that one line piece of code you just posted you have $rows[0][$key][$fieldname] that's a 3d array as in 3 dimensional.
  21. umm. so is $rows now a 3d array?
  22. try taking off the leading / in $dir $dir = "testfolder/test";
  23. you're not actually calling the function. at the bottom add SureRemoveDir($dir, true);
  24. no don't remove it, because then you aren't calling your function. You need to pass it the right arguments, not just "emptyme"
×
×
  • 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.