Jump to content

Third_Degree

Members
  • Posts

    281
  • Joined

  • Last visited

    Never

Everything posted by Third_Degree

  1. oh well I guess it wasn't the wrong thread after all, you just changed your post. To answer your first question <?php $str = explode( '.', $stuff ); print $str[0]; ?>
  2. http://phpbench.com indicates that it doesn't matter much. interesting
  3. Whichever library you end up using, you have to make sure the extension is loaded.
  4. What's 'optimized' about it? And why print over echo? Theoretically, echo should be faster than print (because print is a function, echo a construct), though no-one has been able to produce a conclusive benchmark to support it. 1.print is not a function...http://www.php.net/print 2.Also, PHP was born from C, and C uses print... 3.Lastly, echo checks for parameters whereas print does not, so the return value vs. the check evens out timewise (roughly) Single quotes parse faster than double quotes, you can get conclusive proof of that looking at the php source, this is also why i concatenate how I do. Overall, I guess it's just my programming roots in C coming out in PHP.
  5. Well I'll add my two cents I like to call it "pretty but optimized" <?php if ( function( $parameter, $parameter ) ) { print 'Hey ' . $var; } else { print ( 10 / 5 ) + ( 12 / 6 ); } ?> Always print over echo, always single over double quotes, always spaces after parentheses.
  6. <?php if ( empty( $_POST['user'] ) || empty( $_POST['pass'] ) ) { ?> <form action="<?php print $_SERVER['PHP_SELF']; ?>" method="post"> Username: <input type="text" name="user" /><br /> Password: <input type="password" name="pass" /><br /> <input type="submit" value="Log In" /> </form> <?php die( ); } if ( $_POST['user'] == 'CorrectUser' && $_POST['pass'] == 'CorrectPass' ) { print 'Correct!'; } else { print 'Incorrect'; } ?>
  7. well if you open the file with the file() function, moving around an array is easy...
  8. I don't think he was really asking for that, he already has the zip codes and mentioned nothing about distance. Anyway just get all the zip codes out of the db and use php to compare the strings.
  9. This thread probably should have been put in javascript, but i agree with ratcateme, if you didn't know that, start googling for javascript and draggable (is that a word?) elements.
  10. Use the pdf library. http://php.net/pdf_begin_document
  11. http://php.net/fseek http://php.net/rewind
  12. Well if the server's deciding what to show you, there's not much you can do. Also, I copied the source of both of the pages (original and test.php) and ran a comparison script and they were the same...
  13. All you have to do is change your url to http://111.com/update.php?id=whatever
  14. <link href="/inc/css/site.css" media="screen" type="text/css" rel="stylesheet"> That line's your problem I think.
  15. This as I said is a big job. Easiest way to do it is look in the original page source to see where it needs the css or whatever, and str_replace that another page on your server that forms a curl request to that page.
  16. umm...something like this...not sure what you're trying to do $file = file( 'file.txt' ); foreach( $file as $line ) { run_function( $line, '1', '1' ); }
  17. $sql = "INSERT INTO `transactions` ( `userid`, `accountid`, `amount`, `description`, `date` ) VALUES ( '" . $userid . "', '" . $accountid . "', '" . $amount . "', '" . $description . "', '" . date( 'Y-m-d' ) . "'" ); mysql_query( $sql ) or die( mysql_error( ) ); Try it?
  18. Well clearly somewhere in the source a tag is looking for css/javascript/something from another page on their original server which is not found on yours. You'll need to parse the html somehow and then make another request to the site for the css or whatever it is.
  19. the file() function already returns an array...
  20. Why make them wait longer then they have to, pretty inconvenient. Well thorpe already mentioned it's not possible, but the OP still wants it, so I'd tried to help. I agree it's a waste of time though.
  21. well, you could fake it. Use CSS to make everything invisible, display your progress bar, then after how ever long your progress bar takes, make the javascript show all your content by changing the css.
×
×
  • 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.