Jump to content

DeathRay2K

Members
  • Posts

    70
  • Joined

  • Last visited

Everything posted by DeathRay2K

  1. DeathRay2K

    CSS 3.0

    Don't expect it any sooner than 2008.
  2. DeathRay2K

    hide my files?

    Actually, the entire file is laoded to your computer and left there at YouTube.They put the movies in a Flash player so that they can stream them easily, and so that its a little bit more difficult for users to access them, but ifsomeone wants to they can get them anyways.
  3. DeathRay2K

    Teamup!

    Yeah, that's exactly what I thought when I first post, and it turns out that's right...I've seen this happen a dozen times before, always ending with disgruntled team members, because the team leader starts to make some money, and they aren't getting any of it.
  4. DeathRay2K

    Teamup!

    You didn't really answer most of his questions...Are you planning to pay the people who work on it? Obviously you would be making money, and that just doesn't seem fair, especially considering that you have yet to say what exactly you are doing.If you are paying, I may be interested. :)I do web design and am moderately skilled in PHP/SQL.
  5. Personally, I like to use a combination of cookies and session cookies, so that the user can be logged in instantly and stay logged in through multiple sessions.
  6. In the end, big businesses choose ASP.NET, small businesses and individuals choose PHP.Usually, there are always exception.I know quite a bit of PHP, and some ASP.NET, and I find PHP much easier, but not as fast as I would like. I have yet to find something that PHP simply cannot do, though.
  7. Javascript ads add an underline to normal text by altering the style of the text, probably by putting a <span> around the keyword.
  8. Before you go through all that work, you should try this: #navlinks {vertical-align: middle;} Just add that to #navlinks, see if it works...
  9. The phpBB convertor here should be able to do it for you:http://www.simplemachines.org/download/?converters
  10. Simply remove the call to itself to only get the direct children to $parent. You don't need $level this way. You'll then have this: <?phpfunction listCategory($parent = 0){ // where parent of 0 means it's top-level $retval = ""; $indent = "<br />"; for ($i=0; $i<$level; $i++) $indent .= " "; $result = mysql_query("SELECT * FROM categories WHERE parent_id='$parent'"); while ($row = mysql_fetch_assoc($result)) { extract($row); $retval .= $indent . "<a href=\"?c=$category_id\">" . $category_name . "</a>"; } return $retval;}?> Then, to get the children of the id in the query string, just call the function with it as a parameter, i.e: <? listCategory($_GET['c']);?>
  11. Did you set the height of the box (the one that everything is in)? If you didn't it should just resize with the content, including the footer.Can you post the relevant CSS and HTML?
  12. Try Simple Machines Forum. I switched from phpBB2 to SMF a while ago and absolutely don't regret it.
  13. You can use array_walk or array_map to pass the values of an array to a function.If you want to pass it for each $k, just put it before or after the $i loop.
  14. To do that with PHP, it has to be done before any HTML output occurs.If you want to do it after the original page has loaded, you're better off with javascript. If you still want to do it with PHP, it is done like this: <? header('Location: otherfile.php');?> Just remember that in PHP, that has to be done before any HTML output, including empty space.Also, PHP is not a replacement for Javascript. PHP is executed on the server, so there is no interaction with the user on a single page.
  15. Relative paths are perfectly fine.Are you sure that the uploads directory allows uploads? Try chmodding it to 777. If that works then great.I made an uploads script some time ago when I was just getting into PHP. Granted, I dissallowed certain extensions rather than simply only allowing certain mime types, but that can easily be amended: $target_path = "uploads/";$target_path = $target_path . basename($_FILES['uploadedfile']['name']); $allowed_types = array('image/gif', 'image/jpeg', 'image/pjpeg');if($_POST['MAX_FILE_SIZE'] >= filesize($_FILES['uploadedfile']['tmp_name']) && in_array($_FILES['uploadedfile']['type'], $allowed_types)){ if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) { //Success message } else { //Error message }}else{ //Not allowed message} And for the form, you just need something like this: <form enctype="multipart/form-data" action="upload_class.php" method="post"> <input type="hidden" name="MAX_FILE_SIZE" value="5242880" /> Choose a file to upload: <input type="file" name="uploadedfile" /><br /> <input type="submit" value="Upload File" /></form> Simple!Just make sure that permissions for the uploads folder allow uploads!
  16. DeathRay2K

    PHP Call Home

    You could always just include it like this:if((include 'var.php') == 'OK'){ //all good}else{ //no good}
  17. You mean you want the white part to be the same distance from the right edge of the window at all times?Simple.Just give it right: 100px; or whatever and width: auto;
  18. Try it, it works. And without the regex overhead.It takes basename($_SERVER['PHP_SELF']), which gives you something like 'document.php', and replaces '.php' with '', an empty string, leaving you with 'document'.
  19. Or you could use$document = str_replace('.php', '', basename($_SERVER['PHP_SELF']));That should work.
  20. On the top navigation, the hover image, and the current page image don't really go well with the regular image, as the regular image looks like a button, and the other two don't, nor do they bear any resemblance to each other either...Also, when the button shows the current page, the text should be a bit lower.The top border of the left hand navigation doesn't fit with the sides and bottom very well.Finally, the banner image looks kind of stretched, so if you can, you might want to get a larger background image.
  21. I have an O'Reilly reference book, and it doesn't give much notice to heredoc format at all, but at PHP.net there's a lot of info:http://ca.php.net/manual/en/language.types....syntax.heredoc
  22. Actually it doesn't matter what you use, it just has to alphanumeric + underscores and start with a letter.I just used SCRIPT to make it clear that it conatins javascript.
  23. Or you could just use Heredoc.Like this: echo <<<script<script>alert("hey")</script>SCRIPT note that it should be < < < SCRIPT without the spaces, but for some reason the forum won't let me type that.
  24. I like your way, but what should the directory be CHMODed to allow PHP to access the file without allowing the user to do so, and I would recommend using a .htaccess file to have a more friendly user than blah.php?download=62839 could simply be download/file.zip and be redirected to a page for you to download it from.
  25. Easy enough. function percentbar($correct, $total, $width, $height) { $percent = $correct / $total; $percent *= $width; $im = imagecreatetruecolor($width, $height); $green = imagecolorallocate($im, 0, 255, 0); $red = imagecolorallocate($im, 255, 0, 0); imagefilledrectangle($im, -1, 0, $percent, $height - 1, $green); imagefilledrectangle($im, $percent, 0, $width, $height - 1, $red); imagepng($im); imagedestroy($im); }
×
×
  • Create New...