-
Posts
14,780 -
Joined
-
Last visited
-
Days Won
43
Everything posted by .josh
-
don't you mean...burned?
-
aww how cute. you should start a siggy/avatar request thread, obsidian! Then you can be like all the kiddies on the game boards!
-
LoL damn! But seriously, I don't think it was microshaft's fault. I think someone bought it from walmart, taped the stuff and then returned it. Then walmart people probably just put it back on the shelf, not even bothering to check it. I used to work at walmart. They do that all the time with returned items that aren't broken etc...
-
[quote author=The Little Guy link=topic=119299.msg488996#msg488996 date=1166632935] Lets take this one step further, and instead of using just # use different symbols, one for light areas of the image, one for dark areas of the image, and others for in between areas, the end result must be an all black colored image, no color at all... just the symbols to emphisize the different shades. [/quote] i stoled your code and made a few rough mods to it : I also limited the dimension to 100x50 in this code, so it will truncate larger pictures. [code] <html> <head> <title>Ascii</title> <style> body{ line-height:12px; font-size:15px; } </style> </head> <body> <?php // array of symbols to use, from "darkest" to "lightest" $symbols = array('#','@','8','O','o',':','.',' '); function getext($filename) { $pos = strrpos($filename,'.'); $str = substr($filename, $pos); return $str; } if(!isset($_POST['submit'])){ ?> <form action="<?echo $_SERVER['PHP_SELF'];?>" method="post"> JPG img URL: <input type="text" name="image"><br> <input type="submit" name="submit" value="Create"> </form> <?php }else{ $image = $_POST['image']; $ext = getext($image); if($ext == ".jpg"){ $img = ImageCreateFromJpeg($image); } else if($ext == ".gif"){ $img = ImageCreateFromGif($image); } $width = 100; //imagesx($img); $height = 50; //imagesy($img); echo "<table cellspacing='0' cellpadding='0'><tr>"; for($h=0;$h<=$height;$h++){ for($w=0;$w<=$width;$w++){ $rgb = ImageColorAt($img, $w, $h); $r = ($rgb >> 16) & 0xFF; $g = ($rgb >> 8) & 0xFF; $b = $rgb & 0xFF; // find out the average from the rgb values $shade = round(($r+$g+$b) / 3); // use the # of symbols to find out range they have $range = 256/(count($symbols)-1); // divide the average by the range to find out what // position in the symbols element to use $pos = round($shade/$range); // assign symbol to variable $symbol = $symbols[$pos]; // echo symbol echo "<td><center><font size = '1'>$symbol</font></center></td>"; if($w == $width){ echo '</tr>'; } } } } echo "</table>"; ?> </body> </html> [/code]
-
[SOLVED] Deleting Information Stored In a Database
.josh replied to netpants's topic in PHP Coding Help
that's fine and dandy if you are the only one going to delete records. But what about giving delete permissions to other people, but you don't want to give them phpmyadmin access? -
[SOLVED] Deleting Information Stored In a Database
.josh replied to netpants's topic in PHP Coding Help
so where is $_POST['id'] being passed from? Only thing I see here is update.php?id=37 at the bottom of your script, which would be passed as $_GET['id'] -
[code] // example retrieval of all info in your db $sql = "select * from table"; $result = mysql_query($sql) or die(mysql_error()); while ($list = mysql_fetch_array($result)) { // make a radio button with the item name next to it. radio button will // pass all of the info associated with the item as an array called [itemname] echo "<input type='radio' name='{$list['itemno']}' value='{$list}'>{$list['itemname']}<br/>"; } [/code]
-
personally i think the main advantage to being self-taught is that i learn the 'right' and/or 'best' way to do things by first doing it all the 'wrong' and/or 'worst' ways first ;D you don't really get that out of schools.
-
seems more like a poll thread to me. poll added. thread moved. self taught. hobby. maybe one day i will make a buck or 2 off it.
-
what kind of website rating do you prefer?
.josh replied to calum.mackenzie's topic in Miscellaneous
i like scale type ratings (like 1-5) star. It provides a way to show an overall average. But ratings should just be an at-a-glance feature to compliment a system for people to make their own praises/bitches about something. It's one thing to see that something has a 1 star or a 5 star; it's quite another to know [i]why[/i] it was given. -
i vote smf. there is a (small) bond between the phpfreak community and the smf community, that i personally hope to see grow in the future.
-
I choose both. I try to incorporate using both in my site, but I take the ajax/js approach: Use it for added features/functionality, but script it to gracefully fall back without it. you should have added a "both" option on your poll.
-
Quick question on finding if its a link in a string
.josh replied to BillyBoB's topic in PHP Coding Help
uh..okay..well you didn't say anything about that in your OP. And even now you're not being very specific. The impression I got is that you have a chunk of data and it has a url in it somewhere but it may or may not have href tags around it, so if it doesn't, then wrap the url in href tags. That's what my example does. If you have an array of data, just put the code in a loop that checks each element. How about you make an example list of what your actual data looks like and post it here, showing [i]every[/i] example of what it should look for and change, vs. not change. -
Quick question on finding if its a link in a string
.josh replied to BillyBoB's topic in PHP Coding Help
[code] <?php // assuming your data looks like this vs. this: // http://www.blah.com vs. <a href='http://www.blah.com'>http://www.blah.com</a> // example $data = "http://www.blah.com"; // data have '<a' in it already? do nothing. It doesn't? add it on $data = (stripos($data, "<a")) ? $data : "<a href = '$data'>$data</a>"; [/code] -
The php help forum is for asking for help when you get stuck writing your own code. For now, I'm moving this to the misc. forum as it seems like you are hoping there is some 3rd party script out there someone might be able to recommend for you. However, if you are looking for someone to write the code for you, you might try making a post in the freelance forum (please read the guidelines before posting).
-
okay founded it.
-
i checked the permissions. they are set to allow global mods to mark as solved. it did not have smods set but i changed that. but still no dice. i still don't see anything. also, i have a test reg user account and i can't see anything on it either.
-
okay maybe i'm blind, but i just can't seem to find this "mark as solved" button. Is it forum specific? Is there some usercp pref i'm supposed to turn on? I tried going to a thread I started but found no button. I tried making a reply to other people's threads and even my own thread, couldn't find a button either.
-
[quote author=artacus link=topic=112560.msg485058#msg485058 date=1166130217] Being the consumate smartass, I retorted, "Narf! I think so Brain. But where are we going to find a rubber hose and a policeman at this hour?" [/quote] hahAHAHahHAHAHA!
-
[code] echo $_SESSION['id'][0]; // echos 1st one echo $_SESSION['id'][1]; // echos 2nd one // echo all of them in a loop foreach ($_SESSION['id'] as $val) { echo "$val <br/>"; } [/code]
-
I'll agree with the expert @ 30 posts thing, but I have to disagree with this: [quote author=artacus link=topic=118570.msg484648#msg484648 date=1166084679] And I think you'd see a big difference between having a "newbie forum"/"php help" and "php help"/"expert forum" [/quote] The descriptions of the forums listed "PHP Help" as "For more advanced questions/users" and the "Newbie Forum" clearly stated "for beginners.." and yet it was still a problem.
-
is this a 1 time thing, or are you looking to be able to be able to in the future change it to something else?
-
by "popup" do you mean a seperate window, or do you mean display something (like an ad or something) and then user has to click on something like "continue to page..." or whatever?
-
And every night you TRY to take OVER the WORLD! ;D Narf.
-
[url=http://www.alamorose.com/crayonviolent/cubed0004.jpg]cartoon 1[/url] [url=http://www.alamorose.com/crayonviolent/cubed0005.jpg]cartoon 2[/url] [url=http://www.alamorose.com/crayonviolent/cubed0006.jpg]cartoon 3[/url]