
ShogunWarrior
Members-
Posts
528 -
Joined
-
Last visited
Never
Everything posted by ShogunWarrior
-
Google php captcha and you will turn up some very interesting things.
-
escapeshellarg is a function, however it is only supposed to be used if the string is going to be passed as an argument to exec or system not to a database function.
-
[SOLVED] Adding a decimal to an output echo
ShogunWarrior replied to suttercain's topic in PHP Coding Help
boo_lolly's code will work. However, I tested my original code again and there isn't really a reason it should return 0. -
I just get Processing..Please wait. And then nothing.
-
[SOLVED] Adding a decimal to an output echo
ShogunWarrior replied to suttercain's topic in PHP Coding Help
echo "<tr class=\"$class\">\n"; echo "<td>$row[sub_class]</td>\n"; echo "<td>$row[disp] L</td>\n"; echo "<td>".sprintf( '%01.1f',$row[fuel])."</td>\n"; <--------------- THIS IS WHERE I NEED THE DECIMAL POINT echo "</tr>\n"; -
Just look up classes, here's an example of how you would implement your first menu class: <?php class Cmenu { var $links = array(); function Cmenu() {} function AddLink($url,$title) { $this->links[] = array($url,$title); } function display() { echo '<ul>'; foreach( $this->links as $link ) { echo '<li> <a href="'.$link[0].'" title="'.$title[1].'">'.$link[1].'</a> </li>' . "\n"; } echo '</ul>'; } } $new_menu->display(); would show the menu.
-
Looks like a bit of a joke. "Chuck Norris" namespace. "Whore" and "Cop" in your examples, incorrectly spelled operators... Edit: Ah, it is a joke, but it still doesn't work for me.
-
Not really, only as much as error_reporting(0); Will "solve" the problem of writing all sorts of terrible code.
-
The overall design is quite nice, more function would improve it. PS: Your signature link doesn not work (not formatted properly).
-
Out of Curiosity: Can You Make Anchors in PHP (like in HTML)
ShogunWarrior replied to suttercain's topic in PHP Coding Help
In your output, to place an anchor which you should be able to jump to you would write: <a name="nameofanchor"></a> And to make a link to that anchor: <a href="#nameofanchor">Link to anchor</a> -
PHP5 will give warnings with different things like static class functions etc. and it is hassle to switch over so that suggestion isn't so good. However, you could probably download the source, find the file with the version number in it, edit it and compile it.
-
I had this problem with my old host and you won't be able to make any remote requests (RPC/FSOCK/FOPEN) until your host fixes this.
-
How to convert " & and ' to a format that can be validated
ShogunWarrior replied to AdRock's topic in PHP Coding Help
Look into: http://www.php.net/htmlentities and http://www.php.net/htmlspecialchars -
Just do the following and add any pages you want into case statements: switch( $_GET['c'] ) { case "test":{ include('test.php'); break; } case "home": default: { include('home.php'); } }
-
Do you mean "un" include something. AFAIK that isn't possible because including by definition means you are inserting the code into the current script which obviously can't be reversed.
-
[SOLVED] Handling HTTP Basic Authentication with PHP
ShogunWarrior replied to rtoscano's topic in PHP Coding Help
Have a look at http://www.daviddoranmedia.com/articles/securing-your-downloads which uses Apache Deny All and PHP to grant access to files. -
AES / 3-DES / Blowfish.
-
That code is in my signature. It is (I think) pretty well obfuscated (muddle up) code which, when corrected very slightly will output a simple message.
-
Couldn't you do something safe the likes of: <?php function op_test( $operator, $x, $y ) { switch( $operator ) { case '>':{ return (($x>$y)?(true):(false)); } case '<':{ return (($x<$y)?(true):(false)); } case '=':{ return (($x==$y)?(true):(false)); } default:{ return false; } } } //And then use it like this: if( op_test($operator,$x,$y) ) { echo 'hi'; } ?>
-
You should include a link back to styleshout in your credits, as the template designer requested.
-
You could use the stream/file functions to read from it as a socket, and stop at 25 lines. So, something like: $f = fopen('http://site.com/page.php','r'); for( $i=0;$i<25,!feof($f);$i++ ) { //Do something with line $line = fgets($f); } Probably not working code, I don't know the f* functions well for remote pages.
-
If you can manually create (via FTP/shell) a .htaccess file put it in the main directory with: AddType application/x-httpd-php .htm .html
-
Get 7zip at http://www.7-zip.org/ which supports Zip, gZip and Tar which is what you want.
-
Could you fill the table with the cos() and sin() values for each row? I am willing to bet that it would cut out ALOT of work. From what I see in the query it has to compute sin, cos and rad->degree values for each row and that must take up quite a bit of query time. If you could pre-compute the values AFAIK it would remove alot of computation and you could index those columns, at the moment no indexes are being used.
-
Have a look at: http://www.daviddoranmedia.com/articles/securing-your-downloads which uses Apache Htaccess and PHP.